@arcgis/core 4.34.0-next.44 → 4.34.0-next.46

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 (285) hide show
  1. package/AttributeBinsGraphic.js +1 -1
  2. package/PopupTemplate.js +1 -1
  3. package/arcade/featureSetUtils.js +1 -1
  4. package/arcade/functions/featuresetbase.js +1 -1
  5. package/arcade/geometry/wkt.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/04cbd3aa9965b2eb71ea.js +1 -0
  8. package/assets/esri/core/workers/chunks/{42c5d957813080143e5a.js → 09268dc856c3d5ce178f.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0f20c0eec850a39620a1.js +1 -0
  10. package/assets/esri/core/workers/chunks/{b40845b45f8d7cd347a1.js → 17df0f766ee1e323d3fa.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{cf474c055a85bdbfa8d0.js → 19f1bfe815896d4983af.js} +1 -1
  12. package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +1 -0
  13. package/assets/esri/core/workers/chunks/{bb23371335ac049861e6.js → 28a85997c9003cacdefb.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{9d9a7333a968065b53a1.js → 2942ab268f24cea2e722.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{3a2cbfb03103c402c6c5.js → 2b75212c31145cc07d16.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{787d281b2fe1edf6cf30.js → 2bb61f80473b495163e3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/2cda605c302176905e84.js +1 -0
  18. package/assets/esri/core/workers/chunks/{5958598da96464128aed.js → 2f65081bfedeab44d6cb.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{78de16f65ea297452a65.js → 31c6e951b99315e8e68a.js} +1 -1
  20. package/assets/esri/core/workers/chunks/33f3e3d05429f845c139.js +1 -0
  21. package/assets/esri/core/workers/chunks/3610357c8fa9bec9e0dc.js +1 -0
  22. package/assets/esri/core/workers/chunks/379a4f664e77ad1fffe9.js +1 -0
  23. package/assets/esri/core/workers/chunks/45b450c045d5fadf71b6.js +1 -0
  24. package/assets/esri/core/workers/chunks/{d547b27ac750953a998f.js → 46a470bea2a3601182dc.js} +1 -1
  25. package/assets/esri/core/workers/chunks/47f2e905ef42e36897aa.js +1 -0
  26. package/assets/esri/core/workers/chunks/4c6862ad3af947c704f7.js +1 -0
  27. package/assets/esri/core/workers/chunks/4d544e3e19ce07c2c195.js +1 -0
  28. package/assets/esri/core/workers/chunks/4f5e72993a4f5180d703.js +1 -0
  29. package/assets/esri/core/workers/chunks/50d526a16bc86a481055.js +1 -0
  30. package/assets/esri/core/workers/chunks/516b30778cd54d29e362.js +1 -0
  31. package/assets/esri/core/workers/chunks/54b1a960bb8c3fe05976.js +1 -0
  32. package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +1 -0
  33. package/assets/esri/core/workers/chunks/576792b5e1e13084adba.js +1 -0
  34. package/assets/esri/core/workers/chunks/{6759319f3fd2d03c446b.js → 5c556468e2a598ab793a.js} +1 -1
  35. package/assets/esri/core/workers/chunks/5d331f7628514a572f82.js +1 -0
  36. package/assets/esri/core/workers/chunks/64c31c90e4c589ca2f04.js +1 -0
  37. package/assets/esri/core/workers/chunks/65e1f5b20a585e04655a.js +1 -0
  38. package/assets/esri/core/workers/chunks/66db5f77e09d25e33951.js +1 -0
  39. package/assets/esri/core/workers/chunks/{863e87ac982d7727b435.js → 69e37365c17e7cc4168f.js} +1 -1
  40. package/assets/esri/core/workers/chunks/6fe738748ce837811ff4.js +1 -0
  41. package/assets/esri/core/workers/chunks/709dc98379f4ce18a0b5.js +1 -0
  42. package/assets/esri/core/workers/chunks/719450ccd455f503d81a.js +1 -0
  43. package/assets/esri/core/workers/chunks/73140c5c0beda7ea3703.js +1 -0
  44. package/assets/esri/core/workers/chunks/790e97ddbe318bc75415.js +1 -0
  45. package/assets/esri/core/workers/chunks/7df8c78e36b04ad657d2.js +1 -0
  46. package/assets/esri/core/workers/chunks/838c7fd37b2e78b1d582.js +1 -0
  47. package/assets/esri/core/workers/chunks/8736b78256037b145f8b.js +1 -0
  48. package/assets/esri/core/workers/chunks/{c6da9ba188b627ab3b79.js → 8aa77a5e82c033512b45.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{b1c2e5e0a70fb5d27da5.js → 8bab4c59c9b644224ecb.js} +1 -1
  50. package/assets/esri/core/workers/chunks/8c6119dde0eead8d90d9.js +1 -0
  51. package/assets/esri/core/workers/chunks/{4f3c187a7cb2b1444281.js → 8c81156b1605a16acc29.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{f4b145feab275b268c2e.js → 8cc700da2ac58849a708.js} +1 -1
  53. package/assets/esri/core/workers/chunks/8f70650aba8e55eb7a96.js +1 -0
  54. package/assets/esri/core/workers/chunks/914eaed113dda727eb47.js +1 -0
  55. package/assets/esri/core/workers/chunks/98175b454e807b1a3c5f.js +1 -0
  56. package/assets/esri/core/workers/chunks/{44116cf0bd4d6a127c96.js → 99b9392946d776a62997.js} +1 -1
  57. package/assets/esri/core/workers/chunks/9a20be3b02c9d6349b8d.js +1 -0
  58. package/assets/esri/core/workers/chunks/9affcf990ea810fa426b.js +1 -0
  59. package/assets/esri/core/workers/chunks/9b7fee0adffeee8d45ae.js +1 -0
  60. package/assets/esri/core/workers/chunks/9cbec2ffa445a72d4c33.js +1 -0
  61. package/assets/esri/core/workers/chunks/9d30fed26e0d84ef893b.js +1 -0
  62. package/assets/esri/core/workers/chunks/9f178cf73c63caaea190.js +1 -0
  63. package/assets/esri/core/workers/chunks/a1ff4c252012d5026133.js +1 -0
  64. package/assets/esri/core/workers/chunks/a34d98abcf958a632b0f.js +1 -0
  65. package/assets/esri/core/workers/chunks/a3a23a56df4e5ee86bb2.js +1 -0
  66. package/assets/esri/core/workers/chunks/a6493607b98783bf1ef2.js +1 -0
  67. package/assets/esri/core/workers/chunks/a69258f34a5eb5a1954f.js +1 -0
  68. package/assets/esri/core/workers/chunks/a7ff44157b8cf19de37e.js +1 -0
  69. package/assets/esri/core/workers/chunks/{5ae6e2b3557fe8730072.js → b287624909578d307e07.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{48514235c32917e43a3f.js → b3e2e826295620b1a9dd.js} +2 -2
  71. package/assets/esri/core/workers/chunks/{5b91a49202129eedaf00.js → b4304673696fc0774bff.js} +1 -1
  72. package/assets/esri/core/workers/chunks/bd1c2afaf491d1c79a9e.js +1 -0
  73. package/assets/esri/core/workers/chunks/{f34739daceab54a280ad.js → beb77cdae0b1b6ad73da.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{a638f1688ac9525a52a7.js → c2f184e9f579152aa29a.js} +1 -1
  75. package/assets/esri/core/workers/chunks/c483d2149d9d0099bfdb.js +1 -0
  76. package/assets/esri/core/workers/chunks/{349da65a8793f7873366.js → c5a0976de958b3b01c70.js} +1 -1
  77. package/assets/esri/core/workers/chunks/ce569860b170700e9b31.js +1 -0
  78. package/assets/esri/core/workers/chunks/cf5db995ba88912cf6b7.js +1 -0
  79. package/assets/esri/core/workers/chunks/cf6330f721c6910d25ff.js +1 -0
  80. package/assets/esri/core/workers/chunks/{2aac5d560e4c5defe882.js → cff15600d0ec7b19dffb.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{0faec78b2dd6990a5da0.js → d09ded9fb621491e2466.js} +1 -1
  82. package/assets/esri/core/workers/chunks/d1842745a7699879a1e1.js +1 -0
  83. package/assets/esri/core/workers/chunks/{7e99fc78bd0f40a8ba81.js → d1c97fdcba6eb443cb1c.js} +1 -1
  84. package/assets/esri/core/workers/chunks/d62d41091f7ac5f77f16.js +1 -0
  85. package/assets/esri/core/workers/chunks/d70e1b8b8bee88a7a5b8.js +353 -0
  86. package/assets/esri/core/workers/chunks/d8d17e3ecccec7e99f0b.js +1 -0
  87. package/assets/esri/core/workers/chunks/{14b536e0c1de6c7422bc.js → e408ccee12bfe089c913.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{7f2bdb8da5c9ffd7d05e.js → e58336aafe8c95bb6831.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{30b9c131b69297ee186f.js → e59e09766b130a05c617.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{01ae7d36bda6b6186786.js → eb61b47df99a54a364c8.js} +1 -1
  91. package/assets/esri/core/workers/chunks/ef02e33ea53b46b566cb.js +1 -0
  92. package/assets/esri/core/workers/chunks/f0ccd7ac83d94cbf40a5.js +1 -0
  93. package/assets/esri/core/workers/chunks/{655b8d24ffe5405f8ba1.js → f2a2d3cda4a3dc0a8caf.js} +1 -1
  94. package/assets/esri/core/workers/chunks/fc6408208c850eec4019.js +1 -0
  95. package/assets/esri/core/workers/chunks/ff79a8df1b1941ae350d.js +1 -0
  96. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  97. package/chunks/NativeLine.glsl.js +5 -14
  98. package/chunks/bundle.js +1 -1
  99. package/chunks/languageUtils.js +1 -1
  100. package/chunks/persistableUrlUtils.js +1 -1
  101. package/colorUtils.js +1 -1
  102. package/config.js +1 -1
  103. package/core/BidiEngine.js +1 -1
  104. package/core/accessorSupport/get.js +1 -1
  105. package/core/accessorSupport/read.js +1 -1
  106. package/core/accessorSupport/tracking.js +1 -1
  107. package/core/screenUtils.js +1 -1
  108. package/core/sql/DateOnly.js +1 -1
  109. package/core/urlUtils.js +1 -1
  110. package/core/uuid.js +1 -1
  111. package/core/workers/registry.js +1 -1
  112. package/geometry/operators/json/generalizeOperator.js +5 -0
  113. package/geometry/operators/json/simplifyOperator.js +1 -1
  114. package/identity/IdentityManagerBase.js +1 -1
  115. package/interfaces.d.ts +3 -3
  116. package/kernel.js +1 -1
  117. package/layers/ParquetLayer.js +1 -1
  118. package/layers/SubtypeGroupLayer.js +1 -1
  119. package/layers/graphics/data/QueryEngine.js +1 -1
  120. package/layers/graphics/data/QueryEngineResult.js +1 -1
  121. package/layers/graphics/sources/ParquetSource.js +1 -1
  122. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  123. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  124. package/layers/graphics/sources/support/ParquetSourceWorker.js +5 -0
  125. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  126. package/layers/mixins/ArcGISImageService.js +1 -1
  127. package/layers/support/TitleCreator.js +1 -1
  128. package/layers/support/fieldUtils.js +1 -1
  129. package/layers/support/parquetUtils.js +1 -1
  130. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  131. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  132. package/libs/maquette-advanced-projector/utils.js +1 -1
  133. package/libs/parquet/parquet.js +1 -1
  134. package/networks/RulesTable.js +1 -1
  135. package/package.json +1 -1
  136. package/rest/generateRenderer.js +1 -1
  137. package/rest/networks/support/TraceResult.js +1 -1
  138. package/smartMapping/statistics/support/statsWorker.js +1 -1
  139. package/smartMapping/statistics/support/utils.js +1 -1
  140. package/support/revision.js +1 -1
  141. package/symbols/cim/CIMEffects.js +1 -1
  142. package/symbols/cim/CIMResourceManager.js +1 -1
  143. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  144. package/symbols/cim/CIMSymbolHelper.js +1 -1
  145. package/symbols/cim/cimAnalyzer.js +1 -1
  146. package/symbols/cim/effects/CIMEffectHelper.js +1 -1
  147. package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
  148. package/symbols/cim/effects/EffectArrow.js +1 -1
  149. package/symbols/cim/effects/EffectBuffer.js +1 -1
  150. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  151. package/symbols/cim/effects/EffectCut.js +1 -1
  152. package/symbols/cim/effects/EffectDashes.js +1 -1
  153. package/symbols/cim/effects/EffectDonut.js +1 -1
  154. package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
  155. package/symbols/cim/effects/EffectJog.js +1 -1
  156. package/symbols/cim/effects/EffectMove.js +1 -1
  157. package/symbols/cim/effects/EffectOffset.js +1 -1
  158. package/symbols/cim/effects/EffectRadial.js +1 -1
  159. package/symbols/cim/effects/EffectReverse.js +1 -1
  160. package/symbols/cim/effects/EffectRotate.js +1 -1
  161. package/symbols/cim/effects/EffectScale.js +1 -1
  162. package/symbols/cim/effects/EffectSuppress.js +1 -1
  163. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  164. package/symbols/cim/effects/EffectWave.js +1 -1
  165. package/symbols/cim/fitVectorMarker.js +1 -1
  166. package/symbols/cim/placements/CIMMarkerPlacementHelper.js +1 -1
  167. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  168. package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
  169. package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
  170. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  171. package/symbols/cim/placements/PlacementOnLine.js +1 -1
  172. package/symbols/cim/placements/PlacementOnVertices.js +1 -1
  173. package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
  174. package/symbols/cim/utils.js +1 -1
  175. package/views/2d/engine/webgl/TextureManager.js +1 -1
  176. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  177. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  178. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  179. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  180. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  181. package/views/2d/interactive/editingTools/MediaTransformToolsWrapper.js +1 -1
  182. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  183. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  184. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  185. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  186. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  187. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  188. package/views/3d/terrain/TerrainRenderer.js +1 -1
  189. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  190. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  191. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  192. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  193. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  194. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  195. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  196. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
  197. package/views/draw/DrawOperation.js +1 -1
  198. package/views/draw/{DrawManipulator.js → LegacyDrawManipulator.js} +1 -1
  199. package/views/draw/{DrawTool.js → LegacyDrawTool.js} +1 -1
  200. package/views/draw/PointDrawAction.js +1 -1
  201. package/views/draw/PolygonDrawAction.js +1 -1
  202. package/views/draw/PolylineDrawAction.js +1 -1
  203. package/views/draw/SegmentDrawAction.js +1 -1
  204. package/views/draw/support/Box.js +1 -1
  205. package/views/draw/support/Reshape.js +1 -1
  206. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  207. package/views/support/TextureCompressionWorker.js +1 -1
  208. package/webscene/spec-certification/spec.js +1 -1
  209. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  210. package/widgets/BatchAttributeForm.js +1 -1
  211. package/widgets/CatalogLayerList.js +1 -1
  212. package/widgets/CoordinateConversion/support/Format.js +1 -1
  213. package/widgets/Editor/UpdateWorkflow.js +1 -1
  214. package/widgets/Editor/workflowUtils.js +1 -1
  215. package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
  216. package/widgets/Feature/FeatureRelationship.js +1 -1
  217. package/widgets/Feature/FeatureViewModel.js +1 -1
  218. package/widgets/Feature/support/featureUtils.js +1 -1
  219. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  220. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  221. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  222. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  223. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  224. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  225. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +5 -0
  226. package/widgets/OrientedImageryViewer/symbols.js +1 -1
  227. package/widgets/OrientedImageryViewer.js +1 -1
  228. package/widgets/Print.js +1 -1
  229. package/widgets/Sketch/SketchViewModel.js +1 -1
  230. package/widgets/Track/TrackViewModel.js +1 -1
  231. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  232. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  233. package/widgets/support/SnappingControls.js +1 -1
  234. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  235. package/assets/esri/core/workers/chunks/03df4668002eb4cb4f98.js +0 -1
  236. package/assets/esri/core/workers/chunks/087ae1e3e767f0e678e5.js +0 -1
  237. package/assets/esri/core/workers/chunks/0b45566fad2cbb03fea1.js +0 -1
  238. package/assets/esri/core/workers/chunks/0d73afce787ee1e76b21.js +0 -1
  239. package/assets/esri/core/workers/chunks/1acc620bfd2983d6853f.js +0 -1
  240. package/assets/esri/core/workers/chunks/21dd626a5b5ea6a7e18e.js +0 -1
  241. package/assets/esri/core/workers/chunks/24e76fa530fc0c495fb5.js +0 -1
  242. package/assets/esri/core/workers/chunks/28d71e1b866113650c75.js +0 -1
  243. package/assets/esri/core/workers/chunks/2a26c3fc324d672ebe88.js +0 -1
  244. package/assets/esri/core/workers/chunks/2c816d3a737e39e6eb84.js +0 -1
  245. package/assets/esri/core/workers/chunks/2f54776ff86f397adc55.js +0 -1
  246. package/assets/esri/core/workers/chunks/3984ca7e05f30724adaf.js +0 -1
  247. package/assets/esri/core/workers/chunks/3af4a410ff0bca7ba2e3.js +0 -1
  248. package/assets/esri/core/workers/chunks/439128f23fa091633d2d.js +0 -1
  249. package/assets/esri/core/workers/chunks/489391ed1d443140617d.js +0 -1
  250. package/assets/esri/core/workers/chunks/4970d439d9648e97fd5a.js +0 -1
  251. package/assets/esri/core/workers/chunks/774844eea928efa811f2.js +0 -1
  252. package/assets/esri/core/workers/chunks/7b82ed4cc475c782256b.js +0 -1
  253. package/assets/esri/core/workers/chunks/7ef29640de297a0cf744.js +0 -1
  254. package/assets/esri/core/workers/chunks/8867368ab9b005460f19.js +0 -353
  255. package/assets/esri/core/workers/chunks/8c3c752408fac3db05cf.js +0 -1
  256. package/assets/esri/core/workers/chunks/8ca95499e00ce8b0af9a.js +0 -1
  257. package/assets/esri/core/workers/chunks/8f3ce10eacb5bc14a641.js +0 -1
  258. package/assets/esri/core/workers/chunks/91be247f868ce6596c9e.js +0 -1
  259. package/assets/esri/core/workers/chunks/97fc21355efc7b289f3b.js +0 -1
  260. package/assets/esri/core/workers/chunks/9cd9b22354dbdf1b1df0.js +0 -1
  261. package/assets/esri/core/workers/chunks/a89c060ad302381aaf7d.js +0 -1
  262. package/assets/esri/core/workers/chunks/aaab7694eb333ad480f5.js +0 -1
  263. package/assets/esri/core/workers/chunks/af98c7546be409303213.js +0 -1
  264. package/assets/esri/core/workers/chunks/b01a90ce699058307bc2.js +0 -1
  265. package/assets/esri/core/workers/chunks/b5f6a0607b620b027cdd.js +0 -1
  266. package/assets/esri/core/workers/chunks/c110941e87923ba47193.js +0 -1
  267. package/assets/esri/core/workers/chunks/c6e3d4c6bb02d58d5cfe.js +0 -1
  268. package/assets/esri/core/workers/chunks/cd6398a2951922e13b86.js +0 -1
  269. package/assets/esri/core/workers/chunks/ceb63ca9ad473c3f1820.js +0 -1
  270. package/assets/esri/core/workers/chunks/d392fbbcfac2a1b54bd6.js +0 -1
  271. package/assets/esri/core/workers/chunks/d93b24e863379116b2aa.js +0 -1
  272. package/assets/esri/core/workers/chunks/da6f46211551a96dce19.js +0 -1
  273. package/assets/esri/core/workers/chunks/dd9be173cddc16a354ed.js +0 -1
  274. package/assets/esri/core/workers/chunks/ddeaf688d72b2873c4ac.js +0 -1
  275. package/assets/esri/core/workers/chunks/e3f5afdf133c58b3d161.js +0 -1
  276. package/assets/esri/core/workers/chunks/e5aeb34d918dee539694.js +0 -1
  277. package/assets/esri/core/workers/chunks/e6d08230adb90b9a2a17.js +0 -1
  278. package/assets/esri/core/workers/chunks/e7806a57d29bca385f1d.js +0 -1
  279. package/assets/esri/core/workers/chunks/e799433770e4303fcd9c.js +0 -1
  280. package/assets/esri/core/workers/chunks/eb7dd722e4cd7f83b3f5.js +0 -1
  281. package/assets/esri/core/workers/chunks/f1adf8ebc2c1b93857bf.js +0 -1
  282. package/assets/esri/core/workers/chunks/f1b02c4bd5fde235212b.js +0 -1
  283. package/assets/esri/core/workers/chunks/f65b2d3a91a0c726fee4.js +0 -1
  284. package/assets/esri/core/workers/chunks/ff34fdda7899e784ac73.js +0 -1
  285. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/loadGeometryEngine.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromNestedArray as b}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as _}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as T}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let C;const G=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class W{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class z{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes??{},aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new W(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new _(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLineGeometry,this._trackLinePath,this._spatialReference),this._bounds=N(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=new g;m(a,r,!1,!1,this._metadata.geometryType,t.subscription.tile.transform);const o=l(1/0,1/0,-1/0,-1/0);E(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new _(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=new g;m(e,this._trackLineGeometry,!1,!1,"esriGeometryPolyline",t.subscription.tile.transform);return new _(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new _(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class M extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,a,o,n){const l=new R({spatialReference:e}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then(([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,s,a,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}destroy(){super.destroy();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){const t=new Set(this._source.chunks().map(t=>t.chunkId));for(const e of t)if(!this._handledChunks.has(e))return!0;for(const e of this._handledChunks)if(!t.has(e))return!0;return!1}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new M(t)}async*applyOverrideUpdate(t){G().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,attributes:{},...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,attributes:{},...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=z.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new z(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,T(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e);null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function q(t,e,s){if(e.length<2)return b(t,[e],!1,!1);if(s.isWrappable){let r=!1;for(let t=1;t<e.length;t++){const i=e[t][0],a=h(i,e[t-1][0],s);i!==a&&(e[t][0]=a,r=!0)}if(r){const r=p({paths:[e],spatialReference:s});if(null!=r)return b(t,r.paths,!1,!1)}return b(t,[e],!1,!1)}const r=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[e]}),i=C.fromSpatialReference(s);if(null!=i){const e=a(r,1e6,i,o.geodesic);if(null!=e){const s=C.toGeometry(e,i);if(null!=s&&"paths"in s)return b(t,s.paths,!1,!1)}}return b(t,[e],!1,!1)}function E(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function N(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
5
+ import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromNestedArray as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as b}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as T}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let C;const G=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class W{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class z{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes??{},aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new W(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new b(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLineGeometry,this._trackLinePath,this._spatialReference),this._bounds=N(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=new g;m(a,r,!1,!1,this._metadata.geometryType,t.subscription.tile.transform);const o=l(1/0,1/0,-1/0,-1/0);E(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new b(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=new g;m(e,this._trackLineGeometry,!1,!1,"esriGeometryPolyline",t.subscription.tile.transform);return new b(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new b(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class M extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,a,o,n){const l=new R({spatialReference:e}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then(([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,s,a,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}destroy(){super.destroy();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){const t=new Set(this._source.chunks().map(t=>t.chunkId));for(const e of t)if(!this._handledChunks.has(e))return!0;for(const e of this._handledChunks)if(!t.has(e))return!0;return!1}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new M(t)}async*applyOverrideUpdate(t){G().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=z.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new z(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,T(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e);null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function q(t,e,s){if(e.length<2)return _(t,[e],!1,!1);if(s.isWrappable){let r=!1;for(let t=1;t<e.length;t++){const i=e[t][0],a=h(i,e[t-1][0],s);i!==a&&(e[t][0]=a,r=!0)}if(r){const r=p({paths:[e],spatialReference:s});if(null!=r)return _(t,r.paths,!1,!1)}return _(t,[e],!1,!1)}const r=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[e]}),i=C.fromSpatialReference(s);if(null!=i){const e=a(r,1e6,i,o.geodesic);if(null!=e){const s=C.toGeometry(e,i);if(null!=s&&"paths"in s)return _(t,s.paths,!1,!1)}}return _(t,[e],!1,!1)}function E(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function N(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import r from"../../../../../core/Logger.js";import{watch as i,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import a from"../../../../../geometry/Point.js";import{tryProjectWithZConversion as l}from"../../../../../geometry/projectionUtils.js";import{empty as h,expandPointInPlace as m}from"../../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as c}from"../../support/projectionUtils.js";import{createCoordinateHelper as u}from"../../../../interactive/coordinateHelper.js";import{EditGeometry as d,Part as p}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as y}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let g=class extends t{constructor(e={}){super(e),this._version=0,this._internalGeometryChange=!1,this._extent=h()}set areaMeasurement(e){this._set("areaMeasurement",e),null!=e&&null!=this.view&&this._initialize(e,this.view)}set view(e){this._set("view",e),null!=e&&null!=this.areaMeasurement&&this._initialize(this.areaMeasurement,e)}get constructed(){return null!=this.areaMeasurement&&null!=this.view}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||0===this._editGeometry.parts.length}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.parts.length>0&&this._editGeometry.parts[0].vertices.length>0){const e=h(this._extent);return this.forEachVertex(t=>{m(e,t.pos)}),e}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this.removeAllHandles(),this.addHandles(i(()=>e.geometry,()=>{this._updateEditGeometryFromModelGeometry(e,t)},o)),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange("polygonIsClosed"),this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),e&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(e,t){if(this._version++,this._internalGeometryChange)return;this.removeHandles("EditGeometry");let i=e.geometry;if(null!=i){const o=l(i,t.spatialReference);null==o&&c(e,i.spatialReference,r.getLogger(this)),i=o}this._editGeometryOperations=null!=i?y.fromGeometry(i,t.state.viewingMode):new y(new d("polygon",u(!0,!1,t.spatialReference)),t.state.viewingMode),this._makeDirty(!0),this.emit("change"),this.addHandles(this._editGeometry.on("change",t=>{this._makeDirty(null!=t.addedVertices||null!=t.removedVertices),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this._editGeometry.geometry:null,this._internalGeometryChange=!1}),"EditGeometry")}get _editGeometry(){return this._editGeometryOperations.data}get vertices(){const e=[];return this.forEachVertex(t=>{e.push(t)}),e}get numVertices(){return this.constructed&&this._editGeometry.parts.length>0?this._editGeometry.parts[0].vertices.length:0}get polygonIsClosed(){return this._editGeometry.parts.length>0&&this._editGeometry.parts[0].isClosed()}get firstPoint(){if(this.constructed&&this._editGeometry.parts.length>0){const e=this._editGeometry.parts[0].getFirstVertex();if(null!=e)return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}return null}get lastPoint(){if(this.constructed&&this._editGeometry.parts.length>0){const e=this._editGeometry.parts[0].getLastVertex();if(null!=e)return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}return null}getVertex(e){if(!this.constructed||0===this._editGeometry.parts.length||0===this._editGeometry.parts[0].vertices.length)return null;const t=this._editGeometry.parts[0].vertices[0];let r=t;do{if(r.index===e)return r;r=r.rightSegment.rightVertex}while(r!==t&&null!=r);return null}getVertexPositionAsPoint(e){return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){if(this.constructed&&this._editGeometry.parts.length>0)for(const t of this._editGeometry.parts[0].iterateVertices())e(t,t.index)}forEachVertexPosition(e){const t=this._editGeometry.coordinateHelper;this.forEachVertex((r,i)=>{t.vectorToPoint(r.pos,_),e(_,i)})}clear(){null!=this.areaMeasurement&&(this.areaMeasurement.geometry=null)}add(e){if(!this.constructed)return null;if(0===this._editGeometry.parts.length){const e=this.view;this._editGeometry.parts.push(new p(e.spatialReference,e.state.viewingMode))}const t=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(e));return this.emit("change"),t}close(){if(!this.constructed||0===this._editGeometry.parts.length)return null;const e=this._editGeometryOperations.closePart(this._editGeometry.parts[0]);return this.emit("change"),e}ensureContains(e,t=""){let r=!1;if(this._editGeometry.parts.forEach(t=>{for(const i of t.iterateVertices())i===e&&(r=!0)}),!r)throw new Error(`vertex doesn't exist ${t}`);return r}setVertexPosition(e,t){if(!this.constructed)return null;const r=this._editGeometryOperations.setVertexPosition(e,this._editGeometry.coordinateHelper.pointToVector(t));return this.emit("change"),r}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition((r,i)=>{const o=e.getVertexPositionAsPointFromIndex(i);r.equals(o)||(t=!1)}),!!t}};e([s({value:null})],g.prototype,"areaMeasurement",null),e([s({value:null})],g.prototype,"view",null),e([s()],g.prototype,"isEmptyPolygon",null),e([s()],g.prototype,"isValidPolygon",null),e([s()],g.prototype,"extent",null),e([s()],g.prototype,"spatialReference",null),e([s()],g.prototype,"numVertices",null),e([s()],g.prototype,"polygonIsClosed",null),g=e([n("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementPathHelper")],g);const _=new a;export{g as AreaMeasurement3DPathHelper};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import r from"../../../../../core/Logger.js";import{watch as i,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import a from"../../../../../geometry/Point.js";import{tryProjectWithZConversion as l}from"../../../../../geometry/projectionUtils.js";import{empty as h,expandPointInPlace as c}from"../../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as m}from"../../support/projectionUtils.js";import{createCoordinateHelper as u}from"../../../../interactive/coordinateHelper.js";import{EditGeometry as p,Part as d}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as y}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let g=class extends t{constructor(e={}){super(e),this._version=0,this._internalGeometryChange=!1,this._extent=h()}set areaMeasurement(e){this._set("areaMeasurement",e),null!=e&&null!=this.view&&this._initialize(e,this.view)}set view(e){this._set("view",e),null!=e&&null!=this.areaMeasurement&&this._initialize(this.areaMeasurement,e)}get constructed(){return null!=this.areaMeasurement&&null!=this.view}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||0===this._editGeometry.parts.length}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.parts[0]?.vertices.length){const e=h(this._extent);return this.forEachVertex(t=>{c(e,t.pos)}),e}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this.removeAllHandles(),this.addHandles(i(()=>e.geometry,()=>{this._updateEditGeometryFromModelGeometry(e,t)},o)),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange("polygonIsClosed"),this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),e&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(e,t){if(this._version++,this._internalGeometryChange)return;this.removeHandles("EditGeometry");let i=e.geometry;if(null!=i){const o=l(i,t.spatialReference);null==o&&m(e,i.spatialReference,r.getLogger(this)),i=o}this._editGeometryOperations=null!=i?y.fromGeometry(i,t.state.viewingMode):new y(new p("polygon",u(!0,!1,t.spatialReference)),t.state.viewingMode),this._makeDirty(!0),this.emit("change"),this.addHandles(this._editGeometry.on("change",t=>{this._makeDirty(null!=t.addedVertices||null!=t.removedVertices),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this._editGeometry.geometry:null,this._internalGeometryChange=!1}),"EditGeometry")}get _editGeometry(){return this._editGeometryOperations.data}get vertices(){const e=[];return this.forEachVertex(t=>{e.push(t)}),e}get numVertices(){return this.constructed?this._editGeometry.parts[0]?.vertices.length??0:0}get polygonIsClosed(){return this._editGeometry.parts[0]?.isClosed()??!1}get firstPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getFirstVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}get lastPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getLastVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}getVertex(e){if(!this.constructed||!this._editGeometry.parts[0]?.vertices.length)return null;const t=this._editGeometry.parts[0].vertices[0];let r=t;do{if(r.index===e)return r;r=r.rightSegment.rightVertex}while(r!==t&&null!=r);return null}getVertexPositionAsPoint(e){return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){if(this.constructed&&this._editGeometry.parts.length>0)for(const t of this._editGeometry.parts[0].iterateVertices())e(t,t.index)}forEachVertexPosition(e){const t=this._editGeometry.coordinateHelper;this.forEachVertex((r,i)=>{t.vectorToPoint(r.pos,f),e(f,i)})}clear(){null!=this.areaMeasurement&&(this.areaMeasurement.geometry=null)}add(e){if(!this.constructed)return null;if(0===this._editGeometry.parts.length){const e=this.view;this._editGeometry.parts.push(new d(e.spatialReference,e.state.viewingMode))}const t=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(e));return this.emit("change"),t}close(){if(!this.constructed||0===this._editGeometry.parts.length)return null;const e=this._editGeometryOperations.closePart(this._editGeometry.parts[0]);return this.emit("change"),e}ensureContains(e,t=""){let r=!1;if(this._editGeometry.parts.forEach(t=>{for(const i of t.iterateVertices())i===e&&(r=!0)}),!r)throw new Error(`vertex doesn't exist ${t}`);return r}setVertexPosition(e,t){if(!this.constructed)return null;const r=this._editGeometryOperations.setVertexPosition(e,this._editGeometry.coordinateHelper.pointToVector(t));return this.emit("change"),r}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition((r,i)=>{const o=e.getVertexPositionAsPointFromIndex(i);r.equals(o)||(t=!1)}),!!t}};e([s({value:null})],g.prototype,"areaMeasurement",null),e([s({value:null})],g.prototype,"view",null),e([s()],g.prototype,"isEmptyPolygon",null),e([s()],g.prototype,"isValidPolygon",null),e([s()],g.prototype,"extent",null),e([s()],g.prototype,"spatialReference",null),e([s()],g.prototype,"numVertices",null),e([s()],g.prototype,"polygonIsClosed",null),g=e([n("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementPathHelper")],g);const f=new a;export{g as AreaMeasurement3DPathHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../../intl.js";import t from"../../../../core/Accessor.js";import{unitRGBAFromColor as i,multiplyOpacityToUnitRGBA as s,getContrast as n,multiplyOpacity as o}from"../../../../core/colorUtils.js";import"../../../../core/has.js";import{nextHighestPowerOfTen as l,deg2rad as r}from"../../../../core/mathUtils.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{formatDecimal as c,formatImperialVerticalLength as h,formatImperialLength as u,formatMetricVerticalLength as d,formatMetricLength as m}from"../../../../core/quantityFormatUtils.js";import{toUnit as g}from"../../../../core/quantityUtils.js";import{watch as p,syncAndInitial as _,initial as v}from"../../../../core/reactiveUtils.js";import{createRenderScreenPointArray3 as b,createRenderScreenPointArray as L}from"../../../../core/screenUtils.js";import{adaptiveImperialLengthUnit as w,convertUnit as y}from"../../../../core/unitUtils.js";import{property as S}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{dot as E}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as V,f as z}from"../../../../chunks/vec32.js";import{create as A}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{renderScreenSpaceTangent as P}from"../../interactive/support/viewUtils.js";import{LabelVisualElement as j,mirrorPosition as M}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as C}from"../../interactive/visualElements/LineVisualElement.js";import{MeasurementArrowVisualElement as O}from"../../interactive/visualElements/MeasurementArrowVisualElement.js";import{RightAngleQuadVisualElement as x}from"../../interactive/visualElements/RightAngleQuadVisualElement.js";import{GeodesicSegment as D,EuclideanSegment as G}from"../../interactive/visualElements/support/Segment.js";import{createStipplePatternSimple as H}from"../../webgl-engine/materials/lineStippleUtils.js";import{geodesicDistanceThreshold as k}from"../../../support/geodesicMeasurementUtils.js";import{onLocaleChange as T}from"../../../../intl/locale.js";import{fetchMessageBundle as U}from"../../../../intl/messages.js";let R=class extends t{get _parameters(){const e=this.view.effectiveTheme,{accentColor:t,textColor:l}=e,r=i(t),a=s(t,.75),c=i(n(t)),h=n(l,160);return{accentColor:r,contrastColor:c,translucentAccentColor:a,triangleLineWidth:3,geodesicProjectionLineWidth:2,guideLineWidth:2,guideStippleLengthPixels:3,directLabelFontSize:16,horizontalLabelFontSize:12,verticalLabelFontSize:12,textColor:l,textBackgroundColor:o(h,.6),textCalloutColor:o(h,.5)}}get visible(){return this.analysisView.visible}get viewMode(){const{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t}=this.analysisView;if(null==e||null==t||e.equals(t))return 0;const i=this.analysisView.result;if(null==i)return 1;if("geodesic"===this.actualVisualizedMeasurement)return this._requiresGeodesicGuideAt(this._startPosition)||this._requiresGeodesicGuideAt(this._endPosition)?3:1;const{verticalDistance:s,horizontalDistance:n}=i,o=g(s,"meters").value,l=g(n,"meters").value;return Math.min(o/l,l/o)<this.triangleCollapseRatioThreshold?1:2}get actualVisualizedMeasurement(){const{measurementMode:e,result:t}=this.analysisView;switch(e){case 0:return null!=t&&g(t.horizontalDistance,"meters").value>k?"geodesic":"euclidean";case 1:return"euclidean";case 2:return"geodesic"}}get allowVisualElementsOrientationChange(){return null==this._triangleOrientationOverride}set allowVisualElementsOrientationChange(e){null==this._triangleOrientationOverride!==e&&(null==this._triangleOrientationOverride?this._triangleOrientationOverride=this._actualVisualElementsOrientation:this._triangleOrientationOverride=null)}get labels(){return"geodesic"===this.actualVisualizedMeasurement?{direct:null,horizontal:this._segmentLabel,vertical:this._verticalLabel}:{direct:this._segmentLabel,horizontal:this._horizontalLabel,vertical:this._verticalLabel}}constructor(e){super(e),this._segmentVisualElement=null,this._triangleVisualElement=null,this._rightAngleQuad=null,this._projectedGeodesicLine=null,this._geodesicStartHint=null,this._geodesicEndHint=null,this._segmentLabel=null,this._verticalLabel=null,this._horizontalLabel=null,this._startPosition=A(),this._endPosition=A(),this._cornerPosition=A(),this._startPositionAtSeaLevel=A(),this._endPositionAtSeaLevel=A(),this._triangleOrientationOverride=null,this.messages=null,this.loadingMessages=!0,this.visualElementOrientation=0,this.triangleCollapseRatioThreshold=.03}initialize(){const e={attached:!0,view:this.view,isDecoration:!0},{guideLineWidth:t,guideStippleLengthPixels:i,triangleLineWidth:s,geodesicProjectionLineWidth:n,directLabelFontSize:o,verticalLabelFontSize:l,horizontalLabelFontSize:r}=this._parameters;this._segmentVisualElement=new O({...e,geometry:null,renderOccluded:4}),this._triangleVisualElement=new C({...e,width:s,renderOccluded:4}),this._rightAngleQuad=new x({...e,renderOccluded:4});const a={...e,polygonOffset:!0,renderOccluded:4};this._projectedGeodesicLine=new C({...a,width:n,stipplePattern:H(i)}),this._geodesicStartHint=new C({...a,width:t,stipplePattern:H(i)}),this._geodesicEndHint=new C({...a,width:t,stipplePattern:H(i)}),this._segmentLabel=new j({...e,fontSize:o}),this._verticalLabel=new j({...e,fontSize:l}),this._horizontalLabel=new j({...e,fontSize:r}),this.addHandles([p(()=>{const{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t}=this.analysisView,i=this.view;return{view:i,camera:i.state.camera,viewMode:this.viewMode,elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,orientation:this._actualVisualElementsOrientation,visualizedMeasurement:this.actualVisualizedMeasurement,stripeLength:this._measurementArrowStripeLength}},e=>this._updateGeometryAndViewMode(e),_),p(()=>({visible:this.visible,viewMode:this.viewMode}),e=>this._updateVisualElementVisibility(e),_),p(()=>({text:this._labelsText,visualizedMeasurement:this.actualVisualizedMeasurement}),e=>this._updateLabelText(e),_),p(()=>({visible:this.visible,viewMode:this.viewMode}),e=>this._updateLabelVisibility(e),_),p(()=>this._measurementArrowStripeLength,e=>this._updateSegmentStripeLength(e),_),T(async()=>this._updateMessageBundle()),p(()=>this._parameters,({textBackgroundColor:e,textCalloutColor:t,textColor:i,translucentAccentColor:s,accentColor:n,contrastColor:o})=>{const{_segmentLabel:l,_verticalLabel:r,_horizontalLabel:a,_triangleVisualElement:c,_rightAngleQuad:h,_projectedGeodesicLine:u,_geodesicStartHint:d,_geodesicEndHint:m,_segmentVisualElement:g}=this;l.backgroundColor=e,l.calloutColor=t,l.textColor=i,r.backgroundColor=e,r.calloutColor=t,r.textColor=i,a.backgroundColor=e,a.calloutColor=t,a.textColor=i,c.color=s,h.color=s,u.color=s,d.color=s,m.color=s,g.color=n,g.contrastColor=o},v)]),this._updateMessageBundle()}destroy(){this._segmentVisualElement=a(this._segmentVisualElement),this._triangleVisualElement=a(this._triangleVisualElement),this._rightAngleQuad=a(this._rightAngleQuad),this._projectedGeodesicLine=a(this._projectedGeodesicLine),this._geodesicStartHint=a(this._geodesicStartHint),this._geodesicEndHint=a(this._geodesicEndHint),this._segmentLabel=a(this._segmentLabel),this._verticalLabel=a(this._verticalLabel),this._horizontalLabel=a(this._horizontalLabel),this.set("view",null)}_updateVisualElementVisibility({visible:e,viewMode:t}){if(this._segmentVisualElement.visible=!1,this._triangleVisualElement.visible=!1,this._rightAngleQuad.visible=!1,this._projectedGeodesicLine.visible=!1,this._geodesicStartHint.visible=!1,this._geodesicEndHint.visible=!1,e)switch(t){case 0:break;case 1:this._segmentVisualElement.visible=!0;break;case 2:this._segmentVisualElement.visible=!0,this._triangleVisualElement.visible=!0,this._rightAngleQuad.visible=!0;break;case 3:this._segmentVisualElement.visible=!0,this._projectedGeodesicLine.visible=!0,this._geodesicStartHint.visible=!0,this._geodesicEndHint.visible=!0}}_updateGeometryAndViewMode({view:e,camera:t,viewMode:i,elevationAlignedStartPoint:s,elevationAlignedEndPoint:n,orientation:o,visualizedMeasurement:l,stripeLength:r}){const a=e.renderCoordsHelper;if(null==a||null==s||null==n||s.equals(n))return;let c=this._startPosition,h=this._endPosition;a.toRenderCoords(s,c),a.toRenderCoords(n,h);const u=1===o?1:-1,d=u*(a.getAltitude(h)-a.getAltitude(c));d<0&&(c=this._endPosition,h=this._startPosition);const m="geodesic"===l?new D(this._startPosition,this._endPosition,a.spatialReference):new G(this._startPosition,this._endPosition);switch(this._segmentVisualElement.geometry=m,this._updateSegmentStripeLength(r),i){case 1:this._updateSegment(m,o);break;case 2:this._updateSegmentAndTriangle({view:e,camera:t,segment:m,orientation:o,startPosition:c,endPosition:h,deltaSign:u,altitudeDelta:d});break;case 3:this._updateSegmentAndProjection({view:e,orientation:o,startPosition:c,endPosition:h})}}_updateSegment(e,t){this._segmentLabel.anchor=1===t?"top":"bottom",this._segmentLabel.geometry={type:"segment",segment:e,sampleLocation:"center"}}_updateSegmentAndTriangle({view:{renderCoordsHelper:e},camera:t,segment:i,orientation:s,startPosition:n,endPosition:o,deltaSign:l,altitudeDelta:r}){const a=this._cornerPosition;e.worldUpAtPosition(n,a),V(a,a,l*Math.abs(r)),z(a,a,n),this._triangleVisualElement.geometry=[[[n[0],n[1],n[2]],[a[0],a[1],a[2]],[o[0],o[1],o[2]]]],this._rightAngleQuad.geometry={previous:n,center:a,next:o};const c=new G(n,a),h=new G(a,o),u=F(n,o,a,s,t);this._segmentLabel.anchor=u.segment,this._segmentLabel.geometry={type:"segment",segment:i,sampleLocation:"center"},this._verticalLabel.geometry={type:"segment",segment:c,sampleLocation:"center"},this._verticalLabel.anchor=u.vertical,this._horizontalLabel.geometry={type:"segment",segment:h,sampleLocation:"center"},this._horizontalLabel.anchor=u.horizontal}_updateSegmentAndProjection({view:{renderCoordsHelper:e},orientation:t,startPosition:i,endPosition:s}){e.setAltitude(this._startPositionAtSeaLevel,0,i),e.setAltitude(this._endPositionAtSeaLevel,0,s);const n=new D(this._startPositionAtSeaLevel,this._endPositionAtSeaLevel,e.spatialReference);this._projectedGeodesicLine.setGeometryFromSegment(n),this._geodesicStartHint.setGeometryFromSegment(new G(this._startPositionAtSeaLevel,i)),this._geodesicEndHint.setGeometryFromSegment(new G(this._endPositionAtSeaLevel,s)),this._segmentLabel.geometry={type:"segment",segment:n,sampleLocation:"center"},this._segmentLabel.anchor=1===t?"top":"bottom"}_updateLabelText({text:e,visualizedMeasurement:t}){null!=e?(this._segmentLabel.text="euclidean"===t?e.directDistance:e.horizontalDistance,this._horizontalLabel.text=e.horizontalDistance,this._verticalLabel.text=e.verticalDistance):(this._segmentLabel.text=null,this._horizontalLabel.text=null,this._verticalLabel.text=null),this.notifyChange("labels")}_updateLabelVisibility({visible:e,viewMode:t}){const i=this._segmentLabel,s=this._horizontalLabel,n=this._verticalLabel;if(i.visible=!1,s.visible=!1,n.visible=!1,e)switch(t){case 1:case 3:i.visible=!0;break;case 2:i.visible=!0,s.visible=!0,n.visible=!0}}get _labelsText(){if(this.destroyed)return null;const e=this.messages,t=this.analysisView.result;if(null==t||null==e)return null;const{directDistance:i,horizontalDistance:s,verticalDistance:n}=t,o=this.analysisView.unit,l=e=>({directDistance:"",horizontalDistance:"",verticalDistance:"",...e});switch(o){case"metric":return l({directDistance:i&&m(e,i),horizontalDistance:s&&m(e,s),verticalDistance:n&&d(e,n)});case"imperial":return l({directDistance:i&&u(e,i),horizontalDistance:s&&u(e,s),verticalDistance:n&&h(e,n)});default:return l({directDistance:i&&c(e,i,o),horizontalDistance:s&&c(e,s,o),verticalDistance:n&&c(e,n,o)})}}_updateSegmentStripeLength(e){const t=this._segmentVisualElement;null!=e?(t.stripeLength=e,t.stripesEnabled=!0):t.stripesEnabled=!1}get _actualVisualElementsOrientation(){if(null!=this._triangleOrientationOverride)return this._triangleOrientationOverride;const e=this.visualElementOrientation;return 0===e?this.view.state.camera.aboveGround?1:2:e}_requiresGeodesicGuideAt(e){const t=this.view;if(!t?.state)return!1;const i=t.state.camera,s=t.renderCoordsHelper;if(!s)return!1;const n=i.computeScreenPixelSizeAt(e);return s.getAltitude(e)/n>=10}get _measurementArrowStripeLength(){const{result:e,unit:t}=this.analysisView;if(null==e)return null;let i=null;const s=e.directDistance;switch(t){case"metric":i=s&&g(s,"meters");break;case"imperial":i=s&&g(s,w(s.value,s.unit));break;default:i=s&&g(s,t)}if(null==i)return null;return l(i.value/30)*y(1,i.unit,"meters")}_updateMessageBundle(){this.loadingMessages=!0,U("esri/core/t9n/Units").then(e=>{this.messages=e}).finally(()=>{this.loadingMessages=!1})}get testData(){}};function F(e,t,i,s,n){const o=q,l=W;n.projectToRenderScreen(i,o),n.projectToRenderScreen(t,l);const r={segment:"bottom",horizontal:"top",vertical:o[0]<l[0]?"left":"right"};{const s=B,o=I;if(P(e,i,n,s),P(e,t,n,o),E(s,o)>=Q){const e=Math.sign(s[1])===Math.sign(o[1]);r.segment=e?M(r.vertical):r.vertical}else{const e=J;P(i,t,n,e),E(e,o)>=Q&&(r.segment=Math.sign(e[0])===Math.sign(o[0])?M(r.horizontal):r.horizontal)}}if(2===s){const e=e=>"top"===e?"bottom":"top";r.segment=e(r.segment),r.horizontal=e(r.horizontal),r.vertical=e(r.vertical)}return r}e([S()],R.prototype,"_parameters",null),e([S()],R.prototype,"_triangleOrientationOverride",void 0),e([S()],R.prototype,"messages",void 0),e([S()],R.prototype,"view",void 0),e([S()],R.prototype,"analysis",void 0),e([S()],R.prototype,"analysisView",void 0),e([S()],R.prototype,"loadingMessages",void 0),e([S()],R.prototype,"visible",null),e([S()],R.prototype,"viewMode",null),e([S()],R.prototype,"actualVisualizedMeasurement",null),e([S()],R.prototype,"visualElementOrientation",void 0),e([S()],R.prototype,"triangleCollapseRatioThreshold",void 0),e([S()],R.prototype,"allowVisualElementsOrientationChange",null),e([S()],R.prototype,"labels",null),e([S()],R.prototype,"_labelsText",null),e([S()],R.prototype,"_actualVisualElementsOrientation",null),e([S()],R.prototype,"_measurementArrowStripeLength",null),R=e([f("esri.views.3d.analysis.DirectLineMeasurement.DirectLineMeasurementVisualization")],R);const Q=Math.cos(r(12)),q=b(),W=b(),B=L(),I=L(),J=L();export{R as DirectLineMeasurementVisualization};
5
+ import{__decorate as e}from"tslib";import"../../../../intl.js";import t from"../../../../core/Accessor.js";import{unitRGBAFromColor as i,multiplyOpacityToUnitRGBA as s,getContrast as n,multiplyOpacity as o}from"../../../../core/colorUtils.js";import"../../../../core/has.js";import{nextHighestPowerOfTen as l,deg2rad as r}from"../../../../core/mathUtils.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{formatDecimal as c,formatImperialVerticalLength as h,formatImperialLength as u,formatMetricVerticalLength as d,formatMetricLength as m}from"../../../../core/quantityFormatUtils.js";import{toUnit as g}from"../../../../core/quantityUtils.js";import{watch as p,syncAndInitial as _,initial as v}from"../../../../core/reactiveUtils.js";import{createRenderScreenPointArray3 as b,createRenderScreenPointArray as L}from"../../../../core/screenUtils.js";import{adaptiveImperialLengthUnit as w,convertUnit as y}from"../../../../core/unitUtils.js";import{property as S}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{dot as E}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as V,f as z}from"../../../../chunks/vec32.js";import{create as A}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{renderScreenSpaceTangent as P}from"../../interactive/support/viewUtils.js";import{LabelVisualElement as j,mirrorPosition as M}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as C}from"../../interactive/visualElements/LineVisualElement.js";import{MeasurementArrowVisualElement as O}from"../../interactive/visualElements/MeasurementArrowVisualElement.js";import{RightAngleQuadVisualElement as x}from"../../interactive/visualElements/RightAngleQuadVisualElement.js";import{GeodesicSegment as D,EuclideanSegment as G}from"../../interactive/visualElements/support/Segment.js";import{createStipplePatternSimple as H}from"../../webgl-engine/materials/lineStippleUtils.js";import{geodesicDistanceThreshold as k}from"../../../support/geodesicMeasurementUtils.js";import{onLocaleChange as T}from"../../../../intl/locale.js";import{fetchMessageBundle as U}from"../../../../intl/messages.js";let R=class extends t{get _parameters(){const e=this.view.effectiveTheme,{accentColor:t,textColor:l}=e,r=i(t),a=s(t,.75),c=i(n(t)),h=n(l,160);return{accentColor:r,contrastColor:c,translucentAccentColor:a,triangleLineWidth:3,geodesicProjectionLineWidth:2,guideLineWidth:2,guideStippleLengthPixels:3,directLabelFontSize:16,horizontalLabelFontSize:12,verticalLabelFontSize:12,textColor:l,textBackgroundColor:o(h,.6),textCalloutColor:o(h,.5)}}get visible(){return this.analysisView.visible}get viewMode(){const{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t}=this.analysisView;if(null==e||null==t||e.equals(t))return 0;const i=this.analysisView.result;if(null==i)return 1;if("geodesic"===this.actualVisualizedMeasurement)return this._requiresGeodesicGuideAt(this._startPosition)||this._requiresGeodesicGuideAt(this._endPosition)?3:1;const{verticalDistance:s,horizontalDistance:n}=i,o=g(s,"meters").value,l=g(n,"meters").value;return Math.min(o/l,l/o)<this.triangleCollapseRatioThreshold?1:2}get actualVisualizedMeasurement(){const{measurementMode:e,result:t}=this.analysisView;switch(e){case 0:return null!=t&&g(t.horizontalDistance,"meters").value>k?"geodesic":"euclidean";case 1:return"euclidean";case 2:return"geodesic"}}get allowVisualElementsOrientationChange(){return null==this._triangleOrientationOverride}set allowVisualElementsOrientationChange(e){null==this._triangleOrientationOverride!==e&&(null==this._triangleOrientationOverride?this._triangleOrientationOverride=this._actualVisualElementsOrientation:this._triangleOrientationOverride=null)}get labels(){return"geodesic"===this.actualVisualizedMeasurement?{direct:null,horizontal:this._segmentLabel,vertical:this._verticalLabel}:{direct:this._segmentLabel,horizontal:this._horizontalLabel,vertical:this._verticalLabel}}constructor(e){super(e),this._segmentVisualElement=null,this._triangleVisualElement=null,this._rightAngleQuad=null,this._projectedGeodesicLine=null,this._geodesicStartHint=null,this._geodesicEndHint=null,this._segmentLabel=null,this._verticalLabel=null,this._horizontalLabel=null,this._startPosition=A(),this._endPosition=A(),this._cornerPosition=A(),this._startPositionAtSeaLevel=A(),this._endPositionAtSeaLevel=A(),this._triangleOrientationOverride=null,this.messages=null,this.loadingMessages=!0,this.visualElementOrientation=0,this.triangleCollapseRatioThreshold=.03}initialize(){const e={attached:!0,view:this.view,isDecoration:!0},{guideLineWidth:t,guideStippleLengthPixels:i,triangleLineWidth:s,geodesicProjectionLineWidth:n,directLabelFontSize:o,verticalLabelFontSize:l,horizontalLabelFontSize:r}=this._parameters;this._segmentVisualElement=new O({...e,geometry:null,renderOccluded:4}),this._triangleVisualElement=new C({...e,width:s,renderOccluded:4}),this._rightAngleQuad=new x({...e,renderOccluded:4});const a={...e,polygonOffset:!0,renderOccluded:4};this._projectedGeodesicLine=new C({...a,width:n,stipplePattern:H(i)}),this._geodesicStartHint=new C({...a,width:t,stipplePattern:H(i)}),this._geodesicEndHint=new C({...a,width:t,stipplePattern:H(i)}),this._segmentLabel=new j({...e,fontSize:o}),this._verticalLabel=new j({...e,fontSize:l}),this._horizontalLabel=new j({...e,fontSize:r}),this.addHandles([p(()=>{const{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t}=this.analysisView,i=this.view;return{view:i,camera:i.state.camera,viewMode:this.viewMode,elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,orientation:this._actualVisualElementsOrientation,visualizedMeasurement:this.actualVisualizedMeasurement,stripeLength:this._measurementArrowStripeLength}},e=>this._updateGeometryAndViewMode(e),_),p(()=>({visible:this.visible,viewMode:this.viewMode}),e=>this._updateVisualElementVisibility(e),_),p(()=>({text:this._labelsText,visualizedMeasurement:this.actualVisualizedMeasurement}),e=>this._updateLabelText(e),_),p(()=>({visible:this.visible,viewMode:this.viewMode}),e=>this._updateLabelVisibility(e),_),p(()=>this._measurementArrowStripeLength,e=>this._updateSegmentStripeLength(e),_),T(()=>this._updateMessageBundle()),p(()=>this._parameters,({textBackgroundColor:e,textCalloutColor:t,textColor:i,translucentAccentColor:s,accentColor:n,contrastColor:o})=>{const{_segmentLabel:l,_verticalLabel:r,_horizontalLabel:a,_triangleVisualElement:c,_rightAngleQuad:h,_projectedGeodesicLine:u,_geodesicStartHint:d,_geodesicEndHint:m,_segmentVisualElement:g}=this;l.backgroundColor=e,l.calloutColor=t,l.textColor=i,r.backgroundColor=e,r.calloutColor=t,r.textColor=i,a.backgroundColor=e,a.calloutColor=t,a.textColor=i,c.color=s,h.color=s,u.color=s,d.color=s,m.color=s,g.color=n,g.contrastColor=o},v)]),this._updateMessageBundle()}destroy(){this._segmentVisualElement=a(this._segmentVisualElement),this._triangleVisualElement=a(this._triangleVisualElement),this._rightAngleQuad=a(this._rightAngleQuad),this._projectedGeodesicLine=a(this._projectedGeodesicLine),this._geodesicStartHint=a(this._geodesicStartHint),this._geodesicEndHint=a(this._geodesicEndHint),this._segmentLabel=a(this._segmentLabel),this._verticalLabel=a(this._verticalLabel),this._horizontalLabel=a(this._horizontalLabel),this.set("view",null)}_updateVisualElementVisibility({visible:e,viewMode:t}){if(this._segmentVisualElement.visible=!1,this._triangleVisualElement.visible=!1,this._rightAngleQuad.visible=!1,this._projectedGeodesicLine.visible=!1,this._geodesicStartHint.visible=!1,this._geodesicEndHint.visible=!1,e)switch(t){case 0:break;case 1:this._segmentVisualElement.visible=!0;break;case 2:this._segmentVisualElement.visible=!0,this._triangleVisualElement.visible=!0,this._rightAngleQuad.visible=!0;break;case 3:this._segmentVisualElement.visible=!0,this._projectedGeodesicLine.visible=!0,this._geodesicStartHint.visible=!0,this._geodesicEndHint.visible=!0}}_updateGeometryAndViewMode({view:e,camera:t,viewMode:i,elevationAlignedStartPoint:s,elevationAlignedEndPoint:n,orientation:o,visualizedMeasurement:l,stripeLength:r}){const a=e.renderCoordsHelper;if(null==a||null==s||null==n||s.equals(n))return;let c=this._startPosition,h=this._endPosition;a.toRenderCoords(s,c),a.toRenderCoords(n,h);const u=1===o?1:-1,d=u*(a.getAltitude(h)-a.getAltitude(c));d<0&&(c=this._endPosition,h=this._startPosition);const m="geodesic"===l?new D(this._startPosition,this._endPosition,a.spatialReference):new G(this._startPosition,this._endPosition);switch(this._segmentVisualElement.geometry=m,this._updateSegmentStripeLength(r),i){case 1:this._updateSegment(m,o);break;case 2:this._updateSegmentAndTriangle({view:e,camera:t,segment:m,orientation:o,startPosition:c,endPosition:h,deltaSign:u,altitudeDelta:d});break;case 3:this._updateSegmentAndProjection({view:e,orientation:o,startPosition:c,endPosition:h})}}_updateSegment(e,t){this._segmentLabel.anchor=1===t?"top":"bottom",this._segmentLabel.geometry={type:"segment",segment:e,sampleLocation:"center"}}_updateSegmentAndTriangle({view:{renderCoordsHelper:e},camera:t,segment:i,orientation:s,startPosition:n,endPosition:o,deltaSign:l,altitudeDelta:r}){const a=this._cornerPosition;e.worldUpAtPosition(n,a),V(a,a,l*Math.abs(r)),z(a,a,n),this._triangleVisualElement.geometry=[[[n[0],n[1],n[2]],[a[0],a[1],a[2]],[o[0],o[1],o[2]]]],this._rightAngleQuad.geometry={previous:n,center:a,next:o};const c=new G(n,a),h=new G(a,o),u=F(n,o,a,s,t);this._segmentLabel.anchor=u.segment,this._segmentLabel.geometry={type:"segment",segment:i,sampleLocation:"center"},this._verticalLabel.geometry={type:"segment",segment:c,sampleLocation:"center"},this._verticalLabel.anchor=u.vertical,this._horizontalLabel.geometry={type:"segment",segment:h,sampleLocation:"center"},this._horizontalLabel.anchor=u.horizontal}_updateSegmentAndProjection({view:{renderCoordsHelper:e},orientation:t,startPosition:i,endPosition:s}){e.setAltitude(this._startPositionAtSeaLevel,0,i),e.setAltitude(this._endPositionAtSeaLevel,0,s);const n=new D(this._startPositionAtSeaLevel,this._endPositionAtSeaLevel,e.spatialReference);this._projectedGeodesicLine.setGeometryFromSegment(n),this._geodesicStartHint.setGeometryFromSegment(new G(this._startPositionAtSeaLevel,i)),this._geodesicEndHint.setGeometryFromSegment(new G(this._endPositionAtSeaLevel,s)),this._segmentLabel.geometry={type:"segment",segment:n,sampleLocation:"center"},this._segmentLabel.anchor=1===t?"top":"bottom"}_updateLabelText({text:e,visualizedMeasurement:t}){null!=e?(this._segmentLabel.text="euclidean"===t?e.directDistance:e.horizontalDistance,this._horizontalLabel.text=e.horizontalDistance,this._verticalLabel.text=e.verticalDistance):(this._segmentLabel.text=null,this._horizontalLabel.text=null,this._verticalLabel.text=null),this.notifyChange("labels")}_updateLabelVisibility({visible:e,viewMode:t}){const i=this._segmentLabel,s=this._horizontalLabel,n=this._verticalLabel;if(i.visible=!1,s.visible=!1,n.visible=!1,e)switch(t){case 1:case 3:i.visible=!0;break;case 2:i.visible=!0,s.visible=!0,n.visible=!0}}get _labelsText(){if(this.destroyed)return null;const e=this.messages,t=this.analysisView.result;if(null==t||null==e)return null;const{directDistance:i,horizontalDistance:s,verticalDistance:n}=t,o=this.analysisView.unit,l=e=>({directDistance:"",horizontalDistance:"",verticalDistance:"",...e});switch(o){case"metric":return l({directDistance:i&&m(e,i),horizontalDistance:s&&m(e,s),verticalDistance:n&&d(e,n)});case"imperial":return l({directDistance:i&&u(e,i),horizontalDistance:s&&u(e,s),verticalDistance:n&&h(e,n)});default:return l({directDistance:i&&c(e,i,o),horizontalDistance:s&&c(e,s,o),verticalDistance:n&&c(e,n,o)})}}_updateSegmentStripeLength(e){const t=this._segmentVisualElement;null!=e?(t.stripeLength=e,t.stripesEnabled=!0):t.stripesEnabled=!1}get _actualVisualElementsOrientation(){if(null!=this._triangleOrientationOverride)return this._triangleOrientationOverride;const e=this.visualElementOrientation;return 0===e?this.view.state.camera.aboveGround?1:2:e}_requiresGeodesicGuideAt(e){const t=this.view;if(!t?.state)return!1;const i=t.state.camera,s=t.renderCoordsHelper;if(!s)return!1;const n=i.computeScreenPixelSizeAt(e);return s.getAltitude(e)/n>=10}get _measurementArrowStripeLength(){const{result:e,unit:t}=this.analysisView;if(null==e)return null;let i=null;const s=e.directDistance;switch(t){case"metric":i=s&&g(s,"meters");break;case"imperial":i=s&&g(s,w(s.value,s.unit));break;default:i=s&&g(s,t)}if(null==i)return null;return l(i.value/30)*y(1,i.unit,"meters")}_updateMessageBundle(){this.loadingMessages=!0,U("esri/core/t9n/Units").then(e=>{this.messages=e}).finally(()=>{this.loadingMessages=!1})}get testData(){}};function F(e,t,i,s,n){const o=q,l=W;n.projectToRenderScreen(i,o),n.projectToRenderScreen(t,l);const r={segment:"bottom",horizontal:"top",vertical:o[0]<l[0]?"left":"right"};{const s=B,o=I;if(P(e,i,n,s),P(e,t,n,o),E(s,o)>=Q){const e=Math.sign(s[1])===Math.sign(o[1]);r.segment=e?M(r.vertical):r.vertical}else{const e=J;P(i,t,n,e),E(e,o)>=Q&&(r.segment=Math.sign(e[0])===Math.sign(o[0])?M(r.horizontal):r.horizontal)}}if(2===s){const e=e=>"top"===e?"bottom":"top";r.segment=e(r.segment),r.horizontal=e(r.horizontal),r.vertical=e(r.vertical)}return r}e([S()],R.prototype,"_parameters",null),e([S()],R.prototype,"_triangleOrientationOverride",void 0),e([S()],R.prototype,"messages",void 0),e([S()],R.prototype,"view",void 0),e([S()],R.prototype,"analysis",void 0),e([S()],R.prototype,"analysisView",void 0),e([S()],R.prototype,"loadingMessages",void 0),e([S()],R.prototype,"visible",null),e([S()],R.prototype,"viewMode",null),e([S()],R.prototype,"actualVisualizedMeasurement",null),e([S()],R.prototype,"visualElementOrientation",void 0),e([S()],R.prototype,"triangleCollapseRatioThreshold",void 0),e([S()],R.prototype,"allowVisualElementsOrientationChange",null),e([S()],R.prototype,"labels",null),e([S()],R.prototype,"_labelsText",null),e([S()],R.prototype,"_actualVisualElementsOrientation",null),e([S()],R.prototype,"_measurementArrowStripeLength",null),R=e([f("esri.views.3d.analysis.DirectLineMeasurement.DirectLineMeasurementVisualization")],R);const Q=Math.cos(r(12)),q=b(),W=b(),B=L(),I=L(),J=L();export{R as DirectLineMeasurementVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getObjectId as u}from"../../../layers/graphics/dehydratedFeatures.js";import{FeatureLikeLayerView3D as n}from"./FeatureLikeLayerView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import{FeatureGraphics3DGraphicsPipeline as l}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as m}from"../support/updatingProperties.js";import{FeatureLayerView as c}from"../../layers/FeatureLayerView.js";import d from"../../layers/LayerView.js";import{RefreshableLayerView as h}from"../../layers/RefreshableLayerView.js";let y=class extends(h(n(c(p(d))))){constructor(e){super(e)}initialize(){this.addHandles(i(()=>this._updatingRequiredPromise,e=>this._updatingHandles.addPromise(e),s))}destroy(){this._updatingHandles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(e){this.graphicsPipeline.maximumNumberOfFeatures=e}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??0}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){this.graphicsPipeline?.setVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}async createGraphicsPipeline(){if(has("feature-pipeline-3d-test")){const{Feature3DPipeline:e}=await import("./graphics/pipeline/Feature3DPipeline.js");return new e({layerView:this})}return new l({layerView:this})}async doRefresh(e){return await this.graphicsPipeline.doRefresh(e)}_popupFeatureHasRequiredFields(e,r){if(!super._popupFeatureHasRequiredFields(e,r))return!1;const t=u(e,this.layer.objectIdField);if(null==t)return!0;const i=this.graphicsPipeline.getMissingAttributesForFeature(t);if(null==i)return!0;for(const s of r)if(i.has(s))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(e,r){await this._validateQueryFeaturesMesh(e);const t=await r(),i=this.graphicsPipeline;if(e?.outStatistics||null==i)return t;const s=this.layer.objectIdField,a=[];for(const o of t.features)if(o.geometry){const e=i.getHydratedGeometry(o.attributes[s]);e&&(o.geometry=e,a.push(o))}else a.push(o);return t.features=a,t}async _validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},i=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of i)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),null==e.outSpatialReference||e.outSpatialReference.equals(this.view.spatialReference)||t("outSpatialReference")}get test(){}};e([a()],y.prototype,"layer",void 0),e([a()],y.prototype,"graphicsPipeline",void 0),e([a()],y.prototype,"maximumNumberOfFeatures",null),e([a()],y.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(m)],y.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],y.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],y.prototype,"updatePolicy",null),e([a({readOnly:!0})],y.prototype,"hasZ",null),e([a({readOnly:!0})],y.prototype,"hasM",null),y=e([o("esri.views.3d.layers.FeatureLayerViewBase3D")],y);export{y as default};
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getObjectId as u}from"../../../layers/graphics/dehydratedFeatures.js";import{FeatureLikeLayerView3D as n}from"./FeatureLikeLayerView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import{FeatureGraphics3DGraphicsPipeline as l}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as m}from"../support/updatingProperties.js";import{FeatureLayerView as c}from"../../layers/FeatureLayerView.js";import d from"../../layers/LayerView.js";import{RefreshableLayerView as h}from"../../layers/RefreshableLayerView.js";let y=class extends(h(n(c(p(d))))){constructor(e){super(e)}initialize(){this.addHandles(i(()=>this._updatingRequiredPromise,e=>this._updatingHandles.addPromise(e),s))}destroy(){this._updatingHandles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(e){this.graphicsPipeline.maximumNumberOfFeatures=e}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??0}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){this.graphicsPipeline?.setVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}async createGraphicsPipeline(){if(has("feature-pipeline-3d-test")){const{Feature3DPipeline:e}=await import("./graphics/pipeline/Feature3DPipeline.js");return new e({layerView:this})}return new l({layerView:this})}async doRefresh(e){return await this.graphicsPipeline.doRefresh(e)}_popupFeatureHasRequiredFields(e,r){if(!super._popupFeatureHasRequiredFields(e,r))return!1;const t=u(e,this.layer.objectIdField);if(null==t)return!0;const i=this.graphicsPipeline.getMissingAttributesForFeature(t);if(null==i)return!0;for(const s of r)if(i.has(s))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(e,r){this._validateQueryFeaturesMesh(e);const t=await r(),i=this.graphicsPipeline;if(e?.outStatistics||null==i)return t;const s=this.layer.objectIdField,a=[];for(const o of t.features)if(o.geometry){const e=i.getHydratedGeometry(o.attributes[s]);e&&(o.geometry=e,a.push(o))}else a.push(o);return t.features=a,t}_validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},i=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of i)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),null==e.outSpatialReference||e.outSpatialReference.equals(this.view.spatialReference)||t("outSpatialReference")}get test(){}};e([a()],y.prototype,"layer",void 0),e([a()],y.prototype,"graphicsPipeline",void 0),e([a()],y.prototype,"maximumNumberOfFeatures",null),e([a()],y.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(m)],y.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],y.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],y.prototype,"updatePolicy",null),e([a({readOnly:!0})],y.prototype,"hasZ",null),e([a({readOnly:!0})],y.prototype,"hasM",null),y=e([o("esri.views.3d.layers.FeatureLayerViewBase3D")],y);export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{result as e,assertResult as t}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{clone as r}from"../../../../core/lang.js";import{throwIfAbortError as i}from"../../../../core/promiseUtils.js";import{makeAbsolute as o}from"../../../../core/urlUtils.js";import{readBinaryAttribute as n,createGeometryDescriptor as s}from"./I3SBinaryReader.js";import{getMaterialAndTextures as a,getMaterialAndTexturesFromShared as u,selectEncoding as l}from"./I3SMaterialUtil.js";class f{constructor(e,t,r,i,o,n){if(this._streamDataController=t,this._logger=r,this._defaultGeometrySchema=i,this._requiredAttributes=o,this._options=n,this._logLayer=e,this._layerUrl=e.parsedUrl.path,this._geometryDefinitions=e.geometryDefinitions,e.materialDefinitions){const t=e.textureSetDefinitions;this._materialAndTextures=e.materialDefinitions.map(r=>a(t,r,"integrated-mesh"===e.type))}}_load(e,t,r){return this._streamDataController.request(e,t,r)}_loadAttribute(e,t,r){const i=`${this._layerUrl}/nodes/${e.resources.attributes}/attributes/${t.key}/0`;return this._load(i,1,r).then(e=>n(t,e))}async loadAttributes(e,t,r){const o=await Promise.allSettled(t.map(t=>this._loadAttribute(e,t.attributeStorageInfo,r))),n={};for(let s=0;s<t.length;++s){const r=o[s],a=t[s];if("fulfilled"===r.status){const e=r.value;n[a.name]=e}else{const t=r.reason;i(t),this._logger.error("#loadAttributes",this._logLayer,`Failed to load attributeData for '${a.name}' on node '${e.id}'`,t)}}return n}async loadNodeData(r,i){const o=null!=this._requiredAttributes&&r.resources.attributes?e(this.loadAttributes(r,this._requiredAttributes,i)):null,{bufferDefinition:n,bufferIndex:a}=g(this._geometryDefinitions,r),l=!!r.resources.geometry,f=l?e(this._loadGeometry(r.resources.geometry,a,i)):null,_=r.resources.hasSharedResource?await this._loadShared(r,i):null,y=r.resources.materialDefinition,D=this._materialAndTextures&&null!=y&&y>=0?this._materialAndTextures[y]:null!=_?u(_):null,b=D?.material,x=D?.textures??[],p=`${r.id}`,A=!l&&this._options.loadFeatureData,$=A?await this._loadFeatureData(p,i):null,T=A?c($):d(b),w=null==T?m($):null,I=x.length>0?e(this.loadTextures(r,x,i)):null;let U=null,j=null;if(f){U=t(await f);const e=h(this._defaultGeometrySchema,_);j=s(n,e)}const S=I?t(await I):null,q=o?t(await o):{},P=q?{attributeData:q,loadedAttributes:this._requiredAttributes}:null;if(null!=T)return{geometryData:T,attributeDataInfo:P,geometryBuffer:U,geometryDescriptor:j,requiredTextures:x,textureData:S};if(null!=w)return{pointData:w,attributeDataInfo:P,geometryBuffer:U,geometryDescriptor:j,requiredTextures:x,textureData:S};throw new Error}static _addAbsoluteHrefTexture(e,t){const r=e.textureDefinitions;if(null!=r)for(const i of Object.keys(r))for(const e of r[i].images)Array.isArray(e.href)?e.hrefConcat=e.href.map(e=>o(e,t)):e.hrefConcat=o(e.href,t)}static _fixTextureEncodings(e){const t=e.textureDefinitions;if(null!=t)for(const r in t){const e=t[r];if(Array.isArray(e.encoding))for(let t=0;t<e.encoding.length;t++){const r=e.encoding[t];"data:"===r.slice(0,5)&&(e.encoding[t]=r.slice(5))}else{const t=e.encoding;"data:"===t.slice(0,5)&&(e.encoding=t.slice(5))}}}async _loadShared(e,t){if(null==e.resources.geometry)return{};const r=`${this._layerUrl}/nodes/${e.resources.geometry}/shared`,i=await this._load(r,0,t);return f._fixTextureEncodings(i),f._addAbsoluteHrefTexture(i,r),i}_loadTexture(e,t,r,i,o){return 4===i||1===i||2===i?this._load(e,1,o).then(e=>({id:t,usage:r,data:e,encoding:i})):this._load(e,2,o).then(e=>({id:t,usage:r,data:e,encoding:i}))}loadTextures(e,t,r){const i=this._options.textureUsageMask;return Promise.all(t.map(t=>{if(0===(t.usage&i))return null;const o=l(t.encodings,this._options.textureEncodings);if(null==o)return this._logger.error("#loadTextures",this._logLayer,`No known encoding for texture found on node ${e.id}`),Promise.reject();const n=e.resources.texture||e.id,s=`${this._layerUrl}/nodes/${n}/textures/${o.name}`;return this._loadTexture(s,t.id,t.usage,o.encoding,r)}))}_loadFeatureData(e,t){const r=`${this._layerUrl}/nodes/${e}/features/0`;return this._load(r,0,t)}_loadGeometry(e,t,r){const i=`${this._layerUrl}/nodes/${e}/geometries/${t}`;return this._load(i,1,r)}}function d(e){return{featureIds:[],geometries:[{type:"ArrayBufferView",params:{material:e}}],featureDataPosition:[0,0,0]}}function c(e){if(!e)return null;for(const t of e.featureData){const e=t.geometries;if(null!=e)for(const r of e)return{featureIds:[t.id],featureDataPosition:t.position,geometries:[r]}}return null}function m(e){if(!e)return null;const t=new Array;for(const r of e.featureData)null!=r.position&&t.push({featureIds:[r.id],featureDataPosition:r.position,geometries:[]});return t}function h(e,t){if(!e||!t?.materialDefinitions)return e;const i=Object.keys(t.materialDefinitions)[0];return!t.materialDefinitions[i].params.vertexRegions&&e.vertexAttributes.region&&delete(e=r(e)).vertexAttributes.region,e}function g(e,t){const r={bufferDefinition:null,bufferIndex:0},i=t.resources.geometryDefinition;if(null==e||null==i||i<0)return r;const o=i>=0?e[i].geometryBuffers:null;if(null==o)return r;for(let n=0;n<o.length;n++){const e=o[n];if(null==e.compressedAttributes)r.bufferIndex=n,r.bufferDefinition=o[n];else if("draco"===e.compressedAttributes.encoding&&!has("disable-feature:i3s-draco"))return r.bufferIndex=n,r.bufferDefinition=e,r}return r}export{f as default};
5
+ import{result as e,assertResult as t}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{clone as r}from"../../../../core/lang.js";import{throwIfAbortError as i}from"../../../../core/promiseUtils.js";import{makeAbsolute as o}from"../../../../core/urlUtils.js";import{readBinaryAttribute as s,createGeometryDescriptor as n}from"./I3SBinaryReader.js";import{getMaterialAndTextures as a,getMaterialAndTexturesFromShared as u,selectEncoding as l}from"./I3SMaterialUtil.js";class f{constructor(e,t,r,i,o,s){if(this._streamDataController=t,this._logger=r,this._defaultGeometrySchema=i,this._requiredAttributes=o,this._options=s,this._logLayer=e,this._layerUrl=e.parsedUrl.path,this._geometryDefinitions=e.geometryDefinitions,e.materialDefinitions){const t=e.textureSetDefinitions;this._materialAndTextures=e.materialDefinitions.map(r=>a(t,r,"integrated-mesh"===e.type))}}_load(e,t,r){return this._streamDataController.request(e,t,r)}_loadAttribute(e,t,r){const i=`${this._layerUrl}/nodes/${e.resources.attributes}/attributes/${t.key}/0`;return this._load(i,1,r).then(e=>s(t,e))}async loadAttributes(e,t,r){const o=await Promise.allSettled(t.map(t=>this._loadAttribute(e,t.attributeStorageInfo,r))),s={};for(let n=0;n<t.length;++n){const r=o[n],a=t[n];if("fulfilled"===r.status){const e=r.value;s[a.name]=e}else{const t=r.reason;i(t),this._logger.error("#loadAttributes",this._logLayer,`Failed to load attributeData for '${a.name}' on node '${e.id}'`,t)}}return s}async loadNodeData(r,i){const o=null!=this._requiredAttributes&&r.resources.attributes?e(this.loadAttributes(r,this._requiredAttributes,i)):null,{bufferDefinition:s,bufferIndex:a}=g(this._geometryDefinitions,r),l=!!r.resources.geometry,f=l?e(this._loadGeometry(r.resources.geometry,a,i)):null,_=r.resources.hasSharedResource?await this._loadShared(r,i):null,y=r.resources.materialDefinition,D=this._materialAndTextures&&null!=y&&y>=0?this._materialAndTextures[y]:null!=_?u(_):null,b=D?.material,x=D?.textures??[],p=`${r.id}`,A=!l&&this._options.loadFeatureData,$=A?await this._loadFeatureData(p,i):null,T=A?c($):d(b),w=null==T?m($):null,I=x.length>0?e(this.loadTextures(r,x,i)):null;let U=null,j=null;if(f){U=t(await f);const e=h(this._defaultGeometrySchema,_);j=n(s,e)}const S=I?t(await I):null,q=o?t(await o):{},P=q?{attributeData:q,loadedAttributes:this._requiredAttributes}:null;if(null!=T)return{geometryData:T,attributeDataInfo:P,geometryBuffer:U,geometryDescriptor:j,requiredTextures:x,textureData:S};if(null!=w)return{pointData:w,attributeDataInfo:P,geometryBuffer:U,geometryDescriptor:j,requiredTextures:x,textureData:S};throw new Error}static _addAbsoluteHrefTexture(e,t){const r=e.textureDefinitions;if(null!=r)for(const i of Object.keys(r))for(const e of r[i].images)Array.isArray(e.href)?e.hrefConcat=e.href.map(e=>o(e,t)):e.hrefConcat=o(e.href,t)}static _fixTextureEncodings(e){const t=e.textureDefinitions;if(null!=t)for(const r in t){const e=t[r];if(Array.isArray(e.encoding))for(let t=0;t<e.encoding.length;t++){const r=e.encoding[t];r.startsWith("data:")&&(e.encoding[t]=r.slice(5))}else{const t=e.encoding;t.startsWith("data:")&&(e.encoding=t.slice(5))}}}async _loadShared(e,t){if(null==e.resources.geometry)return{};const r=`${this._layerUrl}/nodes/${e.resources.geometry}/shared`,i=await this._load(r,0,t);return f._fixTextureEncodings(i),f._addAbsoluteHrefTexture(i,r),i}_loadTexture(e,t,r,i,o){return 4===i||1===i||2===i?this._load(e,1,o).then(e=>({id:t,usage:r,data:e,encoding:i})):this._load(e,2,o).then(e=>({id:t,usage:r,data:e,encoding:i}))}loadTextures(e,t,r){const i=this._options.textureUsageMask;return Promise.all(t.map(t=>{if(0===(t.usage&i))return null;const o=l(t.encodings,this._options.textureEncodings);if(null==o)return this._logger.error("#loadTextures",this._logLayer,`No known encoding for texture found on node ${e.id}`),Promise.reject();const s=e.resources.texture||e.id,n=`${this._layerUrl}/nodes/${s}/textures/${o.name}`;return this._loadTexture(n,t.id,t.usage,o.encoding,r)}))}_loadFeatureData(e,t){const r=`${this._layerUrl}/nodes/${e}/features/0`;return this._load(r,0,t)}_loadGeometry(e,t,r){const i=`${this._layerUrl}/nodes/${e}/geometries/${t}`;return this._load(i,1,r)}}function d(e){return{featureIds:[],geometries:[{type:"ArrayBufferView",params:{material:e}}],featureDataPosition:[0,0,0]}}function c(e){if(!e)return null;for(const t of e.featureData){const e=t.geometries;if(null!=e)for(const r of e)return{featureIds:[t.id],featureDataPosition:t.position,geometries:[r]}}return null}function m(e){if(!e)return null;const t=new Array;for(const r of e.featureData)null!=r.position&&t.push({featureIds:[r.id],featureDataPosition:r.position,geometries:[]});return t}function h(e,t){if(!e||!t?.materialDefinitions)return e;const i=Object.keys(t.materialDefinitions)[0];return!t.materialDefinitions[i].params.vertexRegions&&e.vertexAttributes.region&&delete(e=r(e)).vertexAttributes.region,e}function g(e,t){const r={bufferDefinition:null,bufferIndex:0},i=t.resources.geometryDefinition;if(null==e||null==i||i<0)return r;const o=i>=0?e[i].geometryBuffers:null;if(null==o)return r;for(let s=0;s<o.length;s++){const e=o[s];if(null==e.compressedAttributes)r.bufferIndex=s,r.bufferDefinition=o[s];else if("draco"===e.compressedAttributes.encoding&&!has("disable-feature:i3s-draco"))return r.bufferIndex=s,r.bufferDefinition=e,r}return r}export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Color.js";import has from"../../../core/has.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{MemCachePool as r}from"../../../core/MemCachePool.js";import s from"../../../core/ObjectPool.js";import{watch as n,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{d as c,i as d,e as h}from"../../../chunks/vec32.js";import{ZEROS as u,create as g,fromValues as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as f,ZEROS as p}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as m,set as y}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as b}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as x}from"./OverlayRenderer.js";import{PatchRenderData as T}from"./PatchRenderData.js";import{TerrainAttributesCache as v}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as R}from"./terrainUtils.js";import{TileRenderer as P}from"./TileRenderer.js";import{IteratorPreorder as O,sortTiles as w,compareTiles as S}from"./tileUtils.js";import{componentMinimalSizeForIntersectionData as D,ComponentIntersectionData as B}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{getOverlayContentForOutputTerrain as C}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as j,ConsumesDepth as E,ConsumesNone as q}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as F}from"../webgl-engine/lib/Attribute.js";import{IntersectorResult as A}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as k,MeshIntersectionOptions as M,intersectTriangles as N}from"../webgl-engine/lib/RayIntersections.js";import{getSettings as G}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{terrainId as z,getVerticalOffsetTerrain as U}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as I}from"../webgl-engine/materials/DrawParameters.js";import{T as L}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as V}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as H}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as W}from"../../webgl/enums.js";const Y=7,Q=10,Z=m();let J=class extends j{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return 1===this._stage.viewingMode}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}constructor(e,t,i,n,a,o){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=i,this._ellipsoidRadius=n,this._compressionTracker=a,this.type=2,this.isGround=!0,this._passParameters=new L,this._drawParameters=new I,this._renderDataPool=new s(T),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new O,this._castShadows=!1,this._inViewshed=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.renderOccludedFlags=1,this.produces=new Map([[1,()=>this._produces()&&0===this.transparency],[6,()=>this._produces()&&(1===this.transparency||2===this.transparency)],[8,()=>this._produces()&&this.renderOccludedFlags===x]]),this._tileSize=256,this._configuration=new H(1===t.viewingMode),this._tileTextureCache=new r((e,t)=>o.newCache(e,t),"TileTexture"),this.tileGeometryCache=new v(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(n(()=>this._overlayRenderer.renderOccludedFlags,e=>{this.renderOccludedFlags=e,this.setNeedsRender()},a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}consumes(){return this._overlayRenderer.hasWater?E:q}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return this._configuration.visualizeNormals}set visualizeNormals(e){this._configuration.visualizeNormals!==e&&(this._configuration.visualizeNormals=e,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._configuration.backfaceCullingEnabled}set cullBackFaces(e){this._configuration.backfaceCullingEnabled!==e&&(this._configuration.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}get layerViewUid(){return z}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this._configuration.screenSizePerspective!==e&&(this._configuration.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){const t=e.parent;if(!t)return!1;const i=f(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,32===t?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[0])i.pendingUpdates&=-9;e.resetPendingUpdate(8);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=Q-Y,i=Math.max(0,Math.floor((e.level-t)/Y)*Y);if(this._isGlobal&&0===i)return u;for(;e.parent&&e.level>i;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new P(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=i(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&0!==this.transparency)return;const s=K,n=X;c(s,r,i),d(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,o=e.results.max,l=e.results.ground,u=0===e.options.store,g=!!e.results.ground.target,_=U(e.verticalOffset),f=e.tolerance;let p,m=u&&null!=a.distance?a.distance:1/0;const x=e.options,T=x.normalRequired||!x.backfacesTerrain,v=new M(!1,T),R=d=>{const g=d.renderData;if(!g?.vao)return;const R=g.geometry;y(Z,R.boundingBox);const P=g.localOrigin;null!=_&&(_.localOrigin=P,_.applyToAabb(Z));const O=Z;if($[0]=i[0]-P[0],$[1]=i[1]-P[1],$[2]=i[2]-P[2],!k(O,$,n,f,m))return;const w=(e,t,i)=>{e.set(this.type,d,t,i),m=u&&null!=a.distance?a.distance:1/0},S=(n,c,d)=>{if((!T||null!=d)&&n>=0&&(x.backfacesTerrain||h(d,s)<0)&&(x.invisibleTerrain||!x.selectionMode||null==t||t(i,r,n))){if((null==l.distance||n<l.distance)&&w(l,n,d),x.isFiltered)return;2===x.store&&(null==p?(p=new A(e.ray),w(p,n,d),e.results.all.push(p)):n<p.distance&&w(p,n,d)),(null==a.distance||n<a.distance)&&w(a,n,d),0!==x.store&&(null==o.distance||n>o.distance)&&w(o,n,d)}},C=ee;c(C,r,P);const{indices:j,indexCount:E}=R,q=R.vertexAttributes,M=q.getField("position",b),G=new F(M.typedBuffer,3,q.stride/4),z=E/3;if(!_&&z>D){const e=d.renderData;null==e.intersectionData&&(e.intersectionData=new B(j,0,z,G)),e.intersectionData.intersectRay($,C,v,S)}else N($,C,0,z,j,G,_,v,S)},P=this._rootTiles;if(null!=P){(()=>{const t=this._tileIterator;t.reset(P);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==_&&!e.intersectsRay(i,s,f,m)||g&&this._useStencilForTile(e)?t.skipSubtree():R(e)})()}}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}acquireTechniques(e){const t=!!has("enable-feature:terrain-shadows")&&e.bind.shadowMap.enabled;t!==this._castShadows&&(this._castShadows=t,this._patchesByOriginDirty=!0);const i=e.bind.viewshedEnabled;if(this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),8===e.bind.slot){if(0===(e.renderOccludedMask&x))return null}else{const t=0===this.transparency?1:6;if(e.bind.slot!==t)return null}if(3===this.transparency)return null;const r=this._configuration;switch(r.screenSpaceReflections=r.cloudReflections=r.receiveShadows=r.receiveAmbientOcclusion=r.renderOccluded=r.hasHighlightMixTexture=!1,r.overlayMode=this._overlayRenderer.mode,e.output){case 0:case 1:{r.screenSpaceReflections=null!=e.bind.ssr.lastFrameColor,r.cloudReflections=null!=e.bind.clouds.data;const t=8===e.bind.slot;return r.receiveShadows=e.bind.shadowMap.ready&&!t,r.renderOccluded=t,r.receiveAmbientOcclusion=!t&&null!=e.bind.ssao,this._acquireTechnique(e.output)}case 4:case 6:return this._castShadows?this._acquireTechnique(4):null;case 7:return this._inViewshed?this._acquireTechnique(7):null;case 2:case 3:return this._acquireTechnique(e.output);case 9:return this._acquireTechnique(9);case 8:return r.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(8):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,this._passParameters.overlayContent=C(e.output,e.bind),e.output){case 0:case 1:this._renderMaterialPass(e,t);break;case 2:case 3:case 9:this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break;case 8:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 4:case 6:case 7:this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const i=this._tileRenderer;let r;if(null!=e){const i=t.toUnitRGBA(e);r=_(i[0]||0,i[1]||0,i[2]||0)}i.setBackground(r),this._allTiles.forAll(e=>i.updateTileTexture(e,0)),this._configuration.tileBlendInput=i.backgroundIsGrid?2:null!=i.backgroundColor?1:0,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)w(i,t);e.sort((e,t)=>S(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i){const{rctx:r,bind:s}=e;r.bindTechnique(t,s,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;i.forEach(e=>{this._drawParameters.origin=e[0].renderData.localOrigin,t.program.bindDraw(s,this._passParameters,this._drawParameters);for(let i=0;i<e.length;i++)this._renderPatch(r,t,e[i],W.TRIANGLES,n,null===this._passParameters.overlayContent)}),r.bindVAO(null)}_renderMaterialPass(e,t){const{rctx:i,bind:r}=e;i.bindTechnique(t,r,this._passParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const s=r.camera,n=t.program;if(this._configuration.screenSizePerspective&&this.pointsOfInterest){const e=G(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:s.fovY})}const a=this._stencilEnabledLayerExtents.length>0,o=8===r.slot;o&&(n.bindTexture("tex",i.emptyTexture),n.setUniform3fv("textureOpacities",u),n.setUniform4fv("texOffsetAndScale",p));const l=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:u;1===this._configuration.tileBlendInput&&n.setUniform3fv("backgroundColor",l);const c=this.wireframe?W.LINES:W.TRIANGLES;this._configuration.textureFadingEnabled&&n.bindTexture("texNext",i.emptyTexture);const d=this._visiblePatchesByOrigin;for(const h of d.values()){const e=h[0].renderData.localOrigin;this._drawParameters.origin=e,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const r of h){const e=r.renderData,s=e.textureReference;if(null!=s){if(!o){n.setUniform4fv("texOffsetAndScale",s.offsetAndScale),n.bindTexture("tex",s.texture.texture);const t=e.textureFadeFactor,i=t<1?e.nextTextureReference:null;this._configuration.textureFadingEnabled&&i&&t<1?(n.setUniform1f("fadeFactor",t),n.setUniform4fv("nextTexOffsetAndScale",i.offsetAndScale),n.setUniform3fv("nextTexOpacities",i.opacities),n.bindTexture("texNext",i.texture.texture)):n.setUniform1f("fadeFactor",1),e.textureIsFading&&this.setNeedsRender(),n.setUniform3fv("textureOpacities",s.opacities)}this._renderPatch(i,t,r,c,a),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}i.bindVAO(null)}_renderPatch(e,t,i,r,s,n=!1){const a=i.renderData,o=a.vao,l=o?.indexBuffer;if(!o||null==l)return void(R&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay),s&&(t.useStencil=this._useStencilForTile(i),e.setPipelineState(t.getPipeline()));const d=a.geometry.indexCount;e.bindVAO(o),c.assertCompatibleVertexAttributeLocations(o),e.drawElements(r,d,l.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(V,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o()],J.prototype,"_visiblePatchesByOrigin",void 0),e([o({readOnly:!0})],J.prototype,"_isGlobal",null),e([o()],J.prototype,"renderOccludedFlags",void 0),e([o({value:!1})],J.prototype,"renderingDisabled",null),e([o({value:!0})],J.prototype,"visible",null),e([o()],J.prototype,"renderPatchBorders",null),e([o()],J.prototype,"visualizeNormals",null),e([o()],J.prototype,"cullBackFaces",null),e([o()],J.prototype,"wireframe",null),J=e([l("esri.views.3d.terrain.TerrainRenderer")],J);const K=g(),X=g(),$=g(),ee=g();export{J as TerrainRenderer};
5
+ import{__decorate as e}from"tslib";import t from"../../../Color.js";import has from"../../../core/has.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{MemCachePool as r}from"../../../core/MemCachePool.js";import s from"../../../core/ObjectPool.js";import{watch as n,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{d as c,i as d,e as h}from"../../../chunks/vec32.js";import{ZEROS as u,create as g,fromValues as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as f,ZEROS as p}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as m,set as y}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as b}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as T}from"./OverlayRenderer.js";import{PatchRenderData as x}from"./PatchRenderData.js";import{TerrainAttributesCache as v}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as R}from"./terrainUtils.js";import{TileRenderer as P}from"./TileRenderer.js";import{IteratorPreorder as O,sortTiles as w,compareTiles as S}from"./tileUtils.js";import{componentMinimalSizeForIntersectionData as D,ComponentIntersectionData as B}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{getOverlayContentForOutputTerrain as C}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as j,ConsumesDepth as E,ConsumesNone as q}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as F}from"../webgl-engine/lib/Attribute.js";import{IntersectorResult as A}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as k,MeshIntersectionOptions as M,intersectTriangles as N}from"../webgl-engine/lib/RayIntersections.js";import{getSettings as G}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{terrainId as z,getVerticalOffsetTerrain as U}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as I}from"../webgl-engine/materials/DrawParameters.js";import{T as L}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as V}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as H}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as W}from"../../webgl/enums.js";const Y=7,Q=10,Z=m();let J=class extends j{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return 1===this._stage.viewingMode}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}constructor(e,t,i,n,a,o){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=i,this._ellipsoidRadius=n,this._compressionTracker=a,this.type=2,this.isGround=!0,this._passParameters=new L,this._drawParameters=new I,this._renderDataPool=new s(x),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new O,this._castShadows=!1,this._inViewshed=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.renderOccludedFlags=1,this.produces=new Map([[1,()=>this._produces()&&0===this.transparency],[6,()=>this._produces()&&(1===this.transparency||2===this.transparency)],[8,()=>this._produces()&&this.renderOccludedFlags===T]]),this._tileSize=256,this._configuration=new H(1===t.viewingMode),this._tileTextureCache=new r((e,t)=>o.newCache(e,t),"TileTexture"),this.tileGeometryCache=new v(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(n(()=>this._overlayRenderer.renderOccludedFlags,e=>{this.renderOccludedFlags=e,this.setNeedsRender()},a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}consumes(){return this._overlayRenderer.hasWater?E:q}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return this._configuration.visualizeNormals}set visualizeNormals(e){this._configuration.visualizeNormals!==e&&(this._configuration.visualizeNormals=e,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._configuration.backfaceCullingEnabled}set cullBackFaces(e){this._configuration.backfaceCullingEnabled!==e&&(this._configuration.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}get layerViewUid(){return z}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this._configuration.screenSizePerspective!==e&&(this._configuration.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){const t=e.parent;if(!t)return!1;const i=f(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,32===t?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[0])i.pendingUpdates&=-9;e.resetPendingUpdate(8);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=Q-Y,i=Math.max(0,Math.floor((e.level-t)/Y)*Y);if(this._isGlobal&&0===i)return u;for(;e.parent&&e.level>i;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new P(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=i(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&0!==this.transparency)return;const s=K,n=X;c(s,r,i),d(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,o=e.results.max,l=e.results.ground,u=0===e.options.store,g=!!e.results.ground.target,_=U(e.verticalOffset),f=e.tolerance;let p,m=u&&null!=a.distance?a.distance:1/0;const T=e.options,x=T.normalRequired||!T.backfacesTerrain,v=new M(!1,x),R=d=>{const g=d.renderData;if(!g?.vao)return;const R=g.geometry;y(Z,R.boundingBox);const P=g.localOrigin;null!=_&&(_.localOrigin=P,_.applyToAabb(Z));const O=Z;if($[0]=i[0]-P[0],$[1]=i[1]-P[1],$[2]=i[2]-P[2],!k(O,$,n,f,m))return;const w=(e,t,i)=>{e.set(this.type,d,t,i),m=u&&null!=a.distance?a.distance:1/0},S=(n,c,d)=>{if((!x||null!=d)&&n>=0&&(T.backfacesTerrain||h(d,s)<0)&&(T.invisibleTerrain||!T.selectionMode||null==t||t(i,r,n))){if((null==l.distance||n<l.distance)&&w(l,n,d),T.isFiltered)return;2===T.store&&(null==p?(p=new A(e.ray),w(p,n,d),e.results.all.push(p)):n<p.distance&&w(p,n,d)),(null==a.distance||n<a.distance)&&w(a,n,d),0!==T.store&&(null==o.distance||n>o.distance)&&w(o,n,d)}},C=ee;c(C,r,P);const{indices:j,indexCount:E}=R,q=R.vertexAttributes,M=q.getField("position",b),G=new F(M.typedBuffer,3,q.stride/4),z=E/3;if(!_&&z>D){const e=d.renderData;null==e.intersectionData&&(e.intersectionData=new B(j,0,z,G)),e.intersectionData.intersectRay($,C,v,S)}else N($,C,0,z,j,G,_,v,S)},P=this._rootTiles;if(null!=P){(()=>{const t=this._tileIterator;t.reset(P);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==_&&!e.intersectsRay(i,s,f,m)||g&&this._useStencilForTile(e)?t.skipSubtree():R(e)})()}}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}acquireTechniques(e){const t=!!has("enable-feature:terrain-shadows")&&e.bind.shadowMap.enabled;t!==this._castShadows&&(this._castShadows=t,this._patchesByOriginDirty=!0);const i=e.bind.viewshedEnabled;if(this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),8===e.bind.slot){if(0===(e.renderOccludedMask&T))return null}else{const t=0===this.transparency?1:6;if(e.bind.slot!==t)return null}if(3===this.transparency)return null;const r=this._configuration;switch(r.screenSpaceReflections=r.cloudReflections=r.receiveShadows=r.receiveAmbientOcclusion=r.renderOccluded=r.hasHighlightMixTexture=!1,r.overlayMode=this._overlayRenderer.mode,e.output){case 0:case 1:{r.screenSpaceReflections=null!=e.bind.ssr.lastFrameColor,r.cloudReflections=null!=e.bind.clouds.data;const t=8===e.bind.slot;return r.receiveShadows=e.bind.shadowMap.ready&&!t,r.renderOccluded=t,r.receiveAmbientOcclusion=!t&&null!=e.bind.ssao,this._acquireTechnique(e.output)}case 4:case 6:return this._castShadows?this._acquireTechnique(4):null;case 7:return this._inViewshed?this._acquireTechnique(7):null;case 2:case 3:return this._acquireTechnique(e.output);case 9:return this._acquireTechnique(9);case 8:return r.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(8):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,this._passParameters.overlayContent=C(e.output,e.bind),e.output){case 0:case 1:this._renderMaterialPass(e,t);break;case 2:case 3:case 9:this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break;case 8:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 4:case 6:case 7:this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const i=this._tileRenderer;let r;if(null!=e){const i=t.toUnitRGBA(e);r=_(i[0]||0,i[1]||0,i[2]||0)}i.setBackground(r),this._allTiles.forAll(e=>i.updateTileTexture(e,0)),this._configuration.tileBlendInput=i.backgroundIsGrid?2:null!=i.backgroundColor?1:0,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)w(i,t);e.sort((e,t)=>S(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange("visibleTiles"),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i){const{rctx:r,bind:s}=e;r.bindTechnique(t,s,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;i.forEach(e=>{this._drawParameters.origin=e[0].renderData.localOrigin,t.program.bindDraw(s,this._passParameters,this._drawParameters);for(let i=0;i<e.length;i++)this._renderPatch(r,t,e[i],W.TRIANGLES,n,null===this._passParameters.overlayContent)}),r.bindVAO(null)}_renderMaterialPass(e,t){const{rctx:i,bind:r}=e;i.bindTechnique(t,r,this._passParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const s=r.camera,n=t.program;if(this._configuration.screenSizePerspective&&this.pointsOfInterest){const e=G(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:s.fovY})}const a=this._stencilEnabledLayerExtents.length>0,o=8===r.slot;o&&(n.bindTexture("tex",i.emptyTexture),n.setUniform3fv("textureOpacities",u),n.setUniform4fv("texOffsetAndScale",p));const l=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:u;1===this._configuration.tileBlendInput&&n.setUniform3fv("backgroundColor",l);const c=this.wireframe?W.LINES:W.TRIANGLES;this._configuration.textureFadingEnabled&&n.bindTexture("texNext",i.emptyTexture);const d=this._visiblePatchesByOrigin;for(const h of d.values()){const e=h[0].renderData.localOrigin;this._drawParameters.origin=e,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const r of h){const e=r.renderData,s=e.textureReference;if(null!=s){if(!o){n.setUniform4fv("texOffsetAndScale",s.offsetAndScale),n.bindTexture("tex",s.texture.texture);const t=e.textureFadeFactor,i=t<1?e.nextTextureReference:null;this._configuration.textureFadingEnabled&&i&&t<1?(n.setUniform1f("fadeFactor",t),n.setUniform4fv("nextTexOffsetAndScale",i.offsetAndScale),n.setUniform3fv("nextTexOpacities",i.opacities),n.bindTexture("texNext",i.texture.texture)):n.setUniform1f("fadeFactor",1),e.textureIsFading&&this.setNeedsRender(),n.setUniform3fv("textureOpacities",s.opacities)}this._renderPatch(i,t,r,c,a),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}i.bindVAO(null)}_renderPatch(e,t,i,r,s,n=!1){const a=i.renderData,o=a.vao,l=o?.indexBuffer;if(!o||null==l)return void(R&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay),s&&(t.useStencil=this._useStencilForTile(i),e.setPipelineState(t.getPipeline()));const d=a.geometry.indexCount;e.bindVAO(o),c.assertCompatibleVertexAttributeLocations(o),e.drawElements(r,d,l.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(V,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],J.prototype,"visibleTiles",null),e([o({readOnly:!0})],J.prototype,"_isGlobal",null),e([o()],J.prototype,"renderOccludedFlags",void 0),e([o({value:!1})],J.prototype,"renderingDisabled",null),e([o({value:!0})],J.prototype,"visible",null),e([o()],J.prototype,"renderPatchBorders",null),e([o()],J.prototype,"visualizeNormals",null),e([o()],J.prototype,"cullBackFaces",null),e([o()],J.prototype,"wireframe",null),J=e([l("esri.views.3d.terrain.TerrainRenderer")],J);const K=g(),X=g(),$=g(),ee=g();export{J as TerrainRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- function n(n){return 4===n||5===n||6===n||7===n}function r(n){return w(n)||3===n}function t(n){return x(n)||3===n}function u(n){return 8===n||9===n}function e(n){return c(n)||u(n)}function c(n){return 0===n}function i(n){return c(n)||d(n)}function o(n){return c(n)||9===n}function f(n){return i(n)||9===n}function s(n){return c(n)||8===n}function a(n){return s(n)||b(n)}function h(n){return c(n)||u(n)}function p(n){return i(n)||u(n)}function w(n){return h(n)||b(n)}function x(n){return p(n)||b(n)}function b(n){return 2===n}function d(n){return 1===n}function g(n){switch(n){case 2:case 4:case 5:case 6:case 7:return!0}return!1}export{e as is2DGeometryOutput,r as is3DGeometryOutput,t as is3DGeometryOutputMRT,c as isColor,d as isColorEmission,x as isColorEmissionHighlightOIDOrDepth,p as isColorEmissionHighlightOrOID,w as isColorHighlightOIDOrDepth,a as isColorHighlightOrDepth,h as isColorHighlightOrOID,i as isColorOrColorEmission,f as isColorOrColorEmissionOrOID,s as isColorOrHighlight,o as isColorOrOID,b as isDepth,g as isDepthOnlyOutput,u as isHighlightOrOID,n as isShadowRelatedOutput};
5
+ function n(n){return 4===n||5===n||6===n||7===n}function r(n){return h(n)||3===n}function t(n){return 8===n||9===n}function u(n){return e(n)||t(n)}function e(n){return 0===n}function c(n){return e(n)||w(n)}function i(n){return e(n)||9===n}function o(n){return c(n)||9===n}function f(n){return e(n)||8===n}function s(n){return f(n)||p(n)}function a(n){return c(n)||t(n)}function h(n){return a(n)||p(n)}function p(n){return 2===n}function w(n){return 1===n}function x(n){switch(n){case 2:case 4:case 5:case 6:case 7:return!0}return!1}export{u as is2DGeometryOutput,r as is3DGeometryOutputMRT,e as isColor,w as isColorEmission,h as isColorEmissionHighlightOIDOrDepth,a as isColorEmissionHighlightOrOID,s as isColorHighlightOrDepth,c as isColorOrColorEmission,o as isColorOrColorEmissionOrOID,f as isColorOrHighlight,i as isColorOrOID,p as isDepth,x as isDepthOnlyOutput,t as isHighlightOrOID,n as isShadowRelatedOutput};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as r,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as a}from"../../../webgl.js";import{TransparentEnvironment as m}from"../TransparentEnvironment.js";import{B as l}from"../../../../../chunks/BloomBlur.glsl.js";import{BloomBlurTechnique as n}from"./BloomBlurTechnique.js";import{BloomBlurTechniqueConfiguration as u}from"./BloomBlurTechniqueConfiguration.js";import{B as c}from"../../../../../chunks/BloomComposition.glsl.js";import{BloomCompositionTechnique as h}from"./BloomCompositionTechnique.js";import{blurRadiusPresets as p,lodFactorsPresets as b,normalizePreset as _}from"./BloomPresets.glsl.js";import{ColorAttachment1 as d,DepthStencilAttachment as g}from"../../../../webgl/enums.js";let f=class extends m{constructor(e){super(e),this.consumes={required:[a.TRANSPARENT_ENVIRONMENT,"emissive"]},this._blurHorizontalConfiguration=new u,this._blurVerticalConfiguration=new u,this._compositionParameters=new c,this._blurParameters=new l,this._blurScale=3.06,this._bloomResults=new Array}initialize(){this.addHandles([r(()=>this._updateFogParameters(),()=>{},o),r(()=>this.view.qualitySettings.bloom,e=>{e?(this._enable(),this.precompile()):this._disable()},o)])}_updateFogParameters(){const e=this.view.environment.weather;if("sunny"===e.type||"cloudy"===e.type)this._blurParameters.blurRadius=p[e.type];else{const r="foggy"===e.type?e.fogStrength:e.precipitation;this._blurParameters.blurRadius=t(p.cloudy,p[e.type],r)}this._compositionParameters.lodFactors=b[e.type].far,this._compositionParameters.lodFactorsFront=b[e.type].near,this.requestRender(1)}precompile(){this.techniques.precompile(n,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.bloomStage=1,this.techniques.precompile(n,this._blurVerticalConfiguration),this.techniques.precompile(h)}render(e){const t=e.find(({name:e})=>e===a.TRANSPARENT_ENVIRONMENT),r=t.getAttachment(d)?.attachment;if(!r)return t;const o=this.techniques.get(n,this._blurHorizontalConfiguration),s=this.techniques.get(n,this._blurVerticalConfiguration),i=this.techniques.get(h);if(!o.compiled||!s.compiled||!i.compiled)return this.requestRender(1),t;const m=t.getTexture(),l=this.fboCache,{fullWidth:u,fullHeight:c}=this.bindParameters.camera,p=this.renderingContext;let b=r,_=u/2,f=c/2;const P=5,T=this._blurParameters.blurRadius;for(let a=0;a<P;a++){const e=l.acquire(_,f,"bloomHorizontal",8);this._blurParameters.color=b,this._prepareFBO(e,_,f),p.bindTechnique(o,this.bindParameters,this._blurParameters),p.screen.draw();const t=l.acquire(_,f,"bloomVertical",8);this._blurParameters.color=e.getTexture(),this._prepareFBO(t,_,f),p.bindTechnique(s,this.bindParameters,this._blurParameters),p.screen.draw(),e.release(),this._bloomResults[a]=t,_=Math.ceil(_/2),f=Math.ceil(f/2),b=this._bloomResults[a].getTexture(),this._blurParameters.blurRadius*=this._blurScale}this._blurParameters.blurRadius=T,this._compositionParameters.color=m,this._compositionParameters.emission=r,this._compositionParameters.bloomTexture0=this._bloomResults[0].getTexture(),this._compositionParameters.bloomTexture1=this._bloomResults[1].getTexture(),this._compositionParameters.bloomTexture2=this._bloomResults[2].getTexture(),this._compositionParameters.bloomTexture3=this._bloomResults[3].getTexture(),this._compositionParameters.bloomTexture4=this._bloomResults[4].getTexture();const R=l.acquire(m.descriptor.width,m.descriptor.height,this.produces);return this._prepareFBO(R,u,c),p.bindTechnique(i,this.bindParameters,this._compositionParameters),p.screen.draw(),this._bloomResults.forEach(e=>e.release()),R.attachDepth(t.getAttachment(g)),R.attachColor(t.getAttachment(d),d),R}_prepareFBO(e,t,r){const o=this.renderingContext;o.bindFramebuffer(e.fbo),o.setViewport(0,0,t,r),o.setClearColor(0,0,0,0),o.clear(16384)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setLodFactors:e=>{this._compositionParameters.lodFactors=_(e)}}}};e([s()],f.prototype,"consumes",void 0),f=e([i("esri.views.3d.webgl-engine.effects.bloom.BloomRenderNode")],f);export{f as BloomRenderNode};
5
+ import{__decorate as e}from"tslib";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as r,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as a}from"../../../webgl.js";import{TransparentEnvironment as m}from"../TransparentEnvironment.js";import{B as l}from"../../../../../chunks/BloomBlur.glsl.js";import{BloomBlurTechnique as n}from"./BloomBlurTechnique.js";import{BloomBlurTechniqueConfiguration as c}from"./BloomBlurTechniqueConfiguration.js";import{B as u}from"../../../../../chunks/BloomComposition.glsl.js";import{BloomCompositionTechnique as h}from"./BloomCompositionTechnique.js";import{blurRadiusPresets as p,lodFactorsPresets as b,normalizePreset as _}from"./BloomPresets.glsl.js";import{ColorAttachment1 as d,DepthStencilAttachment as g}from"../../../../webgl/enums.js";let f=class extends m{constructor(e){super(e),this.consumes={required:[a.TRANSPARENT_ENVIRONMENT,"emissive"]},this._blurHorizontalConfiguration=new c,this._blurVerticalConfiguration=new c,this._compositionParameters=new u,this._blurParameters=new l,this._blurScale=3.06,this._bloomResults=new Array}initialize(){this.addHandles([r(()=>this._updateFogParameters(),()=>{},o),r(()=>this.view.qualitySettings.bloom,e=>{e?(this._enable(),this.precompile()):this._disable()},o)])}_updateFogParameters(){const e=this.view.environment.weather;if("sunny"===e.type||"cloudy"===e.type)this._blurParameters.blurRadius=p[e.type];else{const r="foggy"===e.type?e.fogStrength:e.precipitation;this._blurParameters.blurRadius=t(p.cloudy,p[e.type],r)}this._compositionParameters.lodFactors=b[e.type].far,this._compositionParameters.lodFactorsFront=b[e.type].near,this.requestRender(1)}precompile(){this.techniques.precompile(n,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.bloomStage=1,this.techniques.precompile(n,this._blurVerticalConfiguration),this.techniques.precompile(h)}render(e){const t=e.find(({name:e})=>e===a.TRANSPARENT_ENVIRONMENT),r=t.getAttachment(d)?.attachment;if(!r)return t;const o=this.techniques.get(n,this._blurHorizontalConfiguration),s=this.techniques.get(n,this._blurVerticalConfiguration),i=this.techniques.get(h);if(!o.compiled||!s.compiled||!i.compiled)return this.requestRender(1),t;const m=t.getTexture(),l=this.fboCache,{fullWidth:c,fullHeight:u}=this.bindParameters.camera,p=this.renderingContext;let b=r,_=Math.ceil(c/2),f=Math.ceil(u/2);const P=5,T=this._blurParameters.blurRadius;for(let a=0;a<P;a++){const e=l.acquire(_,f,"bloomHorizontal",8);this._blurParameters.color=b,this._prepareFBO(e,_,f),p.bindTechnique(o,this.bindParameters,this._blurParameters),p.screen.draw();const t=l.acquire(_,f,"bloomVertical",8);this._blurParameters.color=e.getTexture(),this._prepareFBO(t,_,f),p.bindTechnique(s,this.bindParameters,this._blurParameters),p.screen.draw(),e.release(),this._bloomResults[a]=t,_=Math.ceil(_/2),f=Math.ceil(f/2),b=this._bloomResults[a].getTexture(),this._blurParameters.blurRadius*=this._blurScale}this._blurParameters.blurRadius=T,this._compositionParameters.color=m,this._compositionParameters.emission=r,this._compositionParameters.bloomTexture0=this._bloomResults[0].getTexture(),this._compositionParameters.bloomTexture1=this._bloomResults[1].getTexture(),this._compositionParameters.bloomTexture2=this._bloomResults[2].getTexture(),this._compositionParameters.bloomTexture3=this._bloomResults[3].getTexture(),this._compositionParameters.bloomTexture4=this._bloomResults[4].getTexture();const R=l.acquire(m.descriptor.width,m.descriptor.height,this.produces);return this._prepareFBO(R,c,u),p.bindTechnique(i,this.bindParameters,this._compositionParameters),p.screen.draw(),this._bloomResults.forEach(e=>e.release()),R.attachDepth(t.getAttachment(g)),R.attachColor(t.getAttachment(d),d),R}_prepareFBO(e,t,r){const o=this.renderingContext;o.bindFramebuffer(e.fbo),o.setViewport(0,0,t,r),o.setClearColor(0,0,0,0),o.clear(16384)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setLodFactors:e=>{this._compositionParameters.lodFactors=_(e)}}}};e([s()],f.prototype,"consumes",void 0),f=e([i("esri.views.3d.webgl-engine.effects.bloom.BloomRenderNode")],f);export{f as BloomRenderNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{getScale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{diameter as t}from"../../../../geometry/support/aaBoundingBox.js";import{g as n}from"../../../../chunks/sphere.js";import{isPclIntersectorResult as i,isVoxelIntersectorResult as a,isTiles3DIntersectorResult as l,isI3sIntersectorResult as o}from"../../layers/i3s/Intersector.js";import{isOverlayIntersectorResult as u,isTerrainIntersectorResult as c}from"../../terrain/Intersector.js";import{isHUDIntersectorResult as s}from"./HUDIntersectorResult.js";import{isObjectIntersectorResult as g}from"./ObjectIntersectorResult.js";import{isLodIntersectorResult as p}from"./lodRendering/Intersector.js";function f(r,e){return g(r)||s(r)?w(r.target?.object,e):c(r)?e.map?.ground:i(r)||o(r)||u(r)||a(r)?w(r.target,e):null}function d(r,e){const t=m(r,e);return"graphic"===t?.type?t.graphic:null}function m(r,e,t={}){if(null==r)return null;if(g(r)||s(r))return h(r.target?.object,e,t);if(i(r)){const e=r.target.createGraphic();return{type:"graphic",graphic:e,layer:e.layer}}if(a(r)){const e=r.target.createVoxelGraphic();return{type:"graphic",graphic:e,layer:e.layer}}if(l(r)){const e=r.target.createTiles3DGraphic();return{type:"graphic",graphic:e,layer:e.layer}}return u(r)||p(r)?h(r.target,e,t):o(r)?y(r.target,e,t):null}function h(r,e,t){if(null==r?.graphicUid)return null;const n=w(r,e);if(null==n)return null;if(n===e.graphics)return null==e.graphicsView||"number"!=typeof r.graphicUid?null:e.graphicsView.getHit(r.graphicUid,t);const i=e.allLayerViews.find(r=>r.layer===n);return!i||i.suspended||null==r.graphicUid?null:"getHit"in i?i.getHit(r.graphicUid,t):null}function y(r,e,t){const n=w(r,e);if(null==n)return null;const i=e.allLayerViews.find(r=>r.layer===n);if(!i||i.suspended||!("getGraphicFromIntersectorTarget"in i))return null;const a=t.defer;return V(i.getGraphicFromIntersectorTarget(r,{defer:a?async r=>a(async()=>V(await r())):void 0}))}function j(r,e){const t=w(r,e);if(null==t)return null;const n=e.allLayerViews.find(r=>r.layer===t);return n&&!n.suspended&&"getAABBFromIntersectorTarget"in n?n.getAABBFromIntersectorTarget(r):null}function V(r){return null!=r?{type:"graphic",graphic:r,layer:r.layer}:null}function w(r,e){return null==r?.layerViewUid?null:null!=e.graphicsView&&r.layerViewUid===e.graphicsView.uid?e.graphics:e.allLayerViews.find(e=>e.uid===r.layerViewUid)?.layer}function b(e,i){if(g(e)||s(e))return n(e.target.object.boundingVolumeWorldSpace.bounds);if(p(e)){r(U,e.transformation);const t=Math.max(U[0],U[1],U[2]);return e.target.baseBoundingSphere.radius*t}if(o(e)){const r=j(e.target,i);return r?.5*t(r):null}return null}function I(r){return!g(r)&&!s(r)&&(p(r)?r.target.numLodLevels>1:!!o(r))}const U=e();export{b as getIntersectedFeatureBSRadius,I as hasLod,d as toGraphic,m as toHit,f as toOwner};
5
+ import{getScale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{diameter as t}from"../../../../geometry/support/aaBoundingBox.js";import{g as n}from"../../../../chunks/sphere.js";import{isPclIntersectorResult as i,isVoxelIntersectorResult as l,isTiles3DIntersectorResult as a,isI3sIntersectorResult as o}from"../../layers/i3s/Intersector.js";import{isOverlayIntersectorResult as u,isTerrainIntersectorResult as c}from"../../terrain/Intersector.js";import{isHUDIntersectorResult as s}from"./HUDIntersectorResult.js";import{isObjectIntersectorResult as g}from"./ObjectIntersectorResult.js";import{isLodIntersectorResult as p}from"./lodRendering/Intersector.js";function f(r,e){return g(r)||s(r)?w(r.target?.object,e):c(r)?e.map?.ground:i(r)||o(r)||u(r)||l(r)?w(r.target,e):null}function d(r,e){const t=m(r,e);return"graphic"===t?.type?t.graphic:null}function m(r,e,t={}){if(null==r)return null;if(g(r)||s(r))return h(r.target?.object,e,t);if(i(r)){const e=r.target.createGraphic();return{type:"graphic",graphic:e,layer:e.layer}}if(l(r)){const e=r.target.createVoxelGraphic();return{type:"graphic",graphic:e,layer:e.layer}}if(a(r)){const e=r.target.createTiles3DGraphic();return{type:"graphic",graphic:e,layer:e.layer}}return u(r)||p(r)?h(r.target,e,t):o(r)?y(r.target,e,t):null}function h(r,e,t){if(null==r?.graphicUid)return null;const n=w(r,e);if(null==n)return null;if(n===e.graphics)return null==e.graphicsView||"number"!=typeof r.graphicUid?null:e.graphicsView.getHit(r.graphicUid,t);const i=e.allLayerViews.find(r=>r.layer===n);return!i||i.suspended||null==r.graphicUid?null:"getHit"in i?i.getHit(r.graphicUid,t):null}function y(r,e,t){const n=w(r,e);if(null==n)return null;const i=e.allLayerViews.find(r=>r.layer===n);if(!i||i.suspended||!("getGraphicFromIntersectorTarget"in i))return null;const l=t.defer;return V(i.getGraphicFromIntersectorTarget(r,{defer:l?r=>l(async()=>V(await r())):void 0}))}function j(r,e){const t=w(r,e);if(null==t)return null;const n=e.allLayerViews.find(r=>r.layer===t);return n&&!n.suspended&&"getAABBFromIntersectorTarget"in n?n.getAABBFromIntersectorTarget(r):null}function V(r){return null!=r?{type:"graphic",graphic:r,layer:r.layer}:null}function w(r,e){return null==r?.layerViewUid?null:null!=e.graphicsView&&r.layerViewUid===e.graphicsView.uid?e.graphics:e.allLayerViews.find(e=>e.uid===r.layerViewUid)?.layer}function b(e,i){if(g(e)||s(e))return n(e.target.object.boundingVolumeWorldSpace.bounds);if(p(e)){r(U,e.transformation);const t=Math.max(U[0],U[1],U[2]);return e.target.baseBoundingSphere.radius*t}if(o(e)){const r=j(e.target,i);return r?.5*t(r):null}return null}function I(r){return!g(r)&&!s(r)&&(p(r)?r.target.numLodLevels>1:!!o(r))}const U=e();export{b as getIntersectedFeatureBSRadius,I as hasLod,d as toGraphic,m as toHit,f as toOwner};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{q as e,i as r,c as t,n as s,d as a,l as i,g as o,e as n,o as l}from"../../../../chunks/vec32.js";import{ZEROS as u,create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOutputMRT as m,isShadowRelatedOutput as p,is3DGeometryOutput as d,isColorOrColorEmission as T,isColorEmission as f}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as x}from"../lib/GLTextureMaterial.js";import{Material as g}from"../lib/Material.js";import{OITPolygonOffsetLimit as v}from"../lib/OrderIndependentTransparency.js";import{intersectTriangleGeometry as S}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as M}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as b}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as O}from"./internal/MaterialUtil.js";import{getLayout as C,DefaultMaterialPassParameters as w,DefaultMaterialTechnique as y}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as R}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as P}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as D}from"../../../../webscene/support/AlphaCutoff.js";class j extends g{constructor(e,r){super(e,B),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(m(e)||p(e))&&!this.transparent],[4,e=>(m(e)||p(e))&&this.transparent&&this.parameters.writeDepth],[7,e=>(d(e)||p(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=C(this.parameters),this._configuration=new R(r.spherical)}isVisibleForOutput(e){return 4!==e&&6!==e&&5!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:r,opacity:t,externalColor:s}=this.parameters;return e*("replace"===r?1:t)*("ignore"===r||isNaN(s[3])?1:s[3])>=D}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,r){const{parameters:t,_configuration:s}=this,{treeRendering:a,doubleSided:i,doubleSidedType:o}=t;return super.getConfiguration(e,r,this._configuration),s.hasNormalTexture=t.hasNormalTexture,s.hasColorTexture=t.hasColorTexture,s.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,s.hasOcclusionTexture=t.hasOcclusionTexture,s.hasVertexTangents=!a&&t.hasVertexTangents,s.instanced=t.instanced,s.instancedDoublePrecision=t.instancedDoublePrecision,s.hasVVColor=!!t.vvColor,s.hasVVSize=!!t.vvSize,s.hasVerticalOffset=null!=t.verticalOffset,s.hasScreenSizePerspective=null!=t.screenSizePerspective,s.hasSlicePlane=t.hasSlicePlane,s.alphaDiscardMode=t.textureAlphaMode,s.normalType=a?0:t.normalType,s.transparent=this.transparent,s.writeDepth=t.writeDepth,s.customDepthTest=t.customDepthTest??0,s.hasOccludees=r.hasOccludees,s.cullFace=t.hasSlicePlane?0:t.cullFace,s.cullAboveTerrain=r.cullAboveTerrain,s.hasModelTransformation=!a&&null!=t.modelTransformation,s.hasVertexColors=t.hasVertexColors,s.hasSymbolColors=t.hasSymbolColors,s.doubleSidedMode=a?2:i&&"normal"===o?1:i&&"winding-order"===o?2:0,s.instancedFeatureAttribute=t.instancedFeatureAttribute,s.instancedColor=t.instancedColor,T(e)?(s.terrainDepthTest=r.terrainDepthTest,s.receiveShadows=t.receiveShadows,s.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=r.ssao):(s.terrainDepthTest=!1,s.receiveShadows=s.receiveAmbientOcclusion=!1),s.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,s.pbrMode=t.usePBR?t.isSchematic?2:1:0,s.emissionSource=t.emissionSource,s.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),s.oitPass=r.oitPass,s.enableOffset=r.camera.relativeElevation<v,s.snowCover=r.snowCover,s.hasBloom=f(e),s.hasColorTextureTransform=!!t.colorTextureTransformMatrix,s.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,s.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,s.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,s.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix,s}intersect(e,u,c,h,m,p){if(null!=this.parameters.verticalOffset){const e=c.camera;r(q,u[12],u[13],u[14]);let p=null;switch(c.viewingMode){case 1:p=s(z,q);break;case 2:p=t(z,N)}let d=0;const T=a(F,q,e.eye),f=i(T),x=o(T,T,1/f);let g=null;this.parameters.screenSizePerspective&&(g=n(p,x)),d+=O(e,f,this.parameters.verticalOffset,g??0,this.parameters.screenSizePerspective),o(p,p,d),l(E,p,c.transform.inverseRotation),h=a(V,h,E),m=a(_,m,E)}S(e,c,h,m,M(c.verticalOffset),p)}createGLMaterial(e){return new A(e)}createBufferWriter(){return new b(this._layout)}get transparent(){return I(this.parameters)}}class A extends x{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const s=e.camera.viewInverseTransposeMatrix;return r(t.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?P:y,e)}}class B extends w{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function I(e){const{drivenOpacity:r,opacity:t,externalColor:s,layerOpacity:a,texture:i,textureId:o,textureAlphaMode:n,colorMixMode:l}=e,u=s[3];return r||t<1&&"replace"!==l||u<1&&"ignore"!==l||a<1||(null!=i||null!=o)&&1!==n&&2!==n&&"replace"!==l}const V=c(),_=c(),N=h(0,0,1),z=c(),E=c(),q=c(),F=c();export{A as DefaultGLMaterial,j as DefaultMaterial,B as DefaultMaterialParameters,I as isTransparent};
5
+ import{q as e,i as r,c as t,n as s,d as a,l as i,g as o,e as n,o as l}from"../../../../chunks/vec32.js";import{ZEROS as u,create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOutputMRT as m,isShadowRelatedOutput as p,isColorOrColorEmission as d,isColorEmission as T}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as f}from"../lib/GLTextureMaterial.js";import{Material as x}from"../lib/Material.js";import{OITPolygonOffsetLimit as g}from"../lib/OrderIndependentTransparency.js";import{intersectTriangleGeometry as v}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as S}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as M}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as b}from"./internal/MaterialUtil.js";import{getLayout as O,DefaultMaterialPassParameters as C,DefaultMaterialTechnique as w}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as y}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as R}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as P}from"../../../../webscene/support/AlphaCutoff.js";class D extends x{constructor(e,r){super(e,A),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(m(e)||p(e))&&!this.transparent],[4,e=>(m(e)||p(e))&&this.transparent&&this.parameters.writeDepth],[7,e=>(m(e)||p(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=O(this.parameters),this._configuration=new y(r.spherical)}isVisibleForOutput(e){return 4!==e&&6!==e&&5!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:r,opacity:t,externalColor:s}=this.parameters;return e*("replace"===r?1:t)*("ignore"===r||isNaN(s[3])?1:s[3])>=P}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,r){const{parameters:t,_configuration:s}=this,{treeRendering:a,doubleSided:i,doubleSidedType:o}=t;return super.getConfiguration(e,r,this._configuration),s.hasNormalTexture=t.hasNormalTexture,s.hasColorTexture=t.hasColorTexture,s.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,s.hasOcclusionTexture=t.hasOcclusionTexture,s.hasVertexTangents=!a&&t.hasVertexTangents,s.instanced=t.instanced,s.instancedDoublePrecision=t.instancedDoublePrecision,s.hasVVColor=!!t.vvColor,s.hasVVSize=!!t.vvSize,s.hasVerticalOffset=null!=t.verticalOffset,s.hasScreenSizePerspective=null!=t.screenSizePerspective,s.hasSlicePlane=t.hasSlicePlane,s.alphaDiscardMode=t.textureAlphaMode,s.normalType=a?0:t.normalType,s.transparent=this.transparent,s.writeDepth=t.writeDepth,s.customDepthTest=t.customDepthTest??0,s.hasOccludees=r.hasOccludees,s.cullFace=t.hasSlicePlane?0:t.cullFace,s.cullAboveTerrain=r.cullAboveTerrain,s.hasModelTransformation=!a&&null!=t.modelTransformation,s.hasVertexColors=t.hasVertexColors,s.hasSymbolColors=t.hasSymbolColors,s.doubleSidedMode=a?2:i&&"normal"===o?1:i&&"winding-order"===o?2:0,s.instancedFeatureAttribute=t.instancedFeatureAttribute,s.instancedColor=t.instancedColor,d(e)?(s.terrainDepthTest=r.terrainDepthTest,s.receiveShadows=t.receiveShadows,s.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=r.ssao):(s.terrainDepthTest=!1,s.receiveShadows=s.receiveAmbientOcclusion=!1),s.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,s.pbrMode=t.usePBR?t.isSchematic?2:1:0,s.emissionSource=t.emissionSource,s.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),s.oitPass=r.oitPass,s.enableOffset=r.camera.relativeElevation<g,s.snowCover=r.snowCover,s.hasBloom=T(e),s.hasColorTextureTransform=!!t.colorTextureTransformMatrix,s.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,s.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,s.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,s.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix,s}intersect(e,u,c,h,m,p){if(null!=this.parameters.verticalOffset){const e=c.camera;r(E,u[12],u[13],u[14]);let p=null;switch(c.viewingMode){case 1:p=s(N,E);break;case 2:p=t(N,_)}let d=0;const T=a(q,E,e.eye),f=i(T),x=o(T,T,1/f);let g=null;this.parameters.screenSizePerspective&&(g=n(p,x)),d+=b(e,f,this.parameters.verticalOffset,g??0,this.parameters.screenSizePerspective),o(p,p,d),l(z,p,c.transform.inverseRotation),h=a(I,h,z),m=a(V,m,z)}v(e,c,h,m,S(c.verticalOffset),p)}createGLMaterial(e){return new j(e)}createBufferWriter(){return new M(this._layout)}get transparent(){return B(this.parameters)}}class j extends f{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const s=e.camera.viewInverseTransposeMatrix;return r(t.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?R:w,e)}}class A extends C{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function B(e){const{drivenOpacity:r,opacity:t,externalColor:s,layerOpacity:a,texture:i,textureId:o,textureAlphaMode:n,colorMixMode:l}=e,u=s[3];return r||t<1&&"replace"!==l||u<1&&"ignore"!==l||a<1||(null!=i||null!=o)&&1!==n&&2!==n&&"replace"!==l}const I=c(),V=c(),_=h(0,0,1),N=c(),z=c(),E=c(),q=c();export{j as DefaultGLMaterial,D as DefaultMaterial,A as DefaultMaterialParameters,B as isTransparent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t}from"../../../../core/screenUtils.js";import{copy as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as i,e as a,g as n,f as c,c as m,l,j as f}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as h,fromPoints as g,create as d,closestLineSegmentPoint as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as b,create as x,signedDistance as L,getNormal as v}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOID as y}from"../core/shaderLibrary/ShaderOutput.js";import S from"../lib/GLMaterial.js";import{Material as M,MaterialParameters as _}from"../lib/Material.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{DefaultBufferWriter as C}from"./DefaultBufferWriter.js";import{PositionColorLayout as T,PositionLayout as A}from"./DefaultLayouts.js";import{NativeLineTechnique as V}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as N}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class U extends M{constructor(e){super(e,P),this._configuration=new N,this.produces=new Map([[2,e=>y(e)]])}getConfiguration(e,r){return super.getConfiguration(e,r,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=r.hasOccludees,this._configuration}get visible(){return this.parameters.color[3]>=R}intersect(r,t,u,p,d,x){const y=u.camera;if(!u.options.selectionMode||!r.visible||!y)return;if(!w(t))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const S=r.attributes.get("position").data,M=H;o(M,u.point);const _=2;s(I[0],M[0]-_,M[1]+_,0),s(I[1],M[0]+_,M[1]+_,0),s(I[2],M[0]+_,M[1]-_,0),s(I[3],M[0]-_,M[1]-_,0);for(let e=0;e<4;e++)if(!y.unprojectFromRenderScreen(I[e],J[e]))return;b(y.eye,J[0],J[1],K),b(y.eye,J[1],J[2],Q),b(y.eye,J[2],J[3],Y),b(y.eye,J[3],J[0],Z);let C=Number.MAX_VALUE,T=0;for(let e=0;e<S.length-5;e+=3){if(q[0]=S[e]+t[12],q[1]=S[e+1]+t[13],q[2]=S[e+2]+t[14],B[0]=S[e+3]+t[12],B[1]=S[e+4]+t[13],B[2]=S[e+5]+t[14],L(K,q)<0&&L(K,B)<0||L(Q,q)<0&&L(Q,B)<0||L(Y,q)<0&&L(Y,B)<0||L(Z,q)<0&&L(Z,B)<0)continue;if(y.projectToRenderScreen(q,W),y.projectToRenderScreen(B,X),W[2]<0&&X[2]>0){i(D,q,B);const e=y.frustum,r=-L(e[4],q)/a(D,v(e[4]));n(D,D,r),c(q,q,D),y.projectToRenderScreen(q,W)}else if(W[2]>0&&X[2]<0){i(D,B,q);const e=y.frustum,r=-L(e[4],B)/a(D,v(e[4]));n(D,D,r),c(B,B,D),y.projectToRenderScreen(B,X)}else if(W[2]<0&&X[2]<0)continue;W[2]=0,X[2]=0;const r=h(g(W,X,z),M);r<C&&(C=r,m(G,q),m(k,B),T=e/3)}const A=u.rayBegin,V=u.rayEnd;if(C<_*_){let e=Number.MAX_VALUE;if(j(g(G,k,z),g(A,V,F),O)){i(O,O,A);const r=l(O);n(O,O,1/r),e=r/f(A,V)}x(e,O,T)}}intersectDraped(e,t,o,s,i){if(!t.options.selectionMode)return;const a=e.attributes.get("position").data,n=e.attributes.get("size"),c=n?n.data[0]:0,m=o[0],l=o[1],f=((c+1)/2+4)*e.screenToWorldRatio;let u=Number.MAX_VALUE,p=0;for(let h=0;h<a.length-5;h+=3){const e=a[h],t=a[h+1],o=m-e,s=l-t,i=a[h+3]-e,n=a[h+4]-t,c=r((i*o+n*s)/(i*i+n*n),0,1),f=i*c-o,g=n*c-s,d=f*f+g*g;d<u&&(u=d,p=h/3)}u<f*f&&s(i.distance,i.normal,p)}createGLMaterial(e){return new E(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?T:A;return new C(e)}}class E extends S{beginSlot(e){return this.getTechnique(V,e)}}class P extends _{constructor(){super(...arguments),this.color=p,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const q=u(),B=u(),D=u(),O=u(),W=t(),X=t(),G=u(),k=u(),z=d(),F=d(),H=u(),I=[t(),t(),t(),t()],J=[u(),u(),u(),u()],K=x(),Q=x(),Y=x(),Z=x();export{U as NativeLineMaterial,P as Parameters};
5
+ import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t}from"../../../../core/screenUtils.js";import{copy as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as i,e as a,g as n,f as c,c as m,l,j as f}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as h,fromPoints as g,create as d,closestLineSegmentPoint as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as b,create as x,signedDistance as L,getNormal as v}from"../../../../geometry/support/plane.js";import{isColorEmissionHighlightOrOID as y}from"../core/shaderLibrary/ShaderOutput.js";import S from"../lib/GLMaterial.js";import{Material as M,MaterialParameters as _}from"../lib/Material.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{DefaultBufferWriter as C}from"./DefaultBufferWriter.js";import{PositionColorLayout as T,PositionLayout as A}from"./DefaultLayouts.js";import{NativeLineTechnique as V}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as N}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class U extends M{constructor(e){super(e,P),this._configuration=new N,this.produces=new Map([[2,e=>y(e)]])}getConfiguration(e,r){return super.getConfiguration(e,r,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=r.hasOccludees,this._configuration}get visible(){return this.parameters.color[3]>=R}intersect(r,t,u,p,d,x){const y=u.camera;if(!u.options.selectionMode||!r.visible||!y)return;if(!w(t))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const S=r.attributes.get("position").data,M=H;o(M,u.point);const _=2;s(I[0],M[0]-_,M[1]+_,0),s(I[1],M[0]+_,M[1]+_,0),s(I[2],M[0]+_,M[1]-_,0),s(I[3],M[0]-_,M[1]-_,0);for(let e=0;e<4;e++)if(!y.unprojectFromRenderScreen(I[e],J[e]))return;b(y.eye,J[0],J[1],K),b(y.eye,J[1],J[2],Q),b(y.eye,J[2],J[3],Y),b(y.eye,J[3],J[0],Z);let C=Number.MAX_VALUE,T=0;for(let e=0;e<S.length-5;e+=3){if(q[0]=S[e]+t[12],q[1]=S[e+1]+t[13],q[2]=S[e+2]+t[14],B[0]=S[e+3]+t[12],B[1]=S[e+4]+t[13],B[2]=S[e+5]+t[14],L(K,q)<0&&L(K,B)<0||L(Q,q)<0&&L(Q,B)<0||L(Y,q)<0&&L(Y,B)<0||L(Z,q)<0&&L(Z,B)<0)continue;if(y.projectToRenderScreen(q,W),y.projectToRenderScreen(B,X),W[2]<0&&X[2]>0){i(D,q,B);const e=y.frustum,r=-L(e[4],q)/a(D,v(e[4]));n(D,D,r),c(q,q,D),y.projectToRenderScreen(q,W)}else if(W[2]>0&&X[2]<0){i(D,B,q);const e=y.frustum,r=-L(e[4],B)/a(D,v(e[4]));n(D,D,r),c(B,B,D),y.projectToRenderScreen(B,X)}else if(W[2]<0&&X[2]<0)continue;W[2]=0,X[2]=0;const r=h(g(W,X,z),M);r<C&&(C=r,m(G,q),m(k,B),T=e/3)}const A=u.rayBegin,V=u.rayEnd;if(C<_*_){let e=Number.MAX_VALUE;if(j(g(G,k,z),g(A,V,F),O)){i(O,O,A);const r=l(O);n(O,O,1/r),e=r/f(A,V)}x(e,O,T)}}intersectDraped(e,t,o,s,i){if(!t.options.selectionMode)return;const a=e.attributes.get("position").data,n=e.attributes.get("size"),c=n?n.data[0]:0,m=o[0],l=o[1],f=((c+1)/2+4)*e.screenToWorldRatio;let u=Number.MAX_VALUE,p=0;for(let h=0;h<a.length-5;h+=3){const e=a[h],t=a[h+1],o=m-e,s=l-t,i=a[h+3]-e,n=a[h+4]-t,c=r((i*o+n*s)/(i*i+n*n),0,1),f=i*c-o,g=n*c-s,d=f*f+g*g;d<u&&(u=d,p=h/3)}u<f*f&&s(i.distance,i.normal,p)}createGLMaterial(e){return new E(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?T:A;return new C(e)}}class E extends S{beginSlot(e){return this.getTechnique(V,e)}}class P extends _{constructor(){super(...arguments),this.color=p,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const q=u(),B=u(),D=u(),O=u(),W=t(),X=t(),G=u(),k=u(),z=d(),F=d(),H=u(),I=[t(),t(),t(),t()],J=[u(),u(),u(),u()],K=x(),Q=x(),Y=x(),Z=x();export{U as NativeLineMaterial,P as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/NativeLine.glsl.js";
5
+ import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/glsl.js";import"./OutputColorHighlightOID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/NativeLine.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{stencilToolMaskBaseParams as r,stencilBaseAllZerosParams as l,stencilWriteMaskOn as s,depthCompareLess as o}from"../lib/StencilUtils.js";import{PositionColorLayout as n,PositionLayout as u}from"../materials/DefaultLayouts.js";import{N as a}from"../../../../chunks/NativeLine.glsl.js";import{PrimitiveType as p}from"../../../webgl/enums.js";import{makePipelineState as c,defaultColorWrite as m,defaultDepthWrite as h,unpremultipliedAlphaToPremultipliedAlpha as d}from"../../../webgl/renderState.js";class f extends i{constructor(e,i){super(e,i,new t(a,()=>import("./NativeLine.glsl.js")),i.hasVertexColors?n.locations:u.locations),this.primitiveType=p.LINES}initializePipeline(t){const{hasOccludees:i,output:n,transparent:u}=t,a=(e,t=null,n=null)=>c({blending:t,depthTest:o,depthWrite:n,colorWrite:m,stencilWrite:i?s:null,stencilTest:i?e?r:l:null});return e(n)?(this._occludeePipeline=a(!0,u?d:null,h),a(!1,u?d:null,h)):a(!1)}getPipeline(e){return e?this._occludeePipeline:super.getPipeline()}}export{f as NativeLineTechnique};
5
+ import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{getDrawBuffers as i}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as s,stencilBaseAllZerosParams as l,stencilWriteMaskOn as o,depthCompareLess as n}from"../lib/StencilUtils.js";import{PositionColorLayout as a,PositionLayout as p}from"../materials/DefaultLayouts.js";import{N as u}from"../../../../chunks/NativeLine.glsl.js";import{PrimitiveType as c}from"../../../webgl/enums.js";import{makePipelineState as m,defaultColorWrite as d,defaultDepthWrite as h,unpremultipliedAlphaToPremultipliedAlpha as f}from"../../../webgl/renderState.js";class j extends t{constructor(e,t){super(e,t,new r(u,()=>import("./NativeLine.glsl.js")),t.hasVertexColors?a.locations:p.locations),this.primitiveType=c.LINES}initializePipeline(r){const{hasOccludees:t,output:a,transparent:p,oitPass:u}=r,c=(e,r=null,p=null)=>m({blending:r,depthTest:n,depthWrite:p,colorWrite:d,stencilWrite:t?o:null,stencilTest:t?e?s:l:null,drawBuffers:i(u,a)});return e(a)?(this._occludeePipeline=c(!0,p?f:null,h),c(!1,p?f:null,h)):c(!1)}getPipeline(e){return e?this._occludeePipeline:super.getPipeline()}}export{j as NativeLineTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{parameter as r}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as t}from"../materials/DefaultTechniqueConfiguration.js";class o extends t{constructor(){super(...arguments),this.hasVertexColors=!1,this.transparent=!1,this.hasOccludees=!1,this.draped=!1}}e([r()],o.prototype,"hasVertexColors",void 0),e([r()],o.prototype,"transparent",void 0),e([r()],o.prototype,"hasOccludees",void 0);export{o as NativeLineTechniqueConfiguration};
5
+ import{__decorate as t}from"tslib";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as r}from"../materials/DefaultTechniqueConfiguration.js";class s extends r{constructor(){super(...arguments),this.hasVertexColors=!1,this.transparent=!1,this.hasOccludees=!1,this.writeDepth=!0,this.draped=!1,this.snowCover=!1,this.emissionSource=0,this.textureCoordinateType=0}get discardInvisibleFragments(){return this.transparent&&this.writeDepth}}t([e()],s.prototype,"hasVertexColors",void 0),t([e()],s.prototype,"transparent",void 0),t([e()],s.prototype,"hasOccludees",void 0),t([e()],s.prototype,"writeDepth",void 0);export{s as NativeLineTechniqueConfiguration};