@arcgis/core 4.25.0-next.20220718 → 4.25.0-next.20220721

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 (284) hide show
  1. package/Camera.js +1 -1
  2. package/analysis/DimensioningAnalysis.js +1 -1
  3. package/analysis/LineOfSightAnalysis.js +1 -1
  4. package/analysis/SliceAnalysis.js +1 -1
  5. package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
  6. package/arcade/functions/featuresetgeom.js +1 -1
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/1751de504354d98ac3fd.js +1 -0
  9. package/assets/esri/core/workers/chunks/1f4f1896880bfa6801c5.js +1 -0
  10. package/assets/esri/core/workers/chunks/290cd411d0d18b1d0efd.js +1 -0
  11. package/assets/esri/core/workers/chunks/{ab3bd5fecdb97f2d690e.js → 3b5be512567d9c1c6fe6.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{c3236a7058e64ea3b939.js → 3c9da9b88777700879aa.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{f96e8724ae3458f5e262.js → 4a7aa1b9de61eb013647.js} +1 -1
  14. package/assets/esri/core/workers/chunks/4cb64ccb5fba126f9a66.js +1 -0
  15. package/assets/esri/core/workers/chunks/{68f19e58aae01791944e.js → 579ba109718bc2554008.js} +1 -1
  16. package/assets/esri/core/workers/chunks/59845b02b07a8ed7ce81.js +1 -0
  17. package/assets/esri/core/workers/chunks/{c705f907ce60a646d9aa.js → 652d36523efbe5c9ebb2.js} +1 -1
  18. package/assets/esri/core/workers/chunks/888d8e4471c9a2cd5009.js +1 -0
  19. package/assets/esri/core/workers/chunks/9493a8e5d6001b6bf275.js +1 -0
  20. package/assets/esri/core/workers/chunks/9d824cdfbcdf3cb3246f.js +1 -0
  21. package/assets/esri/core/workers/chunks/bf348f6f52701fa6016e.js +987 -0
  22. package/assets/esri/core/workers/chunks/d02881954c0cc0d39dfb.js +1 -0
  23. package/assets/esri/core/workers/chunks/{1ecbf642debc2207b762.js → da54483123f377e9b3e1.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{61b71b8e028eda10ccab.js → e4ad2cf5d6bded02e392.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{3bfab05ae07ac18a75fe.js → f298a70f3b6f27675d53.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{d499cce61c1c5c367380.js → f40290cfad3fe6fb4ef9.js} +1 -1
  27. package/assets/esri/layers/support/rasterFormats/lerc-wasm.wasm +0 -0
  28. package/assets/esri/themes/base/widgets/_Tooltip.scss +1 -1
  29. package/assets/esri/themes/dark/main.css +1 -1
  30. package/assets/esri/themes/light/main.css +1 -1
  31. package/assets/esri/themes/light/view.css +1 -1
  32. package/chunks/ComponentShader.glsl.js +39 -33
  33. package/chunks/Laserlines.glsl.js +4 -4
  34. package/chunks/Precipitation.glsl.js +2 -2
  35. package/chunks/RibbonLine.glsl.js +46 -44
  36. package/chunks/Stars.glsl.js +2 -2
  37. package/chunks/Terrain.glsl.js +25 -17
  38. package/chunks/boundedPlane.js +1 -1
  39. package/chunks/lerc-wasm.js +1 -1
  40. package/chunks/mat2d.js +1 -1
  41. package/chunks/quatf32.js +1 -1
  42. package/core/BidiEngine.js +1 -1
  43. package/core/accessorSupport/watch.js +1 -1
  44. package/core/libs/gl-matrix-2/factories/quatf32.js +1 -1
  45. package/core/libs/gl-matrix-2/math/mat2d.js +1 -1
  46. package/core/perspectiveUtils.js +1 -1
  47. package/core/promiseUtils.js +1 -1
  48. package/core/reactiveUtils.js +1 -1
  49. package/core/unitUtils.js +1 -1
  50. package/geometry/projection.js +1 -1
  51. package/geometry/projectionEllipsoid.js +1 -1
  52. package/geometry/support/MeshTexture.js +1 -1
  53. package/geometry/support/axisAngleDegrees.js +1 -1
  54. package/geometry/support/coordinateSystem.js +1 -1
  55. package/geometry/support/geodesicUtils.js +1 -1
  56. package/geometry/support/meshUtils/exporters/gltf/index.js +1 -1
  57. package/geometry/support/meshUtils/loadExternal.js +1 -1
  58. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  59. package/geometry/support/scaleUtils.js +1 -1
  60. package/geometry/support/spatialReferenceUtils.js +1 -1
  61. package/identity/IdentityManagerBase.js +1 -1
  62. package/identity/IdentityModal.js +1 -1
  63. package/interfaces.d.ts +3 -33
  64. package/layers/FeatureLayer.js +1 -1
  65. package/layers/effects/parser.js +1 -1
  66. package/layers/graphics/hydratedFeatures.js +1 -1
  67. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  68. package/layers/mixins/ArcGISImageService.js +1 -1
  69. package/layers/ogc/wfsUtils.js +1 -1
  70. package/layers/support/ContingentValue.js +1 -1
  71. package/layers/support/ElevationQuery.js +1 -1
  72. package/layers/support/PixelBlock.js +1 -1
  73. package/layers/support/kmlUtils.js +1 -1
  74. package/layers/support/rasterDatasets/CloudRaster.js +1 -1
  75. package/layers/support/rasterDatasets/EphemeralBlockCache.js +1 -1
  76. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  77. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  78. package/layers/support/rasterFormats/ImageCanvasDecoder.js +1 -1
  79. package/layers/support/rasterFormats/JpgPlus.js +1 -1
  80. package/layers/support/rasterFormats/Lerc.js +1 -1
  81. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  82. package/layers/support/rasterFormats/Raw.js +1 -1
  83. package/layers/support/rasterFormats/TiffTags.js +1 -1
  84. package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
  85. package/layers/support/vectorTileLayerLoader.js +1 -1
  86. package/layers/support/wmtsUtils.js +1 -1
  87. package/package.json +1 -1
  88. package/renderers/RasterShadedReliefRenderer.js +1 -1
  89. package/renderers/RasterStretchRenderer.js +1 -1
  90. package/renderers/UniqueValueRenderer.js +1 -1
  91. package/renderers/support/AuthoringInfo.js +1 -1
  92. package/renderers/support/RasterSymbolizer.js +1 -1
  93. package/rest/query/operations/query.js +1 -1
  94. package/rest/query/operations/queryTopFeatures.js +1 -1
  95. package/rest/support/DirectionsFeatureSet.js +1 -1
  96. package/rest/support/ImageHistogramParameters.js +1 -1
  97. package/rest/support/ImageSampleParameters.js +1 -1
  98. package/smartMapping/labels/clusters.js +1 -1
  99. package/smartMapping/renderers/relationship.js +1 -1
  100. package/smartMapping/support/adapters/support/utils.js +1 -1
  101. package/support/basemapUtils.js +1 -1
  102. package/support/revision.js +1 -1
  103. package/symbols/LabelSymbol3D.js +1 -1
  104. package/symbols/PointSymbol3D.js +1 -1
  105. package/symbols/cim/CIMCursor.js +1 -1
  106. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  107. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  108. package/symbols/support/previewSymbol3D.js +1 -1
  109. package/symbols/support/webStyleSymbolUtils.js +1 -1
  110. package/views/2d/ViewState.js +1 -1
  111. package/views/2d/engine/vectorTiles/Feature.js +1 -1
  112. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  113. package/views/2d/engine/webgl/SDFConverter.js +1 -1
  114. package/views/2d/engine/webgl/TurboLine.js +1 -1
  115. package/views/2d/engine/webgl/brushes/BrushClip.js +1 -1
  116. package/views/2d/engine/webgl/brushes/BrushOverlay.js +1 -1
  117. package/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel.js +1 -1
  118. package/views/2d/engine/webgl/brushes/WGLGeometryBrushLine.js +1 -1
  119. package/views/2d/engine/webgl/brushes/WGLGeometryBrushText.js +1 -1
  120. package/views/2d/engine/webgl/collisions/MetricReader.js +1 -1
  121. package/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js +1 -1
  122. package/views/2d/engine/webgl/cpuMapped/FreeList.js +1 -1
  123. package/views/2d/engine/webgl/mesh/heuristics.js +1 -1
  124. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  125. package/views/2d/engine/webgl/mesh/templates/WGLDynamicLineTemplate.js +1 -1
  126. package/views/2d/engine/webgl/mesh/templates/WGLDynamicMarkerTemplate.js +1 -1
  127. package/views/2d/engine/webgl/mesh/templates/WGLDynamicTextTemplate.js +1 -1
  128. package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
  129. package/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js +1 -1
  130. package/views/2d/engine/webgl/mesh/templates/WGLMarkerTemplate.js +1 -1
  131. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  132. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  133. package/views/2d/input/MapViewInputManager.js +1 -1
  134. package/views/2d/layers/features/createSymbolSchema.js +1 -1
  135. package/views/2d/viewpointUtils.js +1 -1
  136. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  137. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  138. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  139. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  140. package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
  141. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  142. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  143. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  144. package/views/3d/camera/constraintUtils/distance.js +1 -1
  145. package/views/3d/environment/ChapmanAtmosphereTechniqueConfiguration.js +1 -1
  146. package/views/3d/environment/CloudsComposition.js +1 -1
  147. package/views/3d/environment/FogTechnique.js +1 -1
  148. package/views/3d/glTF/internal/Resource.js +1 -1
  149. package/views/3d/input/SceneInputManager.js +1 -1
  150. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  151. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  152. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  153. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  154. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  155. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
  156. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  157. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  158. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  159. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  160. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  161. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  162. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  163. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  164. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  165. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  166. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  167. package/views/3d/layers/graphics/lineUtils.js +1 -1
  168. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  169. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  170. package/views/3d/layers/i3s/IDBCache.js +1 -1
  171. package/views/3d/layers/i3s/IDBMockCache.js +1 -1
  172. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  173. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  174. package/views/3d/state/ViewState.js +1 -1
  175. package/views/3d/support/cameraUtils.js +1 -1
  176. package/views/3d/support/orientedBoundingBox.js +1 -1
  177. package/views/3d/support/viewpointUtils.js +1 -1
  178. package/views/3d/terrain/Overlay.js +1 -1
  179. package/views/3d/terrain/OverlayRenderTarget.js +1 -1
  180. package/views/3d/terrain/OverlayRenderer.js +1 -1
  181. package/views/3d/terrain/TerrainRenderer.js +1 -1
  182. package/views/3d/terrain/TerrainSurface.js +1 -1
  183. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  184. package/views/3d/terrain/interfaces.js +1 -1
  185. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  186. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  187. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  188. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  189. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  190. package/views/3d/webgl-engine/collections/Component/RenderGeometry.js +1 -1
  191. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  192. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  193. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  194. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +2 -2
  195. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
  196. package/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js +9 -0
  197. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +18 -17
  198. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  199. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  200. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  201. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +5 -0
  202. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  203. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  204. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  205. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  206. package/views/3d/webgl-engine/lib/TextureTechniqueConfiguration.js +1 -1
  207. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  208. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  209. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  210. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  211. package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
  212. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  213. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/PathMaterial.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/internal/bufferWriterUtils.js +1 -1
  218. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  219. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  220. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  221. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  222. package/views/3d/webgl-engine/shaders/LaserlinePathTechniqueConfiguration.js +1 -1
  223. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  224. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  225. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  226. package/views/DOMContainer.js +1 -1
  227. package/views/MapView.js +1 -1
  228. package/views/SceneView.js +1 -1
  229. package/views/View.js +1 -1
  230. package/views/analysis/analysisViewUtils.js +1 -1
  231. package/views/animation/pointToPoint/apex/planning.js +1 -1
  232. package/views/draw/PolygonDrawAction.js +1 -1
  233. package/views/draw/PolylineDrawAction.js +1 -1
  234. package/views/draw/support/createUtils.js +1 -1
  235. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  236. package/views/input/InputManager.js +1 -1
  237. package/views/input/handlers/LatestPointer.js +1 -1
  238. package/views/input/handlers/MultiTouch.js +5 -0
  239. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  240. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  241. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileCache.js +1 -1
  242. package/views/interactive/tooltip/Tooltip.js +1 -1
  243. package/views/interactive/tooltip/support/measurements.js +1 -1
  244. package/views/layers/GroupLayerView.js +1 -1
  245. package/views/navigation/FilteredFiniteDifference.js +1 -1
  246. package/views/navigation/MomentumEstimator.js +1 -1
  247. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  248. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  249. package/views/navigation/RotationMomentumEstimator.js +1 -1
  250. package/views/support/GroundViewElevationSampler.js +1 -1
  251. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  252. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  253. package/views/support/screenshotUtils.js +1 -1
  254. package/views/webgl/BufferObject.js +1 -1
  255. package/views/webgl/FramebufferObject.js +1 -1
  256. package/views/webgl/Texture.js +1 -1
  257. package/views/webgl/capabilities/Capabilities.js +1 -1
  258. package/views/webgl/capabilities.js +1 -1
  259. package/views/webgl/renderState.js +1 -1
  260. package/webscene/spec-certification/api.js +1 -1
  261. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  262. package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
  263. package/widgets/ElevationProfile/ElevationProfileLineInput.js +1 -1
  264. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  265. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  266. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  267. package/widgets/Expand.js +1 -1
  268. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  269. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  270. package/widgets/Popup/PopupViewModel.js +1 -1
  271. package/widgets/Popup/actionUtils.js +1 -1
  272. package/widgets/ScaleRangeSlider.js +1 -1
  273. package/widgets/Slider/SliderViewModel.js +1 -1
  274. package/widgets/Widget.js +1 -1
  275. package/assets/esri/core/workers/chunks/04ea469cb081e181ca82.js +0 -1
  276. package/assets/esri/core/workers/chunks/16c2626ca47132700519.js +0 -1
  277. package/assets/esri/core/workers/chunks/1e4e5d147263e98536bc.js +0 -1
  278. package/assets/esri/core/workers/chunks/35083def3c658d1ae9ff.js +0 -1
  279. package/assets/esri/core/workers/chunks/40032d2bf404a46b8f80.js +0 -1
  280. package/assets/esri/core/workers/chunks/613e82a3e13442685ac4.js +0 -1
  281. package/assets/esri/core/workers/chunks/64b4f1dbf61439cde801.js +0 -1
  282. package/assets/esri/core/workers/chunks/abd68b7ba3be4696611c.js +0 -1
  283. package/assets/esri/core/workers/chunks/b8a062c0c9c626acf61e.js +0 -982
  284. package/assets/esri/core/workers/chunks/e08686088be0aaca1a99.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{a as r}from"../../../chunks/Fog.glsl.js";import{ReloadableShaderModule as i}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{parameter as n,ShaderTechniqueConfiguration as t}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as s}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as a}from"../webgl-engine/lib/Program.js";import{BlendFactor as l}from"../../webgl/enums.js";import{makePipelineState as g,separateBlendingParams as m,defaultColorWriteParams as h}from"../../webgl/renderState.js";class c extends o{initializeProgram(e){return new a(e.rctx,c.shader.get().build(this.configuration),s)}initializePipeline(){return this.configuration.haze?g({blending:m(l.ONE,l.ZERO,l.ONE_MINUS_SRC_COLOR,l.ONE),colorWrite:h}):g({blending:m(l.SRC_ALPHA,l.ZERO,l.ONE_MINUS_SRC_ALPHA,l.ONE),colorWrite:h})}}c.shader=new i(r,(()=>import("./Fog.glsl.js")));class u extends t{constructor(){super(...arguments),this.haze=!1}}e([n()],u.prototype,"haze",void 0);export{c as FogTechnique,u as FogTechniqueConfiguration};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{a as r}from"../../../chunks/Fog.glsl.js";import{ReloadableShaderModule as i}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{ShaderTechniqueConfiguration as n,parameter as t}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as s}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as a}from"../webgl-engine/lib/Program.js";import{BlendFactor as l}from"../../webgl/enums.js";import{makePipelineState as g,separateBlendingParams as m,defaultColorWriteParams as h}from"../../webgl/renderState.js";class c extends o{initializeProgram(e){return new a(e.rctx,c.shader.get().build(this.configuration),s)}initializePipeline(){return this.configuration.haze?g({blending:m(l.ONE,l.ZERO,l.ONE_MINUS_SRC_COLOR,l.ONE),colorWrite:h}):g({blending:m(l.SRC_ALPHA,l.ZERO,l.ONE_MINUS_SRC_ALPHA,l.ONE),colorWrite:h})}}c.shader=new i(r,(()=>import("./Fog.glsl.js")));class u extends n{constructor(){super(...arguments),this.haze=!1}}e([t()],u.prototype,"haze",void 0);export{c as FogTechnique,u as FogTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../core/compilerUtils.js";import{getOrCreateMapValue as t}from"../../../../core/MapUtils.js";import{isDataProtocol as r,dataComponents as s,dataToArrayBuffer as n,makeAbsolute as o}from"../../../../core/urlUtils.js";import{Version as a}from"../../../../core/Version.js";import{w as i,m as u,h as c,e as p,l as f}from"../../../../chunks/mat4.js";import{c as d,b as l}from"../../../../chunks/mat4f64.js";import{g as m}from"../../../../chunks/quat.js";import{a as h}from"../../../../chunks/quatf64.js";import{BufferViewUint32 as y,BufferViewUint16 as b,BufferViewUint8 as T,BufferViewVec3f as _,BufferViewVec4f as O,BufferViewVec2f as w,BufferViewVec4u8 as N,BufferViewVec4u16 as x,BufferViewVec3u8 as S,BufferViewVec3u16 as C,BufferViewVec2u32 as U,BufferViewVec2u16 as I,BufferViewVec2i16 as g,BufferViewVec2u8 as A,BufferViewVec2i8 as E}from"../../../../geometry/support/buffer/BufferView.js";import{m as L}from"../../../../chunks/scalar.js";import{BinaryStreamReader as B}from"./BinaryStreamReader.js";import{AttributeType as R}from"./enums.js";import{material as D,textureSampler as G}from"./fillDefaults.js";import{splitURI as v}from"./pathUtils.js";import{DataType as j}from"../../../webgl/enums.js";const M={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class F{constructor(e,t,r,s,n){this._context=e,this._errorContext=t,this.uri=r,this.json=s,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._baseUri=v(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.errorUnsupportedIf(null==s.scenes,"Scenes must be defined."),t.errorUnsupportedIf(null==s.meshes,"Meshes must be defined"),t.errorUnsupportedIf(null==s.nodes,"Nodes must be defined."),this._computeNodeParents()}static async load(e,t,o,a){if(r(o)){const r=s(o);if("model/gltf-binary"!==r.mediaType)try{const s=JSON.parse(r.isBase64?atob(r.data):r.data);return new F(e,t,o,s)}catch{}const a=n(o);if(F._isGLBData(a))return this._fromGLBData(e,t,o,a)}if(o.endsWith(".gltf")){const r=await e.loadJSON(o,a);return new F(e,t,o,r)}const i=await e.loadBinary(o,a);if(F._isGLBData(i))return this._fromGLBData(e,t,o,i);const u=await e.loadJSON(o,a);return new F(e,t,o,u)}static _isGLBData(e){const t=new B(e);return t.remainingBytes()>=4&&t.readUint32()===M.MAGIC}static async _fromGLBData(e,t,r,s){const n=await F._parseGLBData(t,s);return new F(e,t,r,n.json,n.binaryData)}static async _parseGLBData(e,t){const r=new B(t);e.assert(r.remainingBytes()>=12,"GLB binary data is insufficiently large.");const s=r.readUint32(),n=r.readUint32(),o=r.readUint32();e.assert(s===M.MAGIC,"Magic first 4 bytes do not fit to expected GLB value."),e.assert(t.byteLength>=o,"GLB binary data is smaller than header specifies."),e.errorUnsupportedIf(2!==n,"An unsupported GLB container version was detected. Only version 2 is supported.");let a,i,u=0;for(;r.remainingBytes()>=8;){const t=r.readUint32(),s=r.readUint32();0===u?(e.assert(s===M.CHUNK_TYPE_JSON,"First GLB chunk must be JSON."),e.assert(t>=0,"No JSON data found."),a=await q(r.readUint8Array(t))):1===u?(e.errorUnsupportedIf(s!==M.CHUNK_TYPE_BIN,"Second GLB chunk expected to be BIN."),i=r.readUint8Array(t)):e.warnUnsupported("More than 2 GLB chunks detected. Skipping."),u+=1}return a||e.error("No GLB JSON chunk detected."),{json:a,binaryData:i}}async getBuffer(e,t){const r=this.json.buffers[e],s=this._errorContext;if(null==r.uri)return s.assert(null!=this._glbBuffer,"GLB buffer not present"),this._glbBuffer;const n=await this._getBufferLoader(e,t);return s.assert(n.byteLength===r.byteLength,"Buffer byte lengths should match."),n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const s=this.json.buffers[e],n=this._context.loadBinary(this._resolveUri(s.uri),t).then((e=>new Uint8Array(e)));return this._bufferLoaders.set(e,n),n}async getAccessor(e,t){const r=this._errorContext;r.errorUnsupportedIf(!this.json.accessors,"Accessors missing.");const s=this.json.accessors[e];r.errorUnsupportedIf(null==s?.bufferView,"Some accessor does not specify a bufferView."),r.errorUnsupportedIf(s.type in[R.MAT2,R.MAT3,R.MAT4],`AttributeType ${s.type} is not supported`);const n=this.json.bufferViews[s.bufferView],o=await this.getBuffer(n.buffer,t),a=H[s.type],i=Y[s.componentType],u=a*i,c=n.byteStride||u;return{raw:o.buffer,byteStride:c,byteOffset:o.byteOffset+(n.byteOffset||0)+(s.byteOffset||0),entryCount:s.count,isDenselyPacked:c===u,componentCount:a,componentByteSize:i,componentType:s.componentType,min:s.min,max:s.max,normalized:!!s.normalized}}async getIndexData(e,t){if(null==e.indices)return null;const r=await this.getAccessor(e.indices,t);if(r.isDenselyPacked)switch(r.componentType){case j.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case j.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case j.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case j.UNSIGNED_BYTE:return L(this._wrapAccessor(T,r));case j.UNSIGNED_SHORT:return L(this._wrapAccessor(b,r));case j.UNSIGNED_INT:return L(this._wrapAccessor(y,r))}}async getPositionData(e,t){const r=this._errorContext;r.errorUnsupportedIf(null==e.attributes.POSITION,"No POSITION vertex data found.");const s=await this.getAccessor(e.attributes.POSITION,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for POSITION vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"POSITION vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(_,s)}async getNormalData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.NORMAL,"No NORMAL vertex data found.");const s=await this.getAccessor(e.attributes.NORMAL,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for NORMAL vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"NORMAL vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(_,s)}async getTangentData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TANGENT,"No TANGENT vertex data found.");const s=await this.getAccessor(e.attributes.TANGENT,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for TANGENT vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(4!==s.componentCount,"TANGENT vertex attribute must have 4 components, but found "+s.componentCount.toFixed()),new O(s.raw,s.byteOffset,s.byteStride,s.byteOffset+s.byteStride*s.entryCount)}async getTextureCoordinates(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TEXCOORD_0,"No TEXCOORD_0 vertex data found.");const s=await this.getAccessor(e.attributes.TEXCOORD_0,t);return r.errorUnsupportedIf(2!==s.componentCount,"TEXCOORD_0 vertex attribute must have 2 components, but found "+s.componentCount.toFixed()),s.componentType===j.FLOAT?this._wrapAccessor(w,s):(r.errorUnsupportedIf(!s.normalized,"Integer component types are only supported for a normalized accessor for TEXCOORD_0."),J(s))}async getVertexColors(e,t){const r=this._errorContext;r.assert(null!=e.attributes.COLOR_0,"No COLOR_0 vertex data found.");const s=await this.getAccessor(e.attributes.COLOR_0,t);if(r.errorUnsupportedIf(4!==s.componentCount&&3!==s.componentCount,"COLOR_0 attribute must have 3 or 4 components, but found "+s.componentCount.toFixed()),4===s.componentCount){if(s.componentType===j.FLOAT)return this._wrapAccessor(O,s);if(s.componentType===j.UNSIGNED_BYTE)return this._wrapAccessor(N,s);if(s.componentType===j.UNSIGNED_SHORT)return this._wrapAccessor(x,s)}else if(3===s.componentCount){if(s.componentType===j.FLOAT)return this._wrapAccessor(_,s);if(s.componentType===j.UNSIGNED_BYTE)return this._wrapAccessor(S,s);if(s.componentType===j.UNSIGNED_SHORT)return this._wrapAccessor(C,s)}r.errorUnsupported("Unsupported component type for COLOR_0 attribute: "+z[s.componentType])}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let s=this._materialCache.get(e.material);if(!s){const n=null!=e.material?D(this.json.materials[e.material]):D(),o=n.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(o.baseColorTexture,t),u=this.getTexture(n.normalTexture,t),c=r?this.getTexture(n.occlusionTexture,t):null,p=r?this.getTexture(n.emissiveTexture,t):null,f=r?this.getTexture(o.metallicRoughnessTexture,t):null,d=null!=e.material?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:o.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await i,normalTexture:await u,name:n.name,id:d,occlusionTexture:await c,emissiveTexture:await p,emissiveFactor:n.emissiveFactor,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,metallicRoughnessTexture:await f,hasVertexColors:a,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode}}return s}async getTexture(e,r){if(!e)return null;this._errorContext.errorUnsupportedIf(0!==(e.texCoord||0),"Only TEXCOORD with index 0 is supported.");const s=e.index,n=this._errorContext,o=this.json.textures[s],a=G(null!=o.sampler?this.json.samplers[o.sampler]:{});n.errorUnsupportedIf(null==o.source,"Source is expected to be defined for a texture.");const i=this.json.images[o.source],u=await this._loadTextureImageData(s,o,r);return t(this._textureCache,s,(()=>{const e=e=>33071===e||33648===e||10497===e,t=e=>(n.error(`Unexpected TextureSampler WrapMode: ${e}. Using default REPEAT(10497).`),10497);return{data:u,wrapS:e(a.wrapS)?a.wrapS:t(a.wrapS),wrapT:e(a.wrapT)?a.wrapT:t(a.wrapT),minFilter:a.minFilter,name:i.name,id:s}}))}getNodeTransform(e){if(void 0===e)return V;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?t=u(d(),r,s.matrix):s.translation||s.rotation||s.scale?(t=l(r),s.translation&&c(t,t,s.translation),s.rotation&&(k[3]=m(k,s.rotation),p(t,t,k[3],k)),s.scale&&f(t,t,s.scale)):t=r,this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return o(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=a.parse(this.json.asset.version,"glTF");P.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json,t=this._errorContext;e.extensionsRequired&&0!==e.extensionsRequired.length&&t.errorUnsupported("gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach(((e,t)=>{e.children&&e.children.forEach((e=>{this._nodeParentMap.set(e,t)}))}))}async _loadTextureImageData(e,t,r){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,t){const r=this.json.images[e.source];if(r.uri)return this._context.loadImage(this._resolveUri(r.uri),t);const s=this._errorContext;s.errorUnsupportedIf(null==r.bufferView,"Image bufferView must be defined."),s.errorUnsupportedIf(null==r.mimeType,"Image mimeType must be defined.");const n=this.json.bufferViews[r.bufferView],o=await this.getBuffer(n.buffer,t);return s.errorUnsupportedIf(null!=n.byteStride,"byteStride not supported for image buffer"),X(new Uint8Array(o.buffer,o.byteOffset+(n.byteOffset||0),n.byteLength),r.mimeType)}}const P=new a(2,0,"glTF"),V=i(d(),Math.PI/2),k=h(),H={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},Y={[j.BYTE]:1,[j.UNSIGNED_BYTE]:1,[j.SHORT]:2,[j.UNSIGNED_SHORT]:2,[j.FLOAT]:4,[j.UNSIGNED_INT]:4};function J(t){switch(t.componentType){case j.BYTE:return new E(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case j.UNSIGNED_BYTE:return new A(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case j.SHORT:return new g(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case j.UNSIGNED_SHORT:return new I(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case j.UNSIGNED_INT:return new U(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case j.FLOAT:return new w(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);default:return void e(t.componentType)}}async function q(e){return new Promise(((t,r)=>{const s=new Blob([e]),n=new FileReader;n.onload=()=>{const e=n.result;t(JSON.parse(e))},n.onerror=e=>{r(e)},n.readAsText(s)}))}async function X(e,t){return new Promise(((r,s)=>{const n=new Blob([e],{type:t}),o=URL.createObjectURL(n),a=new Image;a.addEventListener("load",(()=>{URL.revokeObjectURL(o),"decode"in a?a.decode().then((()=>r(a)),(()=>r(a))):r(a)})),a.addEventListener("error",(e=>{URL.revokeObjectURL(o),s(e)})),a.src=o}))}const z={5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5125:"UNSIGNED_INT",5126:"FLOAT"};export{F as Resource};
5
+ import{getOrCreateMapValue as e}from"../../../../core/MapUtils.js";import{isDataProtocol as t,dataComponents as r,dataToArrayBuffer as s,makeAbsolute as n}from"../../../../core/urlUtils.js";import{Version as o}from"../../../../core/Version.js";import{w as a,m as i,h as u,e as c,l as f}from"../../../../chunks/mat4.js";import{c as p,b as d}from"../../../../chunks/mat4f64.js";import{g as m}from"../../../../chunks/quat.js";import{a as l}from"../../../../chunks/quatf64.js";import{BufferViewUint32 as h,BufferViewUint16 as y,BufferViewUint8 as b,BufferViewVec3f as T,BufferViewVec4f as _,BufferViewVec2f as O,BufferViewVec4u8 as w,BufferViewVec4u16 as N,BufferViewVec3u8 as x,BufferViewVec3u16 as S,BufferViewVec2u32 as C,BufferViewVec2u16 as U,BufferViewVec2i16 as I,BufferViewVec2u8 as g,BufferViewVec2i8 as A}from"../../../../geometry/support/buffer/BufferView.js";import{m as E}from"../../../../chunks/scalar.js";import{BinaryStreamReader as L}from"./BinaryStreamReader.js";import{AttributeType as B}from"./enums.js";import{material as R,textureSampler as D}from"./fillDefaults.js";import{splitURI as G}from"./pathUtils.js";import{DataType as v}from"../../../webgl/enums.js";const j={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class M{constructor(e,t,r,s,n){this._context=e,this._errorContext=t,this.uri=r,this.json=s,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._baseUri=G(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.errorUnsupportedIf(null==s.scenes,"Scenes must be defined."),t.errorUnsupportedIf(null==s.meshes,"Meshes must be defined"),t.errorUnsupportedIf(null==s.nodes,"Nodes must be defined."),this._computeNodeParents()}static async load(e,n,o,a){if(t(o)){const t=r(o);if(t&&"model/gltf-binary"!==t.mediaType)try{const r=JSON.parse(t.isBase64?atob(t.data):t.data);return new M(e,n,o,r)}catch{}const a=s(o);if(M._isGLBData(a))return this._fromGLBData(e,n,o,a)}if(o.endsWith(".gltf")){const t=await e.loadJSON(o,a);return new M(e,n,o,t)}const i=await e.loadBinary(o,a);if(M._isGLBData(i))return this._fromGLBData(e,n,o,i);const u=await e.loadJSON(o,a);return new M(e,n,o,u)}static _isGLBData(e){if(null==e)return!1;const t=new L(e);return t.remainingBytes()>=4&&t.readUint32()===j.MAGIC}static async _fromGLBData(e,t,r,s){const n=await M._parseGLBData(t,s);return new M(e,t,r,n.json,n.binaryData)}static async _parseGLBData(e,t){const r=new L(t);e.assert(r.remainingBytes()>=12,"GLB binary data is insufficiently large.");const s=r.readUint32(),n=r.readUint32(),o=r.readUint32();e.assert(s===j.MAGIC,"Magic first 4 bytes do not fit to expected GLB value."),e.assert(t.byteLength>=o,"GLB binary data is smaller than header specifies."),e.errorUnsupportedIf(2!==n,"An unsupported GLB container version was detected. Only version 2 is supported.");let a,i,u=0;for(;r.remainingBytes()>=8;){const t=r.readUint32(),s=r.readUint32();0===u?(e.assert(s===j.CHUNK_TYPE_JSON,"First GLB chunk must be JSON."),e.assert(t>=0,"No JSON data found."),a=await J(r.readUint8Array(t))):1===u?(e.errorUnsupportedIf(s!==j.CHUNK_TYPE_BIN,"Second GLB chunk expected to be BIN."),i=r.readUint8Array(t)):e.warnUnsupported("More than 2 GLB chunks detected. Skipping."),u+=1}return a||e.error("No GLB JSON chunk detected."),{json:a,binaryData:i}}async getBuffer(e,t){const r=this.json.buffers[e],s=this._errorContext;if(null==r.uri)return s.assert(null!=this._glbBuffer,"GLB buffer not present"),this._glbBuffer;const n=await this._getBufferLoader(e,t);return s.assert(n.byteLength===r.byteLength,"Buffer byte lengths should match."),n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const s=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(s),t).then((e=>new Uint8Array(e)));return this._bufferLoaders.set(e,n),n}async getAccessor(e,t){const r=this._errorContext;r.errorUnsupportedIf(!this.json.accessors,"Accessors missing.");const s=this.json.accessors[e];r.errorUnsupportedIf(null==s?.bufferView,"Some accessor does not specify a bufferView."),r.errorUnsupportedIf(s.type in[B.MAT2,B.MAT3,B.MAT4],`AttributeType ${s.type} is not supported`);const n=this.json.bufferViews[s.bufferView],o=await this.getBuffer(n.buffer,t),a=k[s.type],i=H[s.componentType],u=a*i,c=n.byteStride||u;return{raw:o.buffer,byteStride:c,byteOffset:o.byteOffset+(n.byteOffset||0)+(s.byteOffset||0),entryCount:s.count,isDenselyPacked:c===u,componentCount:a,componentByteSize:i,componentType:s.componentType,min:s.min,max:s.max,normalized:!!s.normalized}}async getIndexData(e,t){if(null==e.indices)return;const r=await this.getAccessor(e.indices,t);if(r.isDenselyPacked)switch(r.componentType){case v.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case v.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case v.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case v.UNSIGNED_BYTE:return E(this._wrapAccessor(b,r));case v.UNSIGNED_SHORT:return E(this._wrapAccessor(y,r));case v.UNSIGNED_INT:return E(this._wrapAccessor(h,r))}}async getPositionData(e,t){const r=this._errorContext;r.errorUnsupportedIf(null==e.attributes.POSITION,"No POSITION vertex data found.");const s=await this.getAccessor(e.attributes.POSITION,t);return r.errorUnsupportedIf(s.componentType!==v.FLOAT,"Expected type FLOAT for POSITION vertex attribute, but found "+X[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"POSITION vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(T,s)}async getNormalData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.NORMAL,"No NORMAL vertex data found.");const s=await this.getAccessor(e.attributes.NORMAL,t);return r.errorUnsupportedIf(s.componentType!==v.FLOAT,"Expected type FLOAT for NORMAL vertex attribute, but found "+X[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"NORMAL vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(T,s)}async getTangentData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TANGENT,"No TANGENT vertex data found.");const s=await this.getAccessor(e.attributes.TANGENT,t);return r.errorUnsupportedIf(s.componentType!==v.FLOAT,"Expected type FLOAT for TANGENT vertex attribute, but found "+X[s.componentType]),r.errorUnsupportedIf(4!==s.componentCount,"TANGENT vertex attribute must have 4 components, but found "+s.componentCount.toFixed()),new _(s.raw,s.byteOffset,s.byteStride,s.byteOffset+s.byteStride*s.entryCount)}async getTextureCoordinates(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TEXCOORD_0,"No TEXCOORD_0 vertex data found.");const s=await this.getAccessor(e.attributes.TEXCOORD_0,t);return r.errorUnsupportedIf(2!==s.componentCount,"TEXCOORD_0 vertex attribute must have 2 components, but found "+s.componentCount.toFixed()),s.componentType===v.FLOAT?this._wrapAccessor(O,s):(r.errorUnsupportedIf(!s.normalized,"Integer component types are only supported for a normalized accessor for TEXCOORD_0."),Y(s))}async getVertexColors(e,t){const r=this._errorContext;r.assert(null!=e.attributes.COLOR_0,"No COLOR_0 vertex data found.");const s=await this.getAccessor(e.attributes.COLOR_0,t);if(r.errorUnsupportedIf(4!==s.componentCount&&3!==s.componentCount,"COLOR_0 attribute must have 3 or 4 components, but found "+s.componentCount.toFixed()),4===s.componentCount){if(s.componentType===v.FLOAT)return this._wrapAccessor(_,s);if(s.componentType===v.UNSIGNED_BYTE)return this._wrapAccessor(w,s);if(s.componentType===v.UNSIGNED_SHORT)return this._wrapAccessor(N,s)}else if(3===s.componentCount){if(s.componentType===v.FLOAT)return this._wrapAccessor(T,s);if(s.componentType===v.UNSIGNED_BYTE)return this._wrapAccessor(x,s);if(s.componentType===v.UNSIGNED_SHORT)return this._wrapAccessor(S,s)}r.errorUnsupported("Unsupported component type for COLOR_0 attribute: "+X[s.componentType])}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let s=e.material?this._materialCache.get(e.material):void 0;if(!s){const n=null!=e.material?R(this.json.materials[e.material]):R(),o=n.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(o.baseColorTexture,t),u=this.getTexture(n.normalTexture,t),c=r?this.getTexture(n.occlusionTexture,t):void 0,f=r?this.getTexture(n.emissiveTexture,t):void 0,p=r?this.getTexture(o.metallicRoughnessTexture,t):void 0,d=null!=e.material?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:o.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await i,normalTexture:await u,name:n.name,id:d,occlusionTexture:await c,emissiveTexture:await f,emissiveFactor:n.emissiveFactor,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,metallicRoughnessTexture:await p,hasVertexColors:a,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode}}return s}async getTexture(t,r){if(!t)return;this._errorContext.errorUnsupportedIf(0!==(t.texCoord||0),"Only TEXCOORD with index 0 is supported.");const s=t.index,n=this._errorContext,o=this.json.textures[s],a=D(null!=o.sampler?this.json.samplers[o.sampler]:{});n.errorUnsupportedIf(null==o.source,"Source is expected to be defined for a texture.");const i=this.json.images[o.source],u=await this._loadTextureImageData(s,o,r);return e(this._textureCache,s,(()=>{const e=e=>33071===e||33648===e||10497===e,t=e=>(n.error(`Unexpected TextureSampler WrapMode: ${e}. Using default REPEAT(10497).`),10497);return{data:u,wrapS:e(a.wrapS)?a.wrapS:t(a.wrapS),wrapT:e(a.wrapT)?a.wrapT:t(a.wrapT),minFilter:a.minFilter,name:i.name,id:s}}))}getNodeTransform(e){if(void 0===e)return P;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?t=i(p(),r,s.matrix):s.translation||s.rotation||s.scale?(t=d(r),s.translation&&u(t,t,s.translation),s.rotation&&(V[3]=m(V,s.rotation),c(t,t,V[3],V)),s.scale&&f(t,t,s.scale)):t=r,this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return n(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=o.parse(this.json.asset.version,"glTF");F.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json,t=this._errorContext;e.extensionsRequired&&0!==e.extensionsRequired.length&&t.errorUnsupported("gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach(((e,t)=>{e.children&&e.children.forEach((e=>{this._nodeParentMap.set(e,t)}))}))}async _loadTextureImageData(e,t,r){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,t){const r=this.json.images[e.source];if(r.uri)return this._context.loadImage(this._resolveUri(r.uri),t);const s=this._errorContext;s.errorUnsupportedIf(null==r.bufferView,"Image bufferView must be defined."),s.errorUnsupportedIf(null==r.mimeType,"Image mimeType must be defined.");const n=this.json.bufferViews[r.bufferView],o=await this.getBuffer(n.buffer,t);return s.errorUnsupportedIf(null!=n.byteStride,"byteStride not supported for image buffer"),q(new Uint8Array(o.buffer,o.byteOffset+(n.byteOffset||0),n.byteLength),r.mimeType)}}const F=new o(2,0,"glTF"),P=a(p(),Math.PI/2),V=l(),k={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},H={[v.BYTE]:1,[v.UNSIGNED_BYTE]:1,[v.SHORT]:2,[v.UNSIGNED_SHORT]:2,[v.FLOAT]:4,[v.UNSIGNED_INT]:4};function Y(e){switch(e.componentType){case v.BYTE:return new A(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case v.UNSIGNED_BYTE:return new g(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case v.SHORT:return new I(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case v.UNSIGNED_SHORT:return new U(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case v.UNSIGNED_INT:return new C(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case v.FLOAT:return new O(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}async function J(e){return new Promise(((t,r)=>{const s=new Blob([e]),n=new FileReader;n.onload=()=>{const e=n.result;t(JSON.parse(e))},n.onerror=e=>{r(e)},n.readAsText(s)}))}async function q(e,t){return new Promise(((r,s)=>{const n=new Blob([e],{type:t}),o=URL.createObjectURL(n),a=new Image;a.addEventListener("load",(()=>{URL.revokeObjectURL(o),"decode"in a?a.decode().then((()=>r(a)),(()=>r(a))):r(a)})),a.addEventListener("error",(e=>{URL.revokeObjectURL(o),s(e)})),a.src=o}))}const X={5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5125:"UNSIGNED_INT",5126:"FLOAT"};export{M as Resource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import r from"../../../core/Handles.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{watch as n,initial as i}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as p}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as d}from"./handlers/DragZoom.js";import{GamepadNavigation as l}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as c}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as g}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as h}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as u}from"./handlers/PointerDownCancelAnimation.js";import{SingleKeyResetHeading as w}from"./handlers/SingleKeyResetHeading.js";import{SingleKeyResetTilt as y}from"./handlers/SingleKeyResetTilt.js";import{TwoFingerTilt as _}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as f}from"../../input/BrowserEventSource.js";import{InputManager as D,ViewEventPriorities as j}from"../../input/InputManager.js";import{PreventContextMenu as v}from"../../input/handlers/PreventContextMenu.js";import{Drag as A}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as P}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as M}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as R}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as T}from"../../input/recognizers/VerticalTwoFingerDrag.js";import{PivotPoint as b}from"../state/controllers/RotateController.js";let z=class extends t{constructor(){super(...arguments),this._handles=new r}destroy(){this._handles&&(this._handles.removeAll(),this._handles=null),this.disconnect()}get primaryDragAction(){return this._get("primaryDragAction")}set primaryDragAction(e){"pan"!==e&&"rotate"!==e||e===this._get("primaryDragAction")||(this._set("primaryDragAction",e),this._updateMode())}get mode(){return this._get("mode")}set mode(e){"default"!==e&&"pro"!==e||e===this._get("mode")||(this._set("mode",e),this._updateMode())}get hasPendingInputs(){return this._inputManager?.hasPendingInputs}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}disconnect(){this.view.viewEvents.disconnect(),this._inputManager=o(this._inputManager)}connect(){const e=this.view;this._source=new f(this.view.surface,e.input);const t=[new P,new M,new R,new A(this.view.navigation),new T],r=new D({eventSource:this._source,recognizers:t});this._inputManager=r,r.installHandlers("prevent-context-menu",[new v],j.INTERNAL),this._modeDragPan=new h(e,"primary"),this._modeDragRotate=new m(e,"secondary",b.CENTER),this._modeDragZoom=new d(e,"tertiary");const o={lookAround:"b",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:"u",down:"j",headingLeft:"a",headingRight:"d",tiltUp:"w",tiltDown:"s",zoomIn:"+",zoomOut:"-"},resetHeading:"n",resetTilt:"p"};r.installHandlers("navigation",[new u(e),new p(e),new l(e),new c(e,o.pan),new g(e),new y(e,o.resetTilt),new w(e,o.resetHeading),new m(e,"primary",b.EYE,[o.lookAround]),new m(e,"secondary",b.CENTER,[o.lookAround]),new h(e,"tertiary",[o.lookAround]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,new _(e)],j.INTERNAL),this.view.viewEvents.connect(r),this._updateMode(),this._handles.add(n((()=>this.view.navigation?.browserTouchPanEnabled),(e=>{this._source.browserTouchPanningEnabled=!e}),i))}_updateMode(){const e=this.mode,t=this.primaryDragAction,r=E.get(e).get(t);this._modeDragPan&&(this._modeDragPan.pointerAction=r.pan),this._modeDragRotate&&(this._modeDragRotate.pointerAction=r.rotate),this._modeDragZoom&&(this._modeDragZoom.pointerAction=r.zoom)}get test(){return{inputManager:this._inputManager,modeDragPan:this._modeDragPan,modeDragRotate:this._modeDragRotate,modeDragZoom:this._modeDragZoom}}};e([a()],z.prototype,"view",void 0),e([a({value:"pan"})],z.prototype,"primaryDragAction",null),e([a({value:"default"})],z.prototype,"mode",null),e([a({readOnly:!0})],z.prototype,"hasPendingInputs",null),e([a()],z.prototype,"latestPointerType",null),e([a()],z.prototype,"latestPointerLocation",null),e([a()],z.prototype,"_inputManager",void 0),z=e([s("esri.views.3d.input.SceneInputManager")],z);const E=new Map,k=new Map,C=new Map;k.set("pan",{pan:"primary",rotate:"secondary",zoom:"tertiary"}),k.set("rotate",{pan:"secondary",rotate:"primary",zoom:"tertiary"}),C.set("pan",{pan:"primary",rotate:"tertiary",zoom:"secondary"}),C.set("rotate",{pan:"tertiary",rotate:"primary",zoom:"secondary"}),E.set("default",k),E.set("pro",C);const I=z;export{I as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import r from"../../../core/Handles.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{watch as n,initial as i}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as p}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as d}from"./handlers/DragZoom.js";import{GamepadNavigation as l}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as c}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as g}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as u}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as h}from"./handlers/PointerDownCancelAnimation.js";import{SingleKeyResetHeading as w}from"./handlers/SingleKeyResetHeading.js";import{SingleKeyResetTilt as y}from"./handlers/SingleKeyResetTilt.js";import{TwoFingerTilt as _}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as f}from"../../input/BrowserEventSource.js";import{InputManager as D,ViewEventPriorities as j}from"../../input/InputManager.js";import{PreventContextMenu as v}from"../../input/handlers/PreventContextMenu.js";import{Drag as A}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as P}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as M}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as T}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as R}from"../../input/recognizers/VerticalTwoFingerDrag.js";import{PivotPoint as b}from"../state/controllers/RotateController.js";let z=class extends e{constructor(){super(...arguments),this._handles=new r}destroy(){this._handles&&(this._handles.removeAll(),this._handles=null),this.disconnect()}get primaryDragAction(){return this._get("primaryDragAction")}set primaryDragAction(t){"pan"!==t&&"rotate"!==t||t===this._get("primaryDragAction")||(this._set("primaryDragAction",t),this._updateMode())}get mode(){return this._get("mode")}set mode(t){"default"!==t&&"pro"!==t||t===this._get("mode")||(this._set("mode",t),this._updateMode())}get hasPendingInputs(){return this._inputManager?.hasPendingInputs}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.view.viewEvents.disconnect(),this._inputManager=o(this._inputManager)}connect(){const t=this.view;this._source=new f(this.view.surface,t.input);const e=[new P,new M,new T,new A(this.view.navigation),new R],r=new D({eventSource:this._source,recognizers:e});this._inputManager=r,r.installHandlers("prevent-context-menu",[new v],j.INTERNAL),this._modeDragPan=new u(t,"primary"),this._modeDragRotate=new m(t,"secondary",b.CENTER),this._modeDragZoom=new d(t,"tertiary");const o={lookAround:"b",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:"u",down:"j",headingLeft:"a",headingRight:"d",tiltUp:"w",tiltDown:"s",zoomIn:"+",zoomOut:"-"},resetHeading:"n",resetTilt:"p"};r.installHandlers("navigation",[new h(t),new p(t),new l(t),new c(t,o.pan),new g(t),new y(t,o.resetTilt),new w(t,o.resetHeading),new m(t,"primary",b.EYE,[o.lookAround]),new m(t,"secondary",b.CENTER,[o.lookAround]),new u(t,"tertiary",[o.lookAround]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,new _(t)],j.INTERNAL),this.view.viewEvents.connect(r),this._updateMode(),this._handles.add(n((()=>this.view.navigation?.browserTouchPanEnabled),(t=>{this._source.browserTouchPanningEnabled=!t}),i))}_updateMode(){const t=this.mode,e=this.primaryDragAction,r=E.get(t).get(e);this._modeDragPan&&(this._modeDragPan.pointerAction=r.pan),this._modeDragRotate&&(this._modeDragRotate.pointerAction=r.rotate),this._modeDragZoom&&(this._modeDragZoom.pointerAction=r.zoom)}get test(){return{inputManager:this._inputManager,modeDragPan:this._modeDragPan,modeDragRotate:this._modeDragRotate,modeDragZoom:this._modeDragZoom}}};t([a()],z.prototype,"view",void 0),t([a({value:"pan"})],z.prototype,"primaryDragAction",null),t([a({value:"default"})],z.prototype,"mode",null),t([a({readOnly:!0})],z.prototype,"hasPendingInputs",null),t([a()],z.prototype,"latestPointerType",null),t([a()],z.prototype,"latestPointerLocation",null),t([a()],z.prototype,"multiTouchActive",null),t([a()],z.prototype,"_inputManager",void 0),z=t([s("esri.views.3d.input.SceneInputManager")],z);const E=new Map,k=new Map,C=new Map;k.set("pan",{pan:"primary",rotate:"secondary",zoom:"tertiary"}),k.set("rotate",{pan:"secondary",rotate:"primary",zoom:"tertiary"}),C.set("pan",{pan:"primary",rotate:"tertiary",zoom:"secondary"}),C.set("rotate",{pan:"tertiary",rotate:"primary",zoom:"secondary"}),E.set("default",k),E.set("pro",C);const I=z;export{I as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e,isNone as r,unwrapOr as t}from"../../../../core/maybe.js";import{screenPointObjectToArray as n,castScreenPointArray as o,createScreenPointArray as s}from"../../../../core/screenUtils.js";import{c,l,b as i,e as a,g as u,a as p,f as m}from"../../../../chunks/vec3.js";import{c as d}from"../../../../chunks/vec3f64.js";import{projectPoint as f}from"../../../../geometry/projection.js";import{intersectRay as g,fromPositionAndNormal as y,create as E}from"../../../../geometry/support/plane.js";import{create as S}from"../../../../geometry/support/ray.js";import{projectPoint as j}from"../../../../geometry/support/vector.js";import{sv2d as v}from"../../../../geometry/support/vectorStacks.js";import{getZForElevationMode as b,getGraphicEffectiveElevationInfo as x}from"../../../../support/elevationInfoUtils.js";import{fromScreen as R}from"../../support/geometryUtils/ray.js";import{newIntersector as I}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as w,IntersectorType as H}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{TERRAIN_ID as U}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{EventPipeline as O}from"../../../interactive/dragEventPipeline.js";function C(e,r){return D(e,(()=>r))}function T(e){return D(e,(e=>e.plane))}function D(t,s){const c=d(),l=d();let i=!1;return a=>{const u=s(a);if("start"===a.action){const r=n(a.screenStart,o(v.get())),s=R(t.state.camera,r,L);e(s)&&(i=g(u,s,c))}if(!i)return null;const p=n(a.screenEnd,o(v.get())),m=R(t.state.camera,p,L);return r(m)?null:g(u,m,l)?{...a,renderStart:c,renderEnd:l,plane:u,ray:m}:null}}function M(t,n,o,c=null,l=null){let i=null;return a=>{if("start"===a.action&&(i=t.sceneIntersectionHelper.intersectElevationFromScreen(s(a.screenStart.x,a.screenStart.y),n,o,l),e(i)&&e(c)&&!f(i,i,c)))return null;if(r(i))return null;const u=t.sceneIntersectionHelper.intersectElevationFromScreen(s(a.screenEnd.x,a.screenEnd.y),n,o,l);return e(u)?e(c)&&!f(u,u,c)?null:{...a,mapStart:i,mapEnd:u}:null}}function N(e,r,t,n=null,o=null){return M(e,t,b(r,e,t),n,o)}function P(e,r,t,n=null,o=null){return N(e,t,x(r),n,o)}function h(r,t,n,o){const s=t.toMap(r.screenStart,{include:[n]});return e(s)?P(t,n,s,o):null}function k(e,r){const t=J,n=K,o=E();e.renderCoordsHelper.worldUpAtPosition(r,t);const s=m(o,t,i(n,r,e.state.camera.eye));return m(s,s,t),y(r,s,o)}function G(e,r,t){let n=null;const o=new O;return o.next(C(e,k(e,r))).next(A(e,r)).next(F(e,t)).next((e=>{e.mapEnd.x=e.mapStart.x,e.mapEnd.y=e.mapStart.y,n=e})),e=>(n=null,o.execute(e),n)}function A(e,r){const t=d(),n=l(r);e.renderCoordsHelper.worldUpAtPosition(r,t);const o=d(),s=d(),m=o=>{if(i(o,o,r),j(t,o,o),"global"===e.viewingMode){l(o)*Math.sign(a(t,o))<.001-n&&i(o,u(o,t,.001),r)}return p(o,o,r),o};return e=>(e.renderStart=m(c(o,e.renderStart)),e.renderEnd=m(c(s,e.renderEnd)),e)}function F(r,t){const n=r.renderCoordsHelper;return r=>{const o=n.fromRenderCoords(r.renderStart,t),s=n.fromRenderCoords(r.renderEnd,t);return e(o)&&e(s)?{...r,mapStart:o,mapEnd:s}:null}}var q;function z(r){let t=null;return n=>{switch(n.action){case"start":t=r.disableDisplay();break;case"end":case"cancel":e(t)&&(t.remove(),t=null)}return n}}function B(o,c=null){const l=I(o.state.viewingMode);l.options.selectionMode=!0,l.options.store=w.MIN,l.options.hud=!1;const i=s(),a={requiresGroundFeedback:!0,enableDraped:!0,exclude:new Set},u=d(),p=t(c,o.spatialReference),m=e=>{o.map.ground&&o.map.ground.opacity<1?a.exclude.add(U):a.exclude.delete(U),o.sceneIntersectionHelper.intersectIntersectorScreen(n(e,i),l,a);const r=l.results.min;let t;if(r.getIntersectionPoint(u))t=r.intersector===H.TERRAIN?q.GROUND:q.OTHER;else{if(!l.results.ground.getIntersectionPoint(u))return null;t=q.GROUND}return{location:o.renderCoordsHelper.fromRenderCoords(u,p),surfaceType:t}};let f;return t=>{if("start"===t.action){const r=m(t.screenStart);f=e(r)?r.location:null}if(r(f))return null;const n=m(t.screenEnd);return e(n)&&e(n.location)?{...t,mapStart:f,mapEnd:n.location,surfaceType:n.surfaceType}:null}}!function(e){e[e.GROUND=0]="GROUND",e[e.OTHER=1]="OTHER"}(q||(q={}));const J=d(),K=d(),L=S();export{q as SurfaceType,F as convertToMapCoordinates,z as hideManipulatorWhileDragging,A as projectToWorldUp,B as screenToMap3D,N as screenToMapXYAtLocation,h as screenToMapXYForGraphic,P as screenToMapXYForGraphicAtLocation,C as screenToRenderPlane,T as screenToRenderPlaneFromEvent,G as screenToZConstrained};
5
+ import{isSome as e,isNone as r,unwrapOr as t}from"../../../../core/maybe.js";import{screenPointObjectToArray as n,castScreenPointArray as o,createScreenPointArray as s}from"../../../../core/screenUtils.js";import{l as c,c as l,f as i,b as a,e as u,g as p,a as m}from"../../../../chunks/vec3.js";import{c as d}from"../../../../chunks/vec3f64.js";import{projectPoint as f}from"../../../../geometry/projection.js";import{intersectRay as g,create as y,fromPositionAndNormal as E}from"../../../../geometry/support/plane.js";import{create as S}from"../../../../geometry/support/ray.js";import{projectPoint as j}from"../../../../geometry/support/vector.js";import{sv2d as v}from"../../../../geometry/support/vectorStacks.js";import{getZForElevationMode as b,getGraphicEffectiveElevationInfo as x}from"../../../../support/elevationInfoUtils.js";import{fromScreen as R}from"../../support/geometryUtils/ray.js";import{newIntersector as I}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as w,IntersectorType as H}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{TERRAIN_ID as U}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{EventPipeline as O}from"../../../interactive/dragEventPipeline.js";function C(e,r){return D(e,(()=>r))}function T(e){return D(e,(e=>e.plane))}function D(t,s){const c=d(),l=d();let i=!1;return a=>{const u=s(a);if("start"===a.action){const r=n(a.screenStart,o(v.get())),s=R(t.state.camera,r,L);e(s)&&(i=g(u,s,c))}if(!i)return null;const p=n(a.screenEnd,o(v.get())),m=R(t.state.camera,p,L);return r(m)?null:g(u,m,l)?{...a,renderStart:c,renderEnd:l,plane:u,ray:m}:null}}function M(t,n,o,c=null,l=null){let i=null;return a=>{if("start"===a.action&&(i=t.sceneIntersectionHelper.intersectElevationFromScreen(s(a.screenStart.x,a.screenStart.y),n,o,l),e(i)&&e(c)&&!f(i,i,c)))return null;if(r(i))return null;const u=t.sceneIntersectionHelper.intersectElevationFromScreen(s(a.screenEnd.x,a.screenEnd.y),n,o,l);return e(u)?e(c)&&!f(u,u,c)?null:{...a,mapStart:i,mapEnd:u}:null}}function N(e,r,t,n=null,o=null){return M(e,t,b(r,e,t),n,o)}function P(e,r,t,n=null,o=null){return N(e,t,x(r),n,o)}function h(r,t,n,o){const s=t.toMap(r.screenStart,{include:[n]});return e(s)?P(t,n,s,o):null}function k(e,r){const t=J,n=K,o=y();e.renderCoordsHelper.worldUpAtPosition(r,t);const s=i(o,t,a(n,r,e.state.camera.eye));return i(s,s,t),E(r,s,o)}function G(e,r,t){let n=null;const o=new O;return o.next(C(e,k(e,r))).next(A(e,r)).next(F(e,t)).next((e=>{e.mapEnd.x=e.mapStart.x,e.mapEnd.y=e.mapStart.y,n=e})),e=>(n=null,o.execute(e),n)}function A(e,r){const t=d(),n=c(r);e.renderCoordsHelper.worldUpAtPosition(r,t);const o=d(),s=d(),i=o=>{if(a(o,o,r),j(t,o,o),"global"===e.viewingMode){c(o)*Math.sign(u(t,o))<.001-n&&a(o,p(o,t,.001),r)}return m(o,o,r),o};return e=>(e.renderStart=i(l(o,e.renderStart)),e.renderEnd=i(l(s,e.renderEnd)),e)}function F(r,t){const n=r.renderCoordsHelper;return r=>{const o=n.fromRenderCoords(r.renderStart,t),s=n.fromRenderCoords(r.renderEnd,t);return e(o)&&e(s)?{...r,mapStart:o,mapEnd:s}:null}}var q;function z(r){let t=null;return n=>{switch(n.action){case"start":t=r.disableDisplay();break;case"end":case"cancel":e(t)&&(t.remove(),t=null)}return n}}function B(o,c=null){const l=I(o.state.viewingMode);l.options.selectionMode=!0,l.options.store=w.MIN,l.options.hud=!1;const i=s(),a={requiresGroundFeedback:!0,enableDraped:!0,exclude:new Set},u=d(),p=t(c,o.spatialReference),m=e=>{o.map.ground&&o.map.ground.opacity<1?a.exclude.add(U):a.exclude.delete(U),o.sceneIntersectionHelper.intersectIntersectorScreen(n(e,i),l,a);const r=l.results.min;let t;if(r.getIntersectionPoint(u))t=r.intersector===H.TERRAIN?q.GROUND:q.OTHER;else{if(!l.results.ground.getIntersectionPoint(u))return null;t=q.GROUND}return{location:o.renderCoordsHelper.fromRenderCoords(u,p),surfaceType:t}};let f;return t=>{if("start"===t.action){const r=m(t.screenStart);f=e(r)?r.location:null}if(r(f))return null;const n=m(t.screenEnd);return e(n)&&e(n.location)?{...t,mapStart:f,mapEnd:n.location,surfaceType:n.surfaceType}:null}}!function(e){e[e.GROUND=0]="GROUND",e[e.OTHER=1]="OTHER"}(q||(q={}));const J=d(),K=d(),L=S();export{q as SurfaceType,F as convertToMapCoordinates,z as hideManipulatorWhileDragging,A as projectToWorldUp,B as screenToMap3D,N as screenToMapXYAtLocation,h as screenToMapXYForGraphic,P as screenToMapXYForGraphicAtLocation,C as screenToRenderPlane,T as screenToRenderPlaneFromEvent,G as screenToZConstrained};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{handlesGroup as t,makeHandle as i}from"../../../../../core/handleUtils.js";import{isSome as s,destroyMaybe as r,applySome as a}from"../../../../../core/maybe.js";import{watch as n,initial as o}from"../../../../../core/reactiveUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{getEffectiveElevationMode as h}from"../../../../../support/elevationInfoUtils.js";import p from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as u}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as m}from"../../SnappingVisualizer3D.js";import{settings as v}from"../settings.js";import{OutlineVisualElement as d}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as f}from"../../visualElements/VerticesVisualElement.js";import{GraphicState as V}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as w,geometryTypeToDrawOperationGeometryType as E}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as y}from"../../../../draw/DrawOperation.js";import{SceneDrawSurface as _,ElevationDrawSurface as g}from"../../../../draw/drawSurfaces.js";let j=class extends w{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new p({mode:e,offset:t})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:{mode:t?"absolute-height":"on-the-ground",offset:0}}}return e}initializeGraphic(e){const i=this._createGraphicState=new V({graphic:e});return t([this.view.maskOccludee(e),this.view.trackGraphicState(i),n((()=>({element:this._outlineVisualElement,isDraped:i.isDraped})),(({element:e,isDraped:t})=>{a(e,(e=>e.isDraped=t))}),o)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new y({view:this.view,manipulators:this.manipulators,geometryType:E(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new _(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new g(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new m,segmentLabels:t?new u:null,labelOptions:this.labelOptions,tooltipOptions:this.tooltipOptions,isDraped:s(this._createGraphicState)?this._createGraphicState.isDraped:"on-the-ground"===h(this.hasZ,this.elevationInfo)})}onActiveVertexChanged(e){return s(this._activeVertexVisualElement)?(this._activeVertexVisualElement.vertices=[e],null):(this._activeVertexVisualElement=new f({view:this.view,spatialReference:this.view.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,renderOccluded:v.reshapeManipulators.vertex.renderOccluded,attached:!1}),this._activeVertexVisualElement.color=v.colorToVec4(v.reshapeManipulators.selected.color),this._activeVertexVisualElement.attached=!0,i((()=>{this._activeVertexVisualElement=r(this._activeVertexVisualElement)})))}onOutlineChanged(e){if(s(this._outlineVisualElement))return this._outlineVisualElement.geometry=e,null;const t=this.internalGraphicsLayer.elevationInfo;return this._outlineVisualElement=new d({view:this.view,geometry:e,elevationInfo:t,isDraped:s(this._createGraphicState)?this._createGraphicState.isDraped:"on-the-ground"===h(this.hasZ,t),attached:!1}),v.visualElements.lineGraphics.outline.apply(this._outlineVisualElement),v.visualElements.lineGraphics.shadowStyle.apply(this._outlineVisualElement),this._outlineVisualElement.attached=!0,this._outlineVisualElement.laserlineEnabled=!0,i((()=>{this._outlineVisualElement=r(this._outlineVisualElement)}))}onRegularVerticesChanged(e){return s(this._verticesVisualElement)?(this._verticesVisualElement.vertices=e,null):(this._verticesVisualElement=new f({view:this.view,spatialReference:this.view.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,renderOccluded:v.reshapeManipulators.vertex.renderOccluded,attached:!1}),this._verticesVisualElement.attached=!0,i((()=>{this._verticesVisualElement=r(this._verticesVisualElement)})))}};e([l({constructOnly:!0})],j.prototype,"elevationInfo",void 0),e([l({constructOnly:!0})],j.prototype,"geometryType",void 0),e([l()],j.prototype,"type",void 0),e([l({constructOnly:!0})],j.prototype,"view",void 0),j=e([c("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],j);export{j as DrawGraphicTool3D};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{handlesGroup as t,makeHandle as i}from"../../../../../core/handleUtils.js";import{isSome as s,applySome as r,destroyMaybe as a}from"../../../../../core/maybe.js";import{watch as n,initial as o}from"../../../../../core/reactiveUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{getEffectiveElevationMode as h}from"../../../../../support/elevationInfoUtils.js";import p from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as u}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as m}from"../../SnappingVisualizer3D.js";import{settings as v}from"../settings.js";import{OutlineVisualElement as d}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as f}from"../../visualElements/VerticesVisualElement.js";import{GraphicState as V}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as w,geometryTypeToDrawOperationGeometryType as E}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as y}from"../../../../draw/DrawOperation.js";import{SceneDrawSurface as _,ElevationDrawSurface as g}from"../../../../draw/drawSurfaces.js";let j=class extends w{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new p({mode:e,offset:t})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:{mode:t?"absolute-height":"on-the-ground",offset:0}}}return e}initializeGraphic(e){const i=this._createGraphicState=new V({graphic:e});return t([this.view.maskOccludee(e),this.view.trackGraphicState(i),n((()=>({element:this._outlineVisualElement,isDraped:i.isDraped})),(({element:e,isDraped:t})=>{r(e,(e=>e.isDraped=t))}),o)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new y({view:this.view,manipulators:this.manipulators,geometryType:E(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new _(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new g(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new m,segmentLabels:t?new u:null,labelOptions:this.labelOptions,tooltipOptions:this.tooltipOptions,isDraped:s(this._createGraphicState)?this._createGraphicState.isDraped:"on-the-ground"===h(this.hasZ,this.elevationInfo)})}onActiveVertexChanged(e){return s(this._activeVertexVisualElement)?(this._activeVertexVisualElement.vertices=[e],null):(this._activeVertexVisualElement=new f({view:this.view,spatialReference:this.view.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,renderOccluded:v.reshapeManipulators.vertex.renderOccluded,attached:!1}),this._activeVertexVisualElement.color=v.colorToVec4(v.reshapeManipulators.selected.color),this._activeVertexVisualElement.attached=!0,i((()=>{this._activeVertexVisualElement=a(this._activeVertexVisualElement)})))}onOutlineChanged(e){if(s(this._outlineVisualElement))return this._outlineVisualElement.geometry=e,null;const t=this.internalGraphicsLayer.elevationInfo;return this._outlineVisualElement=new d({view:this.view,geometry:e,elevationInfo:t,isDraped:s(this._createGraphicState)?this._createGraphicState.isDraped:"on-the-ground"===h(this.hasZ,t),attached:!1}),v.visualElements.lineGraphics.outline.apply(this._outlineVisualElement),v.visualElements.lineGraphics.shadowStyle.apply(this._outlineVisualElement),this._outlineVisualElement.attached=!0,this._outlineVisualElement.laserlineEnabled=!0,i((()=>{this._outlineVisualElement=a(this._outlineVisualElement)}))}onRegularVerticesChanged(e){return s(this._verticesVisualElement)?(this._verticesVisualElement.vertices=e,null):(this._verticesVisualElement=new f({view:this.view,spatialReference:this.view.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,renderOccluded:v.reshapeManipulators.vertex.renderOccluded,attached:!1}),this._verticesVisualElement.attached=!0,i((()=>{this._verticesVisualElement=a(this._verticesVisualElement)})))}};e([l({constructOnly:!0})],j.prototype,"elevationInfo",void 0),e([l({constructOnly:!0})],j.prototype,"geometryType",void 0),e([l()],j.prototype,"type",void 0),e([l({constructOnly:!0})],j.prototype,"view",void 0),j=e([c("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],j);export{j as DrawGraphicTool3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as e,isSome as r}from"../../../../../core/maybe.js";import{createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{f as n}from"../../../../../chunks/mat4f64.js";import{f as t,r as s,p as c,b as i}from"../../../../../chunks/vec3.js";import{c as d}from"../../../../../chunks/vec3f64.js";import{normal as f,fromPositionAndNormal as p,create as m}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as u}from"../../../../../layers/graphics/dehydratedFeatures.js";import{OffsetEdgeVertex as a,PlaneType as l}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function j(e,r,o){const n="on-the-ground"===o.mode?l.XY:l.XYZ;return new a(e,n,r,0)}function h(r,o,n){const s=d();if(!r.renderCoordsHelper.toRenderCoords(o,s))return null;const c=y(r,o,f(n.plane)),i=y(r,o,n.edgeDirection);if(e(c)||e(i))return null;const u=t(d(),c,i);return p(s,u,m())}function y(e,r,o){const n=u(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),t=d(),c=d();return e.renderCoordsHelper.toRenderCoords(r,t)&&e.renderCoordsHelper.toRenderCoords(n,c)?s(c,t,c):null}function C(e,r,o){const c=f(e),i=s(d(),r,o),p=t(d(),i,c),m=t(d(),i,p);return n(i[0],i[1],i[2],0,p[0],p[1],p[2],0,m[0],m[1],m[2],0,0,0,0,1)}function R(e,n,t){const s=t.projectToRenderScreen(e,o()),d=t.projectToRenderScreen(n,o());return r(s)&&r(d)?c(i(s,s,d)):0}export{h as createEdgeOffsetIntersectionPlane,j as createEdgeOffsetOperation,C as edgeOffsetRotationMatrix,R as screenEdgeLengthSquared};
5
+ import{isNone as e,isSome as r}from"../../../../../core/maybe.js";import{createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{f as n}from"../../../../../chunks/mat4f64.js";import{f as t,r as s,p as c,b as i}from"../../../../../chunks/vec3.js";import{c as d}from"../../../../../chunks/vec3f64.js";import{normal as f,fromPositionAndNormal as p,create as m}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as u}from"../../../../../layers/graphics/dehydratedFeatures.js";import{PlaneType as a,OffsetEdgeVertex as l}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function j(e,r,o){const n="on-the-ground"===o.mode?a.XY:a.XYZ;return new l(e,n,r,0)}function h(r,o,n){const s=d();if(!r.renderCoordsHelper.toRenderCoords(o,s))return null;const c=y(r,o,f(n.plane)),i=y(r,o,n.edgeDirection);if(e(c)||e(i))return null;const u=t(d(),c,i);return p(s,u,m())}function y(e,r,o){const n=u(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),t=d(),c=d();return e.renderCoordsHelper.toRenderCoords(r,t)&&e.renderCoordsHelper.toRenderCoords(n,c)?s(c,t,c):null}function C(e,r,o){const c=f(e),i=s(d(),r,o),p=t(d(),i,c),m=t(d(),i,p);return n(i[0],i[1],i[2],0,p[0],p[1],p[2],0,m[0],m[1],m[2],0,0,0,0,1)}function R(e,n,t){const s=t.projectToRenderScreen(e,o()),d=t.projectToRenderScreen(n,o());return r(s)&&r(d)?c(i(s,s,d)):0}export{h as createEdgeOffsetIntersectionPlane,j as createEdgeOffsetOperation,C as edgeOffsetRotationMatrix,R 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/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalPI as t}from"../../../../../core/Cyclical.js";import e from"../../../../../core/Evented.js";import a from"../../../../../core/Handles.js";import{clamp as i,rad2deg as o}from"../../../../../core/mathUtils.js";import{isSome as s,destroyMaybe as r,unwrapOr as n,isNone as l}from"../../../../../core/maybe.js";import{createAngle as c,createLength as h}from"../../../../../core/quantityUtils.js";import{when as p,initial as u,watch as d}from"../../../../../core/reactiveUtils.js";import{addFrameTask as g}from"../../../../../core/scheduling.js";import{createScreenPointArray as m}from"../../../../../core/screenUtils.js";import{d as _,g as f,m as M,l as D,e as S}from"../../../../../chunks/mat4.js";import{c as v}from"../../../../../chunks/mat4f64.js";import{s as y,b,l as T,d as R,f as j,a as k}from"../../../../../chunks/vec3.js";import{a as w,f as O}from"../../../../../chunks/vec3f64.js";import{b as A}from"../../../../../chunks/vec4f64.js";import{fromPositionAndNormal as I,create as P,normal as E}from"../../../../../geometry/support/plane.js";import{wrap as F,distance2 as C}from"../../../../../geometry/support/ray.js";import{sv3d as U,sm4d as x}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as z}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as L}from"../../Manipulator3D.js";import{calculateInputRotationTransform as N}from"../../manipulatorUtils.js";import{screenToRenderPlane as G}from"../dragEventPipeline3D.js";import{ManipulatorType as H}from"../ManipulatorType.js";import{ROTATE_INDICATOR_DIRECTION_BUFFER as V,SCALE_INDICATOR_DIRECTION_BUFFER as q,RING_HEIGHT as B,ROTATE_INDICATOR_ARROW_PLACEMENT_PERCENTAGE as J,ROTATE_INDICATOR_ARROW_TIP_LENGTH as K,ROTATE_INDICATOR_ARROW_TIP_RADIUS as Q,RING_THICKNESS as W,HANDLE_COLOR as X,DRAG_THRESHOLD_PX as Y,RING_INDICATOR_DELAY_MS as Z,RING_RADIUS as $,INNER_INDICATOR_RADIUS as tt,INDICATOR_THICKNESS as et,OUTER_INDICATOR_RADIUS as at,SCALE_INDICATOR_OFFSET1 as it,SCALE_INDICATOR_OFFSET2 as ot,RING_RESET_ANIMATION_SPEED_FACTOR as st,GEOMETRY_SEGMENTS as rt,ROTATE_INDICATOR_ARC_LENGTH as nt,SCALE_INDICATOR_ARC_LENGTH as lt}from"../manipulations/config.js";import{CullFaceOptions as ct}from"../../../webgl-engine/lib/basicInterfaces.js";import ht from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as pt}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as ut}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as dt}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as gt,ManipulatorStateFlags as mt}from"../../../../interactive/interfaces.js";import{Tooltip as _t}from"../../../../interactive/tooltip/Tooltip.js";import{TransformRotateTooltipInfo as ft,TransformScaleTooltipInfo as Mt,TransformAbsoluteTooltipInfo as Dt}from"../../../../interactive/tooltip/TransformTooltipInfos.js";var St,vt;!function(t){t.ScaleIn=gt.Custom2,t.ScaleOut=gt.Custom3,t.RotateLeft=gt.Custom4,t.RotateRight=gt.Custom5,t.Unlocked=gt.Custom7,t.DelayedFocused=gt.Custom8,t.TouchInput=gt.Custom12}(St||(St={}));class yt{constructor({adapter:t,tooltipOptions:i,mode:o,tool:r}){this._mode=null,this._handles=new a,this._scaleRotateDragData=null,this._activeAnimation=null,this.events=new e,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>s(this._scaleRotateDragData)&&"scale"===this._scaleRotateDragData.mode?this._adapter.scale:1,this.tool=r,this._mode=o,this._adapter=t,this._tooltipOptions=i,this._tooltip=new _t({view:r.view}),this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this._handles.add(p((()=>!this._tooltipOptions.enabled),(()=>this._tooltip.clear()),u))}get angle(){return this._adapter.angle}get scale(){return this._adapter.scale}set location(t){this._ringManipulator.location=t}set elevationAlignedLocation(t){this._ringManipulator.elevationAlignedLocation=t}get grabbing(){return this._ringManipulator.grabbing}set interactive(t){this._ringManipulator.interactive=t}destroy(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=null),this._handles=r(this._handles),this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null,this._tooltip=r(this._tooltip)}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=g({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=r(this._activeAnimation))}forEachManipulator(t){t(this._ringManipulator,H.SCALE_ROTATE)}_createManipulator(){const e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);const a=this.tool.graphicState.graphic,r=dt(e,((e,r,n)=>{this._scaleRotateDragData=null;const l=this._adapter.startInteraction(),c={mode:"none",origin:w(e.renderLocation),initialAngle:this._adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();const h=U.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,h),r.next(G(this.tool.view,I(e.renderLocation,h,P()))).next((e=>{const r=E(e.plane),n=N(e.renderStart,e.renderEnd,c.origin,r),h=t.shortestSignedDiff(c.angle,n);c.angleDir=i(c.angleDir+h,-V,V),c.angle=n;const p=bt(c,e),u=p-this._adapter.scale;if(c.scaleDir=i(c.scaleDir+u,-q,q),this._onScaleChanged(),"none"===c.mode){const t=this._mode||Tt(e,e.plane,c.origin,this.tool.view.state.camera);if(s(t)){switch(t){case"rotate":this.tool.emit("graphic-rotate-start",{graphic:a,angle:0}),this.tool.emit("record-undo",{record:this._adapter.createUndoRecord()});break;case"scale":this.tool.emit("graphic-scale-start",{graphic:a,xScale:1,yScale:1}),this.tool.emit("record-undo",{record:this._adapter.createUndoRecord()})}c.mode=t}}switch(c.mode){case"rotate":l.state.angle=c.initialAngle+n;break;case"scale":l.state.scale=p,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case"start":case"update":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale",{graphic:a,xScale:p,yScale:p})}break;case"end":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:p,yScale:p})}}return"end"===e.action&&(this.startAnimation(jt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState(),l.done()),e})).next(this._updateTooltipPipelineStep(c)),n.next((()=>{if(l.cancel(),s(this._scaleRotateDragData)){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:0});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:1,yScale:1})}this.startAnimation(jt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()}this._updateFocusTooltip()}))}));this._handles.add([r,e.events.on("focus-changed",(t=>{"focus"===t.action?this.startAnimation(kt(this,(()=>this._updateDelayedFocusedState()))):this._updateDelayedFocusedState()})),e.events.on("immediate-click",(t=>{t.stopPropagation()})),d((()=>this.tool.graphicState?.displaying),(t=>this._ringManipulator.available=t),u)])}_updateTooltipPipelineStep(t){return e=>{const a=this._tooltipOptions;if(!a.enabled)return e;if("end"===e.action)return this._updateFocusTooltip(),e;const i=this._tooltip,o=this._tooltipOptions.visualVariables,r=s(o)?o.size:null,l=s(o)?o.rotation:null;switch(t.mode){case"scale":i.info=new Mt({tooltipOptions:a,scale:{value:this._adapter.scale},size:h(n(this._adapter.size,-1),"meters"),sizeUnit:s(r)?r.unit:null,sizePrecision:s(r)?wt(r.valueType):null});break;case"rotate":{const t=s(l)?wt(l.valueType):null,e=s(l)?l.rotationType:"geographic";i.info=new ft({tooltipOptions:a,rotation:c(n(-this._adapter.relativeAngle,0),"radians","geographic"),rotationPrecision:t,orientation:c(-this._adapter.angle,"radians","geographic"),orientationPrecision:t,rotationType:e})}}return e}}_updateFocusTooltip(){if(!this._tooltipOptions.enabled)return;if(this.getFocused()){const t=this._tooltipOptions.visualVariables,e=s(t)?t.rotation:null,a=s(t)?t.size:null;this._tooltip.info=new Dt({tooltipOptions:this._tooltipOptions,orientation:c(-this._adapter.angle,"radians","geographic"),orientationEnabled:null==this._mode||"rotate"===this._mode,orientationPrecision:s(e)?wt(e.valueType):null,rotationType:s(e)?e.rotationType:"geographic",size:h(n(this._adapter.size,-1),"meters"),sizeUnit:s(a)?a.unit:null,sizeEnabled:null==this._mode||"scale"===this._mode,sizePrecision:s(a)?wt(a.valueType):null})}else this._tooltip.clear()}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(St.DelayedFocused,this.getFocused()),this._updateFocusTooltip()}_updateDragState(){if(this._ringManipulator.updateStateEnabled(St.Unlocked,!(s(this._scaleRotateDragData)&&"none"!==this._scaleRotateDragData.mode)),s(this._scaleRotateDragData))switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(St.ScaleIn|St.ScaleOut,!1),this._ringManipulator.updateStateEnabled(St.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(St.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(St.RotateLeft|St.RotateRight,!1),this._ringManipulator.updateStateEnabled(St.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(St.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(St.ScaleIn|St.ScaleOut|St.RotateLeft|St.RotateRight,!1)}_updateManipulatorTransform(){const t=_(x.get(),this._adapter.angle,O(0,0,1));if(l(t))return;const e=this.getScale(),a=f(x.get(),y(U.get(),e,e,e));this._ringManipulator.modelTransform=M(x.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const i=[],o=Math.ceil(rt*(e-t)/(2*Math.PI));for(let s=0;s<o+1;s++){const r=t+s*(e-t)/o;i.push(O(a*Math.cos(r),a*Math.sin(r),0))}return i},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,B/2],[-t/2,B/2]],i=(t,e)=>ht.createPathExtrusionGeometry(a(e),t,[],[],!1),o=e($),s=i(o,W),r={left:[],right:[]},n=[];for(let j=0;j<2;j++){const e=j*Math.PI-Math.PI/4,a=Math.PI/2-nt,o=e+a,s=e+Math.PI/2-a,l=t(o,s,tt),c=i(l,et);n.push(l),n.push(t(o,s,at-W/2)),r.left.push(c),r.right.push(c);for(let t=0;t<2;t++){const e=0===t,a=v();if(e){D(a,a,[1,-1,1]),S(a,a,-o,[0,0,1]);const t=Math.round(J*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}else{S(a,a,s,[0,0,1]);const t=Math.round((1-J)*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}const i=ht.createExtrudedTriangle(K,0,Q,B);ht.transformInPlace(i,a),(e?r.left:r.right).push(i)}}const l=[];for(let D=0;D<2;D++){const e=D*Math.PI-Math.PI/4,a=Math.PI/2-lt,o=e+a,s=e+Math.PI/2-a,r=t(o,s,at);l.push(i(r,et))}const c=e($+it),h=e($+ot),p=i(c,et),u=i(h,et),d=e($-it),g=e($-ot),m=i(d,et),_=i(g,et),f=this._createMaterial(),M=this._createMaterial(.66),y=this._createMaterial(.5),b=this._createMaterial(.33);let T=[{geometry:s,material:f,stateMask:St.DelayedFocused},{geometry:s,material:y,stateMask:mt.None}];this._mode&&"scale"!==this._mode||(T=T.concat([{geometry:l,material:f,stateMask:St.DelayedFocused|St.Unlocked},{geometry:p,material:M,stateMask:St.DelayedFocused|St.ScaleIn},{geometry:u,material:b,stateMask:St.DelayedFocused|St.ScaleIn},{geometry:m,material:M,stateMask:St.DelayedFocused|St.ScaleOut},{geometry:_,material:b,stateMask:St.DelayedFocused|St.ScaleOut}])),this._mode&&"rotate"!==this._mode||(T=T.concat([{geometry:r.right,material:f,stateMask:St.DelayedFocused|St.Unlocked},{geometry:r.left,material:f,stateMask:St.DelayedFocused|St.RotateLeft},{geometry:r.right,material:f,stateMask:St.DelayedFocused|St.RotateRight}]));const R=[o,...n];return new L({view:this.tool.view,renderObjects:T,autoScaleRenderObjects:!1,worldOriented:!0,radius:W,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:z(this.tool.graphicState.graphic),collisionType:{type:"ribbon",paths:R,direction:O(0,0,1)}})}_createMaterial(t=1){const e=A([...X,t]);return new ut({color:e,transparent:1!==t,cullFace:ct.Back,renderOccluded:pt.Transparent})}get test(){return{ringManipulator:this._ringManipulator,tooltip:this._tooltip}}}function bt(t,e){const a=b(U.get(),e.renderStart,t.origin),i=b(U.get(),e.renderEnd,t.origin),o=T(a),s=T(i);return 0===o?0:s/o}function Tt(t,e,a,i){const{renderStart:o,renderEnd:s}=t,r=Rt(o,i,U.get()),n=Rt(s,i,U.get());if(R(r,n)<Y*Y)return null;const l=b(U.get(),o,a),c=j(U.get(),l,E(e)),h=o,p=k(U.get(),h,c),u=Rt(a,i,U.get()),d=r,g=Rt(p,i,U.get()),m=b(U.get(),g,d),_=b(U.get(),r,u),f=F(d,m),M=F(u,_);return C(f,n)<C(M,n)?"rotate":"scale"}function Rt(t,e,a){return e.projectToScreen(t,Ot),y(a,Ot[0],Ot[1],0)}function jt(t,e){let a=null,i=1;const o=()=>i;return{start:()=>{i=t.getScale(),a=t.getScale,t.getScale=o,e()},update:t=>(i+=((i+1)/2-i)*Math.min(t*st,1),e(),Math.abs(i-1)<.01?vt.STOP:vt.CONTINUE),destroy:()=>{t.getScale=a,e()}}}function kt(t,e){let a=0,i=null;const o=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=o,a=0,e()},update:t=>(a+=t,!i()||a>Z?vt.STOP:vt.CONTINUE),destroy:()=>{t.getFocused=i,e()}}}function wt(t){switch(t){case"integer":case"long":return 0;default:return null}}!function(t){t[t.CONTINUE=0]="CONTINUE",t[t.STOP=1]="STOP"}(vt||(vt={}));const Ot=m();export{yt as GraphicScaleRotateTransform};
5
+ import{cyclicalPI as t}from"../../../../../core/Cyclical.js";import e from"../../../../../core/Evented.js";import a from"../../../../../core/Handles.js";import{clamp as i,rad2deg as o}from"../../../../../core/mathUtils.js";import{isSome as s,destroyMaybe as r,unwrapOr as n,isNone as l}from"../../../../../core/maybe.js";import{createAngle as c,createLength as h}from"../../../../../core/quantityUtils.js";import{when as p,initial as u,watch as d}from"../../../../../core/reactiveUtils.js";import{addFrameTask as g}from"../../../../../core/scheduling.js";import{createScreenPointArray as m}from"../../../../../core/screenUtils.js";import{d as _,g as f,m as M,l as D,e as S}from"../../../../../chunks/mat4.js";import{c as v}from"../../../../../chunks/mat4f64.js";import{s as y,b,l as T,d as R,f as j,a as k}from"../../../../../chunks/vec3.js";import{a as w,f as O}from"../../../../../chunks/vec3f64.js";import{b as A}from"../../../../../chunks/vec4f64.js";import{fromPositionAndNormal as I,create as P,normal as E}from"../../../../../geometry/support/plane.js";import{wrap as F,distance2 as C}from"../../../../../geometry/support/ray.js";import{sv3d as U,sm4d as x}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as z}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as L}from"../../Manipulator3D.js";import{calculateInputRotationTransform as N}from"../../manipulatorUtils.js";import{screenToRenderPlane as G}from"../dragEventPipeline3D.js";import{ManipulatorType as H}from"../ManipulatorType.js";import{ROTATE_INDICATOR_DIRECTION_BUFFER as V,SCALE_INDICATOR_DIRECTION_BUFFER as q,ROTATE_INDICATOR_ARROW_PLACEMENT_PERCENTAGE as B,ROTATE_INDICATOR_ARROW_TIP_LENGTH as J,ROTATE_INDICATOR_ARROW_TIP_RADIUS as K,RING_HEIGHT as Q,RING_THICKNESS as W,HANDLE_COLOR as X,DRAG_THRESHOLD_PX as Y,RING_RADIUS as Z,INNER_INDICATOR_RADIUS as $,OUTER_INDICATOR_RADIUS as tt,SCALE_INDICATOR_OFFSET1 as et,SCALE_INDICATOR_OFFSET2 as at,RING_INDICATOR_DELAY_MS as it,GEOMETRY_SEGMENTS as ot,ROTATE_INDICATOR_ARC_LENGTH as st,INDICATOR_THICKNESS as rt,RING_RESET_ANIMATION_SPEED_FACTOR as nt,SCALE_INDICATOR_ARC_LENGTH as lt}from"../manipulations/config.js";import{CullFaceOptions as ct}from"../../../webgl-engine/lib/basicInterfaces.js";import ht from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as pt}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as ut}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as dt}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as gt,ManipulatorStateFlags as mt}from"../../../../interactive/interfaces.js";import{Tooltip as _t}from"../../../../interactive/tooltip/Tooltip.js";import{TransformRotateTooltipInfo as ft,TransformScaleTooltipInfo as Mt,TransformAbsoluteTooltipInfo as Dt}from"../../../../interactive/tooltip/TransformTooltipInfos.js";var St,vt;!function(t){t.ScaleIn=gt.Custom2,t.ScaleOut=gt.Custom3,t.RotateLeft=gt.Custom4,t.RotateRight=gt.Custom5,t.Unlocked=gt.Custom7,t.DelayedFocused=gt.Custom8,t.TouchInput=gt.Custom12}(St||(St={}));class yt{constructor({adapter:t,tooltipOptions:i,mode:o,tool:r}){this._mode=null,this._handles=new a,this._scaleRotateDragData=null,this._activeAnimation=null,this.events=new e,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>s(this._scaleRotateDragData)&&"scale"===this._scaleRotateDragData.mode?this._adapter.scale:1,this.tool=r,this._mode=o,this._adapter=t,this._tooltipOptions=i,this._tooltip=new _t({view:r.view}),this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this._handles.add(p((()=>!this._tooltipOptions.enabled),(()=>this._tooltip.clear()),u))}get angle(){return this._adapter.angle}get scale(){return this._adapter.scale}set location(t){this._ringManipulator.location=t}set elevationAlignedLocation(t){this._ringManipulator.elevationAlignedLocation=t}get grabbing(){return this._ringManipulator.grabbing}set interactive(t){this._ringManipulator.interactive=t}destroy(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=null),this._handles=r(this._handles),this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null,this._tooltip=r(this._tooltip)}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=g({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=r(this._activeAnimation))}forEachManipulator(t){t(this._ringManipulator,H.SCALE_ROTATE)}_createManipulator(){const e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);const a=this.tool.graphicState.graphic,r=dt(e,((e,r,n)=>{this._scaleRotateDragData=null;const l=this._adapter.startInteraction(),c={mode:"none",origin:w(e.renderLocation),initialAngle:this._adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();const h=U.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,h),r.next(G(this.tool.view,I(e.renderLocation,h,P()))).next((e=>{const r=E(e.plane),n=N(e.renderStart,e.renderEnd,c.origin,r),h=t.shortestSignedDiff(c.angle,n);c.angleDir=i(c.angleDir+h,-V,V),c.angle=n;const p=bt(c,e),u=p-this._adapter.scale;if(c.scaleDir=i(c.scaleDir+u,-q,q),this._onScaleChanged(),"none"===c.mode){const t=this._mode||Tt(e,e.plane,c.origin,this.tool.view.state.camera);if(s(t)){switch(t){case"rotate":this.tool.emit("graphic-rotate-start",{graphic:a,angle:0}),this.tool.emit("record-undo",{record:this._adapter.createUndoRecord()});break;case"scale":this.tool.emit("graphic-scale-start",{graphic:a,xScale:1,yScale:1}),this.tool.emit("record-undo",{record:this._adapter.createUndoRecord()})}c.mode=t}}switch(c.mode){case"rotate":l.state.angle=c.initialAngle+n;break;case"scale":l.state.scale=p,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case"start":case"update":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale",{graphic:a,xScale:p,yScale:p})}break;case"end":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:p,yScale:p})}}return"end"===e.action&&(this.startAnimation(jt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState(),l.done()),e})).next(this._updateTooltipPipelineStep(c)),n.next((()=>{if(l.cancel(),s(this._scaleRotateDragData)){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:0});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:1,yScale:1})}this.startAnimation(jt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()}this._updateFocusTooltip()}))}));this._handles.add([r,e.events.on("focus-changed",(t=>{"focus"===t.action?this.startAnimation(kt(this,(()=>this._updateDelayedFocusedState()))):this._updateDelayedFocusedState()})),e.events.on("immediate-click",(t=>{t.stopPropagation()})),d((()=>this.tool.graphicState?.displaying),(t=>this._ringManipulator.available=t),u)])}_updateTooltipPipelineStep(t){return e=>{const a=this._tooltipOptions;if(!a.enabled)return e;if("end"===e.action)return this._updateFocusTooltip(),e;const i=this._tooltip,o=this._tooltipOptions.visualVariables,r=s(o)?o.size:null,l=s(o)?o.rotation:null;switch(t.mode){case"scale":i.info=new Mt({tooltipOptions:a,scale:{value:this._adapter.scale},size:h(n(this._adapter.size,-1),"meters"),sizeUnit:s(r)?r.unit:null,sizePrecision:s(r)?wt(r.valueType):null});break;case"rotate":{const t=s(l)?wt(l.valueType):null,e=s(l)?l.rotationType:"geographic";i.info=new ft({tooltipOptions:a,rotation:c(n(-this._adapter.relativeAngle,0),"radians","geographic"),rotationPrecision:t,orientation:c(-this._adapter.angle,"radians","geographic"),orientationPrecision:t,rotationType:e})}}return e}}_updateFocusTooltip(){if(!this._tooltipOptions.enabled)return;if(this.getFocused()){const t=this._tooltipOptions.visualVariables,e=s(t)?t.rotation:null,a=s(t)?t.size:null;this._tooltip.info=new Dt({tooltipOptions:this._tooltipOptions,orientation:c(-this._adapter.angle,"radians","geographic"),orientationEnabled:null==this._mode||"rotate"===this._mode,orientationPrecision:s(e)?wt(e.valueType):null,rotationType:s(e)?e.rotationType:"geographic",size:h(n(this._adapter.size,-1),"meters"),sizeUnit:s(a)?a.unit:null,sizeEnabled:null==this._mode||"scale"===this._mode,sizePrecision:s(a)?wt(a.valueType):null})}else this._tooltip.clear()}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(St.DelayedFocused,this.getFocused()),this._updateFocusTooltip()}_updateDragState(){if(this._ringManipulator.updateStateEnabled(St.Unlocked,!(s(this._scaleRotateDragData)&&"none"!==this._scaleRotateDragData.mode)),s(this._scaleRotateDragData))switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(St.ScaleIn|St.ScaleOut,!1),this._ringManipulator.updateStateEnabled(St.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(St.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(St.RotateLeft|St.RotateRight,!1),this._ringManipulator.updateStateEnabled(St.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(St.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(St.ScaleIn|St.ScaleOut|St.RotateLeft|St.RotateRight,!1)}_updateManipulatorTransform(){const t=_(x.get(),this._adapter.angle,O(0,0,1));if(l(t))return;const e=this.getScale(),a=f(x.get(),y(U.get(),e,e,e));this._ringManipulator.modelTransform=M(x.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const i=[],o=Math.ceil(ot*(e-t)/(2*Math.PI));for(let s=0;s<o+1;s++){const r=t+s*(e-t)/o;i.push(O(a*Math.cos(r),a*Math.sin(r),0))}return i},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,Q/2],[-t/2,Q/2]],i=(t,e)=>ht.createPathExtrusionGeometry(a(e),t,[],[],!1),o=e(Z),s=i(o,W),r={left:[],right:[]},n=[];for(let j=0;j<2;j++){const e=j*Math.PI-Math.PI/4,a=Math.PI/2-st,o=e+a,s=e+Math.PI/2-a,l=t(o,s,$),c=i(l,rt);n.push(l),n.push(t(o,s,tt-W/2)),r.left.push(c),r.right.push(c);for(let t=0;t<2;t++){const e=0===t,a=v();if(e){D(a,a,[1,-1,1]),S(a,a,-o,[0,0,1]);const t=Math.round(B*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}else{S(a,a,s,[0,0,1]);const t=Math.round((1-B)*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}const i=ht.createExtrudedTriangle(J,0,K,Q);ht.transformInPlace(i,a),(e?r.left:r.right).push(i)}}const l=[];for(let D=0;D<2;D++){const e=D*Math.PI-Math.PI/4,a=Math.PI/2-lt,o=e+a,s=e+Math.PI/2-a,r=t(o,s,tt);l.push(i(r,rt))}const c=e(Z+et),h=e(Z+at),p=i(c,rt),u=i(h,rt),d=e(Z-et),g=e(Z-at),m=i(d,rt),_=i(g,rt),f=this._createMaterial(),M=this._createMaterial(.66),y=this._createMaterial(.5),b=this._createMaterial(.33);let T=[{geometry:s,material:f,stateMask:St.DelayedFocused},{geometry:s,material:y,stateMask:mt.None}];this._mode&&"scale"!==this._mode||(T=T.concat([{geometry:l,material:f,stateMask:St.DelayedFocused|St.Unlocked},{geometry:p,material:M,stateMask:St.DelayedFocused|St.ScaleIn},{geometry:u,material:b,stateMask:St.DelayedFocused|St.ScaleIn},{geometry:m,material:M,stateMask:St.DelayedFocused|St.ScaleOut},{geometry:_,material:b,stateMask:St.DelayedFocused|St.ScaleOut}])),this._mode&&"rotate"!==this._mode||(T=T.concat([{geometry:r.right,material:f,stateMask:St.DelayedFocused|St.Unlocked},{geometry:r.left,material:f,stateMask:St.DelayedFocused|St.RotateLeft},{geometry:r.right,material:f,stateMask:St.DelayedFocused|St.RotateRight}]));const R=[o,...n];return new L({view:this.tool.view,renderObjects:T,autoScaleRenderObjects:!1,worldOriented:!0,radius:W,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:z(this.tool.graphicState.graphic),collisionType:{type:"ribbon",paths:R,direction:O(0,0,1)}})}_createMaterial(t=1){const e=A([...X,t]);return new ut({color:e,transparent:1!==t,cullFace:ct.Back,renderOccluded:pt.Transparent})}get test(){return{ringManipulator:this._ringManipulator,tooltip:this._tooltip}}}function bt(t,e){const a=b(U.get(),e.renderStart,t.origin),i=b(U.get(),e.renderEnd,t.origin),o=T(a),s=T(i);return 0===o?0:s/o}function Tt(t,e,a,i){const{renderStart:o,renderEnd:s}=t,r=Rt(o,i,U.get()),n=Rt(s,i,U.get());if(R(r,n)<Y*Y)return null;const l=b(U.get(),o,a),c=j(U.get(),l,E(e)),h=o,p=k(U.get(),h,c),u=Rt(a,i,U.get()),d=r,g=Rt(p,i,U.get()),m=b(U.get(),g,d),_=b(U.get(),r,u),f=F(d,m),M=F(u,_);return C(f,n)<C(M,n)?"rotate":"scale"}function Rt(t,e,a){return e.projectToScreen(t,Ot),y(a,Ot[0],Ot[1],0)}function jt(t,e){let a=null,i=1;const o=()=>i;return{start:()=>{i=t.getScale(),a=t.getScale,t.getScale=o,e()},update:t=>(i+=((i+1)/2-i)*Math.min(t*nt,1),e(),Math.abs(i-1)<.01?vt.STOP:vt.CONTINUE),destroy:()=>{t.getScale=a,e()}}}function kt(t,e){let a=0,i=null;const o=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=o,a=0,e()},update:t=>(a+=t,!i()||a>it?vt.STOP:vt.CONTINUE),destroy:()=>{t.getFocused=i,e()}}}function wt(t){switch(t){case"integer":case"long":return 0;default:return null}}!function(t){t[t.CONTINUE=0]="CONTINUE",t[t.STOP=1]="STOP"}(vt||(vt={}));const Ot=m();export{yt as GraphicScaleRotateTransform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import i from"../../../../../core/Evented.js";import{HandleOwnerMixin as e}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{isNone as o,isSome as n,destroyMaybe as s}from"../../../../../core/maybe.js";import{scale as r,zeroMeters as p}from"../../../../../core/quantityUtils.js";import{watch as l,syncAndInitial as c}from"../../../../../core/reactiveUtils.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import d from"../../../../../geometry/Point.js";import{getGraphicEffectiveElevationInfo as u}from"../../../../../support/elevationInfoUtils.js";import{ViewingMode as g}from"../../../../ViewingMode.js";import{Manipulator3D as v}from"../../Manipulator3D.js";import{placeAtGraphic as _}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as M}from"../../SnappingVisualizer3D.js";import{canMoveZ as f}from"../manipulatorUtils.js";import{createVisualElements as y}from"../visualElementUtils.js";import{ALIGN_ARROWS_SCALE_THRESHOLD as S}from"../manipulations/config.js";import{MoveManipulation as R,ManipulationType as b}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as w}from"../manipulations/moveUtils.js";import{GraphicScaleRotateTransform as j}from"./GraphicScaleRotateTransform.js";import{ScaleRotateMeshAdapter as A}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as T}from"./ScaleRotateObjectSymbol3DAdapter.js";import{createGraphicGeometryUndoRecord as O}from"./undoRecords.js";import{GraphicState as x}from"../../../layers/graphics/GraphicState.js";import{InteractiveToolBase as E}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as G}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import z from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as U}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as D}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as k}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicZTooltipInfo as C,TranslateGraphicXYTooltipInfo as I,TranslateGraphicTooltipInfo as L}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as P}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as Z}from"../../../../support/euclideanLengthMeasurementUtils.js";let V=class extends(e(i.EventedMixin(E))){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new z,this.type="transform-3d",this._scaleRotate=null,this._snappingPipeline=new D,this._tooltip=null}initialize(){const{graphic:t,view:i}=this;this.graphicState=new x({graphic:t}),this.addHandles(l((()=>this.tooltipOptions.enabled),(t=>{this._tooltip=t?new k({view:i}):s(this._tooltip)}),c)),this._moveManipulation=new R({tool:this,view:i,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&f(t),radius:R.radiusForSymbol(t.symbol)}),this._moveManipulation.forEachManipulator((i=>this.handles.add(i.events.on("immediate-click",(i=>{this.emit("immediate-click",{...i,graphic:t}),i.stopPropagation()})))));const e=t=>i=>{this.handles.add(i.events.on("focus-changed",(({action:i})=>{const e=this._tooltip;o(e)||("focus"===i?this._updateMoveTooltip(t):e.clear())})))};this._moveManipulation.xyManipulation.forEachManipulator(e(b.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(b.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(b.Z)),this._moveManipulation.elevationInfo=u(t);const r=t.geometry;if(this._moveManipulation.createGraphicDragPipeline(((e,a,o,s,p)=>(n(r)&&e===b.XY&&(o=o.next(this._snappingPipeline.createSnapDragEventPipelineStep({snappingContext:new U({elevationInfo:u(t),pointer:p,editGeometryOperations:G.fromGeometry(new d({spatialReference:r.spatialReference}),i.state.viewingMode),visualizer:new M,excludeFeature:t}),snappingManager:this.snappingManager,updatingHandles:this.updatingHandles,cancel:s}),this._snappingPipeline.next)),o=o.next((t=>(this._updateMoveTooltip(e,t),t))))),this.graphicState,(t=>{const{action:i,graphic:e,dxScreen:a,dyScreen:o}=t,n={graphic:e,dxScreen:a,dyScreen:o};switch(i){case"start":this.emit("graphic-translate-start",n),this.emit("record-undo",{record:this._createGeometryUndoRecord()});break;case"update":this.emit("graphic-translate",n);break;case"end":this.emit("graphic-translate-stop",n)}})),this._moveManipulation.angle=n(this._scaleRotate)?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.handles.add(l((()=>this._scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new j({tool:this,mode:t,adapter:this._scaleRotateAdapter,tooltipOptions:this.tooltipOptions}),this.handles.add(this._scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.handles.add([y({view:this.view,graphic:this.graphic,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()}),this.graphicState.on("changed",(()=>this._onGeometryChanged())),this._hideManipulatorsForGraphicState(),l((()=>i.scale),(()=>this._updateMoveAngle()))]),this.handles.add(this.view.trackGraphicState(this.graphicState)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof v&&this.handles.add(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))})),this.finishToolCreation()}destroy(){this._tooltip=s(this._tooltip),this._moveManipulation.destroy(),this._scaleRotate=s(this._scaleRotate),this._scaleRotateAdapter=s(this._scaleRotateAdapter),this._set("view",null),this._set("graphic",null)}_updateManipulatorsInteractive(){o(this._scaleRotate)||(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){return n(this.graphic.geometry)&&"mesh"===this.graphic.geometry.type?new A({graphic:this.graphic,geometry:this.graphic.geometry,viewingMode:this.view.state.viewingMode}):new T({graphic:this.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.graphic.layer)),sizeAxis:n(this.tooltipOptions.visualVariables)&&n(this.tooltipOptions.visualVariables.size)?this.tooltipOptions.visualVariables.size.axis:null})}_forEachManipulator(t){this._moveManipulation.forEachManipulator(t),n(this._scaleRotate)&&this._scaleRotate.forEachManipulator(t)}_hideManipulatorsForGraphicState(){return l((()=>this.graphicState.displaying),(t=>{this._forEachManipulator((i=>i.available=t)),this._moveManipulation.zManipulation.available=t&&this.enableZ&&f(this.graphic)}))}_createGeometryUndoRecord(){return O(this.graphic)}set snapToScene(t){this._moveManipulation&&(this._moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this.updatingHandles.updating}set location(t){this._moveManipulation.location=t,n(this._scaleRotate)&&(this._scaleRotate.location=t)}set elevationAlignedLocation(t){this._moveManipulation.elevationAlignedLocation=t,n(this._scaleRotate)&&(this._scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){n(this._scaleRotate)&&this._scaleRotate.cancelActiveAnimation()}_onScaleChanged(){if(o(this._scaleRotate))return;const t=this._scaleRotate.getScale();this._moveManipulation.displayScale=t}_updateMoveAngle(){this.view.state.viewingMode===g.Local||this.view.scale<S?this._moveManipulation.angle=this._scaleRotateAdapter.angle:this._moveManipulation.angle=0}_onGeometryChanged(){_(this.view,this,this.graphic)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}_updateMoveTooltip(t,i){const{tooltipOptions:e,_tooltip:a}=this;if(o(a))return;a.clear();const n=this.graphicState.isDraped?"on-the-ground":"absolute-height";switch(t){case b.XY:a.info=new L({tooltipOptions:e}),this._updateMoveTooltipDistance(a.info,i,((t,i)=>P(t,i,n)));break;case b.XY_AXIS:a.info=new I({tooltipOptions:e}),this._updateMoveTooltipDistance(a.info,i,((t,e)=>{const a=P(t,e,n);return r(a,w(i))}));break;case b.Z:a.info=new C({tooltipOptions:e}),this._updateMoveTooltipDistance(a.info,i,Z)}}_updateMoveTooltipDistance(t,i,e){if(n(i)&&"end"!==i.action){const{mapStart:a,mapEnd:o}=i,s=e(a,o);t.distance=n(s)?s:p}}get test(){return{discManipulator:this._moveManipulation.xyManipulation.test.discManipulator,zManipulator:this._moveManipulation.zManipulation.test.manipulator,ringManipulator:n(this._scaleRotate)?this._scaleRotate.test.ringManipulator:null,arrowManipulators:this._moveManipulation.xyAxisManipulation.test.arrowManipulators,scaleRotateAdapter:this._scaleRotateAdapter,scaleRotateTransform:this._scaleRotate,tooltip:this._tooltip}}};t([h({constructOnly:!0,nonNullable:!0})],V.prototype,"view",void 0),t([h({constructOnly:!0,nonNullable:!0})],V.prototype,"graphic",void 0),t([h({constructOnly:!0,nonNullable:!0})],V.prototype,"enableZ",void 0),t([h()],V.prototype,"enableRotation",void 0),t([h()],V.prototype,"enableScaling",void 0),t([h({constructOnly:!0,type:z})],V.prototype,"tooltipOptions",void 0),t([h()],V.prototype,"graphicState",void 0),t([h({value:!1})],V.prototype,"snapToScene",null),t([h({constructOnly:!0})],V.prototype,"snappingManager",void 0),t([h({readOnly:!0})],V.prototype,"type",void 0),t([h({readOnly:!0})],V.prototype,"updating",null),V=t([m("esri.views.3d.interactive.editingTools.graphicTransform3D.GraphicTransformTool")],V);export{V as GraphicTransformTool};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import i from"../../../../../core/Evented.js";import{HandleOwnerMixin as e}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{isSome as o,destroyMaybe as n,isNone as s}from"../../../../../core/maybe.js";import{scale as r,zeroMeters as p}from"../../../../../core/quantityUtils.js";import{watch as l,syncAndInitial as c}from"../../../../../core/reactiveUtils.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import d from"../../../../../geometry/Point.js";import{getGraphicEffectiveElevationInfo as u}from"../../../../../support/elevationInfoUtils.js";import{ViewingMode as g}from"../../../../ViewingMode.js";import{Manipulator3D as v}from"../../Manipulator3D.js";import{placeAtGraphic as _}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as M}from"../../SnappingVisualizer3D.js";import{canMoveZ as f}from"../manipulatorUtils.js";import{createVisualElements as y}from"../visualElementUtils.js";import{ALIGN_ARROWS_SCALE_THRESHOLD as S}from"../manipulations/config.js";import{MoveManipulation as R,ManipulationType as b}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as w}from"../manipulations/moveUtils.js";import{GraphicScaleRotateTransform as j}from"./GraphicScaleRotateTransform.js";import{ScaleRotateMeshAdapter as A}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as T}from"./ScaleRotateObjectSymbol3DAdapter.js";import{createGraphicGeometryUndoRecord as O}from"./undoRecords.js";import{GraphicState as x}from"../../../layers/graphics/GraphicState.js";import{InteractiveToolBase as E}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as G}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import z from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as U}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as D}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as k}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicZTooltipInfo as C,TranslateGraphicXYTooltipInfo as I,TranslateGraphicTooltipInfo as L}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as P}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as Z}from"../../../../support/euclideanLengthMeasurementUtils.js";let V=class extends(e(i.EventedMixin(E))){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new z,this.type="transform-3d",this._scaleRotate=null,this._snappingPipeline=new D,this._tooltip=null}initialize(){const{graphic:t,view:i}=this;this.graphicState=new x({graphic:t}),this.addHandles(l((()=>this.tooltipOptions.enabled),(t=>{this._tooltip=t?new k({view:i}):n(this._tooltip)}),c)),this._moveManipulation=new R({tool:this,view:i,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&f(t),radius:R.radiusForSymbol(t.symbol)}),this._moveManipulation.forEachManipulator((i=>this.handles.add(i.events.on("immediate-click",(i=>{this.emit("immediate-click",{...i,graphic:t}),i.stopPropagation()})))));const e=t=>i=>{this.handles.add(i.events.on("focus-changed",(({action:i})=>{const e=this._tooltip;s(e)||("focus"===i?this._updateMoveTooltip(t):e.clear())})))};this._moveManipulation.xyManipulation.forEachManipulator(e(b.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(b.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(b.Z)),this._moveManipulation.elevationInfo=u(t);const r=t.geometry;if(this._moveManipulation.createGraphicDragPipeline(((e,a,n,s,p)=>(o(r)&&e===b.XY&&(n=n.next(this._snappingPipeline.createSnapDragEventPipelineStep({snappingContext:new U({elevationInfo:u(t),pointer:p,editGeometryOperations:G.fromGeometry(new d({spatialReference:r.spatialReference}),i.state.viewingMode),visualizer:new M,excludeFeature:t}),snappingManager:this.snappingManager,updatingHandles:this.updatingHandles,cancel:s}),this._snappingPipeline.next)),n=n.next((t=>(this._updateMoveTooltip(e,t),t))))),this.graphicState,(t=>{const{action:i,graphic:e,dxScreen:a,dyScreen:o}=t,n={graphic:e,dxScreen:a,dyScreen:o};switch(i){case"start":this.emit("graphic-translate-start",n),this.emit("record-undo",{record:this._createGeometryUndoRecord()});break;case"update":this.emit("graphic-translate",n);break;case"end":this.emit("graphic-translate-stop",n)}})),this._moveManipulation.angle=o(this._scaleRotate)?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.handles.add(l((()=>this._scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new j({tool:this,mode:t,adapter:this._scaleRotateAdapter,tooltipOptions:this.tooltipOptions}),this.handles.add(this._scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.handles.add([y({view:this.view,graphic:this.graphic,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()}),this.graphicState.on("changed",(()=>this._onGeometryChanged())),this._hideManipulatorsForGraphicState(),l((()=>i.scale),(()=>this._updateMoveAngle()))]),this.handles.add(this.view.trackGraphicState(this.graphicState)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof v&&this.handles.add(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))})),this.finishToolCreation()}destroy(){this._tooltip=n(this._tooltip),this._moveManipulation.destroy(),this._scaleRotate=n(this._scaleRotate),this._scaleRotateAdapter=n(this._scaleRotateAdapter),this._set("view",null),this._set("graphic",null)}_updateManipulatorsInteractive(){s(this._scaleRotate)||(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){return o(this.graphic.geometry)&&"mesh"===this.graphic.geometry.type?new A({graphic:this.graphic,geometry:this.graphic.geometry,viewingMode:this.view.state.viewingMode}):new T({graphic:this.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.graphic.layer)),sizeAxis:o(this.tooltipOptions.visualVariables)&&o(this.tooltipOptions.visualVariables.size)?this.tooltipOptions.visualVariables.size.axis:null})}_forEachManipulator(t){this._moveManipulation.forEachManipulator(t),o(this._scaleRotate)&&this._scaleRotate.forEachManipulator(t)}_hideManipulatorsForGraphicState(){return l((()=>this.graphicState.displaying),(t=>{this._forEachManipulator((i=>i.available=t)),this._moveManipulation.zManipulation.available=t&&this.enableZ&&f(this.graphic)}))}_createGeometryUndoRecord(){return O(this.graphic)}set snapToScene(t){this._moveManipulation&&(this._moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this.updatingHandles.updating}set location(t){this._moveManipulation.location=t,o(this._scaleRotate)&&(this._scaleRotate.location=t)}set elevationAlignedLocation(t){this._moveManipulation.elevationAlignedLocation=t,o(this._scaleRotate)&&(this._scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){o(this._scaleRotate)&&this._scaleRotate.cancelActiveAnimation()}_onScaleChanged(){if(s(this._scaleRotate))return;const t=this._scaleRotate.getScale();this._moveManipulation.displayScale=t}_updateMoveAngle(){this.view.state.viewingMode===g.Local||this.view.scale<S?this._moveManipulation.angle=this._scaleRotateAdapter.angle:this._moveManipulation.angle=0}_onGeometryChanged(){_(this.view,this,this.graphic)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}_updateMoveTooltip(t,i){const{tooltipOptions:e,_tooltip:a}=this;if(s(a))return;a.clear();const o=this.graphicState.isDraped?"on-the-ground":"absolute-height";switch(t){case b.XY:a.info=new L({tooltipOptions:e}),this._updateMoveTooltipDistance(a.info,i,((t,i)=>P(t,i,o)));break;case b.XY_AXIS:a.info=new I({tooltipOptions:e}),this._updateMoveTooltipDistance(a.info,i,((t,e)=>{const a=P(t,e,o);return r(a,w(i))}));break;case b.Z:a.info=new C({tooltipOptions:e}),this._updateMoveTooltipDistance(a.info,i,Z)}}_updateMoveTooltipDistance(t,i,e){if(o(i)&&"end"!==i.action){const{mapStart:a,mapEnd:n}=i,s=e(a,n);t.distance=o(s)?s:p}}get test(){return{discManipulator:this._moveManipulation.xyManipulation.test.discManipulator,zManipulator:this._moveManipulation.zManipulation.test.manipulator,ringManipulator:o(this._scaleRotate)?this._scaleRotate.test.ringManipulator:null,arrowManipulators:this._moveManipulation.xyAxisManipulation.test.arrowManipulators,scaleRotateAdapter:this._scaleRotateAdapter,scaleRotateTransform:this._scaleRotate,tooltip:this._tooltip}}};t([h({constructOnly:!0,nonNullable:!0})],V.prototype,"view",void 0),t([h({constructOnly:!0,nonNullable:!0})],V.prototype,"graphic",void 0),t([h({constructOnly:!0,nonNullable:!0})],V.prototype,"enableZ",void 0),t([h()],V.prototype,"enableRotation",void 0),t([h()],V.prototype,"enableScaling",void 0),t([h({constructOnly:!0,type:z})],V.prototype,"tooltipOptions",void 0),t([h()],V.prototype,"graphicState",void 0),t([h({value:!1})],V.prototype,"snapToScene",null),t([h({constructOnly:!0})],V.prototype,"snappingManager",void 0),t([h({readOnly:!0})],V.prototype,"type",void 0),t([h({readOnly:!0})],V.prototype,"updating",null),V=t([m("esri.views.3d.interactive.editingTools.graphicTransform3D.GraphicTransformTool")],V);export{V as GraphicTransformTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{HandleOwner as i}from"../../../../../core/HandleOwner.js";import{deg2rad as o,rad2deg as r}from"../../../../../core/mathUtils.js";import{isSome as n,isNone as s,unwrapOr as l}from"../../../../../core/maybe.js";import{when as a,sync as c}from"../../../../../core/reactiveUtils.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";let y=class extends i{constructor(t){super(t),this.sizeAxis=null,this._interactionState=null}initialize(){this.addHandles(a((()=>n(this._interactionState)?this._interactionState.state:null),(t=>{this._updateSymbol(t)}),c))}get angle(){return n(this._interactionState)?this._interactionState.angle:n(this._orientationReferenceSymbolLayer)?g(this._orientationReferenceSymbolLayer.heading):0}get scale(){return n(this._interactionState)?this._interactionState.scale:1}get relativeAngle(){return this.angle-this.initialAngle}get initialAngle(){return n(this._interactionState)?this._interactionState.initialAngle:0}get size(){const t=this._sizeReferenceSymbolLayer;if(s(t))return null;const e=this.findLayerView(),i=this._graphicSymbol;if(s(e)||s(i)||"point-3d"!==i.type)return null;const o=e.getSymbolLayerSize(i,t);if("size"in o&&n(o.size))return o.size;const r=this.sizeAxis;return"width"in o&&n(o.width)&&(s(r)||"width"===r||"all"===r||"width-and-depth"===r)?o.width:"depth"in o&&n(t.depth)&&(s(r)||"depth"===r||"all"===r||"width-and-depth"===r)?o.depth:"height"in o&&n(t.height)&&(s(r)||"height"===r||"all"===r)?o.height:null}get _sizeReferenceSymbolLayer(){const t=this._graphicSymbol;return s(t)||0===t.symbolLayers.length?null:t.symbolLayers.find((t=>"object"===t.type))}get _orientationReferenceSymbolLayer(){const t=this._graphicSymbol;return s(t)||0===t.symbolLayers.length?null:t.symbolLayers.find((t=>"object"===t.type&&n(t.heading)))}get _graphicSymbol(){return n(this.graphic)&&n(this.graphic.symbol)&&"point-3d"===this.graphic.symbol.type?this.graphic.symbol:null}set _graphicSymbol(t){this.graphic.symbol=t}startInteraction(){const t=this._graphicSymbol,e=this.findLayerView();if(n(this._interactionState)||s(t)||s(e))return m;const i=t.symbolLayers.map((i=>"object"===i.type?e.getSymbolLayerSize(t,i):null)).toArray(),o=t.clone(),r=this.angle,l=new d({originalSymbol:o,angle:r,initialSizes:i});this._interactionState=l;const a=()=>this._interactionState=null;return{state:l,done:a,cancel:()=>{this._graphicSymbol=o,a()}}}createUndoRecord(){let t=this.graphic.symbol,e=null;return{undo:i=>{e=i.symbol,i.symbol=t},redo:i=>{t=i.symbol,i.symbol=e}}}_updateSymbol({scale:t,angle:e,originalSymbol:i,initialSizes:o}){const a=this._graphicSymbol;if(s(a)||"point-3d"!==a.type)return;const c=a.clone(),h=-r(e-this.initialAngle);let p=!1;this._forEachObjectSymbolLayerPair(i,c,((e,i,r)=>{const s=l(e.heading,0)+h;i.heading!==s&&(i.heading=s,p=!0);const a=o[r];if(n(a)&&"width"in a){a.width=this.sizeFilter(a.width),a.height=this.sizeFilter(a.height),a.depth=this.sizeFilter(a.depth);const e=a.width*t;i.width!==e&&(i.width=e,p=!0);const o=a.depth*t;i.depth!==o&&(i.depth=o,p=!0);const r=a.height*t;i.height!==r&&(i.height=r,p=!0)}})),p&&(this._graphicSymbol=c)}_forEachObjectSymbolLayerPair(t,e,i){t.symbolLayers.forEach(((t,o)=>{const r=e.symbolLayers.getItemAt(o);"object"===t.type&&"object"===r.type&&i(t,r,o)}))}};function g(t){return-o(t)}t([h()],y.prototype,"angle",null),t([h()],y.prototype,"scale",null),t([h()],y.prototype,"relativeAngle",null),t([h()],y.prototype,"initialAngle",null),t([h()],y.prototype,"size",null),t([h()],y.prototype,"sizeAxis",void 0),t([h({constructOnly:!0})],y.prototype,"graphic",void 0),t([h()],y.prototype,"_interactionState",void 0),t([h({constructOnly:!0})],y.prototype,"findLayerView",void 0),t([h({constructOnly:!0})],y.prototype,"sizeFilter",void 0),t([h()],y.prototype,"_sizeReferenceSymbolLayer",null),t([h()],y.prototype,"_orientationReferenceSymbolLayer",null),t([h()],y.prototype,"_graphicSymbol",null),y=t([p("esri.views.3d.interactive.editingTools.transformGraphic.ScaleRotateObjectSymbol3DAdapter")],y);const m={state:{angle:0,scale:0},done:()=>{},cancel:()=>{}};let d=class extends e{constructor(t){super(t),this.angle=0,this.initialAngle=0,this.scale=1,this.initialAngle=t.angle}get state(){const{originalSymbol:t,angle:e,initialAngle:i,scale:o,initialSizes:r}=this;return{originalSymbol:t,angle:e,initialAngle:i,scale:o,initialSizes:r}}};t([h()],d.prototype,"originalSymbol",void 0),t([h()],d.prototype,"angle",void 0),t([h()],d.prototype,"initialAngle",void 0),t([h()],d.prototype,"initialSizes",void 0),t([h()],d.prototype,"scale",void 0),t([h()],d.prototype,"state",null),d=t([p("InteractionState")],d);export{y as ScaleRotateObjectSymbol3DAdapter,g as headingToAngle};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{HandleOwner as i}from"../../../../../core/HandleOwner.js";import{rad2deg as o,deg2rad as r}from"../../../../../core/mathUtils.js";import{isSome as n,isNone as s,unwrapOr as l}from"../../../../../core/maybe.js";import{when as a,sync as c}from"../../../../../core/reactiveUtils.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";let y=class extends i{constructor(t){super(t),this.sizeAxis=null,this._interactionState=null}initialize(){this.addHandles(a((()=>n(this._interactionState)?this._interactionState.state:null),(t=>{this._updateSymbol(t)}),c))}get angle(){return n(this._interactionState)?this._interactionState.angle:n(this._orientationReferenceSymbolLayer)?g(this._orientationReferenceSymbolLayer.heading):0}get scale(){return n(this._interactionState)?this._interactionState.scale:1}get relativeAngle(){return this.angle-this.initialAngle}get initialAngle(){return n(this._interactionState)?this._interactionState.initialAngle:0}get size(){const t=this._sizeReferenceSymbolLayer;if(s(t))return null;const e=this.findLayerView(),i=this._graphicSymbol;if(s(e)||s(i)||"point-3d"!==i.type)return null;const o=e.getSymbolLayerSize(i,t);if("size"in o&&n(o.size))return o.size;const r=this.sizeAxis;return"width"in o&&n(o.width)&&(s(r)||"width"===r||"all"===r||"width-and-depth"===r)?o.width:"depth"in o&&n(t.depth)&&(s(r)||"depth"===r||"all"===r||"width-and-depth"===r)?o.depth:"height"in o&&n(t.height)&&(s(r)||"height"===r||"all"===r)?o.height:null}get _sizeReferenceSymbolLayer(){const t=this._graphicSymbol;return s(t)||0===t.symbolLayers.length?null:t.symbolLayers.find((t=>"object"===t.type))}get _orientationReferenceSymbolLayer(){const t=this._graphicSymbol;return s(t)||0===t.symbolLayers.length?null:t.symbolLayers.find((t=>"object"===t.type&&n(t.heading)))}get _graphicSymbol(){return n(this.graphic)&&n(this.graphic.symbol)&&"point-3d"===this.graphic.symbol.type?this.graphic.symbol:null}set _graphicSymbol(t){this.graphic.symbol=t}startInteraction(){const t=this._graphicSymbol,e=this.findLayerView();if(n(this._interactionState)||s(t)||s(e))return m;const i=t.symbolLayers.map((i=>"object"===i.type?e.getSymbolLayerSize(t,i):null)).toArray(),o=t.clone(),r=this.angle,l=new d({originalSymbol:o,angle:r,initialSizes:i});this._interactionState=l;const a=()=>this._interactionState=null;return{state:l,done:a,cancel:()=>{this._graphicSymbol=o,a()}}}createUndoRecord(){let t=this.graphic.symbol,e=null;return{undo:i=>{e=i.symbol,i.symbol=t},redo:i=>{t=i.symbol,i.symbol=e}}}_updateSymbol({scale:t,angle:e,originalSymbol:i,initialSizes:r}){const a=this._graphicSymbol;if(s(a)||"point-3d"!==a.type)return;const c=a.clone(),h=-o(e-this.initialAngle);let p=!1;this._forEachObjectSymbolLayerPair(i,c,((e,i,o)=>{const s=l(e.heading,0)+h;i.heading!==s&&(i.heading=s,p=!0);const a=r[o];if(n(a)&&"width"in a){a.width=this.sizeFilter(a.width),a.height=this.sizeFilter(a.height),a.depth=this.sizeFilter(a.depth);const e=a.width*t;i.width!==e&&(i.width=e,p=!0);const o=a.depth*t;i.depth!==o&&(i.depth=o,p=!0);const r=a.height*t;i.height!==r&&(i.height=r,p=!0)}})),p&&(this._graphicSymbol=c)}_forEachObjectSymbolLayerPair(t,e,i){t.symbolLayers.forEach(((t,o)=>{const r=e.symbolLayers.getItemAt(o);"object"===t.type&&"object"===r.type&&i(t,r,o)}))}};function g(t){return-r(t)}t([h()],y.prototype,"angle",null),t([h()],y.prototype,"scale",null),t([h()],y.prototype,"relativeAngle",null),t([h()],y.prototype,"initialAngle",null),t([h()],y.prototype,"size",null),t([h()],y.prototype,"sizeAxis",void 0),t([h({constructOnly:!0})],y.prototype,"graphic",void 0),t([h()],y.prototype,"_interactionState",void 0),t([h({constructOnly:!0})],y.prototype,"findLayerView",void 0),t([h({constructOnly:!0})],y.prototype,"sizeFilter",void 0),t([h()],y.prototype,"_sizeReferenceSymbolLayer",null),t([h()],y.prototype,"_orientationReferenceSymbolLayer",null),t([h()],y.prototype,"_graphicSymbol",null),y=t([p("esri.views.3d.interactive.editingTools.transformGraphic.ScaleRotateObjectSymbol3DAdapter")],y);const m={state:{angle:0,scale:0},done:()=>{},cancel:()=>{}};let d=class extends e{constructor(t){super(t),this.angle=0,this.initialAngle=0,this.scale=1,this.initialAngle=t.angle}get state(){const{originalSymbol:t,angle:e,initialAngle:i,scale:o,initialSizes:r}=this;return{originalSymbol:t,angle:e,initialAngle:i,scale:o,initialSizes:r}}};t([h()],d.prototype,"originalSymbol",void 0),t([h()],d.prototype,"angle",void 0),t([h()],d.prototype,"initialAngle",void 0),t([h()],d.prototype,"initialSizes",void 0),t([h()],d.prototype,"scale",void 0),t([h()],d.prototype,"state",null),d=t([p("InteractionState")],d);export{y as ScaleRotateObjectSymbol3DAdapter,g as headingToAngle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../geometry.js";import e from"../../../../../core/Handles.js";import{unwrap as i,destroyMaybe as s,isNone as n,isSome as a,unwrapOr as r}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as l}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as c}from"../../../../../core/screenUtils.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as p}from"../../../../../chunks/vec3f64.js";import{clonePoint as d}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as m}from"../../../analysis/support/measurementUtils.js";import{screenToMap3D as y,SurfaceType as v,hideManipulatorWhileDragging as P}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as w}from"./DirectLineMeasurement3DView.js";import{PickRequest as _,PickResult as f}from"../support/PickRequest.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{newIntersector as M}from"../../../webgl-engine/lib/Intersector.js";import{StoreResults as b}from"../../../webgl-engine/lib/IntersectorInterfaces.js";import{AnalysisToolBase as j}from"../../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as S,resetProperties as k}from"../../../../interactive/dragEventPipeline.js";import{createScreenPointFromEvent as D}from"../../../../support/screenUtils.js";import R from"../../../../../geometry/Point.js";let T=class extends j{constructor(t){super(t),this._handles=new e,this._cachedPickRequest=null,this._isAnyPointerDown=!1,this.lineState="initial",this.analysisViewData=null,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null}initialize(){const{view:t,analysis:e,analysisViewData:s,cursorPoint:n,visible:a}=this;this.measurementView=new w({toolState:this,view:t,analysis:e,analysisViewData:s,cursorPoint:n,visible:a}),this._intersector=M(this.view.state.viewingMode),this._intersector.options.store=b.MIN;const{start:r,end:c}=this.measurementView.createManipulators(),h=(t,e,s)=>S(t,((t,n,a)=>{const r=P(t);n.next(r).next(y(this.view)).next((t=>"start"!==t.action?t:null)).next((i=>{const n=d(i.mapEnd,new R);this.analysis[e]=n,t.location=n,this[s]=this._surfaceLocation(n,i.surfaceType)})),a.next(r).next(k(this.analysis,[e])).next(k(this,[s])).next((()=>{t.location=i(this.analysis[e])}))})),u=t=>t.events.on("grab-changed",(()=>{const t=r.grabbing||c.grabbing;this.lineState=t?"editing":"measured"}));this._handles.add([h(r,"startPoint","startPointSurfaceLocation"),h(c,"endPoint","endPointSurfaceLocation"),u(r),u(c)]),this.manipulators.add(r),this.manipulators.add(c),this.startManipulator=r,this.endManipulator=c,this._handles.add(o((()=>this.state),(t=>{"measured"===t&&this.finishToolCreation()}),l))}destroy(){this.measurementView=s(this.measurementView),this._handles=s(this._handles)}get state(){return n(this.analysis.startPoint)&&n(this.analysis.endPoint)?"ready":this.validMeasurement&&"editing"!==this.lineState&&"drawing"!==this.lineState?"measured":"measuring"}get cursor(){return"ready"===this.state||"drawing"===this.lineState?"crosshair":null}set cursorPoint(t){this._set("cursorPoint",t),this.measurementView.cursorPoint=t}get validMeasurement(){return a(this.analysis.startPoint)&&a(this.analysis.endPoint)}onShow(){this.measurementView.show(),this._updateManipulatorAvailability()}onHide(){this.measurementView.hide()}onInputEvent(t){switch(t.type){case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t);break;case"pointer-down":this._handlePointerDown();break;case"pointer-up":this._handlePointerUp()}this._updateManipulatorAvailability()}_handlePointerMove(t){this._clearCachedPickRequest();const e=D(t);"mouse"===t.pointerType&&(this._hoverAt(e),"drawing"===this.lineState&&(this.endManipulator.events.emit("drag",{action:"update",start:e,screenPoint:e}),t.stopPropagation()))}_handlePointerDown(){this._isAnyPointerDown=!0}_handlePointerUp(){this._isAnyPointerDown=!1}_handleImmediateClick(t){if(this._clearCachedPickRequest(),!m(t))return;const e=D(t),i=t.pointerType;let s=!1;if(this.active)switch(this.lineState){case"initial":this.startManipulator.events.emit("drag",{action:"start",pointerType:i,start:e,screenPoint:e}),this.startManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),a(this.analysis.startPoint)&&(this.startManipulator.interactive=!1,this.endManipulator.interactive=!1,this.lineState="drawing",this.endManipulator.events.emit("drag",{action:"start",pointerType:i,start:e,screenPoint:e}),s=!0);break;case"drawing":this.endManipulator.events.emit("drag",{action:"update",start:e,screenPoint:e}),a(this.analysis.endPoint)&&(this.endManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),this.startManipulator.interactive=!0,this.endManipulator.interactive=!0,this.lineState="measured",s=!0)}s&&t.stopPropagation(),"mouse"===t.pointerType&&this._hoverAt(e)}_hoverAt(t){const e=this._isAnyPointerDown&&"drawing"!==this.lineState&&"editing"!==this.lineState;if((n(this.analysis.startPoint)||n(this.analysis.endPoint))&&this.active&&!e){const e=this._pick(t);a(e)&&(this.cursorPoint=e)}else this.cursorPoint=null}_pick(t){if(a(this._cachedPickRequest)&&a(this._cachedPickRequest.result)){const e=this._cachedPickRequest.screenPoint;if(e.x===t.x&&e.y===t.y)return this._cachedPickRequest.result.mapPoint}else this._cachedPickRequest=new _(t);const e=c(t);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector);const i=this._intersector.results.min,s=V;if(!i.getIntersectionPoint(s))return null;const n=this.view.renderCoordsHelper.fromRenderCoords(s,this.view.spatialReference);return this._cachedPickRequest.result=new f(s,n),n}_clearCachedPickRequest(){this._cachedPickRequest=null}_surfaceLocation(t,e){return e===v.GROUND?"on-the-surface":t.z>=this._getElevation(t)?"above-the-surface":"below-the-surface"}_updateManipulatorAvailability(){this.startManipulator.available=a(this.analysis.startPoint),this.endManipulator.available=a(this.analysis.endPoint)}_getElevation(t){return this.view.basemapTerrain.ready?r(g(this.view.elevationProvider,t),0):0}};t([h({readOnly:!0})],T.prototype,"state",null),t([h()],T.prototype,"lineState",void 0),t([h({readOnly:!0})],T.prototype,"cursor",null),t([h()],T.prototype,"cursorPoint",null),t([h({constructOnly:!0})],T.prototype,"analysis",void 0),t([h({constructOnly:!0})],T.prototype,"analysisViewData",void 0),t([h()],T.prototype,"measurementView",void 0),t([h({constructOnly:!0})],T.prototype,"view",void 0),t([h({readOnly:!0})],T.prototype,"validMeasurement",null),t([h({value:null})],T.prototype,"startPointSurfaceLocation",void 0),t([h({value:null})],T.prototype,"endPointSurfaceLocation",void 0),T=t([u("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool")],T);const V=p(),q=T;export{q as default};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../geometry.js";import e from"../../../../../core/Handles.js";import{destroyMaybe as i,isNone as s,isSome as n,unwrapOr as a,unwrap as r}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as l}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as c}from"../../../../../core/screenUtils.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as p}from"../../../../../chunks/vec3f64.js";import{clonePoint as d}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as m}from"../../../analysis/support/measurementUtils.js";import{SurfaceType as y,screenToMap3D as v,hideManipulatorWhileDragging as P}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as w}from"./DirectLineMeasurement3DView.js";import{PickRequest as _,PickResult as f}from"../support/PickRequest.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{newIntersector as M}from"../../../webgl-engine/lib/Intersector.js";import{StoreResults as b}from"../../../webgl-engine/lib/IntersectorInterfaces.js";import{AnalysisToolBase as j}from"../../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as S,resetProperties as k}from"../../../../interactive/dragEventPipeline.js";import{createScreenPointFromEvent as D}from"../../../../support/screenUtils.js";import R from"../../../../../geometry/Point.js";let T=class extends j{constructor(t){super(t),this._handles=new e,this._cachedPickRequest=null,this._isAnyPointerDown=!1,this.lineState="initial",this.analysisViewData=null,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null}initialize(){const{view:t,analysis:e,analysisViewData:i,cursorPoint:s,visible:n}=this;this.measurementView=new w({toolState:this,view:t,analysis:e,analysisViewData:i,cursorPoint:s,visible:n}),this._intersector=M(this.view.state.viewingMode),this._intersector.options.store=b.MIN;const{start:a,end:c}=this.measurementView.createManipulators(),h=(t,e,i)=>S(t,((t,s,n)=>{const a=P(t);s.next(a).next(v(this.view)).next((t=>"start"!==t.action?t:null)).next((s=>{const n=d(s.mapEnd,new R);this.analysis[e]=n,t.location=n,this[i]=this._surfaceLocation(n,s.surfaceType)})),n.next(a).next(k(this.analysis,[e])).next(k(this,[i])).next((()=>{t.location=r(this.analysis[e])}))})),u=t=>t.events.on("grab-changed",(()=>{const t=a.grabbing||c.grabbing;this.lineState=t?"editing":"measured"}));this._handles.add([h(a,"startPoint","startPointSurfaceLocation"),h(c,"endPoint","endPointSurfaceLocation"),u(a),u(c)]),this.manipulators.add(a),this.manipulators.add(c),this.startManipulator=a,this.endManipulator=c,this._handles.add(o((()=>this.state),(t=>{"measured"===t&&this.finishToolCreation()}),l))}destroy(){this.measurementView=i(this.measurementView),this._handles=i(this._handles)}get state(){return s(this.analysis.startPoint)&&s(this.analysis.endPoint)?"ready":this.validMeasurement&&"editing"!==this.lineState&&"drawing"!==this.lineState?"measured":"measuring"}get cursor(){return"ready"===this.state||"drawing"===this.lineState?"crosshair":null}set cursorPoint(t){this._set("cursorPoint",t),this.measurementView.cursorPoint=t}get validMeasurement(){return n(this.analysis.startPoint)&&n(this.analysis.endPoint)}onShow(){this.measurementView.show(),this._updateManipulatorAvailability()}onHide(){this.measurementView.hide()}onInputEvent(t){switch(t.type){case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t);break;case"pointer-down":this._handlePointerDown();break;case"pointer-up":this._handlePointerUp()}this._updateManipulatorAvailability()}_handlePointerMove(t){this._clearCachedPickRequest();const e=D(t);"mouse"===t.pointerType&&(this._hoverAt(e),"drawing"===this.lineState&&(this.endManipulator.events.emit("drag",{action:"update",start:e,screenPoint:e}),t.stopPropagation()))}_handlePointerDown(){this._isAnyPointerDown=!0}_handlePointerUp(){this._isAnyPointerDown=!1}_handleImmediateClick(t){if(this._clearCachedPickRequest(),!m(t))return;const e=D(t),i=t.pointerType;let s=!1;if(this.active)switch(this.lineState){case"initial":this.startManipulator.events.emit("drag",{action:"start",pointerType:i,start:e,screenPoint:e}),this.startManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),n(this.analysis.startPoint)&&(this.startManipulator.interactive=!1,this.endManipulator.interactive=!1,this.lineState="drawing",this.endManipulator.events.emit("drag",{action:"start",pointerType:i,start:e,screenPoint:e}),s=!0);break;case"drawing":this.endManipulator.events.emit("drag",{action:"update",start:e,screenPoint:e}),n(this.analysis.endPoint)&&(this.endManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),this.startManipulator.interactive=!0,this.endManipulator.interactive=!0,this.lineState="measured",s=!0)}s&&t.stopPropagation(),"mouse"===t.pointerType&&this._hoverAt(e)}_hoverAt(t){const e=this._isAnyPointerDown&&"drawing"!==this.lineState&&"editing"!==this.lineState;if((s(this.analysis.startPoint)||s(this.analysis.endPoint))&&this.active&&!e){const e=this._pick(t);n(e)&&(this.cursorPoint=e)}else this.cursorPoint=null}_pick(t){if(n(this._cachedPickRequest)&&n(this._cachedPickRequest.result)){const e=this._cachedPickRequest.screenPoint;if(e.x===t.x&&e.y===t.y)return this._cachedPickRequest.result.mapPoint}else this._cachedPickRequest=new _(t);const e=c(t);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector);const i=this._intersector.results.min,s=V;if(!i.getIntersectionPoint(s))return null;const a=this.view.renderCoordsHelper.fromRenderCoords(s,this.view.spatialReference);return this._cachedPickRequest.result=new f(s,a),a}_clearCachedPickRequest(){this._cachedPickRequest=null}_surfaceLocation(t,e){return e===y.GROUND?"on-the-surface":t.z>=this._getElevation(t)?"above-the-surface":"below-the-surface"}_updateManipulatorAvailability(){this.startManipulator.available=n(this.analysis.startPoint),this.endManipulator.available=n(this.analysis.endPoint)}_getElevation(t){return this.view.basemapTerrain.ready?a(g(this.view.elevationProvider,t),0):0}};t([h({readOnly:!0})],T.prototype,"state",null),t([h()],T.prototype,"lineState",void 0),t([h({readOnly:!0})],T.prototype,"cursor",null),t([h()],T.prototype,"cursorPoint",null),t([h({constructOnly:!0})],T.prototype,"analysis",void 0),t([h({constructOnly:!0})],T.prototype,"analysisViewData",void 0),t([h()],T.prototype,"measurementView",void 0),t([h({constructOnly:!0})],T.prototype,"view",void 0),t([h({readOnly:!0})],T.prototype,"validMeasurement",null),t([h({value:null})],T.prototype,"startPointSurfaceLocation",void 0),t([h({value:null})],T.prototype,"endPointSurfaceLocation",void 0),T=t([u("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool")],T);const V=p(),q=T;export{q as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as t,isNone as s,isSome as o}from"../../../core/maybe.js";import{watch as i,initial as a,when as l,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGeometry as c}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as m}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import{FeatureLikeLayerView3D as h}from"./FeatureLikeLayerView3D.js";import{LayerView3D as d}from"./LayerView3D.js";import{FeatureTileFetcher3DLayerViewContext as y}from"./support/FeatureTileFetcher3DLayerViewContext.js";import{EventedSet as f}from"../support/EventedSet.js";import{updatingProgress as g}from"../support/updatingProperties.js";import{UpdatePolicy as F}from"../webgl-engine/lib/basicInterfaces.js";import x from"../../layers/FeatureLayerView.js";import b from"../../layers/LayerView.js";import M from"../../layers/RefreshableLayerView.js";let _=class extends(M(h(x(d(b))))){constructor(e){super(e),this._controllerTotal=0,this._processorTotal=0,this.suspendResumeExtentMode="data"}initialize(){this.handles.add(i((()=>this._updatingRequiredFieldsPromise),(e=>this.updatingHandles.addPromise(e)),n))}destroy(){this.updatingHandles.removeAll(),this.handles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.controller?.maximumNumberOfFeatures??this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(e){this._set("maximumNumberOfFeatures",e),this.controller&&(this.controller.maximumNumberOfFeatures=e)}get maximumNumberOfFeaturesExceeded(){return!!this.controller&&!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded)}get updatingProgressValue(){let e=0;if(this.controller?.updating){const r=this.controller.updatingRemaining,t=Math.max(this.controller.updatingTotal,this._controllerTotal);t>0&&(e=(t-r)/t,this._controllerTotal=t)}let r=0;if(this.processor?.updating){const e=this.processor.updatingRemaining,t=Math.max(e,this._processorTotal);t>0&&(r=(t-e)/t,this._processorTotal=t)}return.5*(e+r)}get updatePolicy(){if(!this.controller)return F.ASYNC;switch(this.controller.mode){case"snapshot":{const e=j[this.layer.geometryType];return null==e||this.controller.serviceDataCount>e?F.ASYNC:F.SYNC}case"tiles":return F.ASYNC}}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){this.processor?.setObjectIdVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}beforeSetController(e){e.maximumNumberOfFeatures=this.maximumNumberOfFeatures}createController(){this._fetcherContext=new y({layerView:this,returnZ:this.hasZ,returnM:this.hasM});const e=new m({layerView:this,context:this._fetcherContext,graphics:new f,extent:this.clippingExtent});return this.updatingHandles.add((()=>e.serviceDataExtent),(e=>{this.processor&&(this.processor.dataExtent=e)}),a),this.handles.add(i((()=>this.suspended),(r=>{r?e.suspend():e.resume()}),n)),this.updatingHandles.add((()=>this.processor?.displayFeatureLimit),(r=>e.displayFeatureLimit=r),a),this.handles.add(l((()=>!this.updating),(()=>{this._controllerTotal=0,this._processorTotal=0}))),e}async doRefresh(e){e&&!this.suspended&&this.controller&&this.controller.refetch(),this.processor.refreshFilter()}getUsedMemory(){return(this.processor?.usedMemory??0)+(this.controller?.memoryForUnusedFeatures??0)}getUnloadedMemory(){return(this.processor?.unprocessedMemoryEstimate??0)+(this.controller?.expectedFeatureDiff*this.processor?.usedMemoryPerFeature??0)}ignoresMemoryFactor(){return this.controller?.hasMaximumNumberOfFeaturesOverride}async _queryFeaturesMesh(e,r){await this._validateQueryFeaturesMesh(e);const t=await r();if(e&&e.outStatistics||s(this.graphics3DProcessor))return t;const o=this.layer.objectIdField,i=this.graphics3DProcessor.graphics3DGraphicsByObjectID,a=[];for(const s of t.features)if(s.geometry){const e=i.get(s.attributes[o]);e&&(s.geometry=c(e.graphic.geometry),a.push(s))}else a.push(s);return t.features=a,t}async _validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},s=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of s)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),o(e.outSpatialReference)&&!e.outSpatialReference.equals(this.view.spatialReference)&&t("outSpatialReference")}get performanceInfo(){const e=this.controller?.displayFeatureLimit,r=o(e)&&e.averageSymbolComplexity,t=o(r)?`f:${r.primitivesPerFeature},v:${r.primitivesPerCoordinate}`:"n/a",s={...this._getResourceInfo(),storedFeatures:0,totalVertices:0,partial:this.maximumNumberOfFeaturesExceeded,mode:this.controller?.mode??"n/a",symbolComplexity:t,nodes:this.controller?.tileDescriptors.length??0};if(this.controller&&s.displayedNumberOfFeatures){const e=this.controller.debug;s.storedFeatures=e.storedFeatures,s.totalVertices=e.totalVertices}return s}get test(){return{updatePolicy:this.updatePolicy,controller:this.controller,loadedGraphics:this.controller?.graphics}}};e([u()],_.prototype,"layer",void 0),e([u()],_.prototype,"controller",void 0),e([u()],_.prototype,"_controllerTotal",void 0),e([u()],_.prototype,"_processorTotal",void 0),e([u()],_.prototype,"maximumNumberOfFeatures",null),e([u()],_.prototype,"maximumNumberOfFeaturesExceeded",null),e([u(g)],_.prototype,"updatingProgress",void 0),e([u({readOnly:!0})],_.prototype,"updatingProgressValue",null),e([u({readOnly:!0})],_.prototype,"updatePolicy",null),e([u({readOnly:!0})],_.prototype,"hasZ",null),e([u({readOnly:!0})],_.prototype,"hasM",null),e([u()],_.prototype,"suspendResumeExtentMode",void 0),_=e([p("esri.views.3d.layers.FeatureLayerViewBase3D")],_);const j={point:5e3,polygon:500,polyline:1e3},O=_;export{O as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as t,isNone as s,isSome as o}from"../../../core/maybe.js";import{watch as i,initial as a,when as l,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGeometry as c}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as m}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import{FeatureLikeLayerView3D as h}from"./FeatureLikeLayerView3D.js";import{LayerView3D as d}from"./LayerView3D.js";import{FeatureTileFetcher3DLayerViewContext as y}from"./support/FeatureTileFetcher3DLayerViewContext.js";import{EventedSet as f}from"../support/EventedSet.js";import{updatingProgress as g}from"../support/updatingProperties.js";import{UpdatePolicy as F}from"../webgl-engine/lib/basicInterfaces.js";import x from"../../layers/FeatureLayerView.js";import b from"../../layers/LayerView.js";import M from"../../layers/RefreshableLayerView.js";let _=class extends(M(h(x(d(b))))){constructor(e){super(e),this._controllerTotal=0,this._processorTotal=0,this.suspendResumeExtentMode="data"}initialize(){this.handles.add(i((()=>this._updatingRequiredFieldsPromise),(e=>this.updatingHandles.addPromise(e)),n))}destroy(){this.updatingHandles.removeAll(),this.handles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.controller?.maximumNumberOfFeatures??this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(e){this._set("maximumNumberOfFeatures",e),this.controller&&(this.controller.maximumNumberOfFeatures=e)}get maximumNumberOfFeaturesExceeded(){return!!this.controller&&!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded)}get updatingProgressValue(){let e=0;if(this.controller?.updating){const r=this.controller.updatingRemaining,t=Math.max(this.controller.updatingTotal,this._controllerTotal);t>0&&(e=(t-r)/t,this._controllerTotal=t)}let r=0;if(this.processor?.updating){const e=this.processor.updatingRemaining,t=Math.max(e,this._processorTotal);t>0&&(r=(t-e)/t,this._processorTotal=t)}return.5*(e+r)}get updatePolicy(){if(!this.controller)return F.ASYNC;switch(this.controller.mode){case"snapshot":{const e=j[this.layer.geometryType];return null==e||this.controller.serviceDataCount>e?F.ASYNC:F.SYNC}case"tiles":return F.ASYNC}}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){this.processor?.setObjectIdVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}beforeSetController(e){e.maximumNumberOfFeatures=this.maximumNumberOfFeatures}createController(){this._fetcherContext=new y({layerView:this,returnZ:this.hasZ,returnM:this.hasM});const e=new m({layerView:this,context:this._fetcherContext,graphics:new f,extent:this.clippingExtent});return this.updatingHandles.add((()=>e.serviceDataExtent),(e=>{this.processor&&(this.processor.dataExtent=e)}),a),this.handles.add(i((()=>this.suspended),(r=>{r?e.suspend():e.resume()}),n)),this.updatingHandles.add((()=>this.processor?.displayFeatureLimit),(r=>e.displayFeatureLimit=r),a),this.handles.add(l((()=>!this.updating),(()=>{this._controllerTotal=0,this._processorTotal=0}))),e}async doRefresh(e){e&&!this.suspended&&this.controller&&this.controller.refetch(),this.processor.refreshFilter()}getUsedMemory(){return(this.processor?.usedMemory??0)+(this.controller?.memoryForUnusedFeatures??0)}getUnloadedMemory(){return(this.processor?.unprocessedMemoryEstimate??0)+(this.controller?.expectedFeatureDiff??0)*(this.processor?.usedMemoryPerFeature??0)}ignoresMemoryFactor(){return this.controller?.hasMaximumNumberOfFeaturesOverride}async _queryFeaturesMesh(e,r){await this._validateQueryFeaturesMesh(e);const t=await r();if(e&&e.outStatistics||s(this.graphics3DProcessor))return t;const o=this.layer.objectIdField,i=this.graphics3DProcessor.graphics3DGraphicsByObjectID,a=[];for(const s of t.features)if(s.geometry){const e=i.get(s.attributes[o]);e&&(s.geometry=c(e.graphic.geometry),a.push(s))}else a.push(s);return t.features=a,t}async _validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},s=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of s)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),o(e.outSpatialReference)&&!e.outSpatialReference.equals(this.view.spatialReference)&&t("outSpatialReference")}get performanceInfo(){const e=this.controller?.displayFeatureLimit,r=o(e)&&e.averageSymbolComplexity,t=o(r)?`f:${r.primitivesPerFeature},v:${r.primitivesPerCoordinate}`:"n/a",s={...this._getResourceInfo(),storedFeatures:0,totalVertices:0,partial:this.maximumNumberOfFeaturesExceeded,mode:this.controller?.mode??"n/a",symbolComplexity:t,nodes:this.controller?.tileDescriptors.length??0};if(this.controller&&s.displayedNumberOfFeatures){const e=this.controller.debug;s.storedFeatures=e.storedFeatures,s.totalVertices=e.totalVertices}return s}get test(){return{updatePolicy:this.updatePolicy,controller:this.controller,loadedGraphics:this.controller?.graphics}}};e([u()],_.prototype,"layer",void 0),e([u()],_.prototype,"controller",void 0),e([u()],_.prototype,"_controllerTotal",void 0),e([u()],_.prototype,"_processorTotal",void 0),e([u()],_.prototype,"maximumNumberOfFeatures",null),e([u()],_.prototype,"maximumNumberOfFeaturesExceeded",null),e([u(g)],_.prototype,"updatingProgress",void 0),e([u({readOnly:!0})],_.prototype,"updatingProgressValue",null),e([u({readOnly:!0})],_.prototype,"updatePolicy",null),e([u({readOnly:!0})],_.prototype,"hasZ",null),e([u({readOnly:!0})],_.prototype,"hasM",null),e([u()],_.prototype,"suspendResumeExtentMode",void 0),_=e([p("esri.views.3d.layers.FeatureLayerViewBase3D")],_);const j={point:5e3,polygon:500,polyline:1e3},O=_;export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{destroyMaybe as s,isSome as r}from"../../../core/maybe.js";import{when as t}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as a}from"./LayerView3D.js";import{GraphicsProcessor as n}from"./graphics/GraphicsProcessor.js";import{toViewIfLocal as p}from"./support/projectExtentUtils.js";import{UpdatePolicy as l}from"../webgl-engine/lib/basicInterfaces.js";import c from"../../layers/LayerView.js";let u=class extends(a(c)){constructor(){super(...arguments),this.type="graphics-3d",this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set("processor",new n({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.handles.add(this.layer.on("graphic-update",(e=>this.processor.graphicsCore.graphicUpdateHandler(e)))),this.addResolvingPromise(p(this).then((e=>this.fullExtentInLocalViewSpatialReference=e))),this.layer.internal?this.notifyChange("updating"):this.handles.add(t((()=>this.view?.basemapTerrain?.ready),(()=>()=>this.notifyChange("updating")),{once:!0}))}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("processor",s(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.processor?.frustumVisibilitySuspended}getSuspendInfo(){const e=super.getSuspendInfo();return e.outsideScaleRange=this.processor?.scaleVisibilitySuspended??!1,e.outsideOfView=this.processor?.frustumVisibilitySuspended??!1,e}async fetchPopupFeatures(e,s){return r(s)?s.clientGraphics:null}getHit(e){return this.processor.getHit(e)}whenGraphicBounds(e,s){return this.processor.whenGraphicBounds(e,s)}computeAttachmentOrigin(e,s){return this.processor?.computeAttachmentOrigin(e,s)}getSymbolLayerSize(e,s){return this.processor.getSymbolLayerSize(e,s)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e){return this.processor.highlight(e)}get updatePolicy(){return this.processor?.graphicsCore.effectiveUpdatePolicy||l.SYNC}canResume(){return super.canResume()&&!this.processor?.scaleVisibilitySuspended}isUpdating(){return!(!this.processor?.updating&&(this.layer.internal||this.view?.basemapTerrain?.ready))}get performanceInfo(){return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:this.processor?.elevationAlignment.updating??!1,visibilityFrustum:!this.processor?.frustumVisibilitySuspended??!1}}};e([i()],u.prototype,"loadedGraphics",null),e([i({readOnly:!0})],u.prototype,"legendEnabled",null),e([i()],u.prototype,"layer",void 0),e([i({readOnly:!0})],u.prototype,"processor",void 0),e([i({type:Boolean})],u.prototype,"slicePlaneEnabled",void 0),u=e([o("esri.views.3d.layers.GraphicsLayerView3D")],u);const h=u;export{h as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{destroyMaybe as s,isSome as r}from"../../../core/maybe.js";import{when as t}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as a}from"./LayerView3D.js";import{GraphicsProcessor as n}from"./graphics/GraphicsProcessor.js";import{toViewIfLocal as p}from"./support/projectExtentUtils.js";import{UpdatePolicy as l}from"../webgl-engine/lib/basicInterfaces.js";import c from"../../layers/LayerView.js";let u=class extends(a(c)){constructor(){super(...arguments),this.type="graphics-3d",this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set("processor",new n({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.handles.add(this.layer.on("graphic-update",(e=>this.processor.graphicsCore.graphicUpdateHandler(e)))),this.addResolvingPromise(p(this).then((e=>this.fullExtentInLocalViewSpatialReference=e))),this.layer.internal?this.notifyChange("updating"):this.handles.add(t((()=>this.view?.basemapTerrain?.ready),(()=>()=>this.notifyChange("updating")),{once:!0}))}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("processor",s(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.processor?.frustumVisibilitySuspended}getSuspendInfo(){const e=super.getSuspendInfo();return e.outsideScaleRange=this.processor?.scaleVisibilitySuspended??!1,e.outsideOfView=this.processor?.frustumVisibilitySuspended??!1,e}async fetchPopupFeatures(e,s){return r(s)?s.clientGraphics:null}getHit(e){return this.processor.getHit(e)}whenGraphicBounds(e,s){return this.processor.whenGraphicBounds(e,s)}computeAttachmentOrigin(e,s){return this.processor?.computeAttachmentOrigin(e,s)}getSymbolLayerSize(e,s){return this.processor.getSymbolLayerSize(e,s)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e){return this.processor.highlight(e)}get updatePolicy(){return this.processor?.graphicsCore.effectiveUpdatePolicy||l.SYNC}canResume(){return super.canResume()&&!this.processor?.scaleVisibilitySuspended}isUpdating(){return!(!this.processor?.updating&&(this.layer.internal||this.view?.basemapTerrain?.ready))}get performanceInfo(){return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:this.processor?.elevationAlignment.updating??!1,visibilityFrustum:!this.processor?.frustumVisibilitySuspended}}};e([i()],u.prototype,"loadedGraphics",null),e([i({readOnly:!0})],u.prototype,"legendEnabled",null),e([i()],u.prototype,"layer",void 0),e([i({readOnly:!0})],u.prototype,"processor",void 0),e([i({type:Boolean})],u.prototype,"slicePlaneEnabled",void 0),u=e([o("esri.views.3d.layers.GraphicsLayerView3D")],u);const h=u;export{h as default};