@arcgis/core 5.0.0-next.36 → 5.0.0-next.38

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 (270) 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/applications/Components/testUtils.d.ts +4 -0
  6. package/applications/Components/testUtils.js +5 -0
  7. package/arcade/arcadeAsyncRuntime.js +1 -1
  8. package/arcade/arcadeCompiler.js +1 -1
  9. package/arcade/featureSetUtils.js +1 -1
  10. package/arcade/featureset/actions/Adapted.js +1 -1
  11. package/arcade/featureset/actions/AttributeFilter.js +1 -1
  12. package/arcade/featureset/actions/GroupBy.js +1 -1
  13. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  14. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  15. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  16. package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
  17. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  18. package/arcade/featureset/support/FeatureSet.js +1 -1
  19. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  20. package/assets/esri/core/workers/RemoteClient.js +1 -1
  21. package/assets/esri/core/workers/chunks/014dbe6fa93a277b08f7.js +1 -0
  22. package/assets/esri/core/workers/chunks/{51355866a0dcf41cfded.js → 0a5427127634738aa239.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{c7c721de93bc8688e13c.js → 1d4ea8db272655c0608c.js} +1 -1
  24. package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +1 -0
  25. package/assets/esri/core/workers/chunks/1de216d9850c39c1735d.js +1 -0
  26. package/assets/esri/core/workers/chunks/262232437d37a7460b11.js +1 -0
  27. package/assets/esri/core/workers/chunks/2795e491f803654413d2.js +1 -0
  28. package/assets/esri/core/workers/chunks/2f9129003f77bfeab2f9.js +1 -0
  29. package/assets/esri/core/workers/chunks/{1817cf11e85afca947d3.js → 328106e181e5957ceaa5.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{d3db7244fac7398cc700.js → 4b6a44c6265c8959abd8.js} +1 -1
  31. package/assets/esri/core/workers/chunks/50ffb22c48fadd36c748.js +1 -0
  32. package/assets/esri/core/workers/chunks/{f1ac1c8b1331ec79e898.js → 59ce992d3a5e7c32b9fb.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{8a946cbc816f373c136b.js → 5e30acfda04f7fc2b676.js} +1 -1
  34. package/assets/esri/core/workers/chunks/6330d8767ba1d5329daa.js +1 -0
  35. package/assets/esri/core/workers/chunks/{3f03165487c1c2340fff.js → 690a40d2eef52bfc149f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{dd34d56caafa38d4b8e4.js → 7aa730e5ac7b268e3c98.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{b451dc416eebd0931ef8.js → 7ab237d19b84d89ff483.js} +7 -7
  38. package/assets/esri/core/workers/chunks/{1fa55d4c4b092a98bdd7.js → b56c07c0b43cb1999070.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{bfb9cbe59d36d18f9157.js → cda5c95fd49b8901f7d4.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{c9e7cc5d853908ab5b2f.js → ce99abfdcd71ff9e4e36.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{726a797f5df7eeee0b3d.js → d786b17cc9062b1450ac.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{52c8687b473c9953c2f2.js → d9958654c6438f28237b.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{2e76fbd3c874300fc4a7.js → de3da4d31a7529761565.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{eb6218634a492667506a.js → e501d68a1464805c4b4e.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{33431e8131f6017de2f9.js → e7f4d135ef9665de1468.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{d8623f5f13a084e439c2.js → e9bc3c6482ba778c9349.js} +37 -37
  47. package/assets/esri/core/workers/chunks/{7420fa18ba12014b22ea.js → ee67c8a7c1f8b482cd99.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{abb05a903440d97a6a74.js → f441fc74451330384fb0.js} +1 -1
  49. package/assets/esri/core/workers/chunks/f609b256df9eb3803464.js +1 -0
  50. package/assets/esri/core/workers/chunks/f97a7cb367634353177d.js +1 -0
  51. package/chunks/CloudsComposition.glsl.js +1 -1
  52. package/chunks/ComponentShader.glsl.js +2 -2
  53. package/chunks/DefaultMaterial.glsl.js +1 -1
  54. package/chunks/GaussianSplat.glsl.js +2 -2
  55. package/chunks/Laserlines.glsl.js +1 -1
  56. package/chunks/Path.glsl.js +1 -1
  57. package/chunks/RealisticTree.glsl.js +1 -1
  58. package/chunks/Terrain.glsl.js +34 -36
  59. package/chunks/WaterSurface.glsl.js +1 -1
  60. package/chunks/boundedPlane.js +1 -1
  61. package/chunks/cameraUtilsSpherical.js +1 -1
  62. package/chunks/vec32.js +1 -1
  63. package/config.js +1 -1
  64. package/core/has.js +1 -1
  65. package/core/iteratorUtils.js +1 -1
  66. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  67. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  68. package/geometry/support/buffer/BufferView.js +1 -1
  69. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  70. package/geometry/support/lineSegment.js +1 -1
  71. package/geometry/support/meshUtils/merge.js +1 -1
  72. package/geometry/support/sphere.js +1 -1
  73. package/interfaces.d.ts +59 -5
  74. package/kernel.js +1 -1
  75. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  76. package/layers/VoxelWasmPerSceneView.js +1 -1
  77. package/layers/knowledgeGraph/layerUtils.js +1 -1
  78. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  79. package/layers/support/csvUtils.js +1 -1
  80. package/layers/video/VideoController.js +1 -1
  81. package/layers/voxel/VoxelVolume.js +1 -1
  82. package/package.json +5 -5
  83. package/support/revision.js +1 -1
  84. package/support/tests/meshUtils.js +5 -0
  85. package/support/tests/serviceMockDependencies.js +5 -0
  86. package/support/tests/setupServiceMocksMesh.js +5 -0
  87. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  88. package/views/2d/interactive/SegmentLabels2D.js +1 -1
  89. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  90. package/views/3d/FocusAreasView.js +1 -1
  91. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  92. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  93. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  94. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  95. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  96. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  97. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  98. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  99. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  100. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  101. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  102. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  103. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  104. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  105. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  106. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  107. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  108. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  109. package/views/3d/camera/constraintUtils/distance.js +1 -1
  110. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  111. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  112. package/views/3d/environment/CloudsParameters.js +1 -1
  113. package/views/3d/environment/EnvironmentManager.js +1 -1
  114. package/views/3d/environment/MarsAtmosphere.js +1 -1
  115. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  116. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  117. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  118. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  119. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  120. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  121. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  122. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  123. package/views/3d/layers/FlowSubView3D.js +1 -1
  124. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  125. package/views/3d/layers/I3SMeshView3D.js +1 -1
  126. package/views/3d/layers/ImagerySubView3D.js +1 -1
  127. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  128. package/views/3d/layers/PointCloudWorker.js +1 -1
  129. package/views/3d/layers/RouteLayerView3D.js +1 -1
  130. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  132. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  133. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  134. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  135. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  136. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  137. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  138. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  139. package/views/3d/state/Frustum.js +1 -1
  140. package/views/3d/state/ViewStateManager.js +1 -1
  141. package/views/3d/state/controllers/FovController.js +1 -1
  142. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  143. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  144. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  145. package/views/3d/support/cameraUtils.js +1 -1
  146. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  147. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  148. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  149. package/views/3d/support/intersectionUtils.js +1 -1
  150. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  151. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  152. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  153. package/views/3d/support/viewpointUtils.js +1 -1
  154. package/views/3d/terrain/OverlayManager.js +1 -1
  155. package/views/3d/terrain/OverlayRenderer.js +1 -1
  156. package/views/3d/terrain/PatchRenderData.js +1 -1
  157. package/views/3d/terrain/SphericalPatch.js +1 -1
  158. package/views/3d/terrain/TerrainRenderer.js +1 -1
  159. package/views/3d/terrain/TerrainSurface.js +1 -1
  160. package/views/3d/terrain/Tile.js +1 -1
  161. package/views/3d/terrain/TileCompositor.js +1 -1
  162. package/views/3d/webgl/RenderCamera.js +1 -1
  163. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  164. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  165. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  166. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  167. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +4 -7
  168. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +4 -4
  169. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +1 -1
  170. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +6 -6
  171. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +4 -4
  172. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +19 -15
  173. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
  174. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  175. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +5 -5
  176. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +14 -14
  177. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +16 -37
  178. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +8 -8
  179. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  180. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  181. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  182. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  183. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  184. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  185. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  186. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  187. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  188. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  189. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  190. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  191. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  192. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  193. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  194. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +5 -0
  195. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
  196. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
  197. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayoutField.js +5 -0
  198. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +5 -0
  199. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  200. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  201. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  202. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  203. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  204. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  205. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  206. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  207. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  208. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  209. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  210. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  211. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  212. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  213. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  215. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  216. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  217. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  218. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  219. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  220. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  221. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  222. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  223. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  224. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  225. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  226. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  227. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  228. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +9 -10
  229. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  230. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  231. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  232. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  233. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  234. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  235. package/views/BreakpointsOwner.js +1 -1
  236. package/views/GroundView.js +1 -1
  237. package/views/SceneView.js +1 -1
  238. package/views/ToolViewManager.js +1 -1
  239. package/views/analysis/ElevationProfile/elevationProfileVisualizationUtils.js +1 -1
  240. package/views/interactive/GraphicManipulator.js +1 -1
  241. package/views/interactive/InteractiveToolBase.js +1 -1
  242. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  243. package/views/interactive/coordinateHelper.js +1 -1
  244. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  245. package/views/interactive/sketch/constraints.js +1 -1
  246. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  247. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  248. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  249. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  250. package/views/layers/LayerView.js +1 -1
  251. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  252. package/views/support/LayerViewManager.js +1 -1
  253. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  254. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  255. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  256. package/views/support/geometry3dUtils.js +1 -1
  257. package/webmap/utils.js +1 -1
  258. package/widgets/Sketch/SketchViewModel.js +1 -1
  259. package/widgets/Slider.js +1 -1
  260. package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +0 -1
  261. package/assets/esri/core/workers/chunks/15c1a48e8cd2a8882d85.js +0 -1
  262. package/assets/esri/core/workers/chunks/1b9e7d416c9f00e020bb.js +0 -1
  263. package/assets/esri/core/workers/chunks/24a3c6f0154787968724.js +0 -1
  264. package/assets/esri/core/workers/chunks/5000a37fba27464d10ca.js +0 -1
  265. package/assets/esri/core/workers/chunks/951a3442d4342539f2ea.js +0 -1
  266. package/assets/esri/core/workers/chunks/b075d3714fab0591d67c.js +0 -1
  267. package/assets/esri/core/workers/chunks/d8975dd7b85b5d065ee4.js +0 -1
  268. package/assets/esri/core/workers/chunks/e0a74250d22fa1d7dc18.js +0 -1
  269. package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +0 -1
  270. package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +0 -26
@@ -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,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{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{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};
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{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{D as s,n as a,e as o,d as n,m as c,i as l}from"../../../../chunks/vec32.js";import{create as u,ZEROS as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as d}from"../../../../chunks/vec42.js";import{fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as p}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as f}from"./EngineVisualElement.js";import{drapedZ as g}from"../../terrain/OverlayRenderer.js";import{Attribute as M}from"../../webgl-engine/lib/Attribute.js";import{Geometry as b}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as O}from"../../webgl-engine/lib/RenderGeometry.js";import{ColorMaterial as j}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as D}from"../../webgl-engine/materials/RibbonLineMaterial.js";class w extends f{constructor(e){super(e),this._maxSize=0,this._position=u(),this._up=u(),this._right=u(),this._renderOccluded=4,this._color=m(1,0,0,1),this._outlineColor=m(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=16,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D(),forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:z,forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get color(){return this._color}set color(e){d(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){d(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const t=0===this._outlineSize!=(0===e);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:r}){this._maxSize=Math.min(s(t,e),s(t,r))/3,a(this._up,o(this._up,e,t)),a(this._right,o(this._right,r,t)),n(this._position,t),this.recreateGeometry()}_createObject3DResources(e){const t=new j(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new D(this._outlineMaterialParameters,this.view.state.isGlobal);return this._createObject3DGeometries(e,t,r),{quadMaterial:t,outlineMaterial:r}}_createObject3DGeometries(e,t,r){if(c(this._up,h)&&c(this._right,h))return;const i=this._createGeometries(t,r);for(const s of i)e.addGeometry(s);this._updateTransformObject3D(e)}_createDrapedResources(){const t=new j(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new D(this._outlineMaterialParameters,this.view.state.isGlobal),i=this._createGeometries(t,r).map(e=>new O(e));this._setTransformDraped(i);return{quadMaterial:t,outlineMaterial:r,geometries:i,pixelRatioHandle:e(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry())}}_createGeometries(e,t){const{up:r,right:i,corner:s}=this._getVertices(),a=v(r,i,s,e);if(!t)return[a];return[a,R(t,[r,s,i])]}_getVertices(){let e=this._up,t=this._right;const r=l(_.get(),e,t);return this.isDraped&&(e=n(_.get(),e),t=n(_.get(),t),e[2]=0,t[2]=0,r[2]=0),{up:e,right:t,corner:r}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;const i=this.view.state.camera,s=this._size*i.computeScreenPixelSizeAt(this._position),a=Math.min(this._maxSize,s);t(y,this._position),r(y,y,[a,a,a]),e.transformation=y}_setTransformDraped(e){if(0===e.length)return;const{view:{overlayManager:i,state:{contentPixelRatio:s}}}=this,{_position:a,_size:o}=this,c=n(_.get(),a);c[2]=g;const l=P;l.spatialReference=i.spatialReference,l.x=c[0],l.y=c[1];const u=o*(this.view.overlayPixelSizeInMapUnits(l)*s),h=Math.min(this._maxSize,u);t(y,c),r(y,y,[h,h,1]);for(const t of e)t.transformation=y}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}function z(e){e.pixelRatioHandle.remove(),e.geometries=[]}function v(e,t,r,i){return new b(i,[["position",new M([0,0,0,...t,...e,...r],[0,1,2,1,2,3],3,!0)]])}const y=i(),P=p(0,0,void 0,null);export{w as RightAngleQuadVisualElement};
5
+ import{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{C as s,n as a,e as o,d as n,m as c,i as l}from"../../../../chunks/vec32.js";import{create as u,ZEROS as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as d}from"../../../../chunks/vec42.js";import{fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as p}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as f}from"./EngineVisualElement.js";import{drapedZ as g}from"../../terrain/OverlayRenderer.js";import{Attribute as M}from"../../webgl-engine/lib/Attribute.js";import{Geometry as b}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as O}from"../../webgl-engine/lib/RenderGeometry.js";import{ColorMaterial as j}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as D}from"../../webgl-engine/materials/RibbonLineMaterial.js";class w extends f{constructor(e){super(e),this._maxSize=0,this._position=u(),this._up=u(),this._right=u(),this._renderOccluded=4,this._color=m(1,0,0,1),this._outlineColor=m(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=16,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D(),forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:z,forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get color(){return this._color}set color(e){d(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){d(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const t=0===this._outlineSize!=(0===e);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:r}){this._maxSize=Math.min(s(t,e),s(t,r))/3,a(this._up,o(this._up,e,t)),a(this._right,o(this._right,r,t)),n(this._position,t),this.recreateGeometry()}_createObject3DResources(e){const t=new j(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new D(this._outlineMaterialParameters,this.view.state.isGlobal);return this._createObject3DGeometries(e,t,r),{quadMaterial:t,outlineMaterial:r}}_createObject3DGeometries(e,t,r){if(c(this._up,h)&&c(this._right,h))return;const i=this._createGeometries(t,r);for(const s of i)e.addGeometry(s);this._updateTransformObject3D(e)}_createDrapedResources(){const t=new j(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new D(this._outlineMaterialParameters,this.view.state.isGlobal),i=this._createGeometries(t,r).map(e=>new O(e));this._setTransformDraped(i);return{quadMaterial:t,outlineMaterial:r,geometries:i,pixelRatioHandle:e(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry())}}_createGeometries(e,t){const{up:r,right:i,corner:s}=this._getVertices(),a=v(r,i,s,e);if(!t)return[a];return[a,R(t,[r,s,i])]}_getVertices(){let e=this._up,t=this._right;const r=l(_.get(),e,t);return this.isDraped&&(e=n(_.get(),e),t=n(_.get(),t),e[2]=0,t[2]=0,r[2]=0),{up:e,right:t,corner:r}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;const i=this.view.state.camera,s=this._size*i.computeScreenPixelSizeAt(this._position),a=Math.min(this._maxSize,s);t(y,this._position),r(y,y,[a,a,a]),e.transformation=y}_setTransformDraped(e){if(0===e.length)return;const{view:{overlayManager:i,state:{contentPixelRatio:s}}}=this,{_position:a,_size:o}=this,c=n(_.get(),a);c[2]=g;const l=P;l.spatialReference=i.spatialReference,l.x=c[0],l.y=c[1];const u=o*(this.view.overlayPixelSizeInMapUnits(l)*s),h=Math.min(this._maxSize,u);t(y,c),r(y,y,[h,h,1]);for(const t of e)t.transformation=y}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}function z(e){e.pixelRatioHandle.remove(),e.geometries=[]}function v(e,t,r,i){return new b(i,[["position",new M([0,0,0,...t,...e,...r],[0,1,2,1,2,3],3,!0)]])}const y=i(),P=p(0,0,void 0,null);export{w as RightAngleQuadVisualElement};
@@ -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"../../../Graphic.js";import i from"../../../core/Error.js";import{makeHandle as r}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{destroyMaybe as s}from"../../../core/maybe.js";import n from"../../../core/ReactiveMap.js";import{property as l,subclass as h}from"../../../core/accessorSupport/decorators.js";import{hydrateGraphic as o}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as a}from"../../../layers/support/timeSupport.js";import p from"../../../rest/support/AttributeBinsQuery.js";import u from"../../../rest/support/Query.js";import{isGraphic as g}from"../../../support/guards.js";import{attributeLookup as c}from"./support/attributeUtils.js";import{normalizeHighlightTarget as y,emptyHighlightHandle as d,isObjectId as m}from"./support/highlightUtils.js";import{getHighlightName as f}from"../../support/highlightOptionsUtils.js";import{isInEffectiveScaleRange as P,hasLayerBasedScaleVisibility as b}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as v}from"../../support/projectionUtils.js";const w=w=>{const I=w;let _=class extends I{constructor(){super(...arguments),this.highlightOptions=null,this.updatePolicy=1,this.slicePlaneEnabled=!1,this._highlightCounter=new n,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new i("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference="local"===this.view.viewingMode?await v(this.layer.fullExtent,this.view.spatialReference):null;const e=await this.createGraphicsPipeline();this.destroyed?e.destroy():(this.graphicsPipeline=e,await e.when())})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=s(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return b()?P(this.layer.effectiveScaleRange,this.view.scale):!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return a(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get highlightIds(){return Array.from(this._highlightCounter.keys())}get hasHighlight(){return this.highlightIds.length>0}getHit(e,t){if(has("feature-pipeline-3d-test"))return this._getHitMock(e);const i=this.graphicsPipeline.findGraphic(t=>t.uid===e);if(null==i)return null;const r=o(i,this.layer,this.layer.graphicOrigin);return{type:"graphic",graphic:r,layer:r.layer}}_getHitMock(e){const i=this.layer,r={};r[this.layer.objectIdField]=e;const s=new t({layer:i,sourceLayer:i,origin:this.graphicOrigin,visible:!0,symbol:null,attributes:r,geometry:null});return{type:"graphic",graphic:s,layer:s.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}async queryAttributeBins(e,t){return this.graphicsPipeline.graphicsQuery.executeAttributeBinsQuery(this._ensureAttributeBinsQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():u.from(e)}_ensureAttributeBinsQuery(e){const t=p.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_addHighlightIds(e){this._highlightCounter.batch(()=>{for(const t of e){const e=this._highlightCounter.get(t)??0;this._highlightCounter.set(t,e+1)}})}_removeHighlightIds(e){this._highlightCounter.batch(()=>{for(const t of e){let e=this._highlightCounter.get(t);null!=e&&(e--,e>0?this._highlightCounter.set(t,e):this._highlightCounter.delete(t))}})}highlight(e,t){const i=f(t),s=this.layer.objectIdField,n=y(e);if(0===n.length)return d;if(g(n[0])){const e=n;if(null!=c(this.layer.fieldsIndex,e[0].attributes,s)){const t=e.map(e=>c(this.layer.fieldsIndex,e.attributes,s)),n=this.graphicsPipeline.highlightByObjectIds(t,i);return this._addHighlightIds(t),r(()=>{this._removeHighlightIds(t),n.remove()})}return this.graphicsPipeline.highlightByGraphics(e,i)}if(m(n[0])){const e=n;this._addHighlightIds(e);const t=this.graphicsPipeline.highlightByObjectIds(e,i);return r(()=>{t.remove(),this._removeHighlightIds(e)})}return d}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.basemapTerrain?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new i("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}queryAggregates(){throw new Error("Not implemented")}};return e([l()],_.prototype,"graphicsPipeline",void 0),e([l({readOnly:!0})],_.prototype,"dataUpdating",null),e([l()],_.prototype,"highlightOptions",void 0),e([l()],_.prototype,"suspended",void 0),e([l({readOnly:!0})],_.prototype,"legendEnabled",null),e([l({readOnly:!0})],_.prototype,"visibleAtCurrentScale",null),e([l()],_.prototype,"updating",void 0),e([l({readOnly:!0})],_.prototype,"updatePolicy",void 0),e([l({type:Boolean})],_.prototype,"slicePlaneEnabled",void 0),e([l({readOnly:!0})],_.prototype,"suspendInfo",void 0),e([l()],_.prototype,"symbologySnappingSupported",null),e([l({readOnly:!0})],_.prototype,"hasAllFeatures",null),e([l({readOnly:!0})],_.prototype,"hasAllFeaturesInView",null),e([l({readOnly:!0})],_.prototype,"hasFullGeometries",null),e([l({readOnly:!0})],_.prototype,"timeExtent",null),e([l()],_.prototype,"highlightIds",null),e([l()],_.prototype,"hasHighlight",null),_=e([h("esri.views.3d.layers.FeatureLikeLayerView3D")],_),_};export{w as FeatureLikeLayerView3D};
5
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../core/Error.js";import{makeHandle as r}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{destroyMaybe as s}from"../../../core/maybe.js";import n from"../../../core/ReactiveMap.js";import{property as l,subclass as h}from"../../../core/accessorSupport/decorators.js";import{hydrateGraphic as o}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as a}from"../../../layers/support/timeSupport.js";import p from"../../../rest/support/AttributeBinsQuery.js";import u from"../../../rest/support/Query.js";import{isGraphic as g}from"../../../support/guards.js";import{attributeLookup as c}from"./support/attributeUtils.js";import{normalizeHighlightTarget as y,emptyHighlightHandle as d,isObjectId as m}from"./support/highlightUtils.js";import{getHighlightName as f}from"../../support/highlightOptionsUtils.js";import{isInEffectiveScaleRange as P,hasLayerBasedScaleVisibility as b}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as v}from"../../support/projectionUtils.js";const w=w=>{const I=w;let _=class extends I{constructor(){super(...arguments),this.highlightOptions=null,this.updatePolicy=1,this.slicePlaneEnabled=!1,this._highlightCounter=new n,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new i("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference="local"===this.view.viewingMode?await v(this.layer.fullExtent,this.view.spatialReference):null;const e=await this.createGraphicsPipeline();this.destroyed?e.destroy():(this.graphicsPipeline=e,await e.when())})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=s(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return b()?P(this.layer.effectiveScaleRange,this.view.scale):!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return a(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get highlightIds(){return Array.from(this._highlightCounter.keys())}get hasHighlight(){return this.highlightIds.length>0}getHit(e,t){if(has("feature-pipeline-3d-test"))return this._getHitMock(e);const i=this.graphicsPipeline.findGraphic(t=>t.uid===e);if(null==i)return null;const r=o(i,this.layer,this.layer.graphicOrigin);return{type:"graphic",graphic:r,layer:r.layer}}_getHitMock(e){const i=this.layer,r={};r[this.layer.objectIdField]=e;const s=new t({layer:i,sourceLayer:i,origin:this.graphicOrigin,visible:!0,symbol:null,attributes:r,geometry:null});return{type:"graphic",graphic:s,layer:s.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}async queryAttributeBins(e,t){return this.graphicsPipeline.graphicsQuery.executeAttributeBinsQuery(this._ensureAttributeBinsQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():u.from(e)}_ensureAttributeBinsQuery(e){const t=p.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_addHighlightIds(e){this._highlightCounter.batch(()=>{for(const t of e){const e=this._highlightCounter.get(t)??0;this._highlightCounter.set(t,e+1)}})}_removeHighlightIds(e){this._highlightCounter.batch(()=>{for(const t of e){let e=this._highlightCounter.get(t);null!=e&&(e--,e>0?this._highlightCounter.set(t,e):this._highlightCounter.delete(t))}})}highlight(e,t){const i=f(t),s=this.layer.objectIdField,n=y(e);if(0===n.length)return d;if(g(n[0])){const e=n;if(null!=c(this.layer.fieldsIndex,e[0].attributes,s)){const t=e.map(e=>c(this.layer.fieldsIndex,e.attributes,s)),n=this.graphicsPipeline.highlightByObjectIds(t,i);return this._addHighlightIds(t),r(()=>{this._removeHighlightIds(t),n.remove()})}return this.graphicsPipeline.highlightByGraphics(e,i)}if(m(n[0])){const e=n;this._addHighlightIds(e);const t=this.graphicsPipeline.highlightByObjectIds(e,i);return r(()=>{t.remove(),this._removeHighlightIds(e)})}return d}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.groundView?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new i("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}queryAggregates(){throw new Error("Not implemented")}};return e([l()],_.prototype,"graphicsPipeline",void 0),e([l({readOnly:!0})],_.prototype,"dataUpdating",null),e([l()],_.prototype,"highlightOptions",void 0),e([l()],_.prototype,"suspended",void 0),e([l({readOnly:!0})],_.prototype,"legendEnabled",null),e([l({readOnly:!0})],_.prototype,"visibleAtCurrentScale",null),e([l()],_.prototype,"updating",void 0),e([l({readOnly:!0})],_.prototype,"updatePolicy",void 0),e([l({type:Boolean})],_.prototype,"slicePlaneEnabled",void 0),e([l({readOnly:!0})],_.prototype,"suspendInfo",void 0),e([l()],_.prototype,"symbologySnappingSupported",null),e([l({readOnly:!0})],_.prototype,"hasAllFeatures",null),e([l({readOnly:!0})],_.prototype,"hasAllFeaturesInView",null),e([l({readOnly:!0})],_.prototype,"hasFullGeometries",null),e([l({readOnly:!0})],_.prototype,"timeExtent",null),e([l()],_.prototype,"highlightIds",null),e([l()],_.prototype,"hasHighlight",null),_=e([h("esri.views.3d.layers.FeatureLikeLayerView3D")],_),_};export{w as FeatureLikeLayerView3D};
@@ -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{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as s}from"../../../core/maybe.js";import{debounce as r,ignoreAbortErrors as l,throwIfAborted as n}from"../../../core/promiseUtils.js";import{watch as o,when as a,sync as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../core/scheduling.js";import{Seconds as p,secondsFromMilliseconds as c}from"../../../core/time.js";import{property as g,subclass as m}from"../../../core/accessorSupport/decorators.js";import{projectOrLoad as f}from"../../../geometry/projectionUtils.js";import{fromExtent as _,intersection as y,toExtent as v,create as T,contains as w,area as S,intersects as b}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as R}from"../../../geometry/support/spatialReferenceUtils.js";import x from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as L,getPositions as A,getFlowSimulationSettings as j}from"../../2d/engine/flow/utils.js";import M from"./SubView3D.js";import{getFeatureTileId as E}from"./support/FeatureTileDescriptor.js";import{makeScheduleFunction as U}from"./support/makeScheduleFunction.js";import{debugFlags as P}from"../support/debugFlags.js";import{tileFilterDistance as I,scaleThresholdForLoadingAllTiles as F,fadeOutTime as D,fadeInTime as C,defaultTransitionDuration as q,transitionDurationFactor as k,seamlessTransitionEnabled as O,densityFactor as V,loadAllTilesDensityFactor as W,averageLoadingTimeSmoothingFactor as G,minimumTracingResolution as B}from"../support/flow/constants.js";import{isFullExtent as H,wrappedWidth as z,FlowQuery3D as N}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as Q}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as J,createStreamlineGeometry as K}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as X}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as Y}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as Z}from"../support/flow/StreamlineResources3DShape.js";import{descendantsAtLevel as $,tilesAreRelated as ee}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as te}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as ie}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as se,hasLayerBasedScaleVisibility as re}from"../../support/layerViewUtils.js";import{TaskPriority as le}from"../../support/Scheduler.js";let ne=class extends M{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=p(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._overrideTransitionEnabled=null,this._updateTask=null,this._debouncedTileUpdate=r(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*s(s){for(let r=0;r<e.length;++r){const l=e.at(r);t(l)&&i.add(l),s.madeProgress(),s.done&&(s=yield)}}await this.frameTask.scheduleGenerator(s),this.renderedTiles=i})}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new Q(U(i)),this.frameTask=i.scheduler.registerTask(le.FLOW_GENERATOR),this._updateTask=h({update:e=>this._update(e)}),this.addHandles([o(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&L(e,t)}),o(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),u),o(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),e.on("tiles-changed",()=>{this._triggerTilesUpdate()}),t.enableFeatureTiles(),o(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),o(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],s=e?.visualVariables??[];s.length===i.length&&s.every((e,t)=>e.type===i[t].type)||this.clear()}),a(()=>!t.featureTiles?.updating,()=>{this._triggerTilesUpdate()})]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=s(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=f(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:_(e)}get _dataBounds(){const e=this._fullExtentSurfaceSpatialReference;return null==e?null:_(e)}get _fullExtentSurfaceSpatialReference(){return f(this.layer.fullExtent,this.surface.spatialReference).geometry}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get extent(){if(this.loadAllTiles)return this._fullExtentSurfaceSpatialReference;const{spatialReference:e}=this.surface;let t=this.renderedTiles;if(null==e||null==t)return null;const i=this.view.terrainLevel;if(null!=i){const e=new Set;t.forEach(t=>{Math.abs(i-t.level)<I&&e.add(t)}),t=e}const s=X(t,this.spatialReferenceInfo);return null==s?null:(y(s,this._clippingArea,s),v(s,e))}get loadAllTiles(){return this.view.scale>(P.FLOW_GLOBAL_SCALE_THRESHOLD??F)}get isDataGlobal(){const{extent:e,spatialReferenceInfo:t}=this;return null!=e&&H(e.xmin,e.xmax,t)}get loadAllTilesLevel(){const{tilingScheme:e}=this.surface;return Math.min(Math.ceil(e.levelAtScale(P.FLOW_GLOBAL_SCALE_THRESHOLD??F)),e.getMaxLod())}get targetTiles(){const e=new Map;if(this.loadAllTiles){const{_dataBounds:t}=this;if(null==t)return e;const i=T(),s=this.loadAllTilesLevel,r=this.surface.tilingScheme,l=r.rootTilesInExtent(t).flatMap(e=>$(e,s));for(const n of l){const[l,o,a]=n;r.getExtent(s,o,a,i),ae(t,i)&&e.set(E(s,o,a),n)}return e}const{renderedTiles:t}=this;for(const i of t??[])e.set(i.key,i.lij);return e}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=f(e,this.surface.spatialReference).geometry;return null==t?null:_(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...J(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:C,fadeOutTime:D,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&te(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){const{_averageLoadingTime:e}=this;return p(0===e?q:this._averageLoadingTime*k)}get _seamlessTransitionEnabled(){return null!=this._overrideTransitionEnabled?this._overrideTransitionEnabled:O}get _tracingResolution(){const{extent:e}=this;if(!e)return[0,0];const t=z(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,s]=this.view.size;let r,l;i<s?(r=i,l=i/t):(r=s*t,l=s);const n=B,o=this.view.qualitySettings.flow.maxTracingResolution,a=Math.max(1,n/Math.min(r,l)),u=a*Math.min(1,o/Math.max(r*a,l*a));return[Math.round(r*u),Math.round(l*u)]}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get _estimatedStreamlines(){const{extent:e,_simulationSettings:t,renderedTiles:i,loadAllTiles:s}=this;if(null==t||null==i)return 0;const r=this._tracingResolution[0]*this._tracingResolution[1]/t.lineSpacing**2*t.density;if(s)return 2*r;const l=null==e?null:_(e);if(null==l)return 0;let n=0;for(const u of i)w(l,u.extent)&&(n+=S(u.extent));const o=S(l),a=0===o?0:n/o;return 2*Math.round(r*a)}get _effectiveDensity(){const{_estimatedStreamlines:e,_simulationSettings:t}=this,{qualitySettings:i,quality:s}=this.view;if(null==t)return 0;const r=i.flow.maxTotalNumberOfStreamlines,l=e>=r?r/e:1,n=t.density*l*s;return t.lineSpacing/Math.sqrt(n)<t.lineCollisionWidth?(t.lineSpacing/t.lineCollisionWidth)**2:n}get elevationInfo(){return this.layer.elevationInfo??oe}startPositions(e){if(!this._seamlessTransitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:A(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return R(this.surface.spatialReference)}get layer(){return this.layerView.layer}get loadingState(){return this._loadingState}get loadRequirementsMet(){return null!=this.renderedTiles&&(this.renderedTiles.size>0||this.loadAllTiles)}getUpdating(){return this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState}get updating(){return this.getUpdating()}get visibleAtCurrentScale(){return!re()||se(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=j(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,i.density*=V,this.loadAllTiles&&this.isDataGlobal&&(i.density*=W),null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const s="global"===this.view.viewingMode&&null!=i&&H(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:s,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this._loadingState="ready-to-load"}_update(e){const t=c(e.time);this._lastResources?.hasFadedOut(t)&&this._lastResources.detach();const i=this._nextStateForTransition(t);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==i||!this.loadRequirementsMet)return void(this._loadingState=i);this._loadingState="loading";const s=async()=>{const e=performance.now(),i=this._seamlessTransitionEnabled&&null!=this._resources?p(t+this._seamlessTransitionWaitingTime):t;await this._load(i);const s=p((performance.now()-e)/1e3);this._updateAverageLoadingTime(s)};this.updatingHandles.addPromise(l(s())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=G;this._averageLoadingTime=p(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e){const{extent:t,view:i}=this;if(!this._visible)return this.clear(),void(this._loadingState="ready-to-load");if(null==t)return void(this._loadingState="ready-to-load");const s=new N(t,this.layerView.timeExtent,this._tracingResolution,i.state.contentPixelRatio,e);null==this._abortController&&(this._abortController=new AbortController);const r=this._abortController,l=await this._loadStreamlines(s,r.signal);if(n(r.signal),this._visible&&null!=l){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=l;const t=performance.now()/1e3,i=t>e?t:e;null!=this._lastResources&&(this._lastResources.endTime=i),this._resources.startTime=i,await l.attach(),this._loadingState=this._seamlessTransitionEnabled?"before-transition":"transitioning"}else this._loadingState="ready-to-load"}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:s,material:r}=await this._createGeometry(e,i);return this._draped?new Y(e,i,r,s,this.layerView):new Z(e,i,r,s,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new ie(this._materialParameters,this.view.state.isGlobal),s=new Array,{elevationInfo:r,_draped:l,view:n}=this;function*o(o){for(let a=0;a<t.length;++a)s.push(K(n,e,t[a],r,i,l)),o.madeProgress(),o.done&&(o=yield)}return await this.frameTask.scheduleGenerator(o),{geometries:s,material:i}}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await d(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(l(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:s,loadAllTiles:r}=this;if(r){const{loadAllTilesLevel:t}=this;return i=>i.level===t&&ae(e,i.extent)}const l=t=>t.rendered&&t.visible&&ae(e,t.extent),{featureTiles:n}=i;if(!n)return l;const o=n.tiles.filter(e=>e.measures.visible);return e=>l(e)&&ae(s,e.extent)&&o.some(({lij:i})=>t(i,e.lij)||ee(i,e.lij))}_nextStateForTransition(e){const{_resources:t}=this;if(null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+D?"transitioning":"ready-to-load"}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([g()],ne.prototype,"type",void 0),e([g()],ne.prototype,"renderedTiles",void 0),e([g()],ne.prototype,"_resources",void 0),e([g()],ne.prototype,"_lastResources",void 0),e([g()],ne.prototype,"requireLoad",void 0),e([g()],ne.prototype,"_averageLoadingTime",void 0),e([g()],ne.prototype,"_loadingState",void 0),e([g()],ne.prototype,"emissiveStrength",void 0),e([g()],ne.prototype,"_clippingArea",null),e([g()],ne.prototype,"_dataBounds",null),e([g()],ne.prototype,"_fullExtentSurfaceSpatialReference",null),e([g()],ne.prototype,"_draped",null),e([g()],ne.prototype,"extent",null),e([g()],ne.prototype,"loadAllTiles",null),e([g()],ne.prototype,"isDataGlobal",null),e([g()],ne.prototype,"loadAllTilesLevel",null),e([g()],ne.prototype,"targetTiles",null),e([g()],ne.prototype,"_featureTilesBounds",null),e([g()],ne.prototype,"_flowRenderer",null),e([g()],ne.prototype,"_materialParameters",null),e([g()],ne.prototype,"_opacity",null),e([g()],ne.prototype,"_seamlessTransitionWaitingTime",null),e([g()],ne.prototype,"_seamlessTransitionEnabled",null),e([g()],ne.prototype,"_tracingResolution",null),e([g()],ne.prototype,"_visible",null),e([g()],ne.prototype,"_estimatedStreamlines",null),e([g()],ne.prototype,"_effectiveDensity",null),e([g()],ne.prototype,"elevationInfo",null),e([g()],ne.prototype,"needsMagnitude",null),e([g()],ne.prototype,"spatialReferenceInfo",null),e([g()],ne.prototype,"layer",null),e([g()],ne.prototype,"loadingState",null),e([g()],ne.prototype,"updating",null),e([g()],ne.prototype,"visibleAtCurrentScale",null),e([g()],ne.prototype,"_overrideMaterialParameters",void 0),e([g()],ne.prototype,"_overrideSimulationSettings",void 0),e([g()],ne.prototype,"_overrideTransitionEnabled",void 0),e([g()],ne.prototype,"_simulationSettings",null),e([g()],ne.prototype,"surface",null),ne=e([m("esri.views.3d.layers.FlowSubView3D")],ne);const oe=new x({mode:"on-the-ground"});function ae(e,t){return null==e||null==t||b(e,t)}export{ne as default};
5
+ import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as i,abortMaybe as r}from"../../../core/maybe.js";import{debounce as s,ignoreAbortErrors as l,throwIfAborted as n}from"../../../core/promiseUtils.js";import{watch as o,when as a,sync as u,whenOnce as d}from"../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../core/scheduling.js";import{Seconds as p,secondsFromMilliseconds as c}from"../../../core/time.js";import{property as m,subclass as g}from"../../../core/accessorSupport/decorators.js";import{projectOrLoad as f}from"../../../geometry/projectionUtils.js";import _ from"../../../geometry/SpatialReference.js";import{fromExtent as y,intersection as v,toExtent as T,create as w,contains as S,area as b,intersects as R}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as x}from"../../../geometry/support/spatialReferenceUtils.js";import L from"../../../symbols/support/ElevationInfo.js";import{simulationSettingsEqual as A,getPositions as j,getFlowSimulationSettings as M}from"../../2d/engine/flow/utils.js";import E from"./SubView3D.js";import{getFeatureTileId as U}from"./support/FeatureTileDescriptor.js";import{makeScheduleFunction as P}from"./support/makeScheduleFunction.js";import{debugFlags as I}from"../support/debugFlags.js";import{tileFilterDistance as C,scaleThresholdForLoadingAllTiles as F,fadeOutTime as D,fadeInTime as W,defaultTransitionDuration as q,transitionDurationFactor as k,seamlessTransitionEnabled as O,densityFactor as V,loadAllTilesDensityFactor as G,averageLoadingTimeSmoothingFactor as B,minimumTracingResolution as H}from"../support/flow/constants.js";import{isFullExtent as z,wrappedWidth as N,FlowQuery3D as Q}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as J}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as K,createStreamlineGeometry as X}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as Y}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as Z}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as $}from"../support/flow/StreamlineResources3DShape.js";import{webMercatorWorldExtent as ee}from"../terrain/TerrainConst.js";import{descendantsAtLevel as te,tilesAreRelated as ie}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as re}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as se}from"../webgl-engine/materials/RibbonLineMaterial.js";import{isInEffectiveScaleRange as le,hasLayerBasedScaleVisibility as ne}from"../../support/layerViewUtils.js";import{TaskPriority as oe}from"../../support/Scheduler.js";let ae=class extends E{constructor(e){super(e),this.type="flow",this.renderedTiles=null,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=p(0),this._abortController=null,this._loadingState="ready-to-load",this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=!0,this.emissiveStrength=0,this._overrideMaterialParameters=null,this._overrideSimulationSettings=null,this._overrideTransitionEnabled=null,this._updateTask=null,this._debouncedTileUpdate=s(async()=>{const{allTiles:e}=this.surface,t=this._getTileFilterFunction(),i=new Set;function*r(r){for(let s=0;s<e.length;++s){const l=e.at(s);t(l)&&i.add(l),r.madeProgress(),r.done&&(r=yield)}}await this.frameTask.scheduleGenerator(r),this.renderedTiles=i})}initialize(){const{surface:e,view:t}=this,{resourceController:i}=t;this.workerHandle=new J(P(i)),this.frameTask=i.scheduler.registerTask(oe.FLOW_GENERATOR),this._updateTask=h({update:e=>this._update(e)}),this.addHandles([o(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>null==e&&null==t||null!=e&&null!=t&&A(e,t)}),o(()=>{const{elevationInfo:e}=this;return[this._clippingArea,this._visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),u),o(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),a(()=>e.allTilesCreated,()=>this._triggerTilesUpdate,u),t.enableFeatureTiles(),o(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),o(()=>this._flowRenderer,(e,t)=>{const i=t?.visualVariables??[],r=e?.visualVariables??[];r.length===i.length&&r.every((e,t)=>e.type===i[t].type)||this.clear()}),a(()=>!t.featureTiles?.updating,()=>{this._triggerTilesUpdate()})]),this._triggerTilesUpdate()}destroy(){this._updateTask=i(this._updateTask),this.abort(),this.clear()}abort(){this._abortController=r(this._abortController),this.requireLoad=!1}get _clippingArea(){const e=f(this.view.clippingArea,this.surface.spatialReference).geometry;return null==e?null:y(e)}get _dataBounds(){const e=this._fullExtentSurfaceSpatialReference;return null==e?null:y(e)}get _fullExtentSurfaceSpatialReference(){return f(this.layer.fullExtent,this.surface.spatialReference).geometry}get _draped(){return"on-the-ground"===this.elevationInfo.mode}get extent(){if(this.loadAllTiles)return pe(this._fullExtentSurfaceSpatialReference);const{spatialReference:e}=this.surface;let t=this.renderedTiles;if(null==e||null==t)return null;const i=this.view.terrainLevel;if(null!=i){const e=new Set;t.forEach(t=>{Math.abs(i-t.level)<C&&e.add(t)}),t=e}const r=Y(t,this.spatialReferenceInfo);return null==r?null:(v(r,this._clippingArea,r),pe(T(r,e)))}get loadAllTiles(){return this.view.scale>(I.FLOW_GLOBAL_SCALE_THRESHOLD??F)}get isDataGlobal(){const{extent:e,spatialReferenceInfo:t}=this;return null!=e&&z(e.xmin,e.xmax,t)}get loadAllTilesLevel(){const{tilingScheme:e}=this.surface;return Math.min(Math.ceil(e.levelAtScale(I.FLOW_GLOBAL_SCALE_THRESHOLD??F)),e.getMaxLod())}get targetTiles(){const e=new Map;if(this.loadAllTiles){const{_dataBounds:t}=this;if(null==t)return e;const i=w(),r=this.loadAllTilesLevel,s=this.surface.tilingScheme,l=s.rootTilesInExtent(t).flatMap(e=>te(e,r));for(const n of l){const[l,o,a]=n;s.getExtent(r,o,a,i),de(t,i)&&e.set(U(r,o,a),n)}return e}const{renderedTiles:t}=this;for(const i of t??[])e.set(i.key,i.lij);return e}get _featureTilesBounds(){const e=this.view.featureTiles?.filterExtent,t=f(e,this.surface.spatialReference).geometry;return null==t?null:y(t)}get _flowRenderer(){const e=this.layer.renderer;return"flow"!==e?.type?null:e}get _materialParameters(){return{...K(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),fadeInTime:W,fadeOutTime:D,...this._overrideMaterialParameters,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&re(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){const{_averageLoadingTime:e}=this;return p(0===e?q:this._averageLoadingTime*k)}get _seamlessTransitionEnabled(){return null!=this._overrideTransitionEnabled?this._overrideTransitionEnabled:O}get _tracingResolution(){const{extent:e}=this;if(!e)return[0,0];const t=N(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[i,r]=this.view.size;let s,l;i<r?(s=i,l=i/t):(s=r*t,l=r);const n=H,o=this.view.qualitySettings.flow.maxTracingResolution,a=Math.max(1,n/Math.min(s,l)),u=a*Math.min(1,o/Math.max(s*a,l*a));return[Math.round(s*u),Math.round(l*u)]}get _visible(){const e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(null==e||e.a>0)}get _estimatedStreamlines(){const{extent:e,_simulationSettings:t,renderedTiles:i,loadAllTiles:r}=this;if(null==t||null==i)return 0;const s=this._tracingResolution[0]*this._tracingResolution[1]/t.lineSpacing**2*t.density;if(r)return 2*s;const l=null==e?null:y(e);if(null==l)return 0;let n=0;for(const u of i)S(l,u.extent)&&(n+=b(u.extent));const o=b(l),a=0===o?0:n/o;return 2*Math.round(s*a)}get _effectiveDensity(){const{_estimatedStreamlines:e,_simulationSettings:t}=this,{qualitySettings:i,quality:r}=this.view;if(null==t)return 0;const s=i.flow.maxTotalNumberOfStreamlines,l=e>=s?s/e:1,n=t.density*l*r;return t.lineSpacing/Math.sqrt(n)<t.lineCollisionWidth?(t.lineSpacing/t.lineCollisionWidth)**2:n}get elevationInfo(){return this.layer.elevationInfo??ue}startPositions(e){if(!this._seamlessTransitionEnabled)return[];const{_flowRenderer:t,_resources:i}=this;return null==t||null==i?[]:j(i.streamlines,i.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return x(this.surface.spatialReference)}get layer(){return this.layerView.layer}get loadingState(){return this._loadingState}get loadRequirementsMet(){return null!=this.renderedTiles&&(this.renderedTiles.size>0||this.loadAllTiles)&&null!=this.extent}getUpdating(){return!this.destroyed&&(null==this.extent||this.updatingHandles.updating||this.requireLoad||"before-transition"===this._loadingState)}get updating(){return this.getUpdating()}get visibleAtCurrentScale(){return!ne()||le(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){const{_flowRenderer:e,_overrideSimulationSettings:t}=this;if(null==e)return null;let i=M(e);return i.segmentLength=i.lineCollisionWidth/2,i.onlyForwardTracing=!1,i.density*=V,this.loadAllTiles&&this.isDataGlobal&&(i.density*=G),null!=t&&(i={...i,...t}),i}getSimulationSettings(e){const{_simulationSettings:t,spatialReferenceInfo:i}=this;if(null==t)return null;const r="global"===this.view.viewingMode&&null!=i&&z(e.extent.xmin,e.extent.xmax,i);return{...t,wrapAround:r,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){this.triggerLoad()}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this._loadingState="ready-to-load"}_update(e){const t=c(e.time);this._lastResources?.hasFadedOut(t)&&this._lastResources.detach();const i=this._nextStateForTransition(t);if(!this.requireLoad||this.updatingHandles.updating||"ready-to-load"!==i||!this.loadRequirementsMet)return void(this._loadingState=i);this._loadingState="loading";const r=async()=>{const e=performance.now(),i=this._seamlessTransitionEnabled&&null!=this._resources?p(t+this._seamlessTransitionWaitingTime):t;await this._load(i);const r=p((performance.now()-e)/1e3);this._updateAverageLoadingTime(r)};this.updatingHandles.addPromise(l(r())),this.requireLoad=!1}_updateAverageLoadingTime(e){const t=B;this._averageLoadingTime=p(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){this._debugAllowAutoLoading&&(this.requireLoad=!0)}async _load(e){const{extent:t,view:i}=this;if(!this._visible)return this.clear(),void(this._loadingState="ready-to-load");if(null==t)return void(this._loadingState="ready-to-load");const r=new Q(t,this.layerView.timeExtent,this._tracingResolution,i.state.contentPixelRatio,e);null==this._abortController&&(this._abortController=new AbortController);const s=this._abortController,l=await this._loadStreamlines(r,s.signal);if(n(s.signal),this._visible&&null!=l){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=l;const t=performance.now()/1e3,i=t>e?t:e;null!=this._lastResources&&(this._lastResources.endTime=i),this._resources.startTime=i,await l.attach(),this._loadingState=this._seamlessTransitionEnabled?"before-transition":"transitioning"}else this._loadingState="ready-to-load"}async _loadStreamlines(e,t){const i=await this.fetchDataAndGenerateStreamlines(e,t);if(null==i)return null;const{geometries:r,material:s}=await this._createGeometry(e,i);return this._draped?new Z(e,i,s,r,this.layerView):new $(e,i,s,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t){const i=new se(this._materialParameters,this.view.state.isGlobal),r=new Array,{elevationInfo:s,_draped:l,view:n}=this;function*o(o){for(let a=0;a<t.length;++a)r.push(X(n,e,t[a],s,i,l)),o.madeProgress(),o.done&&(o=yield)}return await this.frameTask.scheduleGenerator(o),{geometries:r,material:i}}_triggerTilesUpdate(){if(this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;const e=async()=>{await d(()=>this.view.stationary),this._tilesUpdateIsWaiting=!1,await this._debouncedTileUpdate()};this.updatingHandles.addPromise(l(e()))}_getTileFilterFunction(){const{_dataBounds:e,view:i,_featureTilesBounds:r,loadAllTiles:s}=this;if(s){const{loadAllTilesLevel:t}=this;return i=>i.level===t&&de(e,i.extent)}const l=t=>t.rendered&&t.visible&&de(e,t.extent),{featureTiles:n}=i;if(!n)return l;const o=n.tiles.filter(e=>e.measures.visible);return e=>l(e)&&de(r,e.extent)&&o.some(({lij:i})=>t(i,e.lij)||ie(i,e.lij))}_nextStateForTransition(e){const{_resources:t}=this;if(null==this._flowRenderer||null==t||"ready-to-load"===this._loadingState||"loading"===this._loadingState)return this._loadingState;const i=t.startTime;return e<i?"before-transition":e<i+D?"transitioning":"ready-to-load"}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([m()],ae.prototype,"type",void 0),e([m()],ae.prototype,"renderedTiles",void 0),e([m()],ae.prototype,"_resources",void 0),e([m()],ae.prototype,"_lastResources",void 0),e([m()],ae.prototype,"requireLoad",void 0),e([m()],ae.prototype,"_averageLoadingTime",void 0),e([m()],ae.prototype,"_loadingState",void 0),e([m()],ae.prototype,"emissiveStrength",void 0),e([m()],ae.prototype,"_clippingArea",null),e([m()],ae.prototype,"_dataBounds",null),e([m()],ae.prototype,"_fullExtentSurfaceSpatialReference",null),e([m()],ae.prototype,"_draped",null),e([m()],ae.prototype,"extent",null),e([m()],ae.prototype,"loadAllTiles",null),e([m()],ae.prototype,"isDataGlobal",null),e([m()],ae.prototype,"loadAllTilesLevel",null),e([m()],ae.prototype,"targetTiles",null),e([m()],ae.prototype,"_featureTilesBounds",null),e([m()],ae.prototype,"_flowRenderer",null),e([m()],ae.prototype,"_materialParameters",null),e([m()],ae.prototype,"_opacity",null),e([m()],ae.prototype,"_seamlessTransitionWaitingTime",null),e([m()],ae.prototype,"_seamlessTransitionEnabled",null),e([m()],ae.prototype,"_tracingResolution",null),e([m()],ae.prototype,"_visible",null),e([m()],ae.prototype,"_estimatedStreamlines",null),e([m()],ae.prototype,"_effectiveDensity",null),e([m()],ae.prototype,"elevationInfo",null),e([m()],ae.prototype,"needsMagnitude",null),e([m()],ae.prototype,"spatialReferenceInfo",null),e([m()],ae.prototype,"layer",null),e([m()],ae.prototype,"loadingState",null),e([m()],ae.prototype,"updating",null),e([m()],ae.prototype,"visibleAtCurrentScale",null),e([m()],ae.prototype,"_overrideMaterialParameters",void 0),e([m()],ae.prototype,"_overrideSimulationSettings",void 0),e([m()],ae.prototype,"_overrideTransitionEnabled",void 0),e([m()],ae.prototype,"_simulationSettings",null),e([m()],ae.prototype,"surface",null),ae=e([g("esri.views.3d.layers.FlowSubView3D")],ae);const ue=new L({mode:"on-the-ground"});function de(e,t){return null==e||null==t||R(e,t)}const he=T(ee,_.WebMercator);function pe(e){return null!=e&&e.spatialReference.isWebMercator?e?.intersection(he):e}export{ae 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{__decorate as e}from"tslib";import r from"../../../core/Error.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{when as i}from"../../../core/reactiveUtils.js";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import{LayerView3D as a}from"./LayerView3D.js";import{elevationAlignPointsInFeatures as n}from"./graphics/elevationAlignPointsInFeatures.js";import{GraphicsProcessor as l}from"./graphics/GraphicsProcessor.js";import{queryForSymbologySnapping as p}from"./graphics/queryForSymbologySnapping.js";import{LayerViewPerformanceInfo as c}from"./support/LayerViewPerformanceInfo.js";import h from"../../layers/LayerView.js";import{getHighlightName as d}from"../../support/highlightOptionsUtils.js";import{isInEffectiveScaleRange as u,hasLayerBasedScaleVisibility as g}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as y}from"../../support/projectionUtils.js";let m=class extends(a(h)){constructor(){super(...arguments),this.type="graphics-3d",this.symbologySnappingSupported=!0,this._slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.ignoresMemoryFactor=!0}get highlightOptions(){return null}initialize(){this._set("processor",new l({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.addHandles(this.layer.on("graphic-update",e=>this.processor.graphicsCore.graphicUpdateHandler(e))),this.layer.internal?this.notifyChange("updating"):("local"===this.view.viewingMode&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await y(this.layer.fullExtent,this.view.spatialReference))()),this.addHandles(i(()=>this.view?.basemapTerrain?.ready,()=>()=>this.notifyChange("updating"),{once:!0})))}destroy(){this._updatingHandles.removeAll(),this._set("processor",s(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.processor?.frustumVisibilitySuspended}get visibleAtCurrentScale(){return g()?u(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get slicePlaneEnabled(){const e=this.layer.internal;return this._slicePlaneEnabled&&!e}set slicePlaneEnabled(e){this._slicePlaneEnabled=e}getSuspendInfo(){const e=super.getSuspendInfo();return e.outsideOfView=this.processor?.frustumVisibilitySuspended??!1,e}getHit(e){return this.processor.getHit(e,null)}whenGraphicBounds(e,r){return this.processor.whenGraphicBounds(e,r)}computeAttachmentOrigin(e,r){return this.processor?.computeAttachmentOrigin(e,r)}getSymbolLayerSize(e,r){return this.processor.getSymbolLayerSize(e,r)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e,r){return this.processor.highlight(e,d(r))}notifyContentGeometryUpdate(){this.emit("visible-geometry-changed")}async elevationAlignPointsInFeatures(e,s){const{processor:i}=this;if(null==i?.graphics3DGraphics)throw new r("graphicslayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");const{graphics3DGraphics:t}=i,o=e=>"number"==typeof e?t.get(e):void 0;return n(this.view,this.layer,o,e,s)}async queryForSymbologySnapping(e,r){return p(this.processor,e,r)}get updatePolicy(){return this.processor?.graphicsCore.effectiveUpdatePolicy||1}isUpdating(){return this.view&&this.layer&&!(!this.processor?.updating&&(this.layer.internal||this.view.basemapTerrain?.ready))}get performanceInfo(){return new c(this.usedMemory,this.loadedGraphics.length,-1,-1)}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return this.processor?.graphicsCore?.unprocessedMemoryEstimate}get test(){return{graphics3DProcessor:this.processor,loadedGraphics:this.loadedGraphics}}};e([t()],m.prototype,"highlightOptions",null),e([t()],m.prototype,"loadedGraphics",null),e([t({readOnly:!0})],m.prototype,"legendEnabled",null),e([t()],m.prototype,"layer",void 0),e([t({readOnly:!0})],m.prototype,"processor",void 0),e([t({readOnly:!0})],m.prototype,"visibleAtCurrentScale",null),e([t()],m.prototype,"_slicePlaneEnabled",void 0),e([t({type:Boolean})],m.prototype,"slicePlaneEnabled",null),m=e([o("esri.views.3d.layers.GraphicsLayerView3D")],m);const f=m;export{f as default};
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{when as i}from"../../../core/reactiveUtils.js";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import{LayerView3D as n}from"./LayerView3D.js";import{elevationAlignPointsInFeatures as a}from"./graphics/elevationAlignPointsInFeatures.js";import{GraphicsProcessor as l}from"./graphics/GraphicsProcessor.js";import{queryForSymbologySnapping as p}from"./graphics/queryForSymbologySnapping.js";import{LayerViewPerformanceInfo as c}from"./support/LayerViewPerformanceInfo.js";import h from"../../layers/LayerView.js";import{getHighlightName as d}from"../../support/highlightOptionsUtils.js";import{isInEffectiveScaleRange as u,hasLayerBasedScaleVisibility as g}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as y}from"../../support/projectionUtils.js";let m=class extends(n(h)){constructor(){super(...arguments),this.type="graphics-3d",this.symbologySnappingSupported=!0,this._slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.ignoresMemoryFactor=!0}get highlightOptions(){return null}initialize(){this._set("processor",new l({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.addHandles(this.layer.on("graphic-update",e=>this.processor.graphicsCore.graphicUpdateHandler(e))),this.layer.internal?this.notifyChange("updating"):("local"===this.view.viewingMode&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await y(this.layer.fullExtent,this.view.spatialReference))()),this.addHandles(i(()=>this.view?.groundView?.ready,()=>()=>this.notifyChange("updating"),{once:!0})))}destroy(){this._updatingHandles.removeAll(),this._set("processor",s(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.processor?.frustumVisibilitySuspended}get visibleAtCurrentScale(){return g()?u(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get slicePlaneEnabled(){const e=this.layer.internal;return this._slicePlaneEnabled&&!e}set slicePlaneEnabled(e){this._slicePlaneEnabled=e}getSuspendInfo(){const e=super.getSuspendInfo();return e.outsideOfView=this.processor?.frustumVisibilitySuspended??!1,e}getHit(e){return this.processor.getHit(e,null)}whenGraphicBounds(e,r){return this.processor.whenGraphicBounds(e,r)}computeAttachmentOrigin(e,r){return this.processor?.computeAttachmentOrigin(e,r)}getSymbolLayerSize(e,r){return this.processor.getSymbolLayerSize(e,r)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e,r){return this.processor.highlight(e,d(r))}notifyContentGeometryUpdate(){this.emit("visible-geometry-changed")}async elevationAlignPointsInFeatures(e,s){const{processor:i}=this;if(null==i?.graphics3DGraphics)throw new r("graphicslayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");const{graphics3DGraphics:t}=i,o=e=>"number"==typeof e?t.get(e):void 0;return a(this.view,this.layer,o,e,s)}async queryForSymbologySnapping(e,r){return p(this.processor,e,r)}get updatePolicy(){return this.processor?.graphicsCore.effectiveUpdatePolicy||1}isUpdating(){return this.view&&this.layer&&!(!this.processor?.updating&&(this.layer.internal||this.view.groundView?.ready))}get performanceInfo(){return new c(this.usedMemory,this.loadedGraphics.length,-1,-1)}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return this.processor?.graphicsCore?.unprocessedMemoryEstimate}get test(){return{graphics3DProcessor:this.processor,loadedGraphics:this.loadedGraphics}}};e([t()],m.prototype,"highlightOptions",null),e([t()],m.prototype,"loadedGraphics",null),e([t({readOnly:!0})],m.prototype,"legendEnabled",null),e([t()],m.prototype,"layer",void 0),e([t({readOnly:!0})],m.prototype,"processor",void 0),e([t({readOnly:!0})],m.prototype,"visibleAtCurrentScale",null),e([t()],m.prototype,"_slicePlaneEnabled",void 0),e([t({type:Boolean})],m.prototype,"slicePlaneEnabled",null),m=e([o("esri.views.3d.layers.GraphicsLayerView3D")],m);const f=m;export{f as default};