@arcgis/core 4.33.0-next.20250324 → 4.33.0-next.20250326

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 (237) hide show
  1. package/arcade/arcadeAsyncRuntime.js +1 -1
  2. package/arcade/arcadeCompiler.js +1 -1
  3. package/arcade/arcadeRuntime.js +1 -1
  4. package/arcade/containerUtils.js +1 -1
  5. package/arcade/functions/date.js +1 -1
  6. package/arcade/functions/feature.js +1 -1
  7. package/arcade/functions/featuresetbase.js +1 -1
  8. package/arcade/functions/featuresetgeom.js +1 -1
  9. package/arcade/functions/featuresetstats.js +1 -1
  10. package/arcade/functions/featuresetstring.js +1 -1
  11. package/arcade/functions/fieldStats.js +1 -1
  12. package/arcade/functions/geomasync.js +1 -1
  13. package/arcade/functions/geometry.js +1 -1
  14. package/arcade/functions/geomsync.js +1 -1
  15. package/arcade/functions/knowledgegraph.js +1 -1
  16. package/arcade/functions/maths.js +1 -1
  17. package/arcade/functions/stats.js +1 -1
  18. package/arcade/functions/string.js +1 -1
  19. package/arcade/geometry/functions.js +1 -1
  20. package/arcade/languageUtils.js +1 -1
  21. package/assets/esri/core/workers/RemoteClient.js +1 -1
  22. package/assets/esri/core/workers/chunks/0059295780fa4a090f30.js +319 -0
  23. package/assets/esri/core/workers/chunks/{8f4bcca8b0525e19374f.js → 042771b4e56355924140.js} +1 -1
  24. package/assets/esri/core/workers/chunks/09c9e4e94f09ba9f4c22.js +1 -0
  25. package/assets/esri/core/workers/chunks/{3bea1400160042dca9f3.js → 0e82365be7d9257e7cb2.js} +1 -1
  26. package/assets/esri/core/workers/chunks/1dd6d68d23ba07587ae4.js +1 -0
  27. package/assets/esri/core/workers/chunks/{fef46b841e8369b30227.js → 2873cb727c59328074db.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3808f10747cecc8a1a9b.js +1 -0
  29. package/assets/esri/core/workers/chunks/{9cfce9414b874878d761.js → 4dc1e7d7ac2a4b0144c4.js} +96 -96
  30. package/assets/esri/core/workers/chunks/{e5e1f8ac53c70427a60b.js → 59e4e780dcdfed555ca5.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{33005043f7084048296d.js → 6ab96eaaad0aaad46db9.js} +1 -1
  32. package/assets/esri/core/workers/chunks/705c1ebb327f680f8519.js +1 -0
  33. package/assets/esri/core/workers/chunks/{bd2dcc55ac3418421ee5.js → 726e3f413824f02fe689.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{4c9160e3d596fe75392d.js → 75ec4d2ae9d427a1434f.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{11f9d7cd95891596b716.js → 77199b4b39ee8b4303de.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{74c01de62ccaed0666e0.js → 81f2f1614ea27f4c2e65.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{d787474e78360c925fd9.js → a59ad50d932da1e28c8f.js} +1 -1
  38. package/assets/esri/core/workers/chunks/afe94e351b4a50d7bc53.js +1 -0
  39. package/assets/esri/core/workers/chunks/{47c04980098dc0c228d7.js → b02ac03503bfff1ff922.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{cbbbaccc0d3683e1c0fe.js → b8a4352f83502449ff95.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{605eddec7aac891ed141.js → ba47e43ef039fe4b8c5c.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{3ee000c92e4d5d21e22d.js → bc3f42401131a12fce9b.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{2cedf4222238c86a98e8.js → c6bcfa99fb222894fa0e.js} +1 -1
  44. package/assets/esri/core/workers/chunks/cb386923200272cf26a9.js +1 -0
  45. package/assets/esri/core/workers/chunks/{a2377969f76640f1d6fe.js → d5d2a4e8e19898d86c6d.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{5f8028928ae8e5d27dda.js → e088edb9ffbaa1ed12eb.js} +1 -1
  47. package/assets/esri/core/workers/chunks/ed831e51c2a03ee95879.js +1 -0
  48. package/assets/esri/core/workers/chunks/{3e9cd82325c473ddbf1f.js → edcc0fefd57323d2cb67.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{065ae931b5891847a06f.js → f28eaf1d3a7f12788bcf.js} +1 -1
  50. package/assets/esri/core/workers/chunks/f9396af9cbfd165e72e2.js +1 -0
  51. package/assets/esri/core/workers/chunks/{f86736a60856ef7fdacb.js → fa3eeb40e2d732c184d8.js} +1 -1
  52. package/chunks/BloomBlur.glsl.js +1 -1
  53. package/chunks/BloomComposition.glsl.js +2 -2
  54. package/chunks/ComponentShader.glsl.js +24 -25
  55. package/chunks/HighlightApply.glsl.js +1 -1
  56. package/chunks/HighlightDownsample.glsl.js +1 -1
  57. package/chunks/HighlightToSingle.glsl.js +1 -1
  58. package/chunks/LineSeries.js +1 -1
  59. package/chunks/ShadowHighlight.glsl.js +1 -1
  60. package/chunks/Theme.js +1 -1
  61. package/chunks/Tick.js +1 -1
  62. package/chunks/WaterSurface.glsl.js +1 -1
  63. package/chunks/aiServices.js +1 -1
  64. package/chunks/array.js +1 -1
  65. package/chunks/chartUtilsAm5.js +1 -1
  66. package/chunks/languageUtils.js +1 -1
  67. package/chunks/nl_NL.js +1 -1
  68. package/chunks/vec32.js +1 -1
  69. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  70. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  71. package/geometry/operators/projectOperator.js +1 -1
  72. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  73. package/geometry/support/buffer/BufferView.js +1 -1
  74. package/geometry/support/meshUtils/merge.js +1 -1
  75. package/interfaces.d.ts +17 -17
  76. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  77. package/package.json +1 -1
  78. package/rest/support/DirectionLine.js +1 -1
  79. package/rest/support/DirectionPoint.js +1 -1
  80. package/rest/support/PointBarrier.js +1 -1
  81. package/rest/support/PolygonBarrier.js +1 -1
  82. package/rest/support/PolylineBarrier.js +1 -1
  83. package/rest/support/RasterData.js +1 -1
  84. package/rest/support/RouteInfo.js +1 -1
  85. package/rest/support/Stop.js +1 -1
  86. package/support/revision.js +1 -1
  87. package/views/2d/LabelManager.js +1 -1
  88. package/views/2d/engine/vectorTiles/Placement.js +1 -1
  89. package/views/2d/engine/vectorTiles/SourceLayerData.js +1 -1
  90. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  91. package/views/2d/engine/vectorTiles/TileManager.js +1 -1
  92. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  93. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  94. package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
  95. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  96. package/views/2d/engine/vectorTiles/buckets/BaseBucket.js +1 -1
  97. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  98. package/views/2d/engine/vectorTiles/constants.js +5 -0
  99. package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +5 -0
  100. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  101. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  102. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  103. package/views/2d/engine/vectorTiles/decluttering/core.js +1 -1
  104. package/views/2d/engine/vectorTiles/decluttering/jobsUtil.js +1 -1
  105. package/views/2d/engine/vectorTiles/decluttering/util.js +1 -1
  106. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  107. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  108. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  109. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  110. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  111. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  112. package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
  113. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
  114. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  115. package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
  116. package/views/2d/engine/webgl/mesh/meshDebugUtils.js +1 -1
  117. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  118. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  119. package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
  120. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  121. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  122. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/AlignedVertexSpec.js +1 -1
  123. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  124. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  125. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  126. package/views/2d/layers/MediaLayerView2D.js +1 -1
  127. package/views/2d/layers/RouteLayerView2D.js +1 -1
  128. package/views/2d/layers/TileLayerView2D.js +1 -1
  129. package/views/2d/layers/features/FeatureContainer.js +1 -1
  130. package/views/2d/layers/features/RenderState.js +1 -1
  131. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  132. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  133. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  134. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  135. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  136. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  137. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  138. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  139. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  140. package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
  141. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  142. package/views/2d/layers/features/schema/processor/SubtypeProcessorSchema.js +1 -1
  143. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  144. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  145. package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
  146. package/views/2d/tiling/FeatureTileSubscriptionManager.js +1 -1
  147. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  148. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  149. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
  150. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  151. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  152. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  153. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  154. package/views/3d/layers/I3SMeshView3D.js +1 -1
  155. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  156. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  157. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  158. package/views/3d/layers/graphics/Labeler.js +1 -1
  159. package/views/3d/layers/graphics/deconflictorDebug.js +1 -1
  160. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  161. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  162. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  163. package/views/3d/support/QualitySettings.js +1 -1
  164. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  165. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  166. package/views/3d/terrain/OverlayRenderer.js +1 -1
  167. package/views/3d/terrain/PatchRenderData.js +1 -1
  168. package/views/3d/terrain/SphericalPatch.js +1 -1
  169. package/views/3d/terrain/TerrainRenderer.js +1 -1
  170. package/views/3d/terrain/TileCompositor.js +1 -1
  171. package/views/3d/webgl-engine/core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js +1 -1
  172. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoubleConfiguration.js +1 -1
  173. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +4 -4
  174. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  175. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +9 -9
  176. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +2 -2
  177. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
  178. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
  179. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +6 -6
  180. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +1 -1
  181. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +1 -1
  182. package/views/3d/webgl-engine/core/shaderModules/{UintTexture2DBindUniform.js → Texture2DUintBindUniform.js} +1 -1
  183. package/views/3d/webgl-engine/core/shaderModules/{UintTexture2DPassUniform.js → Texture2DUintPassUniform.js} +1 -1
  184. package/views/3d/webgl-engine/effects/bloom/BloomBlur.glsl.js +1 -1
  185. package/views/3d/webgl-engine/effects/bloom/BloomBlurTechnique.js +1 -1
  186. package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +1 -1
  187. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +1 -1
  188. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  189. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  190. package/views/3d/webgl-engine/lib/Program.js +1 -1
  191. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  192. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  193. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  194. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  195. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  196. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  197. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  198. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  199. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  200. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  201. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  202. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  203. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  204. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  205. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  206. package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +1 -1
  207. package/views/3d/webgl-engine/shaders/HighlightToSingle.glsl.js +1 -1
  208. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  209. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  210. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  211. package/views/VideoView.js +1 -1
  212. package/views/interactive/SegmentLabels.js +1 -1
  213. package/views/interactive/coordinateHelper.js +1 -1
  214. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  215. package/views/interactive/sketch/constraints.js +1 -1
  216. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  217. package/views/support/geometry3dUtils.js +1 -1
  218. package/views/webgl/ShaderBuilder.js +1 -1
  219. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  220. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  221. package/assets/esri/core/workers/chunks/0e164b19e4ea3aa73843.js +0 -1
  222. package/assets/esri/core/workers/chunks/1034155c525d2b7baaa1.js +0 -1
  223. package/assets/esri/core/workers/chunks/2b9ce6648823f6962f58.js +0 -1
  224. package/assets/esri/core/workers/chunks/88a7780b1c689afff8bd.js +0 -1
  225. package/assets/esri/core/workers/chunks/ac6b582ca180210e596c.js +0 -1
  226. package/assets/esri/core/workers/chunks/accd0661a6dd297fab6b.js +0 -1
  227. package/assets/esri/core/workers/chunks/b5f44cf03c4e5cc07bc4.js +0 -1
  228. package/assets/esri/core/workers/chunks/bfbb118ae3b4a4ce1c74.js +0 -319
  229. package/assets/esri/core/workers/chunks/fa7ddf3c89cdb8052b26.js +0 -1
  230. package/chunks/BloomDepthAdjust.glsl.js +0 -14
  231. package/views/2d/engine/vectorTiles/decluttering/jobs.js +0 -5
  232. package/views/2d/engine/webgl/collisions/CollisionEngine.js +0 -5
  233. package/views/2d/engine/webgl/collisions/CollisionGrid.js +0 -5
  234. package/views/3d/webgl-engine/core/shaderModules/TextureCubeBindUniform.js +0 -5
  235. package/views/3d/webgl-engine/core/shaderModules/UintTexture2DDrawUniform.js +0 -5
  236. package/views/3d/webgl-engine/effects/bloom/BloomDepthAdjust.glsl.js +0 -5
  237. package/views/3d/webgl-engine/effects/bloom/BloomDepthAdjustTechnique.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"./DebugOverlay.js";function t(t,r){t.container.addChild(new e({getMesh:e=>o(t,e,r),getColors:s,getOpacities:n}))}const o=(t,o,s)=>{const{pixelRatio:n}=o.state;let r=0;const c=[],a=[];for(const l of t._vectorTileContainer.children)if(l.symbols)for(const t of l.symbols.values())for(const o of t)for(const t of o.colliders){const i=(t.xScreen+t.dxScreen)*n,l=(t.yScreen+t.dyScreen)*n,u=t.width*n,f=t.height*n,p=o.unique.parts[t.partIndex].targetOpacity>.5;if(!p&&"all"!==s)continue;const h=3,d=1,g=3,y=0,m=p?2:0,x=p?3:0,v=e.makeFlags(m,x);c.push(i,l,v,i+u,l,v,i,l+f,v,i+u,l+f,v),a.push(r,r+1,r+2,r+1,r+3,r+2),r+=4;const b=p?h:d,w=p?g:y,C=e.makeFlags(b,w);c.push(i,l,C,i+u,l,C,i,l+1,C,i+u,l+1,C),a.push(r,r+1,r+2,r+1,r+3,r+2),r+=4,c.push(i,l+f-1,C,i+u,l+f-1,C,i,l+f,C,i+u,l+f,C),a.push(r,r+1,r+2,r+1,r+3,r+2),r+=4,c.push(i,l,C,i+1,l,C,i,l+f,C,i+1,l+f,C),a.push(r,r+1,r+2,r+1,r+3,r+2),r+=4,c.push(i+u-1,l,C,i+u,l,C,i+u-1,l+f,C,i+u,l+f,C),a.push(r,r+1,r+2,r+1,r+3,r+2),r+=4}const{symbolFader:i}=t._vectorTileContainer;if(i){const[t,o]=i.decluttererOffset,s=e.makeFlags(2,3),n=256,l=256,u=n+t,f=l+o;for(const e of[-3,3])for(const t of[-3,3])c.push(n,l,s,n+e,l+t,s,u,f,s,u+e,f+t,s),a.push(r,r+1,r+2,r+1,r+3,r+2),r+=4}return{vertexData:new Int16Array(c),indexData:new Uint32Array(a)}},s=()=>[1,.5,0,1,1,0,0,1,0,1,.5,1,0,.5,0,1],n=()=>[.05,.01,.15,.2];export{t as showCollisionBoxes};
5
+ import e from"./DebugOverlay.js";function t(t,a){t.container.addChild(new e({getMesh:e=>"feature"===t.layer.type?n(t,e,a):o(t,e,a),getColors:s,getOpacities:i}))}const a=(t,a,r)=>{let n=0;const o=[],s=[];for(const i of t.children)if(i.symbols)for(const u of i.symbols.values())for(const i of u)for(const u of i.colliders(t)){const t=(u.xScreen+u.dxScreen)*a,x=(u.yScreen+u.dyScreen)*a,c=u.width*a,l=u.height*a,p=i.unique?.parts[u.partIndex].targetOpacity>.5;if(!p&&"all"!==r)continue;const d=3,f=1,h=3,v=0,D=p?2:0,y=p?3:0,g=e.makeFlags(D,y);o.push(t,x,g,t+c,x,g,t,x+l,g,t+c,x+l,g),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4;const C=p?d:f,m=p?h:v,w=e.makeFlags(C,m);o.push(t,x,w,t+c,x,w,t,x+1,w,t+c,x+1,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t,x+l-1,w,t+c,x+l-1,w,t,x+l,w,t+c,x+l,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t,x,w,t+1,x,w,t,x+l,w,t+1,x+l,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t+c-1,x,w,t+c,x,w,t+c-1,x+l,w,t+c,x+l,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4}return{vertexData:o,indexData:s,vertexCount:n}},r=(t,a)=>{let{vertexData:r,indexData:n,vertexCount:o}=a;const[s,i]=t.decluttererOffset,u=e.makeFlags(2,3),x=256,c=256,l=x+s,p=c+i;for(const e of[-3,3])for(const t of[-3,3])r.push(x,c,u,x+e,c+t,u,l,p,u,l+e,p+t,u),n.push(o,o+1,o+2,o+1,o+3,o+2),o+=4},n=(e,t,n)=>{const{pixelRatio:o}=t.state,{vertexData:s,indexData:i,vertexCount:u}=a(e.featureContainer,o,n),x=e.view.labelManager.symbolFader;return x&&r(x,{vertexData:s,indexData:i,vertexCount:u}),{vertexData:new Int16Array(s),indexData:new Uint32Array(i)}},o=(e,t,n)=>{const{pixelRatio:o}=t.state,s=e._vectorTileContainer,{vertexData:i,indexData:u,vertexCount:x}=a(s,o,n),{symbolFader:c}=s;return c&&r(c,{vertexData:i,indexData:u,vertexCount:x}),{vertexData:new Int16Array(i),indexData:new Uint32Array(u)}},s=()=>[1,.5,0,1,1,0,0,1,0,1,.5,1,0,.5,0,1],i=()=>[.05,.01,.15,.2];export{t as showCollisionBoxes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"./TileKey.js";function s(e,s){const t=new Set;for(const i of e instanceof Set?e.values():e.keys())s.has(i)||t.add(i);return t}class t{constructor(e,s,t){const i=t?e.getTileCoverage(t,0,!0,"closest"):null,o=e.getTileCoverage(s,0,!0,"closest");if(this._tileKeys=new Map,i)for(const n of i.keys())this._tileKeys.set(n.id,n);if(o)for(const n of o.keys())this._tileKeys.set(n.id,n)}get coverageSet(){return new Set(this._tileKeys.keys())}keys(){return this._tileKeys.values()}}class i{constructor(e){this.version=e}}class o{constructor(e){this._subscriptions=new Map,this._visible=new Set,this._paused=new Set,this._version=0,this._config=e}destroy(){}get _coverageSet(){return this._coverage?.coverageSet??new Set}suspend(){this._suspendedOverage=this._coverage,this._coverage=null,this._updateSubscriptions()}resume(){null==this._coverage&&(this._coverage=this._suspendedOverage,this._suspendedOverage=null,this._updateSubscriptions())}update(e,s){return this._version=(this._version+1)%Number.MAX_SAFE_INTEGER,this._updateCoverage(e,s),this._updateSubscriptions(),new Set(this._visible)}_updateCoverage(e,s){this._coverage=new t(this._config.tileInfoView,e,s)}_updateSubscriptions(){const e=this._coverageSet,t=this._updateVisibility(),o=s(t,e),n=s(this._subscriptions,t),r=s(e,this._subscriptions),a=s(n,e),c=s(o,a),u=s(c,this._paused);this._visible=t;for(const s of r.values())this._subscriptions.set(s,new i(this._version));for(const s of u.values())this._paused.add(s);for(const s of a.values())this._subscriptions.delete(s),this._paused.delete(s);(r.size||a.size||u.size)&&this._sendUpdateSubscriptions(r,a,u)}_sendUpdateSubscriptions(e,s,t){const i=Array.from(e.values()).map((e=>({tileId:e,version:this._subscriptions.get(e).version})));this._config.updateSubscriptions({subscribe:i,unsubscribe:Array.from(s.values()),pause:Array.from(t.values())})}_updateVisibility(){const s=new Set,t=new Set;if(!this._coverage)return s;for(const e of this._coverage.keys()){if(this._config.isDone(e)){s.add(e.id);continue}if(this._addVisibleParent(s,t,e))continue;this._addVisibleChildren(s,e)||s.add(e.id)}const i=new e(0,0,0,0),o=new e(0,0,0,0);for(const e of t){i.id=e;for(const e of s)o.id=e,i.containsChild(o)&&s.delete(e)}return s}_addVisibleParent(s,t,i){let o=!1;for(const n of this._visible.values()){new e(n).containsChild(i)&&(s.add(n),t.add(n),o=!0)}return o}_addVisibleChildren(s,t){let i=!1;for(const o of this._visible.values()){const n=new e(o);t.containsChild(n)&&(s.add(o),i=!0)}return i}}export{o as FeatureTileSubscriptionManager};
5
+ import s from"./TileKey.js";function e(s,e){const i=new Set;for(const t of s instanceof Set?s.values():s.keys())e.has(t)||i.add(t);return i}class i{constructor(s,e,i){const t=i?s.getTileCoverage(i,0,!0,"closest"):null,n=s.getTileCoverage(e,0,!0,"closest");if(this._tileKeys=new Map,t)for(const o of t.keys())this._tileKeys.set(o.id,o);if(n)for(const o of n.keys())this._tileKeys.set(o.id,o)}get coverageSet(){return new Set(this._tileKeys.keys())}keys(){return this._tileKeys.values()}}class t{constructor(s){this.version=s}}class n{constructor(s){this._subscriptions=new Map,this._visible=new Set,this._paused=new Set,this._version=0,this._config=s}destroy(){}get coverageSet(){return this._coverage?.coverageSet??new Set}get subscriptions(){return new Set(this._subscriptions.keys())}suspend(){this._suspendedOverage=this._coverage,this._coverage=null,this._updateSubscriptions()}resume(){null==this._coverage&&(this._coverage=this._suspendedOverage,this._suspendedOverage=null,this._updateSubscriptions())}update(s,e){return this._version=(this._version+1)%Number.MAX_SAFE_INTEGER,this._updateCoverage(s,e),this._updateSubscriptions(),new Set(this._visible)}updateVisibility(){const s=this._updateVisibility();return this._visible=s,this._visible}_updateCoverage(s,e){this._coverage=new i(this._config.tileInfoView,s,e)}_updateSubscriptions(){const s=this.coverageSet,i=this._updateVisibility(),n=e(i,s),o=e(this._subscriptions,i),r=e(s,this._subscriptions),a=e(o,s),u=e(n,a),c=e(u,this._paused);this._visible=i;for(const e of r.values())this._subscriptions.set(e,new t(this._version));for(const e of c.values())this._paused.add(e);for(const e of a.values())this._subscriptions.delete(e),this._paused.delete(e);(r.size||a.size||c.size)&&this._sendUpdateSubscriptions(r,a,c)}_sendUpdateSubscriptions(s,e,i){const t=Array.from(s.values()).map((s=>({tileId:s,version:this._subscriptions.get(s).version})));this._config.updateSubscriptions({subscribe:t,unsubscribe:Array.from(e.values()),pause:Array.from(i.values())})}_updateVisibility(){const s=new Set,e=new Set;if(!this._coverage)return s;for(const i of this._coverage.keys()){if(this._config.isDone(i)){s.add(i.id);continue}if(this._addVisibleParent(s,e,i))continue;this._addVisibleChildren(s,i)||s.add(i.id)}return s}_addVisibleParent(e,i,t){let n=!1;for(const o of this._visible.values()){new s(o).containsChild(t)&&(e.add(o),i.add(o),n=!0)}return n}_addVisibleChildren(e,i){let t=!1;for(const n of this._visible.values()){const o=new s(n);i.containsChild(o)&&(e.add(n),t=!0)}return t}}export{n as FeatureTileSubscriptionManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{LengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{toUnit as n}from"../../../../core/quantityUtils.js";import{adaptiveVerticalLengthUnit as r,adaptiveLengthUnit as i}from"../../../../core/unitUtils.js";import{fromRotation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as s,b as d,a as c,I as l,f as u,y as p,t as m,e as S,n as g,k as f}from"../../../../chunks/vec32.js";import{create as v,ZEROS as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Axis as A}from"../../../../geometry/support/Axis.js";import{sv3d as P}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as y}from"../../../../layers/graphics/dehydratedPoint.js";import{clonePoint as h}from"../../../../layers/graphics/hydratedFeatures.js";import{EuclideanSegment as E}from"../../interactive/visualElements/support/Segment.js";import{autoDistanceBetweenPoints2D as j}from"../../../support/automaticLengthMeasurementUtils.js";import{euclideanDirectDistance as x,euclideanDirectDistanceBetweenPoints as w}from"../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistanceThreshold as U}from"../../../support/geodesicMeasurementUtils.js";class z{constructor(e,t,n,r,i,o){this.elevationAlignedStartPoint=e,this.elevationAlignedEndPoint=t,this.directSegment=n,this.dimensionSegment=r,this.primaryOffsetAxis=i,this.spatialReference=o}}function b(t,o,a){if(null==t)return null;let s;if(o===e.Horizontal)s=j(t.elevationAlignedStartPoint,t.elevationAlignedEndPoint);else{const{startRenderSpace:e,endRenderSpace:n}=t.dimensionSegment;s=x(e,n,t.spatialReference)}if(null==s)return null;const d=o===e.Vertical?r(s.value,s.unit,a):i(s.value,s.unit,a);return n(s,d)}function H(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,dimension:{offset:r,measureType:i,orientation:o}}=e;return{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,offset:r,measureType:i,orientation:o}}function C({elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,offset:r,measureType:i,orientation:o},a,d=null){if(null==t||null==n)return null;const c=D(d?.directSegment??new E,{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n},a),l=d?.primaryOffsetAxis??v();F(l,{measureType:i,elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,directSegment:c,orientation:o,renderCoordsHelper:a});const u=d?.dimensionSegment??new E;return G({elevationAlignedStartPoint:t,elevationAlignedEndPoint:n})&&i===e.Vertical?(s(u.startRenderSpace,c.startRenderSpace),s(u.endRenderSpace,c.endRenderSpace)):J(u,l,r,c,a),new z(t,n,c,u,l,a.spatialReference)}function T(e,t,n,r){return t===k.Start?(s(e.startRenderSpace,n.startRenderSpace),s(e.endRenderSpace,r.startRenderSpace)):(s(e.startRenderSpace,n.endRenderSpace),s(e.endRenderSpace,r.endRenderSpace)),e}var k;function M(e,t,n,r){d(e.startRenderSpace,t.startRenderSpace,n,r),d(e.endRenderSpace,t.endRenderSpace,n,r)}function V(t,n,r,i){switch(n){case e.Direct:return D(t,r,i);case e.Horizontal:case e.Vertical:{const{elevationAlignedStartPoint:o,elevationAlignedEndPoint:a,dimension:s,geometry:d}=r;let c;if(s.measureType===e.Direct){c=I(d,i)===o.z>a.z,n===e.Horizontal&&(c=!c)}else c=!O(d);const[l,u]=c?[o,a]:[a,o],p=h(u,L);return n===e.Horizontal?p.z=l.z:(p.x=l.x,p.y=l.y),i.toRenderCoords(l,t.startRenderSpace),i.toRenderCoords(p,t.endRenderSpace),t}}}function D(e,t,n){return n.toRenderCoords(t.elevationAlignedStartPoint,e.startRenderSpace),n.toRenderCoords(t.elevationAlignedEndPoint,e.endRenderSpace),e}function I(e,t){const n=e.directSegment.eval(.5,P.get()),r=t.worldUpAtPosition(n,P.get()),i=e.dimensionSegment.eval(.5,P.get()),o=c(P.get(),i,n);return!l(o,R)&&u(o,r)>0}function O(e){const{startRenderSpace:t,endRenderSpace:n}=e.dimensionSegment,{startRenderSpace:r,endRenderSpace:i}=e.directSegment;return p(r,t)<p(i,n)}!function(e){e[e.Start=0]="Start",e[e.End=1]="End"}(k||(k={}));const L=y(0,0,0,null);function q(e,t,n,r){const{directSegment:i}=n,o=F(P.get(),{measureType:t,directSegment:i,renderCoordsHelper:r}),a=J(B,o,0,i,r).eval(.5,P.get()),s=c(P.get(),e,a);return u(s,o)*r.unitInMeters}const B=new E;function F(n,r){const{measureType:i,elevationAlignedStartPoint:a,elevationAlignedEndPoint:d,directSegment:{startRenderSpace:p,endRenderSpace:f},directSegment:v,renderCoordsHelper:y}=r,h=v.eval(.5,P.get()),E=y.worldUpAtPosition(h,P.get()),j=y.worldBasisAtPosition(h,A.Y,P.get());switch(i){case e.Horizontal:s(n,E);break;case e.Vertical:u(p,E)<u(f,E)?c(n,f,p):c(n,p,f),S(n,n,E),S(n,n,E);break;case e.Direct:{const e=r.orientation??0;if(G({elevationAlignedStartPoint:a,elevationAlignedEndPoint:d}))o(Y,-t(e),E),m(n,j,Y);else{const r=c(P.get(),f,p),i=S(P.get(),r,E);S(i,i,r),o(Y,t(e),r),m(n,i,Y)}break}}return l(n,R)?s(n,j):g(n,n)}const Y=a();function G({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t}){return null!=e&&null!=t&&e.x===t.x&&e.y===t.y}function J(e,t,n,r,i){const{startRenderSpace:o,endRenderSpace:a}=r,s=n/i.unitInMeters,[c,l]=K(o,a,t,s);return d(e.startRenderSpace,r.startRenderSpace,t,c),d(e.endRenderSpace,r.endRenderSpace,t,l),e}function K(e,t,n,r=0){const i=u(t,n),o=u(e,n),a=Math.abs(i-o)+r;return i>o?[a,r]:[r,a]}function N(e,t,n){const r=t.directSegment.eval(.5,P.get());return n.worldUpAtPosition(r,e)}function Q(e,t){const{startRenderSpace:n,endRenderSpace:r}=t.directSegment;return c(e,r,n)}function W(e,t,n={invert:!1}){const{startRenderSpace:r,endRenderSpace:i}=t.dimensionSegment;return n.invert?c(e,r,i):c(e,i,r)}function X(e,t){const n=e.directSegment.eval(.5,P.get());return t.headingAtPosition(n,e.primaryOffsetAxis)}function Z(e,t){return f(W($,e))/t**2}const $=v();function _(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:r}=e;if(null==t||null==r)return!1;const i=w(t,r);return null!=i&&n(i,"meters").value>U}function ee(e){return null!=e.geometry}export{z as LengthDimensionGeometry,k as OffsetSegmentLocation,G as arePointsVerticallyAligned,H as computationToGeometryDependencies,C as computeGeometryFromDimension,b as computeLength,F as computeOffsetAxis,q as computeOffsetForPoint,V as computeSegmentForMeasureType,T as computeSpanningSegment,W as dimensionStartToEnd,Q as directStartToEnd,N as directUp,X as headingFromGeometry,_ as isGeodesicDimension,ee as isValidComputation,Z as maxScreenLengthSquaredFromGeometry,M as offsetSegment};
5
+ import{LengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{toUnit as n}from"../../../../core/quantityUtils.js";import{adaptiveVerticalLengthUnit as r,adaptiveLengthUnit as i}from"../../../../core/unitUtils.js";import{fromRotation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as s,b as d,a as c,H as l,f as u,y as p,t as m,e as S,n as g,k as f}from"../../../../chunks/vec32.js";import{create as v,ZEROS as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Axis as A}from"../../../../geometry/support/Axis.js";import{sv3d as P}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as y}from"../../../../layers/graphics/dehydratedPoint.js";import{clonePoint as h}from"../../../../layers/graphics/hydratedFeatures.js";import{EuclideanSegment as E}from"../../interactive/visualElements/support/Segment.js";import{autoDistanceBetweenPoints2D as j}from"../../../support/automaticLengthMeasurementUtils.js";import{euclideanDirectDistance as x,euclideanDirectDistanceBetweenPoints as w}from"../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistanceThreshold as U}from"../../../support/geodesicMeasurementUtils.js";class z{constructor(e,t,n,r,i,o){this.elevationAlignedStartPoint=e,this.elevationAlignedEndPoint=t,this.directSegment=n,this.dimensionSegment=r,this.primaryOffsetAxis=i,this.spatialReference=o}}function H(t,o,a){if(null==t)return null;let s;if(o===e.Horizontal)s=j(t.elevationAlignedStartPoint,t.elevationAlignedEndPoint);else{const{startRenderSpace:e,endRenderSpace:n}=t.dimensionSegment;s=x(e,n,t.spatialReference)}if(null==s)return null;const d=o===e.Vertical?r(s.value,s.unit,a):i(s.value,s.unit,a);return n(s,d)}function b(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,dimension:{offset:r,measureType:i,orientation:o}}=e;return{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,offset:r,measureType:i,orientation:o}}function C({elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,offset:r,measureType:i,orientation:o},a,d=null){if(null==t||null==n)return null;const c=D(d?.directSegment??new E,{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n},a),l=d?.primaryOffsetAxis??v();F(l,{measureType:i,elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,directSegment:c,orientation:o,renderCoordsHelper:a});const u=d?.dimensionSegment??new E;return G({elevationAlignedStartPoint:t,elevationAlignedEndPoint:n})&&i===e.Vertical?(s(u.startRenderSpace,c.startRenderSpace),s(u.endRenderSpace,c.endRenderSpace)):J(u,l,r,c,a),new z(t,n,c,u,l,a.spatialReference)}function T(e,t,n,r){return t===k.Start?(s(e.startRenderSpace,n.startRenderSpace),s(e.endRenderSpace,r.startRenderSpace)):(s(e.startRenderSpace,n.endRenderSpace),s(e.endRenderSpace,r.endRenderSpace)),e}var k;function M(e,t,n,r){d(e.startRenderSpace,t.startRenderSpace,n,r),d(e.endRenderSpace,t.endRenderSpace,n,r)}function V(t,n,r,i){switch(n){case e.Direct:return D(t,r,i);case e.Horizontal:case e.Vertical:{const{elevationAlignedStartPoint:o,elevationAlignedEndPoint:a,dimension:s,geometry:d}=r;let c;if(s.measureType===e.Direct){c=O(d,i)===o.z>a.z,n===e.Horizontal&&(c=!c)}else c=!I(d);const[l,u]=c?[o,a]:[a,o],p=h(u,L);return n===e.Horizontal?p.z=l.z:(p.x=l.x,p.y=l.y),i.toRenderCoords(l,t.startRenderSpace),i.toRenderCoords(p,t.endRenderSpace),t}}}function D(e,t,n){return n.toRenderCoords(t.elevationAlignedStartPoint,e.startRenderSpace),n.toRenderCoords(t.elevationAlignedEndPoint,e.endRenderSpace),e}function O(e,t){const n=e.directSegment.eval(.5,P.get()),r=t.worldUpAtPosition(n,P.get()),i=e.dimensionSegment.eval(.5,P.get()),o=c(P.get(),i,n);return!l(o,R)&&u(o,r)>0}function I(e){const{startRenderSpace:t,endRenderSpace:n}=e.dimensionSegment,{startRenderSpace:r,endRenderSpace:i}=e.directSegment;return p(r,t)<p(i,n)}!function(e){e[e.Start=0]="Start",e[e.End=1]="End"}(k||(k={}));const L=y(0,0,0,null);function q(e,t,n,r){const{directSegment:i}=n,o=F(P.get(),{measureType:t,directSegment:i,renderCoordsHelper:r}),a=J(B,o,0,i,r).eval(.5,P.get()),s=c(P.get(),e,a);return u(s,o)*r.unitInMeters}const B=new E;function F(n,r){const{measureType:i,elevationAlignedStartPoint:a,elevationAlignedEndPoint:d,directSegment:{startRenderSpace:p,endRenderSpace:f},directSegment:v,renderCoordsHelper:y}=r,h=v.eval(.5,P.get()),E=y.worldUpAtPosition(h,P.get()),j=y.worldBasisAtPosition(h,A.Y,P.get());switch(i){case e.Horizontal:s(n,E);break;case e.Vertical:u(p,E)<u(f,E)?c(n,f,p):c(n,p,f),S(n,n,E),S(n,n,E);break;case e.Direct:{const e=r.orientation??0;if(G({elevationAlignedStartPoint:a,elevationAlignedEndPoint:d}))o(Y,-t(e),E),m(n,j,Y);else{const r=c(P.get(),f,p),i=S(P.get(),r,E);S(i,i,r),o(Y,t(e),r),m(n,i,Y)}break}}return l(n,R)?s(n,j):g(n,n)}const Y=a();function G({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t}){return null!=e&&null!=t&&e.x===t.x&&e.y===t.y}function J(e,t,n,r,i){const{startRenderSpace:o,endRenderSpace:a}=r,s=n/i.unitInMeters,[c,l]=K(o,a,t,s);return d(e.startRenderSpace,r.startRenderSpace,t,c),d(e.endRenderSpace,r.endRenderSpace,t,l),e}function K(e,t,n,r=0){const i=u(t,n),o=u(e,n),a=Math.abs(i-o)+r;return i>o?[a,r]:[r,a]}function N(e,t,n){const r=t.directSegment.eval(.5,P.get());return n.worldUpAtPosition(r,e)}function Q(e,t){const{startRenderSpace:n,endRenderSpace:r}=t.directSegment;return c(e,r,n)}function W(e,t,n={invert:!1}){const{startRenderSpace:r,endRenderSpace:i}=t.dimensionSegment;return n.invert?c(e,r,i):c(e,i,r)}function X(e,t){const n=e.directSegment.eval(.5,P.get());return t.headingAtPosition(n,e.primaryOffsetAxis)}function Z(e,t){return f(W($,e))/t**2}const $=v();function _(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:r}=e;if(null==t||null==r)return!1;const i=w(t,r);return null!=i&&n(i,"meters").value>U}function ee(e){return null!=e.geometry}export{z as LengthDimensionGeometry,k as OffsetSegmentLocation,G as arePointsVerticallyAligned,b as computationToGeometryDependencies,C as computeGeometryFromDimension,H as computeLength,F as computeOffsetAxis,q as computeOffsetForPoint,V as computeSegmentForMeasureType,T as computeSpanningSegment,W as dimensionStartToEnd,Q as directStartToEnd,N as directUp,X as headingFromGeometry,_ as isGeodesicDimension,ee as isValidComputation,Z as maxScreenLengthSquaredFromGeometry,M as offsetSegment};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../../../chunks/tslib.es6.js";import o from"../../../../core/Accessor.js";import{equals as t}from"../../../../core/arrayUtils.js";import{clone as s}from"../../../../core/lang.js";import{equalsMaybe as i}from"../../../../core/maybe.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{I as n}from"../../../../chunks/vec32.js";import{clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{equals as a}from"../../../../geometry/support/ray.js";var m;let y=m=class extends o{constructor(r){super(r)}clone(){return new m({type:this.type,id:s(this.id),mapPoint:s(this.mapPoint),renderPoint:c(this.renderPoint),normal:s(this.normal),ray:s(this.ray),graphic:this.graphic})}equals(r){return this.type===r.type&&this.id===r.id&&i(this.mapPoint,r.mapPoint)&&n(this.renderPoint,r.renderPoint)&&t(this.normal,r.normal)&&a(this.ray,r.ray)&&this.graphic===r.graphic}};r([e()],y.prototype,"type",void 0),r([e({constructOnly:!0})],y.prototype,"id",void 0),r([e({constructOnly:!0})],y.prototype,"mapPoint",void 0),r([e({constructOnly:!0})],y.prototype,"renderPoint",void 0),r([e({constructOnly:!0})],y.prototype,"normal",void 0),r([e({constructOnly:!0})],y.prototype,"graphic",void 0),r([e({constructOnly:!0})],y.prototype,"ray",void 0),y=m=r([p("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],y);export{y as LineOfSightIntersectionResult};
5
+ import{_ as r}from"../../../../chunks/tslib.es6.js";import o from"../../../../core/Accessor.js";import{equals as t}from"../../../../core/arrayUtils.js";import{clone as s}from"../../../../core/lang.js";import{equalsMaybe as i}from"../../../../core/maybe.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{H as n}from"../../../../chunks/vec32.js";import{clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{equals as a}from"../../../../geometry/support/ray.js";var m;let y=m=class extends o{constructor(r){super(r)}clone(){return new m({type:this.type,id:s(this.id),mapPoint:s(this.mapPoint),renderPoint:c(this.renderPoint),normal:s(this.normal),ray:s(this.ray),graphic:this.graphic})}equals(r){return this.type===r.type&&this.id===r.id&&i(this.mapPoint,r.mapPoint)&&n(this.renderPoint,r.renderPoint)&&t(this.normal,r.normal)&&a(this.ray,r.ray)&&this.graphic===r.graphic}};r([e()],y.prototype,"type",void 0),r([e({constructOnly:!0})],y.prototype,"id",void 0),r([e({constructOnly:!0})],y.prototype,"mapPoint",void 0),r([e({constructOnly:!0})],y.prototype,"renderPoint",void 0),r([e({constructOnly:!0})],y.prototype,"normal",void 0),r([e({constructOnly:!0})],y.prototype,"graphic",void 0),r([e({constructOnly:!0})],y.prototype,"ray",void 0),y=m=r([p("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],y);export{y as LineOfSightIntersectionResult};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/Handles.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{fromScaling as e,fromTranslation as a,fromZRotation as r,mul as o,fromYRotation as n,multiply as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as m,h as p,a as c,H as u,f as h,b as d,n as f,i as _}from"../../../../chunks/vec32.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as T}from"../../../../chunks/boundedPlane.js";import{fromValues as v}from"../../../../geometry/support/ray.js";import{displayFocusMultiplier as j}from"../Slice/sliceToolConfig.js";import{ArrowManipulator as w}from"./ArrowManipulator.js";import{viewshedToolManipulatorConfiguration as D}from"./ViewshedConfiguration.js";import{screenToCircleAngle as R,getViewshedRotationMatrix as S}from"./viewshedToolUtils.js";import{screenToRenderRay as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ManipulatorType as H}from"../../interactive/editingTools/ManipulatorType.js";import{discRadiusSmall as x,discRadius as M}from"../../interactive/editingTools/manipulations/config.js";import{InteractiveManipulation as y}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createManipulatorDragEventPipeline as P,dragAtLocation as b}from"../../../interactive/dragEventPipeline.js";class A extends y{constructor(i){super(),this._handles=new t,this._tool=i.tool,this._view=i.view;const e=D.scaleOrientHandleRadius;this._manipulatorHeading=new w(this._view,e),this._manipulatorTilt=new w(this._view,e),this._manipulatorDistance=new w(this._view,e),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles.destroy(),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._manipulatorHeading=null,this._manipulatorTilt=null,this._manipulatorDistance=null,this._tool=null,this._view=null}createHeadingDragPipeline(t,e){return P(this._manipulatorHeading,((a,r,o,n,s)=>{const l=this._view,{tiltParallelToSurface:h,farDistanceRenderSpace:d,upVector:f,observerRenderSpace:_,targetRenderSpace:g,rightVector:v}=e,j=Math.sin(i(h))*d,w=m(V,_,p(C,f,j)),D=c(C,g,w),S=p(I,v,u(D)),E=T(w,D,S),x=R(r,l,E,e).next((t=>({...t,manipulatorType:H.ROTATE})));t(a,x,o)}))}createTiltDragPipeline(t,i){return P(this._manipulatorTilt,((e,a,r,o,n)=>{const{observerRenderSpace:s,farDistanceRenderSpace:l,upVector:m,targetDirection:c}=i,u=h(c,m),_=d(V,c,m,-u);p(_,f(_,_),l);const g=p(C,m,l),v=T(s,_,g),j=R(a,this._view,v,i).next((t=>({...t,manipulatorType:H.ROTATE})));t(e,j,r)}))}createDistanceDragPipeline(t,i){return P(this._manipulatorDistance,((e,a,r,o,n)=>{const s=v(i.observerRenderSpace,i.targetDirection),l=a.next(b(this._view,e.location)).next(E(this._view,s)).next((t=>({...t,manipulatorType:H.SCALE})));t(e,l,r)}))}updateManipulators(t){const{targetRenderSpace:i}=t;this._manipulatorHeading.renderLocation=i,this._manipulatorTilt.renderLocation=i,this._manipulatorDistance.renderLocation=i;const m=l(),c=t=>{s(m,t,m)},u=D.scaleOrientSize*(x/M);c(e(O,_(V,u,u,u))),c(S(t,O));const h=D.scaleOrientHandleRadius*j*u,d=p(V,t.targetDirection,h);c(a(O,d));const f=r(O,-k);o(f,f,n(L,-k)),this._manipulatorHeading.modelTransform=o(l(),m,f);const g=n(O,k);o(g,g,r(L,Math.PI)),this._manipulatorTilt.modelTransform=s(l(),m,g),this._manipulatorDistance.modelTransform=m}forEachManipulator(t){t(this._manipulatorHeading,H.ROTATE),t(this._manipulatorTilt,H.ROTATE),t(this._manipulatorDistance,H.SCALE)}}const O=l(),L=l(),V=g(),C=g(),I=g(),k=Math.PI/2;export{A as ScaleOrientManipulation};
5
+ import t from"../../../../core/Handles.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{fromScaling as e,fromTranslation as a,fromZRotation as r,mul as o,fromYRotation as n,multiply as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as m,h as p,a as c,I as u,f as h,b as d,n as f,i as _}from"../../../../chunks/vec32.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as T}from"../../../../chunks/boundedPlane.js";import{fromValues as v}from"../../../../geometry/support/ray.js";import{displayFocusMultiplier as j}from"../Slice/sliceToolConfig.js";import{ArrowManipulator as w}from"./ArrowManipulator.js";import{viewshedToolManipulatorConfiguration as D}from"./ViewshedConfiguration.js";import{screenToCircleAngle as R,getViewshedRotationMatrix as S}from"./viewshedToolUtils.js";import{screenToRenderRay as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ManipulatorType as x}from"../../interactive/editingTools/ManipulatorType.js";import{discRadiusSmall as H,discRadius as M}from"../../interactive/editingTools/manipulations/config.js";import{InteractiveManipulation as y}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createManipulatorDragEventPipeline as P,dragAtLocation as b}from"../../../interactive/dragEventPipeline.js";class A extends y{constructor(i){super(),this._handles=new t,this._tool=i.tool,this._view=i.view;const e=D.scaleOrientHandleRadius;this._manipulatorHeading=new w(this._view,e),this._manipulatorTilt=new w(this._view,e),this._manipulatorDistance=new w(this._view,e),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles.destroy(),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._manipulatorHeading=null,this._manipulatorTilt=null,this._manipulatorDistance=null,this._tool=null,this._view=null}createHeadingDragPipeline(t,e){return P(this._manipulatorHeading,((a,r,o,n,s)=>{const l=this._view,{tiltParallelToSurface:h,farDistanceRenderSpace:d,upVector:f,observerRenderSpace:_,targetRenderSpace:g,rightVector:v}=e,j=Math.sin(i(h))*d,w=m(V,_,p(C,f,j)),D=c(C,g,w),S=p(I,v,u(D)),E=T(w,D,S),H=R(r,l,E,e).next((t=>({...t,manipulatorType:x.ROTATE})));t(a,H,o)}))}createTiltDragPipeline(t,i){return P(this._manipulatorTilt,((e,a,r,o,n)=>{const{observerRenderSpace:s,farDistanceRenderSpace:l,upVector:m,targetDirection:c}=i,u=h(c,m),_=d(V,c,m,-u);p(_,f(_,_),l);const g=p(C,m,l),v=T(s,_,g),j=R(a,this._view,v,i).next((t=>({...t,manipulatorType:x.ROTATE})));t(e,j,r)}))}createDistanceDragPipeline(t,i){return P(this._manipulatorDistance,((e,a,r,o,n)=>{const s=v(i.observerRenderSpace,i.targetDirection),l=a.next(b(this._view,e.location)).next(E(this._view,s)).next((t=>({...t,manipulatorType:x.SCALE})));t(e,l,r)}))}updateManipulators(t){const{targetRenderSpace:i}=t;this._manipulatorHeading.renderLocation=i,this._manipulatorTilt.renderLocation=i,this._manipulatorDistance.renderLocation=i;const m=l(),c=t=>{s(m,t,m)},u=D.scaleOrientSize*(H/M);c(e(O,_(V,u,u,u))),c(S(t,O));const h=D.scaleOrientHandleRadius*j*u,d=p(V,t.targetDirection,h);c(a(O,d));const f=r(O,-k);o(f,f,n(L,-k)),this._manipulatorHeading.modelTransform=o(l(),m,f);const g=n(O,k);o(g,g,r(L,Math.PI)),this._manipulatorTilt.modelTransform=s(l(),m,g),this._manipulatorDistance.modelTransform=m}forEachManipulator(t){t(this._manipulatorHeading,x.ROTATE),t(this._manipulatorTilt,x.ROTATE),t(this._manipulatorDistance,x.SCALE)}}const O=l(),L=l(),V=g(),C=g(),I=g(),k=Math.PI/2;export{A as ScaleOrientManipulation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as o,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as c,syncAndInitial as d,initial as v}from"../../../../core/reactiveUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as g,H as M,f as _}from"../../../../chunks/vec32.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProjectWithZConversion as w}from"../../../../geometry/projection.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{FieldOfViewManipulation as V,isSideHorizontal as y,flipSide as D}from"./FieldOfViewManipulation.js";import{ScaleOrientManipulation as T}from"./ScaleOrientManipulation.js";import{viewshedToolManipulatorConfiguration as H}from"./ViewshedConfiguration.js";import{ViewshedObserverManipulator as j}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as F}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as S,dragManipulatedObject as P}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as k}from"../../../interactive/editGeometry/EditGeometryOperations.js";const E=Symbol("dragHandles"),x=Symbol("hideManipulators"),A=Symbol("hideFoVManipulators"),z=Symbol("hideObserverManipulator");let U=class extends e{constructor(i){super(i),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new V({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new T({view:this.view,tool:this.parentTool}),this._observerManipulator=new j(this.view,this.parentTool),this.addHandles([c((()=>this.viewshedComputedData?.observerRenderSpace),(i=>{null!=i&&(this._moveManipulation.renderLocation=i,this._observerManipulator.renderLocation=i)}),d),c((()=>this.viewshedComputedData?.heading),(i=>{i&&(this._moveManipulation.angle=r(90-i))}),v),c((()=>{const{viewshedComputedData:i}=this;return{viewshedComputedData:i,observer:i?.observer}}),(({viewshedComputedData:i,observer:e},a)=>{this._grabbing&&e!==a?.observer||(this.removeHandles(E),i?.isValid()&&this.addHandles([this._buildObserverDragPipeline(i),this._buildFOVDragPipeline(i),this._buildScaleOrientDragPipeline(i)].filter(t),E))}),v),c((()=>{const i=this.viewshedComputedData;return i?.isValid()?{viewshedCompData:i,target:i.targetRenderSpace,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView}:null}),(i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorsTransform(i.viewshedCompData)}),v),c((()=>{const i=this.viewshedComputedData;return i?.isValid()?{viewshedCompData:i,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView,tilt:i.tilt}:null}),(i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorVisuals(i.viewshedCompData)}),v),c((()=>{const i=this.analysisViewData.visible&&(this.viewshedComputedData?.isValid()??!1),e=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData;return{fovManipulationAvailable:i&&!this.parentTool.isPlacingTarget,nonFOVManipulationAvailable:i&&(!this.parentTool.creating||e)}}),(({fovManipulationAvailable:i,nonFOVManipulationAvailable:e})=>{this._moveManipulation.available=e,this._scaleOrientManipulation.available=e,this._observerManipulator.available=e,this._fieldOfViewManipulation.available=i}),v),c((()=>{const i=this.viewshedComputedData;if(!i?.isValid())return null;const{observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}=i;return{viewshedCompData:i,observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}}),(i=>{null!=i&&this._scaleOrientManipulation.updateManipulators(i.viewshedCompData)}),v)]);const i=i=>{const e=this.analysisViewData;this.addHandles([i.events.on("focus-changed",(()=>{const i=this._someManipulatorHovering();i&&this.parentTool.subToolHandles.forEach((({subTool:i})=>{i._resetHoveringTask()})),this._someManipulatorSelected()||i||(this._forceHoveringTask=a((async i=>{await(this._forceHoveringTestPromise??h(H.hoverTimeoutMilliseconds,i)),u(i),this._forceHoveringTask=null,this._updateManipulatorVisibility()})))})),i.events.on("grab-changed",(t=>{this._grabbing="start"===t.action,"end"===t.action&&e.tool?.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach((({subTool:i})=>{i!==this&&i._setInteractive(!this._grabbing)})),this._setInteractive((e=>e.hasManipulator(i)||!this._grabbing))})),i.events.on("drag",(i=>{"start"===i.action&&e.tool?.updateInteractionVisualsVisibility()}))])};this._forEachManipulator(i)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(i){const e=this.viewshed;null!=e&&(e.observer=i)}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:i,grabbing:e}=this._moveManipulation;return{dragging:i,grabbing:e}}get scaleOrientInteractionState(){const{dragging:i,grabbing:e}=this._scaleOrientManipulation;return{dragging:i,grabbing:e}}_setInteractive(i){const e="boolean"==typeof i;this._forEachManipulation((t=>t.interactive=e?i:i(t)))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(i){let e=!1;return this._forEachManipulator((t=>{e=e||t===i})),e}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new F({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:C})}_buildObserverDragPipeline(i){const e={mode:"absolute-height",offset:0},t=i.observer;if(null==t)return null;const a=this.view.spatialReference;return this._moveManipulation.createDragPipeline(((i,e,o,n,s)=>{n=n.next(S(this,["observer"]));const r=w(t,a);if(null==r)return{steps:o,cancel:n};const l=k.fromGeometry(r,O(this.view.viewingMode));return{steps:o.next(P({operations:l})).next((i=>(this.observer=l.data.geometry,i))),cancel:n}}),e,a,void 0)}_buildFOVDragPipeline(i){let e=0,t=0;return this._fieldOfViewManipulation.createDragPipeline(((a,n,s)=>{if(null==i)return{steps:n,cancel:s};const r=i.viewshed;let l=null;s=s.next(S(r,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:n.next((a=>{"start"===a.action&&(l=null,e=i.horizontalFieldOfView,t=i.verticalFieldOfView);const n=a.deltaAngle;if(null==l&&0!==n){const i="bottom"===a.side||"left"===a.side?n>0:n<0;l=y(a.side)?0===e&&i||360===e&&!i:0===t&&i}const s=l?D(a.side):a.side;let p=0;switch(s){case"left":p=e/2-n;break;case"right":p=e/2+n;break;case"top":p=t+2*n;break;case"bottom":p=t-2*n}return y(s)?(p=o.normalize(p),p=p>270?0:p>180?180:p,r.horizontalFieldOfView=2*p):r.verticalFieldOfView=p,a})),cancel:s}}),i)}_buildScaleOrientDragPipeline(i){let e=0,t=0;const a=(e,t)=>(a,o,n)=>{if(null==i)return{steps:o,cancel:n};const s=i.viewshed;return n=n.next(S(s,[e])),{steps:o=o.next(t(s,i)),cancel:n}};return s([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",((e,a)=>a=>("start"===a.action&&(t=i.heading),e.heading=o.normalize(t+a.deltaAngle),a))),i),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",((t,a)=>a=>{"start"===a.action&&(e=i.tilt);let o=e+a.deltaAngle;return o<-90?o=180:o>270&&(o=0),t.tilt=R.clamp(o),a})),i),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",((i,e)=>t=>{const a=g(I,t.renderEnd,e.observerRenderSpace),o=M(a)*e.metersPerUnit,n=_(a,e.targetDirection)<0?H.scaleOrientMinDistance:o;return i.farDistance=n,t})),i)])}_updateManipulatorVisibility(){const i=this._someManipulatorSelected(),e=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let o=[];const n=i=>{o.push(i.disableDisplay())};i||!a&&e?this.removeHandles(x):(this._scaleOrientManipulation.forEachManipulator(n),this._moveManipulation.forEachManipulator(n),this.addHandles(o,x),o=[]),i||!a&&e||a&&t?this.removeHandles(A):(this._fieldOfViewManipulation.forEachManipulator(n),this.addHandles(o,A)),i||!a?this.removeHandles(z):this.addHandles(this._observerManipulator.disableDisplay(),z)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(i){this._forEachManipulation((e=>{e.forEachManipulator(i)})),i(this._observerManipulator)}_forEachManipulation(i){i(this._moveManipulation),i(this._fieldOfViewManipulation),i(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:i=>{this._forceHoveringTestPromise=i}}}};i([m({constructOnly:!0})],U.prototype,"analysis",void 0),i([m({constructOnly:!0})],U.prototype,"analysisViewData",void 0),i([m({constructOnly:!0})],U.prototype,"parentTool",void 0),i([m({constructOnly:!0,nonNullable:!0})],U.prototype,"view",void 0),i([m()],U.prototype,"viewshed",null),i([m()],U.prototype,"_grabbing",void 0),i([m()],U.prototype,"grabbing",null),i([m()],U.prototype,"viewshedComputedData",void 0),i([m()],U.prototype,"observer",null),U=i([f("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],U);const I=b(),R=new n(0,180);export{U as ViewshedSubTool};
5
+ import{_ as i}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as o,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as c,syncAndInitial as d,initial as v}from"../../../../core/reactiveUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as g,I as M,f as _}from"../../../../chunks/vec32.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProjectWithZConversion as w}from"../../../../geometry/projection.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{FieldOfViewManipulation as V,isSideHorizontal as y,flipSide as D}from"./FieldOfViewManipulation.js";import{ScaleOrientManipulation as T}from"./ScaleOrientManipulation.js";import{viewshedToolManipulatorConfiguration as H}from"./ViewshedConfiguration.js";import{ViewshedObserverManipulator as j}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as F}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as S,dragManipulatedObject as P}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as k}from"../../../interactive/editGeometry/EditGeometryOperations.js";const E=Symbol("dragHandles"),x=Symbol("hideManipulators"),A=Symbol("hideFoVManipulators"),z=Symbol("hideObserverManipulator");let I=class extends e{constructor(i){super(i),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new V({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new T({view:this.view,tool:this.parentTool}),this._observerManipulator=new j(this.view,this.parentTool),this.addHandles([c((()=>this.viewshedComputedData?.observerRenderSpace),(i=>{null!=i&&(this._moveManipulation.renderLocation=i,this._observerManipulator.renderLocation=i)}),d),c((()=>this.viewshedComputedData?.heading),(i=>{i&&(this._moveManipulation.angle=r(90-i))}),v),c((()=>{const{viewshedComputedData:i}=this;return{viewshedComputedData:i,observer:i?.observer}}),(({viewshedComputedData:i,observer:e},a)=>{this._grabbing&&e!==a?.observer||(this.removeHandles(E),i?.isValid()&&this.addHandles([this._buildObserverDragPipeline(i),this._buildFOVDragPipeline(i),this._buildScaleOrientDragPipeline(i)].filter(t),E))}),v),c((()=>{const i=this.viewshedComputedData;return i?.isValid()?{viewshedCompData:i,target:i.targetRenderSpace,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView}:null}),(i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorsTransform(i.viewshedCompData)}),v),c((()=>{const i=this.viewshedComputedData;return i?.isValid()?{viewshedCompData:i,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView,tilt:i.tilt}:null}),(i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorVisuals(i.viewshedCompData)}),v),c((()=>{const i=this.analysisViewData.visible&&(this.viewshedComputedData?.isValid()??!1),e=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData;return{fovManipulationAvailable:i&&!this.parentTool.isPlacingTarget,nonFOVManipulationAvailable:i&&(!this.parentTool.creating||e)}}),(({fovManipulationAvailable:i,nonFOVManipulationAvailable:e})=>{this._moveManipulation.available=e,this._scaleOrientManipulation.available=e,this._observerManipulator.available=e,this._fieldOfViewManipulation.available=i}),v),c((()=>{const i=this.viewshedComputedData;if(!i?.isValid())return null;const{observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}=i;return{viewshedCompData:i,observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}}),(i=>{null!=i&&this._scaleOrientManipulation.updateManipulators(i.viewshedCompData)}),v)]);const i=i=>{const e=this.analysisViewData;this.addHandles([i.events.on("focus-changed",(()=>{const i=this._someManipulatorHovering();i&&this.parentTool.subToolHandles.forEach((({subTool:i})=>{i._resetHoveringTask()})),this._someManipulatorSelected()||i||(this._forceHoveringTask=a((async i=>{await(this._forceHoveringTestPromise??h(H.hoverTimeoutMilliseconds,i)),u(i),this._forceHoveringTask=null,this._updateManipulatorVisibility()})))})),i.events.on("grab-changed",(t=>{this._grabbing="start"===t.action,"end"===t.action&&e.tool?.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach((({subTool:i})=>{i!==this&&i._setInteractive(!this._grabbing)})),this._setInteractive((e=>e.hasManipulator(i)||!this._grabbing))})),i.events.on("drag",(i=>{"start"===i.action&&e.tool?.updateInteractionVisualsVisibility()}))])};this._forEachManipulator(i)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(i){const e=this.viewshed;null!=e&&(e.observer=i)}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:i,grabbing:e}=this._moveManipulation;return{dragging:i,grabbing:e}}get scaleOrientInteractionState(){const{dragging:i,grabbing:e}=this._scaleOrientManipulation;return{dragging:i,grabbing:e}}_setInteractive(i){const e="boolean"==typeof i;this._forEachManipulation((t=>t.interactive=e?i:i(t)))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(i){let e=!1;return this._forEachManipulator((t=>{e=e||t===i})),e}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new F({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:C})}_buildObserverDragPipeline(i){const e={mode:"absolute-height",offset:0},t=i.observer;if(null==t)return null;const a=this.view.spatialReference;return this._moveManipulation.createDragPipeline(((i,e,o,n,s)=>{n=n.next(S(this,["observer"]));const r=w(t,a);if(null==r)return{steps:o,cancel:n};const l=k.fromGeometry(r,O(this.view.viewingMode));return{steps:o.next(P({operations:l})).next((i=>(this.observer=l.data.geometry,i))),cancel:n}}),e,a,void 0)}_buildFOVDragPipeline(i){let e=0,t=0;return this._fieldOfViewManipulation.createDragPipeline(((a,n,s)=>{if(null==i)return{steps:n,cancel:s};const r=i.viewshed;let l=null;s=s.next(S(r,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:n.next((a=>{"start"===a.action&&(l=null,e=i.horizontalFieldOfView,t=i.verticalFieldOfView);const n=a.deltaAngle;if(null==l&&0!==n){const i="bottom"===a.side||"left"===a.side?n>0:n<0;l=y(a.side)?0===e&&i||360===e&&!i:0===t&&i}const s=l?D(a.side):a.side;let p=0;switch(s){case"left":p=e/2-n;break;case"right":p=e/2+n;break;case"top":p=t+2*n;break;case"bottom":p=t-2*n}return y(s)?(p=o.normalize(p),p=p>270?0:p>180?180:p,r.horizontalFieldOfView=2*p):r.verticalFieldOfView=p,a})),cancel:s}}),i)}_buildScaleOrientDragPipeline(i){let e=0,t=0;const a=(e,t)=>(a,o,n)=>{if(null==i)return{steps:o,cancel:n};const s=i.viewshed;return n=n.next(S(s,[e])),{steps:o=o.next(t(s,i)),cancel:n}};return s([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",((e,a)=>a=>("start"===a.action&&(t=i.heading),e.heading=o.normalize(t+a.deltaAngle),a))),i),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",((t,a)=>a=>{"start"===a.action&&(e=i.tilt);let o=e+a.deltaAngle;return o<-90?o=180:o>270&&(o=0),t.tilt=R.clamp(o),a})),i),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",((i,e)=>t=>{const a=g(U,t.renderEnd,e.observerRenderSpace),o=M(a)*e.metersPerUnit,n=_(a,e.targetDirection)<0?H.scaleOrientMinDistance:o;return i.farDistance=n,t})),i)])}_updateManipulatorVisibility(){const i=this._someManipulatorSelected(),e=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let o=[];const n=i=>{o.push(i.disableDisplay())};i||!a&&e?this.removeHandles(x):(this._scaleOrientManipulation.forEachManipulator(n),this._moveManipulation.forEachManipulator(n),this.addHandles(o,x),o=[]),i||!a&&e||a&&t?this.removeHandles(A):(this._fieldOfViewManipulation.forEachManipulator(n),this.addHandles(o,A)),i||!a?this.removeHandles(z):this.addHandles(this._observerManipulator.disableDisplay(),z)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(i){this._forEachManipulation((e=>{e.forEachManipulator(i)})),i(this._observerManipulator)}_forEachManipulation(i){i(this._moveManipulation),i(this._fieldOfViewManipulation),i(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:i=>{this._forceHoveringTestPromise=i}}}};i([m({constructOnly:!0})],I.prototype,"analysis",void 0),i([m({constructOnly:!0})],I.prototype,"analysisViewData",void 0),i([m({constructOnly:!0})],I.prototype,"parentTool",void 0),i([m({constructOnly:!0,nonNullable:!0})],I.prototype,"view",void 0),i([m()],I.prototype,"viewshed",null),i([m()],I.prototype,"_grabbing",void 0),i([m()],I.prototype,"grabbing",null),i([m()],I.prototype,"viewshedComputedData",void 0),i([m()],I.prototype,"observer",null),I=i([f("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],I);const U=b(),R=new n(0,180);export{I as ViewshedSubTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../analysis/Viewshed.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{rad2deg as a}from"../../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as r,sync as l,when as c,initial as d}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as m,H as g,i as w,r as v,f as _}from"../../../../chunks/vec32.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import b from"../../../../geometry/Point.js";import{create as f,fromPositionAndNormal as y,projectPoint as S}from"../../../../geometry/support/plane.js";import{creationVerticalOffset as T}from"./ViewshedConfiguration.js";import{ViewshedSubTool as C}from"./ViewshedSubTool.js";import{Manipulator3D as D}from"../../interactive/Manipulator3D.js";import{Settings as j}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as M}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as P}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{RenderOccludedFlag as I}from"../../webgl-engine/lib/Material.js";import{AnalysisToolBase as E}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as L}from"../../../interactive/keybindings.js";import{newToolIntersector as k}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as O}from"../../../support/screenUtils.js";const R=Symbol("interactionVisuals");let x=class extends E{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._creationState=!1,this._interactionVisualElements=null,this._settings=new j({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=k(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s((()=>e),(({viewshedComputedData:e})=>{const t=new C({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}})),this.addHandles([o((()=>e?.some((e=>e.viewshedComputedData.isValid()))),(e=>{e&&this.finishToolCreation()}),r),o((()=>this._stagedViewshed),(e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null}),r),o((()=>this.firstGrabbedManipulator),(e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()}),l),o((()=>this.view.activeTool),(e=>{e!==this&&null!=e&&(this.selectedViewshed=null)})),c((()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.observerRenderSpace,target:e.targetRenderSpace}}),(e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)}),d),o((()=>this.creating),(()=>this.updateInteractionVisualsVisibility())),o((()=>this.selectedViewshed),(e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)}),d)])}destroy(){this.subToolHandles=n(this.subToolHandles),this.removeHandles(R)}onDeactivate(){this.removeStaged(),this._creationState=!1}get cursor(){return this.creating?"crosshair":null}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}get stagedViewshed(){return this._stagedViewshed}get grabbing(){return this.subToolHandles.some((({subTool:e})=>e.grabbing))}get creating(){return this._creationState&&this.active}get isPlacingTarget(){return"placing-target"===this._creationState}createViewsheds(){this.selectedViewshed=null,this._creationState="placing-observer"}onManipulatorSelectionChanged(){this.subToolHandles.forEach((e=>e.subTool.onManipulatorSelectionChanged()))}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":L.cancel===e.key?this._cancelKeyHandler(e):L.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,B);if(null!=i){if("placing-observer"===this._creationState){i.mapPoint.z=(i.mapPoint.z??0)+T;const e=new t({observer:i.mapPoint.clone(),feature:i.feature});this.analysis.viewsheds.add(e),this._stagedViewshed=e,this._creationState="placing-target",this._updateStagedViewshed(i.scenePoint)}else if("placing-target"===this._creationState){this._updateStagedViewshed(i.scenePoint);const e=this._stagedViewshed;this._creationState="placing-observer",this._stagedViewshed=null,this.selectedViewshed=e}e.stopPropagation()}}_doubleClickHandler(e){this.creating&&(this.removeStaged(),this._creationState=!1,this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(!this.creating)return;const t=this._intersectScreen(e,B);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){if(this.creating){if(this.removeStaged())return this._creationState="placing-observer",this.selectedViewshed=null,void e.stopPropagation();this._creationState=!1}else if(!this.grabbing)return this.selectedViewshed=null,void e.stopPropagation()}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:a,farDistance:n}=U(this.view,i,e);t.farDistance=n,t.tilt=a,t.heading=s}removeStaged(){return null!=this._stagedViewshed&&(this.analysis.viewsheds.remove(this._stagedViewshed),this._stagedViewshed=null,!0)}_intersectScreen(e,t){const i=O(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,a=t.scenePoint;if(!s.getIntersectionPoint(a))return null;const n=t.mapPoint;return n.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(a,n),null==n?null:(t.feature=P(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(R);const e=this._settings.visualElements,t=new H({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new M({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:I.OccludeAndTransparent,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([o((()=>e.zVerticalLine),(e=>e.apply(s)),r),o((()=>e.heightPlane),(e=>e.apply(t)),r),i((()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null}))],R)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,a=this.selectedViewshedComputedData,n=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void n(i,!1);if(null==s||null==a)return void n(!1,!1);const o=s.moveInteractionState,r=e?o.grabbing:o.dragging,l=s.scaleOrientInteractionState,c=e?l.grabbing:l.dragging,d=i&&(r||c);if(n(d,r),d){const e=r?a.observerRenderSpace:a.targetRenderSpace;this._updateInteractionVisualsLocation(e,r)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:a}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&a.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof D?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};function U(e,t,i){const s=t.observerRenderSpace,n=m(W,i,s),o=g(n)*t.metersPerUnit,r=e.renderCoordsHelper.basisMatrixAtPosition(s,F),l=w(A,r[8],r[9],r[10]),c=y(s,l,G),d=S(c,i,z),h=m(d,d,s),u=(g(h)<1e-4?90:a(v(n,h)))*(_(l,n)<0?-1:1)+90,p=w(K,r[4],r[5],r[6]),V=a(v(p,h)),b=w(K,r[0],r[1],r[2]);return{heading:_(h,b)<0?360-V:V,tilt:u,farDistance:o}}e([h({constructOnly:!0})],x.prototype,"view",void 0),e([h()],x.prototype,"analysisViewData",void 0),e([h()],x.prototype,"removeIncompleteOnCancel",void 0),e([h()],x.prototype,"automaticManipulatorSelection",void 0),e([h({constructOnly:!0})],x.prototype,"analysis",void 0),e([h()],x.prototype,"subToolHandles",void 0),e([h()],x.prototype,"_stagedViewshed",void 0),e([h()],x.prototype,"_stagedViewshedComputedData",void 0),e([h()],x.prototype,"_creationState",void 0),e([h({readOnly:!0})],x.prototype,"cursor",null),e([h()],x.prototype,"_selectedManipulator",void 0),e([h()],x.prototype,"_selectedSubTool",null),e([h()],x.prototype,"selectedViewshed",null),e([h()],x.prototype,"selectedViewshedComputedData",null),e([h()],x.prototype,"stagedViewshed",null),e([h()],x.prototype,"grabbing",null),e([h()],x.prototype,"creating",null),e([h()],x.prototype,"isPlacingTarget",null),x=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],x);const W=V(),A=V(),z=V(),K=V(),F=p(),G=f(),B={mapPoint:new b,scenePoint:V(),feature:null},q=x;export{q as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../analysis/Viewshed.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{rad2deg as a}from"../../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as r,sync as l,when as c,initial as d}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as m,I as g,i as w,r as v,f as _}from"../../../../chunks/vec32.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import b from"../../../../geometry/Point.js";import{create as f,fromPositionAndNormal as y,projectPoint as S}from"../../../../geometry/support/plane.js";import{creationVerticalOffset as T}from"./ViewshedConfiguration.js";import{ViewshedSubTool as C}from"./ViewshedSubTool.js";import{Manipulator3D as D}from"../../interactive/Manipulator3D.js";import{Settings as j}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as M}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as P}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{RenderOccludedFlag as I}from"../../webgl-engine/lib/Material.js";import{AnalysisToolBase as E}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as L}from"../../../interactive/keybindings.js";import{newToolIntersector as k}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as O}from"../../../support/screenUtils.js";const R=Symbol("interactionVisuals");let x=class extends E{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._creationState=!1,this._interactionVisualElements=null,this._settings=new j({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=k(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s((()=>e),(({viewshedComputedData:e})=>{const t=new C({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}})),this.addHandles([o((()=>e?.some((e=>e.viewshedComputedData.isValid()))),(e=>{e&&this.finishToolCreation()}),r),o((()=>this._stagedViewshed),(e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null}),r),o((()=>this.firstGrabbedManipulator),(e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()}),l),o((()=>this.view.activeTool),(e=>{e!==this&&null!=e&&(this.selectedViewshed=null)})),c((()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.observerRenderSpace,target:e.targetRenderSpace}}),(e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)}),d),o((()=>this.creating),(()=>this.updateInteractionVisualsVisibility())),o((()=>this.selectedViewshed),(e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)}),d)])}destroy(){this.subToolHandles=n(this.subToolHandles),this.removeHandles(R)}onDeactivate(){this.removeStaged(),this._creationState=!1}get cursor(){return this.creating?"crosshair":null}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}get stagedViewshed(){return this._stagedViewshed}get grabbing(){return this.subToolHandles.some((({subTool:e})=>e.grabbing))}get creating(){return this._creationState&&this.active}get isPlacingTarget(){return"placing-target"===this._creationState}createViewsheds(){this.selectedViewshed=null,this._creationState="placing-observer"}onManipulatorSelectionChanged(){this.subToolHandles.forEach((e=>e.subTool.onManipulatorSelectionChanged()))}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":L.cancel===e.key?this._cancelKeyHandler(e):L.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,B);if(null!=i){if("placing-observer"===this._creationState){i.mapPoint.z=(i.mapPoint.z??0)+T;const e=new t({observer:i.mapPoint.clone(),feature:i.feature});this.analysis.viewsheds.add(e),this._stagedViewshed=e,this._creationState="placing-target",this._updateStagedViewshed(i.scenePoint)}else if("placing-target"===this._creationState){this._updateStagedViewshed(i.scenePoint);const e=this._stagedViewshed;this._creationState="placing-observer",this._stagedViewshed=null,this.selectedViewshed=e}e.stopPropagation()}}_doubleClickHandler(e){this.creating&&(this.removeStaged(),this._creationState=!1,this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(!this.creating)return;const t=this._intersectScreen(e,B);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){if(this.creating){if(this.removeStaged())return this._creationState="placing-observer",this.selectedViewshed=null,void e.stopPropagation();this._creationState=!1}else if(!this.grabbing)return this.selectedViewshed=null,void e.stopPropagation()}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:a,farDistance:n}=U(this.view,i,e);t.farDistance=n,t.tilt=a,t.heading=s}removeStaged(){return null!=this._stagedViewshed&&(this.analysis.viewsheds.remove(this._stagedViewshed),this._stagedViewshed=null,!0)}_intersectScreen(e,t){const i=O(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,a=t.scenePoint;if(!s.getIntersectionPoint(a))return null;const n=t.mapPoint;return n.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(a,n),null==n?null:(t.feature=P(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(R);const e=this._settings.visualElements,t=new H({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new M({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:I.OccludeAndTransparent,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([o((()=>e.zVerticalLine),(e=>e.apply(s)),r),o((()=>e.heightPlane),(e=>e.apply(t)),r),i((()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null}))],R)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,a=this.selectedViewshedComputedData,n=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void n(i,!1);if(null==s||null==a)return void n(!1,!1);const o=s.moveInteractionState,r=e?o.grabbing:o.dragging,l=s.scaleOrientInteractionState,c=e?l.grabbing:l.dragging,d=i&&(r||c);if(n(d,r),d){const e=r?a.observerRenderSpace:a.targetRenderSpace;this._updateInteractionVisualsLocation(e,r)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:a}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&a.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof D?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};function U(e,t,i){const s=t.observerRenderSpace,n=m(W,i,s),o=g(n)*t.metersPerUnit,r=e.renderCoordsHelper.basisMatrixAtPosition(s,F),l=w(A,r[8],r[9],r[10]),c=y(s,l,G),d=S(c,i,z),h=m(d,d,s),u=(g(h)<1e-4?90:a(v(n,h)))*(_(l,n)<0?-1:1)+90,p=w(K,r[4],r[5],r[6]),V=a(v(p,h)),b=w(K,r[0],r[1],r[2]);return{heading:_(h,b)<0?360-V:V,tilt:u,farDistance:o}}e([h({constructOnly:!0})],x.prototype,"view",void 0),e([h()],x.prototype,"analysisViewData",void 0),e([h()],x.prototype,"removeIncompleteOnCancel",void 0),e([h()],x.prototype,"automaticManipulatorSelection",void 0),e([h({constructOnly:!0})],x.prototype,"analysis",void 0),e([h()],x.prototype,"subToolHandles",void 0),e([h()],x.prototype,"_stagedViewshed",void 0),e([h()],x.prototype,"_stagedViewshedComputedData",void 0),e([h()],x.prototype,"_creationState",void 0),e([h({readOnly:!0})],x.prototype,"cursor",null),e([h()],x.prototype,"_selectedManipulator",void 0),e([h()],x.prototype,"_selectedSubTool",null),e([h()],x.prototype,"selectedViewshed",null),e([h()],x.prototype,"selectedViewshedComputedData",null),e([h()],x.prototype,"stagedViewshed",null),e([h()],x.prototype,"grabbing",null),e([h()],x.prototype,"creating",null),e([h()],x.prototype,"isPlacingTarget",null),x=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],x);const W=V(),A=V(),z=V(),K=V(),F=p(),G=f(),B={mapPoint:new b,scenePoint:V(),feature:null},q=x;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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as s}from"../../../../core/lang.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as a,initial as l}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as d,i as u,a as p,H as _,n as V,h as f,r as v,v as w,c as E,g as b}from"../../../../chunks/vec32.js";import{create as g,clone as C}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewshedVisualizationConfiguration as L,arcAnglePerSegment as A}from"./ViewshedConfiguration.js";import j from"./ViewshedTool.js";import{LineVisualElement as y}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as D}from"../../interactive/visualElements/PointVisualElement.js";import{ViewshedShapeVisualElement as F}from"../../interactive/visualElements/ViewshedShapeVisualElement.js";import{RenderOccludedFlag as R}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as O}from"../../webgl-engine/materials/lineStippleUtils.js";let S=class extends i{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:g(),topRight:g(),bottomLeft:g(),bottomRight:g()},this._arcCenterPoints={top:g(),bottom:g(),left:g(),right:g()},this._parallelCenters={top:g(),bottom:g()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:R.OccludeAndTransparent},i={...t,stipplePattern:O(2)};this._observerVisualElement=new D({...e,...L.observerPointConfiguration}),this._shapeVisualElement=new F(e),this._frameLinesVisualElement=new y(t),this._leftArcVisualElement=new y(t),this._rightArcVisualElement=new y(t),this._topArcVisualElement=new y(t),this._bottomArcVisualElement=new y(t),this._centralLongitude=new y(i),this._centralLatitude=new y(i),this.addHandles([a((()=>{const e=this.viewshedComputedData;if(!e?.isValid())return null;const t=this._viewshedCorners,i=this._arcCenterPoints,s=this._parallelCenters;return e.cornerPoints(t),e.arcCentersPoints(i),e.parallelCenterPoints(s),{viewshedComputedData:e,corners:t,arcCenters:i,parallelCenters:s,interactive:this.analysisViewData.interactive,selected:this._selected}}),(e=>{const t=null!=e;this._forEachVisualElement((e=>e.attached=t)),t&&this._updateVisualElements(e)}),{initial:!0,equals:s}),a((()=>{const{viewshedComputedData:e}=this,{horizontalFieldOfView:t,verticalFieldOfView:i}=e??{};return{viewshedComputedData:e,horizontalFieldOfView:t,verticalFieldOfView:i}}),(({viewshedComputedData:e})=>{const{_shapeVisualElement:t}=this;e!==t.viewshedComputedData&&(t.viewshedComputedData=e),this._shapeVisualElement.recreateGeometry()}),l),a((()=>{const{interactive:e}=this.analysisViewData;return{visible:this.visible,selected:e&&this._selected,staged:e&&this._staged,horFovNot360:360!==this.viewshedComputedData?.horizontalFieldOfView}}),(({visible:e,selected:t,staged:i,horFovNot360:s})=>{const r=t||i;this._shapeVisualElement.visible=e,this._topArcVisualElement.visible=e,this._bottomArcVisualElement.visible=e,this._frameLinesVisualElement.visible=e&&s;const o=e&&(t||s);this._leftArcVisualElement.visible=o,this._rightArcVisualElement.visible=o,this._forEachLineVisualElement((e=>{e.width=r?L.frameWidthSelected:L.frameWidthNotSelected,e.renderOccluded=t?R.OccludeAndTransparent:R.Occlude})),[this._centralLatitude,this._centralLongitude].forEach((i=>{i.width=2*(r?L.frameWidthSelected:L.frameWidthNotSelected),i.visible=e&&t}))}),l),a((()=>{const{analysisViewData:{interactive:e,tool:t},_selected:i,visible:s}=this,r=this.view.activeTool,o=!t?.active&&r instanceof j&&r.creating;return{observerVisible:s&&!i&&(!e||(t?.creating??!1)||o),color:this._color}}),(({observerVisible:e,color:t})=>{this._observerVisualElement.visible=e,this._forEachLineVisualElement((e=>e.color=t))}),l)])}get _color(){const{viewshedComputedData:e,_selected:i,analysisViewData:s}=this;if(null==e)return t.toUnitRGBA(L.frameColor);const r=s.tool?.active||s.interactive,o=e.viewshed===s.tool?.stagedViewshed,a=r&&(i||o)?this.view.effectiveTheme.accentColor:L.frameColor;return t.toUnitRGBA(a)}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:{tool:e},viewshedComputedData:t}=this;return null!=e&&e.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=o(this._observerVisualElement),this._shapeVisualElement=o(this._shapeVisualElement),this._frameLinesVisualElement=o(this._frameLinesVisualElement),this._leftArcVisualElement=o(this._leftArcVisualElement),this._rightArcVisualElement=o(this._rightArcVisualElement),this._topArcVisualElement=o(this._topArcVisualElement),this._bottomArcVisualElement=o(this._bottomArcVisualElement),this._centralLongitude=o(this._centralLongitude),this._centralLatitude=o(this._centralLatitude)}_forEachLineVisualElement(e){[this._frameLinesVisualElement,this._leftArcVisualElement,this._rightArcVisualElement,this._topArcVisualElement,this._bottomArcVisualElement,this._centralLatitude,this._centralLongitude].forEach(e)}_forEachVisualElement(e){this._forEachLineVisualElement(e),e(this._observerVisualElement),e(this._shapeVisualElement)}_updateVisualElements(e){const{viewshedComputedData:t,corners:i,arcCenters:s,parallelCenters:r}=e,o=C(t.observerRenderSpace);this._observerVisualElement.geometry=t.observer,this._shapeVisualElement.updateTransform(),this._updateFrameLines(o,i),this._updateFrameArcs(t,i,r),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){this._frameLinesVisualElement.geometry=[[e,t.topLeft],[e,t.topRight],[e,t.bottomLeft],[e,t.bottomRight]]}_updateFrameArcs(e,t,i){const{observerRenderSpace:s,rightVector:o,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=r(a),c=g(),p=m();h(p,n/2,l),d(c,o,p),P(this._leftArcVisualElement,s,t.bottomLeft,t.topLeft,"forward",c),h(p,-n/2,l),u(c,0,0,0),d(c,o,p),P(this._rightArcVisualElement,s,t.bottomRight,t.topRight,"forward",c);const _=a>180?"backward":"forward";P(this._topArcVisualElement,i.top,t.topRight,t.topLeft,_,l),P(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,_,l)}_updateCentralHelperArcs(e,t){const i=e.observerRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";P(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),P(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function P(e,t,i,s,r,o,a=A){const l=g();p(l,i,t);const n=_(l),c=g();p(c,s,t),V(c,c),f(c,c,n);let u=v(l,c);const L=C(o);"backward"===r&&(w(L,L),u=-(2*Math.PI-u));const j=[],y=Math.ceil(Math.abs(u)/a),D=m();h(D,u/y,L);const F=g();E(F,l);const R=g();E(R,i);for(let h=0;h<y;h++){const e=g();E(e,R),d(F,F,D),b(R,t,F);const i=g();E(i,R),j.push([e,i])}e.geometry=j}e([n()],S.prototype,"view",void 0),e([n()],S.prototype,"analysisViewData",void 0),e([n()],S.prototype,"viewshedComputedData",void 0),e([n()],S.prototype,"visible",void 0),e([n()],S.prototype,"_color",null),e([n()],S.prototype,"_selected",null),e([n()],S.prototype,"_staged",null),S=e([c("esri.views.3d.analysis.Viewshed.ViewshedVisualization")],S);const z=S;export{z as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as s}from"../../../../core/lang.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as a,initial as l}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as d,i as u,a as p,I as _,n as V,h as f,r as v,v as w,c as E,g as b}from"../../../../chunks/vec32.js";import{create as g,clone as C}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewshedVisualizationConfiguration as L,arcAnglePerSegment as A}from"./ViewshedConfiguration.js";import j from"./ViewshedTool.js";import{LineVisualElement as y}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as D}from"../../interactive/visualElements/PointVisualElement.js";import{ViewshedShapeVisualElement as F}from"../../interactive/visualElements/ViewshedShapeVisualElement.js";import{RenderOccludedFlag as R}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as O}from"../../webgl-engine/materials/lineStippleUtils.js";let S=class extends i{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:g(),topRight:g(),bottomLeft:g(),bottomRight:g()},this._arcCenterPoints={top:g(),bottom:g(),left:g(),right:g()},this._parallelCenters={top:g(),bottom:g()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:R.OccludeAndTransparent},i={...t,stipplePattern:O(2)};this._observerVisualElement=new D({...e,...L.observerPointConfiguration}),this._shapeVisualElement=new F(e),this._frameLinesVisualElement=new y(t),this._leftArcVisualElement=new y(t),this._rightArcVisualElement=new y(t),this._topArcVisualElement=new y(t),this._bottomArcVisualElement=new y(t),this._centralLongitude=new y(i),this._centralLatitude=new y(i),this.addHandles([a((()=>{const e=this.viewshedComputedData;if(!e?.isValid())return null;const t=this._viewshedCorners,i=this._arcCenterPoints,s=this._parallelCenters;return e.cornerPoints(t),e.arcCentersPoints(i),e.parallelCenterPoints(s),{viewshedComputedData:e,corners:t,arcCenters:i,parallelCenters:s,interactive:this.analysisViewData.interactive,selected:this._selected}}),(e=>{const t=null!=e;this._forEachVisualElement((e=>e.attached=t)),t&&this._updateVisualElements(e)}),{initial:!0,equals:s}),a((()=>{const{viewshedComputedData:e}=this,{horizontalFieldOfView:t,verticalFieldOfView:i}=e??{};return{viewshedComputedData:e,horizontalFieldOfView:t,verticalFieldOfView:i}}),(({viewshedComputedData:e})=>{const{_shapeVisualElement:t}=this;e!==t.viewshedComputedData&&(t.viewshedComputedData=e),this._shapeVisualElement.recreateGeometry()}),l),a((()=>{const{interactive:e}=this.analysisViewData;return{visible:this.visible,selected:e&&this._selected,staged:e&&this._staged,horFovNot360:360!==this.viewshedComputedData?.horizontalFieldOfView}}),(({visible:e,selected:t,staged:i,horFovNot360:s})=>{const r=t||i;this._shapeVisualElement.visible=e,this._topArcVisualElement.visible=e,this._bottomArcVisualElement.visible=e,this._frameLinesVisualElement.visible=e&&s;const o=e&&(t||s);this._leftArcVisualElement.visible=o,this._rightArcVisualElement.visible=o,this._forEachLineVisualElement((e=>{e.width=r?L.frameWidthSelected:L.frameWidthNotSelected,e.renderOccluded=t?R.OccludeAndTransparent:R.Occlude})),[this._centralLatitude,this._centralLongitude].forEach((i=>{i.width=2*(r?L.frameWidthSelected:L.frameWidthNotSelected),i.visible=e&&t}))}),l),a((()=>{const{analysisViewData:{interactive:e,tool:t},_selected:i,visible:s}=this,r=this.view.activeTool,o=!t?.active&&r instanceof j&&r.creating;return{observerVisible:s&&!i&&(!e||(t?.creating??!1)||o),color:this._color}}),(({observerVisible:e,color:t})=>{this._observerVisualElement.visible=e,this._forEachLineVisualElement((e=>e.color=t))}),l)])}get _color(){const{viewshedComputedData:e,_selected:i,analysisViewData:s}=this;if(null==e)return t.toUnitRGBA(L.frameColor);const r=s.tool?.active||s.interactive,o=e.viewshed===s.tool?.stagedViewshed,a=r&&(i||o)?this.view.effectiveTheme.accentColor:L.frameColor;return t.toUnitRGBA(a)}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:{tool:e},viewshedComputedData:t}=this;return null!=e&&e.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=o(this._observerVisualElement),this._shapeVisualElement=o(this._shapeVisualElement),this._frameLinesVisualElement=o(this._frameLinesVisualElement),this._leftArcVisualElement=o(this._leftArcVisualElement),this._rightArcVisualElement=o(this._rightArcVisualElement),this._topArcVisualElement=o(this._topArcVisualElement),this._bottomArcVisualElement=o(this._bottomArcVisualElement),this._centralLongitude=o(this._centralLongitude),this._centralLatitude=o(this._centralLatitude)}_forEachLineVisualElement(e){[this._frameLinesVisualElement,this._leftArcVisualElement,this._rightArcVisualElement,this._topArcVisualElement,this._bottomArcVisualElement,this._centralLatitude,this._centralLongitude].forEach(e)}_forEachVisualElement(e){this._forEachLineVisualElement(e),e(this._observerVisualElement),e(this._shapeVisualElement)}_updateVisualElements(e){const{viewshedComputedData:t,corners:i,arcCenters:s,parallelCenters:r}=e,o=C(t.observerRenderSpace);this._observerVisualElement.geometry=t.observer,this._shapeVisualElement.updateTransform(),this._updateFrameLines(o,i),this._updateFrameArcs(t,i,r),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){this._frameLinesVisualElement.geometry=[[e,t.topLeft],[e,t.topRight],[e,t.bottomLeft],[e,t.bottomRight]]}_updateFrameArcs(e,t,i){const{observerRenderSpace:s,rightVector:o,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=r(a),c=g(),p=m();h(p,n/2,l),d(c,o,p),P(this._leftArcVisualElement,s,t.bottomLeft,t.topLeft,"forward",c),h(p,-n/2,l),u(c,0,0,0),d(c,o,p),P(this._rightArcVisualElement,s,t.bottomRight,t.topRight,"forward",c);const _=a>180?"backward":"forward";P(this._topArcVisualElement,i.top,t.topRight,t.topLeft,_,l),P(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,_,l)}_updateCentralHelperArcs(e,t){const i=e.observerRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";P(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),P(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function P(e,t,i,s,r,o,a=A){const l=g();p(l,i,t);const n=_(l),c=g();p(c,s,t),V(c,c),f(c,c,n);let u=v(l,c);const L=C(o);"backward"===r&&(w(L,L),u=-(2*Math.PI-u));const j=[],y=Math.ceil(Math.abs(u)/a),D=m();h(D,u/y,L);const F=g();E(F,l);const R=g();E(R,i);for(let h=0;h<y;h++){const e=g();E(e,R),d(F,F,D),b(R,t,F);const i=g();E(i,R),j.push([e,i])}e.geometry=j}e([n()],S.prototype,"view",void 0),e([n()],S.prototype,"analysisViewData",void 0),e([n()],S.prototype,"viewshedComputedData",void 0),e([n()],S.prototype,"visible",void 0),e([n()],S.prototype,"_color",null),e([n()],S.prototype,"_selected",null),e([n()],S.prototype,"_staged",null),S=e([c("esri.views.3d.analysis.Viewshed.ViewshedVisualization")],S);const z=S;export{z as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{colorVectorEquals as e}from"../../../../core/colorUtils.js";import t from"../../../../core/Handles.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as i,a,e as n,H as l,d as h}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as d}from"../../../../chunks/vec42.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as p}from"./Object3DVisualElement.js";import{headingTiltToDirectionUp as g}from"../../support/cameraUtils.js";import{createDirectionUp as u}from"../../support/cameraUtilsInternal.js";import{createPolylineGeometry as w}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as f}from"../../webgl-engine/lib/Material.js";import{MeasurementArrowMaterial as C}from"../../webgl-engine/materials/MeasurementArrowMaterial.js";class y extends p{constructor(e){super(e),this._arrowWidth=16,this._arrowSubdivisions=128,this._origin=c(),this._originTransform=o(),this._arrowCenter=c(),this._renderOccluded=f.OccludeAndTransparent,this._geometry=null,this._stripeLength=1,this._stripesEnabled=!0,this._color=m(),this._contrastColor=m(),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._arrowMaterial?.setParameters({renderOccluded:e}))}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this._geometryChanged()}get stripeLength(){return this._stripeLength}set stripeLength(e){this._stripeLength=e,this.attached&&this._arrowMaterial.setParameters({stripeLength:this._stripeLength})}get stripesEnabled(){return this._stripesEnabled}set stripesEnabled(e){if(this._stripesEnabled=e,this.attached){const e=this._stripesEnabled?this._contrastColor:this._color;this._arrowMaterial.setParameters({stripeEvenColor:e})}}get color(){return this._color}set color(t){e(t,this._color)||(d(this._color,t),this._updateArrowColor())}get contrastColor(){return this._contrastColor}set contrastColor(t){e(t,this._color)||(d(this._contrastColor,t),this._updateArrowColor())}createExternalResources(){const e=this._color,r=this._contrastColor,o=this._stripesEnabled?r:e;this._arrowMaterial=new C({outlineColor:e,stripeEvenColor:o,stripeOddColor:e,renderOccluded:this.renderOccluded,polygonOffset:!0,isDecoration:this.isDecoration}),this._handles=new t,this._handles.add(s((()=>this.view.state.camera),(()=>{this._viewChanged()})))}destroyExternalResources(){this._arrowMaterial=null,this._handles=r(this._handles)}forEachExternalMaterial(e){e(this._arrowMaterial)}createGeometries(e){if(null==this._geometry?.startRenderSpace||null==this._geometry.endRenderSpace)return;const t=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);t.transformation=this._originTransform,e.addGeometry(t),this._viewChanged()}_createArrowGeometry(e,t,r,s){const o=this.view,a=o.renderCoordsHelper,n=[],l=[],c=(e,t)=>{const s=_.get();h(s,e,r),n.push(s),l.push(t)};if("euclidean"===s.type){s.eval(.5,this._arrowCenter);const r=_.get();if(a.worldUpAtPosition(this._arrowCenter,r),v(e,t,r)){const{heading:t,tilt:s}=o.camera,{direction:a}=g(o,e,t,s,j);i(r,a)}c(e,r),c(t,r)}else{s.eval(.5,this._arrowCenter);const e=this._arrowSubdivisions+1&-2;for(let t=0;t<e;++t){const r=t/(e-1),o=_.get(),i=_.get();s.eval(r,o),a.worldUpAtPosition(o,i),c(o,i)}}return w(this._arrowMaterial,n,l)}_geometryChanged(){this.recreateGeometry()}_viewChanged(){if(this.view.ready&&this.attached&&null!=this._geometry){const e=this.view.state.camera.computeScreenPixelSizeAt(this._arrowCenter);this._arrowMaterial.setParameters({width:this._arrowWidth*e})}}_updateArrowColor(){if(!this.attached)return;const e=this._color,t=this._contrastColor,r=this._stripesEnabled?t:e,s=e,o=e;this._arrowMaterial.setParameters({stripeEvenColor:r,outlineColor:s,stripeOddColor:o})}}function v(e,t,r){const s=a(b,t,e),o=n(b,s,r);return 0===l(o)}const b=c(),j=u();export{y as MeasurementArrowVisualElement};
5
+ import{colorVectorEquals as e}from"../../../../core/colorUtils.js";import t from"../../../../core/Handles.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as i,a,e as n,I as l,d as h}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as d}from"../../../../chunks/vec42.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as p}from"./Object3DVisualElement.js";import{headingTiltToDirectionUp as g}from"../../support/cameraUtils.js";import{createDirectionUp as u}from"../../support/cameraUtilsInternal.js";import{createPolylineGeometry as w}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as f}from"../../webgl-engine/lib/Material.js";import{MeasurementArrowMaterial as C}from"../../webgl-engine/materials/MeasurementArrowMaterial.js";class y extends p{constructor(e){super(e),this._arrowWidth=16,this._arrowSubdivisions=128,this._origin=c(),this._originTransform=o(),this._arrowCenter=c(),this._renderOccluded=f.OccludeAndTransparent,this._geometry=null,this._stripeLength=1,this._stripesEnabled=!0,this._color=m(),this._contrastColor=m(),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._arrowMaterial?.setParameters({renderOccluded:e}))}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this._geometryChanged()}get stripeLength(){return this._stripeLength}set stripeLength(e){this._stripeLength=e,this.attached&&this._arrowMaterial.setParameters({stripeLength:this._stripeLength})}get stripesEnabled(){return this._stripesEnabled}set stripesEnabled(e){if(this._stripesEnabled=e,this.attached){const e=this._stripesEnabled?this._contrastColor:this._color;this._arrowMaterial.setParameters({stripeEvenColor:e})}}get color(){return this._color}set color(t){e(t,this._color)||(d(this._color,t),this._updateArrowColor())}get contrastColor(){return this._contrastColor}set contrastColor(t){e(t,this._color)||(d(this._contrastColor,t),this._updateArrowColor())}createExternalResources(){const e=this._color,r=this._contrastColor,o=this._stripesEnabled?r:e;this._arrowMaterial=new C({outlineColor:e,stripeEvenColor:o,stripeOddColor:e,renderOccluded:this.renderOccluded,polygonOffset:!0,isDecoration:this.isDecoration}),this._handles=new t,this._handles.add(s((()=>this.view.state.camera),(()=>{this._viewChanged()})))}destroyExternalResources(){this._arrowMaterial=null,this._handles=r(this._handles)}forEachExternalMaterial(e){e(this._arrowMaterial)}createGeometries(e){if(null==this._geometry?.startRenderSpace||null==this._geometry.endRenderSpace)return;const t=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);t.transformation=this._originTransform,e.addGeometry(t),this._viewChanged()}_createArrowGeometry(e,t,r,s){const o=this.view,a=o.renderCoordsHelper,n=[],l=[],c=(e,t)=>{const s=_.get();h(s,e,r),n.push(s),l.push(t)};if("euclidean"===s.type){s.eval(.5,this._arrowCenter);const r=_.get();if(a.worldUpAtPosition(this._arrowCenter,r),v(e,t,r)){const{heading:t,tilt:s}=o.camera,{direction:a}=g(o,e,t,s,j);i(r,a)}c(e,r),c(t,r)}else{s.eval(.5,this._arrowCenter);const e=this._arrowSubdivisions+1&-2;for(let t=0;t<e;++t){const r=t/(e-1),o=_.get(),i=_.get();s.eval(r,o),a.worldUpAtPosition(o,i),c(o,i)}}return w(this._arrowMaterial,n,l)}_geometryChanged(){this.recreateGeometry()}_viewChanged(){if(this.view.ready&&this.attached&&null!=this._geometry){const e=this.view.state.camera.computeScreenPixelSizeAt(this._arrowCenter);this._arrowMaterial.setParameters({width:this._arrowWidth*e})}}_updateArrowColor(){if(!this.attached)return;const e=this._color,t=this._contrastColor,r=this._stripesEnabled?t:e,s=e,o=e;this._arrowMaterial.setParameters({stripeEvenColor:r,outlineColor:s,stripeOddColor:o})}}function v(e,t,r){const s=a(b,t,e),o=n(b,s,r);return 0===l(o)}const b=c(),j=u();export{y as MeasurementArrowVisualElement};