@arcgis/core 4.34.0-next.24 → 4.34.0-next.25

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 (363) hide show
  1. package/Basemap.js +1 -1
  2. package/analysis/VolumeMeasurement/CutFillOptions.d.ts +4 -0
  3. package/analysis/VolumeMeasurement/CutFillOptions.js +1 -1
  4. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  5. package/applications/Components/imageryUtils.d.ts +4 -0
  6. package/applications/Components/imageryUtils.js +5 -0
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/{0867aa688fa8938906da.js → 03bef3f4b6b09b1e864b.js} +1 -1
  9. package/assets/esri/core/workers/chunks/06cdbccc9f325dcc303d.js +1 -0
  10. package/assets/esri/core/workers/chunks/07613c89255bdab6b7c6.js +1 -0
  11. package/assets/esri/core/workers/chunks/09618761df5c4fdd52a0.js +1 -0
  12. package/assets/esri/core/workers/chunks/0ae00339991f5387203e.js +1 -0
  13. package/assets/esri/core/workers/chunks/0b4b294f3ce74fde5620.js +1 -0
  14. package/assets/esri/core/workers/chunks/{146520d263b910b5bdc7.js → 0e96a3b7228f1ff8e6c5.js} +1 -1
  15. package/assets/esri/core/workers/chunks/109ef17dd4f9430bb686.js +1 -0
  16. package/assets/esri/core/workers/chunks/1597aca21334cab3b802.js +1 -0
  17. package/assets/esri/core/workers/chunks/196564ad230bef6b59cf.js +1 -0
  18. package/assets/esri/core/workers/chunks/19f8d551cbebc11db1eb.js +1 -0
  19. package/assets/esri/core/workers/chunks/1ceee047e3fa617b0600.js +1 -0
  20. package/assets/esri/core/workers/chunks/1d27701832ea139fcc20.js +1 -0
  21. package/assets/esri/core/workers/chunks/1f296f85becf1ca6714d.js +1 -0
  22. package/assets/esri/core/workers/chunks/1f8d7bd44d53c30df383.js +1 -0
  23. package/assets/esri/core/workers/chunks/1fabb5ec59da698c1618.js +1 -0
  24. package/assets/esri/core/workers/chunks/{919d2fd7ebc0c840a759.js → 219b2911668db120452b.js} +1 -1
  25. package/assets/esri/core/workers/chunks/29ae5723fa35aa73ff9b.js +1 -0
  26. package/assets/esri/core/workers/chunks/2b4b073254fe8b6a081c.js +1 -0
  27. package/assets/esri/core/workers/chunks/30293b88501b5d6162fc.js +1 -0
  28. package/assets/esri/core/workers/chunks/31533f5e8b76b307f61c.js +1 -0
  29. package/assets/esri/core/workers/chunks/347117e61e1c6edd074f.js +1 -0
  30. package/assets/esri/core/workers/chunks/3616eb2607843524483f.js +1 -0
  31. package/assets/esri/core/workers/chunks/36648facd56ee91afc7c.js +1 -0
  32. package/assets/esri/core/workers/chunks/394477e88be0c6790f02.js +1 -0
  33. package/assets/esri/core/workers/chunks/3b80b01551d124534a1b.js +1 -0
  34. package/assets/esri/core/workers/chunks/{89d91ce2f566dd3f57f7.js → 3be9ec0503a669bcfce6.js} +1 -1
  35. package/assets/esri/core/workers/chunks/3c9cf06ac6aa1db6c4f6.js +1 -0
  36. package/assets/esri/core/workers/chunks/40fc7c43feaeef8b814d.js +1 -0
  37. package/assets/esri/core/workers/chunks/42cddc8f8c8d73e22ee2.js +1 -0
  38. package/assets/esri/core/workers/chunks/437a4100a837ee16df7c.js +1 -0
  39. package/assets/esri/core/workers/chunks/453e536f566d80a9863b.js +1 -0
  40. package/assets/esri/core/workers/chunks/472c677a74d779ce62d7.js +1 -0
  41. package/assets/esri/core/workers/chunks/4b68b6985430c42316b7.js +1 -0
  42. package/assets/esri/core/workers/chunks/4ce671bc4d36387b55fa.js +1 -0
  43. package/assets/esri/core/workers/chunks/51cfa2f70ec222e1582b.js +1 -0
  44. package/assets/esri/core/workers/chunks/5284d46aecd6fe0345b8.js +1 -0
  45. package/assets/esri/core/workers/chunks/567385709e18ace93b1e.js +1 -0
  46. package/assets/esri/core/workers/chunks/5a9b27f2b343cd5b0852.js +1 -0
  47. package/assets/esri/core/workers/chunks/{4c2f3e43992a918e4c2d.js → 5ef3256c32c4b622bd11.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{5ce62d9fff80d014d186.js → 60aeb7a5ccd8bc71be02.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{55e9b02d70812f7cdac2.js → 63966066a963e9a1fb14.js} +1 -1
  50. package/assets/esri/core/workers/chunks/63f50ff2ae94f684d56b.js +1 -0
  51. package/assets/esri/core/workers/chunks/{8bf04be4052bf148777a.js → 6a1cf6b0ffdf6080b5c4.js} +1 -1
  52. package/assets/esri/core/workers/chunks/6deaa08e3a61a455e564.js +1 -0
  53. package/assets/esri/core/workers/chunks/6e9b4bfe2a1497c96100.js +1 -0
  54. package/assets/esri/core/workers/chunks/6efc3d120c9c2c09cb06.js +1 -0
  55. package/assets/esri/core/workers/chunks/7338ce95bceb2c7fab87.js +1 -0
  56. package/assets/esri/core/workers/chunks/{c64fa94cba71ba2794e2.js → 771012f129890f9a089c.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{d1b363c418a67b087306.js → 780ff9314f26ae62f75f.js} +1 -1
  58. package/assets/esri/core/workers/chunks/820cf4337b248a0cb63c.js +1 -0
  59. package/assets/esri/core/workers/chunks/{fedbf639a0788417a70f.js → 86abfce1f2ac93cc4d54.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{c94cc026c4ed330408fb.js → 8894483b91bcda845b6f.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{f050ab9d100012b77bb9.js → 8c5b1114cc2a58305a81.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{6ca764b4baadef5c1515.js → 92737419b66894799a34.js} +1 -1
  63. package/assets/esri/core/workers/chunks/9511e55e4fabb3235eac.js +1 -0
  64. package/assets/esri/core/workers/chunks/{909a6218db87cba2c9ba.js → 9a78cb291c966f8ddda6.js} +1 -1
  65. package/assets/esri/core/workers/chunks/9f8341caab3b1d02f387.js +1 -0
  66. package/assets/esri/core/workers/chunks/a08d018d8c137fc4ca17.js +1 -0
  67. package/assets/esri/core/workers/chunks/{7051bcc178eb512819f6.js → a55338add265d330124b.js} +1 -1
  68. package/assets/esri/core/workers/chunks/afe4fd3b1b3521712edd.js +1 -0
  69. package/assets/esri/core/workers/chunks/{9991bd3c7991bffd8260.js → b37f3c416cefc1a6ea2c.js} +1 -1
  70. package/assets/esri/core/workers/chunks/bb50b4a3af627f91d789.js +1 -0
  71. package/assets/esri/core/workers/chunks/{f42155b7a4e6c5e80757.js → bbc2a4976d044b990193.js} +1 -1
  72. package/assets/esri/core/workers/chunks/bbf2c31d217de1b8ba6e.js +1 -0
  73. package/assets/esri/core/workers/chunks/be3977f7fe0c46a1b493.js +1 -0
  74. package/assets/esri/core/workers/chunks/befba7ceeb26a38732c1.js +1 -0
  75. package/assets/esri/core/workers/chunks/bf3fc71881aa559fc931.js +1 -0
  76. package/assets/esri/core/workers/chunks/c19421707257fc93acb9.js +1 -0
  77. package/assets/esri/core/workers/chunks/c1fb5290e0e259b74389.js +1 -0
  78. package/assets/esri/core/workers/chunks/c361bf4d41a1843d4640.js +1 -0
  79. package/assets/esri/core/workers/chunks/c51099eab5a99c88e5de.js +1 -0
  80. package/assets/esri/core/workers/chunks/c56b05a8be498b6f3ee7.js +1 -0
  81. package/assets/esri/core/workers/chunks/c82e78590c2fabc67609.js +1 -0
  82. package/assets/esri/core/workers/chunks/{7d7f8f2936ddee65e3da.js → c9e580867f7ac17be329.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{92ad9098006568358550.js → cafcb46d723d38b377a9.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{1d75cb1747ffb7b8b050.js → cb81d448ed6bad205346.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{0f6203ae32663b2b52db.js → d08a523b548e892e1222.js} +1 -1
  86. package/assets/esri/core/workers/chunks/d29ae64703a947bfb83b.js +1 -0
  87. package/assets/esri/core/workers/chunks/{04c17957c15234ca0321.js → d81260303a11d3fbe940.js} +1 -1
  88. package/assets/esri/core/workers/chunks/de1457b07f4e263f1524.js +1 -0
  89. package/assets/esri/core/workers/chunks/{6bf43bc3714d7b3878fa.js → e547318638c8f496c1a0.js} +1 -1
  90. package/assets/esri/core/workers/chunks/e8e993fb8697b8f3e0c7.js +346 -0
  91. package/assets/esri/core/workers/chunks/{53781ccca16e53d4a8c3.js → f291ccf9da6aa7d7ae23.js} +1 -1
  92. package/assets/esri/core/workers/chunks/f61a8cc7e2b198e521ba.js +1 -0
  93. package/assets/esri/core/workers/chunks/f9442a281cb91c64c7cd.js +1 -0
  94. package/assets/esri/core/workers/chunks/fb785bc38323cce6e549.js +1 -0
  95. package/assets/esri/core/workers/chunks/{c3213b487c11076985af.js → fbf3240b36718fa5dc76.js} +1 -1
  96. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  97. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  98. package/chunks/ComponentShader.glsl.js +36 -36
  99. package/chunks/RibbonLine.glsl.js +40 -33
  100. package/chunks/persistableUrlUtils.js +1 -1
  101. package/config.js +1 -1
  102. package/core/AsyncUpdate.js +1 -1
  103. package/core/Clonable.js +1 -1
  104. package/core/Evented.js +1 -1
  105. package/core/Identifiable.js +1 -1
  106. package/core/JSONSupport.js +1 -1
  107. package/core/Loadable.js +1 -1
  108. package/core/MapUtils.js +1 -1
  109. package/core/MemCache.js +1 -1
  110. package/core/MultiOriginJSONSupport.js +1 -1
  111. package/core/ObjectPool.js +1 -1
  112. package/core/Promise.js +1 -1
  113. package/core/ReadOnlyMultiOriginJSONSupport.js +1 -1
  114. package/core/quantity.d.ts +1 -0
  115. package/geometry/support/buffer/BufferPool.js +1 -1
  116. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  117. package/interfaces.d.ts +147 -12
  118. package/kernel.js +1 -1
  119. package/layers/CatalogLayer.js +1 -1
  120. package/layers/FeatureLayer.js +1 -1
  121. package/layers/GeoJSONLayer.js +1 -1
  122. package/layers/SubtypeGroupLayer.js +1 -1
  123. package/layers/knowledgeGraph/KnowledgeGraphSublayerBase.js +1 -1
  124. package/layers/mixins/APIKeyMixin.js +1 -1
  125. package/layers/mixins/ArcGISCachedService.js +1 -1
  126. package/layers/mixins/ArcGISImageService.js +1 -1
  127. package/layers/mixins/ArcGISMapService.js +1 -1
  128. package/layers/mixins/ArcGISService.js +1 -1
  129. package/layers/mixins/BlendLayer.js +1 -1
  130. package/layers/mixins/CustomParametersMixin.js +1 -1
  131. package/layers/mixins/DisplayFilteredLayer.js +1 -1
  132. package/layers/mixins/EditBusLayer.js +1 -1
  133. package/layers/mixins/FeatureEffectLayer.js +1 -1
  134. package/layers/mixins/FeatureLayerBase.js +1 -1
  135. package/layers/mixins/FeatureReductionLayer.js +1 -1
  136. package/layers/mixins/ImageryTileMixin.js +1 -1
  137. package/layers/mixins/OperationalLayer.js +1 -1
  138. package/layers/mixins/OrderedLayer.js +1 -1
  139. package/layers/mixins/PortalLayer.js +1 -1
  140. package/layers/mixins/PublishableLayer.js +1 -1
  141. package/layers/mixins/RasterJobHandlerMixin.js +1 -1
  142. package/layers/mixins/RasterPresetRendererMixin.js +1 -1
  143. package/layers/mixins/RefreshableLayer.js +1 -1
  144. package/layers/mixins/ScaleRangeLayer.js +1 -1
  145. package/layers/mixins/SceneService.js +1 -1
  146. package/layers/mixins/SublayersOwner.js +1 -1
  147. package/layers/mixins/TemporalLayer.js +1 -1
  148. package/layers/mixins/TemporalSceneLayer.js +1 -1
  149. package/layers/mixins/TrackableLayer.js +1 -1
  150. package/layers/ogc/wfsUtils.js +1 -1
  151. package/layers/support/RasterJobHandler.js +1 -1
  152. package/layers/support/RasterWorker.js +1 -1
  153. package/layers/support/Sublayer.js +1 -1
  154. package/layers/support/arcgisLayerUrl.js +1 -1
  155. package/layers/support/multiLayerServiceUtils.js +1 -1
  156. package/layers/support/rasterDatasets/pixelReader.js +5 -0
  157. package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
  158. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  159. package/package.json +1 -1
  160. package/renderers/mixins/VisualVariablesMixin.js +1 -1
  161. package/rest/support/CameraInfoMixin.js +1 -1
  162. package/rest/support/NormalizationBinParametersMixin.js +1 -1
  163. package/smartMapping/renderers/color.js +1 -1
  164. package/smartMapping/renderers/heatmap.js +1 -1
  165. package/smartMapping/renderers/pieChart.js +1 -1
  166. package/smartMapping/renderers/size.js +1 -1
  167. package/smartMapping/renderers/support/regenerateUtils.js +1 -1
  168. package/smartMapping/renderers/support/rendererUtils.js +1 -1
  169. package/smartMapping/renderers/type.js +1 -1
  170. package/smartMapping/symbology/color.js +1 -1
  171. package/smartMapping/symbology/support/utils.js +1 -1
  172. package/support/LayersMixin.js +1 -1
  173. package/support/TablesMixin.js +1 -1
  174. package/support/revision.js +1 -1
  175. package/symbols/support/utils.js +1 -1
  176. package/views/2d/engine/ParentChildStage.js +1 -1
  177. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  178. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  179. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MultiRasterMixin.js +1 -1
  180. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  181. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  182. package/views/2d/engine/webgl/textureUtils.js +1 -1
  183. package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
  184. package/views/2d/layers/LayerView2D.js +1 -1
  185. package/views/2d/layers/MediaLayerView2D.js +1 -1
  186. package/views/2d/layers/TileLayerView2D.js +1 -1
  187. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  188. package/views/2d/layers/support/DebugOverlay.js +1 -1
  189. package/views/3d/analysis/AnalysisView3D.js +1 -1
  190. package/views/3d/analysis/VolumeMeasurement/CutFillVolumeMeasurementController.js +5 -0
  191. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  192. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  193. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  194. package/views/3d/layers/BuildingSublayerView3D.js +1 -1
  195. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  196. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  197. package/views/3d/layers/FlowSubView3D.js +1 -1
  198. package/views/3d/layers/I3SMeshView3D.js +1 -1
  199. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  200. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  201. package/views/3d/layers/LayerView3D.js +1 -1
  202. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  203. package/views/3d/layers/StreamLayerView3D.js +1 -1
  204. package/views/3d/layers/TiledLayerView3D.js +1 -1
  205. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  207. package/views/3d/layers/graphics/Labeler.js +1 -1
  208. package/views/3d/layers/graphics/StreamController.js +5 -0
  209. package/views/3d/layers/graphics/StreamGraphics3DGraphicsPipeline.js +1 -1
  210. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  211. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  212. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  213. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  214. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  215. package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
  216. package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
  217. package/views/3d/layers/support/fetchTile.js +1 -1
  218. package/views/3d/support/MemoryController.js +1 -1
  219. package/views/3d/support/ResourceController.js +1 -1
  220. package/views/3d/support/StreamDataLoader.js +1 -1
  221. package/views/3d/support/StreamDataRequester.js +5 -0
  222. package/views/3d/support/StreamTextureCollection.js +1 -1
  223. package/views/3d/support/engineContent/line.js +1 -1
  224. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  225. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  226. package/views/3d/support/flow/StreamlinesResources3D.js +1 -1
  227. package/views/3d/support/flow/geometryUtils.js +1 -1
  228. package/views/3d/support/index.js +1 -1
  229. package/views/3d/terrain/OverlayRenderer.js +1 -1
  230. package/views/3d/terrain/TerrainRenderer.js +1 -1
  231. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  232. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  233. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
  234. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  235. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  236. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  237. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  238. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  239. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  240. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  241. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  242. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  243. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +17 -0
  244. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  245. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  246. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  247. package/views/BreakpointsOwner.js +1 -1
  248. package/views/DOMContainer.js +1 -1
  249. package/views/PopupView.js +1 -1
  250. package/views/VideoView.js +1 -1
  251. package/views/Viewport2DBaseMixin.js +1 -1
  252. package/views/Viewport2DMixin.js +1 -1
  253. package/views/draw/DrawGraphicTool.js +1 -1
  254. package/views/draw/DrawScreenTool.js +1 -1
  255. package/views/draw/DrawTool.js +1 -1
  256. package/views/interactive/tooltip/infos/TooltipInfoWithCoordinates.js +1 -1
  257. package/views/layers/CatalogDynamicGroupLayerView.js +1 -1
  258. package/views/layers/CatalogFootprintLayerView.js +1 -1
  259. package/views/layers/CatalogLayerView.js +1 -1
  260. package/views/layers/DimensionLayerView.js +1 -1
  261. package/views/layers/FeatureLayerView.js +1 -1
  262. package/views/layers/ImageryLayerView.js +1 -1
  263. package/views/layers/ImageryTileLayerView.js +1 -1
  264. package/views/layers/LineOfSightLayerView.js +1 -1
  265. package/views/layers/MapImageLayerView.js +1 -1
  266. package/views/layers/MediaLayerView.js +1 -1
  267. package/views/layers/OGCFeatureLayerView.js +1 -1
  268. package/views/layers/PointCloudLayerView.js +1 -1
  269. package/views/layers/RefreshableLayerView.js +1 -1
  270. package/views/layers/StreamLayerView.js +1 -1
  271. package/views/layers/ViewshedLayerView.js +1 -1
  272. package/views/layers/WMSLayerView.js +1 -1
  273. package/views/support/Scheduler.js +1 -1
  274. package/views/video/VideoOperationalDataView.js +1 -1
  275. package/views/webgl/BufferObject.js +1 -1
  276. package/views/webgl/Program.js +1 -1
  277. package/views/webgl/Renderbuffer.js +1 -1
  278. package/views/webgl/Texture.js +1 -1
  279. package/views/webgl/Util.js +1 -1
  280. package/webscene/SunLighting.js +1 -1
  281. package/webscene/VirtualLighting.js +1 -1
  282. package/widgets/BasemapGallery/support/PortalBasemapsSource.js +1 -1
  283. package/widgets/Directions/DirectionsSearchTool.js +1 -1
  284. package/widgets/Editor/EditorViewModel.js +1 -1
  285. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  286. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  287. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  288. package/widgets/Feature/support/FeatureContentMixin.js +1 -1
  289. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  290. package/widgets/FeatureTable/support/EditableColumnTemplateMixin.js +1 -1
  291. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  292. package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
  293. package/widgets/OrientedImageryViewer/mixins/SketchHandlerMixin.js +1 -1
  294. package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
  295. package/widgets/OrientedImageryViewer/mixins/TriangulatedSketchHandlerMixin.js +1 -1
  296. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  297. package/widgets/PanoramicViewer/PanoramicZoomConditions.js +1 -1
  298. package/widgets/PanoramicViewer.js +1 -1
  299. package/widgets/Sketch/support/ResponsiveToolbar/ToolbarGroupBase.js +1 -1
  300. package/widgets/support/GoTo.js +1 -1
  301. package/assets/esri/core/workers/chunks/0202c2ac73354e3970b2.js +0 -1
  302. package/assets/esri/core/workers/chunks/02dc6e31b1244e5bb785.js +0 -1
  303. package/assets/esri/core/workers/chunks/080c79d6caca3b6a2db2.js +0 -1
  304. package/assets/esri/core/workers/chunks/084236ca316aad980192.js +0 -1
  305. package/assets/esri/core/workers/chunks/0b484224a92b52c34330.js +0 -1
  306. package/assets/esri/core/workers/chunks/16a78f5a82f5ca163816.js +0 -1
  307. package/assets/esri/core/workers/chunks/1cc30073f8200b67cff6.js +0 -1
  308. package/assets/esri/core/workers/chunks/242b216d61940aebe8e1.js +0 -1
  309. package/assets/esri/core/workers/chunks/32756905bcf11699b3f7.js +0 -1
  310. package/assets/esri/core/workers/chunks/35d238a5a6501f89bed7.js +0 -1
  311. package/assets/esri/core/workers/chunks/36a2a8b6547604bad2ab.js +0 -1
  312. package/assets/esri/core/workers/chunks/3fcd73ba832cb53d3a07.js +0 -1
  313. package/assets/esri/core/workers/chunks/40c1d65039c8f1d6afa0.js +0 -1
  314. package/assets/esri/core/workers/chunks/49dce142ad1ea4c01d00.js +0 -1
  315. package/assets/esri/core/workers/chunks/4b89d5b9e35bf79b321e.js +0 -1
  316. package/assets/esri/core/workers/chunks/4c47d327815e281c457e.js +0 -1
  317. package/assets/esri/core/workers/chunks/4ea96aff38bb301dc40d.js +0 -346
  318. package/assets/esri/core/workers/chunks/54a49a25845897a15ab1.js +0 -1
  319. package/assets/esri/core/workers/chunks/576e408fb0834f3948e8.js +0 -1
  320. package/assets/esri/core/workers/chunks/5e805c9e9012dd39ec86.js +0 -1
  321. package/assets/esri/core/workers/chunks/6136bf09950adc46bc33.js +0 -1
  322. package/assets/esri/core/workers/chunks/666afe669866c44830bd.js +0 -1
  323. package/assets/esri/core/workers/chunks/6a0fbc54638f7de138c1.js +0 -1
  324. package/assets/esri/core/workers/chunks/843b6029d4c13115e1ac.js +0 -1
  325. package/assets/esri/core/workers/chunks/86d6007c45f2aa643ac8.js +0 -1
  326. package/assets/esri/core/workers/chunks/8ea34878a1ef24b4ded3.js +0 -1
  327. package/assets/esri/core/workers/chunks/8eea6251aa09725e654e.js +0 -1
  328. package/assets/esri/core/workers/chunks/90145d49a0cec902435c.js +0 -1
  329. package/assets/esri/core/workers/chunks/916691122d7fb38497d6.js +0 -1
  330. package/assets/esri/core/workers/chunks/9ae18a17f62d91167202.js +0 -1
  331. package/assets/esri/core/workers/chunks/9c510df592befb9ff892.js +0 -1
  332. package/assets/esri/core/workers/chunks/a273f80298417edecc07.js +0 -1
  333. package/assets/esri/core/workers/chunks/a2ed7a3cd518dd136ec7.js +0 -1
  334. package/assets/esri/core/workers/chunks/a6a7279b09d7962147ec.js +0 -1
  335. package/assets/esri/core/workers/chunks/aba520714efc01bead36.js +0 -1
  336. package/assets/esri/core/workers/chunks/acb9c166259872828646.js +0 -1
  337. package/assets/esri/core/workers/chunks/accff253af360c34e8a8.js +0 -1
  338. package/assets/esri/core/workers/chunks/ae6eed26fc932bc08356.js +0 -1
  339. package/assets/esri/core/workers/chunks/b32c1b60896a72e0ae90.js +0 -1
  340. package/assets/esri/core/workers/chunks/b4bb461955a4c2bce072.js +0 -1
  341. package/assets/esri/core/workers/chunks/b98279213f45a0c27600.js +0 -1
  342. package/assets/esri/core/workers/chunks/ba5b24beebeb703b5919.js +0 -1
  343. package/assets/esri/core/workers/chunks/bd7d19ba0c7d9143a455.js +0 -1
  344. package/assets/esri/core/workers/chunks/bffaf1f20f18c75fad4e.js +0 -1
  345. package/assets/esri/core/workers/chunks/c4f8da6c238eb5e91f91.js +0 -1
  346. package/assets/esri/core/workers/chunks/cdabea4718a7e7d34cb8.js +0 -1
  347. package/assets/esri/core/workers/chunks/ce7155ae63e7bb74be00.js +0 -1
  348. package/assets/esri/core/workers/chunks/d45383d76ba99718b6d9.js +0 -1
  349. package/assets/esri/core/workers/chunks/d915d0a30d9beb24bd3a.js +0 -1
  350. package/assets/esri/core/workers/chunks/dc6538a2d5a1e60d0209.js +0 -1
  351. package/assets/esri/core/workers/chunks/dca633ae3bfd4a3f9bb3.js +0 -1
  352. package/assets/esri/core/workers/chunks/dfa7976085f7408a366c.js +0 -1
  353. package/assets/esri/core/workers/chunks/e0a5b499b3ae38c21278.js +0 -1
  354. package/assets/esri/core/workers/chunks/e1a20ba7d6279f59adc0.js +0 -1
  355. package/assets/esri/core/workers/chunks/e49a135a2933306a6105.js +0 -1
  356. package/assets/esri/core/workers/chunks/e9a9174c4d1a0a9effb6.js +0 -1
  357. package/assets/esri/core/workers/chunks/edead1a123860cc74b1b.js +0 -1
  358. package/assets/esri/core/workers/chunks/f90573c9dc36e51cd588.js +0 -1
  359. package/assets/esri/core/workers/chunks/fa9658dbfb921f9c13af.js +0 -1
  360. package/assets/esri/core/workers/chunks/fb5e2b1ced03eef28e96.js +0 -1
  361. package/assets/esri/core/workers/chunks/fd8f4eabb8bbc593dd9c.js +0 -1
  362. package/assets/esri/core/workers/chunks/fe1902d63f610cebd947.js +0 -1
  363. package/layers/graphics/controllers/StreamController.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{_ as e}from"../../../chunks/tslib.es6.js";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 p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as _,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as m,set as b}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as y}from"../../../geometry/support/buffer/BufferView.js";import{ViewingMode as T}from"../../ViewingMode.js";import{TextureUpdate as R}from"./interfaces.js";import{LayerClass as O}from"./LayerClass.js";import{OverlayContent as x}from"./OverlayContent.js";import{overlayRenderOccludedFlag as v}from"./OverlayRenderer.js";import{PatchRenderData as w}from"./PatchRenderData.js";import{RenderOrder as P}from"./RenderOrder.js";import{TerrainAttributesCache as D}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as S}from"./terrainUtils.js";import{TileRenderer as C}from"./TileRenderer.js";import{TileUpdate as E}from"./TileUpdate.js";import{IteratorPreorder as j,sortTiles as A,compareTiles as N}from"./tileUtils.js";import{TransparencyMode as B}from"./TransparencyMode.js";import{componentMinimalSizeForIntersectionData as I,ComponentIntersectionData as U}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as G}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{TileBlendInput as F}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{SyncRenderPlugin as q,ConsumesDepth as M,ConsumesNone as k}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as L}from"../webgl-engine/lib/Attribute.js";import{RenderRequestType as z}from"../webgl-engine/lib/basicInterfaces.js";import{StoreResults as V}from"../webgl-engine/lib/IntersectorInterfaces.js";import{IntersectorResult as H}from"../webgl-engine/lib/IntersectorResult.js";import{IntersectorType as Y}from"../webgl-engine/lib/IntersectorType.js";import{RenderOccludedFlag as Q}from"../webgl-engine/lib/Material.js";import{intersectAabbInvDirBefore as W,MeshIntersectionOptions as X,intersectTriangles as K}from"../webgl-engine/lib/RayIntersections.js";import{RenderSlot as Z}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as J}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as $}from"../webgl-engine/lib/VertexAttribute.js";import{terrainId as ee,getVerticalOffsetTerrain as te}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as ie}from"../webgl-engine/materials/DrawParameters.js";import{T as re}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as se}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as ne}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as ae}from"../../webgl/enums.js";const oe=7,le=10,ce=m();let de=class extends q{get _isGlobal(){return this._stage.viewingMode===T.Global}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=Y.TERRAIN,this.isGround=!0,this._passParameters=new re,this._drawParameters=new ie,this._renderDataPool=new s(w),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new j,this._castShadows=!1,this._inViewshed=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.renderOccludedFlags=Q.Occlude,this.produces=new Map([[Z.OPAQUE_TERRAIN,()=>this._produces()&&this.transparency===B.Opaque],[Z.TRANSPARENT_TERRAIN,()=>this._produces()&&(this.transparency===B.Transparent||this.transparency===B.InvisibleWithDraped)],[Z.OCCLUDED_GROUND,()=>this._produces()&&this.renderOccludedFlags===v]]),this._tileSize=256,this._configuration=new ne(t.viewingMode===T.Global),this._tileTextureCache=new r((e,t)=>o.newCache(e,t),"TileTexture"),this.tileGeometryCache=new D(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(n(()=>this._overlayRenderer.rendersOccludedDraped,e=>{this.renderOccludedFlags=e?v:Q.Occlude,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?M:k}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())}set renderOrder(e){this._set("renderOrder",e),this._setSortingDirty()}get layerViewUid(){return ee}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,E.TEXTURE_FADING)}reuseTextureFromParent(e){const t=e.parent;if(!t)return!1;const i=_(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,t===E.TEXTURE_FADING?R.FADING:R.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[O.ELEVATION])i.pendingUpdates&=~E.GEOMETRY;e.resetPendingUpdate(E.GEOMETRY);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=le-oe,i=Math.max(0,Math.floor((e.level-t)/oe)*oe);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=z.UPDATE){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=z.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=z.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new C(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&&this.transparency!==B.Opaque)return;const s=he,n=ue;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=e.options.store===V.MIN,g=!!e.results.ground.target,p=te(e.verticalOffset),_=e.tolerance;let f,m=u&&null!=a.distance?a.distance:1/0;const T=e.options,R=T.normalRequired||!T.backfacesTerrain,O=new X(!1,R),x=d=>{const g=d.renderData;if(!g?.vao)return;const x=g.geometry;b(ce,x.boundingBox);const v=g.localOrigin;null!=p&&(p.localOrigin=v,p.applyToAabb(ce));const w=ce;if(ge[0]=i[0]-v[0],ge[1]=i[1]-v[1],ge[2]=i[2]-v[2],!W(w,ge,n,_,m))return;const P=(e,t,i)=>{e.set(this.type,d,t,i),m=u&&null!=a.distance?a.distance:1/0},D=(n,c,d)=>{if((!R||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)&&P(l,n,d),T.isFiltered)return;T.store===V.ALL&&(null==f?(f=new H(e.ray),P(f,n,d),e.results.all.push(f)):n<f.distance&&P(f,n,d)),(null==a.distance||n<a.distance)&&P(a,n,d),T.store!==V.MIN&&(null==o.distance||n>o.distance)&&P(o,n,d)}},S=pe;c(S,r,v);const{indices:C,indexCount:E}=x,j=x.vertexAttributes,A=j.getField($.POSITION,y),N=new L(A.typedBuffer,3,j.stride/4),B=E/3;if(!p&&B>I){const e=d.renderData;null==e.intersectionData&&(e.intersectionData=new U(C,0,B,N)),e.intersectionData.intersectRay(ge,S,O,D)}else K(ge,S,0,B,C,N,p,O,D)},v=this._rootTiles;if(null!=v){(()=>{const t=this._tileIterator;t.reset(v);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==p&&!e.intersectsRay(i,s,_,m)||g&&this._useStencilForTile(e)?t.skipSubtree():x(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),e.bind.slot===Z.OCCLUDED_GROUND){if(0===(e.renderOccludedMask&v))return null}else{const t=this.transparency===B.Opaque?Z.OPAQUE_TERRAIN:Z.TRANSPARENT_TERRAIN;if(e.bind.slot!==t)return null}if(this.transparency===B.Invisible)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 G.Color:case G.ColorEmission:{r.screenSpaceReflections=null!=e.bind.ssr.lastFrameColor,r.cloudReflections=null!=e.bind.clouds.data,r.receiveShadows=e.bind.shadowMap.ready;const t=e.bind.slot===Z.OCCLUDED_GROUND;return r.renderOccluded=t,r.receiveAmbientOcclusion=!t&&null!=e.bind.ssao,this._acquireTechnique(e.output)}case G.Shadow:case G.ShadowExcludeHighlight:return this._castShadows?this._acquireTechnique(G.Shadow):null;case G.ViewshedShadow:return this._inViewshed?this._acquireTechnique(G.ViewshedShadow):null;case G.Depth:case G.Normal:return this._acquireTechnique(e.output);case G.ObjectAndLayerIdColor:return this._acquireTechnique(G.ObjectAndLayerIdColor);case G.Highlight:return r.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(G.Highlight):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,e.output){case G.Color:case G.ColorEmission:{const i=e.bind.slot===Z.OCCLUDED_GROUND?x.Occluded:x.Color;this._renderMaterialPass(e,t,i);break}case G.Depth:case G.Normal:this._renderAuxiliaryPass(e,t,x.Color,this._visiblePatchesByOrigin);break;case G.Highlight:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(x.Highlight)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,x.Highlight,this._visiblePatchesByOrigin);break}case G.Shadow:case G.ShadowExcludeHighlight:case G.ViewshedShadow:this._renderAuxiliaryPass(e,t,null,this._allPatchesByOrigin);break;case G.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,t,x.ObjectAndLayerIdColor,this._visiblePatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const i=this._tileRenderer;let r;if(null!=e){const i=t.toUnitRGBA(e);r=p(i[0]||0,i[1]||0,i[2]||0)}i.setBackground(r),this._allTiles.forAll(e=>i.updateTileTexture(e,R.FADING)),this._configuration.tileBlendInput=i.backgroundIsGrid?F.GridComposite:null!=i.backgroundColor?F.ColorComposite:F.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==P.NONE){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)A(this.renderOrder,i,t);e.sort((e,t)=>N(e[0],t[0],this.renderOrder)),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,r){const s=e.rctx;this._passParameters.overlayContent=i,s.bindTechnique(t,e.bind,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;r.forEach(r=>{this._drawParameters.origin=r[0].renderData.localOrigin,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters);for(let s=0;s<r.length;s++)this._renderPatch(e,t,r[s],ae.TRIANGLES,n,i)}),e.rctx.bindVAO(null)}_renderMaterialPass(e,t,i){const{rctx:r}=e;this._passParameters.overlayContent=i,r.bindTechnique(t,e.bind,this._passParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const s=e.bind.camera,n=t.program;if(this._configuration.screenSizePerspective&&this.pointsOfInterest){const e=J(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:s.fovY})}const a=this._stencilEnabledLayerExtents.length>0,o=i===x.Occluded;o&&(n.bindTexture("tex",r.emptyTexture),n.setUniform3fv("textureOpacities",u),n.setUniform4fv("texOffsetAndScale",f));const l=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:u;this._configuration.tileBlendInput===F.ColorComposite&&n.setUniform3fv("backgroundColor",l);const c=this.wireframe?ae.LINES:ae.TRIANGLES;this._configuration.textureFadingEnabled&&n.bindTexture("texNext",r.emptyTexture);const d=this._visiblePatchesByOrigin;for(const h of d.values()){const r=h[0].renderData.localOrigin;this._drawParameters.origin=r,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const s of h){const r=s.renderData,l=r.textureReference;if(null!=l){if(!o){n.setUniform4fv("texOffsetAndScale",l.offsetAndScale),n.bindTexture("tex",l.texture.texture);const e=r.textureFadeFactor,t=e<1?r.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(n.setUniform1f("fadeFactor",e),n.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),n.setUniform3fv("nextTexOpacities",t.opacities),n.bindTexture("texNext",t.texture.texture)):n.setUniform1f("fadeFactor",1),r.textureIsFading&&this.setNeedsRender(),n.setUniform3fv("textureOpacities",l.opacities)}this._renderPatch(e,t,s,c,a,i),s.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,t,i,r,s,n){const a=i.renderData,o=a.vao,l=o?.indexBuffer;if(!o||null==l)return void(S&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;null==n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay),s&&(t.useStencil=this._useStencilForTile(i),e.rctx.setPipelineState(t.getPipeline()));const d=a.geometry.indexCount;e.rctx.bindVAO(o),c.assertCompatibleVertexAttributeLocations(o),e.rctx.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(se,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],de.prototype,"_isGlobal",null),e([o()],de.prototype,"renderOccludedFlags",void 0),e([o({value:!1})],de.prototype,"renderingDisabled",null),e([o({value:!0})],de.prototype,"visible",null),e([o()],de.prototype,"renderPatchBorders",null),e([o()],de.prototype,"visualizeNormals",null),e([o()],de.prototype,"cullBackFaces",null),e([o({value:P.FRONT_TO_BACK})],de.prototype,"renderOrder",null),e([o()],de.prototype,"wireframe",null),de=e([l("esri.views.3d.terrain.TerrainRenderer")],de);const he=g(),ue=g(),ge=g(),pe=g();export{de as TerrainRenderer};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";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 p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as _,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as m,set as b}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as y}from"../../../geometry/support/buffer/BufferView.js";import{ViewingMode as T}from"../../ViewingMode.js";import{TextureUpdate as O}from"./interfaces.js";import{LayerClass as R}from"./LayerClass.js";import{OverlayContent as x}from"./OverlayContent.js";import{overlayRenderOccludedFlag as v}from"./OverlayRenderer.js";import{PatchRenderData as w}from"./PatchRenderData.js";import{RenderOrder as D}from"./RenderOrder.js";import{TerrainAttributesCache as P}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as S}from"./terrainUtils.js";import{TileRenderer as C}from"./TileRenderer.js";import{TileUpdate as E}from"./TileUpdate.js";import{IteratorPreorder as j,sortTiles as A,compareTiles as N}from"./tileUtils.js";import{TransparencyMode as B}from"./TransparencyMode.js";import{componentMinimalSizeForIntersectionData as I,ComponentIntersectionData as U}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as G}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{TileBlendInput as F}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{SyncRenderPlugin as q,ConsumesDepth as M,ConsumesNone as L}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as k}from"../webgl-engine/lib/Attribute.js";import{RenderRequestType as z}from"../webgl-engine/lib/basicInterfaces.js";import{StoreResults as V}from"../webgl-engine/lib/IntersectorInterfaces.js";import{IntersectorResult as H}from"../webgl-engine/lib/IntersectorResult.js";import{IntersectorType as Y}from"../webgl-engine/lib/IntersectorType.js";import{RenderOccludedFlag as Q}from"../webgl-engine/lib/Material.js";import{intersectAabbInvDirBefore as W,MeshIntersectionOptions as X,intersectTriangles as K}from"../webgl-engine/lib/RayIntersections.js";import{RenderSlot as Z}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as J}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as $}from"../webgl-engine/lib/VertexAttribute.js";import{terrainId as ee,getVerticalOffsetTerrain as te}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as ie}from"../webgl-engine/materials/DrawParameters.js";import{T as re}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as se}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as ne}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as ae}from"../../webgl/enums.js";const oe=7,le=10,ce=m();let de=class extends q{get _isGlobal(){return this._stage.viewingMode===T.Global}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=Y.TERRAIN,this.isGround=!0,this._passParameters=new re,this._drawParameters=new ie,this._renderDataPool=new s(w),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new j,this._castShadows=!1,this._inViewshed=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.renderOccludedFlags=Q.Occlude,this.produces=new Map([[Z.OPAQUE_TERRAIN,()=>this._produces()&&this.transparency===B.Opaque],[Z.TRANSPARENT_TERRAIN,()=>this._produces()&&(this.transparency===B.Transparent||this.transparency===B.InvisibleWithDraped)],[Z.OCCLUDED_GROUND,()=>this._produces()&&this.renderOccludedFlags===v]]),this._tileSize=256,this._configuration=new ne(t.viewingMode===T.Global),this._tileTextureCache=new r((e,t)=>o.newCache(e,t),"TileTexture"),this.tileGeometryCache=new P(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(n(()=>this._overlayRenderer.rendersOccludedDraped,e=>{this.renderOccludedFlags=e?v:Q.Occlude,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?M:L}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())}set renderOrder(e){this._set("renderOrder",e),this._setSortingDirty()}get layerViewUid(){return ee}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,E.TEXTURE_FADING)}reuseTextureFromParent(e){const t=e.parent;if(!t)return!1;const i=_(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,t===E.TEXTURE_FADING?O.FADING:O.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[R.ELEVATION])i.pendingUpdates&=~E.GEOMETRY;e.resetPendingUpdate(E.GEOMETRY);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=le-oe,i=Math.max(0,Math.floor((e.level-t)/oe)*oe);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=z.UPDATE){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=z.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=z.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new C(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&&this.transparency!==B.Opaque)return;const s=he,n=ue;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=e.options.store===V.MIN,g=!!e.results.ground.target,p=te(e.verticalOffset),_=e.tolerance;let f,m=u&&null!=a.distance?a.distance:1/0;const T=e.options,O=T.normalRequired||!T.backfacesTerrain,R=new X(!1,O),x=d=>{const g=d.renderData;if(!g?.vao)return;const x=g.geometry;b(ce,x.boundingBox);const v=g.localOrigin;null!=p&&(p.localOrigin=v,p.applyToAabb(ce));const w=ce;if(ge[0]=i[0]-v[0],ge[1]=i[1]-v[1],ge[2]=i[2]-v[2],!W(w,ge,n,_,m))return;const D=(e,t,i)=>{e.set(this.type,d,t,i),m=u&&null!=a.distance?a.distance:1/0},P=(n,c,d)=>{if((!O||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)&&D(l,n,d),T.isFiltered)return;T.store===V.ALL&&(null==f?(f=new H(e.ray),D(f,n,d),e.results.all.push(f)):n<f.distance&&D(f,n,d)),(null==a.distance||n<a.distance)&&D(a,n,d),T.store!==V.MIN&&(null==o.distance||n>o.distance)&&D(o,n,d)}},S=pe;c(S,r,v);const{indices:C,indexCount:E}=x,j=x.vertexAttributes,A=j.getField($.POSITION,y),N=new k(A.typedBuffer,3,j.stride/4),B=E/3;if(!p&&B>I){const e=d.renderData;null==e.intersectionData&&(e.intersectionData=new U(C,0,B,N)),e.intersectionData.intersectRay(ge,S,R,P)}else K(ge,S,0,B,C,N,p,R,P)},v=this._rootTiles;if(null!=v){(()=>{const t=this._tileIterator;t.reset(v);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==p&&!e.intersectsRay(i,s,_,m)||g&&this._useStencilForTile(e)?t.skipSubtree():x(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),e.bind.slot===Z.OCCLUDED_GROUND){if(0===(e.renderOccludedMask&v))return null}else{const t=this.transparency===B.Opaque?Z.OPAQUE_TERRAIN:Z.TRANSPARENT_TERRAIN;if(e.bind.slot!==t)return null}if(this.transparency===B.Invisible)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 G.Color:case G.ColorEmission:{r.screenSpaceReflections=null!=e.bind.ssr.lastFrameColor,r.cloudReflections=null!=e.bind.clouds.data,r.receiveShadows=e.bind.shadowMap.ready;const t=e.bind.slot===Z.OCCLUDED_GROUND;return r.renderOccluded=t,r.receiveAmbientOcclusion=!t&&null!=e.bind.ssao,this._acquireTechnique(e.output)}case G.Shadow:case G.ShadowExcludeHighlight:return this._castShadows?this._acquireTechnique(G.Shadow):null;case G.ViewshedShadow:return this._inViewshed?this._acquireTechnique(G.ViewshedShadow):null;case G.Depth:case G.Normal:return this._acquireTechnique(e.output);case G.ObjectAndLayerIdColor:return this._acquireTechnique(G.ObjectAndLayerIdColor);case G.Highlight:return r.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(G.Highlight):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,e.output){case G.Color:case G.ColorEmission:{const i=e.bind.slot!==Z.OCCLUDED_GROUND||e.bind.overlay?.allSourcesOccludees?x.Color:x.Occluded;this._renderMaterialPass(e,t,i);break}case G.Depth:case G.Normal:this._renderAuxiliaryPass(e,t,x.Color,this._visiblePatchesByOrigin);break;case G.Highlight:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(x.Highlight)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,x.Highlight,this._visiblePatchesByOrigin);break}case G.Shadow:case G.ShadowExcludeHighlight:case G.ViewshedShadow:this._renderAuxiliaryPass(e,t,null,this._allPatchesByOrigin);break;case G.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,t,x.ObjectAndLayerIdColor,this._visiblePatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const i=this._tileRenderer;let r;if(null!=e){const i=t.toUnitRGBA(e);r=p(i[0]||0,i[1]||0,i[2]||0)}i.setBackground(r),this._allTiles.forAll(e=>i.updateTileTexture(e,O.FADING)),this._configuration.tileBlendInput=i.backgroundIsGrid?F.GridComposite:null!=i.backgroundColor?F.ColorComposite:F.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==D.NONE){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)A(this.renderOrder,i,t);e.sort((e,t)=>N(e[0],t[0],this.renderOrder)),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,r){const s=e.rctx;this._passParameters.overlayContent=i,s.bindTechnique(t,e.bind,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;r.forEach(r=>{this._drawParameters.origin=r[0].renderData.localOrigin,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters);for(let s=0;s<r.length;s++)this._renderPatch(e,t,r[s],ae.TRIANGLES,n,i)}),e.rctx.bindVAO(null)}_renderMaterialPass(e,t,i){const{rctx:r}=e;this._passParameters.overlayContent=i,r.bindTechnique(t,e.bind,this._passParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const s=e.bind.camera,n=t.program;if(this._configuration.screenSizePerspective&&this.pointsOfInterest){const e=J(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:s.fovY})}const a=this._stencilEnabledLayerExtents.length>0,o=e.bind.slot===Z.OCCLUDED_GROUND;o&&(n.bindTexture("tex",r.emptyTexture),n.setUniform3fv("textureOpacities",u),n.setUniform4fv("texOffsetAndScale",f));const l=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:u;this._configuration.tileBlendInput===F.ColorComposite&&n.setUniform3fv("backgroundColor",l);const c=this.wireframe?ae.LINES:ae.TRIANGLES;this._configuration.textureFadingEnabled&&n.bindTexture("texNext",r.emptyTexture);const d=this._visiblePatchesByOrigin;for(const h of d.values()){const r=h[0].renderData.localOrigin;this._drawParameters.origin=r,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const s of h){const r=s.renderData,l=r.textureReference;if(null!=l){if(!o){n.setUniform4fv("texOffsetAndScale",l.offsetAndScale),n.bindTexture("tex",l.texture.texture);const e=r.textureFadeFactor,t=e<1?r.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(n.setUniform1f("fadeFactor",e),n.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),n.setUniform3fv("nextTexOpacities",t.opacities),n.bindTexture("texNext",t.texture.texture)):n.setUniform1f("fadeFactor",1),r.textureIsFading&&this.setNeedsRender(),n.setUniform3fv("textureOpacities",l.opacities)}this._renderPatch(e,t,s,c,a,i),s.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,t,i,r,s,n){const a=i.renderData,o=a.vao,l=o?.indexBuffer;if(!o||null==l)return void(S&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;null==n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay),s&&(t.useStencil=this._useStencilForTile(i),e.rctx.setPipelineState(t.getPipeline()));const d=a.geometry.indexCount;e.rctx.bindVAO(o),c.assertCompatibleVertexAttributeLocations(o),e.rctx.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(se,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],de.prototype,"_isGlobal",null),e([o()],de.prototype,"renderOccludedFlags",void 0),e([o({value:!1})],de.prototype,"renderingDisabled",null),e([o({value:!0})],de.prototype,"visible",null),e([o()],de.prototype,"renderPatchBorders",null),e([o()],de.prototype,"visualizeNormals",null),e([o()],de.prototype,"cullBackFaces",null),e([o({value:D.FRONT_TO_BACK})],de.prototype,"renderOrder",null),e([o()],de.prototype,"wireframe",null),de=e([l("esri.views.3d.terrain.TerrainRenderer")],de);const he=g(),ue=g(),ge=g(),pe=g();export{de 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
- import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{q as s,I as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as n}from"../../../../../../chunks/vec42.js";import{freeze as u,fromValues as h}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{EmissiveSourceMode as p}from"../../../../../../symbols/support/materialUtils.js";import{ColorMixModeEnum as c}from"../../../../layers/support/symbolColorUtils.js";import{OverlayContent as d}from"../../../../terrain/OverlayContent.js";import{ComponentTechnique as m}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as g,IntegratedMeshMode as f}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as x}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as v}from"./shader/VertexDiscardMode.js";import{parameter as b,parameterBlock as M,MaterialBase as y,MaterialParameterBlock as T}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as O}from"../../../core/renderPasses/RenderPassIdentifier.js";import{ShaderOutput as C,isColorEmission as S}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as w}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as D}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as N}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as j}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as P}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as q}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as A,CullFaceOptions as R}from"../../../lib/basicInterfaces.js";import{OITPass as I}from"../../../lib/OITPass.js";import{RenderSlot as E}from"../../../lib/RenderSlot.js";import{advancedMRRFactors as F}from"../../../materials/pbrUtils.js";import{defaultHighlightName as B}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as W}from"../../../../../../webscene/support/AlphaCutoff.js";class L extends y{constructor(e,s){super(),this.toMapSpace=s,this.baseColor=u(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=F,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=1,this.emissiveSource=p.Emissive,this.commonMaterialParameters=new V,this.componentParameters=new U,this.objectOpacity=1,this.textureAlphaCutoff=W,this.alphaDiscardMode=A.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=P.Earth,this.hasOccludees=!1;const i=new q(e.position),l=o(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l,this.transformWorldFromModelTL=i.low,this.transformWorldFromModelTH=i.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get hasEmissions(){return null!=this.emissionTexture||!s(this.emissiveBaseColor,l)}get texture(){return this.baseColorTexture?.glTexture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.glTexture}get textureEmissive(){return this.emissionTexture?.glTexture}get textureOcclusion(){return this.occlusionTexture?.glTexture}get textureNormal(){return this.normalTexture?.glTexture}acquireTechnique(e,t,r,o){const s=new g(e.context.spherical);s.renderOccluded=r.slot===E.OCCLUDED_GROUND,s.hasVertexColors=o.colors,s.hasNormals=o.hasNormals,s.textureCoordinateType=o.textureCoordinates,s.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,s.hasOcclusionTexture=null!=this.occlusionTexture,s.hasNormalTexture=null!=this.normalTexture,s.oitPass=t.identifier===O.Material&&null!=r.oitPass?r.oitPass:I.NONE,s.terrainDepthTest=t.identifier===O.Material&&r.terrainDepthTest,s.cullAboveTerrain=t.identifier===O.Material&&r.cullAboveTerrain,s.ellipsoidMode=this.ellipsoidMode,s.componentData=this.componentParameters.type,s.cullFace=this.commonMaterialParameters.cullFace,s.doubleSidedMode=this.commonMaterialParameters.doubleSided?N.View:N.None,s.hasColorTexture=null!=this.baseColorTexture;const i=this._computeWhichMaterialPass();if(s.blendingEnabled=i===k.Transparent||i===k.OpaqueAndTransparent,s.alphaDiscardMode=this.alphaDiscardMode,s.integratedMeshMode=this.isIntegratedMesh?J(r)?z(r)?f.ColorOverlayWithWater:f.ColorOverlay:f.NoOverlay:f.None,s.hasPolygonOffset=this.polygonOffsetEnabled,s.pbrMode=s.integratedMeshMode===f.ColorOverlayWithWater?j.WaterOnIntegratedMesh:this.usePBR?this.hasParametersFromSource?o.shadeNormals&&this.isIntegratedMesh?j.Disabled:j.Schematic:j.Normal:j.Disabled,s.emissionSource=this.hasEmissions?null!=this.emissionTexture?D.Texture:s.pbrMode===j.Normal?D.SymbolColor:D.None:D.None,s.shadeNormals=o.shadeNormals,s.normalType=s.hasNormals?w.Compressed:w.ScreenDerivative,s.hasSlicePlane=null!=r.slicePlane&&this.commonMaterialParameters.hasSlicePlane,s.receiveAmbientOcclusion=s.hasOccludees=s.receiveShadows=s.screenSpaceReflections=s.cloudReflections=s.hasHighlightMixTexture=!1,t.identifier===O.ShadowMap)s.output=C.Shadow,s.vertexDiscardMode=v.None;else if(t.identifier===O.ViewshedShadowMap)s.output=C.ViewshedShadow,s.vertexDiscardMode=v.None;else if(t.identifier===O.Highlight)s.output=C.Highlight,s.vertexDiscardMode=v.None,s.hasHighlightMixTexture=null!=r.highlightMixTexture;else{switch(i===k.OpaqueAndTransparent?s.vertexDiscardMode=t.transparent?v.Opaque:v.Transparent:s.vertexDiscardMode=v.None,s.hasBloom=S(t.output),s.output=t.output,t.output){case C.Color:case C.ColorEmission:s.receiveAmbientOcclusion=o.applySSAO&&null!=r.ssao?.getTexture(),s.hasOccludees=r.hasOccludees,s.receiveShadows=r.shadowMap.ready,s.screenSpaceReflections=null!=r.ssr.lastFrameColor,s.cloudReflections=null!=r.clouds.data?.cubeMap?.colorTexture;break;case C.ObjectAndLayerIdColor:s.objectAndLayerIdColor=!0}s.snowCover=r.snowCover}const a=e.get(m,s);return this._setClean(),a}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:o,renderable:s}=r,{geometry:i}=s,a=s.meta.cameraDepthSquared;o.updateHighlights(t.highlights);const{geometryRanges:l,highlightRangesMap:n,shadowmapRanges:u}=o;switch(this._computeWhichMaterialPass()){case k.Opaque:e.opaque.submitDraw(this,i,l,a);break;case k.Transparent:e.transparent.submitDraw(this,i,l,a);break;case k.OpaqueAndTransparent:e.opaque.submitDraw(this,i,l,a),e.transparent.submitDraw(this,i,l,a);break;case k.IntegratedMesh:e.integratedMesh.submitDraw(this,i,l,a),K(t)&&e.occludedGround.submitDraw(this,i,l,a),G(t)&&e.highlightIntegratedMesh.submitDraw(this,i,l,a)}if(this.componentParameters.castShadows!==H.None){if(null!=n)for(const t of n)t[0]===B&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=u&&e.defaultShadowMap.submitDraw(this,i,u,a),e.shadowMap.submitDraw(this,i,l,a)}if(null!=n)for(const h of n)e.highlight.submitDraw(this,i,h[1],a,h[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,i,l,a)}_computeWhichMaterialPass(){if(this.isIntegratedMesh)return k.IntegratedMesh;if(this.objectOpacity<1)return k.Transparent;if(this.componentParameters.opaqueOverride===H.All)return k.Opaque;if(this.baseColor[3]<1||this.alphaDiscardMode===A.Blend||this.alphaDiscardMode===A.MaskBlend)return k.Transparent;switch(this.componentParameters.transparent){case H.None:return k.Opaque;case H.All:return k.Transparent;case H.Some:return k.OpaqueAndTransparent}}}var k,H;e([b({vectorOps:n})],L.prototype,"baseColor",void 0),e([b()],L.prototype,"usePBR",void 0),e([b()],L.prototype,"hasParametersFromSource",void 0),e([b({vectorOps:i})],L.prototype,"mrrFactors",void 0),e([b({dispose:!0})],L.prototype,"baseColorTexture",void 0),e([b({dispose:!0})],L.prototype,"metallicRoughnessTexture",void 0),e([b({dispose:!0})],L.prototype,"normalTexture",void 0),e([b({dispose:!0})],L.prototype,"occlusionTexture",void 0),e([b({dispose:!0})],L.prototype,"emissionTexture",void 0),e([b({vectorOps:i})],L.prototype,"emissiveBaseColor",void 0),e([b()],L.prototype,"emissiveStrength",void 0),e([b()],L.prototype,"emissiveSource",void 0),e([M()],L.prototype,"commonMaterialParameters",void 0),e([M()],L.prototype,"componentParameters",void 0),e([b()],L.prototype,"objectOpacity",void 0),e([b()],L.prototype,"textureAlphaCutoff",void 0),e([b()],L.prototype,"alphaDiscardMode",void 0),e([b()],L.prototype,"isIntegratedMesh",void 0),e([b()],L.prototype,"polygonOffsetEnabled",void 0),e([b()],L.prototype,"ellipsoidMode",void 0),e([b()],L.prototype,"hasOccludees",void 0),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(k||(k={}));class V extends T{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=R.Back,this.hasSlicePlane=!0}}e([b()],V.prototype,"doubleSided",void 0),e([b()],V.prototype,"cullFace",void 0),e([b()],V.prototype,"hasSlicePlane",void 0);class U extends T{constructor(){super(...arguments),this.externalColor=h(1,1,1,1),this.externalColorMixMode=c.Multiply,this.castShadows=H.All}get transparent(){return this.externalColor[3]<1?H.All:H.None}get opaqueOverride(){return this.externalColorMixMode===c.Replace&&1===this.externalColor[3]?H.All:H.None}get visible(){return this.externalColor[3]>0?H.All:H.None}get type(){return x.Uniform}}e([b({vectorOps:n})],U.prototype,"externalColor",void 0),e([b()],U.prototype,"externalColorMixMode",void 0),e([b()],U.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(H||(H={}));class _ extends T{constructor(){super(...arguments),this.texture=null,this.transparent=H.None,this.opaqueOverride=H.None,this.castShadows=H.None}get type(){return x.Varying}}function G(e){return null!=e.overlay?.getTexture(d.Highlight)}function z(e){return null!=e.overlay?.getTexture(d.WaterNormal)}function J(e){return null!=e.overlay?.getTexture(d.ColorNoRasterImage)}function K(e){return null!=e.overlay?.getTexture(d.Occluded)}e([b()],_.prototype,"texture",void 0),e([b()],_.prototype,"transparent",void 0),e([b()],_.prototype,"opaqueOverride",void 0),e([b()],_.prototype,"castShadows",void 0);export{V as CommonMaterialParameters,L as ComponentMaterial,H as ComponentParameterSummary,U as ComponentParametersUniform,_ as ComponentParametersVarying};
5
+ import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{q as s,I as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as n}from"../../../../../../chunks/vec42.js";import{freeze as u,fromValues as h}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{EmissiveSourceMode as p}from"../../../../../../symbols/support/materialUtils.js";import{ColorMixModeEnum as c}from"../../../../layers/support/symbolColorUtils.js";import{OverlayContent as d}from"../../../../terrain/OverlayContent.js";import{ComponentTechnique as m}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as g,IntegratedMeshMode as f}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as x}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as v}from"./shader/VertexDiscardMode.js";import{parameter as b,parameterBlock as y,MaterialBase as M,MaterialParameterBlock as T}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as O}from"../../../core/renderPasses/RenderPassIdentifier.js";import{ShaderOutput as C,isColorEmission as S}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as w}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as N}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as D}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as j}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as P}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as q}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as A,CullFaceOptions as R}from"../../../lib/basicInterfaces.js";import{OITPass as I}from"../../../lib/OITPass.js";import{RenderSlot as E}from"../../../lib/RenderSlot.js";import{advancedMRRFactors as F}from"../../../materials/pbrUtils.js";import{defaultHighlightName as B}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as W}from"../../../../../../webscene/support/AlphaCutoff.js";class L extends M{constructor(e,s){super(),this.toMapSpace=s,this.baseColor=u(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=F,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=1,this.emissiveSource=p.Emissive,this.commonMaterialParameters=new V,this.componentParameters=new U,this.objectOpacity=1,this.textureAlphaCutoff=W,this.alphaDiscardMode=A.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=P.Earth,this.hasOccludees=!1;const i=new q(e.position),l=o(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l,this.transformWorldFromModelTL=i.low,this.transformWorldFromModelTH=i.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get hasEmissions(){return null!=this.emissionTexture||!s(this.emissiveBaseColor,l)}get texture(){return this.baseColorTexture?.glTexture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.glTexture}get textureEmissive(){return this.emissionTexture?.glTexture}get textureOcclusion(){return this.occlusionTexture?.glTexture}get textureNormal(){return this.normalTexture?.glTexture}acquireTechnique(e,t,r,o){const s=new g(e.context.spherical);s.renderOccluded=r.slot===E.OCCLUDED_GROUND,s.hasVertexColors=o.colors,s.hasNormals=o.hasNormals,s.textureCoordinateType=o.textureCoordinates,s.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,s.hasOcclusionTexture=null!=this.occlusionTexture,s.hasNormalTexture=null!=this.normalTexture,s.oitPass=t.identifier===O.Material&&null!=r.oitPass?r.oitPass:I.NONE,s.terrainDepthTest=t.identifier===O.Material&&r.terrainDepthTest,s.cullAboveTerrain=t.identifier===O.Material&&r.cullAboveTerrain,s.ellipsoidMode=this.ellipsoidMode,s.componentData=this.componentParameters.type,s.cullFace=this.commonMaterialParameters.cullFace,s.doubleSidedMode=this.commonMaterialParameters.doubleSided?D.View:D.None,s.hasColorTexture=null!=this.baseColorTexture;const i=this._computeWhichMaterialPass();if(s.blendingEnabled=i===k.Transparent||i===k.OpaqueAndTransparent,s.alphaDiscardMode=this.alphaDiscardMode,s.integratedMeshMode=this.isIntegratedMesh?J(r)?z(r)?f.ColorOverlayWithWater:f.ColorOverlay:f.NoOverlay:f.None,s.hasPolygonOffset=this.polygonOffsetEnabled,s.pbrMode=s.integratedMeshMode===f.ColorOverlayWithWater?j.WaterOnIntegratedMesh:this.usePBR?this.hasParametersFromSource?o.shadeNormals&&this.isIntegratedMesh?j.Disabled:j.Schematic:j.Normal:j.Disabled,s.emissionSource=this.hasEmissions?null!=this.emissionTexture?N.Texture:s.pbrMode===j.Normal?N.SymbolColor:N.None:N.None,s.shadeNormals=o.shadeNormals,s.normalType=s.hasNormals?w.Compressed:w.ScreenDerivative,s.hasSlicePlane=null!=r.slicePlane&&this.commonMaterialParameters.hasSlicePlane,s.receiveAmbientOcclusion=s.hasOccludees=s.receiveShadows=s.screenSpaceReflections=s.cloudReflections=s.hasHighlightMixTexture=!1,t.identifier===O.ShadowMap)s.output=C.Shadow,s.vertexDiscardMode=v.None;else if(t.identifier===O.ViewshedShadowMap)s.output=C.ViewshedShadow,s.vertexDiscardMode=v.None;else if(t.identifier===O.Highlight)s.output=C.Highlight,s.vertexDiscardMode=v.None,s.hasHighlightMixTexture=null!=r.highlightMixTexture;else{switch(i===k.OpaqueAndTransparent?s.vertexDiscardMode=t.transparent?v.Opaque:v.Transparent:s.vertexDiscardMode=v.None,s.hasBloom=S(t.output),s.output=t.output,t.output){case C.Color:case C.ColorEmission:s.receiveAmbientOcclusion=o.applySSAO&&null!=r.ssao?.getTexture(),s.hasOccludees=r.hasOccludees,s.receiveShadows=r.shadowMap.ready,s.screenSpaceReflections=null!=r.ssr.lastFrameColor,s.cloudReflections=null!=r.clouds.data?.cubeMap?.colorTexture;break;case C.ObjectAndLayerIdColor:s.objectAndLayerIdColor=!0}s.snowCover=r.snowCover}const a=e.get(m,s);return this._setClean(),a}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:o,renderable:s}=r,{geometry:i}=s,a=s.meta.cameraDepthSquared;o.updateHighlights(t.highlights);const{geometryRanges:l,highlightRangesMap:n,shadowmapRanges:u}=o;switch(this._computeWhichMaterialPass()){case k.Opaque:e.opaque.submitDraw(this,i,l,a);break;case k.Transparent:e.transparent.submitDraw(this,i,l,a);break;case k.OpaqueAndTransparent:e.opaque.submitDraw(this,i,l,a),e.transparent.submitDraw(this,i,l,a);break;case k.IntegratedMesh:e.integratedMesh.submitDraw(this,i,l,a),K(t)&&e.occludedGround.submitDraw(this,i,l,a),G(t)&&e.highlightIntegratedMesh.submitDraw(this,i,l,a)}if(this.componentParameters.castShadows!==H.None){if(null!=n)for(const t of n)t[0]===B&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=u&&e.defaultShadowMap.submitDraw(this,i,u,a),e.shadowMap.submitDraw(this,i,l,a)}if(null!=n)for(const h of n)e.highlight.submitDraw(this,i,h[1],a,h[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,i,l,a)}_computeWhichMaterialPass(){if(this.isIntegratedMesh)return k.IntegratedMesh;if(this.objectOpacity<1)return k.Transparent;if(this.componentParameters.opaqueOverride===H.All)return k.Opaque;if(this.baseColor[3]<1||this.alphaDiscardMode===A.Blend||this.alphaDiscardMode===A.MaskBlend)return k.Transparent;switch(this.componentParameters.transparent){case H.None:return k.Opaque;case H.All:return k.Transparent;case H.Some:return k.OpaqueAndTransparent}}}var k,H;e([b({vectorOps:n})],L.prototype,"baseColor",void 0),e([b()],L.prototype,"usePBR",void 0),e([b()],L.prototype,"hasParametersFromSource",void 0),e([b({vectorOps:i})],L.prototype,"mrrFactors",void 0),e([b({dispose:!0})],L.prototype,"baseColorTexture",void 0),e([b({dispose:!0})],L.prototype,"metallicRoughnessTexture",void 0),e([b({dispose:!0})],L.prototype,"normalTexture",void 0),e([b({dispose:!0})],L.prototype,"occlusionTexture",void 0),e([b({dispose:!0})],L.prototype,"emissionTexture",void 0),e([b({vectorOps:i})],L.prototype,"emissiveBaseColor",void 0),e([b()],L.prototype,"emissiveStrength",void 0),e([b()],L.prototype,"emissiveSource",void 0),e([y()],L.prototype,"commonMaterialParameters",void 0),e([y()],L.prototype,"componentParameters",void 0),e([b()],L.prototype,"objectOpacity",void 0),e([b()],L.prototype,"textureAlphaCutoff",void 0),e([b()],L.prototype,"alphaDiscardMode",void 0),e([b()],L.prototype,"isIntegratedMesh",void 0),e([b()],L.prototype,"polygonOffsetEnabled",void 0),e([b()],L.prototype,"ellipsoidMode",void 0),e([b()],L.prototype,"hasOccludees",void 0),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(k||(k={}));class V extends T{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=R.Back,this.hasSlicePlane=!0}}e([b()],V.prototype,"doubleSided",void 0),e([b()],V.prototype,"cullFace",void 0),e([b()],V.prototype,"hasSlicePlane",void 0);class U extends T{constructor(){super(...arguments),this.externalColor=h(1,1,1,1),this.externalColorMixMode=c.Multiply,this.castShadows=H.All}get transparent(){return this.externalColor[3]<1?H.All:H.None}get opaqueOverride(){return this.externalColorMixMode===c.Replace&&1===this.externalColor[3]?H.All:H.None}get visible(){return this.externalColor[3]>0?H.All:H.None}get type(){return x.Uniform}}e([b({vectorOps:n})],U.prototype,"externalColor",void 0),e([b()],U.prototype,"externalColorMixMode",void 0),e([b()],U.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(H||(H={}));class _ extends T{constructor(){super(...arguments),this.texture=null,this.transparent=H.None,this.opaqueOverride=H.None,this.castShadows=H.None}get type(){return x.Varying}}function G(e){return null!=e.overlay?.getTexture(d.Highlight)}function z(e){return null!=e.overlay?.getTexture(d.WaterNormal)}function J(e){return null!=e.overlay?.getTexture(d.ColorNoRasterImage)}function K(e){const t=null!=e.overlay?.getTexture(d.Occluded);return t&&e.overlay?.allSourcesOccludees?null!=e.overlay?.getTexture(d.ColorNoRasterImage):t}e([b()],_.prototype,"texture",void 0),e([b()],_.prototype,"transparent",void 0),e([b()],_.prototype,"opaqueOverride",void 0),e([b()],_.prototype,"castShadows",void 0);export{V as CommonMaterialParameters,L as ComponentMaterial,H as ComponentParameterSummary,U as ComponentParametersUniform,_ as ComponentParametersVarying};
@@ -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"../../../../../../../geometry/support/Ellipsoid.js";import"../../../../../terrain/OverlayContent.js";import"./ComponentData.glsl.js";import"./VertexDiscardMode.js";import"../../../../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../../../../core/shaderLibrary/ShaderOutput.js";import"../../../../core/shaderLibrary/Slice.glsl.js";import"../../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import"../../../../core/shaderLibrary/output/OutputDepth.glsl.js";import"../../../../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../../../../core/shaderLibrary/output/OutputHighlightOverlay.js";import"../../../../core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../../../../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../../../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../../../../core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import"../../../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../../../../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../../../../core/shaderLibrary/terrain/Overlay.glsl.js";import"../../../../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../../../../core/shaderLibrary/util/EllipsoidMode.js";import"../../../../core/shaderModules/glsl.js";import"../../../../core/shaderModules/Texture2DBindUniform.js";import"../../../../core/shaderModules/Texture2DPassUniform.js";import"../../../../effects/weather/SnowCover.glsl.js";import"../../../../shaders/OutputColorHighlightOID.glsl.js";import"../../../../../../webgl/ShaderBuilder.js";import"../../../../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../../../../chunks/ComponentShader.glsl.js";
5
+ import"../../../../../../../geometry/support/Ellipsoid.js";import"../../../../../terrain/OverlayContent.js";import"./ComponentData.glsl.js";import"./VertexDiscardMode.js";import"../../../../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../../../../core/shaderLibrary/ShaderOutput.js";import"../../../../core/shaderLibrary/Slice.glsl.js";import"../../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import"../../../../core/shaderLibrary/output/OutputDepth.glsl.js";import"../../../../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../../../../core/shaderLibrary/output/OutputHighlightOverlay.js";import"../../../../core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../../../../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../../../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../../../../core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import"../../../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../../../../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../../../../core/shaderLibrary/terrain/Overlay.glsl.js";import"../../../../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../../../../core/shaderLibrary/util/EllipsoidMode.js";import"../../../../core/shaderModules/glsl.js";import"../../../../core/shaderModules/Texture2DBindUniform.js";import"../../../../effects/weather/SnowCover.glsl.js";import"../../../../shaders/OutputColorHighlightOID.glsl.js";import"../../../../../../webgl/ShaderBuilder.js";import"../../../../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../../../../chunks/ComponentShader.glsl.js";
@@ -2,7 +2,7 @@
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{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{OverlayIndex as a}from"../../../../terrain/interfaces.js";import{OverlayContent as l}from"../../../../terrain/OverlayContent.js";import{RenderPassIdentifier as i}from"../../renderPasses/RenderPassIdentifier.js";import{ShaderOutput as n,isColorOrColorEmission as d}from"../ShaderOutput.js";import{addMainLightDirection as s,addMainLightIntensity as v}from"../shading/MainLighting.glsl.js";import{PBRMode as c}from"../shading/PhysicallyBasedRenderingParameters.glsl.js";import{Water as u}from"../shading/Water.glsl.js";import{Float4DrawUniform as x}from"../../shaderModules/Float4DrawUniform.js";import{FloatPassUniform as y}from"../../shaderModules/FloatPassUniform.js";import{glsl as m}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as p}from"../../shaderModules/Texture2DPassUniform.js";import{Texture2DUintPassUniform as f}from"../../shaderModules/Texture2DUintPassUniform.js";import{Uniform as g}from"../../../../../webgl/Uniform.js";var h;function C(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new x("overlayTexOffset",(e,o)=>V(e,o)),new x("overlayTexScale",(e,o)=>I(e,o))),t.constants.add("overlayOpacity","float",1),t.uniforms.add(new p("ovColorTex",(e,o)=>b(e,o))),T(e,o)}function O(e,o){const{vertex:r,fragment:t}=e,{output:a}=o;r.uniforms.add(new M("overlayTexOffset"),new M("overlayTexScale")),t.uniforms.add(new y("overlayOpacity",e=>e.overlayOpacity)),a!==n.Highlight&&t.uniforms.add(new p("ovColorTex",(e,o)=>o.overlay?.getTexture(e.overlayContent))),T(e,o)}function T(e,o){const r=o.pbrMode===c.Water||o.pbrMode===c.WaterOnIntegratedMesh||o.pbrMode===c.TerrainWithWater;r&&e.include(u,o);const{vertex:t,fragment:a,varyings:i}=e;i.add("vtcOverlay","vec4");const{output:d}=o,x=d===n.Highlight;t.code.add(m`void setOverlayVTC(in vec2 uv) {
5
+ import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{OverlayIndex as a}from"../../../../terrain/interfaces.js";import{OverlayContent as l}from"../../../../terrain/OverlayContent.js";import{RenderPassIdentifier as i}from"../../renderPasses/RenderPassIdentifier.js";import{ShaderOutput as n,isColorOrColorEmission as d}from"../ShaderOutput.js";import{addMainLightDirection as s,addMainLightIntensity as v}from"../shading/MainLighting.glsl.js";import{PBRMode as c}from"../shading/PhysicallyBasedRenderingParameters.glsl.js";import{Water as u}from"../shading/Water.glsl.js";import{Float4DrawUniform as x}from"../../shaderModules/Float4DrawUniform.js";import{FloatPassUniform as y}from"../../shaderModules/FloatPassUniform.js";import{glsl as m}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as p}from"../../shaderModules/Texture2DPassUniform.js";import{Texture2DUintPassUniform as g}from"../../shaderModules/Texture2DUintPassUniform.js";import{Uniform as f}from"../../../../../webgl/Uniform.js";var h;function C(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new x("overlayTexOffset",(e,o)=>I(e,o)),new x("overlayTexScale",(e,o)=>V(e,o))),t.constants.add("overlayOpacity","float",1),t.uniforms.add(new p("ovColorTex",(e,o)=>O(e,o))),b(e,o)}function O(e,o){return e.identifier===i.Material&&d(e.output)?e.occludedGround?o.overlay?.allSourcesOccludees?o.overlay?.getTexture(l.ColorNoRasterImage):o.overlay?.getTexture(l.Occluded):o.overlay?.getTexture(l.ColorNoRasterImage):e.identifier===i.Material&&e.output===n.ObjectAndLayerIdColor?o.overlay?.getTexture(l.ObjectAndLayerIdColor):e.identifier===i.Highlight?o.overlay?.getTexture(l.Highlight):null}function T(e,o){const{vertex:r,fragment:t}=e,{output:a}=o;r.uniforms.add(new M("overlayTexOffset"),new M("overlayTexScale")),t.uniforms.add(new y("overlayOpacity",e=>e.overlayOpacity)),a!==n.Highlight&&t.uniforms.add(new p("ovColorTex",(e,o)=>o.overlay?.getTexture(e.overlayContent))),b(e,o)}function b(e,o){const r=o.pbrMode===c.Water||o.pbrMode===c.WaterOnIntegratedMesh||o.pbrMode===c.TerrainWithWater;r&&e.include(u,o);const{vertex:t,fragment:a,varyings:i}=e;i.add("vtcOverlay","vec4");const{output:d}=o,x=d===n.Highlight;t.code.add(m`void setOverlayVTC(in vec2 uv) {
6
6
  vtcOverlay = vec4(uv, uv) * overlayTexScale + overlayTexOffset;
7
7
  }`),a.code.add(m`bool isValid(vec2 uv, vec2 dxdy) {
8
8
  return (uv.x >= 0.0 + dxdy.x) && (uv.x <= 1.0 - dxdy.x) && (uv.y >= 0.0 + dxdy.y) && (uv.y <= 1.0 - dxdy.y);
@@ -13,7 +13,7 @@ vec4 color1 = texture(ov0Tex, vec2(texCoords.z * 0.5 + 0.5, texCoords.w));
13
13
  bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy));
14
14
  bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0));
