@arcgis/core 5.0.0-next.35 → 5.0.0-next.37

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 (357) hide show
  1. package/WebLinkChart.js +1 -1
  2. package/analysis/ShadowCast/types.d.ts +2 -0
  3. package/applications/Components/analysisUtils.d.ts +1 -0
  4. package/applications/Components/analysisUtils.js +1 -1
  5. package/arcade/arcadeAsyncRuntime.js +1 -1
  6. package/arcade/arcadeCompiler.js +1 -1
  7. package/arcade/featureSetUtils.js +1 -1
  8. package/arcade/featureset/actions/Adapted.js +1 -1
  9. package/arcade/featureset/actions/AttributeFilter.js +1 -1
  10. package/arcade/featureset/actions/GroupBy.js +1 -1
  11. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  12. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  13. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  14. package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
  15. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  16. package/arcade/featureset/support/FeatureSet.js +1 -1
  17. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  18. package/assets/esri/core/workers/RemoteClient.js +1 -1
  19. package/assets/esri/core/workers/chunks/014dbe6fa93a277b08f7.js +1 -0
  20. package/assets/esri/core/workers/chunks/06462b267ff8d5984882.js +1 -0
  21. package/assets/esri/core/workers/chunks/{b48bb38e5d60fc7a9097.js → 08ef90e3fcfd4eda4301.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{fa01d1813fa78034526e.js → 0a5427127634738aa239.js} +1 -1
  23. package/assets/esri/core/workers/chunks/0a58b57e1777a8b0ea23.js +1 -0
  24. package/assets/esri/core/workers/chunks/{7115c52e22b7becff8de.js → 103153951ba312dc5e9e.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{c7c721de93bc8688e13c.js → 1d4ea8db272655c0608c.js} +1 -1
  26. package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +1 -0
  27. package/assets/esri/core/workers/chunks/1de216d9850c39c1735d.js +1 -0
  28. package/assets/esri/core/workers/chunks/20e4243ea563d05a5256.js +1 -0
  29. package/assets/esri/core/workers/chunks/262232437d37a7460b11.js +1 -0
  30. package/assets/esri/core/workers/chunks/{fafbacf2467e6883b6c9.js → 28db329528def851efd7.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{2367bd1cb34799a3f08a.js → 30184e39129d9c66ea54.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{f55328aabf84770c8e6a.js → 328106e181e5957ceaa5.js} +1 -1
  33. package/assets/esri/core/workers/chunks/48e2737182c75005fb8f.js +1 -0
  34. package/assets/esri/core/workers/chunks/{d3db7244fac7398cc700.js → 4b6a44c6265c8959abd8.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{a372d9af43ade7c6314c.js → 52c8687b473c9953c2f2.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{63933cbcb5c12df09715.js → 59ce992d3a5e7c32b9fb.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{c9c2e00fed979c21e2f0.js → 5e30acfda04f7fc2b676.js} +1 -1
  38. package/assets/esri/core/workers/chunks/6330d8767ba1d5329daa.js +1 -0
  39. package/assets/esri/core/workers/chunks/640085b5ade5c7f16228.js +1 -0
  40. package/assets/esri/core/workers/chunks/690a40d2eef52bfc149f.js +1 -0
  41. package/assets/esri/core/workers/chunks/727804cf901094b1d620.js +1 -0
  42. package/assets/esri/core/workers/chunks/{dd34d56caafa38d4b8e4.js → 7aa730e5ac7b268e3c98.js} +1 -1
  43. package/assets/esri/core/workers/chunks/8c271e9272e4eaf1325a.js +1 -0
  44. package/assets/esri/core/workers/chunks/{2a0fe1aede5c68374ccf.js → 8ec238b5b59ef18a1713.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{f1dfb1323d50247e80f9.js → 9110287f272141f60c35.js} +1 -1
  46. package/assets/esri/core/workers/chunks/951a3442d4342539f2ea.js +1 -0
  47. package/assets/esri/core/workers/chunks/9664d9e679abc41f6c42.js +1 -0
  48. package/assets/esri/core/workers/chunks/{2921f05a40fda12f9f81.js → a00bba1c7cbf8cd7892c.js} +1 -1
  49. package/assets/esri/core/workers/chunks/a716b8fdeda4e16f03ab.js +1 -0
  50. package/assets/esri/core/workers/chunks/aead7c9830fa310e5b53.js +1 -0
  51. package/assets/esri/core/workers/chunks/{1fa55d4c4b092a98bdd7.js → b56c07c0b43cb1999070.js} +1 -1
  52. package/assets/esri/core/workers/chunks/b59be95949445ff5afab.js +1 -0
  53. package/assets/esri/core/workers/chunks/b6dec5dfdeca54bae88d.js +1 -0
  54. package/assets/esri/core/workers/chunks/{6afd59412bfc134bdf75.js → c052fb8c952cda0b5d13.js} +1 -1
  55. package/assets/esri/core/workers/chunks/c5967133f3ba34a883f8.js +1 -0
  56. package/assets/esri/core/workers/chunks/{4356274cfa477eb6d749.js → cda5c95fd49b8901f7d4.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{82cc758bddd9f8397b9f.js → ce8fc1ca229d53a4b68d.js} +8 -8
  58. package/assets/esri/core/workers/chunks/{f2ebd6471e1259a6eac0.js → ce99abfdcd71ff9e4e36.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{726a797f5df7eeee0b3d.js → d786b17cc9062b1450ac.js} +1 -1
  60. package/assets/esri/core/workers/chunks/dd105d6e0fcedee32644.js +1 -0
  61. package/assets/esri/core/workers/chunks/{2e76fbd3c874300fc4a7.js → de3da4d31a7529761565.js} +1 -1
  62. package/assets/esri/core/workers/chunks/e1148067ceae7d9eaaf8.js +1 -0
  63. package/assets/esri/core/workers/chunks/{b536fdb655ad293d9024.js → e501d68a1464805c4b4e.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{33431e8131f6017de2f9.js → e7f4d135ef9665de1468.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{97650ee3d0eecb69ccbb.js → e9bc3c6482ba778c9349.js} +39 -39
  66. package/assets/esri/core/workers/chunks/{7804be2f5b3d86188a24.js → edc3d98f33d7bf959154.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{0446562aee0639c61485.js → ee67c8a7c1f8b482cd99.js} +1 -1
  68. package/assets/esri/core/workers/chunks/eefad79be500667af96e.js +1 -0
  69. package/assets/esri/core/workers/chunks/{2b7f9a57a2cfbc108673.js → f1b99529e2055873b65a.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{abb05a903440d97a6a74.js → f441fc74451330384fb0.js} +1 -1
  71. package/assets/esri/core/workers/chunks/f609b256df9eb3803464.js +1 -0
  72. package/assets/esri/core/workers/chunks/f693a4d97b2762d0e6ff.js +1 -0
  73. package/assets/esri/core/workers/chunks/f8caceeaa14d99c35526.js +1 -0
  74. package/assets/esri/core/workers/chunks/f97a7cb367634353177d.js +1 -0
  75. package/assets/esri/core/workers/chunks/febce0d80f019dc2a427.js +1 -0
  76. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  77. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  78. package/assets/esri/themes/base/widgets/_Attribution.scss +1 -0
  79. package/assets/esri/themes/dark/main.css +1 -1
  80. package/assets/esri/themes/light/main.css +1 -1
  81. package/assets/esri/themes/light/view.css +1 -1
  82. package/chunks/CloudsComposition.glsl.js +1 -1
  83. package/chunks/ComponentShader.glsl.js +2 -2
  84. package/chunks/DefaultMaterial.glsl.js +1 -1
  85. package/chunks/GaussianSplat.glsl.js +2 -2
  86. package/chunks/Laserlines.glsl.js +1 -1
  87. package/chunks/Magnifier.glsl.js +1 -1
  88. package/chunks/Path.glsl.js +1 -1
  89. package/chunks/RealisticTree.glsl.js +1 -1
  90. package/chunks/Terrain.glsl.js +34 -36
  91. package/chunks/WaterSurface.glsl.js +1 -1
  92. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  93. package/chunks/arcgis-knowledge-client-core.js +1 -1
  94. package/chunks/boundedPlane.js +1 -1
  95. package/chunks/cameraUtilsSpherical.js +1 -1
  96. package/chunks/vec32.js +1 -1
  97. package/chunks/vec42.js +1 -1
  98. package/config.js +1 -1
  99. package/core/has.js +1 -1
  100. package/core/iteratorUtils.js +1 -1
  101. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  102. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  103. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  104. package/geometry/support/aaBoundingRect.js +1 -1
  105. package/geometry/support/buffer/BufferView.js +1 -1
  106. package/geometry/support/buffer/internals/Vec4.js +1 -1
  107. package/geometry/support/lineSegment.js +1 -1
  108. package/geometry/support/meshUtils/merge.js +1 -1
  109. package/geometry/support/sphere.js +1 -1
  110. package/interfaces.d.ts +143 -5
  111. package/kernel.js +1 -1
  112. package/layers/GaussianSplatLayer.js +1 -1
  113. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  114. package/layers/IntegratedMeshLayer.js +1 -1
  115. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  116. package/layers/VoxelWasmPerSceneView.js +1 -1
  117. package/layers/knowledgeGraph/layerUtils.js +1 -1
  118. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  119. package/layers/support/csvUtils.js +1 -1
  120. package/layers/video/VideoController.js +1 -1
  121. package/layers/voxel/VoxelVolume.js +1 -1
  122. package/package.json +5 -5
  123. package/rest/knowledgeGraph/DataModel.js +1 -1
  124. package/rest/knowledgeGraph/GraphDataModelSingletonOperationResult.d.ts +4 -0
  125. package/rest/knowledgeGraph/GraphDataModelSingletonOperationResult.js +5 -0
  126. package/rest/knowledgeGraph/GraphProperty.js +1 -1
  127. package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js +1 -1
  128. package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
  129. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
  130. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelFactories.js +1 -1
  131. package/rest/knowledgeGraphService.d.ts +3 -0
  132. package/rest/knowledgeGraphService.js +1 -1
  133. package/support/revision.js +1 -1
  134. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  135. package/views/2d/interactive/SegmentLabels2D.js +1 -1
  136. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  137. package/views/3d/FocusAreasView.js +1 -1
  138. package/views/3d/GroundView3D.js +1 -1
  139. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  140. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  141. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  142. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  143. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  144. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  145. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  146. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  147. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  148. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  149. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  150. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  151. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  152. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  153. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  154. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  155. package/views/3d/camera/constraintUtils/distance.js +1 -1
  156. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  157. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  158. package/views/3d/environment/CloudsParameters.js +1 -1
  159. package/views/3d/environment/EnvironmentManager.js +1 -1
  160. package/views/3d/environment/Fog.js +1 -1
  161. package/views/3d/environment/MarsAtmosphere.js +1 -1
  162. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  163. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  164. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  165. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  166. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  167. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  168. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  169. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  170. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  171. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  172. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  173. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  174. package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
  175. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  176. package/views/3d/layers/DrapedSubView3D.js +1 -1
  177. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  178. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  179. package/views/3d/layers/I3SMeshView3D.js +1 -1
  180. package/views/3d/layers/ImagerySubView3D.js +1 -1
  181. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  182. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  183. package/views/3d/layers/RouteLayerView3D.js +1 -1
  184. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  185. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  186. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  187. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  188. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  189. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  190. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  191. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  192. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  193. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  194. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  195. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  196. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  197. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  198. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  199. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  200. package/views/3d/state/ConstraintsManager.js +1 -1
  201. package/views/3d/state/Frustum.js +1 -1
  202. package/views/3d/state/ViewStateManager.js +1 -1
  203. package/views/3d/state/controllers/FovController.js +1 -1
  204. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  205. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  206. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  207. package/views/3d/support/cameraUtils.js +1 -1
  208. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  209. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
  210. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  211. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  212. package/views/3d/support/intersectionUtils.js +1 -1
  213. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  214. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  215. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  216. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  217. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  218. package/views/3d/support/viewpointUtils.js +1 -1
  219. package/views/3d/terrain/Overlay.js +1 -1
  220. package/views/3d/terrain/OverlayManager.js +1 -1
  221. package/views/3d/terrain/OverlayRenderer.js +1 -1
  222. package/views/3d/terrain/PatchRenderData.js +1 -1
  223. package/views/3d/terrain/ScaleRangeQueries.js +1 -1
  224. package/views/3d/terrain/SphericalPatch.js +1 -1
  225. package/views/3d/terrain/TerrainRenderer.js +1 -1
  226. package/views/3d/terrain/TerrainSurface.js +1 -1
  227. package/views/3d/terrain/TextureFader.js +1 -1
  228. package/views/3d/terrain/TextureReference.js +1 -1
  229. package/views/3d/terrain/Tile.js +1 -1
  230. package/views/3d/terrain/TileCompositor.js +1 -1
  231. package/views/3d/webgl/RenderCamera.js +1 -1
  232. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +1 -1
  233. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  234. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  235. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  236. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  237. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +4 -7
  238. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
  239. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +6 -6
  240. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +4 -4
  241. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +19 -15
  242. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
  243. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +1 -1
  244. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  245. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +5 -5
  246. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +14 -14
  247. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +16 -37
  248. package/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js +2 -2
  249. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  250. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  251. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  252. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  253. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  254. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  255. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  256. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  257. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  258. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  259. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  260. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  261. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  262. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  263. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  264. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  265. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  266. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  267. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  268. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  269. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  270. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  271. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  272. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  273. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  274. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  275. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  276. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  277. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  278. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  279. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  280. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  281. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  282. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  283. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  284. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  285. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  286. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  287. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  288. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  289. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  290. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  291. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +1 -1
  292. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  293. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  294. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  295. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  296. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  297. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  298. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  299. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +9 -10
  300. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  301. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  302. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  303. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  304. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  305. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  306. package/views/3d/webgl-engine/shaders/ensureColor4.js +1 -1
  307. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +5 -5
  308. package/views/GroundView.js +1 -1
  309. package/views/SceneView.js +1 -1
  310. package/views/analysis/ElevationProfile/elevationProfileVisualizationUtils.js +1 -1
  311. package/views/interactive/GraphicManipulator.js +1 -1
  312. package/views/interactive/coordinateHelper.js +1 -1
  313. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  314. package/views/interactive/sketch/constraints.js +1 -1
  315. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  316. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  317. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  318. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  319. package/views/layers/LayerView.js +1 -1
  320. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  321. package/views/support/GroundElevationSampler.js +1 -1
  322. package/views/support/LayerViewManager.js +1 -1
  323. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  324. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  325. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  326. package/views/support/geometry3dUtils.js +1 -1
  327. package/webmap/utils.js +1 -1
  328. package/widgets/Sketch/SketchViewModel.js +1 -1
  329. package/widgets/support/SelectionList.js +1 -1
  330. package/assets/esri/core/workers/chunks/032444974011118127d7.js +0 -1
  331. package/assets/esri/core/workers/chunks/05e55118dc0023d500fc.js +0 -1
  332. package/assets/esri/core/workers/chunks/089221bac1f019692f48.js +0 -1
  333. package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +0 -1
  334. package/assets/esri/core/workers/chunks/15c1a48e8cd2a8882d85.js +0 -1
  335. package/assets/esri/core/workers/chunks/1b9e7d416c9f00e020bb.js +0 -1
  336. package/assets/esri/core/workers/chunks/1bfe0b2bf38d4dee7fd6.js +0 -1
  337. package/assets/esri/core/workers/chunks/27bd88e1101873d4ce12.js +0 -1
  338. package/assets/esri/core/workers/chunks/483dc4ee5d73cdfe6229.js +0 -1
  339. package/assets/esri/core/workers/chunks/53d95ba86d010231fc4e.js +0 -1
  340. package/assets/esri/core/workers/chunks/7d3e665613927904ba4f.js +0 -1
  341. package/assets/esri/core/workers/chunks/a5f2da24497349239648.js +0 -1
  342. package/assets/esri/core/workers/chunks/a7b1b42bdb9cb9ecac45.js +0 -1
  343. package/assets/esri/core/workers/chunks/acaaefd4997316d319b8.js +0 -1
  344. package/assets/esri/core/workers/chunks/ad138b989c2c7a1168ac.js +0 -1
  345. package/assets/esri/core/workers/chunks/cc7c37f9ed3f831fd25c.js +0 -1
  346. package/assets/esri/core/workers/chunks/d14bd320f72d8e8a0ad8.js +0 -1
  347. package/assets/esri/core/workers/chunks/d86e59da76eea888ba86.js +0 -1
  348. package/assets/esri/core/workers/chunks/d8975dd7b85b5d065ee4.js +0 -1
  349. package/assets/esri/core/workers/chunks/de99c4fd1582a8e610cf.js +0 -1
  350. package/assets/esri/core/workers/chunks/ded3ef385d5a3a2ec8ca.js +0 -1
  351. package/assets/esri/core/workers/chunks/e3a994587f9b2e88db85.js +0 -1
  352. package/assets/esri/core/workers/chunks/eab0938d4ad7d7cc7309.js +0 -1
  353. package/assets/esri/core/workers/chunks/ed1dabed10ff9f4e0369.js +0 -1
  354. package/assets/esri/core/workers/chunks/ef5b13ee3362763c1096.js +0 -1
  355. package/assets/esri/core/workers/chunks/effbc4d240752e8ba0ab.js +0 -1
  356. package/assets/esri/core/workers/chunks/f403d8e414766fab2936.js +0 -1
  357. package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/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{b as s,D as a,l as h,d as o,e as n,t as r,j as c,f as _,g as p,i as m,n as f}from"../../../../chunks/vec32.js";import{create as d,clone as l,UNIT_Y as v,UNIT_X as M,UNIT_Z as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{angle as u,slerp as w}from"../../support/mathUtils.js";class y{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=d(),this._pitch=0,this._yaw=0,this._distance=0,this.direction=l(V),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(1===this.viewingMode){const e=(s(this.center)+s(t.center))/2;i.pan=u(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 h=Math.abs(t._pitch-this._pitch);i.rotate=Math.max(e,h),i.fov=t.fov-this.fov,i.sourceZoom=this._distance,i.targetZoom=t._distance}interpolate(i,e,s){1===this.viewingMode?w(i.center,e.center,s.pan,this.center):h(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 o=e._yaw;Math.abs(o-a)>=Math.PI&&(a+=2*(a<o?1:-1)*Math.PI),this._yaw=t(a,o,s.rotate),this._fov=t(i.fov,e.fov,s.fov)}copyFrom(t){o(this.center,t.center),this._pitch=t.pitch,this._yaw=t.yaw,this._distance=t.distance,o(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,S);o(this.center,t.center),n(j,t.center,t.eye),r(j,j,i),r(I,t.up,i),this._distance=s(j),0!==this._distance&&(j[0]/=this._distance,j[1]/=this._distance,j[2]/=this._distance),this._pitch=P(j),this._yaw=z(j,I),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,S);i(e,e),this._axisAngleVec3(O,this._pitch-Math.PI/2,V,j),this._axisAngleVec3(T,this._yaw,j,j),this._axisAngleVec3(O,this._pitch-Math.PI/2,T,I),this._axisAngleVec3(T,this._yaw,I,I),c(j,j,this._distance),r(j,j,e),r(I,I,e),t.center=this.center,t.eye=n(j,this.center,j),t.up=I,t.fov=this._fov}_axisAngleVec3(t,i,e,s){const a=Math.cos(i),h=Math.sin(i);return c(x,e,a),_(A,t,e),c(A,A,h),c(b,t,(1-a)*p(t,e)),m(s,m(s,x,A),b)}_lookAtOrientation(t,i=e()){return this._upAtLookAt(t,b),_(x,this.direction,b),f(x,x),0===x[0]&&0===x[1]&&0===x[2]&&o(x,O),_(A,b,x),f(A,A),i[0]=x[0],i[1]=A[0],i[2]=b[0],i[3]=x[1],i[4]=A[1],i[5]=b[1],i[6]=x[2],i[7]=A[2],i[8]=b[2],i}_upAtLookAt(t,i){return 2===this.viewingMode?o(i,T):f(i,t)}}function P(t){return Math.PI-u(T,t)}function z(t,i){const e=k;return Math.abs(i[2])<.5?(o(e,i),t[2]>0&&c(e,e,-1)):o(e,t),_(A,e,T),f(A,A),u(O,A,T)}const x=d(),A=d(),b=d(),j=d(),I=d(),k=d(),T=g,V=v,O=M,S=e();export{y 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{b as s,C as a,l as h,d as o,e as n,t as r,j as c,f as _,g as p,i as m,n as f}from"../../../../chunks/vec32.js";import{create as d,clone as l,UNIT_Y as v,UNIT_X as M,UNIT_Z as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{angle as u,slerp as w}from"../../support/mathUtils.js";class y{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=d(),this._pitch=0,this._yaw=0,this._distance=0,this.direction=l(V),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(1===this.viewingMode){const e=(s(this.center)+s(t.center))/2;i.pan=u(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 h=Math.abs(t._pitch-this._pitch);i.rotate=Math.max(e,h),i.fov=t.fov-this.fov,i.sourceZoom=this._distance,i.targetZoom=t._distance}interpolate(i,e,s){1===this.viewingMode?w(i.center,e.center,s.pan,this.center):h(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 o=e._yaw;Math.abs(o-a)>=Math.PI&&(a+=2*(a<o?1:-1)*Math.PI),this._yaw=t(a,o,s.rotate),this._fov=t(i.fov,e.fov,s.fov)}copyFrom(t){o(this.center,t.center),this._pitch=t.pitch,this._yaw=t.yaw,this._distance=t.distance,o(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,S);o(this.center,t.center),n(j,t.center,t.eye),r(j,j,i),r(I,t.up,i),this._distance=s(j),0!==this._distance&&(j[0]/=this._distance,j[1]/=this._distance,j[2]/=this._distance),this._pitch=P(j),this._yaw=z(j,I),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,S);i(e,e),this._axisAngleVec3(O,this._pitch-Math.PI/2,V,j),this._axisAngleVec3(T,this._yaw,j,j),this._axisAngleVec3(O,this._pitch-Math.PI/2,T,I),this._axisAngleVec3(T,this._yaw,I,I),c(j,j,this._distance),r(j,j,e),r(I,I,e),t.center=this.center,t.eye=n(j,this.center,j),t.up=I,t.fov=this._fov}_axisAngleVec3(t,i,e,s){const a=Math.cos(i),h=Math.sin(i);return c(x,e,a),_(A,t,e),c(A,A,h),c(b,t,(1-a)*p(t,e)),m(s,m(s,x,A),b)}_lookAtOrientation(t,i=e()){return this._upAtLookAt(t,b),_(x,this.direction,b),f(x,x),0===x[0]&&0===x[1]&&0===x[2]&&o(x,O),_(A,b,x),f(A,A),i[0]=x[0],i[1]=A[0],i[2]=b[0],i[3]=x[1],i[4]=A[1],i[5]=b[1],i[6]=x[2],i[7]=A[2],i[8]=b[2],i}_upAtLookAt(t,i){return 2===this.viewingMode?o(i,T):f(i,t)}}function P(t){return Math.PI-u(T,t)}function z(t,i){const e=k;return Math.abs(i[2])<.5?(o(e,i),t[2]>0&&c(e,e,-1)):o(e,t),_(A,e,T),f(A,A),u(O,A,T)}const x=d(),A=d(),b=d(),j=d(),I=d(),k=d(),T=g,V=v,O=M,S=e();export{y 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{d as e,e as r,i as t,D as n,E as o}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{Sphere as s}from"../../../../geometry/support/sphere.js";import{defaultConstraintOptions as a,interactionDirectionTowardsConstraintMinimization as f,adjustRangeForInteraction as m}from"./common.js";function u(e,r,t=a){if(!e.state.isLocal)return 0;const n=e.state.constraints.distance;if(!e.pointsOfInterest.surfaceOrigin.renderLocation||n===1/0)return 0;g.min=0,g.max=n,d(e,t,g);const o=y(e,r),i=g.max-o;return i>=-1e-6?0:i}function p(n,o,i=a){const m=u(n,o,i);if(0===m)return!1;const p=n.pointsOfInterest.surfaceOrigin;if(!p.renderLocation)return!1;const d=y(n,o)+m,g=e(x,o.eye),C=f(o,i.interactionDirection,l(o,p.renderLocation,j),O);if(!new s(p.renderLocation,d).intersectRay(c(o.eye,C),I))return!1;o.eye=I;const h=r(L,o.eye,g);o.center=t(I,o.center,h);const v=n.renderCoordsHelper.getAltitude(o.center),D=n.renderCoordsHelper.intersectInfiniteManifold(o.ray,v,I);return null!=D&&(o.center=D),!0}function d(e,r,t){const n=r.interactionType;if(0===n)return;const{min:o,max:i}=t,{interactionStartCamera:c,interactionFactor:s}=r;if(!c)return;const a=1===n||4===n,f=u(e,c),p=0===f?0:y(e,c);t.min=o,t.max=i;m(f,p,a,s,.05*p,t)}function y(e,r){const t=e.pointsOfInterest.surfaceOrigin;return t.renderLocation?n(r.eye,t.renderLocation):0}function l(e,r,t){return o(t,e.eye,r)}const g={min:0,max:0},x=i(),L=i(),O=i(),j=i(),I=i();export{p as applyDistanceConstraint,u as getDistanceConstraintError};
5
+ import{d as e,e as r,i as t,C as n,D as o}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{Sphere as s}from"../../../../geometry/support/sphere.js";import{defaultConstraintOptions as a,interactionDirectionTowardsConstraintMinimization as f,adjustRangeForInteraction as m}from"./common.js";function u(e,r,t=a){if(!e.state.isLocal)return 0;const n=e.state.constraints.distance;if(!e.pointsOfInterest.surfaceOrigin.renderLocation||n===1/0)return 0;g.min=0,g.max=n,d(e,t,g);const o=y(e,r),i=g.max-o;return i>=-1e-6?0:i}function p(n,o,i=a){const m=u(n,o,i);if(0===m)return!1;const p=n.pointsOfInterest.surfaceOrigin;if(!p.renderLocation)return!1;const d=y(n,o)+m,g=e(x,o.eye),I=f(o,i.interactionDirection,l(o,p.renderLocation,j),O);if(!new s(p.renderLocation,d).intersectRay(c(o.eye,I),C))return!1;o.eye=C;const h=r(L,o.eye,g);o.center=t(C,o.center,h);const v=n.renderCoordsHelper.getAltitude(o.center),D=n.renderCoordsHelper.intersectInfiniteManifold(o.ray,v,C);return null!=D&&(o.center=D),!0}function d(e,r,t){const n=r.interactionType;if(0===n)return;const{min:o,max:i}=t,{interactionStartCamera:c,interactionFactor:s}=r;if(!c)return;const a=1===n||4===n,f=u(e,c),p=0===f?0:y(e,c);t.min=o,t.max=i;m(f,p,a,s,.05*p,t)}function y(e,r){const t=e.pointsOfInterest.surfaceOrigin;return t.renderLocation?n(r.eye,t.renderLocation):0}function l(e,r,t){return o(t,e.eye,r)}const g={min:0,max:0},x=i(),L=i(),O=i(),j=i(),C=i();export{p as applyDistanceConstraint,u as getDistanceConstraintError};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../core/compilerUtils.js";import{acosClamped as t,clamp as r,asinClamped as n,deg2rad as i}from"../../../../core/mathUtils.js";import{fromRotation as a}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{e as o,p as c,j as u,i as l,F as m,D as d,g as f,n as p,b as h}from"../../../../chunks/vec32.js";import{create as M}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as y}from"../../../../geometry/ellipsoidUtils.js";import{Sphere as C}from"../../../../geometry/support/sphere.js";import{defaultConstraintOptions as I,hasConstraintType as S,adjustRangeForInteraction as x}from"./common.js";import{viewAngle as v}from"../../state/utils/viewUtils.js";function w(t,r,n,i=!0){N.eyeCenterDistance=0,N.requiresTwoSteps=!1;const s=A(t,r,n,I,N);if(0===s)return!1;switch(a(L,-s,r.viewRight),n.tiltMode){case 1:c(k,r.viewForward,L),u(k,k,N.eyeCenterDistance),r.center=l(z,r.eye,k);break;case 0:o(k,r.center,r.eye),c(k,k,L),r.eye=o(z,r.center,k);break;default:e(n.tiltMode)}return r.up=c(z,r.up,L),!N.requiresTwoSteps||!i||w(t,r,n,!1)}function A(e,t,r,n=I,i){if(!e.state.constraints.tilt)return 0;const a=Math.min(t.relativeElevation*G,t.distance),s=e.state.constraints.tilt(a,J);return E(e,r,s),2===n.interactionType&&S(n.selection,2)&&U(e,n.interactionStartCamera,s),1===r.tiltMode||1===n.tiltMode?R(e,t,s,i):P(e,t,s)}function P(e,t,n){const i=v(e.renderCoordsHelper,t.center,t.eye),a=i-r(i,n.min,n.max);return O(a)?a:0}function R(e,t,r,n){switch(n&&(n.requiresTwoSteps=!1),e.viewingMode){case"global":return j(e,t,r,n);case"local":return T(e,t,r,n)}}function T(e,t,n,i){const a=v(e.renderCoordsHelper,t.center,t.eye),s=r(a,n.min,n.max),o=a-s;if(!O(o))return 0;if(i){const r=Math.abs(e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude),n=e.renderCoordsHelper.getAltitude(t.eye)-r,a=Math.max(Math.cos(s),1e-4);Math.abs(a)>1e-4?i.eyeCenterDistance=n/a:i.eyeCenterDistance=t.distance}return o}function j(e,t,n,i){const a=b(e,t,K),s=r(a.tiltAtCenter,n.min,n.max);if(!O(a.tiltAtCenter-s))return 0;let o,c;return a.centerIsOnSurface?(o=q(a),c=H(a,o)):(o=a.constraints.clampTilt(a.distance,a.tiltAtCenter),i&&o<Math.PI/2&&(i.requiresTwoSteps=!0,o=Math.PI/2-1e-5),c=F(a,o)),i&&(i.eyeCenterDistance=D(a,o)),c}function b(e,r,n){const i=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,a=i+y(e.spatialReference).radius,s=e.renderCoordsHelper.intersectManifold(r.ray,i,z);return n.distance=Math.min(r.relativeElevation*G,r.distance),n.centerIsOnSurface=!1,null!=s?(n.distance=Math.min(r.relativeElevation*G,d(r.eye,s)),n.tiltAtCenter=v(e.renderCoordsHelper,s,r.eye),n.centerIsOnSurface=!0):e.state.isLocal?n.tiltAtCenter=v(e.renderCoordsHelper,r.center,r.eye):(g.radius=a,g.closestPointOnSilhouette(r.ray,z),n.distance=Math.min(r.relativeElevation*G,d(r.eye,z)),n.tiltAtCenter=t(-f(r.viewForward,p(z,z)))),n.radius=a,n.eyeRadius=h(r.eye),n.constraints=e.state.constraints,n}const g=new C;function O(e){return Math.abs(e)>1e-9}function q(e){const{constraints:t,distance:r,tiltAtCenter:n}=e;let i=n,a=t.clampTilt(r,n);const s=D(e,a);if(t.clampTilt(s,n)===a)return a;let o=0;for(;o<10&&O(a-i);){const r=(i+a)/2,n=D(e,r);O(t.clampTilt(n,r)-r)?i=r:a=r,o++}return a}function D(e,t){if(!e.centerIsOnSurface)return e.distance;const i=Math.PI-r(t,0,Math.PI),a=n(e.radius/e.eyeRadius*Math.sin(i)),s=Math.PI-i-a,o=Math.sin(s)/Math.sin(i);if(e.eyeRadius<e.radius&&o>1){const t=Math.PI-a,r=Math.PI-i-t;return Math.sin(r)/Math.sin(i)*e.eyeRadius}return o*e.eyeRadius}function H(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 F(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function E(e,t,r){if(0===t.interactionType)return;const{interactionStartCamera:n,interactionFactor:i}=t;if(!n)return;const{min:a,max:s}=r,o=A(e,n,I,t),c=0===o?0:v(e.renderCoordsHelper,n.center,n.eye);r.min=a,r.max=s,2===t.interactionType?(S(t.selection,2)&&U(e,n,r),x(o,c,!0,i,B,r)):x(o,c,!1,i,B,r)}function U(e,r,n){const i=e.state.constraints;if(e.state.isLocal||!i.altitude||!r)return;const a=m(r.center),s=Math.sqrt(a),o=r.distance,c=y(e.spatialReference).radius,u=i.altitude.min+c,l=i.altitude.max+c,d=(u*u-o*o-a)/(-2*s*o),f=(l*l-o*o-a)/(-2*s*o);n.min=Math.max(n.min,Math.min(Math.PI-t(f),n.max)),n.max=Math.min(n.max,Math.PI-t(d))}const k=M(),L=s(),z=M(),B=i(5),G=30,J={min:0,max:0},K={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,distance:0,tiltAtCenter:0},N={eyeCenterDistance:0,requiresTwoSteps:!1};export{w as applyTiltConstraint,A as getTiltConstraintError};
5
+ import{neverReached as e}from"../../../../core/compilerUtils.js";import{acosClamped as t,clamp as r,asinClamped as n,deg2rad as i}from"../../../../core/mathUtils.js";import{fromRotation as a}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{e as o,p as c,j as u,i as l,E as m,C as d,g as f,n as p,b as h}from"../../../../chunks/vec32.js";import{create as M}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as y}from"../../../../geometry/ellipsoidUtils.js";import{Sphere as C}from"../../../../geometry/support/sphere.js";import{defaultConstraintOptions as I,hasConstraintType as S,adjustRangeForInteraction as x}from"./common.js";import{viewAngle as v}from"../../state/utils/viewUtils.js";function w(t,r,n,i=!0){N.eyeCenterDistance=0,N.requiresTwoSteps=!1;const s=A(t,r,n,I,N);if(0===s)return!1;switch(a(L,-s,r.viewRight),n.tiltMode){case 1:c(k,r.viewForward,L),u(k,k,N.eyeCenterDistance),r.center=l(z,r.eye,k);break;case 0:o(k,r.center,r.eye),c(k,k,L),r.eye=o(z,r.center,k);break;default:e(n.tiltMode)}return r.up=c(z,r.up,L),!N.requiresTwoSteps||!i||w(t,r,n,!1)}function A(e,t,r,n=I,i){if(!e.state.constraints.tilt)return 0;const a=Math.min(t.relativeElevation*G,t.distance),s=e.state.constraints.tilt(a,J);return F(e,r,s),2===n.interactionType&&S(n.selection,2)&&U(e,n.interactionStartCamera,s),1===r.tiltMode||1===n.tiltMode?R(e,t,s,i):P(e,t,s)}function P(e,t,n){const i=v(e.renderCoordsHelper,t.center,t.eye),a=i-r(i,n.min,n.max);return O(a)?a:0}function R(e,t,r,n){switch(n&&(n.requiresTwoSteps=!1),e.viewingMode){case"global":return j(e,t,r,n);case"local":return T(e,t,r,n)}}function T(e,t,n,i){const a=v(e.renderCoordsHelper,t.center,t.eye),s=r(a,n.min,n.max),o=a-s;if(!O(o))return 0;if(i){const r=Math.abs(e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude),n=e.renderCoordsHelper.getAltitude(t.eye)-r,a=Math.max(Math.cos(s),1e-4);Math.abs(a)>1e-4?i.eyeCenterDistance=n/a:i.eyeCenterDistance=t.distance}return o}function j(e,t,n,i){const a=b(e,t,K),s=r(a.tiltAtCenter,n.min,n.max);if(!O(a.tiltAtCenter-s))return 0;let o,c;return a.centerIsOnSurface?(o=q(a),c=D(a,o)):(o=a.constraints.clampTilt(a.distance,a.tiltAtCenter),i&&o<Math.PI/2&&(i.requiresTwoSteps=!0,o=Math.PI/2-1e-5),c=E(a,o)),i&&(i.eyeCenterDistance=H(a,o)),c}function b(e,r,n){const i=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,a=i+y(e.spatialReference).radius,s=e.renderCoordsHelper.intersectManifold(r.ray,i,z);return n.distance=Math.min(r.relativeElevation*G,r.distance),n.centerIsOnSurface=!1,null!=s?(n.distance=Math.min(r.relativeElevation*G,d(r.eye,s)),n.tiltAtCenter=v(e.renderCoordsHelper,s,r.eye),n.centerIsOnSurface=!0):e.state.isLocal?n.tiltAtCenter=v(e.renderCoordsHelper,r.center,r.eye):(g.radius=a,g.closestPointOnSilhouette(r.ray,z),n.distance=Math.min(r.relativeElevation*G,d(r.eye,z)),n.tiltAtCenter=t(-f(r.viewForward,p(z,z)))),n.radius=a,n.eyeRadius=h(r.eye),n.constraints=e.state.constraints,n}const g=new C;function O(e){return Math.abs(e)>1e-9}function q(e){const{constraints:t,distance:r,tiltAtCenter:n}=e;let i=n,a=t.clampTilt(r,n);const s=H(e,a);if(t.clampTilt(s,n)===a)return a;let o=0;for(;o<10&&O(a-i);){const r=(i+a)/2,n=H(e,r);O(t.clampTilt(n,r)-r)?i=r:a=r,o++}return a}function H(e,t){if(!e.centerIsOnSurface)return e.distance;const i=Math.PI-r(t,0,Math.PI),a=n(e.radius/e.eyeRadius*Math.sin(i)),s=Math.PI-i-a,o=Math.sin(s)/Math.sin(i);if(e.eyeRadius<e.radius&&o>1){const t=Math.PI-a,r=Math.PI-i-t;return Math.sin(r)/Math.sin(i)*e.eyeRadius}return o*e.eyeRadius}function D(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 E(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function F(e,t,r){if(0===t.interactionType)return;const{interactionStartCamera:n,interactionFactor:i}=t;if(!n)return;const{min:a,max:s}=r,o=A(e,n,I,t),c=0===o?0:v(e.renderCoordsHelper,n.center,n.eye);r.min=a,r.max=s,2===t.interactionType?(S(t.selection,2)&&U(e,n,r),x(o,c,!0,i,B,r)):x(o,c,!1,i,B,r)}function U(e,r,n){const i=e.state.constraints;if(e.state.isLocal||!i.altitude||!r)return;const a=m(r.center),s=Math.sqrt(a),o=r.distance,c=y(e.spatialReference).radius,u=i.altitude.min+c,l=i.altitude.max+c,d=(u*u-o*o-a)/(-2*s*o),f=(l*l-o*o-a)/(-2*s*o);n.min=Math.max(n.min,Math.min(Math.PI-t(f),n.max)),n.max=Math.min(n.max,Math.PI-t(d))}const k=M(),L=s(),z=M(),B=i(5),G=30,J={min:0,max:0},K={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,distance:0,tiltAtCenter:0},N={eyeCenterDistance:0,requiresTwoSteps:!1};export{w as applyTiltConstraint,A 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{unitRGBAFromColor as t}from"../../../core/colorUtils.js";import{clamp as r,lerp as s}from"../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{subclass as n}from"../../../core/accessorSupport/decorators.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{h,b as c,F as p}from"../../../chunks/vec32.js";import{s as d}from"../../../chunks/vec42.js";import{ZEROS as u}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as f}from"../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as l}from"../webgl.js";import{innerAtmosphereDepth as g,computeInnerAltitudeFade as b}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as _,ChapmanAtmosphereTechnique as P}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as w}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{OpaqueEnvironment as j}from"../webgl-engine/effects/OpaqueEnvironment.js";import{createQuadVAO as v}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as q}from"../webgl-engine/lib/textureUtils.js";import{A}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as T}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{DepthStencilAttachment as x,PrimitiveType as C}from"../../webgl/enums.js";import y from"../../../webscene/background/ColorBackground.js";let M=class extends j{constructor(){super(...arguments),this.requireGeometryDepth=!0,this._compositingPassParameters=new A,this._vao=null,this._passParameters=new _,this._configuration=new w}initialize(){this.techniques.precompile(P,this._configuration),this.techniques.precompile(T),this._configuration.reduced=!0,this.techniques.precompile(P,this._configuration),this._configuration.reduced=!1,this.addHandles([a(()=>this.view.environment.background,e=>{const r=e instanceof y?t(e.color):u;h(this._passParameters.backgroundColor,r[0]*r[3],r[1]*r[3],r[2]*r[3])},o),a(()=>this.view.stage?.renderer?.highResolutionAtmosphere,e=>this._configuration.reduced=!e,o),a(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o)])}destroy(){this._vao=i(this._vao)}render(e){const t=e.find(({name:e})=>e===l.OPAQUE_ENVIRONMENT);if(!this.bindParameters.mainDepth)return t;const r=this.renderingContext;this._vao??=v(r,1);const i=t.getAttachment(x);this._update();const a=this.techniques.get(P,this._configuration);if(!a.compiled)return this.requestRender(1),t;if(!this._configuration.reduced)return t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(a,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(C.TRIANGLE_STRIP,0,4),t.attachDepth(i),t;const o=this.techniques.get(T);if(!o.compiled)return this.requestRender(1),t;const n=r.getViewport(),m=this.bindParameters.camera,h=c(m.eye)-f.radius;let p;const d=f.atmosphereHeight;if(h<d){const e=Math.min(1,Math.max(0,h/d));p=s(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(h-d)/(15*d)));p=s(.3,.6,e)}const u=this.renderingContext.parameters.maxTextureSize,g=q(Math.round(p*m.fullViewport[2]),u),b=q(Math.round(p*m.fullViewport[3]),u);r.setViewport(0,0,g,b);const _=this.fboCache.acquire(g,b,"chapman",5);return r.bindFramebuffer(_.fbo),r.clearFramebuffer([0,0,0,1],!0,!0),r.bindTechnique(a,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(C.TRIANGLE_STRIP,0,4),r.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=_.getTexture(),t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(o,this.bindParameters,this._compositingPassParameters),r.screen.draw(),t.attachDepth(i),_.release(),t}_update(){const e=this.bindParameters.camera,t=p(e.eye),s=Math.sqrt(t),i=t-this._passParameters.radii[1]**2,a=r((s-this._passParameters.radii[0])/f.atmosphereHeight,0,1);d(this._passParameters.heightParameters,s,t,i,a);const o=this.view.basemapTerrain?.getLowerBoundRadius()??0;m(this._passParameters.radii,o,o+f.atmosphereHeight),this._passParameters.innerFadeDistance=2*Math.sqrt((2*o-g)*g),this._passParameters.altitudeFade=b(s-o)}};M=e([n("esri.views.3d.environment.ChapmanAtmosphere")],M);export{M as ChapmanAtmosphere};
5
+ import{__decorate as e}from"tslib";import{unitRGBAFromColor as t}from"../../../core/colorUtils.js";import{clamp as r,lerp as s}from"../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{subclass as n}from"../../../core/accessorSupport/decorators.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{h,b as c,E as p}from"../../../chunks/vec32.js";import{c as d}from"../../../chunks/vec42.js";import{ZEROS as u}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as f}from"../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as l}from"../webgl.js";import{innerAtmosphereDepth as g,computeInnerAltitudeFade as b}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as _,ChapmanAtmosphereTechnique as P}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as w}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{OpaqueEnvironment as j}from"../webgl-engine/effects/OpaqueEnvironment.js";import{createQuadVAO as v}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as q}from"../webgl-engine/lib/textureUtils.js";import{A}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as T}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{DepthStencilAttachment as x,PrimitiveType as C}from"../../webgl/enums.js";import y from"../../../webscene/background/ColorBackground.js";let E=class extends j{constructor(){super(...arguments),this.requireGeometryDepth=!0,this._compositingPassParameters=new A,this._vao=null,this._passParameters=new _,this._configuration=new w}initialize(){this.techniques.precompile(P,this._configuration),this.techniques.precompile(T),this._configuration.reduced=!0,this.techniques.precompile(P,this._configuration),this._configuration.reduced=!1,this.addHandles([a(()=>this.view.environment.background,e=>{const r=e instanceof y?t(e.color):u;h(this._passParameters.backgroundColor,r[0]*r[3],r[1]*r[3],r[2]*r[3])},o),a(()=>this.view.stage?.renderer?.highResolutionAtmosphere,e=>this._configuration.reduced=!e,o),a(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o)])}destroy(){this._vao=i(this._vao)}render(e){const t=e.find(({name:e})=>e===l.OPAQUE_ENVIRONMENT);if(!this.bindParameters.mainDepth)return t;const r=this.renderingContext;this._vao??=v(r,1);const i=t.getAttachment(x);this._update();const a=this.techniques.get(P,this._configuration);if(!a.compiled)return this.requestRender(1),t;if(!this._configuration.reduced)return t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(a,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(C.TRIANGLE_STRIP,0,4),t.attachDepth(i),t;const o=this.techniques.get(T);if(!o.compiled)return this.requestRender(1),t;const n=r.getViewport(),m=this.bindParameters.camera,h=c(m.eye)-f.radius;let p;const d=f.atmosphereHeight;if(h<d){const e=Math.min(1,Math.max(0,h/d));p=s(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(h-d)/(15*d)));p=s(.3,.6,e)}const u=this.renderingContext.parameters.maxTextureSize,g=q(Math.round(p*m.fullViewport[2]),u),b=q(Math.round(p*m.fullViewport[3]),u);r.setViewport(0,0,g,b);const _=this.fboCache.acquire(g,b,"chapman",5);return r.bindFramebuffer(_.fbo),r.clearFramebuffer([0,0,0,1],!0,!0),r.bindTechnique(a,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(C.TRIANGLE_STRIP,0,4),r.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=_.getTexture(),t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(o,this.bindParameters,this._compositingPassParameters),r.screen.draw(),t.attachDepth(i),_.release(),t}_update(){const e=this.bindParameters.camera,t=p(e.eye),s=Math.sqrt(t),i=t-this._passParameters.radii[1]**2,a=r((s-this._passParameters.radii[0])/f.atmosphereHeight,0,1);d(this._passParameters.heightParameters,s,t,i,a);const o=this.view.basemapTerrain?.getLowerBoundRadius()??0;m(this._passParameters.radii,o,o+f.atmosphereHeight),this._passParameters.innerFadeDistance=2*Math.sqrt((2*o-g)*g),this._passParameters.altitudeFade=b(s-o)}};E=e([n("esri.views.3d.environment.ChapmanAtmosphere")],E);export{E 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as t}from"../../../core/compilerUtils.js";import{clamp as a}from"../../../core/mathUtils.js";import{signal as e}from"../../../core/signal.js";import{rotate as s}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as i,create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{F as h,n as o,j as n,d as c,b as d,e as l}from"../../../chunks/vec32.js";import{create as _,fromValues as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as f,fromPoints as p,axis as m}from"../../../geometry/support/axisAngleDegrees.js";import{earth as F}from"../../../geometry/support/Ellipsoid.js";import{ensureClouds as P}from"./Clouds.js";import{heightLimit as x}from"./weather.js";class v{constructor(){this.startTime=0,this._data=e(null),this.coverage=0,this.absorption=0,this._readChannels=0,this.parallax=new g,this.parallaxNew=new g,this._anchorPoint=_(),this._fadeState=e(0),this._fadeFactor=e(1)}get data(){return this._data.value}set data(t){this._data.value=t}get readChannels(){return this._readChannels}get fadeState(){return this._fadeState.value}get fadeFactor(){return this._fadeFactor.value}get opacity(){switch(this.fadeState){case 0:return 0;case 4:return 1-this.fadeFactor;case 1:return this.fadeFactor;case 2:case 3:return 1}}fade(t,e,s){this.isFading&&this.fadeFactor<1&&(this._fadeFactor.value=s?a((e-this.startTime)/(b*s),0,1):1,1===this.fadeFactor&&this._endFade()),this._evaluateState(t,e),this._updateParallax(t)}_evaluateState(t,a){const e=t.relativeElevation,s=this._updateAnchorPoint(t);(e>1.7*x||e<-x||s>k)&&this.opacity>0?this._startFade(0,a):this.isFading||(e>x||e<-.35*x||s>j*k?this.opacity>0&&this._startFade(4,a):P(this.data)&&(0===this.opacity?this._startFade(1,a):2===this.data.state&&(2===this.fadeState?this._startFade(3,a):this._startFade(2,a))))}_updateParallax(t){const a=h(t.eye);this.parallax.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(a-F.radius*F.radius,0))/Math.sqrt(a),p(w,this.parallax.anchorPoint,S),s(this.parallax.transform,i,S[3],m(S)),p(w,this.parallaxNew.anchorPoint,S),s(this.parallaxNew.transform,i,S[3],m(S))}_updateAnchorPoint(t){return o(this._anchorPoint,t.eye),n(this._anchorPoint,this._anchorPoint,F.radius),0===this.fadeState&&2===this.data?.state?(c(this.parallax.anchorPoint,this._anchorPoint),0):d(l(C,this.parallax.anchorPoint,this._anchorPoint))}requestFade(){this._fadeFactor.value=0}_startFade(t,a){switch(this._fadeState.value=t,this.startTime=a,t){case 3:this.requestFade(),this._switchReadChannels(),c(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:this.requestFade(),this._switchReadChannels(),c(this.parallax.anchorPoint,this._anchorPoint),c(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 4:this.requestFade();break;case 2:this._switchReadChannels(),c(this.parallax.anchorPoint,this._anchorPoint),c(this.parallaxNew.anchorPoint,this._anchorPoint),this._endFade();break;case 0:this._endFade()}}_endFade(){switch(this._fadeFactor.value=1,this.data&&2!==this.data.state&&(this.data.state=0),this.fadeState){case 3:c(this.parallax.anchorPoint,this.parallaxNew.anchorPoint),this._fadeState.value=2;break;case 1:this._fadeState.value=2;break;case 4:this._fadeState.value=0;break;case 2:case 0:break;default:t(this.fadeState)}}_switchReadChannels(){2===this.data?.state&&(this._readChannels=1-this._readChannels,this.data.state=3)}get isFading(){return 4===this.fadeState||1===this.fadeState||3===this.fadeState}}class g{constructor(){this.anchorPoint=_(),this.radiusCurvatureCorrection=0,this.transform=r()}}const w=u(0,0,1),S=f(),C=_(),b=1.25,j=.5,k=2e5;export{v as CloudsParameters};
5
+ import{neverReached as t}from"../../../core/compilerUtils.js";import{clamp as a}from"../../../core/mathUtils.js";import{signal as e}from"../../../core/signal.js";import{rotate as s}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as i,create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{E as h,n as o,j as n,d as c,b as d,e as l}from"../../../chunks/vec32.js";import{create as _,fromValues as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as f,fromPoints as p,axis as m}from"../../../geometry/support/axisAngleDegrees.js";import{earth as F}from"../../../geometry/support/Ellipsoid.js";import{ensureClouds as P}from"./Clouds.js";import{heightLimit as x}from"./weather.js";class v{constructor(){this.startTime=0,this._data=e(null),this.coverage=0,this.absorption=0,this._readChannels=0,this.parallax=new g,this.parallaxNew=new g,this._anchorPoint=_(),this._fadeState=e(0),this._fadeFactor=e(1)}get data(){return this._data.value}set data(t){this._data.value=t}get readChannels(){return this._readChannels}get fadeState(){return this._fadeState.value}get fadeFactor(){return this._fadeFactor.value}get opacity(){switch(this.fadeState){case 0:return 0;case 4:return 1-this.fadeFactor;case 1:return this.fadeFactor;case 2:case 3:return 1}}fade(t,e,s){this.isFading&&this.fadeFactor<1&&(this._fadeFactor.value=s?a((e-this.startTime)/(b*s),0,1):1,1===this.fadeFactor&&this._endFade()),this._evaluateState(t,e),this._updateParallax(t)}_evaluateState(t,a){const e=t.relativeElevation,s=this._updateAnchorPoint(t);(e>1.7*x||e<-x||s>k)&&this.opacity>0?this._startFade(0,a):this.isFading||(e>x||e<-.35*x||s>j*k?this.opacity>0&&this._startFade(4,a):P(this.data)&&(0===this.opacity?this._startFade(1,a):2===this.data.state&&(2===this.fadeState?this._startFade(3,a):this._startFade(2,a))))}_updateParallax(t){const a=h(t.eye);this.parallax.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(a-F.radius*F.radius,0))/Math.sqrt(a),p(w,this.parallax.anchorPoint,S),s(this.parallax.transform,i,S[3],m(S)),p(w,this.parallaxNew.anchorPoint,S),s(this.parallaxNew.transform,i,S[3],m(S))}_updateAnchorPoint(t){return o(this._anchorPoint,t.eye),n(this._anchorPoint,this._anchorPoint,F.radius),0===this.fadeState&&2===this.data?.state?(c(this.parallax.anchorPoint,this._anchorPoint),0):d(l(C,this.parallax.anchorPoint,this._anchorPoint))}requestFade(){this._fadeFactor.value=0}_startFade(t,a){switch(this._fadeState.value=t,this.startTime=a,t){case 3:this.requestFade(),this._switchReadChannels(),c(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:this.requestFade(),this._switchReadChannels(),c(this.parallax.anchorPoint,this._anchorPoint),c(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 4:this.requestFade();break;case 2:this._switchReadChannels(),c(this.parallax.anchorPoint,this._anchorPoint),c(this.parallaxNew.anchorPoint,this._anchorPoint),this._endFade();break;case 0:this._endFade()}}_endFade(){switch(this._fadeFactor.value=1,this.data&&2!==this.data.state&&(this.data.state=0),this.fadeState){case 3:c(this.parallax.anchorPoint,this.parallaxNew.anchorPoint),this._fadeState.value=2;break;case 1:this._fadeState.value=2;break;case 4:this._fadeState.value=0;break;case 2:case 0:break;default:t(this.fadeState)}}_switchReadChannels(){2===this.data?.state&&(this._readChannels=1-this._readChannels,this.data.state=3)}get isFading(){return 4===this.fadeState||1===this.fadeState||3===this.fadeState}}class g{constructor(){this.anchorPoint=_(),this.radiusCurvatureCorrection=0,this.transform=r()}}const w=u(0,0,1),S=f(),C=_(),b=1.25,j=.5,k=2e5;export{v as CloudsParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{watch as n,when as r,sync as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as s,subclass as h}from"../../../core/accessorSupport/decorators.js";import{G as l,d as c,j as g,l as p}from"../../../chunks/vec32.js";import{create as d,clone as m,fromValues as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoadedOrLoadFor as u}from"../../../geometry/projectionUtils.js";import v from"../../../geometry/SpatialReference.js";import{projectPointToVector as f}from"../../../geometry/projection/projectPointToVector.js";import{getGCSForPlanet as w}from"../../../geometry/support/planetGCSUtils.js";import{isEarth as y}from"../../../geometry/support/spatialReferenceUtils.js";import{EnvironmentRenderer as P}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as b}from"../support/earthUtils.js";import{ColorAndIntensity as T,computeColorAndIntensity as j,computeVirtualLightDirection as L,computeShadowsEnabled as G}from"../support/sunUtils.js";import{MainLight as U,AmbientLight as H,FillLight as C}from"../webgl-engine/lighting/Lightsources.js";let E=class extends t{constructor(e){super(e),this._tmpLightParameters=new T,this._defaultLightParameters=new T,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey="viewHandles",this._trackingEnabled=!1,this._mainLight=new U,this._ambientLight=new H,this._moonLight=new C,this._disableWeather=!1,this._renderer=null,this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){return this._renderer?.view}get updating(){return!!this._renderer?.updating||!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&!this._disableWeather&&1===this._view?.state?.viewingMode&&y(this._view.spatialReference)}get _weatherAvailable(){return this.weatherEnabled&&this._renderer?.weatherAvailable}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){const e=this._view?.stateManager?.camera?.position?.spatialReference??v.WGS84,t=w(e);return u(e,t)}connectView(e){if(this._renderer)return;this._renderer=new P({view:e});const t=()=>this._updateRenderParameters(),i=()=>this._cameraHandler();this.addHandles([n(()=>e.environment.lighting,e=>this._updateLightingHandler(e),o),n(()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null,e=>this._lightingDateHandler(e),o),n(()=>e.environment.lighting.directShadowsEnabled,t,o),n(()=>e.spatialReference,()=>this._resetReferencePosition(!0),o),n(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),o),n(()=>"snowy"===e.environment.weather.type&&e.environment.weather.snowCover,t,o),n(()=>e.environment,e=>e.setComputeWeatherAvailable(()=>this._weatherAvailable),a),n(()=>e.viewingMode,()=>this._resetReferencePosition(!0),a),n(()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),a),n(()=>e.state.camera,i,a),r(()=>this._canProjectCameraPosition,i,o)],this._viewHandlesKey),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition(),this._renderer=i(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const t=this._view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),null!=this._referencePositionGeographic)){const e=b(this._referencePositionGeographic,this._tmpTz);null!=e&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const i=t.stateManager.camera;if(!i)return;const{position:n}=i,r=n.spatialReference??v.WGS84,o=w(r);if(!f(n,k,o)){if(null==this._referencePositionGeographic)return;return this._referencePositionGeographic=null,void this._updateLighting()}this._referencePositionGeographic?l(this._referencePositionGeographic,k)||(c(this._referencePositionGeographic,k),this.notifyChange("referencePositionGeographic")):this._referencePositionGeographic=m(k),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e)}_updateLighting(e,t=0){const i=this._view,{lighting:n}=i.environment,r="virtual"===n.type,o=this._referencePositionGeographic,a=null!=o?this._tmpLightParameters:this._defaultLightParameters;if(o){e??=r?null:n.date;const t=this._weatherAvailable?i.environment.weather.type:"disabled";j(e,o,i.state.viewingMode,t,i.state.camera,a)}else r&&L(i.state.camera,i.state.viewingMode,a.direct.directionToLightSource);const s=this._mainLight,h=a.direct;g(s.intensity,h.color,h.intensity*Math.PI),c(s.direction,h.directionToLightSource),s.specularStrength=a.specularStrength,s.environmentStrength=a.environmentStrength;const l=this._ambientLight;g(l.intensity,a.ambient.color,a.ambient.intensity);const d=this._moonLight;p(d.intensity,R,S,a.globalFactor);const m=(1-.5*a.globalFactor)*(1-.4*a.noonFactor*(1-a.globalFactor));g(d.intensity,d.intensity,m),c(d.direction,h.directionToLightSource),this._view.stage?.renderer.updateLighting([s,l,d],a.noonFactor,a.globalFactor,this._weatherAvailable?t:0),this._updateRenderParameters()}_autoUpdateTimezone(e,t=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||null==e)return!1;const i=this._tmpDate;i.setTime((t||this._view.environment.lighting.date).getTime());const n=b(e,this._tmpTz);if(null==n)return!1;let r=this._view.environment.lighting.positionTimezoneInfo;if(r.autoUpdated){if(r.hours===n.hours&&r.minutes===n.minutes&&r.seconds===n.seconds)return!1}else r=n;const o=i.getUTCHours()-(n.hours-r.hours),a=i.getUTCMinutes()-(n.minutes-r.minutes),s=i.getUTCSeconds()-(n.seconds-r.seconds);return i.setUTCHours(o),i.setUTCMinutes(a),i.setUTCSeconds(s),!t&&this._view.environment.lighting.autoUpdate(i,n)}_updateRenderParameters(){const e=this._view.stage;if(!e)return;const t=null==this._referencePositionGeographic||G(this._referencePositionGeographic[2],this._view.state.viewingMode);e.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&t,environment:this._view.environment,weatherVisible:this._weatherAvailable})}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}get test(){}};e([s({type:Boolean,readOnly:!0})],E.prototype,"updating",null),e([s()],E.prototype,"_disableWeather",void 0),e([s()],E.prototype,"weatherEnabled",null),e([s()],E.prototype,"_weatherAvailable",null),e([s()],E.prototype,"referencePositionGeographic",null),e([s()],E.prototype,"_referencePositionGeographic",void 0),e([s()],E.prototype,"_renderer",void 0),e([s()],E.prototype,"_canProjectCameraPosition",null),E=e([h("esri.views.3d.environment.EnvironmentManager")],E);const R=_(.22,.22,.33),S=_(.22,.22,.22),k=d();export{E as EnvironmentManager};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{watch as n,when as r,sync as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as s,subclass as h}from"../../../core/accessorSupport/decorators.js";import{F as l,d as c,j as g,l as p}from"../../../chunks/vec32.js";import{create as d,clone as m,fromValues as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoadedOrLoadFor as u}from"../../../geometry/projectionUtils.js";import v from"../../../geometry/SpatialReference.js";import{projectPointToVector as f}from"../../../geometry/projection/projectPointToVector.js";import{getGCSForPlanet as w}from"../../../geometry/support/planetGCSUtils.js";import{isEarth as y}from"../../../geometry/support/spatialReferenceUtils.js";import{EnvironmentRenderer as P}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as b}from"../support/earthUtils.js";import{ColorAndIntensity as T,computeColorAndIntensity as j,computeVirtualLightDirection as L,computeShadowsEnabled as G}from"../support/sunUtils.js";import{MainLight as U,AmbientLight as H,FillLight as C}from"../webgl-engine/lighting/Lightsources.js";let E=class extends t{constructor(e){super(e),this._tmpLightParameters=new T,this._defaultLightParameters=new T,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey="viewHandles",this._trackingEnabled=!1,this._mainLight=new U,this._ambientLight=new H,this._moonLight=new C,this._disableWeather=!1,this._renderer=null,this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){return this._renderer?.view}get updating(){return!!this._renderer?.updating||!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&!this._disableWeather&&1===this._view?.state?.viewingMode&&y(this._view.spatialReference)}get _weatherAvailable(){return this.weatherEnabled&&this._renderer?.weatherAvailable}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){const e=this._view?.stateManager?.camera?.position?.spatialReference??v.WGS84,t=w(e);return u(e,t)}connectView(e){if(this._renderer)return;this._renderer=new P({view:e});const t=()=>this._updateRenderParameters(),i=()=>this._cameraHandler();this.addHandles([n(()=>e.environment.lighting,e=>this._updateLightingHandler(e),o),n(()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null,e=>this._lightingDateHandler(e),o),n(()=>e.environment.lighting.directShadowsEnabled,t,o),n(()=>e.spatialReference,()=>this._resetReferencePosition(!0),o),n(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),o),n(()=>"snowy"===e.environment.weather.type&&e.environment.weather.snowCover,t,o),n(()=>e.environment,e=>e.setComputeWeatherAvailable(()=>this._weatherAvailable),a),n(()=>e.viewingMode,()=>this._resetReferencePosition(!0),a),n(()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),a),n(()=>e.state.camera,i,a),r(()=>this._canProjectCameraPosition,i,o)],this._viewHandlesKey),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition(),this._renderer=i(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const t=this._view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),null!=this._referencePositionGeographic)){const e=b(this._referencePositionGeographic,this._tmpTz);null!=e&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const i=t.stateManager.camera;if(!i)return;const{position:n}=i,r=n.spatialReference??v.WGS84,o=w(r);if(!f(n,k,o)){if(null==this._referencePositionGeographic)return;return this._referencePositionGeographic=null,void this._updateLighting()}this._referencePositionGeographic?l(this._referencePositionGeographic,k)||(c(this._referencePositionGeographic,k),this.notifyChange("referencePositionGeographic")):this._referencePositionGeographic=m(k),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e)}_updateLighting(e,t=0){const i=this._view,{lighting:n}=i.environment,r="virtual"===n.type,o=this._referencePositionGeographic,a=null!=o?this._tmpLightParameters:this._defaultLightParameters;if(o){e??=r?null:n.date;const t=this._weatherAvailable?i.environment.weather.type:"disabled";j(e,o,i.state.viewingMode,t,i.state.camera,a)}else r&&L(i.state.camera,i.state.viewingMode,a.direct.directionToLightSource);const s=this._mainLight,h=a.direct;g(s.intensity,h.color,h.intensity*Math.PI),c(s.direction,h.directionToLightSource),s.specularStrength=a.specularStrength,s.environmentStrength=a.environmentStrength;const l=this._ambientLight;g(l.intensity,a.ambient.color,a.ambient.intensity);const d=this._moonLight;p(d.intensity,R,S,a.globalFactor);const m=(1-.5*a.globalFactor)*(1-.4*a.noonFactor*(1-a.globalFactor));g(d.intensity,d.intensity,m),c(d.direction,h.directionToLightSource),this._view.stage?.renderer.updateLighting([s,l,d],a.noonFactor,a.globalFactor,this._weatherAvailable?t:0),this._updateRenderParameters()}_autoUpdateTimezone(e,t=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||null==e)return!1;const i=this._tmpDate;i.setTime((t||this._view.environment.lighting.date).getTime());const n=b(e,this._tmpTz);if(null==n)return!1;let r=this._view.environment.lighting.positionTimezoneInfo;if(r.autoUpdated){if(r.hours===n.hours&&r.minutes===n.minutes&&r.seconds===n.seconds)return!1}else r=n;const o=i.getUTCHours()-(n.hours-r.hours),a=i.getUTCMinutes()-(n.minutes-r.minutes),s=i.getUTCSeconds()-(n.seconds-r.seconds);return i.setUTCHours(o),i.setUTCMinutes(a),i.setUTCSeconds(s),!t&&this._view.environment.lighting.autoUpdate(i,n)}_updateRenderParameters(){const e=this._view.stage;if(!e)return;const t=null==this._referencePositionGeographic||G(this._referencePositionGeographic[2],this._view.state.viewingMode);e.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&t,environment:this._view.environment,weatherVisible:this._weatherAvailable})}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}get test(){}};e([s({type:Boolean,readOnly:!0})],E.prototype,"updating",null),e([s()],E.prototype,"_disableWeather",void 0),e([s()],E.prototype,"weatherEnabled",null),e([s()],E.prototype,"_weatherAvailable",null),e([s()],E.prototype,"referencePositionGeographic",null),e([s()],E.prototype,"_referencePositionGeographic",void 0),e([s()],E.prototype,"_renderer",void 0),e([s()],E.prototype,"_canProjectCameraPosition",null),E=e([h("esri.views.3d.environment.EnvironmentManager")],E);const R=_(.22,.22,.33),S=_(.22,.22,.22),k=d();export{E as EnvironmentManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{lerp as t,smoothstep as s}from"../../../core/mathUtils.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{d as n,n as h,g as m,j as c,l as p,b as l}from"../../../chunks/vec32.js";import{fromValues as u,create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as g}from"../webgl.js";import{F as f}from"../../../chunks/Fog.glsl.js";import{FogTechnique as w}from"./FogTechnique.js";import{FogTechniqueConfiguration as P}from"./FogTechniqueConfiguration.js";import{heightLimit as b}from"./weather.js";import{TransparentEnvironment as y}from"../webgl-engine/effects/TransparentEnvironment.js";import{Blit as v}from"../webgl-engine/effects/blit/Blit.js";import{ColorAttachment1 as j,DepthStencilAttachment as F}from"../../webgl/enums.js";const E=.95,R=1;let T=class extends y{constructor(e){super(e),this.consumes={required:[g.TRANSPARENT_ENVIRONMENT]},this._configuration=new P,this.requireGeometryDepth=!0,this._newParameters=new q,this._oldParameters=new q,this._fadedParameters=new q,this._parameters=this._newParameters,this._passParameters=new f,this._blit=null;const t=_(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight;const s=e.view.stage.renderView.techniques;s.precompile(w,this._configuration),this._configuration.hasEmissive=!this._configuration.hasEmissive,s.precompile(w,this._configuration),this._configuration.hasEmissive=!this._configuration.hasEmissive}toogle(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}initialize(){this.addHandles([r(()=>this.view.environment.atmosphereEnabled,()=>this.toogle(),i),r(()=>this.view.environment.weather,()=>this.toogle(),i),r(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(r(()=>this._fadeFactor,e=>this._fade(e),i))}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const e=this.view.environment.weather,s="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength="foggy"===e.type?t(3e-5,.005,e.fogStrength**3):"snowy"===e.type||"rainy"===e.type?t(4e-6,2e-4,(e.precipitation??0)**3):0,this._newParameters.amount=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,C),"rainy"===e.type&&n(this._newParameters.color,A),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(1)}render(e){const t=e.find(({name:e})=>e===g.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;const s=t.getAttachment(j);this._configuration.hasEmissive=null!=s;const r=this.techniques.get(w,this._configuration);if(!r.compiled)return this.requestRender(1),t;const i=t.getAttachment(F),a=this.renderingContext,{fullWidth:o,fullHeight:n}=this.bindParameters.camera,h=o,m=n;let c=null;return s&&(c=this.fboCache.acquire(h,m,"glow horizontal",8),this._blit??=new v(this.techniques),this._blit.blitTexture(a,s?.attachment,c,this.bindParameters)),t.attachDepth(null),a.bindFramebuffer(t.fbo),s&&(this._passParameters.emission=c?.getTexture()),a.bindTechnique(r,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),c?.release(),t}_update(){const e=this.bindParameters.camera;h(N,e.eye);const t=Math.max(0,m(N,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;c(x,r,.1),p(this._passParameters.color,x,r,t);const i=l(e.eye);this._passParameters.atmosphereC=i**2-this._atmosphereRadius**2,this._passParameters.amount=(1-s(E*b,R*b,Math.abs(i-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};e([a()],T.prototype,"consumes",void 0),T=e([o("esri.views.3d.environment.Fog")],T);class q{constructor(){this.color=d(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,s,r){this.amount=t(e.amount,s.amount,r),this.strength=t(e.strength,s.strength,r),p(this.color,e.color,s.color,r)}}const N=d(),x=d(),A=u(.5,.5,.5),C=u(1.5,1.5,1.5);export{T as Fog,q as FogParameters};
5
+ import{__decorate as e}from"tslib";import{lerp as t,smoothstep as s}from"../../../core/mathUtils.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{d as n,n as h,g as m,j as c,l as p,b as l}from"../../../chunks/vec32.js";import{fromValues as u,create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as g}from"../webgl.js";import{F as f}from"../../../chunks/Fog.glsl.js";import{FogTechnique as w}from"./FogTechnique.js";import{FogTechniqueConfiguration as P}from"./FogTechniqueConfiguration.js";import{heightLimit as b}from"./weather.js";import{TransparentEnvironment as y}from"../webgl-engine/effects/TransparentEnvironment.js";import{Blit as v}from"../webgl-engine/effects/blit/Blit.js";import{ColorAttachment1 as j,DepthStencilAttachment as F}from"../../webgl/enums.js";const E=.95,R=1;let T=class extends y{constructor(e){super(e),this.consumes={required:[g.TRANSPARENT_ENVIRONMENT]},this._configuration=new P,this.requireGeometryDepth=!0,this._newParameters=new q,this._oldParameters=new q,this._fadedParameters=new q,this._parameters=this._newParameters,this._passParameters=new f,this._blit=null;const t=_(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight;const s=e.view.stage.renderView.techniques;s.precompile(w,this._configuration),this._configuration.hasEmissive=!this._configuration.hasEmissive,s.precompile(w,this._configuration),this._configuration.hasEmissive=!this._configuration.hasEmissive}toogle(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}initialize(){this.addHandles([r(()=>this.view.environment.atmosphereEnabled,()=>this.toogle(),i),r(()=>this.view.environment.weather,()=>this.toogle(),i),r(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(r(()=>this._fadeFactor,e=>this._fade(e),i))}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const e=this.view.environment.weather,s="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength="foggy"===e.type?t(3e-5,.005,e.fogStrength**3):"snowy"===e.type||"rainy"===e.type?t(4e-6,2e-4,(e.precipitation??0)**3):0,this._newParameters.amount=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,C),"rainy"===e.type&&n(this._newParameters.color,A),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(2)}render(e){const t=e.find(({name:e})=>e===g.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;const s=t.getAttachment(j);this._configuration.hasEmissive=null!=s;const r=this.techniques.get(w,this._configuration);if(!r.compiled)return this.requestRender(1),t;const i=t.getAttachment(F),a=this.renderingContext,{fullWidth:o,fullHeight:n}=this.bindParameters.camera,h=o,m=n;let c=null;return s&&(c=this.fboCache.acquire(h,m,"glow horizontal",8),this._blit??=new v(this.techniques),this._blit.blitTexture(a,s?.attachment,c,this.bindParameters)),t.attachDepth(null),a.bindFramebuffer(t.fbo),s&&(this._passParameters.emission=c?.getTexture()),a.bindTechnique(r,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),c?.release(),t}_update(){const e=this.bindParameters.camera;h(N,e.eye);const t=Math.max(0,m(N,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;c(x,r,.1),p(this._passParameters.color,x,r,t);const i=l(e.eye);this._passParameters.atmosphereC=i**2-this._atmosphereRadius**2,this._passParameters.amount=(1-s(E*b,R*b,Math.abs(i-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};e([a()],T.prototype,"consumes",void 0),T=e([o("esri.views.3d.environment.Fog")],T);class q{constructor(){this.color=d(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,s,r){this.amount=t(e.amount,s.amount,r),this.strength=t(e.strength,s.strength,r),p(this.color,e.color,s.color,r)}}const N=d(),x=d(),A=u(.5,.5,.5),C=u(1.5,1.5,1.5);export{T as Fog,q 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{lerp as t,clamp as r}from"../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import{watch as i,initial as o}from"../../../core/reactiveUtils.js";import{subclass as a}from"../../../core/accessorSupport/decorators.js";import{lookAt as n}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as h}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{b as p,j as c,i as u,D as l,f,F as _}from"../../../chunks/vec32.js";import{create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../../geometry/ellipsoidUtils.js";import{newFloatArray as b}from"../../../geometry/support/FloatArray.js";import{InternalRenderCategory as x}from"../webgl.js";import{computeInnerAltitudeFade as j,innerAtmosphereDepth as V}from"./atmosphereUtils.js";import{S as w}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as v,layout as P}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as R}from"./SimpleAtmosphereTechniqueConfiguration.js";import{marsAtmosphereTextureSimple as A}from"./resources/MarsAtmosphereTexture.js";import{makePiecewiseLinearFunction as y}from"../support/mathUtils.js";import{glLayout as S}from"../support/buffer/glUtil.js";import{OpaqueEnvironment as q}from"../webgl-engine/effects/OpaqueEnvironment.js";import{createQuadVAO as F}from"../webgl-engine/lib/glUtil3D.js";import{project as M}from"../webgl-engine/lib/Util.js";import{VertexArrayObject as T}from"../webgl-engine/lib/VertexArrayObject.js";import{PrimitiveType as U}from"../../webgl/enums.js";import{Texture as E}from"../../webgl/Texture.js";import{TextureDescriptor as O}from"../../webgl/TextureDescriptor.js";import{VertexBuffer as N}from"../../webgl/VertexBuffer.js";const C=128,I=-V,W=0,D=50,k=()=>1-511/512,B=y([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);let G=class extends q{constructor(e){super(e),this._passParameters=new w,this._configuration=new R,this._vao=null,this._fadeVao=null,this._texV1=1;const t=e.view,r=g(t.spatialReference),{outerAtmosphereRimWidth:s,radius:i}=r;this._planetRadius=i,this._innerRimFactor=1+I/i,this._middleRimFactor=1+W/i,this._outerRimFactor=1+s/i,this._texV0=W/s,this._texVScale=this._texV1-this._texV0;const o=t.stage.renderView.techniques;o.precompile(v,this._configuration),this._configuration.geometry=2,o.precompile(v,this._configuration)}initialize(){this.addHandles(i(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o))}destroy(){this._passParameters.texture=s(this._passParameters.texture),this._fadeVao=s(this._fadeVao),this._vao=s(this._vao)}render(e){const t=e.find(({name:e})=>e===x.OPAQUE_ENVIRONMENT);this._update();const r=this.renderingContext;if(!this._passParameters.texture){const e=new O(1,512);e.wrapMode=33071,e.flipped=!0,this._passParameters.texture=new E(r,e,A)}if(this._passParameters.undergroundFadeAlpha<1){this._vao??=this._createRibbon(r),this._configuration.geometry=0;const e=this.techniques.get(v,this._configuration);if(!e.compiled)return this.requestRender(1),t;r.bindTechnique(e,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(U.TRIANGLES,0,this._vao.vertexCount("geometry"))}if(this._passParameters.undergroundFadeAlpha>0){this._fadeVao??=F(r),this._configuration.geometry=2;const e=this.techniques.get(v,this._configuration);if(!e.compiled)return this.requestRender(1),t;r.bindTechnique(e,this.bindParameters,this._passParameters),r.bindVAO(this._fadeVao),r.drawArrays(U.TRIANGLE_STRIP,0,this._fadeVao.vertexCount("geometry"))}return t}_update(){const e=this.bindParameters.camera,s=d(),i=this._planetRadius,o=p(e.eye),a=o-i;if(a<0){const e=Math.min(-a/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;const n=Math.max(D,a),m=i+I;this._passParameters.innerScale=J(i+n,i,m)-1,this._passParameters.altitudeFade=j(a),c(s,e.eye,(i+D)/o),L(s,e.center,e.up,i,this._passParameters.silhouette);const u=this._computeScreenRimWidth(e,s,e.up,this._passParameters.silhouette),l=k(),f=B(a);let _=this._texV0+l*this._texVScale,g=this._texV0+u*f*this._texVScale;if(a>D){L(e.eye,e.center,e.up,i,this._passParameters.silhouette);const s=this._computeScreenRimWidth(e,e.eye,e.up,this._passParameters.silhouette),o=r((s-1.5)/(u-1.5),0,1);_=this._texV0+o*l*this._texVScale,g=this._texV0+t(this._texV1,u*f,o)*this._texVScale}h(this._passParameters.texV,_,g)}_createRibbon(e){const t=b(3+3*C*3),r=new Uint32Array(3*C*5);t[0]=0,t[1]=0,t[2]=-1;for(let o=0;o<C;o++){const e=9*o+3;t[e]=o,t[e+1]=this._innerRimFactor,t[e+2]=-1,t[e+3]=o,t[e+4]=this._middleRimFactor,t[e+5]=0,t[e+6]=o,t[e+7]=this._outerRimFactor,t[e+8]=1;const s=3*o+1,i=o===C-1?1:s+3,a=15*o;r[a]=s,r[a+1]=s+1,r[a+2]=i+1,r[a+3]=i+1,r[a+4]=i,r[a+5]=s,r[a+6]=s+1,r[a+7]=s+2,r[a+8]=i+2,r[a+9]=i+2,r[a+10]=i+1,r[a+11]=s+1,r[a+12]=s,r[a+13]=i,r[a+14]=0}const s=P.createBuffer(r.length),i=s.position;for(let o=0;o<r.length;++o){const e=3*r[o];i.set(o,0,t[e]),i.set(o,1,t[e+1]),i.set(o,2,t[e+2])}return new T(e,new N(e,S(P),s.buffer))}_computeScreenRimWidth(e,t,r,s){return u(H,s.center,s.v2),c(Q,H,this._outerRimFactor),n(z,t,H,r),M(H,z,e.projectionMatrix,e.viewport,H),M(Q,z,e.projectionMatrix,e.viewport,Q),l(H,Q)/e.height}};function L(e,t,r,s,i){const o=p(e),a=s*Math.sqrt(o*o-s*s)/o,n=Math.sqrt(s*s-a*a),m=i.v1,h=i.v2;return c(i.center,e,n/o),f(m,e,t),_(m)<1&&f(m,e,r),c(m,m,a/p(m)),f(h,m,e),c(h,h,a/p(h)),a}G=e([a("esri.views.3d.environment.MarsAtmosphere")],G);const z=m(),H=d(),Q=d();function J(e,t,r){return e*e/(Math.sqrt(e*e-t*t)*Math.sqrt(e*e-r*r)+t*r)}export{G as MarsAtmosphere};
5
+ import{__decorate as e}from"tslib";import{lerp as t,clamp as r}from"../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import{watch as i,initial as o}from"../../../core/reactiveUtils.js";import{subclass as a}from"../../../core/accessorSupport/decorators.js";import{lookAt as n}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as h}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{b as p,j as c,i as u,C as l,f,E as _}from"../../../chunks/vec32.js";import{create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as g}from"../../../geometry/ellipsoidUtils.js";import{newFloatArray as b}from"../../../geometry/support/FloatArray.js";import{InternalRenderCategory as x}from"../webgl.js";import{computeInnerAltitudeFade as j,innerAtmosphereDepth as V}from"./atmosphereUtils.js";import{S as w}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as v,layout as P}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as R}from"./SimpleAtmosphereTechniqueConfiguration.js";import{marsAtmosphereTextureSimple as A}from"./resources/MarsAtmosphereTexture.js";import{makePiecewiseLinearFunction as y}from"../support/mathUtils.js";import{glLayout as S}from"../support/buffer/glUtil.js";import{OpaqueEnvironment as q}from"../webgl-engine/effects/OpaqueEnvironment.js";import{createQuadVAO as F}from"../webgl-engine/lib/glUtil3D.js";import{project as M}from"../webgl-engine/lib/Util.js";import{VertexArrayObject as T}from"../webgl-engine/lib/VertexArrayObject.js";import{PrimitiveType as U}from"../../webgl/enums.js";import{Texture as E}from"../../webgl/Texture.js";import{TextureDescriptor as O}from"../../webgl/TextureDescriptor.js";import{VertexBuffer as C}from"../../webgl/VertexBuffer.js";const N=128,I=-V,W=0,k=50,B=()=>1-511/512,D=y([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);let G=class extends q{constructor(e){super(e),this._passParameters=new w,this._configuration=new R,this._vao=null,this._fadeVao=null,this._texV1=1;const t=e.view,r=g(t.spatialReference),{outerAtmosphereRimWidth:s,radius:i}=r;this._planetRadius=i,this._innerRimFactor=1+I/i,this._middleRimFactor=1+W/i,this._outerRimFactor=1+s/i,this._texV0=W/s,this._texVScale=this._texV1-this._texV0;const o=t.stage.renderView.techniques;o.precompile(v,this._configuration),this._configuration.geometry=2,o.precompile(v,this._configuration)}initialize(){this.addHandles(i(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o))}destroy(){this._passParameters.texture=s(this._passParameters.texture),this._fadeVao=s(this._fadeVao),this._vao=s(this._vao)}render(e){const t=e.find(({name:e})=>e===x.OPAQUE_ENVIRONMENT);this._update();const r=this.renderingContext;if(!this._passParameters.texture){const e=new O(1,512);e.wrapMode=33071,e.flipped=!0,this._passParameters.texture=new E(r,e,A)}if(this._passParameters.undergroundFadeAlpha<1){this._vao??=this._createRibbon(r),this._configuration.geometry=0;const e=this.techniques.get(v,this._configuration);if(!e.compiled)return this.requestRender(1),t;r.bindTechnique(e,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(U.TRIANGLES,0,this._vao.vertexCount("geometry"))}if(this._passParameters.undergroundFadeAlpha>0){this._fadeVao??=F(r),this._configuration.geometry=2;const e=this.techniques.get(v,this._configuration);if(!e.compiled)return this.requestRender(1),t;r.bindTechnique(e,this.bindParameters,this._passParameters),r.bindVAO(this._fadeVao),r.drawArrays(U.TRIANGLE_STRIP,0,this._fadeVao.vertexCount("geometry"))}return t}_update(){const e=this.bindParameters.camera,s=d(),i=this._planetRadius,o=p(e.eye),a=o-i;if(a<0){const e=Math.min(-a/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;const n=Math.max(k,a),m=i+I;this._passParameters.innerScale=J(i+n,i,m)-1,this._passParameters.altitudeFade=j(a),c(s,e.eye,(i+k)/o),L(s,e.center,e.up,i,this._passParameters.silhouette);const u=this._computeScreenRimWidth(e,s,e.up,this._passParameters.silhouette),l=B(),f=D(a);let _=this._texV0+l*this._texVScale,g=this._texV0+u*f*this._texVScale;if(a>k){L(e.eye,e.center,e.up,i,this._passParameters.silhouette);const s=this._computeScreenRimWidth(e,e.eye,e.up,this._passParameters.silhouette),o=r((s-1.5)/(u-1.5),0,1);_=this._texV0+o*l*this._texVScale,g=this._texV0+t(this._texV1,u*f,o)*this._texVScale}h(this._passParameters.texV,_,g)}_createRibbon(e){const t=b(3+3*N*3),r=new Uint32Array(3*N*5);t[0]=0,t[1]=0,t[2]=-1;for(let o=0;o<N;o++){const e=9*o+3;t[e]=o,t[e+1]=this._innerRimFactor,t[e+2]=-1,t[e+3]=o,t[e+4]=this._middleRimFactor,t[e+5]=0,t[e+6]=o,t[e+7]=this._outerRimFactor,t[e+8]=1;const s=3*o+1,i=o===N-1?1:s+3,a=15*o;r[a]=s,r[a+1]=s+1,r[a+2]=i+1,r[a+3]=i+1,r[a+4]=i,r[a+5]=s,r[a+6]=s+1,r[a+7]=s+2,r[a+8]=i+2,r[a+9]=i+2,r[a+10]=i+1,r[a+11]=s+1,r[a+12]=s,r[a+13]=i,r[a+14]=0}const s=P.createBuffer(r.length),i=s.position;for(let o=0;o<r.length;++o){const e=3*r[o];i.set(o,0,t[e]),i.set(o,1,t[e+1]),i.set(o,2,t[e+2])}return new T(e,new C(e,S(P),s.buffer))}_computeScreenRimWidth(e,t,r,s){return u(H,s.center,s.v2),c(Q,H,this._outerRimFactor),n(z,t,H,r),M(H,z,e.projectionMatrix,e.viewport,H),M(Q,z,e.projectionMatrix,e.viewport,Q),l(H,Q)/e.height}};function L(e,t,r,s,i){const o=p(e),a=s*Math.sqrt(o*o-s*s)/o,n=Math.sqrt(s*s-a*a),m=i.v1,h=i.v2;return c(i.center,e,n/o),f(m,e,t),_(m)<1&&f(m,e,r),c(m,m,a/p(m)),f(h,m,e),c(h,h,a/p(h)),a}G=e([a("esri.views.3d.environment.MarsAtmosphere")],G);const z=m(),H=d(),Q=d();function J(e,t,r){return e*e/(Math.sqrt(e*e-t*t)*Math.sqrt(e*e-r*r)+t*r)}export{G as MarsAtmosphere};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{createScreenPointArray as t}from"../../../core/screenUtils.js";import{subclass as r}from"../../../core/accessorSupport/decorators.js";import{G as o}from"../../../chunks/vec32.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as i}from"../../../geometry/support/vectorStacks.js";import{vectorToRender as n}from"./support/viewUtils.js";import{SegmentLabels as a}from"../../interactive/SegmentLabels.js";let c=class extends a{getCameraOrExtent({view:e}){return e.state.camera}toScreenPointArray({view:e,elevationInfo:r,editGeometryOperations:o},s,i=t()){const{spatialReference:a}=o.data.coordinateHelper;return n(s,a,r,e,p),e.state.camera.projectToScreen(p,i),i}getRing(e,t,r,s,n){const a=[];for(const o of t.parts[n].iterateVertices())a.push(s.toXYZ(o.pos,i.get()));if(0===n&&null!=r&&a.push(s.toXYZ(r,i.get())),a.length<2)return a;const c=a[0],p=a[a.length-1];return"polygon"===e.type&&a.length>2&&!o(c,p)&&a.push(c),a}};c=e([r("esri.views.3d.interactive.SegmentLabels3D")],c);const p=s();export{c as SegmentLabels3D};
5
+ import{__decorate as e}from"tslib";import{createScreenPointArray as t}from"../../../core/screenUtils.js";import{subclass as r}from"../../../core/accessorSupport/decorators.js";import{F as o}from"../../../chunks/vec32.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as i}from"../../../geometry/support/vectorStacks.js";import{vectorToRender as n}from"./support/viewUtils.js";import{SegmentLabels as a}from"../../interactive/SegmentLabels.js";let c=class extends a{getCameraOrExtent({view:e}){return e.state.camera}toScreenPointArray({view:e,elevationInfo:r,editGeometryOperations:o},s,i=t()){const{spatialReference:a}=o.data.coordinateHelper;return n(s,a,r,e,p),e.state.camera.projectToScreen(p,i),i}getRing(e,t,r,s,n){const a=[];for(const o of t.parts[n].iterateVertices())a.push(s.toXYZ(o.pos,i.get()));if(0===n&&null!=r&&a.push(s.toXYZ(r,i.get())),a.length<2)return a;const c=a[0],p=a[a.length-1];return"polygon"===e.type&&a.length>2&&!o(c,p)&&a.push(c),a}};c=e([r("esri.views.3d.interactive.SegmentLabels3D")],c);const p=s();export{c as SegmentLabels3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../Color.js";import{darken as e}from"../../../../../core/colorUtils.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as a}from"../../../../../core/mathUtils.js";import{removeMaybe as o}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{translate as n,rotateX as l}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{H as m,e as d,n as u,g as p,f as h,j as f}from"../../../../../chunks/vec32.js";import{fromValues as _,create as j}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as w}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as g}from"../../RenderObject.js";import{screenToZConstrained as M}from"../dragEventPipeline3D.js";import{Settings as O}from"../settings.js";import{discRadius as U}from"./config.js";import{Manipulation as b}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as P}from"./moveUtils.js";import{createTubeGeometry as y,createConeGeometry as z}from"../../../webgl-engine/lib/GeometryUtil.js";import{createManipulatorDragEventPipeline as x,addScreenDelta as T}from"../../../../interactive/dragEventPipeline.js";class H extends b{constructor(t){super(),this._radius=U,this.events=new i,this._tool=t.tool,this._view=t.view;const e=new O({getTheme:()=>this._view.effectiveTheme});this._settings=e,null!=t.radius&&(this._radius=t.radius);const r=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:v(C(r,1,.25),1),materialFocused:v(C(r,1,0),1),materialOccludedUnfocused:v(C(r,.7,0),e.zManipulator.renderOccluded),materialOccludedFocused:v(C(r,.85,0),e.zManipulator.renderOccluded)},this._themeHandle=s(()=>this._view.effectiveTheme.accentColor,t=>{const e=C(t,1,.25),i=C(t,1,0),r=C(t,.7,0),a=C(t,.85,0),{materialUnfocused:o,materialFocused:s,materialOccludedUnfocused:n,materialOccludedFocused:l}=this._materials;o.setParameters({color:e}),s.setParameters({color:i}),n.setParameters({color:r}),l.setParameters({color:a})}),this._createManipulator(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._themeHandle=o(this._themeHandle),this._manipulator.applyObjectTransform=R,this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()})}forEachManipulator(t){t(this._manipulator,0)}createManipulatedObjectDragPipeline(t,e,i){if(!e.operations)return r();const a=e.operations.data.spatialReference;return P(e,i,e=>this.createDragPipeline((i,r,a,o,s)=>(({steps:r,cancel:a}=t(i,r,a,o,s)),e(i,r,a)),a))}createDragPipeline(t,e){const i=this._view;return x(this._manipulator,(r,a,o,s,n)=>{const l=a.next(t=>({...t,manipulatorType:0})).next(M(i,r.renderLocation,e)).next(T());t(r,l,o,s,n)})}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}_updateManipulator(){const t=this._settings,e=this._radius/U,i=t.zManipulator.height*e,r=t.zManipulator.coneHeight*e,a=t.zManipulator.coneWidth*e,o=t.zManipulator.width*e,s=[_(0,0,0),_(0,0,i)],m=[_(0,0,0),_(0,0,i+r)],d=(()=>{const t=c();return n(t,t,[0,0,i]),l(t,t,Math.PI/2),t})(),{materialUnfocused:u,materialFocused:p,materialOccludedUnfocused:h,materialOccludedFocused:f}=this._materials,j=y(u,s,o/2,16,!1),w=z(u,r,a/2,16,!1);w.transformation=d,this._manipulator.renderObjects=[new g(w,1),new g(j,1),new g(w.instantiate({material:p}),2),new g(j.instantiate({material:p}),2),new g(w.instantiate({material:h}),1),new g(j.instantiate({material:h}),1),new g(w.instantiate({material:f}),2),new g(j.instantiate({material:f}),2)],this._manipulator.radius=o/2+2,this._manipulator.collisionType={type:"line",paths:[m]}}_createManipulator(){const t=this._view,e=new w({view:t,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:"ns-resize",elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});e.applyObjectTransform=e=>{const i=t.state.camera,r=D;t.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,r);const o=m(i.eye,r),s=i.computeRenderPixelSizeAtDist(o),n=d(E,r,i.eye);u(n,n);const l=F;t.renderCoordsHelper.worldUpAtPosition(D,l);const c=Math.abs(p(n,l)),_=h(E,n,l),j=h(E,_,l),w=a(c,.01,1),v=1-Math.sqrt(1-w*w)/w/i.fullWidth,g=this._settings,M=this._radius/U,O=g.zManipulator.width*M;f(j,u(j,j),(1/v-1)*o+s*O),e[12]-=E[0],e[13]-=E[1],e[14]-=E[2]},this._manipulator=e,this._updateManipulator()}get test(){}}function C(i,r,a){const o=e(i,a);return o.a*=r,t.toUnitRGBA(o)}const D=j(),E=j(),F=j(),R=()=>{};export{H as MoveZManipulation};
5
+ import t from"../../../../../Color.js";import{darken as e}from"../../../../../core/colorUtils.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as a}from"../../../../../core/mathUtils.js";import{removeMaybe as o}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{translate as n,rotateX as l}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{G as m,e as d,n as u,g as p,f as h,j as f}from"../../../../../chunks/vec32.js";import{fromValues as _,create as j}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as w}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as g}from"../../RenderObject.js";import{screenToZConstrained as M}from"../dragEventPipeline3D.js";import{Settings as O}from"../settings.js";import{discRadius as U}from"./config.js";import{Manipulation as b}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as P}from"./moveUtils.js";import{createTubeGeometry as y,createConeGeometry as z}from"../../../webgl-engine/lib/GeometryUtil.js";import{createManipulatorDragEventPipeline as x,addScreenDelta as T}from"../../../../interactive/dragEventPipeline.js";class C extends b{constructor(t){super(),this._radius=U,this.events=new i,this._tool=t.tool,this._view=t.view;const e=new O({getTheme:()=>this._view.effectiveTheme});this._settings=e,null!=t.radius&&(this._radius=t.radius);const r=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:v(D(r,1,.25),1),materialFocused:v(D(r,1,0),1),materialOccludedUnfocused:v(D(r,.7,0),e.zManipulator.renderOccluded),materialOccludedFocused:v(D(r,.85,0),e.zManipulator.renderOccluded)},this._themeHandle=s(()=>this._view.effectiveTheme.accentColor,t=>{const e=D(t,1,.25),i=D(t,1,0),r=D(t,.7,0),a=D(t,.85,0),{materialUnfocused:o,materialFocused:s,materialOccludedUnfocused:n,materialOccludedFocused:l}=this._materials;o.setParameters({color:e}),s.setParameters({color:i}),n.setParameters({color:r}),l.setParameters({color:a})}),this._createManipulator(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._themeHandle=o(this._themeHandle),this._manipulator.applyObjectTransform=R,this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()})}forEachManipulator(t){t(this._manipulator,0)}createManipulatedObjectDragPipeline(t,e,i){if(!e.operations)return r();const a=e.operations.data.spatialReference;return P(e,i,e=>this.createDragPipeline((i,r,a,o,s)=>(({steps:r,cancel:a}=t(i,r,a,o,s)),e(i,r,a)),a))}createDragPipeline(t,e){const i=this._view;return x(this._manipulator,(r,a,o,s,n)=>{const l=a.next(t=>({...t,manipulatorType:0})).next(M(i,r.renderLocation,e)).next(T());t(r,l,o,s,n)})}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}_updateManipulator(){const t=this._settings,e=this._radius/U,i=t.zManipulator.height*e,r=t.zManipulator.coneHeight*e,a=t.zManipulator.coneWidth*e,o=t.zManipulator.width*e,s=[_(0,0,0),_(0,0,i)],m=[_(0,0,0),_(0,0,i+r)],d=(()=>{const t=c();return n(t,t,[0,0,i]),l(t,t,Math.PI/2),t})(),{materialUnfocused:u,materialFocused:p,materialOccludedUnfocused:h,materialOccludedFocused:f}=this._materials,j=y(u,s,o/2,16,!1),w=z(u,r,a/2,16,!1);w.transformation=d,this._manipulator.renderObjects=[new g(w,1),new g(j,1),new g(w.instantiate({material:p}),2),new g(j.instantiate({material:p}),2),new g(w.instantiate({material:h}),1),new g(j.instantiate({material:h}),1),new g(w.instantiate({material:f}),2),new g(j.instantiate({material:f}),2)],this._manipulator.radius=o/2+2,this._manipulator.collisionType={type:"line",paths:[m]}}_createManipulator(){const t=this._view,e=new w({view:t,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:"ns-resize",elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});e.applyObjectTransform=e=>{const i=t.state.camera,r=E;t.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,r);const o=m(i.eye,r),s=i.computeRenderPixelSizeAtDist(o),n=d(F,r,i.eye);u(n,n);const l=H;t.renderCoordsHelper.worldUpAtPosition(E,l);const c=Math.abs(p(n,l)),_=h(F,n,l),j=h(F,_,l),w=a(c,.01,1),v=1-Math.sqrt(1-w*w)/w/i.fullWidth,g=this._settings,M=this._radius/U,O=g.zManipulator.width*M;f(j,u(j,j),(1/v-1)*o+s*O),e[12]-=F[0],e[13]-=F[1],e[14]-=F[2]},this._manipulator=e,this._updateManipulator()}get test(){}}function D(i,r,a){const o=e(i,a);return o.a*=r,t.toUnitRGBA(o)}const E=j(),F=j(),H=j(),R=()=>{};export{C as MoveZManipulation};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{EventEmitter as o}from"../../../../../core/Evented.js";import{watch as r,sync as i}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{D as l}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPointToVector as a}from"../../../../../geometry/projection/projectPointToVector.js";import{isMediaElementVisibleView as p}from"./mediaElementUtils.js";let d=class extends t{grabbableForEvent(){return!0}constructor(e){super(e),this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.grabbing=!1,this.dragging=!1,this.hovering=!0,this.selected=!1,this.cursor=null,this.consumesClicks=!0,this.events=new o,this.addHandles(r(()=>this.selected,e=>this.events.emit("select-changed",{action:e?"select":"deselect"}),i))}destroy(){this._set("view",null)}intersectionDistance(e){const{view:t,layer:o,element:r}=this;if(!p(t,o,r))return null;const i=t.toMap(e,{include:{layer:o,element:r}});return i&&a(i,m,t.renderSpatialReference)?l(m,t.state.camera.eye):null}onElevationChange(){}onViewChange(){}};e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"element",void 0),e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"layer",void 0),e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"view",void 0),e([s()],d.prototype,"interactive",void 0),e([s()],d.prototype,"selectable",void 0),e([s()],d.prototype,"grabbable",void 0),e([s()],d.prototype,"grabbing",void 0),e([s()],d.prototype,"dragging",void 0),e([s()],d.prototype,"hovering",void 0),e([s()],d.prototype,"selected",void 0),e([s()],d.prototype,"cursor",void 0),d=e([n("esri.views.3d.interactive.editingTools.media.MediaElementManipulator3D")],d);const m=c();export{d as MediaElementManipulator3D};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{EventEmitter as o}from"../../../../../core/Evented.js";import{watch as r,sync as i}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{C as l}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPointToVector as a}from"../../../../../geometry/projection/projectPointToVector.js";import{isMediaElementVisibleView as p}from"./mediaElementUtils.js";let d=class extends t{grabbableForEvent(){return!0}constructor(e){super(e),this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.grabbing=!1,this.dragging=!1,this.hovering=!0,this.selected=!1,this.cursor=null,this.consumesClicks=!0,this.events=new o,this.addHandles(r(()=>this.selected,e=>this.events.emit("select-changed",{action:e?"select":"deselect"}),i))}destroy(){this._set("view",null)}intersectionDistance(e){const{view:t,layer:o,element:r}=this;if(!p(t,o,r))return null;const i=t.toMap(e,{include:{layer:o,element:r}});return i&&a(i,m,t.renderSpatialReference)?l(m,t.state.camera.eye):null}onElevationChange(){}onViewChange(){}};e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"element",void 0),e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"layer",void 0),e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"view",void 0),e([s()],d.prototype,"interactive",void 0),e([s()],d.prototype,"selectable",void 0),e([s()],d.prototype,"grabbable",void 0),e([s()],d.prototype,"grabbing",void 0),e([s()],d.prototype,"dragging",void 0),e([s()],d.prototype,"hovering",void 0),e([s()],d.prototype,"selected",void 0),e([s()],d.prototype,"cursor",void 0),d=e([n("esri.views.3d.interactive.editingTools.media.MediaElementManipulator3D")],d);const m=c();export{d as MediaElementManipulator3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{valueInUnit as e}from"../../../../../core/quantity.js";import{createScreenPointArray as r,createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{getMetersPerUnitForSR as t}from"../../../../../core/units.js";import{fromValues as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as s,E as i,F as c,e as l,c as a}from"../../../../../chunks/vec32.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{geodesicCompatibleSpatialReference as p,inverseGeodeticSolver as f,InverseGeodeticSolverResult as u,directGeodeticSolver as d}from"../../../../../geometry/geodesicUtils.js";import{projectPoint as j}from"../../../../../geometry/projectionUtils.js";import{projectVectorToVector as g}from"../../../../../geometry/projection/projectVectorToVector.js";import{getNormal as y,fromPositionAndNormal as h,create as R}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as v}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as x}from"../../../../../support/elevationInfoUtils.js";import{OffsetEdgeVertex as C}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function H(e,r,o){const t="on-the-ground"===o.mode?1:0;return new C(e,t,r,0)}function w(e,r,o){const t=m();if(!e.renderCoordsHelper.toRenderCoords(r,t))return null;const n=T(e,r,y(o.plane)),i=T(e,r,o.edgeDirection);if(null==n||null==i)return null;const c=s(m(),n,i);return h(t,c,R())}function T(e,r,o){const t=v(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),n=m(),s=m();return e.renderCoordsHelper.toRenderCoords(r,n)&&e.renderCoordsHelper.toRenderCoords(t,s)?i(s,n,s):null}function U(e,r,o){const t=y(e),c=i(m(),r,o),l=s(m(),c,t),a=s(m(),c,l);return n(c[0],c[1],c[2],0,l[0],l[1],l[2],0,a[0],a[1],a[2],0,0,0,0,1)}function q(e,r,t){const n=t.projectToRenderScreen(e,o()),s=t.projectToRenderScreen(r,o());return null!=n&&null!=s?c(l(n,n,s)):0}function A(e,o,t,n){const{elevationInfo:s,operations:i}=t;if(!i||!e)return null;const c=n.manipulator.elevationAlignedLocation,l=x(c,o,s),a=o.sceneIntersectionHelper.intersectElevationFromScreen(r(e.x,e.y),s,l);return a&&j(a,a,i.data.spatialReference)?a:null}function E(r,o,n,{data:{coordinateHelper:s,spatialReference:i}}){const c=e(r,"meters"),l=t(i),j=Math.sign(c*n.selectedArrow),h=p(i),R=y(n.plane),v=s.pointToXYZ(o),x=m();a(x,v,R,j*(I/l));const C=c*n.selectedArrow/l;if(!h||!g(v,i,v,h)||!g(x,i,x,h))return C;const H=new u;if(f(H,v,x,h),d(x,v,H.azimuth,c,h),!g(x,h,x,i))return C;const w=x[0]-o.x,T=x[1]-o.y,U=Math.sqrt(w*w+T*T)*j,[q,A]=R,E=Math.sqrt(q*q+A*A);return 0===E?0:U/E}const I=10;export{w as createEdgeOffsetIntersectionPlane,H as createEdgeOffsetOperation,U as edgeOffsetRotationMatrix,E as getDistanceInGeometrySR,A as getMapPointAtEdgeOffsetManipulatorElevation,q as screenEdgeLengthSquared};
5
+ import{valueInUnit as e}from"../../../../../core/quantity.js";import{createScreenPointArray as r,createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{getMetersPerUnitForSR as t}from"../../../../../core/units.js";import{fromValues as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as s,D as i,E as c,e as l,c as a}from"../../../../../chunks/vec32.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{geodesicCompatibleSpatialReference as p,inverseGeodeticSolver as f,InverseGeodeticSolverResult as u,directGeodeticSolver as d}from"../../../../../geometry/geodesicUtils.js";import{projectPoint as j}from"../../../../../geometry/projectionUtils.js";import{projectVectorToVector as g}from"../../../../../geometry/projection/projectVectorToVector.js";import{getNormal as y,fromPositionAndNormal as h,create as R}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as v}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as x}from"../../../../../support/elevationInfoUtils.js";import{OffsetEdgeVertex as C}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function H(e,r,o){const t="on-the-ground"===o.mode?1:0;return new C(e,t,r,0)}function w(e,r,o){const t=m();if(!e.renderCoordsHelper.toRenderCoords(r,t))return null;const n=T(e,r,y(o.plane)),i=T(e,r,o.edgeDirection);if(null==n||null==i)return null;const c=s(m(),n,i);return h(t,c,R())}function T(e,r,o){const t=v(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),n=m(),s=m();return e.renderCoordsHelper.toRenderCoords(r,n)&&e.renderCoordsHelper.toRenderCoords(t,s)?i(s,n,s):null}function U(e,r,o){const t=y(e),c=i(m(),r,o),l=s(m(),c,t),a=s(m(),c,l);return n(c[0],c[1],c[2],0,l[0],l[1],l[2],0,a[0],a[1],a[2],0,0,0,0,1)}function q(e,r,t){const n=t.projectToRenderScreen(e,o()),s=t.projectToRenderScreen(r,o());return null!=n&&null!=s?c(l(n,n,s)):0}function A(e,o,t,n){const{elevationInfo:s,operations:i}=t;if(!i||!e)return null;const c=n.manipulator.elevationAlignedLocation,l=x(c,o,s),a=o.sceneIntersectionHelper.intersectElevationFromScreen(r(e.x,e.y),s,l);return a&&j(a,a,i.data.spatialReference)?a:null}function E(r,o,n,{data:{coordinateHelper:s,spatialReference:i}}){const c=e(r,"meters"),l=t(i),j=Math.sign(c*n.selectedArrow),h=p(i),R=y(n.plane),v=s.pointToXYZ(o),x=m();a(x,v,R,j*(I/l));const C=c*n.selectedArrow/l;if(!h||!g(v,i,v,h)||!g(x,i,x,h))return C;const H=new u;if(f(H,v,x,h),d(x,v,H.azimuth,c,h),!g(x,h,x,i))return C;const w=x[0]-o.x,T=x[1]-o.y,U=Math.sqrt(w*w+T*T)*j,[q,A]=R,E=Math.sqrt(q*q+A*A);return 0===E?0:U/E}const I=10;export{w as createEdgeOffsetIntersectionPlane,H as createEdgeOffsetOperation,U as edgeOffsetRotationMatrix,E as getDistanceInGeometrySR,A as getMapPointAtEdgeOffsetManipulatorElevation,q as screenEdgeLengthSquared};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{when as n,watch as a,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as r,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../../core/support/UpdatingHandles.js";import u from"../../../../../geometry/Point.js";import{clonePoint as p}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as c}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{hideManipulatorWhileDragging as h,screenToMap3D as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as g}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as v}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as P}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as y}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as f,resetProperties as w}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as _}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as M}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as S}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as j}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as b}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as L}from"../../../../support/screenUtils.js";let x=class extends P{constructor(t){super(t),this._updatingHandles=new l,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState="initial",this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=i(t=>new S({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new M(new _("point",y(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new d}))}initialize(){const{view:t,analysis:e,analysisViewData:i,visible:r}=this;this.measurementView=new g({toolState:this,view:t,analysis:e,analysisViewData:i,visible:r});const{start:o,end:l,cursor:c}=this.measurementView.createManipulators(),d=(t,e,i)=>{const n=f(t,(t,n,a,s)=>{const r=h(t),o=this._ensureSnappingManager(),l=this._getSnappingContext(s),c=this._updatingHandles,{lineState:d}=this;a=a.next(r).next(w(this,[i,e])).next(i=>{if("cursorPoint"!==e){const i=this.analysis[e];null!=i&&(t.location=i)}return i});const g=m(this.view),v=t=>{const n=g(t);return n||"drawing"!==this.lineState&&"initial"!==this.lineState||(this[e]=null,this[i]=null),n};let P=n.next(r).next(v);if("touch"!==s||"editing"===d){const{snappingStep:t,cancelSnapping:e}=D({snappingManager:o,snappingContext:l,updatingHandles:c});a=a.next(e),P=P.next(...t)}P.next(t=>"start"!==t.action?t:null).next(n=>{const a=p(n.mapEnd,new u);this[e]=a,t.location=a,this[i]=this._surfaceLocation(a,n.surfaceType)})});return"cursorPoint"===e?[n]:[n,t.events.on("grab-changed",()=>{const t=o.grabbing||l.grabbing;this.lineState=t?"editing":"measured"}),a(()=>this.analysis[e],e=>{e&&(t.location=e)})]};this.startManipulator=o,this.endManipulator=l,this.cursorManipulator=c,this.manipulators.add(o),this.manipulators.add(l),this.manipulators.add(c),this.addHandles([...d(o,"startPoint","startPointSurfaceLocation"),...d(l,"endPoint","endPointSurfaceLocation"),...d(c,"cursorPoint","cursorPointSurfaceLocation"),n(()=>"measured"===this.state,()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)},s),a(()=>({startPointAvailable:null!=this.startPoint,endPointAvailable:null!=this.endPoint}),({startPointAvailable:t,endPointAvailable:e})=>{this.startManipulator.available=t,this.endManipulator.available=e},s)]),b(this)}destroy(){this._updatingHandles=e(this._updatingHandles),this.measurementView=e(this.measurementView)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(null==this._snappingManagerResult){const t=j(this.view);this._snappingManagerResult=t,this.addHandles(t)}return this._snappingManagerResult.snappingManager}get state(){const{analysis:t}=this;if(null==t.startPoint&&null==t.endPoint)return"ready";const{lineState:e}=this;return this.validMeasurement&&"editing"!==e&&"drawing"!==e?"measured":"measuring"}get cursor(){return!this.active||"ready"!==this.state&&"measured"===this.lineState?null:"crosshair"}get startPoint(){return this.analysis.startPoint}set startPoint(t){this.analysis.startPoint=t}get endPoint(){return this.analysis.endPoint}set endPoint(t){this.analysis.endPoint=t}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(t){this.measurementView.cursorPoint=t}get snappingOptions(){return this._snappingManager?.options}get validMeasurement(){return null!=this.analysis.startPoint&&null!=this.analysis.endPoint}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}resetCreated(){super.resetCreated(),this.lineState="initial",this.cursorPoint=null,"measured"===this.state&&this.finishToolCreation()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(t){switch(t.type){case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t)}}_handlePointerMove(t){if(!this.active||this.view.navigating)return;const{pointerType:e}=t;if("mouse"!==e)return;const i=L(t),{lineState:n,cursorManipulator:a,endManipulator:s}=this;let r=!1;null==this.cursorPoint&&(this._emulatedDrag?.cancel(),this._emulatedDrag=V(a,e,i),r=!0),"initial"===n&&(this._emulatedDrag?.update(i),r=!0),"drawing"===n&&(s.events.emit("drag",{action:"update",start:i,screenPoint:i}),r=!0),r&&t.stopPropagation()}_handleImmediateClick(t){if(!this.active||!c(t))return;const e=L(t),{pointerType:i}=t,{cursorManipulator:n,startManipulator:a,endManipulator:s,lineState:r}=this;let o=!1;switch(null==this.cursorPoint&&(this._emulatedDrag?.cancel(),this._emulatedDrag=V(n,i,e)),r){case"initial":if(this._emulatedDrag?.update(e),null!=this.cursorPoint){this._emulatedDrag?.end(e),this._emulatedDrag=null,this.endPoint=null;const{cursorPoint:t}=this;this.startPoint=t,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,a.location=t,a.interactive=!1,s.interactive=!1,this.lineState="drawing",this._emulatedDrag=V(s,i,e),o=!0}break;case"drawing":this._emulatedDrag?.update(e),null!=this.endPoint&&(this._emulatedDrag?.end(e),this._emulatedDrag=null,a.interactive=!0,s.interactive=!0,this.lineState="measured",o=!0)}o&&t.stopPropagation()}_surfaceLocation(t,e){return 0===e?"on-the-surface":(t.z??0)>=this._getElevation(t)?"above-the-surface":"below-the-surface"}_getElevation(t){return this.view.basemapTerrain.ready?v(this.view.elevationProvider,t)??0:0}get test(){}};function V(t,e,i){return t.events.emit("drag",{action:"start",pointerType:e,start:i,screenPoint:i}),{update:e=>t.events.emit("drag",{action:"update",start:e,screenPoint:e}),end:e=>t.events.emit("drag",{action:"end",start:e,screenPoint:e}),cancel:()=>t.events.emit("drag",{action:"cancel"})}}t([r()],x.prototype,"_snappingManagerResult",void 0),t([r()],x.prototype,"_snappingManager",null),t([r({readOnly:!0})],x.prototype,"state",null),t([r()],x.prototype,"lineState",void 0),t([r({readOnly:!0})],x.prototype,"cursor",null),t([r()],x.prototype,"startPoint",null),t([r()],x.prototype,"endPoint",null),t([r()],x.prototype,"cursorPoint",null),t([r({constructOnly:!0})],x.prototype,"analysis",void 0),t([r({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([r()],x.prototype,"measurementView",void 0),t([r()],x.prototype,"removeIncompleteOnCancel",void 0),t([r({constructOnly:!0})],x.prototype,"view",void 0),t([r({readOnly:!0})],x.prototype,"validMeasurement",null),t([r({value:null})],x.prototype,"startPointSurfaceLocation",void 0),t([r({value:null})],x.prototype,"endPointSurfaceLocation",void 0),t([r({value:null})],x.prototype,"cursorPointSurfaceLocation",void 0),t([r()],x.prototype,"updating",null),x=t([o("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool")],x);export{x as default};
5
+ import{__decorate as t}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{when as n,watch as a,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as r,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../../core/support/UpdatingHandles.js";import u from"../../../../../geometry/Point.js";import{clonePoint as p}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as c}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{hideManipulatorWhileDragging as h,screenToMap3D as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as g}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as v}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as P}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as y}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as f,resetProperties as w}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as _}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as M}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as S}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as j}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as b}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as L}from"../../../../support/screenUtils.js";let x=class extends P{constructor(t){super(t),this._updatingHandles=new l,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState="initial",this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=i(t=>new S({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new M(new _("point",y(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new d}))}initialize(){const{view:t,analysis:e,analysisViewData:i,visible:r}=this;this.measurementView=new g({toolState:this,view:t,analysis:e,analysisViewData:i,visible:r});const{start:o,end:l,cursor:c}=this.measurementView.createManipulators(),d=(t,e,i)=>{const n=f(t,(t,n,a,s)=>{const r=h(t),o=this._ensureSnappingManager(),l=this._getSnappingContext(s),c=this._updatingHandles,{lineState:d}=this;a=a.next(r).next(w(this,[i,e])).next(i=>{if("cursorPoint"!==e){const i=this.analysis[e];null!=i&&(t.location=i)}return i});const g=m(this.view),v=t=>{const n=g(t);return n||"drawing"!==this.lineState&&"initial"!==this.lineState||(this[e]=null,this[i]=null),n};let P=n.next(r).next(v);if("touch"!==s||"editing"===d){const{snappingStep:t,cancelSnapping:e}=D({snappingManager:o,snappingContext:l,updatingHandles:c});a=a.next(e),P=P.next(...t)}P.next(t=>"start"!==t.action?t:null).next(n=>{const a=p(n.mapEnd,new u);this[e]=a,t.location=a,this[i]=this._surfaceLocation(a,n.surfaceType)})});return"cursorPoint"===e?[n]:[n,t.events.on("grab-changed",()=>{const t=o.grabbing||l.grabbing;this.lineState=t?"editing":"measured"}),a(()=>this.analysis[e],e=>{e&&(t.location=e)})]};this.startManipulator=o,this.endManipulator=l,this.cursorManipulator=c,this.manipulators.add(o),this.manipulators.add(l),this.manipulators.add(c),this.addHandles([...d(o,"startPoint","startPointSurfaceLocation"),...d(l,"endPoint","endPointSurfaceLocation"),...d(c,"cursorPoint","cursorPointSurfaceLocation"),n(()=>"measured"===this.state,()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)},s),a(()=>({startPointAvailable:null!=this.startPoint,endPointAvailable:null!=this.endPoint}),({startPointAvailable:t,endPointAvailable:e})=>{this.startManipulator.available=t,this.endManipulator.available=e},s)]),b(this)}destroy(){this._updatingHandles=e(this._updatingHandles),this.measurementView=e(this.measurementView)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(null==this._snappingManagerResult){const t=j(this.view);this._snappingManagerResult=t,this.addHandles(t)}return this._snappingManagerResult.snappingManager}get state(){const{analysis:t}=this;if(null==t.startPoint&&null==t.endPoint)return"ready";const{lineState:e}=this;return this.validMeasurement&&"editing"!==e&&"drawing"!==e?"measured":"measuring"}get cursor(){return!this.active||"ready"!==this.state&&"measured"===this.lineState?null:"crosshair"}get startPoint(){return this.analysis.startPoint}set startPoint(t){this.analysis.startPoint=t}get endPoint(){return this.analysis.endPoint}set endPoint(t){this.analysis.endPoint=t}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(t){this.measurementView.cursorPoint=t}get snappingOptions(){return this._snappingManager?.options}get validMeasurement(){return null!=this.analysis.startPoint&&null!=this.analysis.endPoint}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}resetCreated(){super.resetCreated(),this.lineState="initial",this.cursorPoint=null,"measured"===this.state&&this.finishToolCreation()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(t){switch(t.type){case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t)}}_handlePointerMove(t){if(!this.active||this.view.navigating)return;const{pointerType:e}=t;if("mouse"!==e)return;const i=L(t),{lineState:n,cursorManipulator:a,endManipulator:s}=this;let r=!1;null==this.cursorPoint&&(this._emulatedDrag?.cancel(),this._emulatedDrag=V(a,e,i),r=!0),"initial"===n&&(this._emulatedDrag?.update(i),r=!0),"drawing"===n&&(s.events.emit("drag",{action:"update",start:i,screenPoint:i}),r=!0),r&&t.stopPropagation()}_handleImmediateClick(t){if(!this.active||!c(t))return;const e=L(t),{pointerType:i}=t,{cursorManipulator:n,startManipulator:a,endManipulator:s,lineState:r}=this;let o=!1;switch(null==this.cursorPoint&&(this._emulatedDrag?.cancel(),this._emulatedDrag=V(n,i,e)),r){case"initial":if(this._emulatedDrag?.update(e),null!=this.cursorPoint){this._emulatedDrag?.end(e),this._emulatedDrag=null,this.endPoint=null;const{cursorPoint:t}=this;this.startPoint=t,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,a.location=t,a.interactive=!1,s.interactive=!1,this.lineState="drawing",this._emulatedDrag=V(s,i,e),o=!0}break;case"drawing":this._emulatedDrag?.update(e),null!=this.endPoint&&(this._emulatedDrag?.end(e),this._emulatedDrag=null,a.interactive=!0,s.interactive=!0,this.lineState="measured",o=!0)}o&&t.stopPropagation()}_surfaceLocation(t,e){return 0===e?"on-the-surface":(t.z??0)>=this._getElevation(t)?"above-the-surface":"below-the-surface"}_getElevation(t){return this.view.groundView?.ready?v(this.view.elevationProvider,t)??0:0}get test(){}};function V(t,e,i){return t.events.emit("drag",{action:"start",pointerType:e,start:i,screenPoint:i}),{update:e=>t.events.emit("drag",{action:"update",start:e,screenPoint:e}),end:e=>t.events.emit("drag",{action:"end",start:e,screenPoint:e}),cancel:()=>t.events.emit("drag",{action:"cancel"})}}t([r()],x.prototype,"_snappingManagerResult",void 0),t([r()],x.prototype,"_snappingManager",null),t([r({readOnly:!0})],x.prototype,"state",null),t([r()],x.prototype,"lineState",void 0),t([r({readOnly:!0})],x.prototype,"cursor",null),t([r()],x.prototype,"startPoint",null),t([r()],x.prototype,"endPoint",null),t([r()],x.prototype,"cursorPoint",null),t([r({constructOnly:!0})],x.prototype,"analysis",void 0),t([r({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([r()],x.prototype,"measurementView",void 0),t([r()],x.prototype,"removeIncompleteOnCancel",void 0),t([r({constructOnly:!0})],x.prototype,"view",void 0),t([r({readOnly:!0})],x.prototype,"validMeasurement",null),t([r({value:null})],x.prototype,"startPointSurfaceLocation",void 0),t([r({value:null})],x.prototype,"endPointSurfaceLocation",void 0),t([r({value:null})],x.prototype,"cursorPointSurfaceLocation",void 0),t([r()],x.prototype,"updating",null),x=t([o("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool")],x);export{x 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{d as e,e as t,m as r,q as i}from"../../../../chunks/vec32.js";import{create as s,fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a,d as o}from"../../../../chunks/vec42.js";import{fromValues as l,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as d,create as _,getStart as p,getEnd as c}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as u}from"../../../../geometry/support/frustum.js";import{create as m,fromPoints as f,pointAt as y}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPoints as b}from"../../../../geometry/support/ray.js";import{EngineVisualElement as D}from"./EngineVisualElement.js";import{LaserlineVisualElement as w}from"./LaserlineVisualElement.js";import{drapedZ as O}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as j}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as C}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as E}from"../../webgl-engine/materials/RibbonLineMaterial.js";class G extends D{constructor(e){super(e),this._ray=g(),this._isWorldDown=!1,this._start=s(),this._end=n(1,0,0),this._width=1,this._color=l(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=l(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._fadedExtensions=A,this._laserline=new w({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:x,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:x,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(r){this._isWorldDown=!0,e(this._start,r),this.view.renderCoordsHelper.worldUpAtPosition(r,this._end),t(this._end,r,this._end),b(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,r(this._start,t)||(e(this._start,t),b(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,r(this._end,t)||(e(this._end,t),b(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){null!=e&&null!=this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=null!=e?h(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&null!=this._laserlineStyle&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&8===this._renderOccluded?4:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??A,this.recreateGeometry()}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){const t=new E(this.materialParameters,this.view.state.isGlobal),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const i=this._createGeometry(e);r.push(i),t.addGeometry(i),this._updateVerticesObject3D(t)}_createDrapedResources(){const e=new E(this.materialParameters,this.view.state.isGlobal);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){const t=this._createGeometry(e);return this._updateVerticesDraped(t),new C(t)}_createGeometry(e){const t=3===this.extensionType,r=t?[s(),s(),s(),s()]:[s(),s()];return j(e,r,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return 3===this._extensionType?this._updateLineSegmentFinite(M):this._updateLineSegmentInfinite(this._extensionType,M)}_updateLineSegmentFinite(e){return f(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const r=this.view.state.camera;switch(d(this._ray,P),e){case 0:P.c0=-Number.MAX_VALUE;break;case 1:case 2:{const e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground")??0,r=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&r<t&&i(P.ray.direction,P.ray.direction),2===this._extensionType&&null!=t&&(P.c1=Math.abs(r-t));break}}if(!u(r.frustum,P))return this._updateLineSegmentFinite(t);const s=p(P,v),n=c(P,R);return f(s,n,t)}_updateVertexAttributesObject3D(e,t){const r=e.geometries[0].getMutableAttribute("position")?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=s[2];e.geometryVertexAttributeUpdated(e.geometries[0],"position")}_updateVertexAttributesDraped(e,t){const r=e.getMutableAttribute("position")?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=O;e.invalidateBoundingInfo()}*_lineVertices(e){3===this.extensionType?(yield y(e,-this.fadedExtensions.start,v),yield y(e,0,v),yield y(e,1,v),yield y(e,1+this.fadedExtensions.end,v)):(yield y(e,0,v),yield y(e,1,v))}}function x(e){e.geometries=[]}const P=_(),v=s(),R=s(),M=m(),V=1/3,A={start:V,end:V};export{G as ExtendedLineVisualElement};
5
+ import"../../../../core/has.js";import{d as e,e as t,m as r,q as i}from"../../../../chunks/vec32.js";import{create as s,fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a,f as o}from"../../../../chunks/vec42.js";import{fromValues as l,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromRay as d,create as _,getStart as p,getEnd as c}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as u}from"../../../../geometry/support/frustum.js";import{create as f,fromPoints as m,pointAt as y}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPoints as b}from"../../../../geometry/support/ray.js";import{EngineVisualElement as D}from"./EngineVisualElement.js";import{LaserlineVisualElement as w}from"./LaserlineVisualElement.js";import{drapedZ as O}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as j}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as C}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as E}from"../../webgl-engine/materials/RibbonLineMaterial.js";class G extends D{constructor(e){super(e),this._ray=g(),this._isWorldDown=!1,this._start=s(),this._end=n(1,0,0),this._width=1,this._color=l(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=l(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=0,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=4,this._fadedExtensions=A,this._laserline=new w({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:x,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:x,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(r){this._isWorldDown=!0,e(this._start,r),this.view.renderCoordsHelper.worldUpAtPosition(r,this._end),t(this._end,r,this._end),b(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,r(this._start,t)||(e(this._start,t),b(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,r(this._end,t)||(e(this._end,t),b(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){null!=e&&null!=this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=null!=e?h(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&null!=this._laserlineStyle&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&8===this._renderOccluded?4:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??A,this.recreateGeometry()}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){const t=new E(this.materialParameters,this.view.state.isGlobal),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const i=this._createGeometry(e);r.push(i),t.addGeometry(i),this._updateVerticesObject3D(t)}_createDrapedResources(){const e=new E(this.materialParameters,this.view.state.isGlobal);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){const t=this._createGeometry(e);return this._updateVerticesDraped(t),new C(t)}_createGeometry(e){const t=3===this.extensionType,r=t?[s(),s(),s(),s()]:[s(),s()];return j(e,r,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return 3===this._extensionType?this._updateLineSegmentFinite(M):this._updateLineSegmentInfinite(this._extensionType,M)}_updateLineSegmentFinite(e){return m(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const r=this.view.state.camera;switch(d(this._ray,P),e){case 0:P.c0=-Number.MAX_VALUE;break;case 1:case 2:{const e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground")??0,r=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&r<t&&i(P.ray.direction,P.ray.direction),2===this._extensionType&&null!=t&&(P.c1=Math.abs(r-t));break}}if(!u(r.frustum,P))return this._updateLineSegmentFinite(t);const s=p(P,v),n=c(P,R);return m(s,n,t)}_updateVertexAttributesObject3D(e,t){const r=e.geometries[0].getMutableAttribute("position")?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=s[2];e.geometryVertexAttributeUpdated(e.geometries[0],"position")}_updateVertexAttributesDraped(e,t){const r=e.getMutableAttribute("position")?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=O;e.invalidateBoundingInfo()}*_lineVertices(e){3===this.extensionType?(yield y(e,-this.fadedExtensions.start,v),yield y(e,0,v),yield y(e,1,v),yield y(e,1+this.fadedExtensions.end,v)):(yield y(e,0,v),yield y(e,1,v))}}function x(e){e.geometries=[]}const P=_(),v=s(),R=s(),M=f(),V=1/3,A={start:V,end:V};export{G as ExtendedLineVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{getTranslation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{copy as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as o}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as s,d as c}from"../../../../chunks/vec42.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import{Attribute as h}from"../../webgl-engine/lib/Attribute.js";import{Geometry as n}from"../../webgl-engine/lib/Geometry.js";import{CheckerBoardMaterial as d}from"../../webgl-engine/materials/CheckerBoardMaterial.js";class m extends l{constructor(e){super(e),this._checkerBoardMaterial=null,this._renderOccluded=4,this._geometry=null,this._size=t(1,1),this._color1=a(1,.5,0,.5),this._color2=a(1,1,1,.5),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){r(this._size,e),this._updateMaterial()}get color1(){return this._color1}set color1(e){s(e,this._color1)||(c(this._color1,e),this._updateMaterial())}get color2(){return this._color2}set color2(e){s(e,this._color2)||(c(this._color2,e),this._updateMaterial())}_updateMaterial(){this._checkerBoardMaterial?.setParameters({size:this._size,color1:this._color1,color2:this._color2,renderOccluded:this._renderOccluded})}createExternalResources(){this._checkerBoardMaterial=new d({size:this._size,color1:this._color1,color2:this._color2,writeDepth:!1,polygonOffset:!0,renderOccluded:4,isDecoration:this.isDecoration})}destroyExternalResources(){this._checkerBoardMaterial=null}forEachMaterial(e){e(this._checkerBoardMaterial)}createGeometries(r){if(null==this._geometry||null==this._checkerBoardMaterial)return;const t=_;e(t,this.transform);const s=this._geometry,c=[],a=i();s.position.forEach(e=>{o(a,e,t),c.push(a[0],a[1],a[2])});const l=[];s.uv.forEach(e=>{l.push(e[0],e[1])});const d=new n(this._checkerBoardMaterial,[["position",new h(c,s.triangleIndices,3,!0)],["uv0",new h(l,s.triangleIndices,2,!0)]]);r.addGeometry(d)}}const _=i();export{m as MeasurementAreaVisualElement};
5
+ import{getTranslation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{copy as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as o}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as s,f as c}from"../../../../chunks/vec42.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import{Attribute as h}from"../../webgl-engine/lib/Attribute.js";import{Geometry as n}from"../../webgl-engine/lib/Geometry.js";import{CheckerBoardMaterial as d}from"../../webgl-engine/materials/CheckerBoardMaterial.js";class m extends l{constructor(e){super(e),this._checkerBoardMaterial=null,this._renderOccluded=4,this._geometry=null,this._size=t(1,1),this._color1=a(1,.5,0,.5),this._color2=a(1,1,1,.5),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){r(this._size,e),this._updateMaterial()}get color1(){return this._color1}set color1(e){s(e,this._color1)||(c(this._color1,e),this._updateMaterial())}get color2(){return this._color2}set color2(e){s(e,this._color2)||(c(this._color2,e),this._updateMaterial())}_updateMaterial(){this._checkerBoardMaterial?.setParameters({size:this._size,color1:this._color1,color2:this._color2,renderOccluded:this._renderOccluded})}createExternalResources(){this._checkerBoardMaterial=new d({size:this._size,color1:this._color1,color2:this._color2,writeDepth:!1,polygonOffset:!0,renderOccluded:4,isDecoration:this.isDecoration})}destroyExternalResources(){this._checkerBoardMaterial=null}forEachMaterial(e){e(this._checkerBoardMaterial)}createGeometries(r){if(null==this._geometry||null==this._checkerBoardMaterial)return;const t=_;e(t,this.transform);const s=this._geometry,c=[],a=i();s.position.forEach(e=>{o(a,e,t),c.push(a[0],a[1],a[2])});const l=[];s.uv.forEach(e=>{l.push(e[0],e[1])});const d=new n(this._checkerBoardMaterial,[["position",new h(c,s.triangleIndices,3,!0)],["uv0",new h(l,s.triangleIndices,2,!0)]]);r.addGeometry(d)}}const _=i();export{m as MeasurementAreaVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{colorVectorEquals as t}from"../../../../core/colorUtils.js";import e from"../../../../core/Handles.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as i,e as a,a as n,f as h,B as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{d}from"../../../../chunks/vec42.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as p}from"./Object3DVisualElement.js";import{headingTiltToDirectionUp as g}from"../../support/cameraUtils.js";import{createDirectionUp as u}from"../../support/cameraUtilsInternal.js";import{createPolylineGeometry as w}from"../../webgl-engine/lib/GeometryUtil.js";import{MeasurementArrowMaterial as f}from"../../webgl-engine/materials/MeasurementArrowMaterial.js";class C extends p{constructor(t){super(t),this._arrowWidth=16,this._arrowSubdivisions=128,this._origin=c(),this._originTransform=o(),this._arrowCenter=c(),this._renderOccluded=4,this._geometry=null,this._stripeLength=1,this._stripesEnabled=!0,this._color=_(),this._contrastColor=_(),this.applyProperties(t)}get renderOccluded(){return this._renderOccluded}set renderOccluded(t){t!==this._renderOccluded&&(this._renderOccluded=t,this._arrowMaterial?.setParameters({renderOccluded:t}))}get geometry(){return this._geometry}set geometry(t){this._geometry=t,this._geometryChanged()}get stripeLength(){return this._stripeLength}set stripeLength(t){this._stripeLength=t,this.attached&&this._arrowMaterial.setParameters({stripeLength:this._stripeLength})}get stripesEnabled(){return this._stripesEnabled}set stripesEnabled(t){if(this._stripesEnabled=t,this.attached){const t=this._stripesEnabled?this._contrastColor:this._color;this._arrowMaterial.setParameters({stripeEvenColor:t})}}get color(){return this._color}set color(e){t(e,this._color)||(d(this._color,e),this._updateArrowColor())}get contrastColor(){return this._contrastColor}set contrastColor(e){t(e,this._color)||(d(this._contrastColor,e),this._updateArrowColor())}createExternalResources(){const t=this._color,r=this._contrastColor,o=this._stripesEnabled?r:t;this._arrowMaterial=new f({outlineColor:t,stripeEvenColor:o,stripeOddColor:t,renderOccluded:this.renderOccluded,polygonOffset:!0,isDecoration:this.isDecoration}),this._handles=new e,this._handles.add(s(()=>this.view.state.camera,()=>{this._viewChanged()}))}destroyExternalResources(){this._arrowMaterial=null,this._handles=r(this._handles)}forEachMaterial(t){t(this._arrowMaterial)}createGeometries(t){if(null==this._geometry?.startRenderSpace||null==this._geometry.endRenderSpace)return;const e=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);e.transformation=this._originTransform,t.addGeometry(e),this._viewChanged()}_createArrowGeometry(t,e,r,s){const o=this.view,n=o.renderCoordsHelper,h=[],l=[],c=(t,e)=>{const s=m.get();a(s,t,r),h.push(s),l.push(e)};if("euclidean"===s.type){s.eval(.5,this._arrowCenter);const r=m.get();if(n.worldUpAtPosition(this._arrowCenter,r),y(t,e,r)){const{heading:e,tilt:s}=o.camera,{direction:a}=g(o,t,e,s,b);i(r,a)}c(t,r),c(e,r)}else{s.eval(.5,this._arrowCenter);const t=this._arrowSubdivisions+1&-2;for(let e=0;e<t;++e){const r=e/(t-1),o=m.get(),i=m.get();s.eval(r,o),n.worldUpAtPosition(o,i),c(o,i)}}return w(this._arrowMaterial,h,l)}_geometryChanged(){this.recreateGeometry()}_viewChanged(){if(this.view.ready&&this.attached&&null!=this._geometry){const t=this.view.state.camera.computeScreenPixelSizeAt(this._arrowCenter);this._arrowMaterial.setParameters({width:this._arrowWidth*t})}}_updateArrowColor(){if(!this.attached)return;const t=this._color,e=this._contrastColor,r=this._stripesEnabled?e:t,s=t,o=t;this._arrowMaterial.setParameters({stripeEvenColor:r,outlineColor:s,stripeOddColor:o})}}function y(t,e,r){const s=n(v,e,t),o=h(v,s,r);return 0===l(o)}const v=c(),b=u();export{C as MeasurementArrowVisualElement};
5
+ import{colorVectorEquals as t}from"../../../../core/colorUtils.js";import e from"../../../../core/Handles.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as i,e as a,a as n,f as h,H as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as d}from"../../../../chunks/vec42.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as p}from"./Object3DVisualElement.js";import{headingTiltToDirectionUp as g}from"../../support/cameraUtils.js";import{createDirectionUp as u}from"../../support/cameraUtilsInternal.js";import{createPolylineGeometry as w}from"../../webgl-engine/lib/GeometryUtil.js";import{MeasurementArrowMaterial as f}from"../../webgl-engine/materials/MeasurementArrowMaterial.js";class C extends p{constructor(t){super(t),this._arrowWidth=16,this._arrowSubdivisions=128,this._origin=c(),this._originTransform=o(),this._arrowCenter=c(),this._renderOccluded=4,this._geometry=null,this._stripeLength=1,this._stripesEnabled=!0,this._color=_(),this._contrastColor=_(),this.applyProperties(t)}get renderOccluded(){return this._renderOccluded}set renderOccluded(t){t!==this._renderOccluded&&(this._renderOccluded=t,this._arrowMaterial?.setParameters({renderOccluded:t}))}get geometry(){return this._geometry}set geometry(t){this._geometry=t,this._geometryChanged()}get stripeLength(){return this._stripeLength}set stripeLength(t){this._stripeLength=t,this.attached&&this._arrowMaterial.setParameters({stripeLength:this._stripeLength})}get stripesEnabled(){return this._stripesEnabled}set stripesEnabled(t){if(this._stripesEnabled=t,this.attached){const t=this._stripesEnabled?this._contrastColor:this._color;this._arrowMaterial.setParameters({stripeEvenColor:t})}}get color(){return this._color}set color(e){t(e,this._color)||(d(this._color,e),this._updateArrowColor())}get contrastColor(){return this._contrastColor}set contrastColor(e){t(e,this._color)||(d(this._contrastColor,e),this._updateArrowColor())}createExternalResources(){const t=this._color,r=this._contrastColor,o=this._stripesEnabled?r:t;this._arrowMaterial=new f({outlineColor:t,stripeEvenColor:o,stripeOddColor:t,renderOccluded:this.renderOccluded,polygonOffset:!0,isDecoration:this.isDecoration}),this._handles=new e,this._handles.add(s(()=>this.view.state.camera,()=>{this._viewChanged()}))}destroyExternalResources(){this._arrowMaterial=null,this._handles=r(this._handles)}forEachMaterial(t){t(this._arrowMaterial)}createGeometries(t){if(null==this._geometry?.startRenderSpace||null==this._geometry.endRenderSpace)return;const e=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);e.transformation=this._originTransform,t.addGeometry(e),this._viewChanged()}_createArrowGeometry(t,e,r,s){const o=this.view,n=o.renderCoordsHelper,h=[],l=[],c=(t,e)=>{const s=m.get();a(s,t,r),h.push(s),l.push(e)};if("euclidean"===s.type){s.eval(.5,this._arrowCenter);const r=m.get();if(n.worldUpAtPosition(this._arrowCenter,r),y(t,e,r)){const{heading:e,tilt:s}=o.camera,{direction:a}=g(o,t,e,s,b);i(r,a)}c(t,r),c(e,r)}else{s.eval(.5,this._arrowCenter);const t=this._arrowSubdivisions+1&-2;for(let e=0;e<t;++e){const r=e/(t-1),o=m.get(),i=m.get();s.eval(r,o),n.worldUpAtPosition(o,i),c(o,i)}}return w(this._arrowMaterial,h,l)}_geometryChanged(){this.recreateGeometry()}_viewChanged(){if(this.view.ready&&this.attached&&null!=this._geometry){const t=this.view.state.camera.computeScreenPixelSizeAt(this._arrowCenter);this._arrowMaterial.setParameters({width:this._arrowWidth*t})}}_updateArrowColor(){if(!this.attached)return;const t=this._color,e=this._contrastColor,r=this._stripesEnabled?e:t,s=t,o=t;this._arrowMaterial.setParameters({stripeEvenColor:r,outlineColor:s,stripeOddColor:o})}}function y(t,e,r){const s=n(v,e,t),o=h(v,s,r);return 0===l(o)}const v=c(),b=u();export{C as MeasurementArrowVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{EventEmitter as e}from"../../../../core/Evented.js";import{h as t,i as r,j as i}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a,d as o}from"../../../../chunks/vec42.js";import{fromValues as n,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as h}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as c}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as m}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as p}from"../../../../support/elevationInfoUtils.js";import u from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as _}from"./EngineVisualElement.js";import{LaserlineVisualElement as f}from"./LaserlineVisualElement.js";import{ElevationContext as g}from"../../layers/graphics/ElevationContext.js";import{createGeometry as y}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as O,geometryToRenderInfo as C}from"../../support/renderInfoUtils/line.js";import{RenderGeometry as v}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as w}from"../../webgl-engine/materials/RibbonLineMaterial.js";class R extends _{constructor(t){super(t),this._attachmentOrigin=m(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._geometry=null,this._width=1,this._color=n(1,0,1,1),this._innerWidth=0,this._innerColor=n(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=8,this._attachmentOrigin.spatialReference=t.view.spatialReference,this._laserline=new f({view:t.view,isDecoration:t.isDecoration}),this.applyProperties(t),this.attached=t.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:b,recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)},forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:b,recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()},forEachMaterial:(e,t)=>t(e.material)}}get _laserlineAttached(){return this.attached&&this.visible&&null!=this._laserlineStyle&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}get geometry(){return this._geometry}set geometry(e){const t=this._isClosed;this._geometry=e,this.recreateGeometry(),t!==this._isClosed&&this._updateMaterial()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=e?l(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){if(!this._attachmentOriginDirty)return this._attachmentOrigin;const e=this.object3dResources.resources?.geometries;if(!e||0===e.length)return null;t(D,0,0,0);let s=0;for(const t of e)t.computeAttachmentOrigin(j)&&(r(D,D,j),s++);return 0===s?null:(i(D,D,1/s),this.view.renderCoordsHelper.fromRenderCoords(D,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){this.object3dResources.resources?.material.setParameters(this._materialParameters),this.drapedResources.resources?.material.setParameters(this._materialParameters)}get _isClosed(){return null!=this.geometry&&"polygon"===this.geometry.type}get _materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this._isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:"round",hasPolygonOffset:!0,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration}}get _normalizedRenderOccluded(){return this.isDraped&&8===this._renderOccluded?4:this._renderOccluded}_recreateGeometry(e,t,r){this._createRenderGeometries(t,r);for(const i of r)e.addGeometry(i);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit("attachment-origin-changed")}_createObject3DResources(e){const t=new w(this._materialParameters,this.view.state.isGlobal),r=new Array;return this._recreateGeometry(e,t,r),{material:t,geometries:r}}_createDrapedResources(){const e=new w(this._materialParameters,this.view.state.isGlobal);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){const{geometry:t,view:r}=this,i=r.basemapTerrain.spatialReference;if(null==t||null==i)return[];return O(t,i).lines.map(({position:t})=>{const s={overlayInfo:{spatialReference:i,renderCoordsHelper:r.renderCoordsHelper},attributeData:{position:t},removeDuplicateStartEnd:this._isClosed};return new v(y(e,s))})}calculateMapBounds(e){if(null==this.object3dResources.resources)return!1;const t=this.view.renderCoordsHelper;for(const r of this.object3dResources.resources.geometries){const i=r.attributes.get("position"),s=d(i.data.length);h(i.data,t.spatialReference,0,s,this.view.spatialReference,0),c(e,s)}return!0}_createRenderGeometries(e,t){const r=this.geometry;if(null==r)return;const i=C(r,this.view.elevationProvider,this.view.renderCoordsHelper,g.fromElevationInfo(this.elevationInfo??new u({mode:p(r,null)}))),s=new Array;for(const{position:a,mapPositions:o}of i.lines){const r={mapPositions:o,attributeData:{position:a},removeDuplicateStartEnd:this._isClosed};t.push(y(e,r)),s.push(a)}this._laserline.pathVerticalPlane=s}}function b(e){e.geometries=[]}const j=s(),D=s();export{R as OutlineVisualElement};
5
+ import{EventEmitter as e}from"../../../../core/Evented.js";import{h as t,i as r,j as i}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a,f as o}from"../../../../chunks/vec42.js";import{fromValues as n,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as h}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as c}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as m}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as p}from"../../../../support/elevationInfoUtils.js";import u from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as _}from"./EngineVisualElement.js";import{LaserlineVisualElement as f}from"./LaserlineVisualElement.js";import{ElevationContext as g}from"../../layers/graphics/ElevationContext.js";import{createGeometry as y}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as O,geometryToRenderInfo as C}from"../../support/renderInfoUtils/line.js";import{RenderGeometry as v}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as w}from"../../webgl-engine/materials/RibbonLineMaterial.js";class R extends _{constructor(t){super(t),this._attachmentOrigin=m(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._geometry=null,this._width=1,this._color=n(1,0,1,1),this._innerWidth=0,this._innerColor=n(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=8,this._attachmentOrigin.spatialReference=t.view.spatialReference,this._laserline=new f({view:t.view,isDecoration:t.isDecoration}),this.applyProperties(t),this.attached=t.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:b,recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)},forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:b,recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()},forEachMaterial:(e,t)=>t(e.material)}}get _laserlineAttached(){return this.attached&&this.visible&&null!=this._laserlineStyle&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}get geometry(){return this._geometry}set geometry(e){const t=this._isClosed;this._geometry=e,this.recreateGeometry(),t!==this._isClosed&&this._updateMaterial()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=e?l(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){if(!this._attachmentOriginDirty)return this._attachmentOrigin;const e=this.object3dResources.resources?.geometries;if(!e||0===e.length)return null;t(D,0,0,0);let s=0;for(const t of e)t.computeAttachmentOrigin(j)&&(r(D,D,j),s++);return 0===s?null:(i(D,D,1/s),this.view.renderCoordsHelper.fromRenderCoords(D,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){this.object3dResources.resources?.material.setParameters(this._materialParameters),this.drapedResources.resources?.material.setParameters(this._materialParameters)}get _isClosed(){return null!=this.geometry&&"polygon"===this.geometry.type}get _materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this._isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:"round",hasPolygonOffset:!0,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration}}get _normalizedRenderOccluded(){return this.isDraped&&8===this._renderOccluded?4:this._renderOccluded}_recreateGeometry(e,t,r){this._createRenderGeometries(t,r);for(const i of r)e.addGeometry(i);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit("attachment-origin-changed")}_createObject3DResources(e){const t=new w(this._materialParameters,this.view.state.isGlobal),r=new Array;return this._recreateGeometry(e,t,r),{material:t,geometries:r}}_createDrapedResources(){const e=new w(this._materialParameters,this.view.state.isGlobal);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){const{geometry:t,view:r}=this,i=r.basemapTerrain.spatialReference;if(null==t||null==i)return[];return O(t,i).lines.map(({position:t})=>{const s={overlayInfo:{spatialReference:i,renderCoordsHelper:r.renderCoordsHelper},attributeData:{position:t},removeDuplicateStartEnd:this._isClosed};return new v(y(e,s))})}calculateMapBounds(e){if(null==this.object3dResources.resources)return!1;const t=this.view.renderCoordsHelper;for(const r of this.object3dResources.resources.geometries){const i=r.attributes.get("position"),s=d(i.data.length);h(i.data,t.spatialReference,0,s,this.view.spatialReference,0),c(e,s)}return!0}_createRenderGeometries(e,t){const r=this.geometry;if(null==r)return;const i=C(r,this.view.elevationProvider,this.view.renderCoordsHelper,g.fromElevationInfo(this.elevationInfo??new u({mode:p(r,null)}))),s=new Array;for(const{position:a,mapPositions:o}of i.lines){const r={mapPositions:o,attributeData:{position:a},removeDuplicateStartEnd:this._isClosed};t.push(y(e,r)),s.push(a)}this._laserline.pathVerticalPlane=s}}function b(e){e.geometries=[]}const j=s(),D=s();export{R as OutlineVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{watch as e}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as t,castScreenPointArray as r}from"../../../../core/screenUtils.js";import{normalize as i,subtract as s,scale as o,set as a,add as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{m as d,d as h,n as l,e as m,i as u}from"../../../../chunks/vec32.js";import{create as p,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as f,d as g}from"../../../../chunks/vec42.js";import{fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeDehydratedPoint as y}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as j}from"./EngineVisualElement.js";import{drapedZ as D}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as G}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as w}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as R}from"../../webgl-engine/materials/RibbonLineMaterial.js";class O extends j{constructor(e){super(e),this._location=p(),this._direction=_(1,0,0),this._width=1,this._offset=1,this._length=18,this._color=b(1,0,1,1),this._renderOccluded=4,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:V,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:M,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}get location(){return this._location}set location(e){d(this._location,e)||(h(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){d(this._direction,e)||(h(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){l(this._direction,m(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){f(e,this._color)||(g(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}_createObject3DResources(e){const t=new R(this.materialParameters,this.view.state.isGlobal),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const[i,s]=v(e);t.addGeometry(i),t.addGeometry(s),r.push(i),r.push(s),this._updateVerticesObject3D(t)}_createDrapedResources(){const t=new R(this.materialParameters,this.view.state.isGlobal),r=e(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry());return{material:t,geometries:this._createDrapedGeometry(t),pixelRatioHandle:r}}_recreateDrapedGeometry(e){e.geometries=this._createDrapedGeometry(e.material)}_createDrapedGeometry(e){const t=v(e);return this._updateVerticesDraped(t),t.map(e=>new w(e))}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this.view.state.camera;t.projectToScreen(this.location,U),u(P,this.location,this.direction),t.projectToScreen(P,E),i(E,s(E,E,U)),this._updateVertexAttributesObject3D(t,e,0,U,E,1),this._updateVertexAttributesObject3D(t,e,1,U,E,-1)}_updateVertexAttributesObject3D(e,t,i,s,o,a){const c=t.geometries[i],n=c.getMutableAttribute("position")?.data;if(!n)return;const{start:d,end:h}=x(o,s,a,this.offset,this.width,this.length);e.unprojectFromScreen(r(d),P),n[0]=P[0],n[1]=P[1],n[2]=P[2],e.unprojectFromScreen(r(h),P),n[3]=P[0],n[4]=P[1],n[5]=P[2],t.geometryVertexAttributeUpdated(c,"position")}_updateVerticesDraped(e){const{view:{overlayManager:t,state:{contentPixelRatio:r}}}=this,{location:i,width:s,length:o,offset:a}=this,c=k;c.spatialReference=t.spatialReference,c.x=i[0],c.y=i[1];const n=this.view.overlayPixelSizeInMapUnits(c)*r,d=s*n,h=o*n,l=a*n;this._updateVertexAttributesDraped(e[0],d,h,l,-1),this._updateVertexAttributesDraped(e[1],d,h,l,1)}_updateVertexAttributesDraped(e,t,r,i,s){const o=e.getMutableAttribute("position")?.data;if(!o)return;const{location:a,direction:c}=this,{start:n,end:d}=x(c,a,s,i,t,r);o[0]=n[0],o[1]=n[1],o[2]=D,o[3]=d[0],o[4]=d[1],o[5]=D,e.invalidateBoundingInfo()}}function v(e){return[G(e,[p(),p()]),G(e,[p(),p()])]}function x(e,t,r,i,s,n){const d=o(A,a(A,e[1]*r,e[0]*-r),i+s/2),h=c(F,c(F,c(F,t,o(F,e,n/2)),d),d);return{start:h,end:c(S,h,o(S,e,-n))}}function V(e){e.geometries.length=0}function M(e){e.pixelRatioHandle.remove(),e.geometries=[]}const P=p(),A=n(),F=n(),S=n(),U=t(),E=t(),k=y(0,0,void 0,null);export{O as ParallelLineVisualElement};
5
+ import{watch as e}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as t,castScreenPointArray as r}from"../../../../core/screenUtils.js";import{normalize as i,subtract as s,scale as o,set as a,add as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{m as d,d as h,n as l,e as m,i as u}from"../../../../chunks/vec32.js";import{create as p,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as f,f as g}from"../../../../chunks/vec42.js";import{fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeDehydratedPoint as y}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as j}from"./EngineVisualElement.js";import{drapedZ as D}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as G}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as w}from"../../webgl-engine/lib/RenderGeometry.js";import{RibbonLineMaterial as R}from"../../webgl-engine/materials/RibbonLineMaterial.js";class O extends j{constructor(e){super(e),this._location=p(),this._direction=_(1,0,0),this._width=1,this._offset=1,this._length=18,this._color=b(1,0,1,1),this._renderOccluded=4,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:V,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:M,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}get location(){return this._location}set location(e){d(this._location,e)||(h(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){d(this._direction,e)||(h(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){l(this._direction,m(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){f(e,this._color)||(g(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}_createObject3DResources(e){const t=new R(this.materialParameters,this.view.state.isGlobal),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const[i,s]=v(e);t.addGeometry(i),t.addGeometry(s),r.push(i),r.push(s),this._updateVerticesObject3D(t)}_createDrapedResources(){const t=new R(this.materialParameters,this.view.state.isGlobal),r=e(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry());return{material:t,geometries:this._createDrapedGeometry(t),pixelRatioHandle:r}}_recreateDrapedGeometry(e){e.geometries=this._createDrapedGeometry(e.material)}_createDrapedGeometry(e){const t=v(e);return this._updateVerticesDraped(t),t.map(e=>new w(e))}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this.view.state.camera;t.projectToScreen(this.location,U),u(P,this.location,this.direction),t.projectToScreen(P,E),i(E,s(E,E,U)),this._updateVertexAttributesObject3D(t,e,0,U,E,1),this._updateVertexAttributesObject3D(t,e,1,U,E,-1)}_updateVertexAttributesObject3D(e,t,i,s,o,a){const c=t.geometries[i],n=c.getMutableAttribute("position")?.data;if(!n)return;const{start:d,end:h}=x(o,s,a,this.offset,this.width,this.length);e.unprojectFromScreen(r(d),P),n[0]=P[0],n[1]=P[1],n[2]=P[2],e.unprojectFromScreen(r(h),P),n[3]=P[0],n[4]=P[1],n[5]=P[2],t.geometryVertexAttributeUpdated(c,"position")}_updateVerticesDraped(e){const{view:{overlayManager:t,state:{contentPixelRatio:r}}}=this,{location:i,width:s,length:o,offset:a}=this,c=k;c.spatialReference=t.spatialReference,c.x=i[0],c.y=i[1];const n=this.view.overlayPixelSizeInMapUnits(c)*r,d=s*n,h=o*n,l=a*n;this._updateVertexAttributesDraped(e[0],d,h,l,-1),this._updateVertexAttributesDraped(e[1],d,h,l,1)}_updateVertexAttributesDraped(e,t,r,i,s){const o=e.getMutableAttribute("position")?.data;if(!o)return;const{location:a,direction:c}=this,{start:n,end:d}=x(c,a,s,i,t,r);o[0]=n[0],o[1]=n[1],o[2]=D,o[3]=d[0],o[4]=d[1],o[5]=D,e.invalidateBoundingInfo()}}function v(e){return[G(e,[p(),p()]),G(e,[p(),p()])]}function x(e,t,r,i,s,n){const d=o(A,a(A,e[1]*r,e[0]*-r),i+s/2),h=c(F,c(F,c(F,t,o(F,e,n/2)),d),d);return{start:h,end:c(S,h,o(S,e,-n))}}function V(e){e.geometries.length=0}function M(e){e.pixelRatioHandle.remove(),e.geometries=[]}const P=p(),A=n(),F=n(),S=n(),U=t(),E=t(),k=y(0,0,void 0,null);export{O as ParallelLineVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as e}from"../../../../core/mathUtils.js";import{h as t}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as r,d as s}from"../../../../chunks/vec42.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectVectorToVector as n}from"../../../../geometry/projection/projectVectorToVector.js";import{expandWithBuffer as a}from"../../../../geometry/support/aaBoundingBox.js";import{sv3d as l}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as u}from"./Object3DVisualElement.js";import{evaluateElevationAlignmentAtPoint as h}from"../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as p}from"../../layers/graphics/ElevationContext.js";import{defaultBoundingBox as m,requiresHalfTexelOffset as c,defaultSymbolSizeRatio as _,createTexture as g}from"../../support/engineContent/sdfPrimitives.js";import{createPointGeometry as d}from"../../webgl-engine/lib/GeometryUtil.js";import{HUDMaterial as f}from"../../webgl-engine/materials/HUDMaterial.js";class x extends u{constructor(e){super(e),this._material=null,this._texture=null,this._geometry=null,this._size=3,this._color=o(1,0,1,1),this._pixelSnappingEnabled=!0,this._primitive="square",this._outlineSize=1,this._outlineColor=o(1,1,1,1),this._elevationInfo=null,this.applyProperties(e)}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){if(e!==this._size){const t=this._preferredTextureSize;this._size=e,t<this._preferredTextureSize?this.recreate():this._updateSizeAttribute()}}get color(){return this._color}set color(e){r(e,this._color)||(s(this._color,e),this._updateMaterial())}get pixelSnappingEnabled(){return this._pixelSnappingEnabled}set pixelSnappingEnabled(e){this._pixelSnappingEnabled!==e&&(this._pixelSnappingEnabled=e,this._updateMaterial())}get primitive(){return this._primitive}set primitive(e){this._primitive!==e&&(this._primitive=e,this.recreate())}get outlineSize(){return this._outlineSize}set outlineSize(e){e!==this._outlineSize&&(this._outlineSize=e,this._updateMaterial())}get outlineColor(){return this._outlineColor}set outlineColor(e){r(e,this._outlineColor)||(s(this._outlineColor,e),this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}_updateMaterial(){this._material?.setParameters(this._materialParameters)}_updateSizeAttribute(){const e=this.object;if(null==e)return;const t=e.geometries[0];if(null==t)return;const i=t.getMutableAttribute("size").data,r=this._geometrySize;i[0]=r,i[1]=r,e.geometryVertexAttributeUpdated(e.geometries[0],"size")}get _materialParameters(){return{color:this._color,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:c(this._primitive),distanceFieldBoundingBox:m,occlusionTest:!1,outlineColor:this._outlineColor,outlineSize:this._outlineSize,textureId:this._texture?.id,polygonOffset:!1,shaderPolygonOffset:0,drawAsLabel:!0,depthEnabled:!1,pixelSnappingEnabled:this.pixelSnappingEnabled,isDecoration:this.isDecoration}}get _geometrySize(){return this._size/_}createExternalResources(){this._texture=g(this._primitive,this._preferredTextureSize),this._material=new f(this._materialParameters,1===this.view.state.viewingMode);const e=this.view.stage;this._texture.load(e.renderView.renderingContext),e.addTexture(this._texture)}destroyExternalResources(){if(this._texture){this.view.stage.removeTexture(this._texture),this._texture.dispose(),this._texture=null}this._material=null}createGeometries(e){const t=this._createRenderGeometry();null!=t&&e.addGeometry(t)}forEachMaterial(e){e(this._material)}get _preferredTextureSize(){return e(2*this._geometrySize,16,128)}calculateMapBounds(e){const t=this.object?.geometries[0];if(!t)return!1;const i=t.attributes.get("position").data;return n(i,this.view.renderCoordsHelper.spatialReference,v,this.view.spatialReference),a(e,v),!0}_createRenderGeometry(){const{geometry:e,_material:i}=this;if(null==e||null==i)return null;const{renderCoordsHelper:r,elevationProvider:s}=this.view,o=h(e,s,p.fromElevationInfo(this.elevationInfo),r),a=t(l.get(),e.x,e.y,o),u=l.get();n(a,e.spatialReference,u,r.spatialReference);const m=this._geometrySize;return d(i,{position:u,size:[m,m],centerOffsetAndDistance:[0,0,0,1]})}}const v=i();export{x as PointVisualElement};
5
+ import{clamp as e}from"../../../../core/mathUtils.js";import{h as t}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as r,f as s}from"../../../../chunks/vec42.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectVectorToVector as n}from"../../../../geometry/projection/projectVectorToVector.js";import{expandWithBuffer as a}from"../../../../geometry/support/aaBoundingBox.js";import{sv3d as l}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as u}from"./Object3DVisualElement.js";import{evaluateElevationAlignmentAtPoint as h}from"../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as p}from"../../layers/graphics/ElevationContext.js";import{defaultBoundingBox as m,requiresHalfTexelOffset as c,defaultSymbolSizeRatio as _,createTexture as g}from"../../support/engineContent/sdfPrimitives.js";import{createPointGeometry as d}from"../../webgl-engine/lib/GeometryUtil.js";import{HUDMaterial as f}from"../../webgl-engine/materials/HUDMaterial.js";class x extends u{constructor(e){super(e),this._material=null,this._texture=null,this._geometry=null,this._size=3,this._color=o(1,0,1,1),this._pixelSnappingEnabled=!0,this._primitive="square",this._outlineSize=1,this._outlineColor=o(1,1,1,1),this._elevationInfo=null,this.applyProperties(e)}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){if(e!==this._size){const t=this._preferredTextureSize;this._size=e,t<this._preferredTextureSize?this.recreate():this._updateSizeAttribute()}}get color(){return this._color}set color(e){r(e,this._color)||(s(this._color,e),this._updateMaterial())}get pixelSnappingEnabled(){return this._pixelSnappingEnabled}set pixelSnappingEnabled(e){this._pixelSnappingEnabled!==e&&(this._pixelSnappingEnabled=e,this._updateMaterial())}get primitive(){return this._primitive}set primitive(e){this._primitive!==e&&(this._primitive=e,this.recreate())}get outlineSize(){return this._outlineSize}set outlineSize(e){e!==this._outlineSize&&(this._outlineSize=e,this._updateMaterial())}get outlineColor(){return this._outlineColor}set outlineColor(e){r(e,this._outlineColor)||(s(this._outlineColor,e),this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}_updateMaterial(){this._material?.setParameters(this._materialParameters)}_updateSizeAttribute(){const e=this.object;if(null==e)return;const t=e.geometries[0];if(null==t)return;const i=t.getMutableAttribute("size").data,r=this._geometrySize;i[0]=r,i[1]=r,e.geometryVertexAttributeUpdated(e.geometries[0],"size")}get _materialParameters(){return{color:this._color,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:c(this._primitive),distanceFieldBoundingBox:m,occlusionTest:!1,outlineColor:this._outlineColor,outlineSize:this._outlineSize,textureId:this._texture?.id,polygonOffset:!1,shaderPolygonOffset:0,drawAsLabel:!0,depthEnabled:!1,pixelSnappingEnabled:this.pixelSnappingEnabled,isDecoration:this.isDecoration}}get _geometrySize(){return this._size/_}createExternalResources(){this._texture=g(this._primitive,this._preferredTextureSize),this._material=new f(this._materialParameters,1===this.view.state.viewingMode);const e=this.view.stage;this._texture.load(e.renderView.renderingContext),e.addTexture(this._texture)}destroyExternalResources(){if(this._texture){this.view.stage.removeTexture(this._texture),this._texture.dispose(),this._texture=null}this._material=null}createGeometries(e){const t=this._createRenderGeometry();null!=t&&e.addGeometry(t)}forEachMaterial(e){e(this._material)}get _preferredTextureSize(){return e(2*this._geometrySize,16,128)}calculateMapBounds(e){const t=this.object?.geometries[0];if(!t)return!1;const i=t.attributes.get("position").data;return n(i,this.view.renderCoordsHelper.spatialReference,v,this.view.spatialReference),a(e,v),!0}_createRenderGeometry(){const{geometry:e,_material:i}=this;if(null==e||null==i)return null;const{renderCoordsHelper:r,elevationProvider:s}=this.view,o=h(e,s,p.fromElevationInfo(this.elevationInfo),r),a=t(l.get(),e.x,e.y,o),u=l.get();n(a,e.spatialReference,u,r.spatialReference);const m=this._geometrySize;return d(i,{position:u,size:[m,m],centerOffsetAndDistance:[0,0,0,1]})}}const v=i();export{x as PointVisualElement};