@arcgis/core 4.34.0-next.61 → 4.34.0-next.64

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 (263) hide show
  1. package/AggregateGraphic.js +1 -1
  2. package/Graphic.js +1 -1
  3. package/TrackGraphic.js +1 -1
  4. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.js +1 -1
  5. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  6. package/applications/Components/actionUtils.d.ts +3 -0
  7. package/applications/Components/actionUtils.js +5 -0
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/{5de7c2a80bd9c81cefe2.js → 070b29cba896f46537f9.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{8c0e11f781607239749d.js → 0a36df6fdab95785d1ce.js} +1 -1
  11. package/assets/esri/core/workers/chunks/0b01c87db77246632ad9.js +1 -0
  12. package/assets/esri/core/workers/chunks/0b24a6c06d1becbb6815.js +1 -0
  13. package/assets/esri/core/workers/chunks/0cdf6b51f2a63f348530.js +1 -0
  14. package/assets/esri/core/workers/chunks/10ec10ca361842efce92.js +1 -0
  15. package/assets/esri/core/workers/chunks/{bdc18ef9cdc8242f014e.js → 1143313f2f6f34deaad7.js} +1 -1
  16. package/assets/esri/core/workers/chunks/226833d408eb1225e168.js +1 -0
  17. package/assets/esri/core/workers/chunks/2394ac65d64e50399d76.js +1 -0
  18. package/assets/esri/core/workers/chunks/33718ea851645d9078d1.js +1 -0
  19. package/assets/esri/core/workers/chunks/{69fbe363bb130fdd8146.js → 3d6f07e04f77cc0a7506.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{db7678104b18534482e3.js → 426232091caf8608e5f1.js} +1 -1
  21. package/assets/esri/core/workers/chunks/47febd4de836a33b51b1.js +1 -0
  22. package/assets/esri/core/workers/chunks/487afbf352d12c745430.js +1 -0
  23. package/assets/esri/core/workers/chunks/{3fd09a7c05583a57a317.js → 5d12862042b6bf9f9d54.js} +1 -1
  24. package/assets/esri/core/workers/chunks/5d65987f2c1b5c56a799.js +1 -0
  25. package/assets/esri/core/workers/chunks/5de07f7a09eb9f3ab666.js +1 -0
  26. package/assets/esri/core/workers/chunks/{ba0c7339fa19cc7cbde7.js → 5e1d6704ee0aa41b1d06.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{4ac127cefa3aa5e93e78.js → 657b01a6df8dc46c5209.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{71b222089f5e9dcee474.js → 6a1b652ccbf58ac44658.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{4050ddb580d364d9e205.js → 6ab435423acb0ed0b1c7.js} +1 -1
  30. package/assets/esri/core/workers/chunks/7b7f5028a488bb9c10f4.js +1 -0
  31. package/assets/esri/core/workers/chunks/{d83bdc13c3cad3eee7be.js → 7c3a1958990de095d3a1.js} +1 -1
  32. package/assets/esri/core/workers/chunks/808cfed7022e3846d5b2.js +1 -0
  33. package/assets/esri/core/workers/chunks/{b68b54be3d67595a9446.js → 861a6d6fe7958df36aa1.js} +35 -34
  34. package/assets/esri/core/workers/chunks/8bd5a0ff7dcf1067bf53.js +1 -0
  35. package/assets/esri/core/workers/chunks/{f462a138912e5379b6a7.js → 904c116c6b093e0e970c.js} +1 -1
  36. package/assets/esri/core/workers/chunks/99b20eef2893047fac10.js +1 -0
  37. package/assets/esri/core/workers/chunks/a16b471c3706ee37f9b6.js +1 -0
  38. package/assets/esri/core/workers/chunks/{bb2ab663e3e5597f2104.js → a1bd4eecca1e3272bffb.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{8005ae652361f506bc5f.js → a29fb90226bd08157bd1.js} +1 -1
  40. package/assets/esri/core/workers/chunks/a596d6ccb6103e594031.js +1 -0
  41. package/assets/esri/core/workers/chunks/a5e6359fadbd699b1c8e.js +1 -0
  42. package/assets/esri/core/workers/chunks/a7f3cdd9a249ef4572ce.js +1 -0
  43. package/assets/esri/core/workers/chunks/{d2bdd52d2291306a4e47.js → a80d769b0ed025f0df64.js} +1 -1
  44. package/assets/esri/core/workers/chunks/a987731d1b5449d8fb0c.js +1 -0
  45. package/assets/esri/core/workers/chunks/af83dddddbfe25194527.js +1 -0
  46. package/assets/esri/core/workers/chunks/{4d8d942fbd6750bb7567.js → b057e6d593c1607cae61.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{d707538b150d79050336.js → b1f1a26e7a2ef5b783ee.js} +1 -1
  48. package/assets/esri/core/workers/chunks/c337c1a2dbc452780dd7.js +1 -0
  49. package/assets/esri/core/workers/chunks/{a35a439f053d1fe0541b.js → c601bbdafdee5074b04f.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{d7ce68667bb355ef8e5d.js → c7a386ac90e58eb71935.js} +1 -1
  51. package/assets/esri/core/workers/chunks/c8694a27e2cf28b010e8.js +1 -0
  52. package/assets/esri/core/workers/chunks/cf69f6afeaf1229e032c.js +1 -0
  53. package/assets/esri/core/workers/chunks/d1e8220dcae1d01d3c35.js +1 -0
  54. package/assets/esri/core/workers/chunks/e12e8d69c05c182b6a69.js +1 -0
  55. package/assets/esri/core/workers/chunks/{220c8d6338f236298720.js → e6457ac25c0829ee039c.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{c77a97c723b8c17df186.js → e72aee3f857aa473822c.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{8374d87176486c1fc90e.js → eadac757f74470b89a36.js} +1 -1
  58. package/assets/esri/core/workers/chunks/f542bdc994a5ea3aa9d1.js +1 -0
  59. package/assets/esri/core/workers/chunks/{7c23be93d394f1bee941.js → f6107f844f4feed42828.js} +1 -1
  60. package/assets/esri/core/workers/chunks/f76774781865cb1411b0.js +1 -0
  61. package/assets/esri/core/workers/chunks/fd04df45cdcc6ff52554.js +1 -0
  62. package/assets/esri/layers/support/rasterFormats/qb3-wasm.wasm +0 -0
  63. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  64. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  65. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  66. package/chunks/BloomComposition.glsl.js +6 -5
  67. package/chunks/Fog.glsl.js +20 -13
  68. package/chunks/GaussianSplat.glsl.js +7 -0
  69. package/chunks/GaussianSplatComposition.glsl.js +7 -0
  70. package/chunks/GaussianSplatDepthComposition.glsl.js +11 -0
  71. package/chunks/RealisticTree.glsl.js +29 -28
  72. package/chunks/lyr3DMain.js +1 -1
  73. package/chunks/lyr3DWorker.js +1 -1
  74. package/chunks/qb3-wasm.js +5 -0
  75. package/chunks/vxlLayer.js +1 -1
  76. package/config.js +1 -1
  77. package/core/Collection.js +1 -1
  78. package/core/has.js +1 -1
  79. package/geometry/ellipsoidUtils.js +1 -1
  80. package/geometry/operators/geodeticUtilsOperator.d.ts +6 -0
  81. package/geometry/support/heightModelInfoUtils.js +1 -1
  82. package/graphic/AggregateGraphicOrigin.js +5 -0
  83. package/graphic/CSVGraphicOrigin.js +1 -1
  84. package/graphic/CatalogGraphicOrigin.js +1 -1
  85. package/graphic/FeatureGraphicOrigin.js +1 -1
  86. package/graphic/GeoJSONGraphicOrigin.js +1 -1
  87. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  88. package/graphic/OGCFeatureGraphicOrigin.js +1 -1
  89. package/graphic/OrientedImageryGraphicOrigin.js +1 -1
  90. package/graphic/ParquetGraphicOrigin.js +1 -1
  91. package/graphic/StreamGraphicOrigin.js +1 -1
  92. package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
  93. package/graphic/TrackGraphicOrigin.js +5 -0
  94. package/graphic/WFSGraphicOrigin.js +1 -1
  95. package/graphic/getPopupProvider.js +5 -0
  96. package/interfaces.d.ts +869 -38
  97. package/kernel.js +1 -1
  98. package/layers/GaussianSplatLayer.js +1 -1
  99. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  100. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  101. package/layers/VoxelWasmPerSceneView.js +1 -1
  102. package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
  103. package/layers/mixins/FeatureReductionLayer.js +1 -1
  104. package/layers/mixins/TrackableLayer.js +1 -1
  105. package/layers/support/GaussianSplatAtlasPageAllocator.js +5 -0
  106. package/layers/support/gaussianSplatUtils.js +5 -0
  107. package/layers/support/rasterDatasets/MRFRaster.js +1 -1
  108. package/layers/support/rasterFormats/Qb3.js +5 -0
  109. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  110. package/layers/support/tiles3DUtils.js +5 -0
  111. package/layers/video/VideoController.js +1 -1
  112. package/package.json +2 -2
  113. package/rest/knowledgeGraph/GraphApplyEditsResult.js +1 -1
  114. package/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js +1 -1
  115. package/rest/knowledgeGraphService.js +1 -1
  116. package/rest/lastMileDelivery/enums.js +5 -0
  117. package/rest/lastMileDelivery.d.ts +10 -0
  118. package/rest/lastMileDelivery.js +5 -0
  119. package/rest/route/utils.js +1 -1
  120. package/rest/support/JobInfo.js +1 -1
  121. package/rest/support/LastMileDeliveryParameters.d.ts +4 -0
  122. package/rest/support/LastMileDeliveryParameters.js +5 -0
  123. package/support/revision.js +1 -1
  124. package/symbols/IconSymbol3DLayer.js +1 -1
  125. package/symbols/TextSymbol3DLayer.js +1 -1
  126. package/symbols/patterns/StylePattern3D.js +1 -1
  127. package/symbols/patterns/styles.js +1 -1
  128. package/symbols/support/IconSymbol3DLayerResource.js +1 -1
  129. package/symbols/support/OccludedVisibility.js +5 -0
  130. package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
  131. package/symbols/support/Symbol3DIconOutline.js +1 -1
  132. package/unionTypes.d.ts +3 -0
  133. package/views/2d/analysis/AnalysisView2D.js +5 -0
  134. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +4 -0
  135. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +5 -0
  136. package/views/2d/analysis/analysisViewModuleImportUtils.js +5 -0
  137. package/views/2d/engine/webgl/Painter.js +1 -1
  138. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  139. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +5 -0
  140. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsDiffShader.js +5 -0
  141. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsMinMaxSumShader.js +5 -0
  142. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsStdDevShader.js +5 -0
  143. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsSumOfSquaredDiffShader.js +5 -0
  144. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  146. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  147. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  148. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  149. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  150. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  151. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  152. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  153. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  154. package/views/3d/analysis/AnalysisView3D.js +1 -1
  155. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  156. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  157. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  158. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +1 -1
  159. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +1 -1
  160. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization.js +5 -0
  161. package/views/3d/analysis/ElevationProfile/ElevationProfileSceneLineComputation.js +1 -1
  162. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +1 -1
  163. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  164. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  165. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  166. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  167. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  168. package/views/3d/analysis/analysisViewModuleImportUtils.js +5 -0
  169. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  170. package/views/3d/environment/Fog.glsl.js +1 -1
  171. package/views/3d/environment/Fog.js +1 -1
  172. package/views/3d/environment/FogTechniqueConfiguration.js +5 -0
  173. package/views/3d/environment/Precipitation.js +1 -1
  174. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  175. package/views/3d/layers/GraphicsView3D.js +1 -1
  176. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  177. package/views/3d/layers/{IntegratedMesh3DTilesViewPerformanceInfo.js → Lyr3DViewPerformanceInfo.js} +1 -1
  178. package/views/3d/layers/Lyr3DWasm.js +1 -1
  179. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  180. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  181. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  182. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  183. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  184. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  185. package/views/3d/layers/graphics/Labeler.js +1 -1
  186. package/views/3d/layers/support/LayerViewAnalysisViewManager.js +1 -1
  187. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  188. package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
  189. package/views/3d/support/QualitySettings.js +1 -1
  190. package/views/3d/support/pointsOfInterest/ContentGeometryUpdates.js +1 -1
  191. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  192. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  193. package/views/3d/webgl-engine/core/shaderLibrary/util/ComputeCovariance.glsl.js +40 -0
  194. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +59 -0
  195. package/views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js +23 -0
  196. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  197. package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +1 -1
  198. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +1 -1
  199. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  200. package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +4 -4
  201. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  202. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +5 -0
  203. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  204. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  205. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  206. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  207. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +5 -0
  208. package/views/3d/webgl-engine/shaders/GaussianSplatComposition.glsl.js +5 -0
  209. package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechnique.js +5 -0
  210. package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechniqueConfiguration.js +5 -0
  211. package/views/3d/webgl-engine/shaders/GaussianSplatDepthComposition.glsl.js +5 -0
  212. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +5 -0
  213. package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +5 -0
  214. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +5 -0
  215. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +5 -0
  216. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  217. package/views/SceneView.js +1 -1
  218. package/views/VideoView.js +1 -1
  219. package/views/View2D.js +1 -1
  220. package/views/analysis/AnalysisView.js +5 -0
  221. package/views/analysis/ElevationProfile/ElevationProfileInputLineComputation.js +1 -1
  222. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  223. package/views/analysis/ElevationProfile/ElevationProfileTool.js +5 -0
  224. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  225. package/views/layers/FeatureLayerView.js +1 -1
  226. package/views/support/AnalysisViewManager.js +1 -1
  227. package/views/webgl/FramebufferObject.js +1 -1
  228. package/widgets/CoordinateConversion/support/Format.js +1 -1
  229. package/widgets/Locate/LocateViewModel.js +1 -1
  230. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  231. package/widgets/Popup/actionUtils.js +1 -1
  232. package/assets/esri/core/workers/chunks/08d420cd7cfa19a10fa4.js +0 -1
  233. package/assets/esri/core/workers/chunks/17abab49db1813d3e192.js +0 -1
  234. package/assets/esri/core/workers/chunks/182383fd00008606bfaa.js +0 -1
  235. package/assets/esri/core/workers/chunks/188feb2bcbf8e48e3163.js +0 -1
  236. package/assets/esri/core/workers/chunks/232c76f122b1f519e099.js +0 -1
  237. package/assets/esri/core/workers/chunks/3124a8516e815efec973.js +0 -1
  238. package/assets/esri/core/workers/chunks/3461701a15be46603c56.js +0 -1
  239. package/assets/esri/core/workers/chunks/36acf191a2d48560c796.js +0 -1
  240. package/assets/esri/core/workers/chunks/40e1fbfbf3f3979b3713.js +0 -1
  241. package/assets/esri/core/workers/chunks/4b1daffa97fd90a554a0.js +0 -1
  242. package/assets/esri/core/workers/chunks/4b68783e8d1415d0a171.js +0 -1
  243. package/assets/esri/core/workers/chunks/5915f5ba9064097aee79.js +0 -1
  244. package/assets/esri/core/workers/chunks/5e1afea05b624b315d9f.js +0 -1
  245. package/assets/esri/core/workers/chunks/5ed7e139c72cd2b3ddba.js +0 -1
  246. package/assets/esri/core/workers/chunks/63f3e46bfa820436161c.js +0 -1
  247. package/assets/esri/core/workers/chunks/702d2c668dedf83421ca.js +0 -1
  248. package/assets/esri/core/workers/chunks/7b2ec80dca0fdb0442cf.js +0 -1
  249. package/assets/esri/core/workers/chunks/7b9178c3826f9ef52a00.js +0 -1
  250. package/assets/esri/core/workers/chunks/9a20390602126995f831.js +0 -1
  251. package/assets/esri/core/workers/chunks/a2150baf0661e2f28011.js +0 -1
  252. package/assets/esri/core/workers/chunks/a532614aa65fb52dee7b.js +0 -1
  253. package/assets/esri/core/workers/chunks/abededd48e0ea6cfec01.js +0 -1
  254. package/assets/esri/core/workers/chunks/ae1cb4c65d72217ae4d4.js +0 -1
  255. package/assets/esri/core/workers/chunks/c1c6202f7bef24b5db26.js +0 -1
  256. package/assets/esri/core/workers/chunks/c75b0243e5bb84738419.js +0 -1
  257. package/assets/esri/core/workers/chunks/d47c3431c501d77b1779.js +0 -1
  258. package/assets/esri/core/workers/chunks/f6d91256c4e5f8a0d5c0.js +0 -1
  259. package/assets/esri/core/workers/chunks/f711aeba1a2c184ddb43.js +0 -1
  260. package/graphic/isPopupProviderGraphicOrigin.js +0 -5
  261. package/views/2d/analysisViewModuleImportUtils.js +0 -5
  262. package/views/3d/analysis/ElevationProfile/ElevationProfileLinesVisualization.js +0 -5
  263. package/views/3d/analysisViewModuleImportUtils.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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import e from"../../../../core/Accessor.js";import r from"../../../../core/Collection.js";import{watch as t,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileHoveredPointVisualization as a}from"./ElevationProfileHoveredPointVisualization.js";let l=class extends e{constructor(o){super(o),this._hoveredPoints=new r}initialize(){this.addHandles([t(()=>{const{analysis:o,hoveredPoints:e,visible:r}=this.analysisViewData;return r?e.map((e,r)=>{const t=o.profiles.at(r);return!0===t?.viewOptions.hoveredPointVisible&&null!=e?{hoveredPoint:e,color:t.color}:null}).filter(o=>!!o):[]},o=>this._update(o),i)])}destroy(){this._hoveredPoints.drain(o=>o.destroy())}_update(o){const{view:e,_hoveredPoints:r}=this,t=o.length;for(;r.length>t;)r.pop()?.destroy();for(;r.length<t;){const o=new a({view:e});r.push(o)}for(let i=0;i<t;++i){const e=o[i],s=r.at(t-1-i);s.position=e.hoveredPoint,s.color=e.color}}};o([s()],l.prototype,"view",void 0),o([s()],l.prototype,"analysisViewData",void 0),o([s()],l.prototype,"_hoveredPoints",void 0),l=o([n("esri.views.3d.analysis.ElevationProfile.ElevationProfileHoveredPointsVisualization")],l);export{l as ElevationProfileHoveredPointsVisualization};
5
+ import{__decorate as o}from"tslib";import e from"../../../../core/Accessor.js";import r from"../../../../core/Collection.js";import{watch as t,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileHoveredPointVisualization as l}from"./ElevationProfileHoveredPointVisualization.js";import{getInputGeometry as a}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";let p=class extends e{constructor(o){super(o),this._hoveredPoints=new r}initialize(){const{analysisViewData:o}=this,{analysis:e}=o;this.addHandles([t(()=>{const{hoveredPoints:r,visible:t,progress:i}=o;return t?i<1?null:r.map((o,r)=>{const t=e.profiles.at(r);return!0===t?.viewOptions.hoveredPointVisible&&null!=o?{hoveredPoint:o,color:t.color}:null}).filter(o=>!!o):[]},o=>this._update(o),i),t(()=>a(e.input),()=>this._update([]),i)])}destroy(){this._hoveredPoints.drain(o=>o.destroy())}_update(o){if(!o)return;const{view:e,_hoveredPoints:r}=this,t=o.length;for(;r.length>t;)r.pop()?.destroy();for(;r.length<t;){const o=new l({view:e});r.push(o)}for(let i=0;i<t;++i){const e=o[i],s=r.at(t-1-i);s.position=e.hoveredPoint,s.color=e.color}}};o([s()],p.prototype,"view",void 0),o([s()],p.prototype,"analysisViewData",void 0),o([s()],p.prototype,"_hoveredPoints",void 0),p=o([n("esri.views.3d.analysis.ElevationProfile.ElevationProfileHoveredPointsVisualization")],p);export{p as ElevationProfileHoveredPointsVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as i}from"tslib";import e from"../../../../core/Accessor.js";import{createTask as t}from"../../../../core/asyncUtils.js";import{destroyHandle as s,handlesGroup as r}from"../../../../core/handleUtils.js";import{abortMaybe as o,removeMaybe as a}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as h,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{getGraphicEffectiveElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{Settings as g}from"../../interactive/editingTools/settings.js";import{OutlineVisualElement as u}from"../../interactive/visualElements/OutlineVisualElement.js";import{GraphicState as d}from"../../layers/graphics/GraphicState.js";import{getInputGraphic as v,isPolylineGraphic as y,getInputGeometry as f,isValidInputPath as _}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{highlightsSupported as w}from"../../../support/layerViewUtils.js";let j=class extends e{constructor(i){super(i),this._highlightTask=null,this._highlightHandle=null,this._visualElementHandle=null}initialize(){this._settings=new g({getTheme:()=>this.view.effectiveTheme}),this.addHandles(h(()=>{const{analysis:i,inputIsSketched:e,interactive:t,visible:s}=this.analysisViewData,r=v(i.input);return r&&(r.commitProperty("geometry"),r.commitProperty("layer")),{graphic:r,inputIsSketched:e,interactive:t,visible:s&&i.viewOptions.highlightEnabled}},({graphic:i,inputIsSketched:e,interactive:t,visible:s})=>{if(!s)return this._remove();e?e&&!t?this._showReshaping(i):this._remove():this._showHighlight(i)},n))}destroy(){this._remove()}get updating(){return null!=this._highlightTask&&!this._highlightTask.finished}_remove(){this._highlightTask=o(this._highlightTask),this._highlightHandle=a(this._highlightHandle),this._visualElementHandle=a(this._visualElementHandle)}_showHighlight(i){if(this._remove(),!y(i))return;const e=i.layer;e&&"building-component"!==e.type&&"subtype-sublayer"!==e.type&&(this._highlightTask=t(async t=>{const s=await this.view.whenLayerView(e);l(t),w(s)&&(this._highlightHandle=s.highlight(i))}))}_showReshaping(i){if(this._remove(),!i)return;const{view:e}=this,t=new u({view:e,geometry:b(i),attached:!1,elevationInfo:c(i),renderOccluded:8,isDecoration:!0}),o=new d({graphic:i}),a=[h(()=>o.isDraped,i=>{t.isDraped=i}),o.on("changed",()=>{t.geometry=b(i)}),e.trackGraphicState(o),e.maskOccludee(i),s(t)];this._settings.visualElements.lineObjects.outline.apply(t),t.attached=!0,this._visualElementHandle=r(a)}};function b(i){const e=f(i);return _(e)?e:null}i([p()],j.prototype,"view",void 0),i([p()],j.prototype,"analysisViewData",void 0),i([p()],j.prototype,"updating",null),j=i([m("esri.views.3d.analysis.ElevationProfile.ElevationProfileInputVisualization")],j);export{j as ElevationProifileInputVisualization};
5
+ import{__decorate as i}from"tslib";import e from"../../../../core/Accessor.js";import{createTask as t}from"../../../../core/asyncUtils.js";import{destroyHandle as s,handlesGroup as r}from"../../../../core/handleUtils.js";import{abortMaybe as o,removeMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{getGraphicEffectiveElevationInfo as m}from"../../../../support/elevationInfoUtils.js";import{Settings as g}from"../../interactive/editingTools/settings.js";import{OutlineVisualElement as d}from"../../interactive/visualElements/OutlineVisualElement.js";import{GraphicState as u}from"../../layers/graphics/GraphicState.js";import{isPolylineGraphic as v,getInputGeometry as y,isValidInputPath as f}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{highlightsSupported as _}from"../../../support/layerViewUtils.js";let w=class extends e{constructor(i){super(i),this._highlightTask=null,this._highlightHandle=null,this._visualElementHandle=null}initialize(){this._settings=new g({getTheme:()=>this.view.effectiveTheme}),this.addHandles(l(()=>{const{analysis:i,sketchGraphic:e,toolState:t,visible:s}=this.analysisViewData,{input:r,viewOptions:o}=i,h=v(r)?r:null;return{graphic:h,graphicLayer:h?.layer,sketchGraphic:e,toolState:t,visible:s,highlightEnabled:o.highlightEnabled}},({graphic:i,graphicLayer:e,sketchGraphic:t,toolState:s,visible:r,highlightEnabled:o})=>{if(!r)return this._remove();t&&"reshaping"!==s&&"sketching"!==s?this._showSketchedGraphic(t):i&&!t&&o?this._showHighlight(i,e):this._remove()},n))}destroy(){this._remove()}get updating(){return null!=this._highlightTask&&!this._highlightTask.finished}_remove(){this._highlightTask=o(this._highlightTask),this._highlightHandle=h(this._highlightHandle),this._visualElementHandle=h(this._visualElementHandle)}_showHighlight(i,e){this._remove(),e&&"building-component"!==e.type&&"subtype-sublayer"!==e.type&&(this._highlightTask=t(async t=>{const s=await this.view.whenLayerView(e);a(t),_(s)&&(this._highlightHandle=s.highlight(i))}))}_showSketchedGraphic(i){this._remove();const{view:e}=this,t=new d({view:e,geometry:j(i),attached:!1,elevationInfo:m(i),renderOccluded:8,isDecoration:!0}),o=new u({graphic:i}),h=[l(()=>o.isDraped,i=>{t.isDraped=i}),o.on("changed",()=>{t.geometry=j(i)}),e.trackGraphicState(o),e.maskOccludee(i),s(t)];this._settings.visualElements.lineObjects.outline.apply(t),t.attached=!0,this._visualElementHandle=r(h)}};function j(i){const e=y(i);return f(e)?e:null}i([c()],w.prototype,"view",void 0),i([c()],w.prototype,"analysisViewData",void 0),i([c()],w.prototype,"updating",null),w=i([p("esri.views.3d.analysis.ElevationProfile.ElevationProfileInputVisualization")],w);export{w as ElevationProifileInputVisualization};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import{watch as s,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as n,fromArray as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{OutlineVisualElement as m}from"../../interactive/visualElements/OutlineVisualElement.js";import{getConfig as u}from"../../../analysis/ElevationProfile/constants.js";import{getInputGeometry as c}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{createLineGeometry as f}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let v=class extends i{constructor(e){super(e),this._updateGeometryThrottled=r(e=>this._updateGeometry(e),u().profileLinesUpdateThrottleMillis)}initialize(){this._visualElement=new m({view:this.view,elevationInfo:{mode:"absolute-height",offset:0},innerWidth:0,innerColor:n(0,0,0,0),width:3,falloff:0,renderOccluded:16,isDecoration:!0}),this.addHandles([s(()=>({color:this.getResult()?.computation.profileLine.color,visible:this._effectiveVisible}),({color:e,visible:i})=>{e&&(this._visualElement.color=p(t.toUnitRGBA(e))),this._visualElement.visible=i,i||(this._visualElement.geometry=null)},o),s(()=>c(this.analysisViewData.analysis.input),()=>{this._visualElement.visible=!1,this._visualElement.geometry=null},o),s(()=>this._geometryUpdateParameters,e=>this._updateGeometryThrottled(e),o),this._updateGeometryThrottled])}destroy(){this._visualElement.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){return this.getResult()}get _effectiveVisible(){const{analysisViewData:e,_result:t}=this;return e.visible&&null!=t&&t.available&&t.computation.profileLine.viewOptions.lineVisible}get _geometryUpdateParameters(){if(!this._effectiveVisible)return null;const e=this._result;return e&&1===e.progress?{samples:e.samples,spatialReference:this.view.spatialReference}:null}_updateGeometry(e){e&&(this._visualElement.visible=!0,this._visualElement.geometry=f(e.samples,e.spatialReference))}};e([l()],v.prototype,"view",void 0),e([l()],v.prototype,"analysisViewData",void 0),e([l()],v.prototype,"getResult",void 0),e([l()],v.prototype,"updating",null),e([l()],v.prototype,"_result",null),e([l()],v.prototype,"_effectiveVisible",null),e([l()],v.prototype,"_geometryUpdateParameters",null),v=e([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileLineVisualization")],v);export{v as ElevationProfileLineVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{isIterable as t}from"../../../../core/iteratorUtils.js";import{memoize as r}from"../../../../core/memoize.js";import{watch as i}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as o}from"../../../../core/unitUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as l}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../../geometry/ellipsoidUtils.js";import{create as p,fromPoints as u}from"../../../../geometry/support/ray.js";import{GeometryDescriptor as m}from"../../../../layers/support/ElevationQuery.js";import{externalToInternalIntersectOptions as d}from"../../support/hitTest.js";import{Intersector as y}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as f}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{getInputGraphic as v}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{ElevationProfileLineComputation as h}from"../../../analysis/ElevationProfile/ElevationProfileLineComputation.js";const _=2e5;let w=class extends h{constructor(){super(...arguments),this.type="scene",this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependenciesMemoized=r((e,t,r,i,o,n,s)=>({inputGraphicUid:j(e),visibleLayers:t,maxIntersectionDistance:r,intersectOptions:i,view:o,stationary:n,spatialReference:s})),this._vecA=a(),this._vecB=a(),this._ray=p()}get minDemResolution(){const e=this._view;if(!e)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*o(e.spatialReference)}initialize(){const e=()=>this.onInvalidate(this);return this.addHandles([i(()=>this._queryElevationDependencies,e),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:r}){const i=this._queryElevationDependencies;if(null==i)throw new Error(`${this.declaredClass}: no dependencies`);const o=this._intersector;if(null==o)throw new Error(`${this.declaredClass}: no view`);const{intersectOptions:n,view:s,spatialReference:a}=i,c=s.renderCoordsHelper,p=s.sceneIntersectionHelper,d=this._vecA,y=this._vecA,f=this._vecB,v=this._ray;if(!a)return{geometry:e,noDataValue:t};const h=await m.fromGeometry(e).project(a,r);if(!h)return{geometry:e,noDataValue:t};const w=h.coordinates,j=w.length;for(let m=0;m<j;++m){const e=w[m];l(f,e.x,e.y,e.z??0),c.toRenderCoords(f,a,f),c.setAltitude(d,_,f);const r=u(d,f,v);p.computeIntersection(r,o,!0,n);const s=g(i,o.results.all);s?(s.getIntersectionPoint(y),c.fromRenderCoords(y,y,a),e.z=y[2]):e.z=t}return{geometry:h.export(),noDataValue:t}}get _queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependenciesMemoized(this.controller?.analysis.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter(e=>e.visible).toArray()??[]}get _intersectOptions(){const e=this._view;if(!e||e.destroyed)return{};const{include:r,exclude:i}=this.profileLine;return d(e,{include:r,exclude:[...this._pointCloudLayers,...t(i)?i:i?[i]:[]]})}get _pointCloudLayers(){const e=this._view;return e?e.allLayerViews.toArray().filter(e=>"point-cloud"===e.layer?.type).map(e=>e.layer):[]}get _view(){const e=this.controller.view;return"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?c(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(!e)return null;const t=new y(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=2,t}};function g({view:e,inputGraphicUid:t,maxIntersectionDistance:r},i){for(const o of i){if(!o.withinDistance(r))continue;const i=f(o,e);if(null==i||j(i)!==t)return o}return null}function j(e){const t=v(e);if(!t)return null;if(t.layer&&"objectIdField"in t.layer){const e=t.attributes[t.layer.objectIdField];if(e)return`o-${t.layer.id}-${e}`}return`u-${t.uid}`}e([n({readOnly:!0})],w.prototype,"minDemResolution",null),e([n()],w.prototype,"_queryElevationDependencies",null),e([n()],w.prototype,"_visibleLayers",null),e([n()],w.prototype,"_intersectOptions",null),e([n()],w.prototype,"_pointCloudLayers",null),e([n()],w.prototype,"_view",null),e([n()],w.prototype,"_maxIntersectionDistance",null),e([n()],w.prototype,"_intersector",null),w=e([s("esri.views.3d.analysis.ElevationProfile.ElevationProfileSceneLineComputation")],w);export{w as ElevationProfileSceneLineComputation};
5
+ import{__decorate as e}from"tslib";import{isIterable as t}from"../../../../core/iteratorUtils.js";import{memoize as r}from"../../../../core/memoize.js";import{throwIfAborted as i}from"../../../../core/promiseUtils.js";import{watch as o,whenOnce as n}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as s}from"../../../../core/unitUtils.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as c}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../geometry/ellipsoidUtils.js";import{create as m,fromPoints as d}from"../../../../geometry/support/ray.js";import{GeometryDescriptor as y}from"../../../../layers/support/ElevationQuery.js";import{externalToInternalIntersectOptions as f}from"../../support/hitTest.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as h}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{getInputGraphic as _}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{ElevationProfileLineComputation as g}from"../../../analysis/ElevationProfile/ElevationProfileLineComputation.js";const w=2e5;let j=class extends g{constructor(){super(...arguments),this.type="scene",this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependenciesMemoized=r((e,t,r,i,o,n,s)=>({inputGraphicUid:b(e),visibleLayers:t,maxIntersectionDistance:r,intersectOptions:i,view:o,stationary:n,spatialReference:s})),this._vecA=p(),this._vecB=p(),this._ray=m()}get minDemResolution(){const e=this._view;if(!e)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*s(e.spatialReference)}initialize(){const e=()=>this.onInvalidate(this);return this.addHandles([o(()=>this._queryElevationDependencies,e),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:r}){const o=this._queryElevationDependencies;if(null==o)throw new Error(`${this.declaredClass}: no dependencies`);const s=this._intersector;if(null==s)throw new Error(`${this.declaredClass}: no view`);const{intersectOptions:l,view:a,spatialReference:p}=o;await n(()=>a.stationary&&!a.interacting,{signal:r}),i(r);const u=a.renderCoordsHelper,m=a.sceneIntersectionHelper,f=this._vecA,v=this._vecA,h=this._vecB,_=this._ray;if(!p)return{geometry:e,noDataValue:t};const g=await y.fromGeometry(e).project(p,r);if(!g)return{geometry:e,noDataValue:t};const j=g.coordinates,b=j.length;for(let i=0;i<b;++i){const e=j[i];c(h,e.x,e.y,e.z??0),u.toRenderCoords(h,p,h),u.setAltitude(f,w,h);const r=d(f,h,_);m.computeIntersection(r,s,!0,l);const n=I(o,s.results.all);n?(n.getIntersectionPoint(v),u.fromRenderCoords(v,v,p),e.z=v[2]):e.z=t}return{geometry:g.export(),noDataValue:t}}get _queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependenciesMemoized(this.controller?.analysis.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter(e=>e.visible).toArray()??[]}get _intersectOptions(){const e=this._view;if(!e||e.destroyed)return{};const{include:r,exclude:i}=this.profileLine;return f(e,{include:r,exclude:[...this._pointCloudLayers,...t(i)?i:i?[i]:[]]})}get _pointCloudLayers(){const e=this._view;return e?e.allLayerViews.toArray().filter(e=>"point-cloud"===e.layer?.type).map(e=>e.layer):[]}get _view(){const e=this.controller.view;return"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?u(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(!e)return null;const t=new v(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=2,t}};function I({view:e,inputGraphicUid:t,maxIntersectionDistance:r},i){for(const o of i){if(!o.withinDistance(r))continue;const i=h(o,e);if(null==i||b(i)!==t)return o}return null}function b(e){const t=_(e);if(!t)return null;if(t.layer&&"objectIdField"in t.layer){const e=t.attributes[t.layer.objectIdField];if(e)return`o-${t.layer.id}-${e}`}return`u-${t.uid}`}e([l({readOnly:!0})],j.prototype,"minDemResolution",null),e([l()],j.prototype,"_queryElevationDependencies",null),e([l()],j.prototype,"_visibleLayers",null),e([l()],j.prototype,"_intersectOptions",null),e([l()],j.prototype,"_pointCloudLayers",null),e([l()],j.prototype,"_view",null),e([l()],j.prototype,"_maxIntersectionDistance",null),e([l()],j.prototype,"_intersector",null),j=e([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileSceneLineComputation")],j);export{j as ElevationProfileSceneLineComputation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as i}from"tslib";import o from"../../../../core/Accessor.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileHoveredPointsVisualization as e}from"./ElevationProfileHoveredPointsVisualization.js";import{ElevationProifileInputVisualization as a}from"./ElevationProfileInputVisualization.js";import{ElevationProfileLinesVisualization as r}from"./ElevationProfileLinesVisualization.js";let n=class extends o{constructor(i){super(i)}initialize(){const{view:i,analysisViewData:o}=this;this._hoveredPointsVisualization=new e({view:i,analysisViewData:o}),this._inputVisualization=new a({view:i,analysisViewData:o}),this._profileLinesVisualization=new r({view:i,analysisViewData:o})}destroy(){this._inputVisualization.destroy(),this._hoveredPointsVisualization.destroy(),this._profileLinesVisualization.destroy()}get updating(){return this._inputVisualization.updating||this._profileLinesVisualization.updating}};i([t()],n.prototype,"view",void 0),i([t()],n.prototype,"analysisViewData",void 0),i([t()],n.prototype,"updating",null),n=i([s("esri.views.3d.analysis.ElevationProfile.ElevationProfileVisualization")],n);export{n as ElevationProfileVisualization};
5
+ import{__decorate as i}from"tslib";import o from"../../../../core/Accessor.js";import{mapCollection as t}from"../../../../core/mapCollectionUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileHoveredPointsVisualization as a}from"./ElevationProfileHoveredPointsVisualization.js";import{ElevationProifileInputVisualization as r}from"./ElevationProfileInputVisualization.js";import{ElevationProfileLineVisualization as n}from"./ElevationProfileLineVisualization.js";let l=class extends o{constructor(i){super(i)}initialize(){const{view:i,analysisViewData:o}=this;this._hoveredPointsVisualization=new a({view:i,analysisViewData:o}),this._inputVisualization=new r({view:i,analysisViewData:o}),this._lineVisualizations=t(()=>this.analysisViewData.analysis.profiles,t=>new n({view:i,analysisViewData:o,getResult:()=>o.results.find(i=>i.computation.profileLine===t)}))}destroy(){this._inputVisualization.destroy(),this._hoveredPointsVisualization.destroy(),this._lineVisualizations.destroy()}get updating(){return this._inputVisualization.updating||this._lineVisualizations.some(i=>i.updating)}};i([s()],l.prototype,"view",void 0),i([s()],l.prototype,"analysisViewData",void 0),i([s()],l.prototype,"updating",null),l=i([e("esri.views.3d.analysis.ElevationProfile.ElevationProfileVisualization")],l);export{l as ElevationProfileVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{ElevationProfileSceneLineComputation as s}from"./ElevationProfile/ElevationProfileSceneLineComputation.js";import{ElevationProfileVisualization as n}from"./ElevationProfile/ElevationProfileVisualization.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileGroundLineComputation as a}from"../../analysis/ElevationProfile/ElevationProfileGroundLineComputation.js";import{ElevationProfileInputLineComputation as p}from"../../analysis/ElevationProfile/ElevationProfileInputLineComputation.js";import{ElevationProfileQueryLineComputation as u}from"../../analysis/ElevationProfile/ElevationProfileQueryLineComputation.js";let c=class extends(r(e)){constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null,this.inputIsSketched=!1}initialize(){this._controller=new l({analysis:this.analysis,analysisViewData:this,view:this.view,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new a(t);case"input":return new p(t);case"query":return new u(t);case"scene":return new s(t)}}}}),this._visualizattion=new n({view:this.view,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualizattion.destroy()}get units(){return this._controller.units}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return this._controller?.updating||this._visualizattion?.updating}get visible(){return super.visible}set visible(t){super.visible=t}};t([o({readOnly:!0})],c.prototype,"type",void 0),t([o({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",void 0),t([o({readOnly:!0})],c.prototype,"units",null),t([o()],c.prototype,"hoveredPosition",void 0),t([o()],c.prototype,"hoveredPoints",null),t([o({readOnly:!0})],c.prototype,"progress",null),t([o({readOnly:!0})],c.prototype,"results",null),t([o({readOnly:!0})],c.prototype,"statistics",null),t([o({readOnly:!0})],c.prototype,"updating",null),t([o()],c.prototype,"tool",void 0),t([o()],c.prototype,"inputIsSketched",void 0),t([o()],c.prototype,"_controller",void 0),t([o()],c.prototype,"_visualizattion",void 0),c=t([i("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],c);const v=c;export{v as default};
5
+ import{__decorate as t}from"tslib";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as i}from"./AnalysisView3D.js";import{ElevationProfileSceneLineComputation as r}from"./ElevationProfile/ElevationProfileSceneLineComputation.js";import{ElevationProfileVisualization as s}from"./ElevationProfile/ElevationProfileVisualization.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileGroundLineComputation as n}from"../../analysis/ElevationProfile/ElevationProfileGroundLineComputation.js";import{ElevationProfileInputLineComputation as a}from"../../analysis/ElevationProfile/ElevationProfileInputLineComputation.js";import{ElevationProfileQueryLineComputation as p}from"../../analysis/ElevationProfile/ElevationProfileQueryLineComputation.js";import{ElevationProfileTool as c}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let u=class extends i{constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:e}=this;this._controller=new l({analysis:t,analysisViewData:this,view:e,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":return new r(t)}}}}),this._visualization=new s({view:e,analysisViewData:this}),this._sketchTool=new c({view:e,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualization.destroy(),this._sketchTool?.destroy()}get units(){return this._controller.units}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return!0===this._controller.updating||!0===this._visualization.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickGraphic(t){return this._sketchTool.pickGraphic(t)}};t([e({readOnly:!0})],u.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([e({readOnly:!0})],u.prototype,"units",null),t([e()],u.prototype,"hoveredPosition",void 0),t([e()],u.prototype,"hoveredPoints",null),t([e({readOnly:!0})],u.prototype,"progress",null),t([e({readOnly:!0})],u.prototype,"results",null),t([e({readOnly:!0})],u.prototype,"statistics",null),t([e({readOnly:!0})],u.prototype,"updating",null),t([e()],u.prototype,"sketchGraphic",null),t([e()],u.prototype,"toolState",null),t([e()],u.prototype,"_controller",void 0),t([e()],u.prototype,"_visualization",void 0),t([e()],u.prototype,"_sketchTool",void 0),u=t([o("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],u);const h=u;export{h 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import i from"../../../core/Collection.js";import{EventedAccessor as s}from"../../../core/Evented.js";import"../../../core/has.js";import{abortMaybe as o,destroyMaybe as e}from"../../../core/maybe.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{AnalysisView3D as l}from"./AnalysisView3D.js";import{LineOfSightController as p}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as u}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightVisualization as y}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as h,removeAnalysisViewTool as c,startPlaceOperation as m}from"../../analysis/analysisViewUtils.js";let d=class extends(l(s)){constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new i,this.cursorTarget=null,this.editable=!0,this.elevationAlignedObserver=null,this.observerEngineLocation=n(),this.userOperation=null}initialize(){const t=this.view,i=this.analysis;this._analysisController=new p({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new y({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)}),h(this,u)])}destroy(){c(this),this.userOperation=o(this.userOperation),this._analysisController=e(this._analysisController),this._analysisVisualization=e(this._analysisVisualization)}get visible(){return super.visible}set visible(t){super.visible=t}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get results(){return this.computations.map(t=>t.result)}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}place(t){return m(this,{placementOptions:t})}getResultForTarget(t){return this.computations.find(i=>i.target===t)?.result}get testInfo(){}};t([r({readOnly:!0})],d.prototype,"type",void 0),t([r({constructOnly:!0,nonNullable:!0})],d.prototype,"analysis",void 0),t([r()],d.prototype,"tool",void 0),t([r({readOnly:!0})],d.prototype,"results",null),t([r()],d.prototype,"priority",null),t([r()],d.prototype,"computations",void 0),t([r()],d.prototype,"cursorTarget",void 0),t([r()],d.prototype,"editable",void 0),t([r()],d.prototype,"elevationAlignedObserver",void 0),t([r()],d.prototype,"observerEngineLocation",void 0),t([r()],d.prototype,"updating",null),t([r()],d.prototype,"userOperation",void 0),t([r()],d.prototype,"_analysisController",void 0),t([r()],d.prototype,"_analysisVisualization",void 0),d=t([a("esri.views.3d.analysis.LineOfSightAnalysisView3D")],d);const g=d;export{g as default};
5
+ import{__decorate as t}from"tslib";import i from"../../../core/Collection.js";import"../../../core/has.js";import{abortMaybe as s,destroyMaybe as o}from"../../../core/maybe.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{AnalysisView3D as n}from"./AnalysisView3D.js";import{LineOfSightController as l}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as p}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightVisualization as u}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as y,removeAnalysisViewTool as h,startPlaceOperation as c}from"../../analysis/analysisViewUtils.js";let d=class extends n{constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new i,this.cursorTarget=null,this.editable=!0,this.elevationAlignedObserver=null,this.observerEngineLocation=a(),this.userOperation=null}initialize(){const t=this.view,i=this.analysis;this._analysisController=new l({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new u({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)}),y(this,p)])}destroy(){h(this),this.userOperation=s(this.userOperation),this._analysisController=o(this._analysisController),this._analysisVisualization=o(this._analysisVisualization)}get visible(){return super.visible}set visible(t){super.visible=t}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get results(){return this.computations.map(t=>t.result)}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}place(t){return c(this,{placementOptions:t})}getResultForTarget(t){return this.computations.find(i=>i.target===t)?.result}get testInfo(){}};t([e({readOnly:!0})],d.prototype,"type",void 0),t([e({constructOnly:!0,nonNullable:!0})],d.prototype,"analysis",void 0),t([e()],d.prototype,"tool",void 0),t([e({readOnly:!0})],d.prototype,"results",null),t([e()],d.prototype,"priority",null),t([e()],d.prototype,"computations",void 0),t([e()],d.prototype,"cursorTarget",void 0),t([e()],d.prototype,"editable",void 0),t([e()],d.prototype,"elevationAlignedObserver",void 0),t([e()],d.prototype,"observerEngineLocation",void 0),t([e()],d.prototype,"updating",null),t([e()],d.prototype,"userOperation",void 0),t([e()],d.prototype,"_analysisController",void 0),t([e()],d.prototype,"_analysisVisualization",void 0),d=t([r("esri.views.3d.analysis.LineOfSightAnalysisView3D")],d);const m=d;export{m 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as i}from"tslib";import s from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as o}from"./AnalysisView3D.js";import{SliceController as l}from"./Slice/SliceController.js";import r from"./Slice/SliceTool.js";import{SliceVisualization as n}from"./Slice/SliceVisualization.js";import{connectAnalysisViewToTool as p,removeAnalysisViewTool as c,startPlaceOperation as y,startExclusiveInteractiveOperation as u}from"../../analysis/analysisViewUtils.js";let h=class extends(o(s)){constructor(i){super(i),this.type="slice-view-3d",this.analysis=null,this.tool=null,this.plane=null,this.active=!0,this.userOperation=null,this._analysisVisualization=null,this._analysisController=null}initialize(){this._analysisVisualization=new n({view:this.view,analysis:this.analysis,analysisViewData:this}),this._analysisController=new l({view:this.view,analysis:this.analysis,analysisViewData:this}),this.addHandles(p(this,r))}destroy(){c(this),this._analysisVisualization=t(this._analysisVisualization),this._analysisController=t(this._analysisController)}get visible(){return super.visible}set visible(i){super.visible=i}get interactive(){return super.interactive}set interactive(i){super.interactive=i}get editable(){return!this._analysisVisualization.preview}set editable(i){this._analysisVisualization.preview=!i}get showGrid(){return this._analysisVisualization?.showGrid??!1}set showGrid(i){this._analysisVisualization&&(this._analysisVisualization.showGrid=i)}get testData(){}place(i){return this.active=!0,y(this,{placementOptions:i,onToolActivated:i=>i.start("place")})}async pickLayerToExclude(i){return this.active=!0,u(this,{abortOptions:i,onToolActivated:i=>i.start("exclude")})}};i([e({readOnly:!0})],h.prototype,"type",void 0),i([e({constructOnly:!0,nonNullable:!0})],h.prototype,"analysis",void 0),i([e()],h.prototype,"tool",void 0),i([e()],h.prototype,"plane",void 0),i([e()],h.prototype,"active",void 0),i([e()],h.prototype,"editable",null),i([e()],h.prototype,"showGrid",null),i([e()],h.prototype,"userOperation",void 0),i([e()],h.prototype,"_analysisVisualization",void 0),i([e()],h.prototype,"_analysisController",void 0),h=i([a("esri.views.3d.analysis.SliceAnalysisView3D")],h);const d=h;export{d as default};
5
+ import{__decorate as i}from"tslib";import"../../../core/has.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as a}from"./AnalysisView3D.js";import{SliceController as o}from"./Slice/SliceController.js";import l from"./Slice/SliceTool.js";import{SliceVisualization as r}from"./Slice/SliceVisualization.js";import{connectAnalysisViewToTool as n,removeAnalysisViewTool as p,startPlaceOperation as y,startExclusiveInteractiveOperation as c}from"../../analysis/analysisViewUtils.js";let u=class extends a{constructor(i){super(i),this.type="slice-view-3d",this.analysis=null,this.tool=null,this.plane=null,this.active=!0,this.userOperation=null,this._analysisVisualization=null,this._analysisController=null}initialize(){this._analysisVisualization=new r({view:this.view,analysis:this.analysis,analysisViewData:this}),this._analysisController=new o({view:this.view,analysis:this.analysis,analysisViewData:this}),this.addHandles(n(this,l))}destroy(){p(this),this._analysisVisualization=s(this._analysisVisualization),this._analysisController=s(this._analysisController)}get visible(){return super.visible}set visible(i){super.visible=i}get interactive(){return super.interactive}set interactive(i){super.interactive=i}get editable(){return!this._analysisVisualization.preview}set editable(i){this._analysisVisualization.preview=!i}get showGrid(){return this._analysisVisualization?.showGrid??!1}set showGrid(i){this._analysisVisualization&&(this._analysisVisualization.showGrid=i)}get testData(){}place(i){return this.active=!0,y(this,{placementOptions:i,onToolActivated:i=>i.start("place")})}async pickLayerToExclude(i){return this.active=!0,c(this,{abortOptions:i,onToolActivated:i=>i.start("exclude")})}};i([t({readOnly:!0})],u.prototype,"type",void 0),i([t({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),i([t()],u.prototype,"tool",void 0),i([t()],u.prototype,"plane",void 0),i([t()],u.prototype,"active",void 0),i([t()],u.prototype,"editable",null),i([t()],u.prototype,"showGrid",null),i([t()],u.prototype,"userOperation",void 0),i([t()],u.prototype,"_analysisVisualization",void 0),i([t()],u.prototype,"_analysisController",void 0),u=i([e("esri.views.3d.analysis.SliceAnalysisView3D")],u);const h=u;export{h 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import i from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as d}from"../../../core/maybe.js";import{watch as n,initial as l,when as h,syncAndInitial as c}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{c as m,q as v}from"../../../chunks/vec32.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as f,isLoaded as V,projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{projectBoundingRect as _}from"../../../geometry/projection/projectBoundingRect.js";import{empty as g,containsPoint as j}from"../../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as R}from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as b}from"./support/projectionUtils.js";import{ViewshedComputedData as D}from"./Viewshed/ViewshedComputedData.js";import C from"./Viewshed/ViewshedTool.js";import{ViewshedVisualization as F}from"./Viewshed/ViewshedVisualization.js";import{Intersector as H}from"../webgl-engine/lib/Intersector.js";import{Viewshed as O}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as U,removeAnalysisViewTool as S,startPlaceOperation as A}from"../../analysis/analysisViewUtils.js";let N=class extends(R(i)){constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this._viewshedRenderNode=new O({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new H(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=o(()=>this.analysis.viewsheds,t=>{const s=new D({renderCoordsHelper:e.renderCoordsHelper,viewshed:t}),i=Symbol();return this.addHandles([n(()=>({valid:s.valid,canProject:f(s.observer?.spatialReference,this.view.spatialReference)||V()}),({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(s),t||b(this.analysis,s.observer.spatialReference,r.getLogger(this)))},l),...this._createFeatureReferenceHandles(s)],i),{viewshedComputedData:s,remove:()=>{this.removeHandles(i),this._removeViewshedsFromRenderer(s),s.destroy()}}}),this._visualization=new F({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this.addHandles([n(()=>this.visible,e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)}),n(()=>e.renderCoordsHelper,e=>{this.viewshedComputedDataHandles?.forEach(({viewshedComputedData:t})=>t.renderCoordsHelper=e)}),U(this,C),h(()=>this.interactive,()=>{this._unselectOtherViewsheds(this.selectedViewshed)},c)])}destroy(){this.userOperation=a(this.userOperation),S(this),this._visualization=d(this._visualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map(e=>e.viewshedComputedData).toArray())}_createFeatureReferenceHandles(e){const{view:t}=this;return[n(()=>[t.state.camera,t.slice.plane,e.viewshed.observer,e.targetRenderSpace,e.verticalFieldOfView,e.horizontalFieldOfView,e.feature],()=>{this._updateObserverFromFeature(t,e)},l),this._createElevationUpdateHandle(e),h(()=>e.needUpdateByFeature,()=>{this._updateObserverFromFeature(t,e),e.needUpdateByFeature=!1})]}_createElevationUpdateHandle(e){const t=(s,i)=>{const{view:r}=this,{observer:o}=e;if(null==o)return;const a=y(o,r.spatialReference);if(null!=a.pending)return void a.pending.finally(()=>t(s,i));const d=a.geometry;null!=d&&(_(s,i,T,r.spatialReference),j(T,[d.x,d.y])&&(e.needUpdateByFeature=!0))};return this.view.elevationProvider.on("elevation-change",({extent:e,spatialReference:s})=>t(e,s))}async createViewsheds(e){await A(this,{placementOptions:e,onToolActivated:e=>e.place("multiple")})}place(e){return A(this,{placementOptions:e,onToolActivated:e=>e.place("single")})}_addViewshedsToRenderer(e){this._viewshedRenderNode.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderNode.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.observerRenderSpace,o=i.targetRenderSpace,a=m(w(),r),d={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:t(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:m(w(),o),targetFeatureId:null};s(e,this._intersector,d,e=>Math.min(e,.05*i.farDistanceRenderSpace)),i.observerRenderSpaceOverride=v(a,r)?null:a}_unselectOtherViewsheds(e){if(null!=e)for(const t of this.view.tools.items)t!==this.tool&&t instanceof C&&(t.analysisViewData.selectedViewshed=null)}get test(){}};e([p({readOnly:!0})],N.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],N.prototype,"analysis",void 0),e([p()],N.prototype,"tool",void 0),e([p()],N.prototype,"_selectedViewshed",void 0),e([p()],N.prototype,"selectedViewshed",null),e([p()],N.prototype,"selectedViewshedComputedData",null),e([p()],N.prototype,"viewshedComputedDataHandles",void 0),e([p()],N.prototype,"userOperation",void 0),e([p()],N.prototype,"_visualization",void 0),e([p()],N.prototype,"_viewshedRenderNode",void 0),N=e([u("esri.views.3d.analysis.ViewshedAnalysisView3D")],N);const z=N,T=g();export{z as default};
5
+ import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import"../../../core/has.js";import i from"../../../core/Logger.js";import{mapCollection as r}from"../../../core/mapCollectionUtils.js";import{abortMaybe as o,destroyMaybe as a}from"../../../core/maybe.js";import{watch as d,initial as n,when as l,syncAndInitial as h}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{c as u,q as m}from"../../../chunks/vec32.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as w,isLoaded as f,projectOrLoad as V}from"../../../geometry/projectionUtils.js";import{projectBoundingRect as y}from"../../../geometry/projection/projectBoundingRect.js";import{empty as _,containsPoint as g}from"../../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as j}from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as R}from"./support/projectionUtils.js";import{ViewshedComputedData as b}from"./Viewshed/ViewshedComputedData.js";import D from"./Viewshed/ViewshedTool.js";import{ViewshedVisualization as C}from"./Viewshed/ViewshedVisualization.js";import{Intersector as F}from"../webgl-engine/lib/Intersector.js";import{Viewshed as H}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as O,removeAnalysisViewTool as U,startPlaceOperation as S}from"../../analysis/analysisViewUtils.js";let A=class extends j{constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this._viewshedRenderNode=new H({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new F(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=r(()=>this.analysis.viewsheds,t=>{const s=new b({renderCoordsHelper:e.renderCoordsHelper,viewshed:t}),r=Symbol();return this.addHandles([d(()=>({valid:s.valid,canProject:w(s.observer?.spatialReference,this.view.spatialReference)||f()}),({valid:e,canProject:t},r)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):r?.valid&&r?.canProject&&this._removeViewshedsFromRenderer(s),t||R(this.analysis,s.observer.spatialReference,i.getLogger(this)))},n),...this._createFeatureReferenceHandles(s)],r),{viewshedComputedData:s,remove:()=>{this.removeHandles(r),this._removeViewshedsFromRenderer(s),s.destroy()}}}),this._visualization=new C({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this.addHandles([d(()=>this.visible,e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)}),d(()=>e.renderCoordsHelper,e=>{this.viewshedComputedDataHandles?.forEach(({viewshedComputedData:t})=>t.renderCoordsHelper=e)}),O(this,D),l(()=>this.interactive,()=>{this._unselectOtherViewsheds(this.selectedViewshed)},h)])}destroy(){this.userOperation=o(this.userOperation),U(this),this._visualization=a(this._visualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map(e=>e.viewshedComputedData).toArray())}_createFeatureReferenceHandles(e){const{view:t}=this;return[d(()=>[t.state.camera,t.slice.plane,e.viewshed.observer,e.targetRenderSpace,e.verticalFieldOfView,e.horizontalFieldOfView,e.feature],()=>{this._updateObserverFromFeature(t,e)},n),this._createElevationUpdateHandle(e),l(()=>e.needUpdateByFeature,()=>{this._updateObserverFromFeature(t,e),e.needUpdateByFeature=!1})]}_createElevationUpdateHandle(e){const t=(s,i)=>{const{view:r}=this,{observer:o}=e;if(null==o)return;const a=V(o,r.spatialReference);if(null!=a.pending)return void a.pending.finally(()=>t(s,i));const d=a.geometry;null!=d&&(y(s,i,z,r.spatialReference),g(z,[d.x,d.y])&&(e.needUpdateByFeature=!0))};return this.view.elevationProvider.on("elevation-change",({extent:e,spatialReference:s})=>t(e,s))}async createViewsheds(e){await S(this,{placementOptions:e,onToolActivated:e=>e.place("multiple")})}place(e){return S(this,{placementOptions:e,onToolActivated:e=>e.place("single")})}_addViewshedsToRenderer(e){this._viewshedRenderNode.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderNode.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.observerRenderSpace,o=i.targetRenderSpace,a=u(v(),r),d={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:t(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:u(v(),o),targetFeatureId:null};s(e,this._intersector,d,e=>Math.min(e,.05*i.farDistanceRenderSpace)),i.observerRenderSpaceOverride=m(a,r)?null:a}_unselectOtherViewsheds(e){if(null!=e)for(const t of this.view.tools.items)t!==this.tool&&t instanceof D&&(t.analysisViewData.selectedViewshed=null)}get test(){}};e([p({readOnly:!0})],A.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],A.prototype,"analysis",void 0),e([p()],A.prototype,"tool",void 0),e([p()],A.prototype,"_selectedViewshed",void 0),e([p()],A.prototype,"selectedViewshed",null),e([p()],A.prototype,"selectedViewshedComputedData",null),e([p()],A.prototype,"viewshedComputedDataHandles",void 0),e([p()],A.prototype,"userOperation",void 0),e([p()],A.prototype,"_visualization",void 0),e([p()],A.prototype,"_viewshedRenderNode",void 0),A=e([c("esri.views.3d.analysis.ViewshedAnalysisView3D")],A);const N=A,z=_();export{N 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as r}from"../../../support/getDefaultUnitForView.js";import{AnalysisView3D as l}from"./AnalysisView3D.js";import{VolumeMeasurementCutFillController as n}from"./VolumeMeasurement/VolumeMeasurementCutFillController.js";import{VolumeMeasurementCutFillVisualization as a}from"./VolumeMeasurement/VolumeMeasurementCutFillVisualization.js";let u=class extends(l(e)){constructor(t){super(t),this.type="volume-measurement-view-3d",this.analysis=null,this.elevationAlignedGeometry=null,this.targetGeometry=null,this.tool=null}initialize(){const{analysis:t,view:e}=this;this._analysisController=new n({view:e,analysis:t,analysisViewData:this}),this._analysisVisualization=new a({view:e,analysisViewData:this})}destroy(){this._analysisController=s(this._analysisController),this._analysisVisualization=s(this._analysisVisualization)}get result(){return this._analysisController.result}get effectiveTargetElevation(){const{targetElevation:t}=this.analysis.cutFillOptions;if(null!=t)return t;const e=this.elevationAlignedGeometry?.extent;return e&&e.zmin&&e.zmax?(e.zmax+e.zmin)/2:null}get unit(){return this.analysis.unit??r(this.view)}get updating(){return null!=this._analysisController&&this._analysisController.updating}};t([i({readOnly:!0})],u.prototype,"type",void 0),t([i({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([i({readOnly:!0})],u.prototype,"result",null),t([i()],u.prototype,"elevationAlignedGeometry",void 0),t([i({type:Number})],u.prototype,"effectiveTargetElevation",null),t([i()],u.prototype,"targetGeometry",void 0),t([i()],u.prototype,"unit",null),t([i()],u.prototype,"updating",null),u=t([o("esri.views.3d.analysis.VolumeMeasurementAnalysisView3D")],u);const m=u;export{m as default};
5
+ import{__decorate as t}from"tslib";import{destroyMaybe as e}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as o}from"../../../support/getDefaultUnitForView.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{VolumeMeasurementCutFillController as l}from"./VolumeMeasurement/VolumeMeasurementCutFillController.js";import{VolumeMeasurementCutFillVisualization as n}from"./VolumeMeasurement/VolumeMeasurementCutFillVisualization.js";let a=class extends r{constructor(t){super(t),this.type="volume-measurement-view-3d",this.analysis=null,this.elevationAlignedGeometry=null,this.targetGeometry=null,this.tool=null}initialize(){const{analysis:t,view:e}=this;this._analysisController=new l({view:e,analysis:t,analysisViewData:this}),this._analysisVisualization=new n({view:e,analysisViewData:this})}destroy(){this._analysisController=e(this._analysisController),this._analysisVisualization=e(this._analysisVisualization)}get result(){return this._analysisController.result}get effectiveTargetElevation(){const{targetElevation:t}=this.analysis.cutFillOptions;if(null!=t)return t;const e=this.elevationAlignedGeometry?.extent;return e&&e.zmin&&e.zmax?(e.zmax+e.zmin)/2:null}get unit(){return this.analysis.unit??o(this.view)}get updating(){return null!=this._analysisController&&this._analysisController.updating}};t([s({readOnly:!0})],a.prototype,"type",void 0),t([s({constructOnly:!0,nonNullable:!0})],a.prototype,"analysis",void 0),t([s({readOnly:!0})],a.prototype,"result",null),t([s()],a.prototype,"elevationAlignedGeometry",void 0),t([s({type:Number})],a.prototype,"effectiveTargetElevation",null),t([s()],a.prototype,"targetGeometry",void 0),t([s()],a.prototype,"unit",null),t([s()],a.prototype,"updating",null),a=t([i("esri.views.3d.analysis.VolumeMeasurementAnalysisView3D")],a);const u=a;export{u as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import e from"../../../core/Error.js";const i={"area-measurement":()=>import("./AreaMeasurementAnalysisView3D.js"),dimension:()=>import("./DimensionAnalysisView3D.js"),"direct-line-measurement":()=>import("./DirectLineMeasurementAnalysisView3D.js"),"elevation-profile":()=>import("./ElevationProfileAnalysisView3D.js"),"line-of-sight":()=>import("./LineOfSightAnalysisView3D.js"),slice:()=>import("./SliceAnalysisView3D.js"),viewshed:()=>import("./ViewshedAnalysisView3D.js"),"volume-measurement":()=>import("./VolumeMeasurementAnalysisView3D.js")};function s(s){const n=i[s.type];if(!n)throw new e("analysis-view-module-import-utils:analysis-not-supported",`Analysis "${s.type}" is not supported`);return n()}export{s as importAnalysisViewModule};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import"../../../core/has.js";import{destroyMaybe as e}from"../../../core/maybe.js";import{watch as i,sync as r}from"../../../core/reactiveUtils.js";import{signal as s}from"../../../core/signal.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{l as a}from"../../../chunks/vec32.js";import{getReferenceEllipsoid as u}from"../../../geometry/ellipsoidUtils.js";import{cloudPresets as c}from"./CloudsPresets.js";import{CloudsRenderer as p}from"./CloudsRenderer.js";import{Precipitation as l}from"./Precipitation.js";import{heightLimit as h}from"./weather.js";import{SyncRenderPlugin as d}from"../webgl-engine/effects/RenderPlugin.js";let _=class extends d{constructor(t){super(t),this.produces=new Map([]),this._clouds=s(null),this._incarnation=0,this._precipitation=null}initialize(){this.view.stage?.addRenderPlugin(this)}destroy(){this.removeHandles(),this.uninitializeRenderContext(),this.view?.stage?.removeRenderPlugin(this),this._set("view",null)}get updating(){return!!this._clouds.value?.readyToRun}get weatherAvailable(){return a(this.view.state.camera.eye)-u(this.view.spatialReference).radius<=h}get usedMemory(){return this._clouds.value?.usedMemory??0}_fadeOutPrecipitation(){this._precipitation&&(this._precipitationOutgoing?.destroy(),this._precipitationOutgoing=this._precipitation,this._precipitationOutgoing.fadeOut(()=>{this._precipitationOutgoing=e(this._precipitationOutgoing)}),this._precipitation=null,++this._incarnation)}get weather(){return this.view?.environmentManager?.weatherEnabled?this.view.environment.weather:null}initializeRenderContext(t){this._context=t;const e=this.view,s=()=>this._requestRender();this.addHandles([i(()=>this._precipitation,s,r),i(()=>this._clouds.value?.state,s,r),i(()=>e.state.mode,s,r),i(()=>this._updateClouds(),s,r),i(()=>this._updatePrecipitation(),s,r),i(()=>this.weather,t=>this._initWeather(t))])}uninitializeRenderContext(){this._context=null,this._clouds.value=e(this._clouds.value),this._precipitation=e(this._precipitation),this._precipitationOutgoing=e(this._precipitationOutgoing)}prepareRender(t){const{bind:e,time:i}=t;if("local"!==this.view.viewingMode&&e.clouds.data){e.clouds.fade(e.camera,i,this.view.qualitySettings.fadeDuration);const t=this._clouds.value;t&&0===t.state&&0===t.coverage&&!t.readyToRun&&t.destroyCubeMap()}}acquireTechniques(){return[]}render(){}_requestRender(){this._context?.requestRender()}_initWeather(t){const i=this._context;if(!t||!i)return void(this._clouds.value=e(this._clouds.value));if(this._clouds.value)return;const r=this.view;this._clouds.value=new p({context:i,view:r,requestRender:()=>this._requestRender()})}_updateClouds(){const t=this.view.environment.weather;return null==t||null==this._clouds.value||this._clouds.value.applyPreset(c[t.type],v(t)),++this._incarnation}_updatePrecipitation(){const t=this.view.environment.weather;if(t.type===this._precipitation?.type)return this._incarnation;this._fadeOutPrecipitation();const e="rainy"===t.type||"snowy"===t.type,i=this._context;return e&&i&&(this._precipitation=new l({view:this.view,type:t.type}),++this._incarnation),this._incarnation}get test(){}hasHighlight(){return!1}};function v(t){switch(t.type){case"rainy":case"snowy":case"cloudy":case"sunny":return t.cloudCover;case"foggy":return t.fogStrength}}t([n({constructOnly:!0})],_.prototype,"view",void 0),t([n({type:Boolean,readOnly:!0})],_.prototype,"updating",null),t([n()],_.prototype,"weatherAvailable",null),t([n()],_.prototype,"_context",void 0),_=t([o("esri.views.3d.environment.EnvironmentRenderer")],_);export{_ as EnvironmentRenderer};
5
+ import{__decorate as t}from"tslib";import"../../../core/has.js";import{destroyMaybe as e}from"../../../core/maybe.js";import{watch as i,sync as r}from"../../../core/reactiveUtils.js";import{signal as s}from"../../../core/signal.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{l as a}from"../../../chunks/vec32.js";import{getReferenceEllipsoid as u}from"../../../geometry/ellipsoidUtils.js";import{cloudPresets as c}from"./CloudsPresets.js";import{CloudsRenderer as p}from"./CloudsRenderer.js";import{Precipitation as h}from"./Precipitation.js";import{heightLimit as l}from"./weather.js";import{SyncRenderPlugin as d}from"../webgl-engine/effects/RenderPlugin.js";let _=class extends d{constructor(t){super(t),this.produces=new Map([]),this._clouds=s(null),this._incarnation=0,this._precipitation=null}initialize(){this.view.stage?.addRenderPlugin(this)}destroy(){this.removeHandles(),this.uninitializeRenderContext(),this.view?.stage?.removeRenderPlugin(this),this._set("view",null)}get updating(){return!!this._clouds.value?.readyToRun}get weatherAvailable(){return a(this.view.state.camera.eye)-u(this.view.spatialReference).radius<=l}get usedMemory(){return this._clouds.value?.usedMemory??0}_fadeOutPrecipitation(){this._precipitation&&(this._precipitationOutgoing?.destroy(),this._precipitationOutgoing=this._precipitation,this._precipitationOutgoing.fadeOut(()=>{this._precipitationOutgoing=e(this._precipitationOutgoing)}),this._precipitation=null,++this._incarnation)}get _snowCover(){return this._precipitationOutgoing?.snowCover??this._precipitation?.snowCover??0}get weather(){return this.view?.environmentManager?.weatherEnabled?this.view.environment.weather:null}initializeRenderContext(t){this._context=t;const e=this.view,s=()=>this._requestRender();this.addHandles([i(()=>this._precipitation,s,r),i(()=>this._clouds.value?.state,s,r),i(()=>e.state.mode,s,r),i(()=>this._updateClouds(),s,r),i(()=>this._updatePrecipitation(),s,r),i(()=>this.weather,t=>this._initWeather(t))])}uninitializeRenderContext(){this._context=null,this._clouds.value=e(this._clouds.value),this._precipitation=e(this._precipitation),this._precipitationOutgoing=e(this._precipitationOutgoing)}prepareRender(t){const{bind:e,time:i}=t;if(1===this.view.state.viewingMode){if(e.clouds.data){e.clouds.fade(e.camera,i,this.view.qualitySettings.fadeDuration);const t=this._clouds.value;t&&0===t.state&&0===t.coverage&&!t.readyToRun&&t.destroyCubeMap()}e.snowCover=this._snowCover}}acquireTechniques(){return[]}render(){}_requestRender(){this._context?.requestRender()}_initWeather(t){const i=this._context;if(!t||!i)return void(this._clouds.value=e(this._clouds.value));if(this._clouds.value)return;const r=this.view;this._clouds.value=new p({context:i,view:r,requestRender:()=>this._requestRender()})}_updateClouds(){const t=this.view.environment.weather;return null==t||null==this._clouds.value||this._clouds.value.applyPreset(c[t.type],v(t)),++this._incarnation}_updatePrecipitation(){const t=this.view.environment.weather;if(t.type===this._precipitation?.type)return this._incarnation;this._fadeOutPrecipitation();const e="rainy"===t.type||"snowy"===t.type,i=this._context;return e&&i&&(this._precipitation=new h({view:this.view,type:t.type}),++this._incarnation),this._incarnation}hasHighlight(){return!1}get test(){}};function v(t){switch(t.type){case"rainy":case"snowy":case"cloudy":case"sunny":return t.cloudCover;case"foggy":return t.fogStrength}}t([o({constructOnly:!0})],_.prototype,"view",void 0),t([o({type:Boolean,readOnly:!0})],_.prototype,"updating",null),t([o()],_.prototype,"weatherAvailable",null),t([o()],_.prototype,"_context",void 0),_=t([n("esri.views.3d.environment.EnvironmentRenderer")],_);export{_ as EnvironmentRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import"../webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import"../webgl-engine/core/shaderModules/Float3BindUniform.js";import"../webgl-engine/core/shaderModules/Float3PassUniform.js";import"../webgl-engine/core/shaderModules/FloatPassUniform.js";import"../webgl-engine/core/shaderModules/glsl.js";import"../webgl-engine/core/shaderModules/Texture2DBindUniform.js";import"../webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js";import"../webgl-engine/shaders/SphereIntersect.glsl.js";import"../webgl-engine/shaders/ToneMapping.glsl.js";import"../../webgl/NoParameters.js";import"../../webgl/ShaderBuilder.js";export{F as FogPassParameters,b as build}from"../../../chunks/Fog.glsl.js";
5
+ import"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import"../webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import"../webgl-engine/core/shaderModules/Float3BindUniform.js";import"../webgl-engine/core/shaderModules/Float3PassUniform.js";import"../webgl-engine/core/shaderModules/FloatPassUniform.js";import"../webgl-engine/core/shaderModules/glsl.js";import"../webgl-engine/core/shaderModules/Texture2DBindUniform.js";import"../webgl-engine/core/shaderModules/Texture2DPassUniform.js";import"../webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js";import"../webgl-engine/shaders/SphereIntersect.glsl.js";import"../webgl-engine/shaders/ToneMapping.glsl.js";import"../../webgl/NoParameters.js";import"../../webgl/ShaderBuilder.js";export{F as FogPassParameters,b as build}from"../../../chunks/Fog.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{lerp as t,smoothstep as r}from"../../../core/mathUtils.js";import{watch as s,syncAndInitial as a}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{c as o,n,e as m,g as h,m as p,l as c}from"../../../chunks/vec32.js";import{fromValues as d,create as l}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as g}from"../webgl.js";import{F as u}from"../../../chunks/Fog.glsl.js";import{FogTechnique as f}from"./FogTechnique.js";import{heightLimit as w}from"./weather.js";import{TransparentEnvironment as P}from"../webgl-engine/effects/TransparentEnvironment.js";import{DepthStencilAttachment as y}from"../../webgl/enums.js";const b=.95,v=1;let j=class extends P{constructor(e){super(e),this.requireGeometryDepth=!0,this._newParameters=new F,this._oldParameters=new F,this._fadedParameters=new F,this._parameters=this._newParameters,this._passParameters=new u;const t=_(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight,e.view.stage?.renderView.techniques.precompile(f)}toogle(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}initialize(){this.addHandles([s(()=>this.view.environment.atmosphereEnabled,()=>this.toogle(),a),s(()=>this.view.environment.weather,()=>this.toogle(),a),s(()=>this._updateFogParameters(),()=>{},a)]),this.addHandles(s(()=>this._fadeFactor,e=>this._fade(e),a))}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:r}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=r:(this._fadedParameters.lerp(r,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const e=this.view.environment.weather,r="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength="foggy"===e.type?t(3e-5,.005,e.fogStrength**3):"snowy"===e.type||"rainy"===e.type?t(4e-6,2e-4,(e.precipitation??0)**3):0,this._newParameters.amount=r?1:0,"foggy"!==e.type&&"snowy"!==e.type||o(this._newParameters.color,x),"rainy"===e.type&&o(this._newParameters.color,E),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(1)}render(e){const t=e.find(({name:e})=>e===g.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;const r=this.techniques.get(f);if(!r.compiled)return this.requestRender(1),t;const s=this.renderingContext,a=t.getAttachment(y);return t.attachDepth(null),s.bindFramebuffer(t.fbo),s.bindTechnique(r,this.bindParameters,this._passParameters),s.screen.draw(),t.attachDepth(a),t}_update(){const e=this.bindParameters.camera;n(R,e.eye);const t=Math.max(0,m(R,this.bindParameters.lighting.mainLight.direction)),s=this._parameters.color;h(q,s,.1),p(this._passParameters.color,q,s,t);const a=c(e.eye);this._passParameters.atmosphereC=a**2-this._atmosphereRadius**2,this._passParameters.amount=(1-r(b*w,v*w,Math.abs(a-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}};j=e([i("esri.views.3d.environment.Fog")],j);class F{constructor(){this.color=l(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,o(this.color,e.color)}lerp(e,r,s){this.amount=t(e.amount,r.amount,s),this.strength=t(e.strength,r.strength,s),p(this.color,e.color,r.color,s)}}const R=l(),q=l(),E=d(.5,.5,.5),x=d(1.5,1.5,1.5);export{j as Fog,F as FogParameters};
5
+ import{__decorate as e}from"tslib";import{lerp as t,smoothstep as s}from"../../../core/mathUtils.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{c as n,n as m,e as h,g as c,m as p,l}from"../../../chunks/vec32.js";import{fromValues as d,create as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as g}from"../webgl.js";import{F as _}from"../../../chunks/Fog.glsl.js";import{FogTechnique as w}from"./FogTechnique.js";import{FogTechniqueConfiguration as P}from"./FogTechniqueConfiguration.js";import{heightLimit as y}from"./weather.js";import{TransparentEnvironment as b}from"../webgl-engine/effects/TransparentEnvironment.js";import{Blit as v}from"../webgl-engine/effects/blit/Blit.js";import{ColorAttachment1 as j,DepthStencilAttachment as F}from"../../webgl/enums.js";const E=.95,R=1;let T=class extends b{constructor(e){super(e),this.consumes={required:[g.TRANSPARENT_ENVIRONMENT]},this._configuration=new P,this.requireGeometryDepth=!0,this._newParameters=new q,this._oldParameters=new q,this._fadedParameters=new q,this._parameters=this._newParameters,this._passParameters=new _,this._blit=null;const t=f(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight;const s=e.view.stage.renderView.techniques;s.precompile(w,this._configuration),this._configuration.modifiedByEmissive=!this._configuration.modifiedByEmissive,s.precompile(w,this._configuration),this._configuration.modifiedByEmissive=!this._configuration.modifiedByEmissive}toogle(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}initialize(){this.addHandles([r(()=>this.view.environment.atmosphereEnabled,()=>this.toogle(),i),r(()=>this.view.environment.weather,()=>this.toogle(),i),r(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(r(()=>this._fadeFactor,e=>this._fade(e),i))}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const e=this.view.environment.weather,s="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength="foggy"===e.type?t(3e-5,.005,e.fogStrength**3):"snowy"===e.type||"rainy"===e.type?t(4e-6,2e-4,(e.precipitation??0)**3):0,this._newParameters.amount=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,B),"rainy"===e.type&&n(this._newParameters.color,A),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(1)}render(e){const t=e.find(({name:e})=>e===g.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;const s=t.getAttachment(j);this._configuration.modifiedByEmissive=null!=s;const r=this.techniques.get(w,this._configuration);if(!r.compiled)return this.requestRender(1),t;const i=t.getAttachment(F),a=this.renderingContext,{fullWidth:o,fullHeight:n}=this.bindParameters.camera,m=o,h=n;let c=null;return s&&(c=this.fboCache.acquire(m,h,"bloomHorizontal",8),this._blit??=new v(this.techniques),this._blit.blitTexture(a,s?.attachment,c,this.bindParameters)),t.attachDepth(null),a.bindFramebuffer(t.fbo),s&&(this._passParameters.emission=c?.getTexture()),a.bindTechnique(r,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),c?.release(),t}_update(){const e=this.bindParameters.camera;m(N,e.eye);const t=Math.max(0,h(N,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;c(x,r,.1),p(this._passParameters.color,x,r,t);const i=l(e.eye);this._passParameters.atmosphereC=i**2-this._atmosphereRadius**2,this._passParameters.amount=(1-s(E*y,R*y,Math.abs(i-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}};e([a()],T.prototype,"consumes",void 0),T=e([o("esri.views.3d.environment.Fog")],T);class q{constructor(){this.color=u(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,s,r){this.amount=t(e.amount,s.amount,r),this.strength=t(e.strength,s.strength,r),p(this.color,e.color,s.color,r)}}const N=u(),x=u(),A=d(.5,.5,.5),B=d(1.5,1.5,1.5);export{T as Fog,q as FogParameters};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import{parameter as i,ShaderTechniqueConfiguration as o}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends o{constructor(){super(...arguments),this.modifiedByEmissive=!1}}e([i()],r.prototype,"modifiedByEmissive",void 0);export{r as FogTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{lerp as t}from"../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../core/maybe.js";import{watch as s,syncAndInitial as i,sync as o}from"../../../core/reactiveUtils.js";import{secondsFromMilliseconds as n}from"../../../core/time.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as d}from"../../../geometry/ellipsoidUtils.js";import{getContinuousIndexArray as m}from"../../../geometry/support/Indices.js";import{InternalRenderCategory as p}from"../webgl.js";import{PrecipitationPassParameters as f,PrecipitationTechnique as h}from"./PrecipitationTechnique.js";import{PrecipitationTechniqueConfiguration as u}from"./PrecipitationTechniqueConfiguration.js";import{glLayout as l}from"../support/buffer/glUtil.js";import{newLayout as _}from"../support/buffer/InterleavedLayout.js";import{TransparentEnvironment as b}from"../webgl-engine/effects/TransparentEnvironment.js";import{VertexArrayObject as y}from"../webgl-engine/lib/VertexArrayObject.js";import{PrimitiveType as g}from"../../webgl/enums.js";import{bindVertexBufferLayout as j}from"../../webgl/Util.js";import{fromLayout as w}from"../../webgl/VertexAttributeLocations.js";import{VertexBuffer as P}from"../../webgl/VertexBuffer.js";let v=class extends b{constructor(e){super(e),this._rainSpeed=.1,this._snowSpeed=.01,this._numParticles=0,this._passParameters=new f,this._configuration=new u;const{view:t,type:r}=e;this._configuration.type="rainy"===r?0:1,t.stage.renderView.techniques.precompile(h,this._configuration),this._passParameters.time=0,this._passParameters.radius=d(t.spatialReference).radius,this.addHandles([s(()=>t.environment.weather,e=>{e.type===r&&this.addHandles(s(()=>e.precipitation,e=>this._adjustParticles(e),i))},i)]),this.addHandles(s(()=>t.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>{this._passParameters.opacity=e,1===e&&(this.removeHandles("opacity"),this.addHandles(s(()=>t.stage?.renderer.renderContext.bind.clouds.opacity??1,e=>this._passParameters.opacity=e,i),"opacity"))},o),"opacity")}initialize(){this.addHandles([s(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),i)])}_adjustParticles(e){const r=.35,s=e<.5?t(0,r,2*e):t(r,1,2*(e-.5));this._numParticles=A*s}destroy(){this._numParticles=0,this._vao=r(this._vao),this._instanceIdBuffer=r(this._instanceIdBuffer)}fadeOut(e){this.removeAllHandles(),this.addHandles(s(()=>this.renderContext?.bind.clouds.fadeFactor??1,t=>{this._passParameters.opacity=1-t,1===t&&(this.removeAllHandles(),e())}),"opacity")}updateAnimation(e){const t=("rainy"===this.type?this._rainSpeed:this._snowSpeed)*n(e.time)%1e5;return this._passParameters.time!==t&&(this._passParameters.time=t,!0)}render(e){const t=this.renderingContext,r=Math.round(this._numParticles*this._passParameters.opacity),s=e.find(({name:e})=>e===p.TRANSPARENT_ENVIRONMENT);if(r<1)return s;const i=this.techniques.get(h,this._configuration);if(!i.compiled)return this.requestRender(1),s;const o=t.bindTechnique(i,this.bindParameters,this._passParameters);return this._vao??=I(t),t.bindVAO(this._vao),this._bindInstanceIdBuffer(o.locations),o.assertCompatibleVertexAttributeLocations(this._vao,w(B)),t.drawArraysInstanced(g.TRIANGLES,0,3,r),t.unbindBuffer(34962),s}_bindInstanceIdBuffer(e){const t=this.renderingContext;if(this._instanceIdBuffer)return void t.bindBuffer(this._instanceIdBuffer);const r=m(A);this._instanceIdBuffer=new P(t,B,new Float32Array(r)),j(t,e,this._instanceIdBuffer,0)}};function I(e){const t=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new y(e,new P(e,l(x),t))}e([a({constructOnly:!0})],v.prototype,"type",void 0),v=e([c("esri.views.3d.environment.Precipitation")],v);const A=25e4,x=_().vec3f("position").freeze(),B=l(_().f32("instanceFeatureAttribute"),1);export{v as Precipitation};
5
+ import{__decorate as e}from"tslib";import{lerp as t}from"../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../core/maybe.js";import{watch as s,syncAndInitial as i,sync as o}from"../../../core/reactiveUtils.js";import{secondsFromMilliseconds as n}from"../../../core/time.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as p}from"../../../geometry/ellipsoidUtils.js";import{getContinuousIndexArray as d}from"../../../geometry/support/Indices.js";import{InternalRenderCategory as m}from"../webgl.js";import{PrecipitationPassParameters as h,PrecipitationTechnique as f}from"./PrecipitationTechnique.js";import{PrecipitationTechniqueConfiguration as u}from"./PrecipitationTechniqueConfiguration.js";import{glLayout as l}from"../support/buffer/glUtil.js";import{newLayout as _}from"../support/buffer/InterleavedLayout.js";import{TransparentEnvironment as b}from"../webgl-engine/effects/TransparentEnvironment.js";import{VertexArrayObject as y}from"../webgl-engine/lib/VertexArrayObject.js";import{PrimitiveType as w}from"../../webgl/enums.js";import{bindVertexBufferLayout as g}from"../../webgl/Util.js";import{fromLayout as j}from"../../webgl/VertexAttributeLocations.js";import{VertexBuffer as v}from"../../webgl/VertexBuffer.js";let P=class extends b{constructor(e){super(e),this._hasSnowCover=!1,this._rainSpeed=.1,this._snowSpeed=.01,this._numParticles=0,this._passParameters=new h,this._configuration=new u;const{view:t,type:r}=e;this._configuration.type="rainy"===r?0:1,t.stage.renderView.techniques.precompile(f,this._configuration),this._passParameters.time=0,this._passParameters.radius=p(t.spatialReference).radius,this.addHandles([s(()=>t.environment.weather,e=>{e.type===r&&this.addHandles([s(()=>e.precipitation,e=>this._adjustParticles(e),i),s(()=>"snowy"===e.type&&"enabled"===e.snowCover,e=>this._hasSnowCover=e,i)])},i)]),this.addHandles(s(()=>t.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>{this._passParameters.opacity=e,1===e&&(this.removeHandles("opacity"),this.addHandles(s(()=>t.stage?.renderer.renderContext.bind.clouds.opacity??1,e=>this._passParameters.opacity=e,i),"opacity"))},o),"opacity")}initialize(){this.addHandles([s(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),i)])}_adjustParticles(e){const r=.35,s=e<.5?t(0,r,2*e):t(r,1,2*(e-.5));this._numParticles=A*s}destroy(){this._numParticles=0,this._vao=r(this._vao),this._instanceIdBuffer=r(this._instanceIdBuffer)}fadeOut(e){this.removeAllHandles(),this.addHandles(s(()=>this.renderContext?.bind.clouds.fadeFactor??1,t=>{this._passParameters.opacity=1-t,1===t&&(this.removeAllHandles(),e())}),"opacity")}get snowCover(){return this._hasSnowCover?this._passParameters.opacity:null}updateAnimation(e){const t=("rainy"===this.type?this._rainSpeed:this._snowSpeed)*n(e.time)%1e5;return this._passParameters.time!==t&&(this._passParameters.time=t,!0)}render(e){const t=this.renderingContext,r=Math.round(this._numParticles*this._passParameters.opacity),s=e.find(({name:e})=>e===m.TRANSPARENT_ENVIRONMENT);if(r<1)return s;const i=this.techniques.get(f,this._configuration);if(!i.compiled)return this.requestRender(1),s;const o=t.bindTechnique(i,this.bindParameters,this._passParameters);return this._vao??=I(t),t.bindVAO(this._vao),this._bindInstanceIdBuffer(o.locations),o.assertCompatibleVertexAttributeLocations(this._vao,j(x)),t.drawArraysInstanced(w.TRIANGLES,0,3,r),t.unbindBuffer(34962),s}_bindInstanceIdBuffer(e){const t=this.renderingContext;if(this._instanceIdBuffer)return void t.bindBuffer(this._instanceIdBuffer);const r=d(A);this._instanceIdBuffer=new v(t,x,new Float32Array(r)),g(t,e,this._instanceIdBuffer,0)}};function I(e){const t=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new y(e,new v(e,l(C),t))}e([a({constructOnly:!0})],P.prototype,"type",void 0),P=e([c("esri.views.3d.environment.Precipitation")],P);const A=25e4,C=_().vec3f("position").freeze(),x=l(_().f32("instanceFeatureAttribute"),1);export{P as Precipitation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as s}from"./LayerView3D.js";import{makeScheduleFunction as t}from"./support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as i}from"../support/GaussianSplatWorkerHandle.js";import a from"../../layers/LayerView.js";let p=class extends(s(a)){constructor(){super(...arguments),this.type="gaussian-splat-3d"}initialize(){const{resourceController:r}=this.view;this._workerHandle=new i(t(r))}isUpdating(){return!1}destroy(){this._workerHandle.destroyWorkerAndSelf()}};r([o()],p.prototype,"layer",void 0),p=r([e("esri.views.3d.layers.GaussianSplatLayerView3D")],p);const c=p;export{c as default};
5
+ import{__decorate as e}from"tslib";import s from"../../../core/Logger.js";import{removeMaybe as t,destroyMaybe as r}from"../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{GaussianSplatAtlasPageAllocator as l,splatPageSizeInU32 as d,elementsPerSplatPage as h,packedGaussianSizeInU32 as u,splatPageSizeInU32WithoutHeader as c,gaussiansPerSplatPage as p,splatAtlasTextureSize as f}from"../../../layers/support/GaussianSplatAtlasPageAllocator.js";import{GaussianTile as m}from"../../../layers/support/gaussianSplatUtils.js";import{getElevationOffsetInMeters as g}from"../../../support/elevationInfoUtils.js";import{LayerView3D as w}from"./LayerView3D.js";import{getLyr3DWasm as y,addLayerViewToWasm as _,removeLayerViewFromWasm as b}from"./Lyr3DWasm.js";import{GaussianSplatRenderNode as v}from"../webgl-engine/lib/GaussianSplatRenderNode.js";import A from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as H}from"../../support/layerViewUtils.js";const j=()=>s.getLogger("esri.views.3d.layers.GaussianSPlatLayerView3D");let U=class extends(w(A)){constructor(){super(...arguments),this.type="gaussian-splat-3d",this._gaussianTileHandles=new Map,this._pageAllocator=new l,this._pageBuffer=new Uint32Array(d),this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer)}get wasmLayerId(){return this._wasmLayerId}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get _wasm(){return y(this.view)}get usedMemory(){let e=0;return this._gaussianTileHandles.forEach(s=>{s.isVisible&&(e+=s.usedMemory)}),e}get unloadedMemory(){return 0}get cachedMemory(){let e=0;return this._gaussianTileHandles.forEach(s=>{s.isVisible||(e+=s.usedMemory)}),e}async createRenderable(e){const s=e.meshData;if(null==s.data)throw new Error("meshData.data undefined");if(s.desc=JSON.parse(s.desc),null==s.desc)throw new Error("meshData.desc undefined");const t=s.desc.prims[0],r=t.vertexCount,a=t.atrbs[0].view,i=t.atrbs[0].view.byteCount,n=t.atrbs[0].view.byteOffset;let o=null;if("U32"!==a.type)return j().warnOnce("unexpected meshData.data format"),{memUsageBytes:0};o=new Uint32Array(s.data.buffer,n,i/4);const l=this.extractHeader(o),d=Math.ceil(r/p),g=new Uint32Array(r),w=[];for(let m=0;m<d;m++){const e=this._pageAllocator.findFirstFreePage();if(null!==e){this._pageAllocator.allocate(e),w.push(e);const s=r-m*p,t=Math.min(s,p),a=m*p;for(let r=0;r<t;r++)g[r+a]=r+h*e;const i=m*c;this._pageBuffer.set(o.subarray(i,i+t*u)),this._pageBuffer.set(l.packedHeader,c);const n=e*h,d=n%f,y=Math.floor(n/f);this._renderNode?.updateTextureAtlas(d,y,this._pageBuffer)}}const y=new Float64Array(3*r),_=2.048,b=l.tileOrigin.x*_,v=l.tileOrigin.y*_,A=l.tileOrigin.z*_,H=l.invPosScale;let U=0;for(let h=0;h<r;h++){const e=h*u,{rawX:s,rawY:t,rawZ:r}=this.extractPackedGaussianPosition(o,e);y[U]=s*H+b,y[U+1]=t*H+v,y[U+2]=r*H+A,U+=3}const L=new m(e.handle,g,w,y);return this._gaussianTileHandles.set(e.handle,L),{memUsageBytes:0}}extractPackedGaussianPosition(e,s){const t=e[s+1];return{rawX:16383&t,rawY:t>>>14&16383,rawZ:t>>>28&15|(1023&e[s+2])<<4}}freeRenderable(e){const s=this._gaussianTileHandles.get(e);s&&(s.pageIds.forEach(e=>this._pageAllocator.free(e)),this._gaussianTileHandles.delete(e))}setRenderableVisibility(e,s,t){for(let r=0;r<t;++r){const t=e[r],a=s[r],i=this._gaussianTileHandles.get(t);i&&(i.isVisible=a)}this.updateGaussians()}initialize(){if(!this._canProjectWithoutEngine())throw H("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=_(this).then(e=>{this._wasmLayerId=e,this.addHandles([a(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e))]),this._suspendedHandle=a(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),i)});this.addResolvingPromise(e),this._renderNode=new v({view:this.view})}destroy(){b(this),this._suspendedHandle&&(this._suspendedHandle=t(this._suspendedHandle)),this._renderNode=r(this._renderNode)}_canProjectWithoutEngine(){return!0}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,g(e))}updateGaussians(){const e=[];for(const s of this._gaussianTileHandles.values())s.isVisible&&e.push(s);this._renderNode?.updateGaussianVisibility(e)}extractHeader(e){const s=e.length-4,t=this.reinterpretU32AsFloat(e[s]),r=this.reinterpretU32AsFloat(e[s+1]),a=this.reinterpretU32AsFloat(e[s+2]),i=1/(1<<(255&e[s+3]));return{packedHeader:e.subarray(s,s+4),tileOrigin:{x:t,y:r,z:a},invPosScale:i}}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}};e([n()],U.prototype,"layer",void 0),U=e([o("esri.views.3d.layers.GaussianSplatLayerView3D")],U);const L=U;export{L 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import e from"../../../core/Accessor.js";import{IdentifiableMixin as o}from"../../../core/Identifiable.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import p from"./GraphicsView3DDummyLayer.js";import{GraphicsProcessor as c}from"./graphics/GraphicsProcessor.js";import{getHighlightName as a}from"../../support/highlightOptionsUtils.js";let h=class extends(o(e)){constructor(r){super(r),this.drapeSourcePriorityOffset=0,this.processor=null,this.slicePlaneEnabled=!1,this.layer=new p,this.suspended=!1}initialize(){this._set("processor",new c({owner:this,drapeSourcePriorityOffset:this.drapeSourcePriorityOffset}))}destroy(){this._set("processor",s(this.processor))}get loadedGraphics(){return this.getGraphics()}get updating(){return!!this.processor?.updating}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getHit(r,e){return this.processor.getHit(r,null)}whenGraphicBounds(r,e){return this.processor.whenGraphicBounds(r,e)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}async queryGraphics(){return this.loadedGraphics}highlight(r,e){return this.processor.highlight(r,a(e))}maskOccludee(r){return this.processor.maskOccludee(r)}get test(){return{graphics3DProcessor:this.processor}}};r([t({constructOnly:!0})],h.prototype,"view",void 0),r([t({constructOnly:!0})],h.prototype,"getGraphics",void 0),r([t()],h.prototype,"loadedGraphics",null),r([t()],h.prototype,"drapeSourcePriorityOffset",void 0),r([t({readOnly:!0})],h.prototype,"updating",null),r([t()],h.prototype,"processor",void 0),r([t({type:Boolean})],h.prototype,"slicePlaneEnabled",void 0),r([t()],h.prototype,"layer",void 0),r([t()],h.prototype,"suspended",void 0),h=r([i("esri.views.3d.layers.GraphicsView3D")],h);const d=h;export{d as default};
5
+ import{__decorate as r}from"tslib";import{EventedAccessor as e}from"../../../core/Evented.js";import{IdentifiableMixin as o}from"../../../core/Identifiable.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import p from"./GraphicsView3DDummyLayer.js";import{GraphicsProcessor as c}from"./graphics/GraphicsProcessor.js";import{getHighlightName as a}from"../../support/highlightOptionsUtils.js";let h=class extends(o(e)){constructor(r){super(r),this.drapeSourcePriorityOffset=0,this.processor=null,this.slicePlaneEnabled=!1,this.layer=new p,this.suspended=!1}initialize(){this._set("processor",new c({owner:this,drapeSourcePriorityOffset:this.drapeSourcePriorityOffset}))}destroy(){this._set("processor",t(this.processor))}get loadedGraphics(){return this.getGraphics()}get updating(){return!!this.processor?.updating}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getHit(r,e){return this.processor.getHit(r,null)}whenGraphicBounds(r,e){return this.processor.whenGraphicBounds(r,e)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}async queryGraphics(){return this.loadedGraphics}highlight(r,e){return this.processor.highlight(r,a(e))}maskOccludee(r){return this.processor.maskOccludee(r)}notifyContentGeometryUpdate(){this.emit("visible-geometry-changed")}get test(){return{graphics3DProcessor:this.processor}}};r([s({constructOnly:!0})],h.prototype,"view",void 0),r([s({constructOnly:!0})],h.prototype,"getGraphics",void 0),r([s()],h.prototype,"loadedGraphics",null),r([s()],h.prototype,"drapeSourcePriorityOffset",void 0),r([s({readOnly:!0})],h.prototype,"updating",null),r([s()],h.prototype,"processor",void 0),r([s({type:Boolean})],h.prototype,"slicePlaneEnabled",void 0),r([s()],h.prototype,"layer",void 0),r([s()],h.prototype,"suspended",void 0),h=r([i("esri.views.3d.layers.GraphicsView3D")],h);const n=h;export{n 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{initial as s,watch as r,when as o}from"../../../core/reactiveUtils.js";import{schedule as a}from"../../../core/scheduling.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as c,invert as d}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as m,IDENTITY as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{translate as u,getTranslation as p}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as f}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{f as y,o as b}from"../../../chunks/vec32.js";import{fromArray as _,create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as v}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{SphericalECEFSpatialReferenceLike as x}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as C}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as j}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as T}from"../../../geometry/projection/projectVectorToVector.js";import{create as M}from"../../../geometry/support/aaBoundingRect.js";import{BufferViewVec2f as U,BufferViewVec4f as O,BufferViewVec4u8 as P,BufferViewVec4u16 as H,BufferViewVec3f as R,BufferViewVec3u8 as F,BufferViewVec3u16 as A,BufferViewInt16 as S,BufferViewUint32 as E,BufferViewUint16 as k}from"../../../geometry/support/buffer/BufferView.js";import{isLayerGroundReplacement as V}from"../../../layers/GroundLayer.js";import I from"../../../layers/support/SceneModification.js";import{getElevationOffsetInMeters as B}from"../../../support/elevationInfoUtils.js";import{toWasmModification as L}from"./I3SMeshWorkerHandle.js";import{IntegratedMesh3DTilesViewPerformanceInfo as D}from"./IntegratedMesh3DTilesViewPerformanceInfo.js";import{LayerView3D as G}from"./LayerView3D.js";import{addLayerViewToWasm as z,removeLayerViewFromWasm as N,getLyr3DWasm as W}from"./Lyr3DWasm.js";import{LayerElevationProvider as $}from"./i3s/LayerElevationProvider.js";import{primTypeConversion as J,alphaModeConversion as q,faceCullingConversion as K,wrapModeConversion as Q,lyr3DTypeToByteSize as X}from"./support/lyr3dTypeConversions.js";import{Tiles3DIntersectionHandler as Y}from"./support/Tiles3DIntersectionHandler.js";import{ElevationRange as Z}from"../support/ElevationRange.js";import{toBoundingRect as ee}from"../support/extentUtils.js";import{Obb as te,compute as ie}from"../support/orientedBoundingBox.js";import{ObjectParameters as se}from"../webgl-engine/collections/Component/ObjectParameters.js";import{GeometryParameters as re,createVertexBufferLayout as oe}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as ae}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as ne}from"../webgl-engine/core/material/RenderTexture.js";import{getEllipsoidMode as le}from"../webgl-engine/core/shaderLibrary/util/EllipsoidMode.js";import{Attribute as ce}from"../webgl-engine/lib/Attribute.js";import{compressAndTransformNormals as de}from"../webgl-engine/lib/Normals.js";import{Texture as me}from"../webgl-engine/lib/Texture.js";import{writeAttribute as he,writeBufferVec2 as ue}from"../webgl-engine/materials/internal/bufferWriterUtils.js";import pe from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as ge,isInEffectiveScaleRange as fe}from"../../support/layerViewUtils.js";import{TextureCompressionTracker as ye}from"../../support/TextureCompressionTracker.js";import{alphaCutoff as be}from"../../../webscene/support/AlphaCutoff.js";class _e{constructor(){this.handle=0,this.isVisible=!1,this.components=[],this.textureMemoryUsage=0,this.vboMemoryUsage=0,this.cpuMemoryUsage=0,this.textures=[]}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get cachedMemory(){return this.usedMemory}}function we(e){return Math.round(e/1048.576)/1e3}let ve=class extends(G(pe)){constructor(){super(...arguments),this.type="integrated-mesh-3dtiles",this._compressionTracker=new ye,this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this.drapeTargetType=1,this._applySSAO=!has("disable-feature:im-ssao"),this._shadeNormals=!!has("enable-feature:im-shading"),this._lyrHandleToObjects=new Map,this._initialCullFace=new Map,this._suspendedHandle=null,this._dbgFlags=new Set}get hasModifications(){return this._modifications&&this._modifications.length>0}initialize(){this._dbgFlags.add(3),this._dbg(2,"Tiles3DLayerView3D initialize() called");const{view:e}=this;if(this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),s),!this._canProjectWithoutEngine())throw ge("layer",this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);const t=z(this).then(t=>{this._wasmLayerId=t,this._intersectionHandler=new Y(this),e.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),s),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),s),this._elevationProvider=new $({view:e,layerElevationSource:this,intersectionHandler:this._intersectionHandler});const{layer:i}=this,o=V(i)?"ground":"im";e.elevationProvider.register(o,this._elevationProvider),e.basemapTerrain.overlayManager.registerDrapeTarget(this);const a=e.resourceController.memoryController.newCache(`t3d-${this.uid}`,e=>this._onRemoveFromCache(e));this._memCache=a,this.addHandles([r(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e))]),this._suspendedHandle=r(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),s)});this.addResolvingPromise(t),this._isUsedAsGround&&this.addHandles(o(()=>this.view.map.ground.opacity,()=>{this._opacityChange()}))}get _isUsedAsGround(){return V(this.layer)&&!!this.view.map.basemap?.groundLayers.includes(this.layer)}get opacity(){return this.fullOpacity*(this._isUsedAsGround?this.view.map.ground.opacity:1)}_opacityChange(){const e=this.opacity;this.objects.forEach(t=>{this._collection.getMaterial(t).objectOpacity=e})}destroy(){this._dbg(2,"Tiles3DLayerView3D destroy() called"),N(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&(this._elevationProvider.objectsChanged(this._obbs),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this.view.basemapTerrain.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._initialCullFace.clear(),this._memCache=i(this._memCache),this._updatingHandles=i(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_modificationsChanged(){const e=this.layer.spatialReference,t=L(this._layerClippingArea,this._modifications,e);this._wasm?.setMeshModifications(this,t,e.wkid)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=M();this._layerClippingArea=ee(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=a(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),this.objects.forEach(t=>{const i=this._collection.getMaterial(t);i.commonMaterialParameters.hasSlicePlane=e,i.commonMaterialParameters.cullFace=e?0:this._initialCullFace.get(t)})}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,B(e))}get _obbs(){return this.objects.map(e=>this._collection.getComponentObb(e))}get _wasm(){return W(this.view)}get wasmLayerId(){return this._wasmLayerId}get usedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible&&(e+=t.usedMemory)}),e}get unloadedMemory(){return 0}get cachedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible||(e+=t.usedMemory)}),e}get visibleAtCurrentScale(){return fe(this.layer.effectiveScaleRange,this.view.scale)}get performanceInfo(){let e=0,t=0,i=0,s=0,r=0,o=0;return this._lyrHandleToObjects.forEach(a=>{a.isVisible?(e+=a.textureMemoryUsage,t+=a.vboMemoryUsage,r++):(i+=a.textureMemoryUsage,s+=a.vboMemoryUsage,o++)}),new D(this.usedMemory,r,o,we(t),we(e),we(s),we(i))}_canProjectWithoutEngine(){if(2===this.view.state.viewingMode){const e=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1;if(3857!==e&&32662!==e)return!1}return!0}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationOffset(){return B(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new Z(e.zmin,e.zmax):null}getElevationRange(e){return null}get fullExtent(){return this.layer.fullExtent}get objects(){return Array.from(this._lyrHandleToObjects.values()).reduce((e,t)=>e.concat(t.components),new Array)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const i=_(t.desc.origin),s=new Array,r=new Map,o=new _e;o.handle=e.handle,this._lyrHandleToObjects.set(e.handle,o);const a=this.view.basemapTerrain.spatialReference;let n,l;if("global"===this.view.viewingMode){const e=g();C(x,i,e,a),n=c(m(),e),l=d(m(),n)}else n=h,l=h;const M=g();u(M,M,i);const O=p(w(),M);let P=null;const H=w();if(t.desc.obb){const e=t.desc.obb.quaternion;P=new te(t.desc.obb.center,t.desc.obb.halfSize,f(e[0],e[1],e[2],e[3]))}for(let c=0;c<t.desc.prims.length;c++){const e=t.desc.prims[c];this._dbg(2,JSON.stringify(e));if(null==J[e.ptype]||null==t.data){this._dbg(2,"[Unsupported Feature] Unsupported primitive mode ("+e.ptype+"). Skipping primitive.");continue}const d=t.desc?.materials&&null!=e.materialId?t.desc.materials[e.materialId]:null,m=null!=d?d.lightingModel:"Unlit",{positionView:u,positionAttr:p,normalsView:g,normalsAttr:f,colorAttr:_,texCoord0Attr:x,indicesView:C}=this.getBufferViews(e,t.data.buffer,n);if(null==p||null==u||null==C)continue;const M=new re(null!=_,x?1:0,null!=g,this._shadeNormals,this._applySSAO),R=p.data.length/p.size,F=(e,t)=>!e||e.data.length/e.size===R||(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1);if(!F(x,"numTexcoord")||!F(_,"numColors")||!F(f,"normals"))continue;const A=oe(M);if(null!=P?P=P.clone():(P=ie(p),y(H,P.center,i),P.center=H),n!==h)for(let t=0;t<u.count;t++)u.getVec(t,H),b(H,H,n),u.setVec(t,H);const S=A.createBuffer(p.data.length);if(he("position",p,null,null,S,0),null!=x){const e=S.getField("uv0",U);ue(x,e,0)}null!=_&&he("color",_,null,null,S,0),null!=f&&he("normalCompressed",f,null,null,S,0);const E=new Uint32Array([0,C.typedBuffer.length]),k={vertices:{data:S.buffer,count:S.byteLength/A.stride,layoutParameters:M},positionData:{positions:u.typedBuffer,indices:C.typedBuffer},indices:C.typedBuffer,componentOffsets:E};o.cpuMemoryUsage+=u.count,o.cpuMemoryUsage+=C.count;const V=this.view.renderSpatialReference,I=w(),B=[1,1,1];j(O,V,B,a)||this._dbg(3,"Unsupported coordinate system for IM overlay"),T(O,V,I,a);const L=this._collection.createObject(new se(v(I[0],I[1],B[0],B[1]),new ae(O,l),P,k));d&&this._collection.updateMaterial(L,e=>{e.baseColor=d.baseColorFactor,e.usePBR="Pbr"===m,e.hasParametersFromSource=!1,e.baseColorTexture=this._getTexture(d.baseColorTex,t,r,o),e.usePBR&&(e.mrrFactors=[d.metallicFactor,d.roughnessFactor,0],e.emissiveBaseColor=d.emissiveFactor??[0,0,0],e.metallicRoughnessTexture=this._getTexture(d.metalTex,t,r,o),e.emissionTexture=this._getTexture(d.emissiveTex,t,r,o),e.occlusionTexture=this._getTexture(d.occlusionTex,t,r,o),e.normalTexture=this._getTexture(d.normalTex,t,r,o)),e.objectOpacity=0,e.alphaDiscardMode=2;const i=[];e.baseColorTexture&&i.push(e.baseColorTexture.loadPromise),e.usePBR&&e.metallicRoughnessTexture&&i.push(e.metallicRoughnessTexture.loadPromise),e.usePBR&&e.emissionTexture&&i.push(e.emissionTexture.loadPromise),e.usePBR&&e.occlusionTexture&&i.push(e.occlusionTexture.loadPromise),e.usePBR&&e.normalTexture&&i.push(e.normalTexture.loadPromise);const a=Promise.all(i);s.push(a),a.then(()=>{e.alphaDiscardMode=q[d.alphaMode],e.objectOpacity=this.opacity,o.textureMemoryUsage+=e.baseColorTexture?.glTexture?.usedMemory||0,e.usePBR&&(o.textureMemoryUsage+=e.metallicRoughnessTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.emissionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.occlusionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.normalTexture?.glTexture?.usedMemory||0)}),e.commonMaterialParameters.doubleSided=d.isDoubleSided,e.commonMaterialParameters.cullFace=d.faceCulling?K[d.faceCulling]:2,this._initialCullFace.set(L,e.commonMaterialParameters.cullFace),e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.componentParameters.castShadows=0,e.textureAlphaCutoff=d.alphaCutoff??be,e.alphaDiscardMode=q[d.alphaMode],e.isIntegratedMesh=!0,e.polygonOffsetEnabled=!1,e.hasOccludees=!1,e.ellipsoidMode=le(this.view.spatialReference)}),o.components.push(L),o.vboMemoryUsage+=this._collection.getObjectGPUMemoryUsage(L)}if(await Promise.all(s),r.forEach(e=>{o.textures.push(e)}),!this._memCache)throw new Error("no memCache");return this._memCache.put(`${o.handle}`,o),{memUsageBytes:o.usedMemory}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t&&(this.freeObject(t),this._lyrHandleToObjects.delete(e))}freeObject(e){this._memCache&&this._memCache.pop(`${e.handle}`),e.components.forEach(t=>{e.textures.forEach(e=>{this._stage.removeTexture(e)}),this._collection.destroyObject(t),this._initialCullFace.delete(t)})}setRenderableVisibility(e,t,i){if(this._memCache){for(let s=0;s<i;++s){const i=e[s],r=t[s];if(!r)continue;const o=this._lyrHandleToObjects.get(i);o&&(this._visibleGeometryChanged(),o.isVisible=r,o.components.forEach(e=>{this._collection.setObjectVisibility(e,r),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.pop(`${i}`))}for(let s=0;s<i;++s){const i=e[s],r=t[s];if(r)continue;const o=this._lyrHandleToObjects.get(i);o&&(this._visibleGeometryChanged(),o.isVisible=r,o.components.forEach(e=>{this._collection.setObjectVisibility(e,r),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.put(`${i}`,o))}}}_getTexture(e,t,i,s){let r=null;if(e&&t.desc?.images&&t.data?.buffer){const o=t.desc.images[e?.imageId];if(r=i.get(o),!r&&o){const a=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,n=!!o.mipCount||a>1,l=Q[e.wrapMode??"None"];let c=o.alpha?4:3;const d=new Uint8Array(t.data.buffer,o.data.byteOffset,o.data.byteCount);let m=null,h=null,u=null;switch(o.format){case"Raw":"R8"===o.pixelFormat?(m=d,c=1,h=""):"Rgb8"===o.pixelFormat?(m=d,c=3,h=""):"Rgba8"===o.pixelFormat&&(m=d,c=4,h="");break;case"Dxt1":m=d,c=3,h="image/vnd-ms.dds";break;case"Dxt5":m=d,c=4,h="image/vnd-ms.dds";break;case"Basis":m=d,c=3,h="image/ktx2";break;case"Png":h="image/png",u=document.createElement("img");break;case"Jpeg":h="image/jpeg",u=document.createElement("img");break;case"Etc2":h="image/ktx",u=document.createElement("img");break;case"Astc":this._dbg(3,"Astc texture not supported");break;case"Pvrtc":this._dbg(3,"Pvrtc texture not supported")}if(u&&h){const e=new Blob([d],{type:h});u.src=URL.createObjectURL(e),m=u}if(m&&null!=h){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker,compressionCallback:e=>{e&&e>0&&(s.textureMemoryUsage-=e)}}:void 0;r=new me(m,{mipmap:n,maxAnisotropy:a,encoding:h,wrap:l,components:c,compressionOptions:e,noUnpackFlip:!0,width:o.mip0Width,height:o.mip0Height}),this._stage.addTexture(r),i.set(o,r)}}}return r?new ne(this.view.stage.renderView.textures,r.id):null}getBufferViews(e,t,i){let s,r,o,a,n,l,c,d=null;for(let h=0;h<e.atrbs.length;h++){const c=e.atrbs[h],u=c.view,p=void 0,g=u.byteOffset+u.byteCount,f=u.byteCount/X[u.type],y=[...Array(f).keys()].map(e=>e);try{switch(c.sem){case"Position":3!==u.ncomp||"F32"!==u.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Position ("+u+")"):(s=new R(t,u.byteOffset,p,g),r=new ce(s.typedBuffer,y,3));break;case"Normal":if(3!==u.ncomp||"F32"!==u.type)this._dbg(3,"[Unsupported Feature] Unsupported view for Normal ("+u+")");else{const e=new R(t,u.byteOffset,p,g),s=de(e.typedBuffer,i);n=new S(s.buffer),l=new ce(n.typedBuffer,y,2)}break;case"TexCoord":2!==u.ncomp||"F32"!==u.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Texcoord ("+u+")"):void 0===a&&(a=new ce(new U(t,u.byteOffset,p,g).typedBuffer,y,2));break;case"Color":4===u.ncomp?("F32"===u.type&&(d=new O(t,u.byteOffset,p,g)),"U8"===u.type&&(d=new P(t,u.byteOffset,p,g)),"U16"===u.type&&(d=new H(t,u.byteOffset,p,g))):3===u.ncomp&&("F32"===u.type&&(d=new R(t,u.byteOffset,p,g)),"U8"===u.type&&(d=new F(t,u.byteOffset,p,g)),"U16"===u.type&&(d=new A(t,u.byteOffset,p,g))),null==d?this._dbg(2,"[Unsupported Feature] Unsupported view for Color ("+u+")"):o=new ce(d.typedBuffer,y,u.ncomp);break;case"FeatureIndex":break;default:this._dbg(2,"[Unsupported Feature] Unsupported semantic ("+c.sem+"). Skipping vertex attribute.")}}catch(m){this._dbg(2,"Error Creating buffer ("+m+"). Skipping vertex attribute.")}}if(e.index){const i=e.index.view,s=void 0,r=i.byteOffset+i.byteCount;switch(e.index.view.type){case"U16":c=new k(t,i.byteOffset,s,r);break;case"U32":c=new E(t,i.byteOffset,s,r);break;default:this._dbg(3,"[Unsupported Feature] index type not supported ("+i.type+").")}}if(null==c&&null!=s){const e=s.count;if(e<65535){const t=new Uint16Array(e);c=new k(t.buffer)}else{const t=new Uint32Array(e);c=new E(t.buffer)}for(let t=0;t<e;t++)c.set(t,t)}return{positionView:s,positionAttr:r,colorAttr:o,texCoord0Attr:a,indicesView:c,normalsView:n,normalsAttr:l}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>this._modifications=e.toArray(),s),"modifications")}_onRemoveFromCache(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,i){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(i):t.getLogger(this).warn(i))}};e([n({type:[I]})],ve.prototype,"_modifications",void 0),e([n()],ve.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([n()],ve.prototype,"layer",void 0),e([n({readOnly:!0})],ve.prototype,"visibleAtCurrentScale",null),e([n()],ve.prototype,"elevationOffset",null),ve=e([l("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],ve);const xe=ve;export{xe as default};
5
+ import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{initial as s,watch as r,when as o}from"../../../core/reactiveUtils.js";import{schedule as a}from"../../../core/scheduling.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as c,invert as d}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as m,IDENTITY as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{translate as u,getTranslation as p}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as f}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{f as y,o as b}from"../../../chunks/vec32.js";import{fromArray as _,create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as v}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{SphericalECEFSpatialReferenceLike as x}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as C}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as j}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as T}from"../../../geometry/projection/projectVectorToVector.js";import{create as M}from"../../../geometry/support/aaBoundingRect.js";import{BufferViewVec2f as U,BufferViewVec4f as O,BufferViewVec4u8 as P,BufferViewVec4u16 as H,BufferViewVec3f as R,BufferViewVec3u8 as F,BufferViewVec3u16 as A,BufferViewInt16 as S,BufferViewUint32 as E,BufferViewUint16 as k}from"../../../geometry/support/buffer/BufferView.js";import{isLayerGroundReplacement as V}from"../../../layers/GroundLayer.js";import B from"../../../layers/support/SceneModification.js";import{getElevationOffsetInMeters as I}from"../../../support/elevationInfoUtils.js";import{toWasmModification as L}from"./I3SMeshWorkerHandle.js";import{LayerView3D as D}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as G}from"./Lyr3DViewPerformanceInfo.js";import{addLayerViewToWasm as z,removeLayerViewFromWasm as N,getLyr3DWasm as W}from"./Lyr3DWasm.js";import{LayerElevationProvider as $}from"./i3s/LayerElevationProvider.js";import{primTypeConversion as J,alphaModeConversion as q,faceCullingConversion as K,wrapModeConversion as Q,lyr3DTypeToByteSize as X}from"./support/lyr3dTypeConversions.js";import{Tiles3DIntersectionHandler as Y}from"./support/Tiles3DIntersectionHandler.js";import{ElevationRange as Z}from"../support/ElevationRange.js";import{toBoundingRect as ee}from"../support/extentUtils.js";import{Obb as te,compute as ie}from"../support/orientedBoundingBox.js";import{ObjectParameters as se}from"../webgl-engine/collections/Component/ObjectParameters.js";import{GeometryParameters as re,createVertexBufferLayout as oe}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as ae}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as ne}from"../webgl-engine/core/material/RenderTexture.js";import{getEllipsoidMode as le}from"../webgl-engine/core/shaderLibrary/util/EllipsoidMode.js";import{Attribute as ce}from"../webgl-engine/lib/Attribute.js";import{compressAndTransformNormals as de}from"../webgl-engine/lib/Normals.js";import{Texture as me}from"../webgl-engine/lib/Texture.js";import{writeAttribute as he,writeBufferVec2 as ue}from"../webgl-engine/materials/internal/bufferWriterUtils.js";import pe from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as ge,isInEffectiveScaleRange as fe}from"../../support/layerViewUtils.js";import{TextureCompressionTracker as ye}from"../../support/TextureCompressionTracker.js";import{alphaCutoff as be}from"../../../webscene/support/AlphaCutoff.js";class _e{constructor(){this.handle=0,this.isVisible=!1,this.components=[],this.textureMemoryUsage=0,this.vboMemoryUsage=0,this.cpuMemoryUsage=0,this.textures=[]}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get cachedMemory(){return this.usedMemory}}function we(e){return Math.round(e/1048.576)/1e3}let ve=class extends(D(pe)){constructor(){super(...arguments),this.type="integrated-mesh-3dtiles",this._compressionTracker=new ye,this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this.drapeTargetType=1,this._applySSAO=!has("disable-feature:im-ssao"),this._shadeNormals=!!has("enable-feature:im-shading"),this._lyrHandleToObjects=new Map,this._initialCullFace=new Map,this._suspendedHandle=null,this._dbgFlags=new Set}get hasModifications(){return this._modifications&&this._modifications.length>0}initialize(){this._dbgFlags.add(3),this._dbg(2,"Tiles3DLayerView3D initialize() called");const{view:e}=this;if(this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),s),!this._canProjectWithoutEngine())throw ge("layer",this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);const t=z(this).then(t=>{this._wasmLayerId=t,this._intersectionHandler=new Y(this),e.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),s),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),s),this._elevationProvider=new $({view:e,layerElevationSource:this,intersectionHandler:this._intersectionHandler});const{layer:i}=this,o=V(i)?"ground":"im";e.elevationProvider.register(o,this._elevationProvider),e.basemapTerrain.overlayManager.registerDrapeTarget(this);const a=e.resourceController.memoryController.newCache(`t3d-${this.uid}`,e=>this._onRemoveFromCache(e));this._memCache=a,this.addHandles([r(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e))]),this._suspendedHandle=r(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),s)});this.addResolvingPromise(t),this._isUsedAsGround&&this.addHandles(o(()=>this.view.map.ground.opacity,()=>{this._opacityChange()}))}get _isUsedAsGround(){return V(this.layer)&&!!this.view.map.basemap?.groundLayers.includes(this.layer)}get opacity(){return this.fullOpacity*(this._isUsedAsGround?this.view.map.ground.opacity:1)}_opacityChange(){const e=this.opacity;this.objects.forEach(t=>{this._collection.getMaterial(t).objectOpacity=e})}destroy(){this._dbg(2,"Tiles3DLayerView3D destroy() called"),N(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&(this._elevationProvider.objectsChanged(this._obbs),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this.view.basemapTerrain.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._initialCullFace.clear(),this._memCache=i(this._memCache),this._updatingHandles=i(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_modificationsChanged(){const e=this.layer.spatialReference,t=L(this._layerClippingArea,this._modifications,e);this._wasm?.setMeshModifications(this,t,e.wkid)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=M();this._layerClippingArea=ee(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=a(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),this.objects.forEach(t=>{const i=this._collection.getMaterial(t);i.commonMaterialParameters.hasSlicePlane=e,i.commonMaterialParameters.cullFace=e?0:this._initialCullFace.get(t)})}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,I(e))}get _obbs(){return this.objects.map(e=>this._collection.getComponentObb(e))}get _wasm(){return W(this.view)}get wasmLayerId(){return this._wasmLayerId}get usedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible&&(e+=t.usedMemory)}),e}get unloadedMemory(){return 0}get cachedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible||(e+=t.usedMemory)}),e}get visibleAtCurrentScale(){return fe(this.layer.effectiveScaleRange,this.view.scale)}get performanceInfo(){let e=0,t=0,i=0,s=0,r=0,o=0;return this._lyrHandleToObjects.forEach(a=>{a.isVisible?(e+=a.textureMemoryUsage,t+=a.vboMemoryUsage,r++):(i+=a.textureMemoryUsage,s+=a.vboMemoryUsage,o++)}),new G(this.usedMemory,r,o,we(t),we(e),we(s),we(i))}_canProjectWithoutEngine(){if(2===this.view.state.viewingMode){const e=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1;if(3857!==e&&32662!==e)return!1}return!0}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationOffset(){return I(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new Z(e.zmin,e.zmax):null}getElevationRange(e){return null}get fullExtent(){return this.layer.fullExtent}get objects(){return Array.from(this._lyrHandleToObjects.values()).reduce((e,t)=>e.concat(t.components),new Array)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const i=_(t.desc.origin),s=new Array,r=new Map,o=new _e;o.handle=e.handle,this._lyrHandleToObjects.set(e.handle,o);const a=this.view.basemapTerrain.spatialReference;let n,l;if("global"===this.view.viewingMode){const e=g();C(x,i,e,a),n=c(m(),e),l=d(m(),n)}else n=h,l=h;const M=g();u(M,M,i);const O=p(w(),M);let P=null;const H=w();if(t.desc.obb){const e=t.desc.obb.quaternion;P=new te(t.desc.obb.center,t.desc.obb.halfSize,f(e[0],e[1],e[2],e[3]))}for(let c=0;c<t.desc.prims.length;c++){const e=t.desc.prims[c];this._dbg(2,JSON.stringify(e));if(null==J[e.ptype]||null==t.data){this._dbg(2,"[Unsupported Feature] Unsupported primitive mode ("+e.ptype+"). Skipping primitive.");continue}const d=t.desc?.materials&&null!=e.materialId?t.desc.materials[e.materialId]:null,m=null!=d?d.lightingModel:"Unlit",{positionView:u,positionAttr:p,normalsView:g,normalsAttr:f,colorAttr:_,texCoord0Attr:x,indicesView:C}=this.getBufferViews(e,t.data.buffer,n);if(null==p||null==u||null==C)continue;const M=new re(null!=_,x?1:0,null!=g,this._shadeNormals,this._applySSAO),R=p.data.length/p.size,F=(e,t)=>!e||e.data.length/e.size===R||(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1);if(!F(x,"numTexcoord")||!F(_,"numColors")||!F(f,"normals"))continue;const A=oe(M);if(null!=P?P=P.clone():(P=ie(p),y(H,P.center,i),P.center=H),n!==h)for(let t=0;t<u.count;t++)u.getVec(t,H),b(H,H,n),u.setVec(t,H);const S=A.createBuffer(p.data.length);if(he("position",p,null,null,S,0),null!=x){const e=S.getField("uv0",U);ue(x,e,0)}null!=_&&he("color",_,null,null,S,0),null!=f&&he("normalCompressed",f,null,null,S,0);const E=new Uint32Array([0,C.typedBuffer.length]),k={vertices:{data:S.buffer,count:S.byteLength/A.stride,layoutParameters:M},positionData:{positions:u.typedBuffer,indices:C.typedBuffer},indices:C.typedBuffer,componentOffsets:E};o.cpuMemoryUsage+=u.count,o.cpuMemoryUsage+=C.count;const V=this.view.renderSpatialReference,B=w(),I=[1,1,1];j(O,V,I,a)||this._dbg(3,"Unsupported coordinate system for IM overlay"),T(O,V,B,a);const L=this._collection.createObject(new se(v(B[0],B[1],I[0],I[1]),new ae(O,l),P,k));d&&this._collection.updateMaterial(L,e=>{e.baseColor=d.baseColorFactor,e.usePBR="Pbr"===m,e.hasParametersFromSource=!1,e.baseColorTexture=this._getTexture(d.baseColorTex,t,r,o),e.usePBR&&(e.mrrFactors=[d.metallicFactor,d.roughnessFactor,0],e.emissiveBaseColor=d.emissiveFactor??[0,0,0],e.metallicRoughnessTexture=this._getTexture(d.metalTex,t,r,o),e.emissionTexture=this._getTexture(d.emissiveTex,t,r,o),e.occlusionTexture=this._getTexture(d.occlusionTex,t,r,o),e.normalTexture=this._getTexture(d.normalTex,t,r,o)),e.objectOpacity=0,e.alphaDiscardMode=2;const i=[];e.baseColorTexture&&i.push(e.baseColorTexture.loadPromise),e.usePBR&&e.metallicRoughnessTexture&&i.push(e.metallicRoughnessTexture.loadPromise),e.usePBR&&e.emissionTexture&&i.push(e.emissionTexture.loadPromise),e.usePBR&&e.occlusionTexture&&i.push(e.occlusionTexture.loadPromise),e.usePBR&&e.normalTexture&&i.push(e.normalTexture.loadPromise);const a=Promise.all(i);s.push(a),a.then(()=>{e.alphaDiscardMode=q[d.alphaMode],e.objectOpacity=this.opacity,o.textureMemoryUsage+=e.baseColorTexture?.glTexture?.usedMemory||0,e.usePBR&&(o.textureMemoryUsage+=e.metallicRoughnessTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.emissionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.occlusionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.normalTexture?.glTexture?.usedMemory||0)}),e.commonMaterialParameters.doubleSided=d.isDoubleSided,e.commonMaterialParameters.cullFace=d.faceCulling?K[d.faceCulling]:2,this._initialCullFace.set(L,e.commonMaterialParameters.cullFace),e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.componentParameters.castShadows=0,e.textureAlphaCutoff=d.alphaCutoff??be,e.alphaDiscardMode=q[d.alphaMode],e.isIntegratedMesh=!0,e.polygonOffsetEnabled=!1,e.hasOccludees=!1,e.ellipsoidMode=le(this.view.spatialReference)}),o.components.push(L),o.vboMemoryUsage+=this._collection.getObjectGPUMemoryUsage(L)}if(await Promise.all(s),r.forEach(e=>{o.textures.push(e)}),!this._memCache)throw new Error("no memCache");return this._memCache.put(`${o.handle}`,o),{memUsageBytes:o.usedMemory}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t&&(this.freeObject(t),this._lyrHandleToObjects.delete(e))}freeObject(e){this._memCache&&this._memCache.pop(`${e.handle}`),e.components.forEach(t=>{e.textures.forEach(e=>{this._stage.removeTexture(e)}),this._collection.destroyObject(t),this._initialCullFace.delete(t)})}setRenderableVisibility(e,t,i){if(this._memCache){for(let s=0;s<i;++s){const i=e[s],r=t[s];if(!r)continue;const o=this._lyrHandleToObjects.get(i);o&&(this._visibleGeometryChanged(),o.isVisible=r,o.components.forEach(e=>{this._collection.setObjectVisibility(e,r),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.pop(`${i}`))}for(let s=0;s<i;++s){const i=e[s],r=t[s];if(r)continue;const o=this._lyrHandleToObjects.get(i);o&&(this._visibleGeometryChanged(),o.isVisible=r,o.components.forEach(e=>{this._collection.setObjectVisibility(e,r),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.put(`${i}`,o))}}}_getTexture(e,t,i,s){let r=null;if(e&&t.desc?.images&&t.data?.buffer){const o=t.desc.images[e?.imageId];if(r=i.get(o),!r&&o){const a=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,n=!!o.mipCount||a>1,l=Q[e.wrapMode??"None"];let c=o.alpha?4:3;const d=new Uint8Array(t.data.buffer,o.data.byteOffset,o.data.byteCount);let m=null,h=null,u=null;switch(o.format){case"Raw":"R8"===o.pixelFormat?(m=d,c=1,h=""):"Rgb8"===o.pixelFormat?(m=d,c=3,h=""):"Rgba8"===o.pixelFormat&&(m=d,c=4,h="");break;case"Dxt1":m=d,c=3,h="image/vnd-ms.dds";break;case"Dxt5":m=d,c=4,h="image/vnd-ms.dds";break;case"Basis":m=d,c=3,h="image/ktx2";break;case"Png":h="image/png",u=document.createElement("img");break;case"Jpeg":h="image/jpeg",u=document.createElement("img");break;case"Etc2":h="image/ktx",u=document.createElement("img");break;case"Astc":this._dbg(3,"Astc texture not supported");break;case"Pvrtc":this._dbg(3,"Pvrtc texture not supported")}if(u&&h){const e=new Blob([d],{type:h});u.src=URL.createObjectURL(e),m=u}if(m&&null!=h){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker,compressionCallback:e=>{e&&e>0&&(s.textureMemoryUsage-=e)}}:void 0;r=new me(m,{mipmap:n,maxAnisotropy:a,encoding:h,wrap:l,components:c,compressionOptions:e,noUnpackFlip:!0,width:o.mip0Width,height:o.mip0Height}),this._stage.addTexture(r),i.set(o,r)}}}return r?new ne(this.view.stage.renderView.textures,r.id):null}getBufferViews(e,t,i){let s,r,o,a,n,l,c,d=null;for(let h=0;h<e.atrbs.length;h++){const c=e.atrbs[h],u=c.view,p=void 0,g=u.byteOffset+u.byteCount,f=u.byteCount/X[u.type],y=[...Array(f).keys()].map(e=>e);try{switch(c.sem){case"Position":3!==u.ncomp||"F32"!==u.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Position ("+u+")"):(s=new R(t,u.byteOffset,p,g),r=new ce(s.typedBuffer,y,3));break;case"Normal":if(3!==u.ncomp||"F32"!==u.type)this._dbg(3,"[Unsupported Feature] Unsupported view for Normal ("+u+")");else{const e=new R(t,u.byteOffset,p,g),s=de(e.typedBuffer,i);n=new S(s.buffer),l=new ce(n.typedBuffer,y,2)}break;case"TexCoord":2!==u.ncomp||"F32"!==u.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Texcoord ("+u+")"):void 0===a&&(a=new ce(new U(t,u.byteOffset,p,g).typedBuffer,y,2));break;case"Color":4===u.ncomp?("F32"===u.type&&(d=new O(t,u.byteOffset,p,g)),"U8"===u.type&&(d=new P(t,u.byteOffset,p,g)),"U16"===u.type&&(d=new H(t,u.byteOffset,p,g))):3===u.ncomp&&("F32"===u.type&&(d=new R(t,u.byteOffset,p,g)),"U8"===u.type&&(d=new F(t,u.byteOffset,p,g)),"U16"===u.type&&(d=new A(t,u.byteOffset,p,g))),null==d?this._dbg(2,"[Unsupported Feature] Unsupported view for Color ("+u+")"):o=new ce(d.typedBuffer,y,u.ncomp);break;case"FeatureIndex":break;default:this._dbg(2,"[Unsupported Feature] Unsupported semantic ("+c.sem+"). Skipping vertex attribute.")}}catch(m){this._dbg(2,"Error Creating buffer ("+m+"). Skipping vertex attribute.")}}if(e.index){const i=e.index.view,s=void 0,r=i.byteOffset+i.byteCount;switch(e.index.view.type){case"U16":c=new k(t,i.byteOffset,s,r);break;case"U32":c=new E(t,i.byteOffset,s,r);break;default:this._dbg(3,"[Unsupported Feature] index type not supported ("+i.type+").")}}if(null==c&&null!=s){const e=s.count;if(e<65535){const t=new Uint16Array(e);c=new k(t.buffer)}else{const t=new Uint32Array(e);c=new E(t.buffer)}for(let t=0;t<e;t++)c.set(t,t)}return{positionView:s,positionAttr:r,colorAttr:o,texCoord0Attr:a,indicesView:c,normalsView:n,normalsAttr:l}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>this._modifications=e.toArray(),s),"modifications")}_onRemoveFromCache(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,i){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(i):t.getLogger(this).warn(i))}};e([n({type:[B]})],ve.prototype,"_modifications",void 0),e([n()],ve.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([n()],ve.prototype,"layer",void 0),e([n({readOnly:!0})],ve.prototype,"visibleAtCurrentScale",null),e([n()],ve.prototype,"elevationOffset",null),ve=e([l("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],ve);const xe=ve;export{xe 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{LayerViewPerformanceInfo as e}from"./support/LayerViewPerformanceInfo.js";class t extends e{constructor(e,t,s,r,o,h,c){super(e,0,0,0,t),this.nodesCached=s,this.vboMB=r,this.textureMB=o,this.vboMBCached=h,this.textureMBCached=c}}export{t as IntegratedMesh3DTilesViewPerformanceInfo};
5
+ import{LayerViewPerformanceInfo as e}from"./support/LayerViewPerformanceInfo.js";class t extends e{constructor(e,t,s,r,o,h,c){super(e,0,0,0,t),this.nodesCached=s,this.vboMB=r,this.textureMB=o,this.vboMBCached=h,this.textureMBCached=c}}export{t as Lyr3DViewPerformanceInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import{wasmFailedToInit as r}from"../../../layers/ILyr3DWasmPerSceneView.js";let i,t=null;const a=new Map;async function n(n){null==t&&(null==i&&(i=import("../../../layers/Lyr3DWasmPerSceneView.js")),t=await i);const l=n.view;let s=a.get(l);s||(s=new t.default({view:l}),a.set(l,s));const o=!!l.stage.renderView.renderingContext.capabilities.compressedTextureS3TC,d=!!l.stage.renderView.renderingContext.capabilities.compressedTextureETC;await s.initializeWasm(o,d);const w=s.add3DTilesLayerView(n);if(w.wasmLayerId<0)throw s.getValidLayerViewCount()<1&&(a.delete(l),0===a.size&&(i=null,t=null)),w.wasmLayerId===r?new e("tiles3d:addLayer-failure","The 3d tiles layer web assembly module failed to download.",{}):new e("tiles3d:addLayer-failure",w.check?.errorDescription??"The 3d tiles layer description was invalid.",{});return w.wasmLayerId}function l(e){return a.get(e)}function s(e){const r=e.view,n=a.get(r);if(n){n.remove3DTilesLayerView(e)<1&&(a.delete(r),0===a.size&&(i=null,t=null))}}export{n as addLayerViewToWasm,l as getLyr3DWasm,s as removeLayerViewFromWasm};
5
+ import e from"../../../core/Error.js";import{wasmFailedToInit as r}from"../../../layers/ILyr3DWasmPerSceneView.js";let i,t=null;const a=new Map;async function n(n){null==t&&(null==i&&(i=import("../../../layers/Lyr3DWasmPerSceneView.js")),t=await i);const l=n.view;let s=a.get(l);s||(s=new t.default({view:l}),a.set(l,s));const o=!!l.stage.renderView.renderingContext.capabilities.compressedTextureS3TC,d=!!l.stage.renderView.renderingContext.capabilities.compressedTextureETC;await s.initializeWasm(o,d);const w=s.addLayerView(n);if(w.wasmLayerId<0)throw s.getValidLayerViewCount()<1&&(a.delete(l),0===a.size&&(i=null,t=null)),w.wasmLayerId===r?new e("tiles3d:addLayer-failure","The 3d tiles layer web assembly module failed to download.",{}):new e("tiles3d:addLayer-failure",w.check?.errorDescription??"The 3d tiles layer description was invalid.",{});return w.wasmLayerId}function l(e){return a.get(e)}function s(e){const r=e.view,n=a.get(r);if(n){n.removeLayerView(e)<1&&(a.delete(r),0===a.size&&(i=null,t=null))}}export{n as addLayerViewToWasm,l as getLyr3DWasm,s as removeLayerViewFromWasm};