15
15
  return mix(color1 * float(isValid1), color0, float(isValid0));
16
- }`),x?a.uniforms.add(new f("overlayHighlightTexture",(e,o)=>o.overlay?.getTexture(l.Highlight))).code.add(m`uvec2 getAllOverlayHighlightValuesEncoded() {
16
+ }`),x?a.uniforms.add(new g("overlayHighlightTexture",(e,o)=>o.overlay?.getTexture(l.Highlight))).code.add(m`uvec2 getAllOverlayHighlightValuesEncoded() {
17
17
  vec4 texCoords = vtcOverlay;
18
18
  vec2 uvInner = texCoords.xy;
19
19
  vec2 uvOuter = texCoords.zw;
@@ -44,4 +44,4 @@ vec3 n = normalize(tbn * (2.0 * maskInput.rgb - vec3(1.0)));
44
44
  vec3 v = vposEyeDir;
45
45
  vec3 final = getSeaColor(n, v, mainLightDirection, colorInput.rgb, mainLightIntensity, localUp, 1.0 - shadow, maskInput.w, position, positionWorld);
46
46
  return vec4(final, colorInput.w);
47
- }`))}function b(e,o){return e.identifier===i.Material&&d(e.output)?e.occludedGround?o.overlay?.getTexture(l.Occluded):o.overlay?.getTexture(l.ColorNoRasterImage):e.identifier===i.Material&&e.output===n.ObjectAndLayerIdColor?o.overlay?.getTexture(l.ObjectAndLayerIdColor):e.identifier===i.Highlight?o.overlay?.getTexture(l.Highlight):null}function V(e,l){const i=l.overlay?.overlays[a.INNER]?.extent;o(i)&&(w[0]=e.toMapSpace[0]/r(i)-i[0]/r(i),w[1]=e.toMapSpace[1]/t(i)-i[1]/t(i));const n=l.overlay?.overlays[a.OUTER]?.extent;return o(n)&&(w[2]=e.toMapSpace[0]/r(n)-n[0]/r(n),w[3]=e.toMapSpace[1]/t(n)-n[1]/t(n)),w}function I(e,l){const i=l.overlay?.overlays[a.INNER]?.extent;o(i)&&(w[0]=e.toMapSpace[2]/r(i),w[1]=e.toMapSpace[3]/t(i));const n=l.overlay?.overlays[a.OUTER]?.extent;return o(n)&&(w[2]=e.toMapSpace[2]/r(n),w[3]=e.toMapSpace[3]/t(n)),w}!function(e){e[e.Disabled=0]="Disabled",e[e.Enabled=1]="Enabled",e[e.EnabledWithWater=2]="EnabledWithWater",e[e.COUNT=3]="COUNT"}(h||(h={}));const w=e();class M extends g{constructor(e){super(e,"vec4")}}export{C as OverlayIM,h as OverlayMode,O as OverlayTerrain,b as getIMColorTexture};
47
+ }`))}function I(e,l){const i=l.overlay?.overlays[a.INNER]?.extent;o(i)&&(w[0]=e.toMapSpace[0]/r(i)-i[0]/r(i),w[1]=e.toMapSpace[1]/t(i)-i[1]/t(i));const n=l.overlay?.overlays[a.OUTER]?.extent;return o(n)&&(w[2]=e.toMapSpace[0]/r(n)-n[0]/r(n),w[3]=e.toMapSpace[1]/t(n)-n[1]/t(n)),w}function V(e,l){const i=l.overlay?.overlays[a.INNER]?.extent;o(i)&&(w[0]=e.toMapSpace[2]/r(i),w[1]=e.toMapSpace[3]/t(i));const n=l.overlay?.overlays[a.OUTER]?.extent;return o(n)&&(w[2]=e.toMapSpace[2]/r(n),w[3]=e.toMapSpace[3]/t(n)),w}!function(e){e[e.Disabled=0]="Disabled",e[e.Enabled=1]="Enabled",e[e.EnabledWithWater=2]="EnabledWithWater",e[e.COUNT=3]="COUNT"}(h||(h={}));const w=e();class M extends f{constructor(e){super(e,"vec4")}}export{C as OverlayIM,h as OverlayMode,T as OverlayTerrain,O as getIMColorTexture};
@@ -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{_ as t}from"../../../../chunks/tslib.es6.js";import{disposeMaybe as e}from"../../../../core/maybe.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{createQuadVAO as s}from"./glUtil3D.js";import{SortedRenderGeometryRenderer as o}from"./SortedRenderGeometryRenderer.js";import{HeatmapPassParameters as n,HeatmapTechnique as h}from"../shaders/HeatmapTechnique.js";import{HeatmapTechniqueConfiguration as p}from"../shaders/HeatmapTechniqueConfiguration.js";import{TextureWrapMode as m,PixelType as c,FramebufferBit as l}from"../../../webgl/enums.js";import{FramebufferObject as d}from"../../../webgl/FramebufferObject.js";import{Texture as u}from"../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../webgl/TextureDescriptor.js";import{vertexCount as _}from"../../../webgl/Util.js";let g=class extends o{constructor(t){super(t),this.pixelRatio=1,this._colorRampData=new Uint8ClampedArray(4),this.type="draped-heatmap",this._heatmapParameters=new n,this._configuration=new p;const e=new y;e.pixelFormat=t.pixelFormat,e.internalFormat=t.internalFormat,e.dataType=t.dataType,e.samplingMode=t.samplingMode,e.wrapMode=m.CLAMP_TO_EDGE;const r=t.rendererContext.rctx;this._densityMap=new d(r,e),this._quad=s(r),this._configuration.usesHalfFloat=t.dataType!==c.FLOAT,t.rendererContext.pluginContext.techniques.precompile(h,this._configuration)}initialize(){const t=this._colorRampData,e=new y(t.length/4,1);e.wrapMode=m.CLAMP_TO_EDGE,this._colorRamp=new u(this.rctx,e,t),this._heatmapParameters.densityMap=this._densityMap.colorTexture,this.addHandles(r(()=>[this.colorRampData,this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius],()=>this.rendererContext.notifyContentChanged()))}destroy(){this._densityMap=e(this._densityMap),this._quad=e(this._quad),this._colorRamp=e(this._colorRamp)}get searchRadius(){return this._heatmapParameters.searchRadius}set searchRadius(t){t!==this._heatmapParameters.searchRadius&&(this._heatmapParameters.searchRadius=t,this.notifyChange("searchRadius"))}get minDensity(){return this._heatmapParameters.minDensity}set minDensity(t){t!==this._heatmapParameters.minDensity&&(this._heatmapParameters.minDensity=t,this.notifyChange("minDensity"))}get maxDensity(){return this._heatmapParameters.maxDensity}set maxDensity(t){t!==this._heatmapParameters.maxDensity&&(this._heatmapParameters.maxDensity=t,this.notifyChange("maxDensity"))}get fieldTotal(){return this._heatmapParameters.fieldTotal}set fieldTotal(t){this._heatmapParameters.fieldTotal=t,this.notifyChange("fieldTotal")}get colorRampData(){return this._colorRampData}set colorRampData(t){const{colorRamp:e}=this._heatmapParameters;if(null!=e&&t!==this._colorRampData){const r=e.descriptor.width,a=t.length/4;a!==r&&e.resize(a,1),e.setData(t)}this._colorRampData=t}get _colorRamp(){return this._heatmapParameters.colorRamp}set _colorRamp(t){this._heatmapParameters.colorRamp=t}get hasHighlights(){return!1}get hasWater(){return!1}get rendersOccludedDraped(){return!1}render(t){const e=this.sortedRenderers;if(0===e.length)return;const r=this.rctx.getBoundFramebufferObject(),a=this.rctx.getViewport(),{pixelRatio:i}=this,s=Math.ceil(a.width*i),o=Math.ceil(a.height*i);this._densityMap.resize(s,o),this.rctx.bindFramebuffer(this._densityMap),this.rctx.setViewport(0,0,s,o),this.rctx.clear(l.COLOR);let n=!1;if(e.forAll(e=>{const r=e.acquireTechniques(t);r&&(e.render(t,r),n=!0)}),this.rctx.bindFramebuffer(r),this.rctx.setViewport(a.x,a.y,a.width,a.height),!n)return;this.rctx.bindVAO(this._quad);const p=this.rendererContext.pluginContext.techniques.get(h,this._configuration);this.rctx.bindTechnique(p,t.bind,this._heatmapParameters),this.rctx.drawArrays(p.primitiveType,0,_(this._quad,"geometry"))}};t([a()],g.prototype,"searchRadius",null),t([a()],g.prototype,"minDensity",null),t([a()],g.prototype,"maxDensity",null),t([a()],g.prototype,"fieldTotal",null),t([a()],g.prototype,"pixelRatio",void 0),t([a()],g.prototype,"colorRampData",null),t([a({constructOnly:!0})],g.prototype,"dataType",void 0),t([a({constructOnly:!0})],g.prototype,"samplingMode",void 0),t([a({constructOnly:!0})],g.prototype,"pixelFormat",void 0),t([a({constructOnly:!0})],g.prototype,"internalFormat",void 0),t([a()],g.prototype,"_colorRampData",void 0),g=t([i("esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer")],g);export{g as DrapedHeatmapRenderer};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{disposeMaybe as e}from"../../../../core/maybe.js";import{watch as r}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{createQuadVAO as s}from"./glUtil3D.js";import{SortedRenderGeometryRenderer as o}from"./SortedRenderGeometryRenderer.js";import{HeatmapPassParameters as n,HeatmapTechnique as h}from"../shaders/HeatmapTechnique.js";import{HeatmapTechniqueConfiguration as m}from"../shaders/HeatmapTechniqueConfiguration.js";import{TextureWrapMode as p,PixelType as l,FramebufferBit as c}from"../../../webgl/enums.js";import{FramebufferObject as d}from"../../../webgl/FramebufferObject.js";import{Texture as u}from"../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../webgl/TextureDescriptor.js";import{vertexCount as _}from"../../../webgl/Util.js";let f=class extends o{constructor(t){super(t),this.pixelRatio=1,this._colorRampData=new Uint8ClampedArray(4),this.type="draped-heatmap",this._heatmapParameters=new n,this._configuration=new m;const e=new y;e.pixelFormat=t.pixelFormat,e.internalFormat=t.internalFormat,e.dataType=t.dataType,e.samplingMode=t.samplingMode,e.wrapMode=p.CLAMP_TO_EDGE;const r=t.rendererContext.rctx;this._densityMap=new d(r,e),this._quad=s(r),this._configuration.usesHalfFloat=t.dataType!==l.FLOAT,t.rendererContext.pluginContext.techniques.precompile(h,this._configuration)}initialize(){const t=this._colorRampData,e=new y(t.length/4,1);e.wrapMode=p.CLAMP_TO_EDGE,this._colorRamp=new u(this.rctx,e,t),this._heatmapParameters.densityMap=this._densityMap.colorTexture,this.addHandles(r(()=>[this.colorRampData,this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius],()=>this.rendererContext.notifyContentChanged()))}destroy(){this._densityMap=e(this._densityMap),this._quad=e(this._quad),this._colorRamp=e(this._colorRamp)}get searchRadius(){return this._heatmapParameters.searchRadius}set searchRadius(t){t!==this._heatmapParameters.searchRadius&&(this._heatmapParameters.searchRadius=t,this.notifyChange("searchRadius"))}get minDensity(){return this._heatmapParameters.minDensity}set minDensity(t){t!==this._heatmapParameters.minDensity&&(this._heatmapParameters.minDensity=t,this.notifyChange("minDensity"))}get maxDensity(){return this._heatmapParameters.maxDensity}set maxDensity(t){t!==this._heatmapParameters.maxDensity&&(this._heatmapParameters.maxDensity=t,this.notifyChange("maxDensity"))}get fieldTotal(){return this._heatmapParameters.fieldTotal}set fieldTotal(t){this._heatmapParameters.fieldTotal=t,this.notifyChange("fieldTotal")}get colorRampData(){return this._colorRampData}set colorRampData(t){const{colorRamp:e}=this._heatmapParameters;if(null!=e&&t!==this._colorRampData){const r=e.descriptor.width,a=t.length/4;a!==r&&e.resize(a,1),e.setData(t)}this._colorRampData=t}get _colorRamp(){return this._heatmapParameters.colorRamp}set _colorRamp(t){this._heatmapParameters.colorRamp=t}get hasHighlights(){return!1}get hasWater(){return!1}render(t){const e=this.sortedRenderers;if(0===e.length)return;const r=this.rctx.getBoundFramebufferObject(),a=this.rctx.getViewport(),{pixelRatio:i}=this,s=Math.ceil(a.width*i),o=Math.ceil(a.height*i);this._densityMap.resize(s,o),this.rctx.bindFramebuffer(this._densityMap),this.rctx.setViewport(0,0,s,o),this.rctx.clear(c.COLOR);let n=!1;if(e.forAll(e=>{const r=e.acquireTechniques(t);r&&(e.render(t,r),n=!0)}),this.rctx.bindFramebuffer(r),this.rctx.setViewport(a.x,a.y,a.width,a.height),!n)return;this.rctx.bindVAO(this._quad);const m=this.rendererContext.pluginContext.techniques.get(h,this._configuration);this.rctx.bindTechnique(m,t.bind,this._heatmapParameters),this.rctx.drawArrays(m.primitiveType,0,_(this._quad,"geometry"))}};t([a()],f.prototype,"searchRadius",null),t([a()],f.prototype,"minDensity",null),t([a()],f.prototype,"maxDensity",null),t([a()],f.prototype,"fieldTotal",null),t([a()],f.prototype,"pixelRatio",void 0),t([a()],f.prototype,"colorRampData",null),t([a({constructOnly:!0})],f.prototype,"dataType",void 0),t([a({constructOnly:!0})],f.prototype,"samplingMode",void 0),t([a({constructOnly:!0})],f.prototype,"pixelFormat",void 0),t([a({constructOnly:!0})],f.prototype,"internalFormat",void 0),t([a()],f.prototype,"_colorRampData",void 0),f=t([i("esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer")],f);export{f as DrapedHeatmapRenderer};
@@ -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{i as t,d as n,n as e,c as o,g as s,f as r,h as l,t as h,e as u}from"../../../../chunks/vec32.js";import{fromValues as c,clone as a,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{create as p,clone as i,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as g}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as O,floatArrayFrom as m}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as A,getZeroIndexArray as M}from"../../../../geometry/support/Indices.js";import{create as I,fromPositionAndNormal as y,intersectRay as N}from"../../../../geometry/support/plane.js";import{wrap as P}from"../../../../geometry/support/ray.js";import{Attribute as T}from"./Attribute.js";import{Vec3Compact as S}from"./BufferVectorMath.js";import{Geometry as R}from"./Geometry.js";import{assert as b}from"./Util.js";import{VertexAttribute as L}from"./VertexAttribute.js";import{GeometryType as d}from"./IntersectableGeometry.js";const j=S,E=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],U=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],V=[0,0,1,0,1,1,0,1],v=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],x=new Array(36);for(let Nt=0;Nt<6;Nt++)for(let t=0;t<6;t++)x[6*Nt+t]=Nt;const F=new Array(36);for(let Nt=0;Nt<6;Nt++)F[6*Nt]=0,F[6*Nt+1]=1,F[6*Nt+2]=2,F[6*Nt+3]=2,F[6*Nt+4]=3,F[6*Nt+5]=0;function C(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(24);for(let o=0;o<8;o++)e[3*o]=E[o][0]*n[0],e[3*o+1]=E[o][1]*n[1],e[3*o+2]=E[o][2]*n[2];return new R(t,[[L.POSITION,new T(e,v,3,!0)],[L.NORMAL,new T(U,x,3)],[L.UV0,new T(V,F,2)]])}const G=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],D=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],q=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],z=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function B(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(18);for(let o=0;o<6;o++)e[3*o]=G[o][0]*n[0],e[3*o+1]=G[o][1]*n[1],e[3*o+2]=G[o][2]*n[2];return new R(t,[[L.POSITION,new T(e,q,3,!0)],[L.NORMAL,new T(D,z,3)]])}const k=c(-.5,0,-.5),Z=c(.5,0,-.5),H=c(0,0,.5),J=c(0,.5,0),K=f(),Q=f(),W=f(),X=f(),Y=f();n(K,k,J),n(Q,k,Z),l(W,K,Q),e(W,W),n(K,Z,J),n(Q,Z,H),l(X,K,Q),e(X,X),n(K,H,J),n(Q,H,k),l(Y,K,Q),e(Y,Y);const $=[k,Z,H,J],_=[0,-1,0,W[0],W[1],W[2],X[0],X[1],X[2],Y[0],Y[1],Y[2]],tt=[0,1,2,3,1,0,3,2,1,3,0,2],nt=[0,0,0,1,1,1,2,2,2,3,3,3];function et(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(12);for(let o=0;o<4;o++)e[3*o]=$[o][0]*n[0],e[3*o+1]=$[o][1]*n[1],e[3*o+2]=$[o][2]*n[2];return new R(t,[[L.POSITION,new T(e,tt,3,!0)],[L.NORMAL,new T(_,nt,3)]])}function ot(t,n,e,o,s={uv:!0}){const r=-Math.PI,l=2*Math.PI,h=-Math.PI/2,u=Math.PI,c=Math.max(3,Math.floor(e)),a=Math.max(2,Math.floor(o)),f=(c+1)*(a+1),p=O(3*f),i=O(3*f),w=O(2*f),g=[];let m=0;for(let O=0;O<=a;O++){const t=[],e=O/a,o=h+e*u,s=Math.cos(o);for(let h=0;h<=c;h++){const u=h/c,a=r+u*l,f=Math.cos(a)*s,g=Math.sin(o),O=-Math.sin(a)*s;p[3*m]=f*n,p[3*m+1]=g*n,p[3*m+2]=O*n,i[3*m]=f,i[3*m+1]=g,i[3*m+2]=O,w[2*m]=u,w[2*m+1]=e,t.push(m),++m}g.push(t)}const A=new Array;for(let O=0;O<a;O++)for(let t=0;t<c;t++){const n=g[O][t],e=g[O][t+1],o=g[O+1][t+1],s=g[O+1][t];0===O?(A.push(n),A.push(o),A.push(s)):O===a-1?(A.push(n),A.push(e),A.push(o)):(A.push(n),A.push(e),A.push(o),A.push(o),A.push(s),A.push(n))}const I=[[L.POSITION,new T(p,A,3,!0)],[L.NORMAL,new T(i,A,3,!0)]];return s.uv&&I.push([L.UV0,new T(w,A,2,!0)]),s.offset&&(I[0][0]=L.OFFSET,I.push([L.POSITION,new T(Float64Array.from(s.offset),M(A.length),3,!0)])),new R(t,I)}function st(t,n,e,o){const s=rt(n,e,o);return new R(t,s)}function rt(t,n,e){const o=t;let s,r;if(e)s=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],r=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const t=o*(1+Math.sqrt(5))/2;s=[-o,t,0,o,t,0,-o,-t,0,o,-t,0,0,-o,t,0,o,t,0,-o,-t,0,o,-t,t,0,-o,t,0,o,-t,0,-o,-t,0,o],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let c=0;c<s.length;c+=3)j.scale(s,c,t/j.length(s,c));let l={};function h(n,e){n>e&&([n,e]=[e,n]);const o=n.toString()+"."+e.toString();if(l[o])return l[o];let r=s.length;return s.length+=3,j.add(s,3*n,s,3*e,s,r),j.scale(s,r,t/j.length(s,r)),r/=3,l[o]=r,r}for(let c=0;c<n;c++){const t=r.length,n=new Array(4*t);for(let e=0;e<t;e+=3){const t=r[e],o=r[e+1],s=r[e+2],l=h(t,o),u=h(o,s),c=h(s,t),a=4*e;n[a]=t,n[a+1]=l,n[a+2]=c,n[a+3]=o,n[a+4]=u,n[a+5]=l,n[a+6]=s,n[a+7]=c,n[a+8]=u,n[a+9]=l,n[a+10]=u,n[a+11]=c}r=n,l={}}const u=m(s);for(let c=0;c<u.length;c+=3)j.normalize(u,c);return[[L.POSITION,new T(m(s),r,3,!0)],[L.NORMAL,new T(u,r,3,!0)]]}function lt(t,{normal:n,position:e,color:o,rotation:s,size:r,centerOffsetAndDistance:l,uvi:h,featureAttribute:u,objectAndLayerIdColor:c=null}={}){const a=e?i(e):p(),f=n?i(n):w(0,0,1),g=o?[o[0],o[1],o[2],o.length>3?o[3]:255]:[255,255,255,255],O=null!=r&&2===r.length?r:[1,1],m=null!=s?[s]:[0],A=M(1),I=[[L.POSITION,new T(a,A,3,!0)],[L.NORMAL,new T(f,A,3,!0)],[L.COLOR,new T(g,A,4,!0)],[L.SIZE,new T(O,A,2)],[L.ROTATION,new T(m,A,1,!0)]];if(h&&I.push([L.UVI,new T(h,A,h.length)]),null!=l){const t=[l[0],l[1],l[2],l[3]];I.push([L.CENTEROFFSETANDDISTANCE,new T(t,A,4)])}if(u){const t=[u[0],u[1],u[2],u[3]];I.push([L.FEATUREATTRIBUTE,new T(t,A,4)])}return new R(t,I,null,d.Point,c)}const ht=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function ut(t,n=ht){const e=new Array(12);for(let c=0;c<4;c++)for(let t=0;t<3;t++)e[3*c+t]=n[c][t];const o=[0,1,2,2,3,0],s=[0,0,1],r=[0,0,0,0,0,0],l=[0,0,1,0,1,1,0,1],h=[255,255,255,255],u=[[L.POSITION,new T(e,o,3,!0)],[L.NORMAL,new T(s,r,3,!0)],[L.UV0,new T(l,o,2,!0)],[L.COLOR,new T(h,r,4,!0)]];return new R(t,u)}function ct(t,n,e,o,s=!0,r=!0){let l=0;const h=n,u=t;let a=c(0,l,0),f=c(0,l+u,0),p=c(0,-1,0),i=c(0,1,0);o&&(l=u,f=c(0,0,0),a=c(0,l,0),p=c(0,1,0),i=c(0,-1,0));const w=[f,a],g=[p,i],m=e+2,A=Math.sqrt(u*u+h*h);if(o)for(let O=e-1;O>=0;O--){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*h,l,Math.sin(t)*h);w.push(n);const o=c(u*Math.cos(t)/A,-h/A,u*Math.sin(t)/A);g.push(o)}else for(let O=0;O<e;O++){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*h,l,Math.sin(t)*h);w.push(n);const o=c(u*Math.cos(t)/A,h/A,u*Math.sin(t)/A);g.push(o)}const M=new Array,I=new Array;if(s){for(let t=3;t<w.length;t++)M.push(1),M.push(t-1),M.push(t),I.push(0),I.push(0),I.push(0);M.push(w.length-1),M.push(2),M.push(1),I.push(0),I.push(0),I.push(0)}if(r){for(let t=3;t<w.length;t++)M.push(t),M.push(t-1),M.push(0),I.push(t),I.push(t-1),I.push(1);M.push(0),M.push(2),M.push(w.length-1),I.push(1),I.push(2),I.push(g.length-1)}const y=O(3*m);for(let c=0;c<m;c++)y[3*c]=w[c][0],y[3*c+1]=w[c][1],y[3*c+2]=w[c][2];const N=O(3*m);for(let c=0;c<m;c++)N[3*c]=g[c][0],N[3*c+1]=g[c][1],N[3*c+2]=g[c][2];return[[L.POSITION,new T(y,M,3,!0)],[L.NORMAL,new T(N,I,3,!0)]]}function at(t,n,e,o,s,r=!0,l=!0){return new R(t,ct(n,e,o,s,r,l))}function ft(n,o,h,p,i,w,g){const m=i?a(i):c(1,0,0),A=w?a(w):c(0,0,0);g??=!0;const M=f();e(M,m);const I=f();s(I,M,Math.abs(o));const y=f();s(y,I,-.5),r(y,y,A);const N=c(0,1,0);Math.abs(1-u(M,N))<.2&&t(N,0,0,1);const P=f();l(P,M,N),e(P,P),l(N,P,M);const S=2*p+(g?2:0),b=p+(g?2:0),d=O(3*S),j=O(3*b),E=O(2*S),U=new Array(3*p*(g?4:2)),V=new Array(3*p*(g?4:2));g&&(d[3*(S-2)]=y[0],d[3*(S-2)+1]=y[1],d[3*(S-2)+2]=y[2],E[2*(S-2)]=0,E[2*(S-2)+1]=0,d[3*(S-1)]=d[3*(S-2)]+I[0],d[3*(S-1)+1]=d[3*(S-2)+1]+I[1],d[3*(S-1)+2]=d[3*(S-2)+2]+I[2],E[2*(S-1)]=1,E[2*(S-1)+1]=1,j[3*(b-2)]=-M[0],j[3*(b-2)+1]=-M[1],j[3*(b-2)+2]=-M[2],j[3*(b-1)]=M[0],j[3*(b-1)+1]=M[1],j[3*(b-1)+2]=M[2]);const v=(t,n,e)=>{U[t]=n,V[t]=e};let x=0;const F=f(),C=f();for(let t=0;t<p;t++){const n=t*(2*Math.PI/p);s(F,N,Math.sin(n)),s(C,P,Math.cos(n)),r(F,F,C),j[3*t]=F[0],j[3*t+1]=F[1],j[3*t+2]=F[2],s(F,F,h),r(F,F,y),d[3*t]=F[0],d[3*t+1]=F[1],d[3*t+2]=F[2],E[2*t]=t/p,E[2*t+1]=0,d[3*(t+p)]=d[3*t]+I[0],d[3*(t+p)+1]=d[3*t+1]+I[1],d[3*(t+p)+2]=d[3*t+2]+I[2],E[2*(t+p)]=t/p,E[2*t+1]=1;const e=(t+1)%p;v(x++,t,t),v(x++,t+p,t),v(x++,e,e),v(x++,e,e),v(x++,t+p,t),v(x++,e+p,e)}if(g){for(let t=0;t<p;t++){const n=(t+1)%p;v(x++,S-2,b-2),v(x++,t,b-2),v(x++,n,b-2)}for(let t=0;t<p;t++){const n=(t+1)%p;v(x++,t+p,b-1),v(x++,S-1,b-1),v(x++,n+p,b-1)}}const G=[[L.POSITION,new T(d,U,3,!0)],[L.NORMAL,new T(j,V,3,!0)],[L.UV0,new T(E,U,2,!0)]];return new R(n,G)}function pt(t,n,e,o,s,r){o=o||10,s=null==s||s,b(n.length>1);const l=[[0,0,0]],h=[],u=[];for(let c=0;c<o;c++){h.push([0,-c-1,-(c+1)%o-1]);const t=c/o*2*Math.PI;u.push([Math.cos(t)*e,Math.sin(t)*e])}return it(t,u,n,l,h,s,r)}function it(h,u,a,f,i,w,g=c(0,0,0)){const m=u.length,A=O(a.length*m*3+(6*f.length||0)),M=O(a.length*m*3+(f?6:0)),S=new Array,b=new Array;let d=0,j=0;const E=p(),U=p(),V=p(),v=p(),x=p(),F=p(),C=p(),G=p(),D=p(),q=p(),z=p(),B=p(),k=p(),Z=I();t(D,0,1,0),n(U,a[1],a[0]),e(U,U),w?(r(G,a[0],g),e(V,G)):t(V,0,0,1),Mt(U,V,D,D,x,V,It),o(v,V),o(B,x);for(let t=0;t<f.length;t++)s(F,x,f[t][0]),s(G,V,f[t][2]),r(F,F,G),r(F,F,a[0]),A[d++]=F[0],A[d++]=F[1],A[d++]=F[2];M[j++]=-U[0],M[j++]=-U[1],M[j++]=-U[2];for(let t=0;t<i.length;t++)S.push(i[t][0]>0?i[t][0]:-i[t][0]-1+f.length),S.push(i[t][1]>0?i[t][1]:-i[t][1]-1+f.length),S.push(i[t][2]>0?i[t][2]:-i[t][2]-1+f.length),b.push(0),b.push(0),b.push(0);let H=f.length;const J=f.length-1;for(let t=0;t<a.length;t++){let h=!1;if(t>0){o(E,U),t<a.length-1?(n(U,a[t+1],a[t]),e(U,U)):h=!0,r(q,E,U),e(q,q),r(z,a[t-1],v),y(a[t],q,Z);N(Z,P(z,E),G)?(n(G,G,a[t]),e(V,G),l(x,q,V),e(x,x)):Mt(q,v,B,D,x,V,It),o(v,V),o(B,x)}w&&(r(G,a[t],g),e(k,G));for(let n=0;n<m;n++)if(s(F,x,u[n][0]),s(G,V,u[n][1]),r(F,F,G),e(C,F),M[j++]=C[0],M[j++]=C[1],M[j++]=C[2],r(F,F,a[t]),A[d++]=F[0],A[d++]=F[1],A[d++]=F[2],!h){const t=(n+1)%m;S.push(H+n),S.push(H+m+n),S.push(H+t),S.push(H+t),S.push(H+m+n),S.push(H+m+t);for(let n=0;n<6;n++){const t=S.length-6;b.push(S[t+n]-J)}}H+=m}const K=a[a.length-1];for(let t=0;t<f.length;t++)s(F,x,f[t][0]),s(G,V,f[t][1]),r(F,F,G),r(F,F,K),A[d++]=F[0],A[d++]=F[1],A[d++]=F[2];const Q=j/3;M[j++]=U[0],M[j++]=U[1],M[j++]=U[2];const W=H-m;for(let t=0;t<i.length;t++)S.push(i[t][0]>=0?H+i[t][0]:-i[t][0]-1+W),S.push(i[t][2]>=0?H+i[t][2]:-i[t][2]-1+W),S.push(i[t][1]>=0?H+i[t][1]:-i[t][1]-1+W),b.push(Q),b.push(Q),b.push(Q);const X=[[L.POSITION,new T(A,S,3,!0)],[L.NORMAL,new T(M,b,3,!0)]];return new R(h,X)}function wt(t,n,e,o){b(n.length>1,"createPolylineGeometry(): polyline needs at least 2 points"),b(3===n[0].length,"createPolylineGeometry(): malformed vertex"),b(null==e||e.length===n.length,"createPolylineGeometry: need same number of points and normals"),b(null==e||3===e[0].length,"createPolylineGeometry(): malformed normal");const s=g(3*n.length),r=new Array(2*(n.length-1));let l=0,h=0;for(let c=0;c<n.length;c++){for(let t=0;t<3;t++)s[l++]=n[c][t];c>0&&(r[h++]=c-1,r[h++]=c)}const u=[[L.POSITION,new T(s,r,3,!0)]];if(e){const t=O(3*e.length);let o=0;for(let s=0;s<n.length;s++)for(let n=0;n<3;n++)t[o++]=e[s][n];u.push([L.NORMAL,new T(t,r,3,!0)])}return o&&u.push([L.COLOR,new T(o,A(o.length/4),4)]),new R(t,u,null,d.Line)}function gt(t,n,e,o,s,r=0){const l=new Array(18),h=[[-e,r,s/2],[o,r,s/2],[0,n+r,s/2],[-e,r,-s/2],[o,r,-s/2],[0,n+r,-s/2]],u=[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5];for(let c=0;c<6;c++)l[3*c]=h[c][0],l[3*c+1]=h[c][1],l[3*c+2]=h[c][2];return new R(t,[[L.POSITION,new T(l,u,3,!0)]])}function Ot(n,e){const o=n.getMutableAttribute(L.POSITION).data;for(let s=0;s<o.length;s+=3){const n=o[s],r=o[s+1],l=o[s+2];t(yt,n,r,l),h(yt,yt,e),o[s]=yt[0],o[s+1]=yt[1],o[s+2]=yt[2]}}function mt(t,n=t){const e=t.attributes,o=e.get(L.POSITION).data,s=e.get(L.NORMAL).data;if(s){const t=n.getMutableAttribute(L.NORMAL).data;for(let n=0;n<s.length;n+=3){const e=s[n+1];t[n+1]=-s[n+2],t[n+2]=e}}if(o){const t=n.getMutableAttribute(L.POSITION).data;for(let n=0;n<o.length;n+=3){const e=o[n+1];t[n+1]=-o[n+2],t[n+2]=e}}}function At(t,n,o,s,r){return!(Math.abs(u(n,t))>r)&&(l(o,t,n),e(o,o),l(s,o,t),e(s,s),!0)}function Mt(t,n,e,o,s,r,l){return At(t,n,s,r,l)||At(t,e,s,r,l)||At(t,o,s,r,l)}const It=.99619469809,yt=p();export{mt as cgToGIS,C as createBoxGeometry,at as createConeGeometry,ct as createConeGeometryData,ft as createCylinderGeometry,B as createDiamondGeometry,gt as createExtrudedTriangle,it as createPathExtrusionGeometry,lt as createPointGeometry,rt as createPolySphereData,st as createPolySphereGeometry,wt as createPolylineGeometry,ot as createSphereGeometry,ut as createSquareGeometry,et as createTetrahedronGeometry,pt as createTubeGeometry,Mt as makeOrthoBasisDirUpFallback,Ot as transformInPlace};
5
+ import{i as t,d as n,n as e,c as s,g as o,f as r,h,t as l,e as u}from"../../../../chunks/vec32.js";import{fromValues as c,clone as a,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{create as p,clone as i,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as g}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as O,floatArrayFrom as A}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as M,getZeroIndexArray as I}from"../../../../geometry/support/Indices.js";import{create as m,fromPositionAndNormal as y,intersectRay as N}from"../../../../geometry/support/plane.js";import{wrap as T}from"../../../../geometry/support/ray.js";import{timeStampsToAttribute as P}from"../../support/engineContent/line.js";import{Attribute as S}from"./Attribute.js";import{Vec3Compact as R}from"./BufferVectorMath.js";import{Geometry as b}from"./Geometry.js";import{assert as L}from"./Util.js";import{VertexAttribute as j}from"./VertexAttribute.js";import{GeometryType as d}from"./IntersectableGeometry.js";const E=R,U=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],V=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],C=[0,0,1,0,1,1,0,1],F=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],v=new Array(36);for(let Tt=0;Tt<6;Tt++)for(let t=0;t<6;t++)v[6*Tt+t]=Tt;const x=new Array(36);for(let Tt=0;Tt<6;Tt++)x[6*Tt]=0,x[6*Tt+1]=1,x[6*Tt+2]=2,x[6*Tt+3]=2,x[6*Tt+4]=3,x[6*Tt+5]=0;function D(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(24);for(let s=0;s<8;s++)e[3*s]=U[s][0]*n[0],e[3*s+1]=U[s][1]*n[1],e[3*s+2]=U[s][2]*n[2];return new b(t,[[j.POSITION,new S(e,F,3,!0)],[j.NORMAL,new S(V,v,3)],[j.UV0,new S(C,x,2)]])}const q=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],z=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],B=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],G=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function k(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(18);for(let s=0;s<6;s++)e[3*s]=q[s][0]*n[0],e[3*s+1]=q[s][1]*n[1],e[3*s+2]=q[s][2]*n[2];return new b(t,[[j.POSITION,new S(e,B,3,!0)],[j.NORMAL,new S(z,G,3)]])}const Z=c(-.5,0,-.5),H=c(.5,0,-.5),J=c(0,0,.5),K=c(0,.5,0),Q=f(),W=f(),X=f(),Y=f(),$=f();n(Q,Z,K),n(W,Z,H),h(X,Q,W),e(X,X),n(Q,H,K),n(W,H,J),h(Y,Q,W),e(Y,Y),n(Q,J,K),n(W,J,Z),h($,Q,W),e($,$);const _=[Z,H,J,K],tt=[0,-1,0,X[0],X[1],X[2],Y[0],Y[1],Y[2],$[0],$[1],$[2]],nt=[0,1,2,3,1,0,3,2,1,3,0,2],et=[0,0,0,1,1,1,2,2,2,3,3,3];function st(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(12);for(let s=0;s<4;s++)e[3*s]=_[s][0]*n[0],e[3*s+1]=_[s][1]*n[1],e[3*s+2]=_[s][2]*n[2];return new b(t,[[j.POSITION,new S(e,nt,3,!0)],[j.NORMAL,new S(tt,et,3)]])}function ot(t,n,e,s,o={uv:!0}){const r=-Math.PI,h=2*Math.PI,l=-Math.PI/2,u=Math.PI,c=Math.max(3,Math.floor(e)),a=Math.max(2,Math.floor(s)),f=(c+1)*(a+1),p=O(3*f),i=O(3*f),w=O(2*f),g=[];let A=0;for(let O=0;O<=a;O++){const t=[],e=O/a,s=l+e*u,o=Math.cos(s);for(let l=0;l<=c;l++){const u=l/c,a=r+u*h,f=Math.cos(a)*o,g=Math.sin(s),O=-Math.sin(a)*o;p[3*A]=f*n,p[3*A+1]=g*n,p[3*A+2]=O*n,i[3*A]=f,i[3*A+1]=g,i[3*A+2]=O,w[2*A]=u,w[2*A+1]=e,t.push(A),++A}g.push(t)}const M=new Array;for(let O=0;O<a;O++)for(let t=0;t<c;t++){const n=g[O][t],e=g[O][t+1],s=g[O+1][t+1],o=g[O+1][t];0===O?(M.push(n),M.push(s),M.push(o)):O===a-1?(M.push(n),M.push(e),M.push(s)):(M.push(n),M.push(e),M.push(s),M.push(s),M.push(o),M.push(n))}const m=[[j.POSITION,new S(p,M,3,!0)],[j.NORMAL,new S(i,M,3,!0)]];return o.uv&&m.push([j.UV0,new S(w,M,2,!0)]),o.offset&&(m[0][0]=j.OFFSET,m.push([j.POSITION,new S(Float64Array.from(o.offset),I(M.length),3,!0)])),new b(t,m)}function rt(t,n,e,s){const o=ht(n,e,s);return new b(t,o)}function ht(t,n,e){const s=t;let o,r;if(e)o=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],r=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const t=s*(1+Math.sqrt(5))/2;o=[-s,t,0,s,t,0,-s,-t,0,s,-t,0,0,-s,t,0,s,t,0,-s,-t,0,s,-t,t,0,-s,t,0,s,-t,0,-s,-t,0,s],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let c=0;c<o.length;c+=3)E.scale(o,c,t/E.length(o,c));let h={};function l(n,e){n>e&&([n,e]=[e,n]);const s=n.toString()+"."+e.toString();if(h[s])return h[s];let r=o.length;return o.length+=3,E.add(o,3*n,o,3*e,o,r),E.scale(o,r,t/E.length(o,r)),r/=3,h[s]=r,r}for(let c=0;c<n;c++){const t=r.length,n=new Array(4*t);for(let e=0;e<t;e+=3){const t=r[e],s=r[e+1],o=r[e+2],h=l(t,s),u=l(s,o),c=l(o,t),a=4*e;n[a]=t,n[a+1]=h,n[a+2]=c,n[a+3]=s,n[a+4]=u,n[a+5]=h,n[a+6]=o,n[a+7]=c,n[a+8]=u,n[a+9]=h,n[a+10]=u,n[a+11]=c}r=n,h={}}const u=A(o);for(let c=0;c<u.length;c+=3)E.normalize(u,c);return[[j.POSITION,new S(A(o),r,3,!0)],[j.NORMAL,new S(u,r,3,!0)]]}function lt(t,{normal:n,position:e,color:s,rotation:o,size:r,centerOffsetAndDistance:h,uvi:l,featureAttribute:u,objectAndLayerIdColor:c=null}={}){const a=e?i(e):p(),f=n?i(n):w(0,0,1),g=s?[s[0],s[1],s[2],s.length>3?s[3]:255]:[255,255,255,255],O=null!=r&&2===r.length?r:[1,1],A=null!=o?[o]:[0],M=I(1),m=[[j.POSITION,new S(a,M,3,!0)],[j.NORMAL,new S(f,M,3,!0)],[j.COLOR,new S(g,M,4,!0)],[j.SIZE,new S(O,M,2)],[j.ROTATION,new S(A,M,1,!0)]];if(l&&m.push([j.UVI,new S(l,M,l.length)]),null!=h){const t=[h[0],h[1],h[2],h[3]];m.push([j.CENTEROFFSETANDDISTANCE,new S(t,M,4)])}if(u){const t=[u[0],u[1],u[2],u[3]];m.push([j.FEATUREATTRIBUTE,new S(t,M,4)])}return new b(t,m,null,d.Point,c)}const ut=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function ct(t,n=ut){const e=new Array(12);for(let c=0;c<4;c++)for(let t=0;t<3;t++)e[3*c+t]=n[c][t];const s=[0,1,2,2,3,0],o=[0,0,1],r=[0,0,0,0,0,0],h=[0,0,1,0,1,1,0,1],l=[255,255,255,255],u=[[j.POSITION,new S(e,s,3,!0)],[j.NORMAL,new S(o,r,3,!0)],[j.UV0,new S(h,s,2,!0)],[j.COLOR,new S(l,r,4,!0)]];return new b(t,u)}function at(t,n,e,s,o=!0,r=!0){let h=0;const l=n,u=t;let a=c(0,h,0),f=c(0,h+u,0),p=c(0,-1,0),i=c(0,1,0);s&&(h=u,f=c(0,0,0),a=c(0,h,0),p=c(0,1,0),i=c(0,-1,0));const w=[f,a],g=[p,i],A=e+2,M=Math.sqrt(u*u+l*l);if(s)for(let O=e-1;O>=0;O--){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*l,h,Math.sin(t)*l);w.push(n);const s=c(u*Math.cos(t)/M,-l/M,u*Math.sin(t)/M);g.push(s)}else for(let O=0;O<e;O++){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*l,h,Math.sin(t)*l);w.push(n);const s=c(u*Math.cos(t)/M,l/M,u*Math.sin(t)/M);g.push(s)}const I=new Array,m=new Array;if(o){for(let t=3;t<w.length;t++)I.push(1),I.push(t-1),I.push(t),m.push(0),m.push(0),m.push(0);I.push(w.length-1),I.push(2),I.push(1),m.push(0),m.push(0),m.push(0)}if(r){for(let t=3;t<w.length;t++)I.push(t),I.push(t-1),I.push(0),m.push(t),m.push(t-1),m.push(1);I.push(0),I.push(2),I.push(w.length-1),m.push(1),m.push(2),m.push(g.length-1)}const y=O(3*A);for(let c=0;c<A;c++)y[3*c]=w[c][0],y[3*c+1]=w[c][1],y[3*c+2]=w[c][2];const N=O(3*A);for(let c=0;c<A;c++)N[3*c]=g[c][0],N[3*c+1]=g[c][1],N[3*c+2]=g[c][2];return[[j.POSITION,new S(y,I,3,!0)],[j.NORMAL,new S(N,m,3,!0)]]}function ft(t,n,e,s,o,r=!0,h=!0){return new b(t,at(n,e,s,o,r,h))}function pt(n,s,l,p,i,w,g){const A=i?a(i):c(1,0,0),M=w?a(w):c(0,0,0);g??=!0;const I=f();e(I,A);const m=f();o(m,I,Math.abs(s));const y=f();o(y,m,-.5),r(y,y,M);const N=c(0,1,0);Math.abs(1-u(I,N))<.2&&t(N,0,0,1);const T=f();h(T,I,N),e(T,T),h(N,T,I);const P=2*p+(g?2:0),R=p+(g?2:0),L=O(3*P),d=O(3*R),E=O(2*P),U=new Array(3*p*(g?4:2)),V=new Array(3*p*(g?4:2));g&&(L[3*(P-2)]=y[0],L[3*(P-2)+1]=y[1],L[3*(P-2)+2]=y[2],E[2*(P-2)]=0,E[2*(P-2)+1]=0,L[3*(P-1)]=L[3*(P-2)]+m[0],L[3*(P-1)+1]=L[3*(P-2)+1]+m[1],L[3*(P-1)+2]=L[3*(P-2)+2]+m[2],E[2*(P-1)]=1,E[2*(P-1)+1]=1,d[3*(R-2)]=-I[0],d[3*(R-2)+1]=-I[1],d[3*(R-2)+2]=-I[2],d[3*(R-1)]=I[0],d[3*(R-1)+1]=I[1],d[3*(R-1)+2]=I[2]);const C=(t,n,e)=>{U[t]=n,V[t]=e};let F=0;const v=f(),x=f();for(let t=0;t<p;t++){const n=t*(2*Math.PI/p);o(v,N,Math.sin(n)),o(x,T,Math.cos(n)),r(v,v,x),d[3*t]=v[0],d[3*t+1]=v[1],d[3*t+2]=v[2],o(v,v,l),r(v,v,y),L[3*t]=v[0],L[3*t+1]=v[1],L[3*t+2]=v[2],E[2*t]=t/p,E[2*t+1]=0,L[3*(t+p)]=L[3*t]+m[0],L[3*(t+p)+1]=L[3*t+1]+m[1],L[3*(t+p)+2]=L[3*t+2]+m[2],E[2*(t+p)]=t/p,E[2*t+1]=1;const e=(t+1)%p;C(F++,t,t),C(F++,t+p,t),C(F++,e,e),C(F++,e,e),C(F++,t+p,t),C(F++,e+p,e)}if(g){for(let t=0;t<p;t++){const n=(t+1)%p;C(F++,P-2,R-2),C(F++,t,R-2),C(F++,n,R-2)}for(let t=0;t<p;t++){const n=(t+1)%p;C(F++,t+p,R-1),C(F++,P-1,R-1),C(F++,n+p,R-1)}}const D=[[j.POSITION,new S(L,U,3,!0)],[j.NORMAL,new S(d,V,3,!0)],[j.UV0,new S(E,U,2,!0)]];return new b(n,D)}function it(t,n,e,s,o,r){s=s||10,o=null==o||o,L(n.length>1);const h=[[0,0,0]],l=[],u=[];for(let c=0;c<s;c++){l.push([0,-c-1,-(c+1)%s-1]);const t=c/s*2*Math.PI;u.push([Math.cos(t)*e,Math.sin(t)*e])}return wt(t,u,n,h,l,o,r)}function wt(l,u,a,f,i,w,g=c(0,0,0)){const A=u.length,M=O(a.length*A*3+(6*f.length||0)),I=O(a.length*A*3+(f?6:0)),P=new Array,R=new Array;let L=0,d=0;const E=p(),U=p(),V=p(),C=p(),F=p(),v=p(),x=p(),D=p(),q=p(),z=p(),B=p(),G=p(),k=p(),Z=m();t(q,0,1,0),n(U,a[1],a[0]),e(U,U),w?(r(D,a[0],g),e(V,D)):t(V,0,0,1),mt(U,V,q,q,F,V,yt),s(C,V),s(G,F);for(let t=0;t<f.length;t++)o(v,F,f[t][0]),o(D,V,f[t][2]),r(v,v,D),r(v,v,a[0]),M[L++]=v[0],M[L++]=v[1],M[L++]=v[2];I[d++]=-U[0],I[d++]=-U[1],I[d++]=-U[2];for(let t=0;t<i.length;t++)P.push(i[t][0]>0?i[t][0]:-i[t][0]-1+f.length),P.push(i[t][1]>0?i[t][1]:-i[t][1]-1+f.length),P.push(i[t][2]>0?i[t][2]:-i[t][2]-1+f.length),R.push(0),R.push(0),R.push(0);let H=f.length;const J=f.length-1;for(let t=0;t<a.length;t++){let l=!1;if(t>0){s(E,U),t<a.length-1?(n(U,a[t+1],a[t]),e(U,U)):l=!0,r(z,E,U),e(z,z),r(B,a[t-1],C),y(a[t],z,Z);N(Z,T(B,E),D)?(n(D,D,a[t]),e(V,D),h(F,z,V),e(F,F)):mt(z,C,G,q,F,V,yt),s(C,V),s(G,F)}w&&(r(D,a[t],g),e(k,D));for(let n=0;n<A;n++)if(o(v,F,u[n][0]),o(D,V,u[n][1]),r(v,v,D),e(x,v),I[d++]=x[0],I[d++]=x[1],I[d++]=x[2],r(v,v,a[t]),M[L++]=v[0],M[L++]=v[1],M[L++]=v[2],!l){const t=(n+1)%A;P.push(H+n),P.push(H+A+n),P.push(H+t),P.push(H+t),P.push(H+A+n),P.push(H+A+t);for(let n=0;n<6;n++){const t=P.length-6;R.push(P[t+n]-J)}}H+=A}const K=a[a.length-1];for(let t=0;t<f.length;t++)o(v,F,f[t][0]),o(D,V,f[t][1]),r(v,v,D),r(v,v,K),M[L++]=v[0],M[L++]=v[1],M[L++]=v[2];const Q=d/3;I[d++]=U[0],I[d++]=U[1],I[d++]=U[2];const W=H-A;for(let t=0;t<i.length;t++)P.push(i[t][0]>=0?H+i[t][0]:-i[t][0]-1+W),P.push(i[t][2]>=0?H+i[t][2]:-i[t][2]-1+W),P.push(i[t][1]>=0?H+i[t][1]:-i[t][1]-1+W),R.push(Q),R.push(Q),R.push(Q);const X=[[j.POSITION,new S(M,P,3,!0)],[j.NORMAL,new S(I,R,3,!0)]];return new b(l,X)}function gt(t,n,e,s,o){const r=g(3*n.length),h=new Array(2*(n.length-1));let l=0,u=0;for(let a=0;a<n.length;a++){for(let t=0;t<3;t++)r[l++]=n[a][t];a>0&&(h[u++]=a-1,h[u++]=a)}const c=[[j.POSITION,new S(r,h,3,!0)]];if(e&&e.length===n.length&&3===e[0].length){const t=O(3*e.length);let s=0;for(let o=0;o<n.length;o++)for(let n=0;n<3;n++)t[s++]=e[o][n];c.push([j.NORMAL,new S(t,h,3,!0)])}if(s&&c.push([j.COLOR,new S(s,M(s.length/4),4)]),o&&o.length===n.length){const t=P(o);c.push([j.TIMESTAMPS,new S(t,h,3,!0)])}return new b(t,c,null,d.Line)}function Ot(t,n,e,s,o,r=0){const h=new Array(18),l=[[-e,r,o/2],[s,r,o/2],[0,n+r,o/2],[-e,r,-o/2],[s,r,-o/2],[0,n+r,-o/2]],u=[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5];for(let c=0;c<6;c++)h[3*c]=l[c][0],h[3*c+1]=l[c][1],h[3*c+2]=l[c][2];return new b(t,[[j.POSITION,new S(h,u,3,!0)]])}function At(n,e){const s=n.getMutableAttribute(j.POSITION).data;for(let o=0;o<s.length;o+=3){const n=s[o],r=s[o+1],h=s[o+2];t(Nt,n,r,h),l(Nt,Nt,e),s[o]=Nt[0],s[o+1]=Nt[1],s[o+2]=Nt[2]}}function Mt(t,n=t){const e=t.attributes,s=e.get(j.POSITION).data,o=e.get(j.NORMAL).data;if(o){const t=n.getMutableAttribute(j.NORMAL).data;for(let n=0;n<o.length;n+=3){const e=o[n+1];t[n+1]=-o[n+2],t[n+2]=e}}if(s){const t=n.getMutableAttribute(j.POSITION).data;for(let n=0;n<s.length;n+=3){const e=s[n+1];t[n+1]=-s[n+2],t[n+2]=e}}}function It(t,n,s,o,r){return!(Math.abs(u(n,t))>r)&&(h(s,t,n),e(s,s),h(o,s,t),e(o,o),!0)}function mt(t,n,e,s,o,r,h){return It(t,n,o,r,h)||It(t,e,o,r,h)||It(t,s,o,r,h)}const yt=.99619469809,Nt=p();export{Mt as cgToGIS,D as createBoxGeometry,ft as createConeGeometry,at as createConeGeometryData,pt as createCylinderGeometry,k as createDiamondGeometry,Ot as createExtrudedTriangle,wt as createPathExtrusionGeometry,lt as createPointGeometry,ht as createPolySphereData,rt as createPolySphereGeometry,gt as createPolylineGeometry,ot as createSphereGeometry,ct as createSquareGeometry,st as createTetrahedronGeometry,it as createTubeGeometry,mt as makeOrthoBasisDirUpFallback,At as transformInPlace};
@@ -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{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../core/has.js";import{someMap as r}from"../../../../core/MapUtils.js";import t from"../../../../core/PooledArray.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as o}from"../../../../chunks/sphere.js";import{OverlayTarget as d}from"../../terrain/Intersector.js";import{ShaderOutput as a}from"../core/shaderLibrary/ShaderOutput.js";import{ChangeSet as h}from"./ChangeSet.js";import{StoreResults as c}from"./IntersectorInterfaces.js";import{IntersectorResult as l}from"./IntersectorResult.js";import{IntersectorType as p}from"./IntersectorType.js";import{RenderOccludedFlag as m}from"./Material.js";import{DirtyOperation as u,DirtyState as g}from"./ModelDirtyTypes.js";import{RendererBase as y}from"./RendererBase.js";import{RenderSlot as _}from"./RenderSlot.js";import{noBudget as f}from"../../../support/Scheduler.js";let R=class extends y{constructor(e){super(e),this._pending=new G,this._changes=new h,this._sortedRenderers=new t,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return r(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get rendersOccludedDraped(){for(const e of this.renderers.values())if(0!==e.numGeometries&&e.renderOccludedFlags&~m.Occlude)return!0;return!1}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,f,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=r(this.renderers,e=>{const r=e.produces.get(_.DRAPED_MATERIAL);return!!r&&r(a.Highlight)}),this._hasWater=r(this.renderers,e=>{const r=e.produces.get(_.DRAPED_WATER);return!!r&&r(a.Normal)})),this.notifyChange("updating"),!0)}rendererAdded(){this._sortedRenderers.clear()}rendererRemoved(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);s&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=this._changes.updates.pushNew();e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case g.TRANSFORMATION:case g.GEOMETRY:return this._notifyGraphicGeometryChanged(e);case g.VISIBILITY:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere[0]-n.boundingSphere[3]<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere[0]+n.boundingSphere[3]>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.clear(),this._changes.removes.clear(),this._changes.adds.pushArray(Array.from(this._pending.adds)),this._changes.removes.pushArray(Array.from(this._pending.removes)),this._changes.updates.filterInPlace(({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],C[0]=t[0]-s,C[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,i,C,(t,s,o)=>{v(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(o(e.boundingSphere))),e}get test(){}};e([s({constructOnly:!0})],R.prototype,"drapeSource",void 0),e([s({constructOnly:!0})],R.prototype,"rendererContext",void 0),e([s()],R.prototype,"updating",null),e([s()],R.prototype,"rctx",null),e([s()],R.prototype,"_localOriginFactory",null),e([s({readOnly:!0})],R.prototype,"isEmpty",null),e([s()],R.prototype,"_geometries",void 0),R=e([i("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],R);class G{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function v(e,r,t,s,i,n,o){const a=new d(n,o,r),h=r=>{r.set(p.OVERLAY,a,e.distance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.distance||i.results.ground.distance<=i.results.min.distance)&&h(i.results.min),i.options.store!==c.MIN&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.distance||i.results.ground.distance>i.results.max.distance)&&h(i.results.max),i.options.store===c.ALL){const e=new l(i.ray);h(e),i.results.all.push(e)}}const C=n();export{R as SortedRenderGeometryRenderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../core/has.js";import{someMap as r,everyMap as t}from"../../../../core/MapUtils.js";import s from"../../../../core/PooledArray.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a}from"../../../../chunks/sphere.js";import{OverlayTarget as d}from"../../terrain/Intersector.js";import{ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{ChangeSet as c}from"./ChangeSet.js";import{StoreResults as l}from"./IntersectorInterfaces.js";import{IntersectorResult as p}from"./IntersectorResult.js";import{IntersectorType as m}from"./IntersectorType.js";import{DirtyOperation as u,DirtyState as g}from"./ModelDirtyTypes.js";import{RendererBase as y}from"./RendererBase.js";import{RenderSlot as _}from"./RenderSlot.js";import{noBudget as f}from"../../../support/Scheduler.js";let R=class extends y{constructor(e){super(e),this._pending=new G,this._changes=new c,this._sortedRenderers=new s,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return r(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOnlyOccludees(){const e=t(this.renderers,e=>e.hasOnlyOccludees);return this.renderers?.size>0&&e}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,f,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=r(this.renderers,e=>{const r=e.produces.get(_.DRAPED_MATERIAL);return!!r&&r(h.Highlight)}),this._hasWater=r(this.renderers,e=>{const r=e.produces.get(_.DRAPED_WATER);return!!r&&r(h.Normal)})),this.notifyChange("updating"),!0)}rendererAdded(){this._sortedRenderers.clear()}rendererRemoved(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);s&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=this._changes.updates.pushNew();e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case g.TRANSFORMATION:case g.GEOMETRY:return this._notifyGraphicGeometryChanged(e);case g.VISIBILITY:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere[0]-n.boundingSphere[3]<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere[0]+n.boundingSphere[3]>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.clear(),this._changes.removes.clear(),this._changes.adds.pushArray(Array.from(this._pending.adds)),this._changes.removes.pushArray(Array.from(this._pending.removes)),this._changes.updates.filterInPlace(({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],C[0]=t[0]-s,C[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,i,C,(t,s,o)=>{v(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(a(e.boundingSphere))),e}get test(){}};e([i({constructOnly:!0})],R.prototype,"drapeSource",void 0),e([i({constructOnly:!0})],R.prototype,"rendererContext",void 0),e([i()],R.prototype,"updating",null),e([i()],R.prototype,"rctx",null),e([i()],R.prototype,"_localOriginFactory",null),e([i({readOnly:!0})],R.prototype,"isEmpty",null),e([i()],R.prototype,"_geometries",void 0),R=e([n("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],R);class G{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function v(e,r,t,s,i,n,o){const a=new d(n,o,r),h=r=>{r.set(m.OVERLAY,a,e.distance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.distance||i.results.ground.distance<=i.results.min.distance)&&h(i.results.min),i.options.store!==l.MIN&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.distance||i.results.ground.distance>i.results.max.distance)&&h(i.results.max),i.options.store===l.ALL){const e=new p(i.ray);h(e),i.results.all.push(e)}}const C=o();export{R as SortedRenderGeometryRenderer};
@@ -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{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Evented.js";import"../../../../core/has.js";import{disposeMaybe as i,removeMaybe as r}from"../../../../core/maybe.js";import{generateUID as n}from"../../../../core/uid.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as o,s as l}from"../../../../chunks/vec42.js";import{ZEROS as _,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{textTextureAtlas as d}from"./testUtils.js";import{applyTextureResizeModuloCeil as u}from"./textureUtils.js";import{TaskPriority as m}from"../../../support/Scheduler.js";import{Yield as p}from"../../../support/Yield.js";import{TextureWrapMode as g,TextureSamplingMode as f}from"../../../webgl/enums.js";import{Texture as x}from"../../../webgl/Texture.js";import{TextureDescriptor as v}from"../../../webgl/TextureDescriptor.js";const w=4096;let T=class extends t{constructor(e){super(e),this.id=n(),this.events=new s,this._glTexture=null,this._atlas=new b(256,256),this._needsRepack=!1,this._canRepack=!0,this._elementsToRender=new Map,this._elements=new Map,this._uvCallbacks=new Map,this.updating=!1}initialize(){this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","textAtlasCanvas"),this._canvas.setAttribute("style","display:none"),this._ctx=this._canvas.getContext("2d"),this._stage=this.view.stage,this._stage.addTexture(this),this._updateCanvasElementSize(this._atlas),this._reset()}unload(){this._glTexture=i(this._glTexture),this._frameWorker=r(this._frameWorker),this.updating=!1,this.events.emit("unloaded")}get loaded(){return null!=this._glTexture}get glTexture(){return this._glTexture}static get maxSize(){return C=d.stableRendering?k:0,[w-k-C,w-k-C-R]}load(e){if(this._glTexture)return this._glTexture;const t=new v;return t.wrapMode=g.CLAMP_TO_EDGE,t.samplingMode=f.LINEAR_MIPMAP_LINEAR,t.hasMipmap=!0,t.preMultiplyAlpha=!0,t.maxAnisotropy=e.parameters.maxMaxAnisotropy,this._glTexture=new x(e,t,this._canvas),this._frameWorker=this.view.resourceController.scheduler.registerTask(m.TEXT_TEXTURE_ATLAS,this),this.setDirty(),this._glTexture}dispose(){this._elements.clear(),this._elementsToRender.clear(),this._frameWorker=r(this._frameWorker),this._glTexture&&(this._stage.removeTexture(this),this._glTexture=i(this._glTexture)),this._canvas.width=0,this._canvas.height=0,this._canvas=null,this._ctx=null}_updateCanvasElementSize(e){this._canvas.width=e.width,this._canvas.height=e.height}_resizeAtlas(e,t){const{width:s,height:i}=this._atlas;s===e&&i===t||(this._atlas.width=e,this._atlas.height=t,this._glTexture?.resize(e,t),this._glTexture?.updateData(0,0,0,s,i,this._canvas),this._updateCanvasElementSize(this._atlas),this._elements.forEach(e=>this._uvCallbacks.get(e.textRenderer.key)?.forEach(t=>t(e.uv))),this._reset())}_reset(){this._elementsToRender.clear(),this._atlas.reset(),this._needsRepack=!0,this.setDirty()}_addAtlasElement(e,t,s,i){const r=this._atlas;if(r.width<s||r.height<i)return!1;let n=r.cursors.get(i);if(!n){if(r.height<r.nextY+i)return!1;n=[new A(r.nextY)],r.cursors.set(i,n),r.nextY+=i}let h=n.find(e=>r.width>=e.x+s);if(null==h){if(r.height<r.nextY+i)return!1;h=new A(r.nextY),r.nextY+=i,n.push(h)}return e.setNewPosition(h),this._elements.set(t,e),this._elementsToRender.set(t,e),h.x+=s,!0}_ensureCallbacks(e){const t=this._uvCallbacks.get(e);if(t)return t;const s=new Set;return this._uvCallbacks.set(e,s),s}_addCallback(e,t){this._ensureCallbacks(e).add(t)}_removeCallback(e,t){const s=this._uvCallbacks.get(e);return!(!s?.delete(t)||0!==s.size)&&(this._uvCallbacks.delete(e),!0)}_processAddition(e){const t=e.textRenderer.key;if(this._needsRepack)return void this._elements.set(t,e);const s=this._atlas,i=e.textRenderer.renderedWidth,r=e.textRenderer.renderedHeight,n=i+k,h=r+k+R;if(!this._addAtlasElement(e,t,n,h)){if(this._canRepack)this._reset();else if(s.width<n){const e=u(Math.max(n,1.5*s.width),w);this._resizeAtlas(e,s.height)}else{const e=s.nextY+h,t=u(Math.max(e,1.5*s.height),w);if(t>s.height)this._resizeAtlas(s.width,t);else if(s.width<w){const e=u(1.5*s.width,w);this._resizeAtlas(e,s.height)}}this._elements.set(t,e)}}_renderElement(e){const t=e.commitNewPosition(),s=e.textRenderer;this._ctx.clearRect(t[0]-k,t[1]-k,s.renderedWidth+2*k,s.renderedHeight+2*k),s.render(this._ctx,t[0],t[1]),this._uvCallbacks.get(s.key)?.forEach(t=>t(e.uv))}get running(){return this.updating}runTask(e){if(null==this._glTexture)return p;for(;this._needsRepack&&(this._canRepack||this._atlas.height<w&&this._atlas.height<w);){this._canRepack=this._needsRepack=!1;const t=this._elements;this._elements=new Map,t.forEach(e=>this._processAddition(e)),e.madeProgress()}if(this._elementsToRender.size>0){for(const[t,s]of this._elementsToRender){if(e.done)break;this._renderElement(s),this._elementsToRender.delete(t),e.madeProgress()}this._glTexture.setData(this._canvas)}this.updating=this._elementsToRender.size>0}addText(e,t){const s=e.key;this._addCallback(s,t);let i=this._elements.get(s);return i?o(i.uv,_)||t(i.uv):(i=new y(e),this._processAddition(i),this.setDirty()),{remove:()=>this._removeText(e,t)}}_removeText(e,t){const s=e.key;this._elements.get(s)&&this._removeCallback(s,t)&&(this._elements.delete(s),this._elementsToRender.delete(s),this._canRepack=!0)}setDirty(){this._glTexture&&(this.updating=!0)}get test(){}};e([h({constructOnly:!0})],T.prototype,"view",void 0),e([h({type:Boolean})],T.prototype,"updating",void 0),T=e([a("esri.views.3d.webgl-engine.lib.TextTextureAtlas")],T);const k=2,R=2;class y{constructor(e){this.textRenderer=e,this._uv=c(),this._newPosition=[0,0]}get uv(){if(null==this._xOffset||null==this._yOffset)return _;const{renderedWidth:e,renderedHeight:t}=this.textRenderer;return l(this._uv,this._xOffset,this._yOffset+t,this._xOffset+e,this._yOffset)}setNewPosition(e){this._newPosition[0]=e.x,this._newPosition[1]=e.y}commitNewPosition(){return this._xOffset=this._newPosition[0],this._yOffset=this._newPosition[1],this._newPosition}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}}class b{constructor(e,t){this.width=e,this.height=t,this.cursors=new Map,this.nextY=0}reset(){this.cursors.clear(),this.nextY=C}}class A{constructor(e){this.y=e,this.x=C}}let C=0;export{T as TextTextureAtlas};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Evented.js";import"../../../../core/has.js";import{disposeMaybe as i,removeMaybe as r}from"../../../../core/maybe.js";import{generateUID as h}from"../../../../core/uid.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as o,s as l}from"../../../../chunks/vec42.js";import{ZEROS as _,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{textTextureAtlas as d}from"./testUtils.js";import{applyTextureResizeModuloCeil as u}from"./textureUtils.js";import{TaskPriority as m}from"../../../support/Scheduler.js";import{Yield as g}from"../../../support/Yield.js";import{TextureWrapMode as p,TextureSamplingMode as f}from"../../../webgl/enums.js";import{Texture as x}from"../../../webgl/Texture.js";import{TextureDescriptor as v}from"../../../webgl/TextureDescriptor.js";const w=4096;let T=class extends t{constructor(e){super(e),this.id=h(),this.events=new s,this._glTexture=null,this._atlas=new b(256,256),this._needsRepack=!1,this._canRepack=!0,this._elementsToRender=new Map,this._elements=new Map,this._uvCallbacks=new Map,this.updating=!1}initialize(){this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","textAtlasCanvas"),this._canvas.setAttribute("style","display:none"),this._ctx=this._canvas.getContext("2d"),this._stage=this.view.stage,this._stage.addTexture(this),this._updateCanvasElementSize(this._atlas),this._reset()}unload(){this._glTexture=i(this._glTexture),this._frameWorker=r(this._frameWorker),this.updating=!1,this.events.emit("unloaded")}get loaded(){return null!=this._glTexture}get glTexture(){return this._glTexture}static get maxSize(){return C=d.stableRendering?k:0,[w-k-C,w-k-C-R]}load(e){if(this._glTexture)return this._glTexture;const t=new v;return t.wrapMode=p.CLAMP_TO_EDGE,t.samplingMode=f.LINEAR_MIPMAP_LINEAR,t.hasMipmap=!0,t.preMultiplyAlpha=!0,t.maxAnisotropy=e.parameters.maxMaxAnisotropy,this._glTexture=new x(e,t,this._canvas),this._frameWorker=this.view.resourceController.scheduler.registerTask(m.TEXT_TEXTURE_ATLAS,this),this.setDirty(),this._glTexture}dispose(){this._elements.clear(),this._elementsToRender.clear(),this._frameWorker=r(this._frameWorker),this._glTexture&&(this._stage.removeTexture(this),this._glTexture=i(this._glTexture)),this._canvas.width=0,this._canvas.height=0,this._canvas=null,this._ctx=null}_updateCanvasElementSize(e){this._canvas.width=e.width,this._canvas.height=e.height}_resizeAtlas(e,t){const{width:s,height:i}=this._atlas;s===e&&i===t||(this._atlas.width=e,this._atlas.height=t,this._glTexture?.resize(e,t),this._glTexture?.updateData(0,0,0,s,i,this._canvas),this._updateCanvasElementSize(this._atlas),this._elements.forEach(e=>this._uvCallbacks.get(e.textRenderer.key)?.forEach(t=>t(e.uv))),this._reset())}_reset(){this._elementsToRender.clear(),this._atlas.reset(),this._needsRepack=!0,this.setDirty()}_addAtlasElement(e,t,s,i){const r=this._atlas;if(r.width<s||r.height<i)return!1;let h=r.cursors.get(i);if(!h){if(r.height<r.nextY+i)return!1;h=[new A(r.nextY)],r.cursors.set(i,h),r.nextY+=i}let n=h.find(e=>r.width>=e.x+s);if(null==n){if(r.height<r.nextY+i)return!1;n=new A(r.nextY),r.nextY+=i,h.push(n)}return e.setNewPosition(n),this._elements.set(t,e),this._elementsToRender.set(t,e),n.x+=s,!0}_ensureCallbacks(e){const t=this._uvCallbacks.get(e);if(t)return t;const s=new Set;return this._uvCallbacks.set(e,s),s}_addCallback(e,t){this._ensureCallbacks(e).add(t)}_removeCallback(e,t){const s=this._uvCallbacks.get(e);return!(!s?.delete(t)||0!==s.size)&&(this._uvCallbacks.delete(e),!0)}_processAddition(e){const t=e.textRenderer.key;if(this._needsRepack)return void this._elements.set(t,e);const s=this._atlas,i=e.textRenderer.renderedWidth,r=e.textRenderer.renderedHeight,h=i+k,n=r+k+R;if(!this._addAtlasElement(e,t,h,n)){if(this._canRepack)this._reset();else if(s.width<h){const e=u(Math.max(h,1.5*s.width),w);this._resizeAtlas(e,s.height)}else{const e=s.nextY+n,t=u(Math.max(e,1.5*s.height),w);if(t>s.height)this._resizeAtlas(s.width,t);else if(s.width<w){const e=u(1.5*s.width,w);this._resizeAtlas(e,s.height)}}this._elements.set(t,e)}}_renderElement(e){const t=e.commitNewPosition(),s=e.textRenderer;this._ctx.clearRect(t[0]-k,t[1]-k,s.renderedWidth+2*k,s.renderedHeight+2*k),s.render(this._ctx,t[0],t[1]),this._uvCallbacks.get(s.key)?.forEach(t=>t(e.uv))}get running(){return this.updating}runTask(e){if(null==this._glTexture)return g;for(;this._needsRepack&&(this._canRepack||this._atlas.height<w&&this._atlas.height<w);){this._canRepack=this._needsRepack=!1;const t=this._elements;this._elements=new Map,t.forEach(e=>this._processAddition(e)),e.madeProgress()}if(this._elementsToRender.size>0){for(const[t,s]of this._elementsToRender){if(e.done)break;this._renderElement(s),this._elementsToRender.delete(t),e.madeProgress()}this._glTexture.setData(this._canvas)}this.updating=this._elementsToRender.size>0}addText(e,t){const s=e.key;this._addCallback(s,t);let i=this._elements.get(s);return i?o(i.uv,_)||t(i.uv):(i=new y(e),this._processAddition(i),this.setDirty()),{remove:()=>this._removeText(e,t)}}_removeText(e,t){const s=e.key;this._elements.get(s)&&this._removeCallback(s,t)&&(this._elements.delete(s),this._elementsToRender.delete(s),this._canRepack=!0)}setDirty(){this._glTexture&&(this.updating=!0)}get test(){}get usedMemory(){return(this._glTexture?.usedMemory??0)+(this._canvas?.width??0)*(this._canvas?.height??0)*4}};e([n({constructOnly:!0})],T.prototype,"view",void 0),e([n({type:Boolean})],T.prototype,"updating",void 0),T=e([a("esri.views.3d.webgl-engine.lib.TextTextureAtlas")],T);const k=2,R=2;class y{constructor(e){this.textRenderer=e,this._uv=c(),this._newPosition=[0,0]}get uv(){if(null==this._xOffset||null==this._yOffset)return _;const{renderedWidth:e,renderedHeight:t}=this.textRenderer;return l(this._uv,this._xOffset,this._yOffset+t,this._xOffset+e,this._yOffset)}setNewPosition(e){this._newPosition[0]=e.x,this._newPosition[1]=e.y}commitNewPosition(){return this._xOffset=this._newPosition[0],this._yOffset=this._newPosition[1],this._newPosition}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}}class b{constructor(e,t){this.width=e,this.height=t,this.cursors=new Map,this.nextY=0}reset(){this.cursors.clear(),this.nextY=C}}class A{constructor(e){this.y=e,this.x=C}}let C=0;export{T as TextTextureAtlas};
@@ -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
- var e;function E(E){return E===e.POSITION}!function(e){e.POSITION="position",e.NORMAL="normal",e.NORMALCOMPRESSED="normalCompressed",e.UV0="uv0",e.UVI="uvi",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.ROTATION="rotation",e.TANGENT="tangent",e.OFFSET="offset",e.PERSPECTIVEDIVIDE="perspectiveDivide",e.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",e.LENGTH="length",e.NEXTDELTA="nextDelta",e.PREVIOUSDELTA="previousDelta",e.U0="u0",e.LINEPARAMETERS="lineParameters",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.PROFILEAUXDATA="profileAuxData",e.INSTANCEMODELORIGINHI="instanceModelOriginHi",e.INSTANCEMODELORIGINLO="instanceModelOriginLo",e.INSTANCEMODEL="instanceModel",e.INSTANCEMODELNORMAL="instanceModelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMAL2COMPRESSED="normal2Compressed",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.START_UP="startUp",e.END_UP="endUp",e.EXTRUDE="extrude",e.OLIDCOLOR="objectAndLayerIdColor",e.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(e||(e={}));export{e as VertexAttribute,E as affectsGeometry};
5
+ var e;function E(E){return E===e.POSITION}!function(e){e.POSITION="position",e.NORMAL="normal",e.NORMALCOMPRESSED="normalCompressed",e.UV0="uv0",e.UVI="uvi",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.ROTATION="rotation",e.TANGENT="tangent",e.OFFSET="offset",e.PERSPECTIVEDIVIDE="perspectiveDivide",e.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",e.LENGTH="length",e.NEXTDELTA="nextDelta",e.PREVIOUSDELTA="previousDelta",e.U0="u0",e.LINEPARAMETERS="lineParameters",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.TIMESTAMPS="timeStamps",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.PROFILEAUXDATA="profileAuxData",e.INSTANCEMODELORIGINHI="instanceModelOriginHi",e.INSTANCEMODELORIGINLO="instanceModelOriginLo",e.INSTANCEMODEL="instanceModel",e.INSTANCEMODELNORMAL="instanceModelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMAL2COMPRESSED="normal2Compressed",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.START_UP="startUp",e.END_UP="endUp",e.EXTRUDE="extrude",e.OLIDCOLOR="objectAndLayerIdColor",e.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(e||(e={}));export{e as VertexAttribute,E as affectsGeometry};
@@ -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{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{VertexAttribute as O}from"../lib/VertexAttribute.js";const t=e().vec3f(O.POSITION),f=e().vec3f(O.POSITION).vec2f16(O.UV0),r=e().vec3f(O.POSITION).vec4u8(O.COLOR),I=e().vec3f(O.POSITION).vec2f16(O.UV0).vec4u8(O.OLIDCOLOR);export{r as PositionColorLayout,t as PositionLayout,f as PositionUvLayout,I as PositionUvOlidLayout};
5
+ import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{VertexAttribute as O}from"../lib/VertexAttribute.js";const I=e().vec3f(O.POSITION),c=e().vec3f(O.POSITION).vec2f16(O.UV0),f=e().vec3f(O.POSITION).vec4u8(O.COLOR),v=e().vec3f(O.POSITION).vec2f16(O.UV0).vec4u8(O.OLIDCOLOR),t=e().vec3f(O.POSITION).vec2f(O.UV0),r=e().vec3f(O.POSITION).vec2f(O.UV0).vec4u8(O.OLIDCOLOR);export{f as PositionColorLayout,I as PositionLayout,c as PositionUvLayout,v as PositionUvOlidLayout,t as PositionUvf32Layout,r as PositionUvf32OlidLayout};
@@ -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 t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,e as n,g as o,f as l,c,l as p,j as h,t as f}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{distance2 as E,fromPoints as _,create as A,closestLineSegmentPoint as R}from"../../../../geometry/support/lineSegment.js";import{fromPoints as g,create as S,signedDistance as O,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as P,isColorOrColorEmission as N,isDepth as L,isColorEmissionHighlightOIDOrDepth as b,is2DGeometryOutput as C,ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as J}from"./internal/bufferWriterUtils.js";import{LineMarkerAnchor as z}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as H}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Z,CapType as V}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";var Y;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Y||(Y={}));class q extends D{constructor(e){super(e,Q),this._configuration=new Z,this.vertexAttributeLocations=G,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>P(e)||N(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>L(e)],[w.OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==U.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&te(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(B.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],p=s[1],h=(l/2+4)*r;let f=Number.MAX_VALUE,m=0;const u=e.get(B.POSITION).data,T=ee(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=p-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),h=n*l-s,T=o*l-a,E=h*h+T*T;E<f&&(f=E,m=d/3)}f<h*h&&a(n.distance,n.normal,m)}intersect(r,f,m,u,T,A){const{options:S,camera:v,rayBegin:P,rayEnd:N}=m;if(!S.selectionMode||!r.visible||!v)return;if(!M(f))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(B.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(B.SIZE)&&(C*=L.get(B.SIZE).data[0]);const U=ne;i(U,m.point);const y=C*v.pixelRatio/2+4*v.pixelRatio;s(de[0],U[0]-y,U[1]+y,0),s(de[1],U[0]+y,U[1]+y,0),s(de[2],U[0]+y,U[1]-y,0),s(de[3],U[0]-y,U[1]-y,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(de[e],Ee[e]))return;g(v.eye,Ee[0],Ee[1],_e),g(v.eye,Ee[1],Ee[2],Ae),g(v.eye,Ee[2],Ee[3],Re),g(v.eye,Ee[3],Ee[0],ge);let j=Number.MAX_VALUE,D=0;const F=ee(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<F;e+=3){re[0]=b[e]+f[12],re[1]=b[e+1]+f[13],re[2]=b[e+2]+f[14];const t=(e+3)%b.length;if(ie[0]=b[t]+f[12],ie[1]=b[t+1]+f[13],ie[2]=b[t+2]+f[14],O(_e,re)<0&&O(_e,ie)<0||O(Ae,re)<0&&O(Ae,ie)<0||O(Re,re)<0&&O(Re,ie)<0||O(ge,re)<0&&O(ge,ie)<0)continue;if(v.projectToRenderScreen(re,oe),v.projectToRenderScreen(ie,le),oe[2]<0&&le[2]>0){a(se,re,ie);const e=v.frustum,t=-O(e[d.NEAR],re)/n(se,I(e[d.NEAR]));o(se,se,t),l(re,re,se),v.projectToRenderScreen(re,oe)}else if(oe[2]>0&&le[2]<0){a(se,ie,re);const e=v.frustum,t=-O(e[d.NEAR],ie)/n(se,I(e[d.NEAR]));o(se,se,t),l(ie,ie,se),v.projectToRenderScreen(ie,le)}else if(oe[2]<0&&le[2]<0)continue;oe[2]=0,le[2]=0;const r=E(_(oe,le,he),U);r<j&&(j=r,c(ce,re),c(pe,ie),D=e/3)}if(j<y*y){let e=Number.MAX_VALUE;if(R(_(ce,pe,he),_(P,N,fe),ae)){a(ae,ae,P);const t=p(ae);o(ae,ae,1/t),e=t/h(P,N)}A(e,ae,D)}}get _layout(){const e=v().vec3f(B.POSITION).vec4f16(B.PREVIOUSDELTA).vec4f16(B.NEXTDELTA).f32(B.U0).vec2f16(B.LINEPARAMETERS);return this.parameters.vvColor?e.f32(B.COLORFEATUREATTRIBUTE):e.vec4u8(B.COLOR,{glNormalized:!0}),this.parameters.vvSize?e.f32(B.SIZEFEATUREATTRIBUTE):e.f32(B.SIZE),this.parameters.vvOpacity&&e.f32(B.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(B.OLIDCOLOR),e}createBufferWriter(){return new K(this._layout,this.parameters)}createGLMaterial(e){return new X(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class X extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(k,e)}}class Q extends x{constructor(){super(...arguments),this.width=0,this.color=u,this.join="miter",this.cap=V.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class K{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=H+r}}_isClosed(e){return ee(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=r.get(B.POSITION),l=o.indices,p=o.data.length/3,m=r.get(B.DISTANCETOSTART)?.data;l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=(this.vertexBufferLayout.fields.has(B.SIZEFEATUREATTRIBUTE)?r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(B.SIZE)?.data[0])??1;let d=[1,1,1,1],E=0;const _=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);_?E=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(d=r.get(B.COLOR).data);const A=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),R=A?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,g=new Float32Array(a.buffer),S=T(a.buffer),O=new Uint8Array(a.buffer),I=this.vertexBufferLayout.stride/4;let v=n*I;const P=v;let N=0;const L=m?(e,t,r)=>N=m[r]:(e,t,r)=>N+=h(e,t),b=g.BYTES_PER_ELEMENT/S.BYTES_PER_ELEMENT,C=4/b,U=(e,t,r,s,a,n,o)=>{g[v++]=t[0],g[v++]=t[1],g[v++]=t[2],J(e,t,S,v*b),v+=C,J(r,t,S,v*b),v+=C,g[v++]=o;let l=v*b;if(S[l++]=s,S[l++]=a,v=Math.ceil(l/b),_)g[v]=E;else{const e=Math.min(4*n,d.length-4),t=4*v;O[t]=255*d[e],O[t+1]=255*d[e+1],O[t+2]=255*d[e+2],O[t+3]=255*d[e+3]}if(v++,g[v++]=u,A&&(g[v++]=R),y()){let e=4*v;i?(O[e++]=i[0],O[e++]=i[1],O[e++]=i[2],O[e++]=i[3]):(O[e++]=0,O[e++]=0,O[e++]=0,O[e++]=0),v=Math.ceil(.25*e)}};v+=I,s(ue,o.data[0],o.data[1],o.data[2]),e&&f(ue,ue,e);const j=this._isClosed(r);if(j){const t=o.data.length-3;s(me,o.data[t],o.data[t+1],o.data[t+2]),e&&f(me,me,e)}else s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),U(ue,ue,Te,1,Y.LEFT_CAP_START,0,0),U(ue,ue,Te,1,Y.RIGHT_CAP_START,0,0),c(me,ue),c(ue,Te);const D=j?0:1,F=j?p:p-1;for(let h=D;h<F;h++){const t=(h+1)%p*3;s(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e),L(me,ue,h),U(me,ue,Te,0,Y.LEFT_JOIN_END,h,N),U(me,ue,Te,0,Y.RIGHT_JOIN_END,h,N);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);U(me,ue,Te,t,Y.LEFT_JOIN_END,h,N),U(me,ue,Te,t,Y.RIGHT_JOIN_END,h,N)}U(me,ue,Te,1,Y.LEFT_JOIN_START,h,N),U(me,ue,Te,1,Y.RIGHT_JOIN_START,h,N),c(me,ue),c(ue,Te)}j?(s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),N=L(me,ue,F),U(me,ue,Te,0,Y.LEFT_JOIN_END,D,N),U(me,ue,Te,0,Y.RIGHT_JOIN_END,D,N)):(N=L(me,ue,F),U(me,ue,ue,0,Y.LEFT_CAP_END,F,N),U(me,ue,ue,0,Y.RIGHT_CAP_END,F,N)),$(g,P+I,g,P,I);return v=$(g,v-I,g,v,I),this._parameters.wireframe&&this._addWireframeVertices(a,P,v,I),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=$(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function $(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function ee(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function te(e){return e.anchor===z.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const re=m(),ie=m(),se=m(),ae=m(),ne=m(),oe=r(),le=r(),ce=m(),pe=m(),he=A(),fe=A(),me=m(),ue=m(),Te=m(),de=[r(),r(),r(),r()],Ee=[m(),m(),m(),m()],_e=S(),Ae=S(),Re=S(),ge=S();export{Q as Parameters,q as RibbonLineMaterial};
5
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i}from"../../../../core/time.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as a,d as n,e as o,g as l,f as c,c as h,l as p,j as m,t as f}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as T}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as d}from"../../../../geometry/support/float16.js";import{PlaneIndex as E}from"../../../../geometry/support/frustum.js";import{distance2 as _,fromPoints as A,create as R,closestLineSegmentPoint as g}from"../../../../geometry/support/lineSegment.js";import{fromPoints as S,create as I,signedDistance as O,getNormal as v}from"../../../../geometry/support/plane.js";import{newLayout as P}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as N,isColorOrColorEmission as L,isDepth as b,isColorEmissionHighlightOIDOrDepth as C,is2DGeometryOutput as U,ShaderOutput as j}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import M from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as B}from"../lib/Util.js";import{VertexAttribute as x}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as J}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as z}from"./internal/bufferWriterUtils.js";import{Animation as H}from"../shaders/AnimatedLine.glsl.js";import{LineMarkerAnchor as G}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as k}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as Z,RibbonLineTechnique as V}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as W,CapType as Y}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as q}from"../../../../webscene/support/AlphaCutoff.js";var X;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(X||(X={}));class Q extends D{constructor(e){super(e,$),this._configuration=new W,this.vertexAttributeLocations=Z,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>N(e)||L(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>b(e)],[w.OCCLUDER_MATERIAL,e=>C(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>C(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>L(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>L(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>U(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==j.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&ie(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&L(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration}get visible(){return this.parameters.color[3]>=q||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>q}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(x.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(x.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],h=s[1],p=(l/2+4)*r;let m=Number.MAX_VALUE,f=0;const u=e.get(x.POSITION).data,T=re(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=h-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),p=n*l-s,T=o*l-a,E=p*p+T*T;E<m&&(m=E,f=d/3)}m<p*p&&a(n.distance,n.normal,f)}intersect(r,i,f,u,T,d){const{options:R,camera:I,rayBegin:P,rayEnd:N}=f;if(!R.selectionMode||!r.visible||!I)return;if(!B(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(x.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(x.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(x.SIZE)&&(C*=L.get(x.SIZE).data[0]);const U=le;s(U,f.point);const j=C*I.pixelRatio/2+4*I.pixelRatio;a(Ae[0],U[0]-j,U[1]+j,0),a(Ae[1],U[0]+j,U[1]+j,0),a(Ae[2],U[0]+j,U[1]-j,0),a(Ae[3],U[0]-j,U[1]-j,0);for(let e=0;e<4;e++)if(!I.unprojectFromRenderScreen(Ae[e],Re[e]))return;S(I.eye,Re[0],Re[1],ge),S(I.eye,Re[1],Re[2],Se),S(I.eye,Re[2],Re[3],Ie),S(I.eye,Re[3],Re[0],Oe);let y=Number.MAX_VALUE,M=0;const D=re(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<D;e+=3){se[0]=b[e]+i[12],se[1]=b[e+1]+i[13],se[2]=b[e+2]+i[14];const t=(e+3)%b.length;if(ae[0]=b[t]+i[12],ae[1]=b[t+1]+i[13],ae[2]=b[t+2]+i[14],O(ge,se)<0&&O(ge,ae)<0||O(Se,se)<0&&O(Se,ae)<0||O(Ie,se)<0&&O(Ie,ae)<0||O(Oe,se)<0&&O(Oe,ae)<0)continue;if(I.projectToRenderScreen(se,ce),I.projectToRenderScreen(ae,he),ce[2]<0&&he[2]>0){n(ne,se,ae);const e=I.frustum,t=-O(e[E.NEAR],se)/o(ne,v(e[E.NEAR]));l(ne,ne,t),c(se,se,ne),I.projectToRenderScreen(se,ce)}else if(ce[2]>0&&he[2]<0){n(ne,ae,se);const e=I.frustum,t=-O(e[E.NEAR],ae)/o(ne,v(e[E.NEAR]));l(ne,ne,t),c(ae,ae,ne),I.projectToRenderScreen(ae,he)}else if(ce[2]<0&&he[2]<0)continue;ce[2]=0,he[2]=0;const r=_(A(ce,he,fe),U);r<y&&(y=r,h(pe,se),h(me,ae),M=e/3)}if(y<j*j){let e=Number.MAX_VALUE;if(g(A(pe,me,fe),A(P,N,ue),oe)){n(oe,oe,P);const t=p(oe);l(oe,oe,1/t),e=t/m(P,N)}d(e,oe,M)}}get _layout(){const e=P().vec3f(x.POSITION).vec4f16(x.PREVIOUSDELTA).vec4f16(x.NEXTDELTA).f32(x.U0).vec2f16(x.LINEPARAMETERS);return this.parameters.vvColor?e.f32(x.COLORFEATUREATTRIBUTE):e.vec4u8(x.COLOR,{glNormalized:!0}),this.parameters.vvSize?e.f32(x.SIZEFEATUREATTRIBUTE):e.f32(x.SIZE),this.parameters.vvOpacity&&e.f32(x.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(x.OLIDCOLOR),this.parameters.hasAnimation&&e.vec3f16(x.TIMESTAMPS),e}createBufferWriter(){return new ee(this._layout,this.parameters)}createGLMaterial(e){return new K(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){const{hasAnimation:t,animationSpeed:r}=this.parameters;return!!t&&(this.setParameters({timeElapsed:i(e.time)*r},!1),e.dt>0)}}class K extends M{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(V,e)}}class $ extends J{constructor(){super(...arguments),this.width=0,this.color=T,this.join="miter",this.cap=Y.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=0,this.animation=H.None,this.animationSpeed=1,this.trailLength=1}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==H.None}}class ee{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=k+r}}_isClosed(e){return re(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(x.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,s,n){const o=r.get(x.POSITION),l=o.indices,c=o.data.length/3,p=r.get(x.DISTANCETOSTART)?.data;l&&l.length!==2*(c-1)&&console.warn("RibbonLineMaterial does not support indices");const u=(this.vertexBufferLayout.fields.has(x.SIZEFEATUREATTRIBUTE)?r.get(x.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(x.SIZE)?.data[0])??1;let T=[1,1,1,1],E=0;const _=this.vertexBufferLayout.fields.has(x.COLORFEATUREATTRIBUTE);_?E=r.get(x.COLORFEATUREATTRIBUTE).data[0]:r.has(x.COLOR)&&(T=r.get(x.COLOR).data);const A=r.get(x.TIMESTAMPS)?.data,R=A&&this.vertexBufferLayout.fields.has(x.TIMESTAMPS),g=this.vertexBufferLayout.fields.has(x.OPACITYFEATUREATTRIBUTE),S=g?r.get(x.OPACITYFEATUREATTRIBUTE).data[0]:0,I=new Float32Array(s.buffer),O=d(s.buffer),v=new Uint8Array(s.buffer),P=this.vertexBufferLayout.stride/4;let N=n*P;const L=N;let b=0;const C=p?(e,t,r)=>b=p[r]:(e,t,r)=>b+=m(e,t),U=I.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,j=4/U,M=(e,t,r,s,a,n,o,l)=>{I[N++]=t[0],I[N++]=t[1],I[N++]=t[2],z(e,t,O,N*U),N+=j,z(r,t,O,N*U),N+=j,I[N++]=l;let c=N*U;if(O[c++]=a,O[c++]=n,N=Math.ceil(c/U),_)I[N]=E;else{const e=Math.min(4*o,T.length-4),t=4*N;v[t]=255*T[e],v[t+1]=255*T[e+1],v[t+2]=255*T[e+2],v[t+3]=255*T[e+3]}if(N++,I[N++]=u,g&&(I[N++]=S),y()){let e=4*N;i?(v[e++]=i[0],v[e++]=i[1],v[e++]=i[2],v[e++]=i[3]):(v[e++]=0,v[e++]=0,v[e++]=0,v[e++]=0),N=Math.ceil(.25*e)}R&&(c=N*U,O[c++]=s[0],O[c++]=s[1],O[c++]=s[2],N=Math.ceil(c/U))};N+=P,a(de,o.data[0],o.data[1],o.data[2]),R&&a(_e,A[0],A[1],A[2]),e&&f(de,de,e);const D=this._isClosed(r);if(D){const t=o.data.length-3;a(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e)}else a(Ee,o.data[3],o.data[4],o.data[5]),e&&f(Ee,Ee,e),M(de,de,Ee,_e,1,X.LEFT_CAP_START,0,0),M(de,de,Ee,_e,1,X.RIGHT_CAP_START,0,0),h(Te,de),h(de,Ee),R&&a(_e,A[3],A[4],A[5]);const F=D?0:1,w=D?c:c-1;for(let m=F;m<w;m++){const t=(m+1)%c*3;a(Ee,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Ee,Ee,e),C(Te,de,m),M(Te,de,Ee,_e,0,X.LEFT_JOIN_END,m,b),M(Te,de,Ee,_e,0,X.RIGHT_JOIN_END,m,b);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);M(Te,de,Ee,_e,t,X.LEFT_JOIN_END,m,b),M(Te,de,Ee,_e,t,X.RIGHT_JOIN_END,m,b)}M(Te,de,Ee,_e,1,X.LEFT_JOIN_START,m,b),M(Te,de,Ee,_e,1,X.RIGHT_JOIN_START,m,b),h(Te,de),h(de,Ee),R&&a(_e,A[t],A[t+1],A[t+2])}D?(a(Ee,o.data[3],o.data[4],o.data[5]),e&&f(Ee,Ee,e),b=C(Te,de,w),M(Te,de,Ee,_e,0,X.LEFT_JOIN_END,F,b),M(Te,de,Ee,_e,0,X.RIGHT_JOIN_END,F,b)):(b=C(Te,de,w),M(Te,de,de,_e,0,X.LEFT_CAP_END,w,b),M(Te,de,de,_e,0,X.RIGHT_CAP_END,w,b)),te(I,L+P,I,L,P);return N=te(I,N-P,I,N,P),this._parameters.wireframe&&this._addWireframeVertices(s,L,N,P),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=te(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function te(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function re(e,t){if(!e.isClosed)return!1;return t.get(x.POSITION).indices.length>2}function ie(e){return e.anchor===G.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const se=u(),ae=u(),ne=u(),oe=u(),le=u(),ce=r(),he=r(),pe=u(),me=u(),fe=R(),ue=R(),Te=u(),de=u(),Ee=u(),_e=u(),Ae=[r(),r(),r(),r()],Re=[u(),u(),u(),u()],ge=I(),Se=I(),Ie=I(),Oe=I();export{$ as Parameters,Q as RibbonLineMaterial};
@@ -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/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrColorEmission as a,isHighlightOrOID as s,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{MaterialParameters as l}from"../lib/Material.js";import{OITPolygonOffsetLimit as m}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{PositionUvOlidLayout as f,PositionUvLayout as p}from"./DefaultLayouts.js";import{TriangleMaterial as u}from"./TriangleMaterial.js";import{WaterGLMaterial as d}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as g}from"./WaterTechniqueConfiguration.js";class _ extends u{constructor(t,e){super(t,v),this.produces=new Map([[c.OPAQUE_MATERIAL,t=>a(t)&&!this.parameters.transparent||s(t)],[c.TRANSPARENT_MATERIAL,t=>a(t)&&this.parameters.transparent||s(t)],[c.DRAPED_MATERIAL,t=>this.parameters.draped&&a(t)||t===o.Normal||s(t)],[c.DRAPED_WATER,t=>t===o.Normal]]),this._configuration=new g(e.spherical)}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.writeDepth=!0,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.screenSpaceReflections=null!=e.ssr.lastFrameColor,this._configuration.cloudReflections=null!=e.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=e.oitPass,this._configuration.enableOffset=e.camera.relativeElevation<m,this._configuration.terrainDepthTest=e.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration}get visible(){return!0}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<T}createGLMaterial(t){return new d(t)}createBufferWriter(){return new h(n()?f:p)}get test(){}}class v extends l{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const T=35e3;export{v as Parameters,_ as WaterMaterial};
5
+ import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrColorEmission as a,isHighlightOrOID as s,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{MaterialParameters as l}from"../lib/Material.js";import{OITPolygonOffsetLimit as m}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as f,PositionUvf32Layout as p}from"./DefaultLayouts.js";import{TriangleMaterial as u}from"./TriangleMaterial.js";import{WaterGLMaterial as d}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as g}from"./WaterTechniqueConfiguration.js";class _ extends u{constructor(t,e){super(t,v),this.produces=new Map([[c.OPAQUE_MATERIAL,t=>a(t)&&!this.parameters.transparent||s(t)],[c.TRANSPARENT_MATERIAL,t=>a(t)&&this.parameters.transparent||s(t)],[c.DRAPED_MATERIAL,t=>this.parameters.draped&&a(t)||t===o.Normal||s(t)],[c.DRAPED_WATER,t=>t===o.Normal]]),this._configuration=new g(e.spherical)}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.writeDepth=!0,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.screenSpaceReflections=null!=e.ssr.lastFrameColor,this._configuration.cloudReflections=null!=e.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=e.oitPass,this._configuration.enableOffset=e.camera.relativeElevation<m,this._configuration.terrainDepthTest=e.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration}get visible(){return!0}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<T}createGLMaterial(t){return new d(t)}createBufferWriter(){return new h(n()?f:p)}get test(){}}class v extends l{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const T=35e3;export{v as Parameters,_ as WaterMaterial};