@arcgis/core 5.2.0-next.33 → 5.2.0-next.35

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 (244) hide show
  1. package/analysis/Viewshed.d.ts +0 -5
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{39c994536ce6c1e5c956.js → 03350a56f840cffe5459.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{2628136bf9f47d238a24.js → 050aba7089318e1c7d53.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{dd5dddf7e422216d3806.js → 0a2f08298a3c932614f2.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{a844c4e031e77db11478.js → 0df978697328b6453c94.js} +1 -1
  7. package/assets/esri/core/workers/chunks/0f8fcbd0650b6a924f75.js +1 -0
  8. package/assets/esri/core/workers/chunks/{83ae56c7fa8d84865605.js → 0f976bfb7db98c2c0e05.js} +1 -1
  9. package/assets/esri/core/workers/chunks/10510f76f8538c2dfb84.js +1 -0
  10. package/assets/esri/core/workers/chunks/{9508fa53da5f92a0ab70.js → 155940ef3d1888272d73.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{3f63b14b53b5ca716e3a.js → 18c4c437ded8bfbd3305.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{b60f24a6c777301803f4.js → 1958facb000b6c16bfe4.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{1664434dc7a67c8ce453.js → 1ad5fcae6d6a9801cf58.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{390fda094fa8695d98cf.js → 22c447fcc9a28afeb6e3.js} +1 -1
  15. package/assets/esri/core/workers/chunks/24aa98cb2021ddd789ce.js +1 -0
  16. package/assets/esri/core/workers/chunks/{7656900713e55036c3c1.js → 29542a3d7f3fa8d42380.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{1e386475937e02b3f523.js → 2b669473aa2c7cfb63c7.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{c8091e8fd7ca43a4490a.js → 2bb3494659609594c4ca.js} +1 -1
  19. package/assets/esri/core/workers/chunks/2c00f89030c7a4201033.js +2 -0
  20. package/assets/esri/core/workers/chunks/{b75a4753cea6544da8bb.js → 2c61bb25578f73ba49bc.js} +1 -1
  21. package/assets/esri/core/workers/chunks/2d92f0042facb55edcff.js +1 -0
  22. package/assets/esri/core/workers/chunks/2da797ae5af9d2ede42d.js +1 -0
  23. package/assets/esri/core/workers/chunks/{34eb22ee13df24271532.js → 2e495a28494c2351837b.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{a0b78cbeb0e53107d819.js → 367a3031abbeff0c0090.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{aba7a053015a9738d8a0.js → 368db1420b8520beae05.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{92458803531fdfe1557a.js → 38a6a7c56c592f336a12.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{c63b315c6b76b4860fc5.js → 39ff5b2a05a90e1cb214.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{0a52373c4ba652e0ee0f.js → 3b914ca36e7e2b00cfe6.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{f6afc597eaf2afa9a4a0.js → 3dd8145ef89f32920177.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{b289c46ce2dc04d32e81.js → 3e8fa2a7a36881234479.js} +1 -1
  31. package/assets/esri/core/workers/chunks/406c7723e8db470822bf.js +1 -0
  32. package/assets/esri/core/workers/chunks/{5bf01e0eff8a78b65e9e.js → 4656a4bf430d7eed1465.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{43ef6dee2e1d9ed7885e.js → 472ec242cd3070e6acfe.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{1bbf5f5da5842b93f638.js → 4f08b69f4a33a114c5f7.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{c60b4f2dd5fccdf362a7.js → 514ab968c0d75062e6ab.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{ba1c4a8794ac55942e35.js → 51d7145f748b4865de7f.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{2f40193d1b2e534c5226.js → 570a4725b2a4a19c5148.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{1305690054214a9cf48d.js → 586ca90e46f5cbdfeece.js} +1 -1
  39. package/assets/esri/core/workers/chunks/595401947e74a0a67144.js +1 -0
  40. package/assets/esri/core/workers/chunks/{70cb825bb37f1977d2ab.js → 59c22bab85f9cdbb9948.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{b624796ff4a9d4c406bf.js → 61efc7f5fab1c2b1f764.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{c593539c2cce7a2b9d44.js → 6596b12bb286a0b45a68.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{bb1fad01d9f070e7d795.js → 661f50cb97604453f942.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{51a53011478e0cf96e0b.js → 6c02493a1c1deff49c7e.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{7832d94f35b79e27ee51.js → 6c746ac4bd2e57b8cb41.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{71f09e34d56c9fe5c307.js → 6d72a1bdc2664df62c4c.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{4ea325c829d3b82854b1.js → 7085b4c655a19694da04.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{9f3d37e5f42bf1529673.js → 71b672259bac2befd9c7.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{a536904fe6f3b16fdbdc.js → 757982a73174aa7ab0d1.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{d0321dd4b5b2d863eecd.js → 777b16b76db406c99c69.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{32b5d2537feefe6e94a3.js → 7d65a8ec5e1f871b9321.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{fe42fa2144691b9186fd.js → 828b64624c76156a6416.js} +1 -1
  53. package/assets/esri/core/workers/chunks/857532de88f21e8c3466.js +1 -0
  54. package/assets/esri/core/workers/chunks/85a280ee915010a8da3c.js +1 -0
  55. package/assets/esri/core/workers/chunks/{3d1e5bfd88771d4a0bf6.js → 866950e9ab96aebc6b32.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{8c62e2dabd1f1e13d244.js → 86731e276b31453bc235.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{25932fa010f9a32475c1.js → 88ec63501fa2f6fdadca.js} +1 -1
  58. package/assets/esri/core/workers/chunks/8a9b2efa0603e9fa4e8b.js +1 -0
  59. package/assets/esri/core/workers/chunks/{af3b060fdfa3b6174340.js → 8aa5bbf9a9b09815725a.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{2353fbc1ff4481dcfb1f.js → 8b68a69ab8fb1679e7b2.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{35b3ff25f5fe24fe15e2.js → 96860b6035e0b06672dd.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{e2f33945d838183a2192.js → 98685bd149dee1d6dc99.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{122892f365f5327d290c.js → 9de9cec5c644bc452294.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{456b77b8f13933a75b68.js → 9fb0431b0628dcb53004.js} +54 -54
  65. package/assets/esri/core/workers/chunks/{940ebb13618d38c6b459.js → a2a688dd2ed4565e01ff.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{47f21b65065558d583ca.js → a2e754df3215e8b00a8f.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{f59b76fde2cbd17f64b3.js → a3ae7c41832c7a8b0570.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{6dc60afb0c39bbb001a3.js → a3e86830460e52706a4d.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{c030a974a63155f450e9.js → a58b8903ae17acf117d6.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{c4a2ec2e5897300163ac.js → ab3d1c00ef514b61ce0b.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{b324bdb9c74fc3f956db.js → add79af151e3eb560599.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{3b3f91a61e3f29af1fb2.js → ae5363956b4467208e04.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{38b69fba9ae4ccbae6b7.js → afaf6874a645854c3357.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{36913f0f944a9eb82cd3.js → b24b7411a73d1da87c30.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{a3393780655152102c45.js → b97b83159fec34f383af.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{977e6f589bd266d6067d.js → bbcb213d20693fcad5be.js} +12 -12
  77. package/assets/esri/core/workers/chunks/{8ade399db21938822a7c.js → bec660ee2e7828f965e2.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{6b56971783bf4c31a563.js → c19fe4f31e4ef84bbcf6.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{5cccb8b06014ccef30f8.js → c228b058dd91bf0e1102.js} +1 -1
  80. package/assets/esri/core/workers/chunks/c2a02c33462bcdabd39d.js +1 -0
  81. package/assets/esri/core/workers/chunks/{cb30e8a66d6dcfebd439.js → cda2bae39135e5519d8c.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{414691f7758c78e2a704.js → cfbbfa5edffa57bd3a8e.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{de83c177f8a1234a5b2e.js → cffef41791f0cfa6c26c.js} +1 -1
  84. package/assets/esri/core/workers/chunks/d0217187aed8bb7038f4.js +1 -0
  85. package/assets/esri/core/workers/chunks/{70c94bcfa20453134037.js → d1928a8c86a8966e5582.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{58e0e50b6c3abaa4798f.js → d26b1a9f47b4b2744c89.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{2baee42e1797a709fe4b.js → d4a96f0402172787823a.js} +1 -1
  88. package/assets/esri/core/workers/chunks/d7e17df1c3675bf3633e.js +1 -0
  89. package/assets/esri/core/workers/chunks/dd785e595cd08b2d6284.js +1 -0
  90. package/assets/esri/core/workers/chunks/{bd260798b8de09a1eeb2.js → e3a4695c31d3f9d55213.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{197b9f8483fad2258650.js → e6263e1983e703befe48.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{6991ba1b204668e7d4da.js → e67a9f9298d63026e7f6.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{4e803d12486c8de4c901.js → ee446250a40e5d89bb5a.js} +42 -42
  94. package/assets/esri/core/workers/chunks/{6f240fe78b299e6c4fcc.js → eeee7421f64a52074ff4.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{1e109a521ca8772fdf04.js → eef7e0bee19c4258ba55.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{49a45083a9a155614c1c.js → ef32e454012f3b0e3f77.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{83ce38342796bd6d73ce.js → f137e544076482e348ad.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{4ecc345c3732f7fc130f.js → f1f3fe9d2d96578f4f6b.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{e181d0f5562878b3dc01.js → f72f38e7609756a7f8ea.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{ef5d11581a98fb333ad2.js → f83e3ad67b60744afd6d.js} +1 -1
  101. package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
  102. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  103. package/chunks/FocusAreaColor.glsl.js +1 -10
  104. package/chunks/GaussianSplatComposition.glsl.js +4 -4
  105. package/chunks/OITAddEmission.glsl.js +6 -0
  106. package/chunks/OITFilterOpaque.glsl.js +4 -0
  107. package/chunks/RibbonLine.glsl.js +22 -22
  108. package/chunks/lerc-wasm.js +1 -1
  109. package/config.js +1 -1
  110. package/core/workers/workerFactory.js +1 -1
  111. package/form/elements/inputs/attachments/AttachmentInput.js +1 -1
  112. package/geometry/support/frustum.js +1 -1
  113. package/geometry/support/plane.js +1 -1
  114. package/geometry/support/triangle.js +1 -1
  115. package/kernel.js +1 -1
  116. package/layers/AnnotationFeatureLayer.d.ts +110 -67
  117. package/layers/CSVLayer.d.ts +144 -175
  118. package/layers/CatalogLayer.d.ts +129 -132
  119. package/layers/DimensionFeatureLayer.d.ts +106 -63
  120. package/layers/FeatureLayer.d.ts +77 -150
  121. package/layers/GeoJSONLayer.d.ts +111 -168
  122. package/layers/OrientedImageryLayer.d.ts +125 -79
  123. package/layers/ParquetLayer.d.ts +116 -75
  124. package/layers/SubtypeGroupLayer.d.ts +86 -111
  125. package/layers/WFSLayer.d.ts +157 -127
  126. package/layers/catalog/CatalogFootprintLayer.d.ts +142 -129
  127. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  128. package/layers/graphics/sources/support/QueryTask.js +1 -1
  129. package/layers/mixins/EditBusLayer.js +1 -1
  130. package/layers/pointCloudFilters/PointCloudBitfieldFilter.d.ts +1 -1
  131. package/layers/raster/datasets/pixelReader.js +1 -1
  132. package/layers/raster/functions/pixelUtils.js +1 -1
  133. package/layers/video/VideoController.js +1 -1
  134. package/package.json +2 -2
  135. package/popup/Features.d.ts +2 -2
  136. package/popup/Features.js +1 -1
  137. package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
  138. package/support/revision.js +1 -1
  139. package/views/2d/engine/webgl/definitions.js +1 -1
  140. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  141. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  142. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  143. package/views/2d/input/MapViewInputManager.js +1 -1
  144. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  145. package/views/2d/layers/support/annodime/virtualFields.js +1 -1
  146. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  147. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  148. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  149. package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
  150. package/views/3d/analysis/Viewshed/types.d.ts +17 -0
  151. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +3 -14
  152. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  153. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  154. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  155. package/views/3d/input/SceneInputManager.js +1 -1
  156. package/views/3d/interactive/manipulators/RotateManipulator.js +1 -1
  157. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  158. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  159. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  160. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  161. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  162. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  163. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  164. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  165. package/views/3d/terrain/PatchRenderData.js +1 -1
  166. package/views/3d/webgl/ManagedFBO.js +1 -1
  167. package/views/3d/webgl-engine/core/shaderLibrary/util/emissionFilter.glsl.js +2 -0
  168. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColor.glsl.js +1 -1
  169. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  170. package/views/3d/webgl-engine/effects/focusArea/FocusAreaVisualization.js +1 -1
  171. package/views/3d/webgl-engine/effects/transparency/OITAddEmission.glsl.js +2 -0
  172. package/views/3d/webgl-engine/effects/transparency/OITAddEmissionTechnique.js +2 -0
  173. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  174. package/views/3d/webgl-engine/effects/transparency/OITFilterOpaque.glsl.js +2 -0
  175. package/views/3d/webgl-engine/effects/transparency/OITFilterOpaqueTechnique.js +2 -0
  176. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  177. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  178. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  179. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +1 -1
  180. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  181. package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
  182. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  183. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  184. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  185. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  186. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  187. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  188. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  189. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  190. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  191. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  192. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  193. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  194. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  195. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  196. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  197. package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
  198. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  199. package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
  200. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  201. package/views/3d/webgl-engine/shaders/GaussianSplatComposition.glsl.js +1 -1
  202. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  203. package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
  204. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  205. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +3 -3
  206. package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
  207. package/views/input/BrowserEventSource.js +1 -1
  208. package/views/input/handlers/PreventTouchSelection.js +2 -0
  209. package/views/layers/FeatureLikeLayerView.d.ts +9 -64
  210. package/views/layers/GraphicsLayerView.d.ts +1 -1
  211. package/views/layers/ViewshedLayerView.d.ts +0 -10
  212. package/views/layers/types.d.ts +8 -1
  213. package/views/support/LayerViewManager.js +1 -1
  214. package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
  215. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  216. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  217. package/widgets/BatchAttributeForm.js +1 -1
  218. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  219. package/widgets/Editor/VisibleElements.d.ts +14 -1
  220. package/widgets/FeatureForm.js +1 -1
  221. package/assets/esri/core/workers/chunks/209460f8aae3f9f8c9b8.js +0 -1
  222. package/assets/esri/core/workers/chunks/2f02880a7f081eb210cd.js +0 -1
  223. package/assets/esri/core/workers/chunks/4be31fcc5482a2526d2b.js +0 -1
  224. package/assets/esri/core/workers/chunks/58acc18b92533166135d.js +0 -1
  225. package/assets/esri/core/workers/chunks/6162f6735ea4622e54d8.js +0 -1
  226. package/assets/esri/core/workers/chunks/718d2d430c1a5a940b83.js +0 -1
  227. package/assets/esri/core/workers/chunks/a6379a8df8c08b729b9c.js +0 -1
  228. package/assets/esri/core/workers/chunks/b0253fe7b3529bc22270.js +0 -1
  229. package/assets/esri/core/workers/chunks/bd0829eb79efff5b7223.js +0 -1
  230. package/assets/esri/core/workers/chunks/c193b4a175a544c4fcd6.js +0 -1
  231. package/assets/esri/core/workers/chunks/d28169816c768d55aa09.js +0 -1
  232. package/assets/esri/core/workers/chunks/d7c0ab622caf495dbcef.js +0 -1
  233. package/assets/esri/core/workers/chunks/f10a339b16d84b650012.js +0 -2
  234. package/assets/esri/core/workers/chunks/f69d3ff8a69c1985bca3.js +0 -1
  235. package/assets/esri/core/workers/chunks/f847a4846c427f671455.js +0 -1
  236. package/chunks/OITBlendEmission.glsl.js +0 -6
  237. package/chunks/OITDimOpaque.glsl.js +0 -4
  238. package/views/2d/layers/support/annodime/fields.js +0 -2
  239. package/views/3d/webgl-engine/core/shaderLibrary/util/EmissionDimming.glsl.js +0 -2
  240. package/views/3d/webgl-engine/effects/transparency/OITBlendEmission.glsl.js +0 -2
  241. package/views/3d/webgl-engine/effects/transparency/OITBlendEmissionTechnique.js +0 -2
  242. package/views/3d/webgl-engine/effects/transparency/OITDimOpaque.glsl.js +0 -2
  243. package/views/3d/webgl-engine/effects/transparency/OITDimOpaqueTechnique.js +0 -2
  244. /package/assets/esri/core/workers/chunks/{f10a339b16d84b650012.js.LICENSE.txt → 2c00f89030c7a4201033.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../analysis/LengthDimension.js";import i from"../../../../core/Accessor.js";import n from"../../../../core/Handles.js";import{destroyHandle as a,handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as o}from"../../../../core/lang.js";import{mapCollection as r}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as p,destroyMaybe as l}from"../../../../core/maybe.js";import{memoize as u}from"../../../../core/memoize.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{watch as c,initial as m,sync as h,syncAndInitial as g,when as f}from"../../../../core/reactiveUtils.js";import{property as _,subclass as M}from"../../../../core/accessorSupport/decorators.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import S from"../../../../geometry/Point.js";import{clonePoint as C}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as w,applyConstraint as b,computeConstraint as P,constraintDependencies as O}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as D,LengthDimensionPointManipulator as H,pointManipulatorHandles as j,createOffsetManipulator as T,offsetManipulatorHandles as x,LineOfSightOrientationManipulator as G,headingManipulatorHandles as z,rotationManipulatorHandles as U,createMeasureTypeManipulator as R,measureTypeManipulatorHandles as I,updateOffsetManipulatorTransform as V,updateHeadingManipulatorTransform as A,updateRotationManipulatorTransform as E,updateMeasureTypeManipulatorTransform as k,unfocusedOffsetWidth as L,focusedOffsetWidth as F}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as q,arePointsVerticallyAligned as B,computationToGeometryDependencies as N,computeGeometryFromDimension as J}from"./lengthDimensionUtils.js";import{disabledPointColor as K,pointRadius as Q,getTransparentAccentColor as W,getContrastColor as X,initialOffsetPx as Y}from"./settings.js";import{getRotateHeadingTexture as Z}from"../images/Factory.js";import{SnappingVisualizer3D as $}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as tt}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as et}from"../../interactive/visualElements/VerticesVisualElement.js";import{Parameters as it,ImageMaterial as nt}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as at}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends i{constructor(t){super(t),this._stagedDimension=null,this._snappingManagerResult=null,this._computationManipulators=new Map,this._computationHandles=new n,this._updatingHandles=new y,this._getSnappingContext=u(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new $}));const{view:e}=t;this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:at(2)}),this._constraintSnappingIndicator=new tt({view:e,attached:!0,width:1,renderOccluded:4,stipplePattern:at(5),isDecoration:!0});const i=K.toUnitRGBA();this._stagedStartIndicator=new et({view:e,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:i,size:2*Q,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const e=W(t.effectiveTheme),i=X(t.effectiveTheme),n=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=Z(t.stage.textures,{accentColor:e,contrastColor:i,preMultiplyAlpha:n});const s=new it(this._textureHandle.managedTexture,!1);s.writeDepth=!1,s.renderOccluded=16,s.isDecoration=!0,this._orientationManipulatorMaterial=new nt(s);const o=r(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([c(()=>({accentColor:W(t.effectiveTheme),contrastColor:X(t.effectiveTheme)}),({accentColor:e,contrastColor:i})=>{const a=this._textureHandle;this._textureHandle=Z(t.stage.textures,{accentColor:e,contrastColor:i,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({managedTexture:this._textureHandle.managedTexture}),a?.release();const s=e.toUnitRGBA();this._unfocusedOffsetManipulatorMaterial.setParameters({color:s}),this._focusedOffsetManipulatorMaterial.setParameters({color:s}),this._thinOffsetManipulatorMaterial.setParameters({color:s}),this._constraintSnappingIndicator.color=s},m),a(o),c(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=C(t,new S);this._applyPointUpdate(e,{endPoint:i})},h),c(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:n,firstGrabbedManipulator:a}=t;if(i===e?.stagedDimension&&a===e?.firstGrabbedManipulator){for(const s of[n,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},g),c(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),m),c(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),c(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=v();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.consumePromise(d(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",n=this._computeConstraint(t);w(t,i,{constraint:n,view:this.view})}}})}destroy(){this._textureHandle=p(this._textureHandle),this._snappingOperation=l(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy()}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager?.options}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){return this._snappingManagerResult||(this._snappingManagerResult=dt(this.view),this.addHandles(this._snappingManagerResult)),this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[f(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...g,equals:o}),c(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:n}=t;switch(n.previousConstraint){case 0:n.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:n.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:n.preConstraintProperties={measureType:"direct",orientation:i};break;default:n.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},h)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[c(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const n=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)n.attached=!0;else{const{start:e,end:a}=this._computationManipulators.get(i),s=()=>{n.attached=e.grabbing||a.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),a.events.on("grab-changed",s)],t)}else n.attached=!1}),c(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.consumePromise(d(this._snappingOperation.snap({point:t},this._ensureSnappingManager(),i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:i}){let n=t;if("mouse"===i){const e=this._getSnappingContext(i);n=this._ensureSnappingManager().update({point:t,context:e})}const a=new e({startPoint:C(n,new S),endPoint:null,measureType:"horizontal"});return this._stagedDimension=a,this._resetSnappingState(),a}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let n=t;if("mouse"===e){const i=this._getSnappingContext(e);n=this._ensureSnappingManager().update({point:t,context:i})}const a=C(n,new S);this._applyPointUpdate(i,{endPoint:a}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),n=this._setupOffsetManipulator(t),a=this._setupHeadingManipulator(t),o=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new D({start:e,end:i,offset:n,heading:a,rotation:o,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=s(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([c(()=>t.geometry,()=>this._updateManipulators(t,e),{...g,equals:o})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:n}=t,a=new H(i,{metadata:n}),s=j(a,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:n,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),a}_setupOffsetManipulator(t){const{view:e}=this,i=T(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),n=x(i,{computation:t,view:e});return this._computationHandles.add(n,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new G(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),n=z(i,{computation:t,view:e});return this._computationHandles.add(n,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new G(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),n=U(i,{computation:t,view:e});return this._computationHandles.add(n,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,n=R(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),a=I(n,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(a,t),n}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:n,selectedComputation:a,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=a===t,c=q(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==n&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);B(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;V(p,h,g),l.available&&A(l,t,g),u.available&&E(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&k(e,t,i,g)})}_updateManipulatorStyle(t){const e=L(t),i=F(t),n={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:a,heading:s,rotation:o}of this._computationManipulators.values())a.radius=i/2,s.update(n),o.update(n);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,n=N(t);"startPoint"in e&&(n.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(n.elevationAlignedEndPoint=e.endPoint);const a=J(n,i.renderCoordsHelper);if(null==a)return;const s=this._computeConstraint({...n,geometry:a});b(t,e,{...n,constraint:s,unconstrainedGeometry:a,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,n=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Y*n*i.unitInMeters}_computeConstraint(t){return P(O(t,this._ensureSnappingManager().options),this.view)}_createOffsetManipulatorMaterial(t){return new st({width:1,renderOccluded:4,writeDepth:!1,polygonOffset:3,isDecoration:!0},t.state.isGlobal)}get test(){}};t([_({constructOnly:!0})],ht.prototype,"analysis",void 0),t([_({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([_({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([_({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([_({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([_({readOnly:!0})],ht.prototype,"updating",null),t([_()],ht.prototype,"firstGrabbedManipulator",null),t([_()],ht.prototype,"hasGrabbedManipulators",null),t([_()],ht.prototype,"snappingOptions",null),t([_()],ht.prototype,"_stagedDimension",void 0),t([_()],ht.prototype,"_snappingManager",null),t([_()],ht.prototype,"_activeComputation",null),t([_()],ht.prototype,"_stagedComputation",null),t([_()],ht.prototype,"_snappingManagerResult",void 0),ht=t([M("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=v();export{ht as LengthDimensionSubTool};
2
+ import{__decorate as t}from"tslib";import e from"../../../../analysis/LengthDimension.js";import i from"../../../../core/Accessor.js";import n from"../../../../core/Handles.js";import{destroyHandle as a,handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as o}from"../../../../core/lang.js";import{mapCollection as r}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as p,destroyMaybe as l}from"../../../../core/maybe.js";import{memoize as u}from"../../../../core/memoize.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{watch as c,initial as m,sync as h,syncAndInitial as g,when as f}from"../../../../core/reactiveUtils.js";import{property as _,subclass as M}from"../../../../core/accessorSupport/decorators.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import S from"../../../../geometry/Point.js";import{clonePoint as C}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as w,applyConstraint as b,computeConstraint as P,constraintDependencies as O}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as D,LengthDimensionPointManipulator as H,pointManipulatorHandles as j,createOffsetManipulator as T,offsetManipulatorHandles as x,LineOfSightOrientationManipulator as G,headingManipulatorHandles as z,rotationManipulatorHandles as U,createMeasureTypeManipulator as R,measureTypeManipulatorHandles as I,updateOffsetManipulatorTransform as V,updateHeadingManipulatorTransform as A,updateRotationManipulatorTransform as E,updateMeasureTypeManipulatorTransform as k,unfocusedOffsetWidth as L,focusedOffsetWidth as F}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as q,arePointsVerticallyAligned as B,computationToGeometryDependencies as N,computeGeometryFromDimension as J}from"./lengthDimensionUtils.js";import{disabledPointColor as K,pointRadius as Q,getTransparentAccentColor as W,getContrastColor as X,initialOffsetPx as Y}from"./settings.js";import{getRotateHeadingTexture as Z}from"../images/Factory.js";import{SnappingVisualizer3D as $}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as tt}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as et}from"../../interactive/visualElements/VerticesVisualElement.js";import{Parameters as it,ImageMaterial as nt}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as at}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends i{constructor(t){super(t),this._stagedDimension=null,this._snappingManagerResult=null,this._computationManipulators=new Map,this._computationHandles=new n,this._updatingHandles=new y,this._getSnappingContext=u(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new $}));const{view:e}=t;this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(e),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:at(2)}),this._constraintSnappingIndicator=new tt({view:e,attached:!0,width:1,renderOccluded:4,stipplePattern:at(5),isDecoration:!0});const i=K.toUnitRGBA();this._stagedStartIndicator=new et({view:e,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:i,size:2*Q,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const e=W(t.effectiveTheme),i=X(t.effectiveTheme),n=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=Z(t.stage.textures,{accentColor:e,contrastColor:i,preMultiplyAlpha:n});const s=new it(this._textureHandle.managedTexture,!1);s.renderOccluded=16,s.isDecoration=!0,this._orientationManipulatorMaterial=new nt(s);const o=r(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([c(()=>({accentColor:W(t.effectiveTheme),contrastColor:X(t.effectiveTheme)}),({accentColor:e,contrastColor:i})=>{const a=this._textureHandle;this._textureHandle=Z(t.stage.textures,{accentColor:e,contrastColor:i,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({managedTexture:this._textureHandle.managedTexture}),a?.release();const s=e.toUnitRGBA();this._unfocusedOffsetManipulatorMaterial.setParameters({color:s}),this._focusedOffsetManipulatorMaterial.setParameters({color:s}),this._thinOffsetManipulatorMaterial.setParameters({color:s}),this._constraintSnappingIndicator.color=s},m),a(o),c(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=C(t,new S);this._applyPointUpdate(e,{endPoint:i})},h),c(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:n,firstGrabbedManipulator:a}=t;if(i===e?.stagedDimension&&a===e?.firstGrabbedManipulator){for(const s of[n,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},g),c(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),m),c(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),c(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=v();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.consumePromise(d(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",n=this._computeConstraint(t);w(t,i,{constraint:n,view:this.view})}}})}destroy(){this._textureHandle=p(this._textureHandle),this._snappingOperation=l(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy()}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager?.options}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){return this._snappingManagerResult||(this._snappingManagerResult=dt(this.view),this.addHandles(this._snappingManagerResult)),this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[f(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...g,equals:o}),c(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:n}=t;switch(n.previousConstraint){case 0:n.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:n.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:n.preConstraintProperties={measureType:"direct",orientation:i};break;default:n.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},h)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[c(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const n=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)n.attached=!0;else{const{start:e,end:a}=this._computationManipulators.get(i),s=()=>{n.attached=e.grabbing||a.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),a.events.on("grab-changed",s)],t)}else n.attached=!1}),c(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.consumePromise(d(this._snappingOperation.snap({point:t},this._ensureSnappingManager(),i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:i}){let n=t;if("mouse"===i){const e=this._getSnappingContext(i);n=this._ensureSnappingManager().update({point:t,context:e})}const a=new e({startPoint:C(n,new S),endPoint:null,measureType:"horizontal"});return this._stagedDimension=a,this._resetSnappingState(),a}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let n=t;if("mouse"===e){const i=this._getSnappingContext(e);n=this._ensureSnappingManager().update({point:t,context:i})}const a=C(n,new S);this._applyPointUpdate(i,{endPoint:a}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),n=this._setupOffsetManipulator(t),a=this._setupHeadingManipulator(t),o=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new D({start:e,end:i,offset:n,heading:a,rotation:o,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=s(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([c(()=>t.geometry,()=>this._updateManipulators(t,e),{...g,equals:o})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:n}=t,a=new H(i,{metadata:n}),s=j(a,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:n,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),a}_setupOffsetManipulator(t){const{view:e}=this,i=T(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),n=x(i,{computation:t,view:e});return this._computationHandles.add(n,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new G(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),n=z(i,{computation:t,view:e});return this._computationHandles.add(n,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new G(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),n=U(i,{computation:t,view:e});return this._computationHandles.add(n,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,n=R(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),a=I(n,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(a,t),n}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:n,selectedComputation:a,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=a===t,c=q(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==n&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);B(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;V(p,h,g),l.available&&A(l,t,g),u.available&&E(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&k(e,t,i,g)})}_updateManipulatorStyle(t){const e=L(t),i=F(t),n={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:a,heading:s,rotation:o}of this._computationManipulators.values())a.radius=i/2,s.update(n),o.update(n);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,n=N(t);"startPoint"in e&&(n.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(n.elevationAlignedEndPoint=e.endPoint);const a=J(n,i.renderCoordsHelper);if(null==a)return;const s=this._computeConstraint({...n,geometry:a});b(t,e,{...n,constraint:s,unconstrainedGeometry:a,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,n=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Y*n*i.unitInMeters}_computeConstraint(t){return P(O(t,this._ensureSnappingManager().options),this.view)}_createOffsetManipulatorMaterial(t){return new st({width:1,renderOccluded:4,writeDepth:!1,polygonOffset:3,isDecoration:!0},t.state.isGlobal)}get test(){}};t([_({constructOnly:!0})],ht.prototype,"analysis",void 0),t([_({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([_({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([_({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([_({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([_({readOnly:!0})],ht.prototype,"updating",null),t([_()],ht.prototype,"firstGrabbedManipulator",null),t([_()],ht.prototype,"hasGrabbedManipulators",null),t([_()],ht.prototype,"snappingOptions",null),t([_()],ht.prototype,"_stagedDimension",void 0),t([_()],ht.prototype,"_snappingManager",null),t([_()],ht.prototype,"_activeComputation",null),t([_()],ht.prototype,"_stagedComputation",null),t([_()],ht.prototype,"_snappingManagerResult",void 0),ht=t([M("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=v();export{ht as LengthDimensionSubTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as s,throwIfAborted as o,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as r,sync as n}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as l}from"../../../../core/units.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createDrawTool as p,getFeatureReference as _}from"./placementUtils.js";import{detachToolFromView as m}from"./toolLifecycleUtils.js";import{creationVerticalOffset as u}from"./ViewshedConfiguration.js";import v from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as w}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as g}from"./viewshedToolUtils.js";import{DrawManipulator3D as P}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as O}from"../../../input/InputManager.js";import{sketchKeys as S}from"../../../interactive/keybindings.js";import y from"../../../interactive/sketch/SketchOptions.js";const b="multiple",f=Symbol("hiddenManipulatorHandle");let C=class extends i{constructor(e){super(e),this.placementMode=b,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._sketchOptions=new y({tooltips:{enabled:!1}}),this._observerScenePoint=d(),this._targetScenePoint=d()}initialize(){this.addHandles([this.view.on("key-down",e=>this._handleKeyDown(e),O.DEFAULT),r(()=>{const{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:null!=e&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{null==e||t||this.analysis.viewsheds.add(e)},n)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}get creationState(){return this._get("creationState")}set creationState(e){this._set("creationState",e),this._sketchOptions.tooltips.enabled="placing-observer"===e}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(s()),o(t);const{resolve:i,reject:r,promise:n}=Promise.withResolvers(),l=a(t,()=>this._cancelPlacementOperation());return this._placeOperation=new v({abortHandle:l,reject:r,resolve:i}),this.place(e),n}place(e){this.callbacks.setSelectedViewshed(null),this.placementMode=e,this._startObserverPlacement()}cancelPlaceOperation(){null==this.creationState&&null==this._placeOperation||(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return null!=this.creationState&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){null!=this.creationState&&(S.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):S.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&"multiple"===this.placementMode)return this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement();this._destroyDrawTool(),this._abortCreation()}_removeStaged(){const{stagedViewshed:e}=this;return this.stagedViewshed=null,!!e&&(this.analysis.viewsheds.remove(e),!0)}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,i,s){const o=new t({observer:e,feature:s});this.analysis.viewsheds.add(o),this.stagedViewshed=o,this.creationState="placing-target",this._updateStagedViewshed(i),this.callbacks.setSelectedViewshed(null)}_onCancel(e){const t=this._removeStaged();return"placing-observer"===this.creationState?t&&"multiple"===this.placementMode?(this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement()):(this._destroyDrawTool(e),void this._abortCreation()):t?(this.creationState="placing-observer",this.callbacks.setSelectedViewshed(null),void("multiple"!==this.placementMode?(this._destroyDrawTool(e),this._abortCreation()):this._startPointPlacement())):(this._destroyDrawTool(e),void this._abortCreation())}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);const t=this.stagedViewshed;this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t)}_resolvePlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.resolve())}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){const t=this._placeOperation;this._placeOperation=null,e(t)}_startObserverPlacement(){this.creationState="placing-observer",this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);const{drawTool:e,intersector:t,renderer:i,snappingManager:s}=p({analysisViewData:this.analysisViewData,view:this.view,sketchOptions:this._sketchOptions,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>"placing-observer"===this.creationState});this._drawTool=e,this._renderer=i;try{this.view.addAndActivateTool(e),e.begin([w({mode:this.placementMode,onObserverComplete:(e,i)=>this._onObserverMapPointComplete(t,s,e,i),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(o){this._destroyDrawTool(e),this._rejectPlaceOperation(o instanceof Error?o:new Error(String(o)))}}_onComplete(e){this._removeStaged(),this._resolvePlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t,i,s){const o=V(i),a=this._toScenePoint(i,this._targetScenePoint),r=_({intersector:e,snappingManager:t,screenPoint:s,view:this.view});this._renderer?.updatePlacementLocation(a),this._handleObserverPlacementComplete(o,a,r)}_onTargetMapPointComplete(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._handleTargetPlacementComplete(t),"multiple"===this.placementMode&&(this.creationState="placing-observer",this._onObserverMapPointPreview(e))}_onObserverMapPointPreview(e){const t=V(e),i=this._toScenePoint(t,this._observerScenePoint);this._renderer?.updatePlacementLocation(i)}_onTargetMapPointPreview(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_onManipulatorCountChange(e){e.removeHandles(f);const t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof P&&t.push(e.disableDisplay())}),e.addHandles(t,f)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&m(this.view,e)}_toScenePoint(e,t){return this.view.renderCoordsHelper.toRenderCoords(e,t),t}_updateStagedViewshed(e){const t=this.stagedViewshed;if(!t)return;const i=this.callbacks.findViewshedComputedData(t);if(!i)return;const{heading:s,tilt:o,farDistance:a}=g(this.view,i,e);t.farDistance=a,t.tilt=o,t.heading=s}get test(){}};function V(e){const t=e.clone(),i=l(t.spatialReference);return t.z=(t.z??0)+u/i,t}e([c({constructOnly:!0})],C.prototype,"analysis",void 0),e([c({constructOnly:!0})],C.prototype,"analysisViewData",void 0),e([c({constructOnly:!0})],C.prototype,"view",void 0),e([c({constructOnly:!0})],C.prototype,"callbacks",void 0),e([c()],C.prototype,"placementMode",void 0),e([c()],C.prototype,"stagedViewshed",void 0),e([c()],C.prototype,"_placeOperation",void 0),e([c()],C.prototype,"_drawTool",void 0),e([c()],C.prototype,"_renderer",void 0),e([c()],C.prototype,"_sketchOptions",void 0),e([c()],C.prototype,"updating",null),e([c()],C.prototype,"active",null),e([c({value:null})],C.prototype,"creationState",null),C=e([h("esri.views.3d.analysis.Viewshed.ViewshedPlacementController")],C);export{C as ViewshedPlacementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import o from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as i,throwIfAborted as s,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as n,sync as r}from"../../../../core/reactiveUtils.js";import{property as l,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as d}from"../../../../support/elevationInfoUtils.js";import{createDrawTool as p,getFeatureReference as _}from"./placementUtils.js";import{detachToolFromView as v}from"./toolLifecycleUtils.js";import m from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as u}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as w}from"./viewshedToolUtils.js";import{vectorToRender as P}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as g}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as b}from"../../../input/InputManager.js";import{sketchKeys as f}from"../../../interactive/keybindings.js";import S from"../../../interactive/sketch/SketchOptions.js";const y="multiple",O=Symbol("hiddenManipulatorHandle");let T=class extends o{constructor(e){super(e),this.placementMode=y,this.observerPlacementElevationInfo=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._sketchOptions=new S({tooltips:{enabled:!1}}),this._observerScenePoint=h(),this._targetScenePoint=h(),this._mapPointVector=h()}initialize(){this.addHandles([this.view.on("key-down",e=>this._handleKeyDown(e),b.DEFAULT),n(()=>{const{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:null!=e&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{null==e||t||this.analysis.viewsheds.add(e)},r)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}get creationState(){return this._get("creationState")}set creationState(e){this._set("creationState",e),this._sketchOptions.tooltips.enabled="placing-observer"===e}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(i()),s(t);const{resolve:o,reject:n,promise:r}=Promise.withResolvers(),l=a(t,()=>this._cancelPlacementOperation());return this._placeOperation=new m({abortHandle:l,reject:n,resolve:o}),this.placementMode=e,this.observerPlacementElevationInfo=t?.elevationInfo,this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),r}cancelPlaceOperation(){null==this.creationState&&null==this._placeOperation||(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return null!=this.creationState&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){null!=this.creationState&&(f.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):f.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&"multiple"===this.placementMode)return this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement();this._destroyDrawTool(),this._abortCreation()}_removeStaged(){const{stagedViewshed:e}=this;return this.stagedViewshed=null,!!e&&(this.analysis.viewsheds.remove(e),!0)}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,o,i){const s=new t({observer:e,elevationInfo:this.observerPlacementElevationInfo,feature:i});this.analysis.viewsheds.add(s),this.stagedViewshed=s,this.creationState="placing-target",this._updateStagedViewshed(o),this.callbacks.setSelectedViewshed(null)}_onCancel(e){const t=this._removeStaged();return"placing-observer"===this.creationState?t&&"multiple"===this.placementMode?(this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement()):(this._destroyDrawTool(e),void this._abortCreation()):t?(this.creationState="placing-observer",this.callbacks.setSelectedViewshed(null),void("multiple"!==this.placementMode?(this._destroyDrawTool(e),this._abortCreation()):this._startPointPlacement())):(this._destroyDrawTool(e),void this._abortCreation())}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);const t=this.stagedViewshed;this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t)}_resolvePlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.resolve())}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){const t=this._placeOperation;this._placeOperation=null,this.observerPlacementElevationInfo=null,e(t)}_startObserverPlacement(){this.creationState="placing-observer",this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);const{drawTool:e,intersector:t,renderer:o,snappingManager:i}=p({analysisViewData:this.analysisViewData,view:this.view,sketchOptions:this._sketchOptions,elevationInfo:this._observerDrawToolElevationInfo,getSnapToSceneEnabled:()=>this._snapToSceneEnabled,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>"placing-observer"===this.creationState});this._drawTool=e,this._renderer=o;try{this.view.addAndActivateTool(e),e.begin([u({mode:this.placementMode,onObserverComplete:(e,o)=>this._onObserverMapPointComplete(t,i,e,o),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(s){this._destroyDrawTool(e),this._rejectPlaceOperation(s instanceof Error?s:new Error(String(s)))}}_onComplete(e){this._removeStaged(),this._resolvePlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t,o,i){const s=o.clone(),a=this._toScenePoint(o,this._targetScenePoint,this._observerDrawToolElevationInfo),n=_({intersector:e,snappingManager:t,screenPoint:i,view:this.view});this._renderer?.updatePlacementLocation(a),this._handleObserverPlacementComplete(s,a,n),this._setDrawToolElevationInfo(d)}_onTargetMapPointComplete(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._handleTargetPlacementComplete(t),"multiple"===this.placementMode&&(this.creationState="placing-observer",this._setDrawToolElevationInfo(this._observerDrawToolElevationInfo),this._onObserverMapPointPreview(e))}_onObserverMapPointPreview(e){const t=e.clone(),o=this._toScenePoint(t,this._observerScenePoint,this._observerDrawToolElevationInfo);this._renderer?.updatePlacementLocation(o)}_onTargetMapPointPreview(e){const t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_setDrawToolElevationInfo(e){const t=this._drawTool;t&&(t.elevationInfo=e)}get _observerDrawToolElevationInfo(){return this.observerPlacementElevationInfo??d}get _snapToSceneEnabled(){const e=this.observerPlacementElevationInfo?.mode;return("placing-observer"!==this.creationState||null==e||"absolute-height"===e)&&null}_onManipulatorCountChange(e){e.removeHandles(O);const t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof g&&t.push(e.disableDisplay())}),e.addHandles(t,O)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&v(this.view,e)}_toScenePoint(e,t,o=d){const{x:i,y:s,z:a,spatialReference:n}=e,r=this._mapPointVector;return r[0]=i,r[1]=s,r[2]=a??0,P(r,n,o,this.view,t)}_updateStagedViewshed(e){const t=this.stagedViewshed;if(!t)return;const o=this.callbacks.findViewshedComputedData(t);if(!o)return;const{heading:i,tilt:s,farDistance:a}=w(this.view,o,e);t.farDistance=a,t.tilt=s,t.heading=i}get test(){}};e([l({constructOnly:!0})],T.prototype,"analysis",void 0),e([l({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([l({constructOnly:!0})],T.prototype,"view",void 0),e([l({constructOnly:!0})],T.prototype,"callbacks",void 0),e([l()],T.prototype,"placementMode",void 0),e([l()],T.prototype,"observerPlacementElevationInfo",void 0),e([l()],T.prototype,"stagedViewshed",void 0),e([l()],T.prototype,"_placeOperation",void 0),e([l()],T.prototype,"_drawTool",void 0),e([l()],T.prototype,"_renderer",void 0),e([l()],T.prototype,"_sketchOptions",void 0),e([l()],T.prototype,"updating",null),e([l()],T.prototype,"active",null),e([l({value:null})],T.prototype,"creationState",null),T=e([c("esri.views.3d.analysis.Viewshed.ViewshedPlacementController")],T);export{T as ViewshedPlacementController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as i}from"../../../../core/lang.js";import{deg2rad as s}from"../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as o,initial as a}from"../../../../core/reactiveUtils.js";import{property as l,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as m,set as d,sub as u,len as p,normalize as v,scale as _,angle as V,negate as f,copy as E,add as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w,clone as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as C}from"../../../../support/elevationInfoUtils.js";import{isOtherViewshedToolCreating as A}from"./analysisViewRegister.js";import{viewshedVisualizationConfiguration as L,arcAnglePerSegment as D}from"./ViewshedConfiguration.js";import{ViewshedShapeVisualElement as y}from"./ViewshedShapeVisualElement.js";import{LineVisualElement as S}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as j}from"../../interactive/visualElements/PointVisualElement.js";import{VerticesVisualElement as R}from"../../interactive/visualElements/VerticesVisualElement.js";import{createStipplePatternSimple as O}from"../../webgl-engine/materials/lineStippleUtils.js";let F=class extends t{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:w(),topRight:w(),bottomLeft:w(),bottomRight:w()},this._arcCenterPoints={top:w(),bottom:w(),left:w(),right:w()},this._parallelCenters={top:w(),bottom:w()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:4},s={...t,stipplePattern:O(2)};this._observerVisualElement=new j({...e,...L.observerPointConfiguration,elevationInfo:C}),this._observerStagedVisualElement=new R({...e,...L.observerStagedPointConfiguration,spatialReference:this.view.renderCoordsHelper.spatialReference,elevationInfo:C}),this._shapeVisualElement=new y({...e,isDecoration:this.isDecoration}),this._frameLinesVisualElement=new S(t),this._leftArcVisualElement=new S(t),this._rightArcVisualElement=new S(t),this._topArcVisualElement=new S(t),this._bottomArcVisualElement=new S(t),this._centralLongitude=new S(s),this._centralLatitude=new S(s),this.addHandles([o(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const t=this._viewshedCorners,i=this._arcCenterPoints,s=this._parallelCenters;return e.cornerPoints(t),e.arcCentersPoints(i),e.parallelCenterPoints(s),{viewshedComputedData:e,corners:t,arcCenters:i,parallelCenters:s,interactive:this.analysisViewData.interactive,selected:this._selected}},e=>{const t=null!=e;this._forEachVisualElement(e=>e.attached=t),t&&this._updateVisualElements(e)},{initial:!0,equals:i}),o(()=>{const{viewshedComputedData:e}=this,{horizontalFieldOfView:t,verticalFieldOfView:i}=e??{};return{viewshedComputedData:e,horizontalFieldOfView:t,verticalFieldOfView:i}},({viewshedComputedData:e})=>{const{_shapeVisualElement:t}=this;e!==t.viewshedComputedData&&(t.viewshedComputedData=e),this._shapeVisualElement.recreateGeometry()},a),o(()=>{const{interactive:e}=this.analysisViewData;return{visible:this.visible,selected:e&&this._selected,staged:e&&this._staged,horFovNot360:360!==this.viewshedComputedData?.horizontalFieldOfView}},({visible:e,selected:t,staged:i,horFovNot360:s})=>{const r=t||i;this._shapeVisualElement.visible=e,this._topArcVisualElement.visible=e,this._bottomArcVisualElement.visible=e,this._frameLinesVisualElement.visible=e&&s;const o=e&&(t||s);this._leftArcVisualElement.visible=o,this._rightArcVisualElement.visible=o,this._forEachLineVisualElement(e=>{e.width=r?L.frameWidthSelected:L.frameWidthNotSelected,e.renderOccluded=t?4:1}),[this._centralLatitude,this._centralLongitude].forEach(i=>{i.width=2*(r?L.frameWidthSelected:L.frameWidthNotSelected),i.visible=e&&t})},a),o(()=>{const{analysisViewData:{interactive:e,effectiveTool:t},_selected:i,_staged:s,visible:r}=this,o=i||s,a=!t?.active&&A(this.view,this.analysisViewData);return{observerVisible:r&&!o&&(!e||(t?.creating??!1)||a),observerStagedVisible:s,color:this._color}},({observerVisible:e,observerStagedVisible:t,color:i})=>{this._observerVisualElement.visible=e,this._observerStagedVisualElement.visible=t,this._forEachLineVisualElement(e=>e.color=i)},a)])}get _color(){const{viewshedComputedData:e,_selected:t,analysisViewData:i}=this;if(null==e)return L.frameColor.toUnitRGBA();const s=i.effectiveTool?.active||i.interactive,r=e.viewshed===i.stagedViewshed;return(s&&(t||r)?this.view.effectiveTheme.accentColor:L.frameColor).toUnitRGBA()}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:e,viewshedComputedData:t}=this,{effectiveTool:i}=e;return null!=i&&i.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=r(this._observerVisualElement),this._observerStagedVisualElement=r(this._observerStagedVisualElement),this._shapeVisualElement=r(this._shapeVisualElement),this._frameLinesVisualElement=r(this._frameLinesVisualElement),this._leftArcVisualElement=r(this._leftArcVisualElement),this._rightArcVisualElement=r(this._rightArcVisualElement),this._topArcVisualElement=r(this._topArcVisualElement),this._bottomArcVisualElement=r(this._bottomArcVisualElement),this._centralLongitude=r(this._centralLongitude),this._centralLatitude=r(this._centralLatitude)}_forEachLineVisualElement(e){[this._frameLinesVisualElement,this._leftArcVisualElement,this._rightArcVisualElement,this._topArcVisualElement,this._bottomArcVisualElement,this._centralLatitude,this._centralLongitude].forEach(e)}_forEachVisualElement(e){this._forEachLineVisualElement(e),e(this._observerVisualElement),e(this._observerStagedVisualElement),e(this._shapeVisualElement)}_updateVisualElements(e){const{viewshedComputedData:t,corners:i,arcCenters:s,parallelCenters:r}=e,o=w();this.view.renderCoordsHelper.toRenderCoords(t.elevationAlignedObserver,o),this._observerVisualElement.geometry=t.elevationAlignedObserver,this._observerStagedVisualElement.vertices=[o],this._shapeVisualElement.updateTransform(),this._updateFrameLines(t,i),this._updateFrameArcs(t,i,r),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){const i=e.elevationAlignedObserverRenderSpace;this._frameLinesVisualElement.geometry=[[i,t.topLeft],[i,t.topRight],[i,t.bottomLeft],[i,t.bottomRight]]}_updateFrameArcs(e,t,i){const{elevationAlignedObserverRenderSpace:r,rightVector:o,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=s(a),u=w(),p=c();h(p,n/2,l),m(u,o,p),P(this._leftArcVisualElement,r,t.bottomLeft,t.topLeft,"forward",u),h(p,-n/2,l),d(u,0,0,0),m(u,o,p),P(this._rightArcVisualElement,r,t.bottomRight,t.topRight,"forward",u);const v=a>180?"backward":"forward";P(this._topArcVisualElement,i.top,t.topRight,t.topLeft,v,l),P(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,v,l)}_updateCentralHelperArcs(e,t){const i=e.elevationAlignedObserverRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";P(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),P(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function P(e,t,i,s,r,o,a=D){const l=w();u(l,i,t);const n=p(l),d=w();u(d,s,t),v(d,d),_(d,d,n);let C=V(l,d);const A=g(o);"backward"===r&&(f(A,A),C=-(2*Math.PI-C));const L=[],y=Math.ceil(Math.abs(C)/a),S=c();h(S,C/y,A);const j=w();E(j,l);const R=w();E(R,i);for(let h=0;h<y;h++){const e=w();E(e,R),m(j,j,S),b(R,t,j);const i=w();E(i,R),L.push([e,i])}e.geometry=L}e([l()],F.prototype,"view",void 0),e([l({constructOnly:!0})],F.prototype,"isDecoration",void 0),e([l()],F.prototype,"analysisViewData",void 0),e([l()],F.prototype,"viewshedComputedData",void 0),e([l()],F.prototype,"visible",void 0),e([l()],F.prototype,"_color",null),e([l()],F.prototype,"_selected",null),e([l()],F.prototype,"_staged",null),F=e([n("esri.views.3d.analysis.Viewshed.ViewshedSubVisualization")],F);const U=F;export{U as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as i}from"../../../../core/lang.js";import{deg2rad as s}from"../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as a,initial as o}from"../../../../core/reactiveUtils.js";import{property as l,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as m,set as d,sub as u,len as p,normalize as v,scale as _,angle as V,negate as f,copy as E,add as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g,clone as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as C}from"../../../../support/elevationInfoUtils.js";import{isOtherViewshedToolCreating as A}from"./analysisViewRegister.js";import{viewshedVisualizationConfiguration as L,arcAnglePerSegment as D}from"./ViewshedConfiguration.js";import{ViewshedShapeVisualElement as y}from"./ViewshedShapeVisualElement.js";import{LineVisualElement as S}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as j}from"../../interactive/visualElements/PointVisualElement.js";import{VerticesVisualElement as O}from"../../interactive/visualElements/VerticesVisualElement.js";import{createStipplePatternSimple as R}from"../../webgl-engine/materials/lineStippleUtils.js";let F=class extends t{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:g(),topRight:g(),bottomLeft:g(),bottomRight:g()},this._arcCenterPoints={top:g(),bottom:g(),left:g(),right:g()},this._parallelCenters={top:g(),bottom:g()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:4},s={...t,stipplePattern:R(2)};this._observerVisualElement=new j({...e,...L.observerPointConfiguration,elevationInfo:C}),this._observerStagedVisualElement=new O({...e,...L.observerStagedPointConfiguration,spatialReference:this.view.renderCoordsHelper.spatialReference,elevationInfo:C}),this._shapeVisualElement=new y({...e,isDecoration:this.isDecoration}),this._frameLinesVisualElement=new S(t),this._leftArcVisualElement=new S(t),this._rightArcVisualElement=new S(t),this._topArcVisualElement=new S(t),this._bottomArcVisualElement=new S(t),this._centralLongitude=new S(s),this._centralLatitude=new S(s),this.addHandles([a(()=>{const e=this.viewshedComputedData,t=this._staged;if(null==e)return null;if(!e.valid)return{viewshedComputedData:e,staged:t,valid:!1};const i=this._viewshedCorners,s=this._arcCenterPoints,r=this._parallelCenters;return e.cornerPoints(i),e.arcCentersPoints(s),e.parallelCenterPoints(r),{viewshedComputedData:e,corners:i,arcCenters:s,parallelCenters:r,staged:t,valid:!0}},e=>{const t=!0===e?.valid,i=!t&&!0===e?.staged;this._forEachVisualElement(e=>e.attached=t),this._observerStagedVisualElement.attached=t||i,(t||i)&&this._updateVisualElements(e)},{initial:!0,equals:i}),a(()=>{const{viewshedComputedData:e}=this,{horizontalFieldOfView:t,verticalFieldOfView:i}=e??{};return{viewshedComputedData:e,horizontalFieldOfView:t,verticalFieldOfView:i}},({viewshedComputedData:e})=>{const{_shapeVisualElement:t}=this;e!==t.viewshedComputedData&&(t.viewshedComputedData=e),this._shapeVisualElement.recreateGeometry()},o),a(()=>{const{interactive:e}=this.analysisViewData;return{visible:this.visible,selected:e&&this._selected,staged:e&&this._staged,horFovNot360:360!==this.viewshedComputedData?.horizontalFieldOfView}},({visible:e,selected:t,staged:i,horFovNot360:s})=>{const r=t||i;this._shapeVisualElement.visible=e,this._topArcVisualElement.visible=e,this._bottomArcVisualElement.visible=e,this._frameLinesVisualElement.visible=e&&s;const a=e&&(t||s);this._leftArcVisualElement.visible=a,this._rightArcVisualElement.visible=a,this._forEachLineVisualElement(e=>{e.width=r?L.frameWidthSelected:L.frameWidthNotSelected,e.renderOccluded=t?4:1}),[this._centralLatitude,this._centralLongitude].forEach(i=>{i.width=2*(r?L.frameWidthSelected:L.frameWidthNotSelected),i.visible=e&&t})},o),a(()=>{const{analysisViewData:{interactive:e,effectiveTool:t},_selected:i,_staged:s,visible:r}=this,a=i||s,o=!t?.active&&A(this.view,this.analysisViewData);return{observerVisible:r&&!a&&(!e||(t?.creating??!1)||o),observerStagedVisible:s,color:this._color}},({observerVisible:e,observerStagedVisible:t,color:i})=>{this._observerVisualElement.visible=e,this._observerStagedVisualElement.visible=t,this._forEachLineVisualElement(e=>e.color=i)},o)])}get _color(){const{viewshedComputedData:e,_selected:t,analysisViewData:i}=this;if(null==e)return L.frameColor.toUnitRGBA();const s=i.effectiveTool?.active||i.interactive,r=e.viewshed===i.stagedViewshed;return(s&&(t||r)?this.view.effectiveTheme.accentColor:L.frameColor).toUnitRGBA()}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:e,viewshedComputedData:t}=this,{effectiveTool:i}=e;return null!=i&&i.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=r(this._observerVisualElement),this._observerStagedVisualElement=r(this._observerStagedVisualElement),this._shapeVisualElement=r(this._shapeVisualElement),this._frameLinesVisualElement=r(this._frameLinesVisualElement),this._leftArcVisualElement=r(this._leftArcVisualElement),this._rightArcVisualElement=r(this._rightArcVisualElement),this._topArcVisualElement=r(this._topArcVisualElement),this._bottomArcVisualElement=r(this._bottomArcVisualElement),this._centralLongitude=r(this._centralLongitude),this._centralLatitude=r(this._centralLatitude)}_forEachLineVisualElement(e){[this._frameLinesVisualElement,this._leftArcVisualElement,this._rightArcVisualElement,this._topArcVisualElement,this._bottomArcVisualElement,this._centralLatitude,this._centralLongitude].forEach(e)}_forEachVisualElement(e){this._forEachLineVisualElement(e),e(this._observerVisualElement),e(this._observerStagedVisualElement),e(this._shapeVisualElement)}_updateObserverVisualElements(e){const{viewshedComputedData:t}=e,i=g();this.view.renderCoordsHelper.toRenderCoords(t.elevationAlignedObserver,i),this._observerVisualElement.geometry=t.elevationAlignedObserver,this._observerStagedVisualElement.vertices=[i]}_updateVisualElements(e){if(this._updateObserverVisualElements(e),!e.valid)return;const{viewshedComputedData:t,corners:i,arcCenters:s,parallelCenters:r}=e;this._shapeVisualElement.updateTransform(),this._updateFrameLines(t,i),this._updateFrameArcs(t,i,r),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){const i=e.elevationAlignedObserverRenderSpace;this._frameLinesVisualElement.geometry=[[i,t.topLeft],[i,t.topRight],[i,t.bottomLeft],[i,t.bottomRight]]}_updateFrameArcs(e,t,i){const{elevationAlignedObserverRenderSpace:r,rightVector:a,horizontalFieldOfView:o,tiltedUpVector:l}=e,n=s(o),u=g(),p=c();h(p,n/2,l),m(u,a,p),P(this._leftArcVisualElement,r,t.bottomLeft,t.topLeft,"forward",u),h(p,-n/2,l),d(u,0,0,0),m(u,a,p),P(this._rightArcVisualElement,r,t.bottomRight,t.topRight,"forward",u);const v=o>180?"backward":"forward";P(this._topArcVisualElement,i.top,t.topRight,t.topLeft,v,l),P(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,v,l)}_updateCentralHelperArcs(e,t){const i=e.elevationAlignedObserverRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";P(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),P(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function P(e,t,i,s,r,a,o=D){const l=g();u(l,i,t);const n=p(l),d=g();u(d,s,t),v(d,d),_(d,d,n);let C=V(l,d);const A=w(a);"backward"===r&&(f(A,A),C=-(2*Math.PI-C));const L=[],y=Math.ceil(Math.abs(C)/o),S=c();h(S,C/y,A);const j=g();E(j,l);const O=g();E(O,i);for(let h=0;h<y;h++){const e=g();E(e,O),m(j,j,S),b(O,t,j);const i=g();E(i,O),L.push([e,i])}e.geometry=L}e([l()],F.prototype,"view",void 0),e([l({constructOnly:!0})],F.prototype,"isDecoration",void 0),e([l()],F.prototype,"analysisViewData",void 0),e([l()],F.prototype,"viewshedComputedData",void 0),e([l()],F.prototype,"visible",void 0),e([l()],F.prototype,"_color",null),e([l()],F.prototype,"_selected",null),e([l()],F.prototype,"_staged",null),F=e([n("esri.views.3d.analysis.Viewshed.ViewshedSubVisualization")],F);const U=F;export{U as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,sync as r,initial as t}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{absoluteHeightElevationInfo as i}from"../../../../support/elevationInfoUtils.js";import{ViewshedDrawToolRenderer as s}from"./ViewshedDrawToolRenderer.js";import{isValidIntersectorResult as a}from"../../webgl-engine/lib/IntersectorResult.js";import{toGraphic as l}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{DrawTool as c}from"../../../draw/DrawTool.js";import{newToolIntersector as p}from"../../../interactive/ToolIntersector.js";import{acquire as d}from"../../../interactive/snapping/SnappingManagerPool.js";function m(o){const{analysisViewData:a,view:l,sketchOptions:m,onCancel:g,onComplete:u,onManipulatorCountChange:b,isPlacingObserver:j}=o,f=new s({view:l,isPlacingObserver:j}),v=d(l),w=p(l.state.viewingMode),{snappingManager:I}=v,M=new c({elevationInfo:i,enableVertexVisuals:!1,hasZ:!0,renderer:f,sketchOptions:m,snappingManager:I,view:l});return M.addHandles([v,e(f),M.on("cancel",()=>g(M)),M.on("complete",()=>u(M)),n(()=>M.manipulators.length,()=>b(M),r),n(()=>a.visible,e=>f.analysisVisible=e,t)]),{drawTool:M,intersector:w,renderer:f,snappingManager:I}}function g({intersector:e,snappingManager:n,screenPoint:r,view:t}){const o=n.getMainFeatureCandidate();return o?b(o):r?u(r,t,e):null}function u(e,n,r){n.sceneIntersectionHelper.intersectToolIntersectorScreen(o(e.x,e.y),r);const t=r.results.min;return a(t)?l(t,n):null}function b(e){const n={id:e.layer.id,objectIdField:"objectIdField"in e.layer?e.layer.objectIdField:void 0};return{attributes:{[n.objectIdField??"ObjectId"]:e.objectId},layer:n,objectId:e.objectId,uid:null}}export{m as createDrawTool,g as getFeatureReference};
2
+ import{destroyHandle as e}from"../../../../core/handleUtils.js";import{watch as n,syncAndInitial as r,sync as t,initial as o}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{ViewshedDrawToolRenderer as a}from"./ViewshedDrawToolRenderer.js";import{isValidIntersectorResult as s}from"../../webgl-engine/lib/IntersectorResult.js";import{toGraphic as l}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{DrawTool as c}from"../../../draw/DrawTool.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";import{acquire as p}from"../../../interactive/snapping/SnappingManagerPool.js";function g(i){const{analysisViewData:s,view:l,sketchOptions:g,elevationInfo:m,getSnapToSceneEnabled:u,onCancel:b,onComplete:j,onManipulatorCountChange:f,isPlacingObserver:v}=i,w=new a({view:l,isPlacingObserver:v}),I=p(l),M=d(l.state.viewingMode),{snappingManager:h}=I,y=new c({elevationInfo:m,enableVertexVisuals:!1,hasZ:!0,renderer:w,sketchOptions:g,snappingManager:h,view:l});return y.addHandles([I,e(w),y.on("cancel",()=>b(y)),y.on("complete",()=>j(y)),n(()=>[y.surfaceManager,u()],([e,n])=>{e&&(e.snapToSceneEnabled=n)},r),n(()=>y.manipulators.length,()=>f(y),t),n(()=>s.visible,e=>w.analysisVisible=e,o)]),{drawTool:y,intersector:M,renderer:w,snappingManager:h}}function m({intersector:e,snappingManager:n,screenPoint:r,view:t}){const o=n.getMainFeatureCandidate();return o?b(o):r?u(r,t,e):null}function u(e,n,r){n.sceneIntersectionHelper.intersectToolIntersectorScreen(i(e.x,e.y),r);const t=r.results.min;return s(t)?l(t,n):null}function b(e){const n={id:e.layer.id,objectIdField:"objectIdField"in e.layer?e.layer.objectIdField:void 0};return{attributes:{[n.objectIdField??"ObjectId"]:e.objectId},layer:n,objectId:e.objectId,uid:null}}export{g as createDrawTool,m as getFeatureReference};
@@ -1,3 +1,20 @@
1
+ import type ElevationInfo from "../../../../symbols/support/ElevationInfo.js";
2
+ import type { AbortOptions } from "../../../../core/promiseUtils.js";
3
+
4
+ /**
5
+ * Options for placing a viewshed interactively.
6
+ *
7
+ * @since 5.2
8
+ */
9
+ export interface ViewshedPlacementOptions extends AbortOptions {
10
+ /**
11
+ * Specifies how the placed viewshed observer is positioned on the vertical axis (z).
12
+ *
13
+ * @since 5.2
14
+ */
15
+ elevationInfo?: ElevationInfo | null;
16
+ }
17
+
1
18
  /**
2
19
  * Types for the [ViewshedAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/).
3
20
  *
@@ -1,8 +1,7 @@
1
1
  import type Viewshed from "../../../analysis/Viewshed.js";
2
2
  import type ViewshedAnalysis from "../../../analysis/ViewshedAnalysis.js";
3
3
  import type AnalysisView3D from "./AnalysisView3D.js";
4
- import type { AbortOptions } from "../../../core/promiseUtils.js";
5
- import type { ViewshedPlacementResult } from "./Viewshed/types.js";
4
+ import type { ViewshedPlacementOptions, ViewshedPlacementResult } from "./Viewshed/types.js";
6
5
 
7
6
  /**
8
7
  * Represents the analysis view of a [ViewshedAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ViewshedAnalysis/)
@@ -71,11 +70,6 @@ export default abstract class ViewshedAnalysisView3D extends AnalysisView3D {
71
70
  *
72
71
  * Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#interactive) to `true`.
73
72
  *
74
- * > [!WARNING]
75
- * >
76
- * > Note that when placing viewsheds interactively, the viewshed is created with a 1.5 meter vertical offset from the scene.
77
- * > _This behavior is subject to change in a future release._
78
- *
79
73
  * @param options - An object specifying additional options.
80
74
  * @returns A promise which resolves when creation is completed successfully or rejected if it is
81
75
  * canceled.
@@ -93,7 +87,7 @@ export default abstract class ViewshedAnalysisView3D extends AnalysisView3D {
93
87
  * // cancel the placement operation at some later point
94
88
  * abortController.abort();
95
89
  */
96
- createViewsheds(options?: AbortOptions | null | undefined): Promise<void>;
90
+ createViewsheds(options?: ViewshedPlacementOptions | null | undefined): Promise<void>;
97
91
  /**
98
92
  * Starts the interactive placement of a single viewshed, adding it to the [analysis](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#analysis).
99
93
  *
@@ -104,11 +98,6 @@ export default abstract class ViewshedAnalysisView3D extends AnalysisView3D {
104
98
  *
105
99
  * Calling this method sets [interactive](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/#interactive) to `true`.
106
100
  *
107
- * > [!WARNING]
108
- * >
109
- * > Note that when placing viewsheds interactively, the viewshed is created with a 1.5 meter vertical offset from the scene.
110
- * > _This behavior is subject to change in a future release._
111
- *
112
101
  * @param options - An object specifying additional options.
113
102
  * @returns A promise which
114
103
  * resolves when the operation is completed successfully or rejected if it is canceled.
@@ -127,5 +116,5 @@ export default abstract class ViewshedAnalysisView3D extends AnalysisView3D {
127
116
  * // cancel the placement operation at some later point
128
117
  * abortController.abort();
129
118
  */
130
- place(options?: AbortOptions | null | undefined): Promise<ViewshedPlacementResult>;
119
+ place(options?: ViewshedPlacementOptions | null | undefined): Promise<ViewshedPlacementResult>;
131
120
  }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{debounce as i,isPromiseLike as n}from"../../../../core/promiseUtils.js";import{createVolume as s}from"../../../../core/quantity.js";import{whenOnce as a,watch as l,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{sqrDist as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scaleAndAdd as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f,fromValues as y,clone as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as v}from"../../../../core/support/UpdatingHandles.js";import w from"../../../../geometry/Multipoint.js";import{projectOrLoad as E}from"../../../../geometry/projectionUtils.js";import{e as j}from"../../../../chunks/containsOperator.js";import{e as b}from"../../../../chunks/convexHullOperator.js";import{e as R}from"../../../../chunks/simplifyOperator.js";import{e as x}from"../../../../chunks/unionOperator.js";import{computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as T}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as G,create as L,fromExtent as O,intersects as P}from"../../../../geometry/support/aaBoundingRect.js";import{isClockwise as D}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as H}from"../../../../geometry/support/DoubleArray.js";import{a as V}from"../../../../chunks/vec3.js";import I from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as M}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as U}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as k,VolumeMeasurementPerimeterTooLargeError as A,VolumeMeasurementUnsupportedCoordinateSystemError as F,VolumeMeasurementUnsupportedLayerTransparencyError as S}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as W}from"./VolumeMeasurementRawResult.js";import N from"./VolumeMeasurementResult.js";import{ElevationContext as z}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as q}from"../../support/ElevationProvider.js";import{polygonToRenderInfoElevationAligned as B}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as Z}from"../../terrain/tileUtils.js";import{CutFillComputation as J,TargetGeometryRenderInfo as K}from"../../webgl-engine/lib/CutFillComputation.js";import{GeometryWorkerHandle as Q}from"../../../support/GeometryWorkerHandle.js";import{isIntegratedMeshLayerView as X}from"../../../support/layerViewUtils.js";let Y=class extends r{constructor(e){super(e),this._measurementWorkerHandle=new Q,this._getElevationProvider=()=>this.view.elevationProvider,this.depthExtremaPositions=null,this._updatingHandles=new v,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new Z,this._intersectingObbs=[],this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,r,o)=>{if(!this._computation.done)return;const{renderCoordsHelper:i}=this.view,n=new U({extent:t,localOrigin:r,renderCoordsHelper:i});this._computation.update(n,o),this._determineDataCoverage(n);const[s]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),a(()=>this._computation.done).then(()=>{this._updateDepthExtremaPositions(n,this._computation.getResult())})]);if(this.error)return void(this._rawResult=null);const l=this._computation.getResult();this._updateResult(n,l,"fulfilled"===s.status?s.value:null)}),this._determineDataCoverage=e=>{const{elevationAlignedGeometry:t}=this,{frustum:r}=this._computation,{cameraDimensions:o}=e;t&&r&&(this._intersectingObbs.length=0,this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,r)}),this._intersectingObbs.length?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,o):(this._findIntersectingTerrainTiles(t),this._sufficientDataCoverage=this._sufficientTerrainCoverage(o)))}}initialize(){const e=this.view;this._computation=new J({view:e}),this.addHandles([this._createElevationUpdateHandle(),l(()=>({projectedGeometry:this._projectedGeometry,localOrigin:this._localOrigin,targetGeometryRenderInfo:this._targetGeometryRenderInfo,transparencyError:!!this._unsupportedLayerTransparencyError}),({projectedGeometry:e,localOrigin:t,targetGeometryRenderInfo:r,transparencyError:o})=>{const i=e?.extent;if(!e||!i||!t||!r||o)return this._rawResult=null,void(this._sufficientDataCoverage=!0);this._updatingHandles.consumePromise(this._debouncedUpdate(e,i,t,r))},u)])}destroy(){this._updatingHandles.destroy(),this._computation.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){const e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;const t=R(e),r=E(t,this.view.spatialReference);return r.pending?(this._updatingHandles.consumePromise(r.pending),null):(t&&!r.geometry&&M(this.analysis,e.spatialReference,o.getLogger(this)),r.geometry)}get _localOrigin(){const e=this._projectedGeometry?.extent;return e?y(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return $(this._getElevationProvider(),t),t}get targetGeometry(){const{elevationAlignedGeometry:e}=this;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings.forEach(e=>e.forEach(e=>e[2]=r)),o}get _targetGeometryRenderInfo(){const e=this.targetGeometry,t=this._projectedGeometry?.extent,r=this._localOrigin;if(!e||!t||!r)return null;const{elevationProvider:o,renderCoordsHelper:i}=this.view,s=B(e,o,i,z.fromElevationInfo(new I({mode:"absolute-height"})));if(n(s))return this._updatingHandles.consumePromise(s),null;if(null==s)return null;const{positions:a,polygonIndices:l,vertexCount:u}=s,p=H(3*u),m=c(),h=c();return C(t.spatialReference,r,m,i.spatialReference),h[12]=-m[12],h[13]=-m[13],h[14]=-m[14],V(p,a,h),new K(p,l)}get updating(){return this._computation.updating||this._updatingHandles.updating}get result(){const e=this._rawResult,{volume:t,area:r,length:o}=this.analysisViewData.effectiveDisplayUnits;return e?new N({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:r,lengthUnit:o}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>X(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new k}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeterForError,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new A:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeterForError,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new A:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new F:null}get _unsupportedLayerTransparencyError(){return this.view.map.ground&&this.view.map.ground.opacity<1?new S:null}get _perimeterForError(){const{targetGeometry:e}=this;if(null==e)return null;let t=null;for(const r of e.rings){if(!D(r))continue;const e=te(re(r));t=e?Math.max(t??0,e):t}return null!=t?t*e.spatialReference.metersPerUnit:null}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&t&&(T(e.extent,e.spatialReference,ie,this.view.spatialReference),O(t,ne),P(ie,ne)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(e,t,r){const{unitInMeters:o}=this.view.renderCoordsHelper,{dimensions:{width:i,height:n},cameraNearFar:{near:a,far:l}}=e,u=i/t.width*(n/t.height),p=ee(t.cut.totalDepth,a,l)*u,m=ee(t.fill.totalDepth,a,l)*u,c=o**3;this._rawResult=new W({cutVolume:s(Math.abs(p*c),"cubic-meters"),fillVolume:s(m*c,"cubic-meters"),area:r?.area,perimeter:r?.length})}_updateDepthExtremaPositions(e,t){const{dimensions:{width:r,height:o},cameraNearFar:{near:i,far:n},cameraPositionRenderSpace:s,northVector:a,eastVector:l,upVector:u}=e,p=e=>{const{depthExtremum:p,depthExtremumCoords:[m,c],totalDepth:h}=e,d=_(s);return 0!==h&&(g(d,d,l,r*(m/t.width-.5)),g(d,d,a,o*(c/t.height-.5))),g(d,d,u,-ee(p,i,n)),d};this.depthExtremaPositions={cut:p(t.cut),fill:p(t.fill)}}_findIntersectingObbs(e,t){const r=this._intersectingObbs;"integrated-mesh-3d"===e.type&&e.getVisibleNodes().forEach(o=>{e.isNodeLoaded(o.index)&&o.geometryObbInRenderSR?.intersectsFrustum(t)&&r.push(o.geometryObbInRenderSR)}),"integrated-mesh-3dtiles"===e.type&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&r.push(e)})}_sufficientIntegratedMeshCoverage(e,t){const{renderCoordsHelper:r,spatialReference:o}=this.view,i=[],n=new w({spatialReference:o});if(this._intersectingObbs.forEach(e=>{if(oe(e.radius,t)&&(e.getCorners(ae),n.points.length=0,ae.forEach(e=>{const t=r.fromRenderCoords(e,le,o);t&&n.addPoint([t[0],t[1]])}),n.points.length)){const e=b(n);"polygon"===e?.type&&i.push(e)}}),!i.length)return!1;const s=x(i);return!!s&&j(s,e)}_findIntersectingTerrainTiles(e){const{basemapTerrain:t}=this.view;if(this._intersectingTiles.length=0,!e.extent)return;O(e.extent,se);const r=this._tileIterator;r.reset(t.rootTiles);for(let o=r.next();o;o=r.next())o.intersectsExtent(se)?o.rendered&&this._intersectingTiles.push(o):r.skipSubtree()}_sufficientTerrainCoverage(e){const{basemapTerrain:{tilingScheme:t}}=this.view;if(!this._intersectingTiles.length)return!1;const r=256/t.pixelSize;return this._intersectingTiles.every(t=>oe(t.radius*r,e))}};function $(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=q(e,t,"ground")??0))}function ee(e,t,r){return e*(r-t)+t}function te(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1]]),r?o+=h(r,i):r=[0,0],r[0]=i[0],r[1]=i[1];return t&&r&&(o+=h(r,t)),Math.sqrt(o)}function*re(e){const t=d();for(let r=0;r<e.length;r++)t[0]=e[r][0],t[1]=e[r][1],yield t}e([p()],Y.prototype,"_projectedGeometry",null),e([p()],Y.prototype,"_localOrigin",null),e([p()],Y.prototype,"_getElevationProvider",void 0),e([p()],Y.prototype,"elevationAlignedGeometry",null),e([p()],Y.prototype,"targetGeometry",null),e([p()],Y.prototype,"_targetGeometryRenderInfo",null),e([p({constructOnly:!0})],Y.prototype,"analysis",void 0),e([p({constructOnly:!0})],Y.prototype,"analysisViewData",void 0),e([p({constructOnly:!0})],Y.prototype,"view",void 0),e([p()],Y.prototype,"updating",null),e([p()],Y.prototype,"result",null),e([p()],Y.prototype,"depthExtremaPositions",void 0),e([p()],Y.prototype,"error",null),e([p()],Y.prototype,"_imLayerViewsAffectingMeasurement",null),e([p()],Y.prototype,"_insufficientDataError",null),e([p()],Y.prototype,"_perimeterTooLargeError",null),e([p()],Y.prototype,"_perimeterTooLargeLocalError",null),e([p()],Y.prototype,"_perimeterTooLargeGlobalError",null),e([p()],Y.prototype,"_unsupportedCoordinateSystemError",null),e([p()],Y.prototype,"_unsupportedLayerTransparencyError",null),e([p()],Y.prototype,"_perimeterForError",null),e([p()],Y.prototype,"_computation",void 0),e([p({readOnly:!0})],Y.prototype,"_updatingHandles",void 0),e([p()],Y.prototype,"_rawResult",void 0),e([p()],Y.prototype,"_sufficientDataCoverage",void 0),Y=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],Y);const oe=(e,t)=>e<(t.width+t.height)/2,ie=G(),ne=G(),se=L(),ae=new Array(8).fill(0).map(()=>f()),le=f();export{Y as VolumeMeasurementCutFillController};
2
+ import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{debounce as i,isPromiseLike as n}from"../../../../core/promiseUtils.js";import{createVolume as s}from"../../../../core/quantity.js";import{whenOnce as a,watch as l}from"../../../../core/reactiveUtils.js";import{property as u,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{runUntracked as m}from"../../../../core/accessorSupport/tracking.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxes as h}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{sqrDist as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scaleAndAdd as y,scale as _,set as v,negate as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w,fromValues as j,clone as E}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as R}from"../../../../core/support/UpdatingHandles.js";import x from"../../../../geometry/Multipoint.js";import{projectOrLoad as C}from"../../../../geometry/projectionUtils.js";import{e as T}from"../../../../chunks/containsOperator.js";import{e as O}from"../../../../chunks/convexHullOperator.js";import{e as L}from"../../../../chunks/simplifyOperator.js";import{e as G}from"../../../../chunks/unionOperator.js";import{computeTranslationToOriginAndRotation as V}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as D}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as H,create as M,fromExtent as I,intersects as P}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as U}from"../../../../geometry/support/coordinateSystem.js";import{isClockwise as S}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as k}from"../../../../geometry/support/DoubleArray.js";import{a as A}from"../../../../chunks/vec3.js";import F from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as W}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as q}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as B,VolumeMeasurementPerimeterTooLargeError as N,VolumeMeasurementUnsupportedCoordinateSystemError as z,VolumeMeasurementUnsupportedLayerTransparencyError as Z}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as J}from"./VolumeMeasurementRawResult.js";import K from"./VolumeMeasurementResult.js";import{ElevationContext as Q}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as X}from"../../support/ElevationProvider.js";import{Obb as Y}from"../../support/orientedBoundingBox.js";import{polygonToRenderInfoElevationAligned as $}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as ee}from"../../terrain/tileUtils.js";import{CutFillComputation as te,TargetGeometryRenderInfo as re}from"../../webgl-engine/lib/CutFillComputation.js";import{GeometryWorkerHandle as oe}from"../../../support/GeometryWorkerHandle.js";import{isIntegratedMeshLayerView as ie}from"../../../support/layerViewUtils.js";let ne=class extends r{constructor(e){super(e),this._measurementWorkerHandle=new oe,this.depthExtremaPositions=null,this.analysisObb=null,this._updatingHandles=new R,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new ee,this._intersectingObbs=[],this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,r,o)=>{if(!this._computation.done)return;const{renderCoordsHelper:i}=this.view,n=new q({extent:t,localOrigin:r,renderCoordsHelper:i});this._computation.update(n,o),this._determineDataCoverage(n,e);const[s]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),a(()=>this._computation.done).then(()=>{this._updateDepthExtremaPositions(n,this._computation.getResult())})]);if(this.error)return void(this._rawResult=null);const l=this._computation.getResult();this._updateResult(n,l,"fulfilled"===s.status?s.value:null)}),this._determineDataCoverage=(e,t)=>{const{frustum:r}=this._computation,{cameraDimensions:o}=e;t.extent&&r&&(this._intersectingObbs.length=0,this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,r)}),this._intersectingObbs.length?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,o):(this._findIntersectingTerrainTiles(t.extent),this._sufficientDataCoverage=this._sufficientTerrainCoverage(o)))}}initialize(){const e=this.view;this._computation=new te({view:e}),this.addHandles([this._createElevationUpdateHandle(),l(()=>({localOrigin:this._localOrigin,targetGeometryRenderInfo:this._targetGeometryRenderInfo,transparencyError:!!this._unsupportedLayerTransparencyError}),({localOrigin:e,targetGeometryRenderInfo:t,transparencyError:r})=>{const o=this._projectedGeometry,i=o?.extent;if(!o||!i||!e||!t||r)return this._rawResult=null,this.depthExtremaPositions=null,this.analysisObb=null,void(this._sufficientDataCoverage=!0);this._updatingHandles.consumePromise(this._debouncedUpdate(o,i,e,t))})])}destroy(){this._updatingHandles.destroy(),this._computation.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){const e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;const t=L(e),r=C(t,this.view.spatialReference);return r.pending?(this._updatingHandles.consumePromise(r.pending),null):(t&&!r.geometry&&W(this.analysis,e.spatialReference,o.getLogger(this)),r.geometry)}get _localOrigin(){const e=this._projectedGeometry?.extent;return e?j(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){const e=this._projectedGeometry;return e?m(()=>{const t=e.clone();return se(this.view.elevationProvider,t),t}):null}get targetGeometry(){const{elevationAlignedGeometry:e}=this;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings.forEach(e=>e.forEach(e=>e[2]=r)),o}get _targetGeometryRenderInfo(){const e=this.targetGeometry,t=this._localOrigin;if(!e||!t)return null;const{elevationProvider:r,renderCoordsHelper:o}=this.view,i=$(e,r,o,Q.fromElevationInfo(new F({mode:"absolute-height"})));if(n(i))return this._updatingHandles.consumePromise(i),null;if(null==i)return null;const{positions:s,polygonIndices:a,vertexCount:l}=i,u=k(3*l),p=c(),m=c();return V(e.spatialReference,t,p,o.spatialReference),m[12]=-p[12],m[13]=-p[13],m[14]=-p[14],A(u,s,m),new re(u,a)}get updating(){return this._computation.updating||this._updatingHandles.updating}get result(){const e=this._rawResult,{volume:t,area:r,length:o}=this.analysisViewData.effectiveDisplayUnits;return e?new K({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:r,lengthUnit:o}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>ie(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new B}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeterForError,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new N:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeterForError,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new N:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new z:null}get _unsupportedLayerTransparencyError(){return this.view.map.ground&&this.view.map.ground.opacity<1?new Z:null}get _perimeterForError(){const e=this._projectedGeometry;if(null==e)return null;let t=null;for(const r of e.rings){if(!S(r))continue;const e=ue(pe(r));t=e?Math.max(t??0,e):t}return null!=t?t*e.spatialReference.metersPerUnit:null}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&t&&(D(e.extent,e.spatialReference,ce,this.view.spatialReference),I(t,he),P(ce,he)&&this.notifyChange("elevationAlignedGeometry"))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(e,t,r){const{unitInMeters:o}=this.view.renderCoordsHelper,{dimensions:{width:i,height:n},cameraNearFar:{near:a,far:l}}=e,u=i/t.width*(n/t.height),p=ae(t.cut.totalDepth,a,l)*u,m=ae(t.fill.totalDepth,a,l)*u,c=o**3;this._rawResult=new J({cutVolume:s(Math.abs(p*c),"cubic-meters"),fillVolume:s(m*c,"cubic-meters"),area:r?.area,perimeter:r?.length})}_updateDepthExtremaPositions(e,t){const{dimensions:{width:r,height:o},cameraNearFar:{near:i,far:n},cameraPositionRenderSpace:s,northVector:a,eastVector:l,upVector:u}=e,p=e=>{const{depthExtremum:p,depthExtremumCoords:[m,c],totalDepth:h}=e,d=E(s);return 0!==h&&(y(d,d,l,r*(m/t.width-.5)),y(d,d,a,o*(c/t.height-.5))),y(d,d,u,-ae(p,i,n)),d},m={cut:p(t.cut),fill:p(t.fill)};this.depthExtremaPositions=m,this.analysisObb=le(e,m)}_findIntersectingObbs(e,t){const r=this._intersectingObbs;"integrated-mesh-3d"===e.type&&e.getVisibleNodes().forEach(o=>{e.isNodeLoaded(o.index)&&o.geometryObbInRenderSR?.intersectsFrustum(t)&&r.push(o.geometryObbInRenderSR)}),"integrated-mesh-3dtiles"===e.type&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&r.push(e)})}_sufficientIntegratedMeshCoverage(e,t){const{renderCoordsHelper:r,spatialReference:o}=this.view,i=[],n=new x({spatialReference:o});if(this._intersectingObbs.forEach(e=>{if(me(e.radius,t)&&(e.getCorners(we),n.points.length=0,we.forEach(e=>{const t=r.fromRenderCoords(e,je,o);t&&n.addPoint([t[0],t[1]])}),n.points.length)){const e=O(n);"polygon"===e?.type&&i.push(e)}}),!i.length)return!1;const s=G(i);return!!s&&T(s,e)}_findIntersectingTerrainTiles(e){const{basemapTerrain:t}=this.view;this._intersectingTiles.length=0,I(e,de);const r=this._tileIterator;r.reset(t.rootTiles);for(let o=r.next();o;o=r.next())o.intersectsExtent(de)?o.rendered&&this._intersectingTiles.push(o):r.skipSubtree()}_sufficientTerrainCoverage(e){const{basemapTerrain:{tilingScheme:t}}=this.view;if(!this._intersectingTiles.length)return!1;const r=256/t.pixelSize;return this._intersectingTiles.every(t=>me(t.radius*r,e))}};function se(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=X(e,t,"ground")??0))}function ae(e,t,r){return e*(r-t)+t}function le(e,t){const{boundingRect:r,eastVector:o,northVector:i,upVector:n}=e;U(t.cut,o,i,n,fe),U(t.fill,o,i,n,ge);const s=.5*(r[0]+r[2]),a=.5*(r[1]+r[3]),l=Math.min(fe[2],ge[2]),u=Math.max(fe[2],ge[2]),p=.5*(l+u);return _(ye,o,s),y(ye,ye,i,a),y(ye,ye,n,p),v(_e,.5*(r[2]-r[0]),.5*(r[3]-r[1]),.5*(u-l)),b(ve,n),new Y(ye,_e,h(be,ve,o,i))}function ue(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1]]),r?o+=f(r,i):r=[0,0],r[0]=i[0],r[1]=i[1];return t&&r&&(o+=f(r,t)),Math.sqrt(o)}function*pe(e){const t=g();for(let r=0;r<e.length;r++)t[0]=e[r][0],t[1]=e[r][1],yield t}e([u()],ne.prototype,"_projectedGeometry",null),e([u()],ne.prototype,"_localOrigin",null),e([u()],ne.prototype,"elevationAlignedGeometry",null),e([u()],ne.prototype,"targetGeometry",null),e([u()],ne.prototype,"_targetGeometryRenderInfo",null),e([u({constructOnly:!0})],ne.prototype,"analysis",void 0),e([u({constructOnly:!0})],ne.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],ne.prototype,"view",void 0),e([u()],ne.prototype,"updating",null),e([u()],ne.prototype,"result",null),e([u()],ne.prototype,"depthExtremaPositions",void 0),e([u()],ne.prototype,"analysisObb",void 0),e([u()],ne.prototype,"error",null),e([u()],ne.prototype,"_imLayerViewsAffectingMeasurement",null),e([u()],ne.prototype,"_insufficientDataError",null),e([u()],ne.prototype,"_perimeterTooLargeError",null),e([u()],ne.prototype,"_perimeterTooLargeLocalError",null),e([u()],ne.prototype,"_perimeterTooLargeGlobalError",null),e([u()],ne.prototype,"_unsupportedCoordinateSystemError",null),e([u()],ne.prototype,"_unsupportedLayerTransparencyError",null),e([u()],ne.prototype,"_perimeterForError",null),e([u()],ne.prototype,"_computation",void 0),e([u({readOnly:!0})],ne.prototype,"_updatingHandles",void 0),e([u()],ne.prototype,"_rawResult",void 0),e([u()],ne.prototype,"_sufficientDataCoverage",void 0),ne=e([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],ne);const me=(e,t)=>e<(t.width+t.height)/2,ce=H(),he=H(),de=M(),fe=w(),ge=w(),ye=w(),_e=w(),ve=w(),be=d(),we=new Array(8).fill(0).map(()=>w()),je=w();export{ne as VolumeMeasurementCutFillController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../../../intl.js";import{volumeMeasurementConfiguration as o}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import l from"../../../../core/Accessor.js";import{equals as r}from"../../../../core/arrayUtils.js";import{cyclicalPI as n}from"../../../../core/Cyclical.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{isPromiseLike as c}from"../../../../core/promiseUtils.js";import{preferredVolumePrecision as u,formatDecimal as m}from"../../../../core/quantityFormatUtils.js";import{watch as d,initial as h}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as p}from"../../../../core/units.js";import{property as g,subclass as y}from"../../../../core/accessorSupport/decorators.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f,normalize as v,subtract as j,cross as L,dot as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as C,fromValues as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as w}from"../../../../core/support/UpdatingHandles.js";import{computeTranslationToOriginAndRotation as G}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{angleAroundAxis as P}from"../../../../geometry/support/vector.js";import{a as F}from"../../../../chunks/vec3.js";import x from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as R}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as O}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as M}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as A}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as D}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as U}from"../../layers/graphics/extrudeUtils.js";import{polygonToRenderInfoElevationAligned as E}from"../../support/renderInfoUtils/polygon.js";import{CutFillVisualization as S,VolumeGeometry as z}from"../../webgl-engine/lib/CutFillVisualization.js";import{createStipplePatternSimple as H}from"../../webgl-engine/materials/lineStippleUtils.js";let B=class extends l{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages||this._updatingHandles.updating}get hasUnsupportedError(){const{error:e}=this.analysisViewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}get _extrusionHeights(){const{renderCoordsHelper:e}=this.view,{depthExtremaPositions:t,targetGeometry:i}=this.analysisViewData,{targetElevationRange:s}=o;if(!i||!t)return{cut:s,fill:-s};let l=-1/0;for(const o of i.rings)for(const e of o)l=Math.max(l,e[2]);const r=1,n=e.getAltitude(t.fill);return{cut:s,fill:Math.min(n-l,0)-r}}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._updatingHandles=new w,this._elevationContext=D.fromElevationInfo(new x({mode:"absolute-height"})),this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=o,l={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new M({...l,isDraped:!0,color:s.geometryOutlineColor.toUnitRGBA()}),this._targetGeometry=new M(l);const r={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:3},n={...r,stipplePattern:H(s.projectionLineStippleSize)},a=s.cutProjectionLineColor.toUnitRGBA(),c=s.fillProjectionLineColor.toUnitRGBA();this._cutProjectionLines=new O({...r,color:a}),this._occludedCutProjectionLines=new O({...n,color:a}),this._fillProjectionLines=new O({...r,color:c,renderOccluded:8}),this._occludedFillProjectionLines=new O({...n,color:c});const u={...i,attached:!0};this._cutVolumeLabel=new R({...u,distance:s.labelDistance}),this._fillVolumeLabel=new R({...u,distance:-s.labelDistance}),this._cutFillVisualization=new S({view:e,cutColor:s.cutColor,fillColor:s.fillColor,borderColor:s.geometryOutlineColor}),this.addHandles([d(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},h),d(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i,this._cutFillVisualization.measureType=i},h),d(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i),h),d(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.analysisViewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},h),d(()=>[this.analysisViewData.targetGeometry,this._extrusionHeights,this._polygonRenderInfo],()=>this._updateCutFillGeometry(),h),d(()=>this.visible&&this.view.state.camera.aboveGround&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),h),d(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{depthExtremaPositions:s.depthExtremaPositions,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),d(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),h),t(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=a(this._elevationAlignedGeometry),this._targetGeometry=a(this._targetGeometry),this._cutProjectionLines=a(this._cutProjectionLines),this._occludedCutProjectionLines=a(this._occludedCutProjectionLines),this._fillProjectionLines=a(this._fillProjectionLines),this._occludedFillProjectionLines=a(this._occludedFillProjectionLines),this._cutVolumeLabel=a(this._cutVolumeLabel),this._fillVolumeLabel=a(this._fillVolumeLabel),this._cutFillVisualization.destroy(),this._updatingHandles.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,o=[],l=[],n=[],a=[],c=[],u=e.spatialReference;for(let m=0;m<e.rings.length;m++){const i=e.rings[m],d=i.length>1&&r(i[0],i[i.length-1]),h=i.length-(d?1:0),p=[];for(let e=0;e<h;++e){const o=i[e],l=f(C(),o[0],o[1],o[2]);s.toRenderCoords(l,u,l);const r=t.rings[m][e],n=f(C(),r[0],r[1],r[2]);s.toRenderCoords(n,u,n);const a=new A(l,n);p.push(a)}const g=this.view.state.camera;for(let e=0;e<p.length;++e){const s=p[e],r=p[0===e?p.length-1:e-1],u=p[e===p.length-1?0:e+1],d=i[e],h=t.rings[m][e],y=d[2]>h[2],_=new T(s,r,u,y);o.push(_),_.updateOccluded(g);const f=_.isOccluded;y?(f?n:l).push(s):(f?c:a).push(s)}}this._projectionLines=o,this._cutProjectionLines.setGeometryFromSegments(l),this._occludedCutProjectionLines.setGeometryFromSegments(n),this._fillProjectionLines.setGeometryFromSegments(a),this._occludedFillProjectionLines.setGeometryFromSegments(c)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let l=!1,r=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(l||=n.isCut,r||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}r&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),l&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,t,i){const{geometryOutlineColor:s,cutColor:l,fillColor:r,cutColorMuted:n,fillColorMuted:a,cutProjectionLineColor:c,fillProjectionLineColor:u}=o;if(this._cutFillVisualization.cutColor=i?l:n,this._cutFillVisualization.fillColor=i?r:a,e){const e=t.toUnitRGBA();this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillVisualization.borderColor=t}else{this._targetGeometry.color=s.toUnitRGBA();const e=(i?c:n).toUnitRGBA();this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const t=(i?u:a).toUnitRGBA();this._fillProjectionLines.color=t,this._occludedFillProjectionLines.color=t,this._cutFillVisualization.borderColor=s}}_updateLabels(e){const{effectiveDisplayUnits:t,depthExtremaPositions:s,messages:o,unitsMessages:l,result:r,visible:n}=e;if(this._cutVolumeLabel.visible=n,this._fillVolumeLabel.visible=n,this._cutVolumeLabel.geometry=s?{type:"point",point:s.cut}:null,this._fillVolumeLabel.geometry=s?{type:"point",point:s.fill}:null,null==r||null==o||null==l)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=t.volume,c=i(o.labels.cut,{volume:I(l,r.cutVolume,a)}),u=i(o.labels.fill,{volume:I(l,r.fillVolume,a)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=u}_updateCutFillVisibility(e){e?this._cutFillVisualization.enable():this._cutFillVisualization.disable()}get _polygonRenderInfo(){const{renderCoordsHelper:e,elevationProvider:t}=this.view,{targetGeometry:i}=this.analysisViewData;if(null==i)return null;const s=E(i,t,e,this._elevationContext,{outlineOutput:"tessellated-indices"});return c(s)?(this._updatingHandles.consumePromise(s),null):s}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData,{cut:i,fill:s}=this._extrusionHeights;if(!t?.extent)return;const{center:o}=t.extent,l=V(o.x,o.y,0),r=C();e.toRenderCoords(l,t.spatialReference,r);const n=this._getExtrudedVolume(i,l,r),a=this._getExtrudedVolume(s,l,r);null!=n&&null!=a&&this._cutFillVisualization.updateGeometries(n,a,r)}_getExtrudedVolume(e,t,i){const{renderCoordsHelper:s,spatialReference:o}=this.view,l=C(),r=1===s.viewingMode;s.worldUpAtPosition(i,l);const{_polygonRenderInfo:n}=this;if(null==n)return null;const a=U(n,{height:e,worldUp:l,spherical:r,requireElevation:!1,requireNormals:!0,requireSizes:!1});if(null==a)return null;const c=_(),u=_();if(G(o,t,c,s.spatialReference),u[12]=-c[12],u[13]=-c[13],u[14]=-c[14],F(a.vertices,a.vertices,u),"stockpile"===this.analysis.measureType)for(let m=0;m<a.normals.length;m+=3)a.normals[m]=l[0],a.normals[m+1]=l[1],a.normals[m+2]=l[2];return new z(a.vertices,a.bottomIndices,a.indices,a.normals)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await s("esri/core/t9n/Units"),this.messages=await s("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,i){if(!t||!e)return null;const s=p(t.value,t.unit,i),o=u(s);return m(e,t,s,o)}e([g({constructOnly:!0})],B.prototype,"view",void 0),e([g({constructOnly:!0})],B.prototype,"analysis",void 0),e([g({constructOnly:!0})],B.prototype,"analysisViewData",void 0),e([g()],B.prototype,"unitsMessages",void 0),e([g()],B.prototype,"messages",void 0),e([g()],B.prototype,"loadingMessages",void 0),e([g({readOnly:!0})],B.prototype,"_updatingHandles",void 0),e([g({readOnly:!0})],B.prototype,"visible",null),e([g()],B.prototype,"updating",null),e([g()],B.prototype,"hasUnsupportedError",null),e([g()],B.prototype,"_extrusionHeights",null),e([g()],B.prototype,"_polygonRenderInfo",null),B=e([y("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],B);class T{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=C(),this._n2=C();const o=v(q,j(q,e.endRenderSpace,e.startRenderSpace));v(this._n1,L(this._n1,o,v(k,j(k,t.startRenderSpace,e.startRenderSpace)))),v(this._n2,L(this._n2,o,v(k,j(k,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=n.normalize(P(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){j(q,this.segment.startRenderSpace,e.eye);const t=b(this._n1,q)<0,i=b(this._n2,q)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const q=C(),k=C();export{B as VolumeMeasurementCutFillVisualization};
2
+ import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../../../intl.js";import{volumeMeasurementConfiguration as o}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import l from"../../../../core/Accessor.js";import{equals as n}from"../../../../core/arrayUtils.js";import{cyclicalPI as r}from"../../../../core/Cyclical.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{isPromiseLike as c}from"../../../../core/promiseUtils.js";import{preferredVolumePrecision as u,formatDecimal as m}from"../../../../core/quantityFormatUtils.js";import{watch as d,initial as h}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as p}from"../../../../core/units.js";import{property as g,subclass as y}from"../../../../core/accessorSupport/decorators.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f,normalize as v,subtract as j,cross as V,dot as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as L,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as C}from"../../../../core/support/UpdatingHandles.js";import{computeTranslationToOriginAndRotation as G}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{angleAroundAxis as P}from"../../../../geometry/support/vector.js";import{a as F}from"../../../../chunks/vec3.js";import x from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as O}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as R}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as D}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as M}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as A}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as U}from"../../layers/graphics/extrudeUtils.js";import{polygonToRenderInfoElevationAligned as E}from"../../support/renderInfoUtils/polygon.js";import{CutFillVisualization as S,VolumeGeometry as z}from"../../webgl-engine/lib/CutFillVisualization.js";import{createStipplePatternSimple as H}from"../../webgl-engine/materials/lineStippleUtils.js";let B=class extends l{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get inView(){return this.analysisViewData.analysisObb?.intersectsFrustum(this.view.frustum)??!1}get updating(){return this.loadingMessages||this._updatingHandles.updating}get hasUnsupportedError(){const{error:e}=this.analysisViewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}get _extrusionHeights(){const{renderCoordsHelper:e}=this.view,{depthExtremaPositions:t,targetGeometry:i}=this.analysisViewData,{targetElevationRange:s}=o;if(!i||!t)return{cut:s,fill:-s};let l=-1/0;for(const o of i.rings)for(const e of o)l=Math.max(l,e[2]);const n=1,r=e.getAltitude(t.fill);return{cut:s,fill:Math.min(r-l,0)-n}}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._updatingHandles=new C,this._elevationContext=A.fromElevationInfo(new x({mode:"absolute-height"})),this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=o,l={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new D({...l,isDraped:!0,color:s.geometryOutlineColor.toUnitRGBA()}),this._targetGeometry=new D(l);const n={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:3},r={...n,stipplePattern:H(s.projectionLineStippleSize)},a=s.cutProjectionLineColor.toUnitRGBA(),c=s.fillProjectionLineColor.toUnitRGBA();this._cutProjectionLines=new R({...n,color:a}),this._occludedCutProjectionLines=new R({...r,color:a}),this._fillProjectionLines=new R({...n,color:c,renderOccluded:8}),this._occludedFillProjectionLines=new R({...r,color:c});const u={...i,attached:!0};this._cutVolumeLabel=new O({...u,distance:s.labelDistance}),this._fillVolumeLabel=new O({...u,distance:-s.labelDistance}),this._cutFillVisualization=new S({view:e,cutColor:s.cutColor,fillColor:s.fillColor,borderColor:s.geometryOutlineColor}),this.addHandles([d(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},h),d(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i,this._cutFillVisualization.measureType=i},h),d(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i),h),d(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.analysisViewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},h),d(()=>[this.analysisViewData.targetGeometry,this.inView,this._extrusionHeights,this._polygonRenderInfo],()=>this._updateCutFillGeometry(),h),d(()=>this.visible&&this.inView&&this.view.state.camera.aboveGround&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),h),d(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{depthExtremaPositions:s.depthExtremaPositions,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),d(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),h),t(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=a(this._elevationAlignedGeometry),this._targetGeometry=a(this._targetGeometry),this._cutProjectionLines=a(this._cutProjectionLines),this._occludedCutProjectionLines=a(this._occludedCutProjectionLines),this._fillProjectionLines=a(this._fillProjectionLines),this._occludedFillProjectionLines=a(this._occludedFillProjectionLines),this._cutVolumeLabel=a(this._cutVolumeLabel),this._fillVolumeLabel=a(this._fillVolumeLabel),this._cutFillVisualization.destroy(),this._updatingHandles.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,o=[],l=[],r=[],a=[],c=[],u=e.spatialReference;for(let m=0;m<e.rings.length;m++){const i=e.rings[m],d=i.length>1&&n(i[0],i[i.length-1]),h=i.length-(d?1:0),p=[];for(let e=0;e<h;++e){const o=i[e],l=f(L(),o[0],o[1],o[2]);s.toRenderCoords(l,u,l);const n=t.rings[m][e],r=f(L(),n[0],n[1],n[2]);s.toRenderCoords(r,u,r);const a=new M(l,r);p.push(a)}const g=this.view.state.camera;for(let e=0;e<p.length;++e){const s=p[e],n=p[0===e?p.length-1:e-1],u=p[e===p.length-1?0:e+1],d=i[e],h=t.rings[m][e],y=d[2]>h[2],_=new T(s,n,u,y);o.push(_),_.updateOccluded(g);const f=_.isOccluded;y?(f?r:l).push(s):(f?c:a).push(s)}}this._projectionLines=o,this._cutProjectionLines.setGeometryFromSegments(l),this._occludedCutProjectionLines.setGeometryFromSegments(r),this._fillProjectionLines.setGeometryFromSegments(a),this._occludedFillProjectionLines.setGeometryFromSegments(c)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let l=!1,n=!1;for(const r of this._projectionLines){r.updateOccluded(e)&&(l||=r.isCut,n||=!r.isCut);const a=r.isOccluded;(r.isCut?a?i:t:a?o:s).push(r.segment)}n&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),l&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,t,i){const{geometryOutlineColor:s,cutColor:l,fillColor:n,cutColorMuted:r,fillColorMuted:a,cutProjectionLineColor:c,fillProjectionLineColor:u}=o;if(this._cutFillVisualization.cutColor=i?l:r,this._cutFillVisualization.fillColor=i?n:a,e){const e=t.toUnitRGBA();this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillVisualization.borderColor=t}else{this._targetGeometry.color=s.toUnitRGBA();const e=(i?c:r).toUnitRGBA();this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const t=(i?u:a).toUnitRGBA();this._fillProjectionLines.color=t,this._occludedFillProjectionLines.color=t,this._cutFillVisualization.borderColor=s}}_updateLabels(e){const{effectiveDisplayUnits:t,depthExtremaPositions:s,messages:o,unitsMessages:l,result:n,visible:r}=e;if(this._cutVolumeLabel.visible=r,this._fillVolumeLabel.visible=r,this._cutVolumeLabel.geometry=s?{type:"point",point:s.cut}:null,this._fillVolumeLabel.geometry=s?{type:"point",point:s.fill}:null,null==n||null==o||null==l)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=t.volume,c=i(o.labels.cut,{volume:I(l,n.cutVolume,a)}),u=i(o.labels.fill,{volume:I(l,n.fillVolume,a)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=u}_updateCutFillVisibility(e){e?this._cutFillVisualization.enable():this._cutFillVisualization.disable()}get _polygonRenderInfo(){const{renderCoordsHelper:e,elevationProvider:t}=this.view,{targetGeometry:i}=this.analysisViewData;if(null==i)return null;const s=E(i,t,e,this._elevationContext,{outlineOutput:"tessellated-indices"});return c(s)?(this._updatingHandles.consumePromise(s),null):s}_updateCutFillGeometry(){const{view:e,analysisViewData:t,inView:i}=this,{renderCoordsHelper:s}=e,{targetGeometry:o}=t,{cut:l,fill:n}=this._extrusionHeights;if(!o?.extent||!i)return;const{center:r}=o.extent,a=w(r.x,r.y,0),c=L();s.toRenderCoords(a,o.spatialReference,c);const u=this._getExtrudedVolume(l,a,c),m=this._getExtrudedVolume(n,a,c);null!=u&&null!=m&&this._cutFillVisualization.updateGeometries(u,m,c)}_getExtrudedVolume(e,t,i){const{renderCoordsHelper:s,spatialReference:o}=this.view,l=L(),n=1===s.viewingMode;s.worldUpAtPosition(i,l);const{_polygonRenderInfo:r}=this;if(null==r)return null;const a=U(r,{height:e,worldUp:l,spherical:n,requireElevation:!1,requireNormals:!0,requireSizes:!1});if(null==a)return null;const c=_(),u=_();if(G(o,t,c,s.spatialReference),u[12]=-c[12],u[13]=-c[13],u[14]=-c[14],F(a.vertices,a.vertices,u),"stockpile"===this.analysis.measureType)for(let m=0;m<a.normals.length;m+=3)a.normals[m]=l[0],a.normals[m+1]=l[1],a.normals[m+2]=l[2];return new z(a.vertices,a.bottomIndices,a.indices,a.normals)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await s("esri/core/t9n/Units"),this.messages=await s("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,i){if(!t||!e)return null;const s=p(t.value,t.unit,i),o=u(s);return m(e,t,s,o)}e([g({constructOnly:!0})],B.prototype,"view",void 0),e([g({constructOnly:!0})],B.prototype,"analysis",void 0),e([g({constructOnly:!0})],B.prototype,"analysisViewData",void 0),e([g()],B.prototype,"unitsMessages",void 0),e([g()],B.prototype,"messages",void 0),e([g()],B.prototype,"loadingMessages",void 0),e([g({readOnly:!0})],B.prototype,"_updatingHandles",void 0),e([g({readOnly:!0})],B.prototype,"visible",null),e([g()],B.prototype,"inView",null),e([g()],B.prototype,"updating",null),e([g()],B.prototype,"hasUnsupportedError",null),e([g()],B.prototype,"_extrusionHeights",null),e([g()],B.prototype,"_polygonRenderInfo",null),B=e([y("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],B);class T{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=L(),this._n2=L();const o=v(q,j(q,e.endRenderSpace,e.startRenderSpace));v(this._n1,V(this._n1,o,v(k,j(k,t.startRenderSpace,e.startRenderSpace)))),v(this._n2,V(this._n2,o,v(k,j(k,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=r.normalize(P(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){j(q,this.segment.startRenderSpace,e.eye);const t=b(this._n1,q)<0,i=b(this._n2,q)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const q=L(),k=L();export{B as VolumeMeasurementCutFillVisualization};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{verticalLengthUnitFromSpatialReference as i,convertUnit as s}from"../../../core/units.js";import{property as l,subclass as r}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as n}from"../../../support/getDefaultUnitForView.js";import o from"./AnalysisView3D.js";import{VolumeMeasurementCutFillController as a}from"./VolumeMeasurement/VolumeMeasurementCutFillController.js";import{VolumeMeasurementCutFillVisualization as u}from"./VolumeMeasurement/VolumeMeasurementCutFillVisualization.js";import y from"./VolumeMeasurement/VolumeMeasurementTool.js";let p=class extends o{constructor(e){super(e),this.type="volume-measurement-view-3d",this.analysis=null}initialize(){const{analysis:e,view:t}=this;this._analysisController=new a({view:t,analysis:e,analysisViewData:this}),this._analysisTool=new y({analysis:e,view:t,analysisViewData:this}),this._analysisVisualization=new u({view:t,analysis:e,analysisViewData:this})}destroy(){this._analysisController=t(this._analysisController),this._analysisVisualization=t(this._analysisVisualization),this._analysisTool.destroy()}get error(){return this._analysisController?.error??null}get result(){return this._analysisController?.result}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get visible(){return super.visible}set visible(e){super.visible=e}get elevationAlignedGeometry(){return this._analysisController?.elevationAlignedGeometry}get effectiveTargetElevation(){const{cutFillOptions:e,inputUnits:t}=this.analysis,{targetElevation:l}=e,r=t?.elevation??"meters",n=i(this.view.spatialReference);if(null!=l&&null!=n)return s(l,r,n);const o=this.elevationAlignedGeometry?.extent;return null==o?.zmin||null==o?.zmax?null:(o.zmax+o.zmin)/2}get targetGeometry(){return this._analysisController?.targetGeometry}get effectiveDisplayUnits(){const{displayUnits:e}=this.analysis,t=n(this.view);return{elevation:e.elevation??t,volume:e.volume??t,area:e.area??t,length:e.length??t}}get depthExtremaPositions(){return this._analysisController?.depthExtremaPositions}get updating(){return this._analysisController?.updating||this._analysisTool?.updating||this._analysisVisualization?.updating}place(e){return this._analysisTool.place(e)}get test(){}};e([l()],p.prototype,"error",null),e([l({readOnly:!0})],p.prototype,"type",void 0),e([l({constructOnly:!0,nonNullable:!0})],p.prototype,"analysis",void 0),e([l({readOnly:!0})],p.prototype,"result",null),e([l()],p.prototype,"elevationAlignedGeometry",null),e([l({type:Number})],p.prototype,"effectiveTargetElevation",null),e([l()],p.prototype,"targetGeometry",null),e([l()],p.prototype,"effectiveDisplayUnits",null),e([l()],p.prototype,"depthExtremaPositions",null),e([l()],p.prototype,"updating",null),e([l()],p.prototype,"_analysisController",void 0),p=e([r("esri.views.3d.analysis.VolumeMeasurementAnalysisView3D")],p);const m=p;export{m as default};
2
+ import{__decorate as e}from"tslib";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{verticalLengthUnitFromSpatialReference as i,convertUnit as s}from"../../../core/units.js";import{property as l,subclass as r}from"../../../core/accessorSupport/decorators.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import n from"./AnalysisView3D.js";import{VolumeMeasurementCutFillController as o}from"./VolumeMeasurement/VolumeMeasurementCutFillController.js";import{VolumeMeasurementCutFillVisualization as u}from"./VolumeMeasurement/VolumeMeasurementCutFillVisualization.js";import y from"./VolumeMeasurement/VolumeMeasurementTool.js";let p=class extends n{constructor(e){super(e),this.type="volume-measurement-view-3d",this.analysis=null}initialize(){const{analysis:e,view:t}=this;this._analysisController=new o({view:t,analysis:e,analysisViewData:this}),this._analysisTool=new y({analysis:e,view:t,analysisViewData:this}),this._analysisVisualization=new u({view:t,analysis:e,analysisViewData:this})}destroy(){this._analysisController=t(this._analysisController),this._analysisVisualization=t(this._analysisVisualization),this._analysisTool.destroy()}get error(){return this._analysisController?.error??null}get result(){return this._analysisController?.result}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get visible(){return super.visible}set visible(e){super.visible=e}get elevationAlignedGeometry(){return this._analysisController?.elevationAlignedGeometry}get effectiveTargetElevation(){const{cutFillOptions:e,inputUnits:t}=this.analysis,{targetElevation:l}=e,r=t?.elevation??"meters",a=i(this.view.spatialReference);if(null!=l&&null!=a)return s(l,r,a);const n=this.elevationAlignedGeometry?.extent;return null==n?.zmin||null==n?.zmax?null:(n.zmax+n.zmin)/2}get targetGeometry(){return this._analysisController?.targetGeometry}get effectiveDisplayUnits(){const{displayUnits:e}=this.analysis,t=a(this.view);return{elevation:e.elevation??t,volume:e.volume??t,area:e.area??t,length:e.length??t}}get depthExtremaPositions(){return this._analysisController?.depthExtremaPositions}get analysisObb(){return this._analysisController?.analysisObb}get updating(){return this._analysisController?.updating||this._analysisTool?.updating||this._analysisVisualization?.updating}place(e){return this._analysisTool.place(e)}get test(){}};e([l()],p.prototype,"error",null),e([l({readOnly:!0})],p.prototype,"type",void 0),e([l({constructOnly:!0,nonNullable:!0})],p.prototype,"analysis",void 0),e([l({readOnly:!0})],p.prototype,"result",null),e([l()],p.prototype,"elevationAlignedGeometry",null),e([l({type:Number})],p.prototype,"effectiveTargetElevation",null),e([l()],p.prototype,"targetGeometry",null),e([l()],p.prototype,"effectiveDisplayUnits",null),e([l()],p.prototype,"depthExtremaPositions",null),e([l()],p.prototype,"analysisObb",null),e([l()],p.prototype,"updating",null),e([l()],p.prototype,"_analysisController",void 0),p=e([r("esri.views.3d.analysis.VolumeMeasurementAnalysisView3D")],p);const m=p;export{m as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import r from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as e}from"../../../core/maybe.js";import{watch as o,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as g}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as c}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as u}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as l}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as h}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as w}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as f}from"../../input/BrowserEventSource.js";import{InputManager as v,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{Drag as P}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as j}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as A}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as M}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as b}from"../../input/recognizers/VerticalTwoFingerDrag.js";let T=class extends r{constructor(){super(...arguments),this.mode="default",this._updateMode=({mode:t,dragPrimary:r,dragSecondary:e,dragTertiary:o})=>{"pro"===t&&(e="zoom",o="pan"===r?"rotate":"pan");const i={dragPrimary:r,dragSecondary:e,dragTertiary:o};this._modeDragPan&&(this._modeDragPan.pointerActions=D("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=D("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=D("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(t){const{actionMap:r}=this.view.navigation;r.dragPrimary=t,r.dragSecondary="pan"===t?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=e(this._inputManager),this._source=e(this._source)}connect(){const t=this.view;this._source=new f(this.view.surface,t.input);const r=[new j,new A,new M,new P(this.view.navigation),new b],e=new v({eventSource:this._source,recognizers:r});this._inputManager=e,e.installHandlers("prevent-context-menu",[new _],y.INTERNAL);const a={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"]},modifier:["b","B"],zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new l(t,["primary"]),this._modeDragRotate=new m(t,["secondary"],0),this._modeDragZoom=new p(t,["tertiary"],a.fov),this._modeKeyboardNavigation=new c(t,a),e.installHandlers("navigation",[new h(t),new d(t),new g(t),new u(t,a.fov),new m(t,["primary"],1,a.modifier),new l(t,["secondary"],a.modifier,!0),new l(t,["tertiary"],a.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new w(t)],y.INTERNAL),this.view.viewEvents.connect(e),this.addHandles([o(()=>this.view.navigation?.browserTouchPanEnabled,t=>{this._source.browserTouchPanningEnabled=!t},i),o(()=>{const{actionMap:t}=this.view.navigation,{dragPrimary:r,dragSecondary:e,dragTertiary:o}=t;return{mode:this.mode,dragPrimary:r,dragSecondary:e,dragTertiary:o}},this._updateMode,n)])}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}get test(){}};t([a()],T.prototype,"view",void 0),t([a({type:["default","pro"]})],T.prototype,"mode",void 0),t([a({readOnly:!0})],T.prototype,"updating",null),t([a()],T.prototype,"latestPointerInfo",null),t([a()],T.prototype,"latestPenInfo",null),t([a()],T.prototype,"multiTouchActive",null),t([a()],T.prototype,"_inputManager",void 0),T=t([s("esri.views.3d.input.SceneInputManager")],T);const I=T;export{I as default};
2
+ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{watch as o,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as g}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as c}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as l}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as u}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as h}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as w}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as f}from"../../input/BrowserEventSource.js";import{InputManager as v,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as D}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as P}from"../../input/handlers/support.js";import{Drag as j}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as A}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as M}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as T}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as b}from"../../input/recognizers/VerticalTwoFingerDrag.js";let I=class extends e{constructor(){super(...arguments),this.mode="default",this._updateMode=({mode:t,dragPrimary:e,dragSecondary:r,dragTertiary:o})=>{"pro"===t&&(r="zoom",o="pan"===e?"rotate":"pan");const i={dragPrimary:e,dragSecondary:r,dragTertiary:o};this._modeDragPan&&(this._modeDragPan.pointerActions=P("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=P("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=P("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(t){const{actionMap:e}=this.view.navigation;e.dragPrimary=t,e.dragSecondary="pan"===t?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=r(this._inputManager),this._source=r(this._source)}connect(){const t=this.view;this._source=new f(this.view.surface,t.input);const e=[new A,new M,new T,new j(this.view.navigation),new b],r=new v({eventSource:this._source,recognizers:e});this._inputManager=r,r.installHandlers("prevent-context-menu",[new _],y.INTERNAL),r.installHandlers("prevent-touch-text-selection-gesture",[new D(this.view)],y.INTERNAL);const a={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"]},modifier:["b","B"],zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new u(t,["primary"]),this._modeDragRotate=new m(t,["secondary"],0),this._modeDragZoom=new p(t,["tertiary"],a.fov),this._modeKeyboardNavigation=new c(t,a),r.installHandlers("navigation",[new h(t),new d(t),new g(t),new l(t,a.fov),new m(t,["primary"],1,a.modifier),new u(t,["secondary"],a.modifier,!0),new u(t,["tertiary"],a.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new w(t)],y.INTERNAL),this.view.viewEvents.connect(r),this.addHandles([o(()=>this.view.navigation?.browserTouchPanEnabled,t=>{this._source.browserTouchPanningEnabled=!t},i),o(()=>{const{actionMap:t}=this.view.navigation,{dragPrimary:e,dragSecondary:r,dragTertiary:o}=t;return{mode:this.mode,dragPrimary:e,dragSecondary:r,dragTertiary:o}},this._updateMode,n)])}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}get test(){}};t([a()],I.prototype,"view",void 0),t([a({type:["default","pro"]})],I.prototype,"mode",void 0),t([a({readOnly:!0})],I.prototype,"updating",null),t([a()],I.prototype,"latestPointerInfo",null),t([a()],I.prototype,"latestPenInfo",null),t([a()],I.prototype,"multiTouchActive",null),t([a()],I.prototype,"_inputManager",void 0),I=t([s("esri.views.3d.input.SceneInputManager")],I);const N=I;export{N as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{multiplyOpacity as e,getContrast as t}from"../../../../core/colorUtils.js";import{releaseMaybe as r}from"../../../../core/maybe.js";import{watch as i,initial as o}from"../../../../core/reactiveUtils.js";import{DidPointerMoveRecentlyFlag as s}from"../../analysis/Slice/sliceToolUtils.js";import{Manipulator3D as a}from"../Manipulator3D.js";import{rotateManipulatorDefaults as l}from"../manipulatorUtils.js";import{RenderObject as n}from"../RenderObject.js";import{Attribute as c}from"../../webgl-engine/lib/Attribute.js";import{Geometry as m}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as u}from"../../webgl-engine/lib/GeometryUtil.js";import{Parameters as d,ImageMaterial as f}from"../../webgl-engine/materials/ImageMaterial.js";import{RibbonLineMaterial as p}from"../../webgl-engine/materials/RibbonLineMaterial.js";class w extends a{constructor(r,s){const a=e(r.effectiveTheme.accentColor,.5),n=t(r.effectiveTheme.accentColor),c=s(a,n),m=new d(c.managedTexture,!1);m.writeDepth=!1,m.renderOccluded=16,m.isDecoration=!0;const u=new f(m),w=l.calloutWidth,h=new p({width:w,renderOccluded:4,isDecoration:!0},r.state.isGlobal);super({view:r,...g({imageMaterial:u,calloutMaterial:h})}),this._textureHandle=c,this._themeHandle=i(()=>r.effectiveTheme.accentColor,r=>{const i=e(r,.5),o=t(r),a=this._textureHandle;this._textureHandle=s(i,o),u.setParameters({managedTexture:this._textureHandle.managedTexture}),a?.release(),h.setParameters({color:r.toUnitRGBA()})},o)}destroy(){this._textureHandle=r(this._textureHandle),this._themeHandle.remove(),super.destroy()}}function g({imageMaterial:e,calloutMaterial:t}){const{focusMultiplier:r,calloutLength:i,discRadius:o}=l,a=o*r,d=(e,t)=>{const r=[0,1,2,2,3,0];return new m(t,[["position",new c([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],r,3,!0)],["uv0",new c([0,0,1,0,1,1,0,1],r,2,!0)]])},f=u(t,[[0,0,0],[i-o,0,0]]),p=u(t,[[0,0,0],[i-a,0,0]]),w=s;return{autoScaleRenderObjects:!1,collisionPriority:1,collisionType:{type:"disc",direction:[0,0,1],offset:[i,0,0]},focusMultiplier:r,radius:o,renderObjects:[new n(d(o,e),1|w),new n(f,1|w),new n(d(a,e),2|w),new n(p,2|w)],state:w}}export{w as RotateManipulator};
2
+ import{multiplyOpacity as e,getContrast as t}from"../../../../core/colorUtils.js";import{releaseMaybe as r}from"../../../../core/maybe.js";import{watch as i,initial as o}from"../../../../core/reactiveUtils.js";import{DidPointerMoveRecentlyFlag as s}from"../../analysis/Slice/sliceToolUtils.js";import{Manipulator3D as a}from"../Manipulator3D.js";import{rotateManipulatorDefaults as l}from"../manipulatorUtils.js";import{RenderObject as n}from"../RenderObject.js";import{Attribute as c}from"../../webgl-engine/lib/Attribute.js";import{Geometry as m}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as u}from"../../webgl-engine/lib/GeometryUtil.js";import{Parameters as d,ImageMaterial as f}from"../../webgl-engine/materials/ImageMaterial.js";import{RibbonLineMaterial as p}from"../../webgl-engine/materials/RibbonLineMaterial.js";class g extends a{constructor(r,s){const a=e(r.effectiveTheme.accentColor,.5),n=t(r.effectiveTheme.accentColor),c=s(a,n),m=new d(c.managedTexture,!1);m.renderOccluded=16,m.isDecoration=!0;const u=new f(m),g=l.calloutWidth,b=new p({width:g,renderOccluded:4,isDecoration:!0},r.state.isGlobal);super({view:r,...w({imageMaterial:u,calloutMaterial:b})}),this._textureHandle=c,this._themeHandle=i(()=>r.effectiveTheme.accentColor,r=>{const i=e(r,.5),o=t(r),a=this._textureHandle;this._textureHandle=s(i,o),u.setParameters({managedTexture:this._textureHandle.managedTexture}),a?.release(),b.setParameters({color:r.toUnitRGBA()})},o)}destroy(){this._textureHandle=r(this._textureHandle),this._themeHandle.remove(),super.destroy()}}function w({imageMaterial:e,calloutMaterial:t}){const{focusMultiplier:r,calloutLength:i,discRadius:o}=l,a=o*r,d=(e,t)=>{const r=[0,1,2,2,3,0];return new m(t,[["position",new c([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],r,3,!0)],["uv0",new c([0,0,1,0,1,1,0,1],r,2,!0)]])},f=u(t,[[0,0,0],[i-o,0,0]]),p=u(t,[[0,0,0],[i-a,0,0]]),g=s;return{autoScaleRenderObjects:!1,collisionPriority:1,collisionType:{type:"disc",direction:[0,0,1],offset:[i,0,0]},focusMultiplier:r,radius:o,renderObjects:[new n(d(o,e),1|g),new n(f,1|g),new n(d(a,e),2|g),new n(p,2|g)],state:g}}export{g as RotateManipulator};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{getTranslation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{copy as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{subtract as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as o,copy as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import{Attribute as n}from"../../webgl-engine/lib/Attribute.js";import{Geometry as d}from"../../webgl-engine/lib/Geometry.js";import{CheckerBoardMaterial as h}from"../../webgl-engine/materials/CheckerBoardMaterial.js";class m extends l{constructor(e){super(e),this._checkerBoardMaterial=null,this._renderOccluded=4,this._transparentRenderOrder=0,this._geometry=null,this._size=t(1,1),this._color1=c(1,.5,0,.5),this._color2=c(1,1,1,.5),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get testsTransparentRenderOrder(){return this._transparentRenderOrder}set testsTransparentRenderOrder(e){e!==this._transparentRenderOrder&&(this._transparentRenderOrder=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){r(this._size,e),this._updateMaterial()}get color1(){return this._color1}set color1(e){o(e,this._color1)||(a(this._color1,e),this._updateMaterial())}get color2(){return this._color2}set color2(e){o(e,this._color2)||(a(this._color2,e),this._updateMaterial())}_updateMaterial(){this._checkerBoardMaterial?.setParameters({size:this._size,color1:this._color1,color2:this._color2,renderOccluded:this._renderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder})}createExternalResources(){this._checkerBoardMaterial=new h({size:this._size,color1:this._color1,color2:this._color2,writeDepth:!1,renderOccluded:this._renderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder,isDecoration:this.isDecoration})}destroyExternalResources(){this._checkerBoardMaterial=null}forEachMaterial(e){e(this._checkerBoardMaterial)}createGeometries(r){if(null==this._geometry||null==this._checkerBoardMaterial)return;const t=_;e(t,this.transform);const o=this._geometry,a=[],c=i();o.position.forEach(e=>{s(c,e,t),a.push(c[0],c[1],c[2])});const l=[];o.uv.forEach(e=>{l.push(e[0],e[1])});const h=new d(this._checkerBoardMaterial,[["position",new n(a,o.triangleIndices,3,!0)],["uv0",new n(l,o.triangleIndices,2,!0)]]);r.addGeometry(h)}}const _=i();export{m as MeasurementAreaVisualElement};
2
+ import{getTranslation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{copy as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{subtract as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{exactEquals as o,copy as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import{Attribute as n}from"../../webgl-engine/lib/Attribute.js";import{Geometry as d}from"../../webgl-engine/lib/Geometry.js";import{CheckerBoardMaterial as h}from"../../webgl-engine/materials/CheckerBoardMaterial.js";class m extends l{constructor(e){super(e),this._checkerBoardMaterial=null,this._renderOccluded=4,this._transparentRenderOrder=0,this._geometry=null,this._size=t(1,1),this._color1=c(1,.5,0,.5),this._color2=c(1,1,1,.5),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get testsTransparentRenderOrder(){return this._transparentRenderOrder}set testsTransparentRenderOrder(e){e!==this._transparentRenderOrder&&(this._transparentRenderOrder=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){r(this._size,e),this._updateMaterial()}get color1(){return this._color1}set color1(e){o(e,this._color1)||(a(this._color1,e),this._updateMaterial())}get color2(){return this._color2}set color2(e){o(e,this._color2)||(a(this._color2,e),this._updateMaterial())}_updateMaterial(){this._checkerBoardMaterial?.setParameters({size:this._size,color1:this._color1,color2:this._color2,renderOccluded:this._renderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder})}createExternalResources(){this._checkerBoardMaterial=new h({size:this._size,color1:this._color1,color2:this._color2,renderOccluded:this._renderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder,isDecoration:this.isDecoration})}destroyExternalResources(){this._checkerBoardMaterial=null}forEachMaterial(e){e(this._checkerBoardMaterial)}createGeometries(r){if(null==this._geometry||null==this._checkerBoardMaterial)return;const t=_;e(t,this.transform);const o=this._geometry,a=[],c=i();o.position.forEach(e=>{s(c,e,t),a.push(c[0],c[1],c[2])});const l=[];o.uv.forEach(e=>{l.push(e[0],e[1])});const h=new d(this._checkerBoardMaterial,[["position",new n(a,o.triangleIndices,3,!0)],["uv0",new n(l,o.triangleIndices,2,!0)]]);r.addGeometry(h)}}const _=i();export{m as MeasurementAreaVisualElement};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clone as e}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as t}from"../../../../core/units.js";import{normalFromMat4 as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as s,invertOrIdentity as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as a,sub as l,cross as c,add as m,normalize as p,transformMat4 as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as u,create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g,ZEROS as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as f}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as b,fromBuffer as x,intersectsClippingArea as _}from"../../../../geometry/support/aaBoundingBox.js";import{getZeroIndexArray as C}from"../../../../geometry/support/Indices.js";import{a as w}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as v,SnappingCandidateEdge as S}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as j}from"../../../../renderers/support/renderingInfoUtils.js";import{needsElevationUpdates3D as I,SampleElevationInfo as P}from"./elevationAlignmentUtils.js";import{extrudePolygon as E}from"./extrudeUtils.js";import{Object3DEdgeState as A,Graphics3DObject3DGraphicLayer as U}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as z}from"./Graphics3DSymbolLayer.js";import{computeCentroid as O}from"./graphicUtils.js";import{geometryAsPolygon as D}from"./polygonUtils.js";import{createMaterial as M}from"../support/edgeUtils.js";import{encodeNaNUInt8 as G}from"../support/symbolColorUtils.js";import{debugFlags as L}from"../../support/debugFlags.js";import{SamplePosition as V}from"../../support/ElevationProvider.js";import{loadTessellationUtils as R,preloadedPolygonToRenderInfoElevationAligned as B}from"../../support/renderInfoUtils/polygon.js";import{Attribute as F}from"../../webgl-engine/lib/Attribute.js";import{Geometry as T}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as N}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as H,compressNormal as q}from"../../webgl-engine/lib/Normals.js";import{Object3D as W}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as k}from"../../webgl-engine/materials/DefaultMaterial.js";const Z=["polygon","extent"];class J extends z{constructor(e,t,r,i){super(e,t,r,i,ee(t)),this.ensureDrapedStatus(!1)}async doLoad(){const e=this.symbolLayer,t=e?.material,r=this.symbolLayer.material?.color?.a,i=this._hasDrivenColorOrOpacity,s=this.needsDrivenTransparentPass||i&&null!=r&&r<1,n=t?.emissive,o=("color"===n?.source?n?.strength:void 0)??0,a=!i&&(null==r||0===r),l=i?g:this._materialColor?.toUnitRGBA()??y,c={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,useIndexing:!0,ambient:u,diffuse:u,externalColor:l,opacity:a?0:1,layerOpacity:this._getLayerOpacity(),drivenOpacity:s,hasSymbolColors:i,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:e.castShadows,emissiveStrengthFromSymbol:o,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},m=new k(c,this._context),p=new k({...c,cullFace:2},this._context);this._materials[0]=m,this._materials[1]=p,this._updateTransparentDepedentMaterialParameters(),await R()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Z,this.symbolLayer.type))return null;const r=this._getDrivenUInt8ColorWithNaNSupport(e.renderingInfo,this._materialColor,!1);G(r,r);const i=this.createElevationContextForGraphic(t);return this._createAs3DShape(t,e.renderingInfo,r,i,t.uid)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:r}),this._materials[1]?.setParameters({layerOpacity:r}),this._updateTransparentDepedentMaterialParameters(),e?.forEach(e=>t(e)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,I)}slicePlaneEnabledChanged(e,t){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e?.forEach(e=>{const r=t(e);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){const e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(e),this._materials[1]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?j(e.size.output,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}_containsRenderableGeometry(e){return"polygonIndexCount"in e&&"outlineIndexCount"in e?e.polygonIndexCount>0||e.outlineIndexCount>0:super._containsRenderableGeometry(e)}applyRendererDiff(e,t){return this._drivenPropertiesChanged(t)?0:1}async queryForSnapping(r,i,s,n){const o=this._getExtrusionSize(s)*this._context.renderCoordsHelper.unitInMeters/t(i),{objectId:a,target:l}=r,c=e(l);switch(c.z=(c.z??0)+o,r.type){case"edge":{const{start:t,end:i}=r,s=e(t),n=e(i);return s.z=(s.z??0)+o,n.z=(n.z??0)+o,[new S(a,c,1/0,s,n)]}case"vertex":return[new v(a,c,1/0),new S(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,t,n,a,l){const c=D(e.geometry);if(null==c)return null;if(0===c.rings.length||!c.rings.some(e=>e.length>0))return this._logGeometryValidationWarnings(c.rings,"rings","ExtrudeSymbol3DLayer"),null;const m=B(c,this._context.elevationProvider,this._context.renderCoordsHelper,a,{outlineOutput:"tessellated-indices",owner:this._context.layer});if(null==m)return;this._logGeometryCreationWarnings(m,c.rings,"rings","ExtrudeSymbol3DLayer");const p=O(c);if(null==p)return null;const h=new Array,u=new Array,g=b(),y=o(),C=d(),v=1===this._context.renderCoordsHelper.viewingMode;v||this._context.renderCoordsHelper.worldUpAtPosition(null,C),f(c.spatialReference,[p.x,p.y,0],y,this._context.renderCoordsHelper.spatialReference);const S=o();s(S,y);const j=i();r(j,S);const P=new Map,z=this._materials[0];if(this._context.clippingExtent&&(x(m.mapPositions,g),!_(g,this._context.clippingExtent)))return;if(0===m.polygonIndexCount&&0===m.outlineIndexCount)return;const G=this._getExtrusionSize(t),L=E(m,{height:G,worldUp:C,spherical:v,requireElevation:!0,requireNormals:!0,requireSizes:!0});if(null==L)return;w(L.vertices,L.vertices,S);const V=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:l,layerViewUid:this._context.layerViewUid}),R=new le(L.vertices,L.elevation,H(L.normals),L.sizes),F=K(z,L.indices,L.indices.length-L.bottomIndices.length,R,n,V),T=m.vertexCount,N=L.polygonVertexCount,q=2*m.outlineSegmentCount,k=m.polygonIndexCount/3,Z=new ce(T,N,q,k);if($(F,Z,y),P.set(F,Z),h.push(F),L.bottomIndices.length>0&&h.push(K(this._materials[1],L.bottomIndices,0,R,n,V)),u.push(R.heights),0===h.length)return null;const J=new W({geometries:h,layerViewUid:this._context.layerViewUid,graphicUid:l,isElevationSource:!0});J.transformation=y;const Q=M(this.symbolLayer,{opacity:this._getLayerOpacity()}),X=Q?new A(this._materials[0],Q,this._context.slicePlaneEnabled):null,ee=new U(this,J,null,(e,t,r,i,s)=>Y(e,t,r,i,s,u,P),a,X);return ee.alignedSampledElevation=m.sampledElevation,ee.needsElevationUpdates=I(a.mode),ee}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){const e=this._materials[0];e&&e.setParameters({cullFace:e.transparent?0:2})}}function K(e,t,r,i,s,n){const{attributeIndices:o,drawIndices:a}=Q(t),l=[["position",new F(i.positions,o,3,!0)],["normalCompressed",new F(i.normals,o,2,!0)]];if(e.parameters.hasSymbolColors){const e=C(o.length);l.push(["symbolColor",new F(s,e,4,!0)])}return new T(e,l,i.elevation,0,n,r,null,a)}function Q(e){const t=new Array,r=new Map,i=new Array;for(let s=0;s<e.length;++s){const n=e[s];let o=r.get(n);null==o&&(o=t.length,t.push(n),r.set(n,o)),i.push(o)}return{attributeIndices:t,drawIndices:i}}const X=d();function Y(e,t,r,i,s,l,c){const m=e.stageObject,p=m.geometries,u=p.length,d="absolute-height"!==t.mode;let g=0;const y=m.transformation,f=n(o(),y);for(let n=0,o=0;n<u;++n){const e=p[n],t=c.get(e);if(!t||!N(e))continue;const u=e.getMutableAttribute("position").data,b=l[o++],x=new V(e.mapPositions),_=u.length/3;let C=!1,w=0;{let e=0;for(let t=0;t<_;t++){X[0]=u[e],X[1]=u[e+1],X[2]=u[e+2],i(x,ie),d&&(w+=ie.sampledElevation),L.ENABLE_OPTIMIZATIONS?(a(te,u[e],u[e+1],u[e+2]),h(te,te,y),s.setAltitude(te,ie.z+b[e/3]),h(te,te,f)):(a(te,x.array[x.offset],x.array[x.offset+1],ie.z+b[e/3]),null!=r&&s.toRenderCoords(te,r,te),h(te,te,f)),u[e]=te[0],u[e+1]=te[1],u[e+2]=te[2];const t=se/s.unitInMeters;(Math.abs(X[0]-u[e])>=t||Math.abs(X[1]-u[e+1])>=t||Math.abs(X[2]-u[e+2])>=t)&&(C=!0),x.offset+=3,e+=3}}if(C){$(e,t,y),m.geometryVertexAttributeUpdated(p[n],"normalCompressed"),e.invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(p[n],"position");const r=p[n+1],i=!c.has(r);r&&i&&(r.invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(r,"position"))}g+=w/_}return g/u}function $(e,t,r){const i=e.getMutableAttribute("position"),s=e.getMutableAttribute("normalCompressed").data,n=i.data,o=e.primitivePositionIndices,{topVertexStart:u,topVertexCount:d,topFaceStart:g,topFaceCount:y}=t,f=g+y,b=u+d,x=ne,_=oe,C=ae,w=re,v=te;a(v,0,0,0);const S=(e,t)=>{const i=3*e;a(t,n[i+0],n[i+1],n[i+2]),h(t,t,r)};for(let a=g;a<f;++a){const e=3*a;S(o[e+0],x[0]),S(o[e+1],x[1]),S(o[e+2],x[2]),l(_,x[1],x[0]),l(C,x[2],x[0]),c(w,_,C),m(v,v,w)}p(v,v);for(let a=u;a<b;++a){const e=v[0],t=v[1],r=v[2];q(s,a,e,t,r)}}function ee(e){return 1===(e.material?.color?.a??0)}const te=d(),re=d(),ie=new P,se=.01,ne=[d(),d(),d()],oe=d(),ae=d();class le{constructor(e,t,r,i){this.positions=e,this.elevation=t,this.normals=r,this.heights=i}}class ce{constructor(e,t,r,i){this.topVertexStart=e,this.topVertexCount=t,this.topFaceStart=r,this.topFaceCount=i}}export{J as Graphics3DExtrudeSymbolLayer};
2
+ import{clone as e}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as t}from"../../../../core/units.js";import{normalFromMat4 as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as i,invertOrIdentity as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as a,sub as l,cross as c,add as m,normalize as p,transformMat4 as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as u,create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g,ZEROS as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as f}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as b,fromBuffer as x,intersectsClippingArea as _}from"../../../../geometry/support/aaBoundingBox.js";import{getZeroIndexArray as C}from"../../../../geometry/support/Indices.js";import{a as v}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as w,SnappingCandidateEdge as S}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as j}from"../../../../renderers/support/renderingInfoUtils.js";import{isDrivenOpacityFallbackAlwaysOpaque as I}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{needsElevationUpdates3D as P,SampleElevationInfo as E}from"./elevationAlignmentUtils.js";import{extrudePolygon as A}from"./extrudeUtils.js";import{Object3DEdgeState as U,Graphics3DObject3DGraphicLayer as z}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as O}from"./Graphics3DSymbolLayer.js";import{computeCentroid as D}from"./graphicUtils.js";import{geometryAsPolygon as M}from"./polygonUtils.js";import{createMaterial as G}from"../support/edgeUtils.js";import{encodeNaNUInt8 as L}from"../support/symbolColorUtils.js";import{debugFlags as V}from"../../support/debugFlags.js";import{SamplePosition as R}from"../../support/ElevationProvider.js";import{loadTessellationUtils as B,preloadedPolygonToRenderInfoElevationAligned as F}from"../../support/renderInfoUtils/polygon.js";import{Attribute as T}from"../../webgl-engine/lib/Attribute.js";import{Geometry as N}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as H}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as q,compressNormal as W}from"../../webgl-engine/lib/Normals.js";import{Object3D as k}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as Z}from"../../webgl-engine/materials/DefaultMaterial.js";const J=["polygon","extent"];class K extends O{constructor(e,t,r,s){super(e,t,r,s,I(t)),this.ensureDrapedStatus(!1)}async doLoad(){const e=this.symbolLayer,t=e?.material,r=this.symbolLayer.material?.color?.a,s=this._hasDrivenColorOrOpacity,i=this.needsDrivenTransparentPass||s&&null!=r&&r<1,o=t?.emissive,n=("color"===o?.source?o?.strength:void 0)??0,a=!s&&(null==r||0===r),l=s?g:this._materialColor?.toUnitRGBA()??y,c={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,useIndexing:!0,ambient:u,diffuse:u,externalColor:l,opacity:a?0:1,layerOpacity:this._getLayerOpacity(),drivenOpacity:i,hasSymbolColors:s,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:e.castShadows,emissiveStrengthFromSymbol:n,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},m=new Z(c,this._context),p=new Z({...c,cullFace:2},this._context);this._materials[0]=m,this._materials[1]=p,this._updateTransparentDepedentMaterialParameters(),await B()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,J,this.symbolLayer.type))return null;const r=this._getDrivenUInt8ColorWithNaNSupport(e.renderingInfo,this._materialColor,!1);L(r,r);const s=this.createElevationContextForGraphic(t);return this._createAs3DShape(t,e.renderingInfo,r,s,t.uid)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:r}),this._materials[1]?.setParameters({layerOpacity:r}),this._updateTransparentDepedentMaterialParameters(),e?.forEach(e=>t(e)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,P)}slicePlaneEnabledChanged(e,t){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e?.forEach(e=>{const r=t(e);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){const e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(e),this._materials[1]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?j(e.size.output,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}_containsRenderableGeometry(e){return"polygonIndexCount"in e&&"outlineIndexCount"in e?e.polygonIndexCount>0||e.outlineIndexCount>0:super._containsRenderableGeometry(e)}applyRendererDiff(e,t){return this._drivenPropertiesChanged(t)?0:1}async queryForSnapping(r,s,i,o){const n=this._getExtrusionSize(i)*this._context.renderCoordsHelper.unitInMeters/t(s),{objectId:a,target:l}=r,c=e(l);switch(c.z=(c.z??0)+n,r.type){case"edge":{const{start:t,end:s}=r,i=e(t),o=e(s);return i.z=(i.z??0)+n,o.z=(o.z??0)+n,[new S(a,c,1/0,i,o)]}case"vertex":return[new w(a,c,1/0),new S(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,t,o,a,l){const c=M(e.geometry);if(null==c)return null;if(0===c.rings.length||!c.rings.some(e=>e.length>0))return this._logGeometryValidationWarnings(c.rings,"rings","ExtrudeSymbol3DLayer"),null;const m=F(c,this._context.elevationProvider,this._context.renderCoordsHelper,a,{outlineOutput:"tessellated-indices",owner:this._context.layer});if(null==m)return;this._logGeometryCreationWarnings(m,c.rings,"rings","ExtrudeSymbol3DLayer");const p=D(c);if(null==p)return null;const h=new Array,u=new Array,g=b(),y=n(),C=d(),w=1===this._context.renderCoordsHelper.viewingMode;w||this._context.renderCoordsHelper.worldUpAtPosition(null,C),f(c.spatialReference,[p.x,p.y,0],y,this._context.renderCoordsHelper.spatialReference);const S=n();i(S,y);const j=s();r(j,S);const I=new Map,E=this._materials[0];if(this._context.clippingExtent&&(x(m.mapPositions,g),!_(g,this._context.clippingExtent)))return;if(0===m.polygonIndexCount&&0===m.outlineIndexCount)return;const O=this._getExtrusionSize(t),L=A(m,{height:O,worldUp:C,spherical:w,requireElevation:!0,requireNormals:!0,requireSizes:!0});if(null==L)return;v(L.vertices,L.vertices,S);const V=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:l,layerViewUid:this._context.layerViewUid}),R=new le(L.vertices,L.elevation,q(L.normals),L.sizes),B=Q(E,L.indices,L.indices.length-L.bottomIndices.length,R,o,V),T=m.vertexCount,N=L.polygonVertexCount,H=2*m.outlineSegmentCount,W=m.polygonIndexCount/3,Z=new ce(T,N,H,W);if(ee(B,Z,y),I.set(B,Z),h.push(B),L.bottomIndices.length>0&&h.push(Q(this._materials[1],L.bottomIndices,0,R,o,V)),u.push(R.heights),0===h.length)return null;const J=new k({geometries:h,layerViewUid:this._context.layerViewUid,graphicUid:l,isElevationSource:!0});J.transformation=y;const K=G(this.symbolLayer,{opacity:this._getLayerOpacity()}),X=K?new U(this._materials[0],K,this._context.slicePlaneEnabled):null,Y=new z(this,J,null,(e,t,r,s,i)=>$(e,t,r,s,i,u,I),a,X);return Y.alignedSampledElevation=m.sampledElevation,Y.needsElevationUpdates=P(a.mode),Y}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){const e=this._materials[0];e&&e.setParameters({cullFace:e.transparent?0:2})}}function Q(e,t,r,s,i,o){const{attributeIndices:n,drawIndices:a}=X(t),l=[["position",new T(s.positions,n,3,!0)],["normalCompressed",new T(s.normals,n,2,!0)]];if(e.parameters.hasSymbolColors){const e=C(n.length);l.push(["symbolColor",new T(i,e,4,!0)])}return new N(e,l,s.elevation,0,o,r,null,a)}function X(e){const t=new Array,r=new Map,s=new Array;for(let i=0;i<e.length;++i){const o=e[i];let n=r.get(o);null==n&&(n=t.length,t.push(o),r.set(o,n)),s.push(n)}return{attributeIndices:t,drawIndices:s}}const Y=d();function $(e,t,r,s,i,l,c){const m=e.stageObject,p=m.geometries,u=p.length,d="absolute-height"!==t.mode;let g=0;const y=m.transformation,f=o(n(),y);for(let o=0,n=0;o<u;++o){const e=p[o],t=c.get(e);if(!t||!H(e))continue;const u=e.getMutableAttribute("position").data,b=l[n++],x=new R(e.mapPositions),_=u.length/3;let C=!1,v=0;{let e=0;for(let t=0;t<_;t++){Y[0]=u[e],Y[1]=u[e+1],Y[2]=u[e+2],s(x,se),d&&(v+=se.sampledElevation),V.ENABLE_OPTIMIZATIONS?(a(te,u[e],u[e+1],u[e+2]),h(te,te,y),i.setAltitude(te,se.z+b[e/3]),h(te,te,f)):(a(te,x.array[x.offset],x.array[x.offset+1],se.z+b[e/3]),null!=r&&i.toRenderCoords(te,r,te),h(te,te,f)),u[e]=te[0],u[e+1]=te[1],u[e+2]=te[2];const t=ie/i.unitInMeters;(Math.abs(Y[0]-u[e])>=t||Math.abs(Y[1]-u[e+1])>=t||Math.abs(Y[2]-u[e+2])>=t)&&(C=!0),x.offset+=3,e+=3}}if(C){ee(e,t,y),m.geometryVertexAttributeUpdated(p[o],"normalCompressed"),e.invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(p[o],"position");const r=p[o+1],s=!c.has(r);r&&s&&(r.invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(r,"position"))}g+=v/_}return g/u}function ee(e,t,r){const s=e.getMutableAttribute("position"),i=e.getMutableAttribute("normalCompressed").data,o=s.data,n=e.primitivePositionIndices,{topVertexStart:u,topVertexCount:d,topFaceStart:g,topFaceCount:y}=t,f=g+y,b=u+d,x=oe,_=ne,C=ae,v=re,w=te;a(w,0,0,0);const S=(e,t)=>{const s=3*e;a(t,o[s+0],o[s+1],o[s+2]),h(t,t,r)};for(let a=g;a<f;++a){const e=3*a;S(n[e+0],x[0]),S(n[e+1],x[1]),S(n[e+2],x[2]),l(_,x[1],x[0]),l(C,x[2],x[0]),c(v,_,C),m(w,w,v)}p(w,w);for(let a=u;a<b;++a){const e=w[0],t=w[1],r=w[2];W(i,a,e,t,r)}}const te=d(),re=d(),se=new E,ie=.01,oe=[d(),d(),d()],ne=d(),ae=d();class le{constructor(e,t,r,s){this.positions=e,this.elevation=t,this.normals=r,this.heights=s}}class ce{constructor(e,t,r,s){this.topVertexStart=e,this.topVertexCount=t,this.topFaceStart=r,this.topFaceCount=s}}export{K as Graphics3DExtrudeSymbolLayer};