@arcgis/core 4.23.0-next.20220127 → 4.23.0-next.20220128

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 (312) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
  3. package/assets/esri/core/workers/chunks/{e657ba0cab29f05d02da.js → 0cd0a6eef51fc5b9ea61.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{e4896cf85fb2da8a9cc7.js → 17de7a324dfa7f57ad5d.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{0317f37b6c8705b363fd.js → 1c733b7db092a2a88ef3.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{d835b2a683fcd8aeeed8.js → 27474b007988855bea9d.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{8001b0e514bfffe9d7f8.js → 357033117dfe61eb81ea.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{5948923e07bd1662c24a.js → 37c03cfc19086ce631c6.js} +1 -1
  11. package/assets/esri/core/workers/chunks/3c673495e5f507c4a9e5.js +1 -0
  12. package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
  13. package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
  14. package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
  15. package/assets/esri/core/workers/chunks/{5f1dcb6556820cd0aa31.js → 4be35af7d6babbfe9d84.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{f9ff3eaf4eb324429fbd.js → 5457962a70bd3c557a75.js} +1 -1
  17. package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
  18. package/assets/esri/core/workers/chunks/{56274b37ff74ca0d68a6.js → 5d11b97b667921d67ae7.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{ba5eb394f098968c22d2.js → 655b55ac0cd533d7e9d7.js} +1 -1
  20. package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
  21. package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
  22. package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
  23. package/assets/esri/core/workers/chunks/{601e697dc7414bda128a.js → 952980635afc7ec81804.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{e8741bf421f80213f1d3.js → 9876a1bae350795fab36.js} +1 -1
  25. package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
  26. package/assets/esri/core/workers/chunks/{3f343f792fd9f44d6f25.js → b3f5e91116112b0b612a.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{4c76146014dc15143ba3.js → be588873c16770ceb9ef.js} +1 -1
  28. package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
  29. package/assets/esri/core/workers/chunks/{b62e3dccd9f662c0afeb.js → db3c729ce0c0b2690dc9.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
  31. package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
  32. package/assets/esri/core/workers/chunks/{c9cbf8135e95f0f42cd9.js → e287f49184d076af17e2.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{6e6a3c5866e8d8820457.js → eb82ff10cef2bde6e57f.js} +1 -1
  35. package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
  36. package/assets/esri/core/workers/chunks/{842db82733635dbf25cb.js → ee6e0db58dc64410e687.js} +1 -1
  37. package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
  38. package/assets/esri/core/workers/chunks/ff6abdc72076f3994659.js +981 -0
  39. package/chunks/BlendLayers.glsl.js +2 -2
  40. package/chunks/ChapmanAtmosphere.glsl.js +17 -17
  41. package/chunks/CheckerBoard.glsl.js +3 -3
  42. package/chunks/Clouds.glsl.js +2 -2
  43. package/chunks/CloudsComposition.glsl.js +1 -1
  44. package/chunks/ColorMaterial.glsl.js +12 -12
  45. package/chunks/ComponentShader.glsl.js +3 -3
  46. package/chunks/Compositing.glsl.js +1 -1
  47. package/chunks/DefaultMaterial.glsl.js +33 -33
  48. package/chunks/EdgeShaderProgram.glsl.js +7 -7
  49. package/chunks/Fog.glsl.js +10 -12
  50. package/chunks/HUDMaterial.glsl.js +2 -2
  51. package/chunks/HighlightComposition.glsl.js +5 -5
  52. package/chunks/ImageMaterial.glsl.js +6 -6
  53. package/chunks/LaserlinePath.glsl.js +8 -8
  54. package/chunks/LineCallout.glsl.js +6 -6
  55. package/chunks/MeasurementArrow.glsl.js +1 -1
  56. package/chunks/NativeLine.glsl.js +1 -1
  57. package/chunks/Path.glsl.js +5 -5
  58. package/chunks/Pattern.glsl.js +9 -9
  59. package/chunks/PointRenderer.glsl.js +14 -14
  60. package/chunks/Precipitation.glsl.js +2 -2
  61. package/chunks/RealisticTree.glsl.js +21 -21
  62. package/chunks/RibbonLine.glsl.js +11 -11
  63. package/chunks/SMAA.glsl.js +40 -40
  64. package/chunks/ShadedColorMaterial.glsl.js +12 -12
  65. package/chunks/ShadowCast.glsl.js +6 -6
  66. package/chunks/ShadowHighlight.glsl.js +4 -4
  67. package/chunks/SimpleAtmosphere.glsl.js +3 -3
  68. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  69. package/chunks/Stars.glsl.js +3 -3
  70. package/chunks/Terrain.glsl.js +11 -11
  71. package/chunks/TextureOnly.glsl.js +2 -2
  72. package/chunks/WaterSurface.glsl.js +5 -5
  73. package/chunks/boundedPlane.js +1 -1
  74. package/core/accessorSupport/watch.js +1 -1
  75. package/core/loadAll.js +1 -1
  76. package/geometry/support/frustum.js +1 -1
  77. package/geometry/support/plane.js +1 -1
  78. package/interfaces.d.ts +204 -10
  79. package/layers/VectorTileLayer.js +1 -1
  80. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  81. package/layers/graphics/featureConversionUtils.js +1 -1
  82. package/layers/support/LayerContingentValuesCache.js +1 -1
  83. package/layers/support/TileInfo.js +1 -1
  84. package/package.json +1 -1
  85. package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
  86. package/support/revision.js +1 -1
  87. package/symbols/FillSymbol3DLayer.js +1 -1
  88. package/symbols/IconSymbol3DLayer.js +1 -1
  89. package/symbols/ObjectSymbol3DLayer.js +1 -1
  90. package/symbols/Symbol3D.js +1 -1
  91. package/symbols/WebStyleSymbol.js +1 -1
  92. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  93. package/symbols/support/IconSymbol3DLayerResource.js +1 -1
  94. package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
  95. package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
  96. package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
  97. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  98. package/symbols/support/Symbol3DIconOutline.js +1 -1
  99. package/symbols/support/Symbol3DOutline.js +1 -1
  100. package/symbols/support/Thumbnail.js +1 -1
  101. package/symbols/support/webStyleSymbolUtils.js +1 -1
  102. package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
  103. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  104. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  105. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  106. package/views/3d/environment/CloudsGenerator.js +1 -1
  107. package/views/3d/environment/Fog.glsl.js +1 -1
  108. package/views/3d/environment/Fog.js +1 -1
  109. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  110. package/views/3d/environment/Precipitation.glsl.js +1 -1
  111. package/views/3d/environment/Precipitation.js +1 -1
  112. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  113. package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
  114. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  115. package/views/3d/environment/Stars.glsl.js +1 -1
  116. package/views/3d/environment/Stars.js +1 -1
  117. package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
  118. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  119. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  120. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  121. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  122. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  123. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  124. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  125. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  126. package/views/3d/layers/I3SMeshView3D.js +1 -1
  127. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  128. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  129. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  130. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  132. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  133. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  134. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  135. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  136. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  137. package/views/3d/layers/graphics/lineUtils.js +1 -1
  138. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  139. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  140. package/views/3d/layers/graphics/symbolComplexity.js +1 -1
  141. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  142. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  143. package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
  144. package/views/3d/layers/support/overlayImageUtils.js +1 -1
  145. package/views/3d/layers/support/patternUtils.js +1 -1
  146. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  147. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  148. package/views/3d/support/LaserLineRenderer.js +1 -1
  149. package/views/3d/support/LaserlinePathData.js +1 -1
  150. package/views/3d/terrain/OverlayRenderer.js +1 -1
  151. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  152. package/views/3d/terrain/TerrainRenderer.js +1 -1
  153. package/views/3d/terrain/TerrainSurface.js +1 -1
  154. package/views/3d/terrain/Tile.js +1 -1
  155. package/views/3d/terrain/terrainUtils.js +1 -1
  156. package/views/3d/terrain/tileUtils.js +1 -1
  157. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  158. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  159. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  160. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
  161. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  162. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  163. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  164. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  165. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
  166. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
  167. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
  168. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
  169. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  170. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
  171. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
  172. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  173. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
  174. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
  175. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
  176. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
  177. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
  178. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
  179. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
  180. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
  181. package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
  182. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
  183. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
  184. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  185. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
  186. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
  187. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
  188. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
  189. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
  190. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
  191. package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
  192. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
  193. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
  194. package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
  195. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
  196. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
  197. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +10 -10
  198. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  199. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
  200. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
  201. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  202. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  203. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  204. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  205. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  206. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  207. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  208. package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
  209. package/views/3d/webgl-engine/lib/Material.js +1 -1
  210. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  211. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  212. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  213. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  214. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  215. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  216. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  217. package/views/3d/webgl-engine/lib/TextureUniformName.js +4 -0
  218. package/views/3d/webgl-engine/lib/UniformName.js +4 -0
  219. package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
  220. package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
  221. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  222. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  223. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  224. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  225. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  226. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  227. package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
  228. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  229. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  230. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  231. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  232. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  233. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  234. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  235. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  236. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  237. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  238. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  239. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  240. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  241. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  242. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  243. package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
  244. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  245. package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
  246. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  247. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  248. package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
  249. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  250. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  251. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  252. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  253. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  254. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  255. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  256. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  257. package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
  258. package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
  259. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  260. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  261. package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
  262. package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
  263. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  264. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  265. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
  266. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  267. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  268. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  269. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  270. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  271. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  272. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  273. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  274. package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
  275. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  276. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  277. package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
  278. package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
  279. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  280. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  281. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
  282. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
  283. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
  284. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
  285. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
  286. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
  287. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
  288. package/views/SceneView.js +1 -1
  289. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  290. package/views/support/WatchUpdatingTracking.js +1 -1
  291. package/views/webgl/BufferObject.js +1 -1
  292. package/views/webgl/InstanceCounter.js +1 -1
  293. package/views/webgl/Program.js +1 -1
  294. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  295. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  296. package/widgets/Search/support/locatorUtils.js +1 -1
  297. package/widgets/Search.js +1 -1
  298. package/assets/esri/core/workers/chunks/12c0cabb6c59e65d8546.js +0 -1
  299. package/assets/esri/core/workers/chunks/322d917e8cb398816a93.js +0 -1
  300. package/assets/esri/core/workers/chunks/392b6382e06652dd4c80.js +0 -1
  301. package/assets/esri/core/workers/chunks/3aa73119b055e05bbbeb.js +0 -1
  302. package/assets/esri/core/workers/chunks/52ea678ba1da0e349919.js +0 -1
  303. package/assets/esri/core/workers/chunks/5ee497d5d7b0e580526a.js +0 -1
  304. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
  305. package/assets/esri/core/workers/chunks/83b8fec1650e061aaa56.js +0 -1
  306. package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
  307. package/assets/esri/core/workers/chunks/d07440469fe7d181c4fd.js +0 -1
  308. package/assets/esri/core/workers/chunks/dbf192b4ce7e608610f6.js +0 -1
  309. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
  310. package/assets/esri/core/workers/chunks/dee9929d95e9fe26929c.js +0 -1
  311. package/assets/esri/core/workers/chunks/e12d91ef44d6f879a02a.js +0 -1
  312. package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../core/compilerUtils.js";import{isNone as r,isSome as t}from"../../../../core/maybe.js";import{defaultPrimitive as a}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{primitiveLodResources as s}from"./primitiveObjectSymbolUtils.js";import{hasEdges as i}from"../support/edgeUtils.js";import{VertexAttribute as o}from"../../webgl-engine/lib/basicInterfaces.js";import{geometriesFromLodLevelResources as u}from"../../webgl-engine/lib/lodRendering/LodResources.js";const b={primitivesPerFeature:0,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!0,memory:{bytesPerFeature:0,bytesPerCoordinate:0,bytesPerFeatureLabel:0,draped:{bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0}}};function P(e){if("web-style"===e.type)return b;return d(e.symbolLayers.toArray().map((r=>m(e,r))))}function d(e){let t=0,a=0,s=0,i=!1,o=0;const u={bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0,draped:{bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0}};for(const b of e)r(b)||(t+=b.primitivesPerFeature,a+=b.primitivesPerCoordinate,s+=b.drawCallsPerFeature,u.bytesPerFeature+=b.memory.bytesPerFeature,u.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,u.bytesPerCoordinate+=b.memory.bytesPerCoordinate,u.draped.bytesPerFeature+=b.memory.bytesPerFeature,u.draped.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,u.draped.bytesPerCoordinate+=b.memory.bytesPerCoordinate,i=i||b.estimated,++o);return{primitivesPerFeature:t,primitivesPerCoordinate:a,drawCallsPerFeature:s,estimated:i,memory:u,numComplexities:o}}function y(e){const r=d(e);return r.numComplexities>0&&(r.primitivesPerFeature/=r.numComplexities,r.primitivesPerCoordinate/=r.numComplexities,r.drawCallsPerFeature/=r.numComplexities,r.memory.bytesPerFeature/=r.numComplexities,r.memory.bytesPerFeatureLabel/=r.numComplexities,r.memory.bytesPerCoordinate/=r.numComplexities,r.memory.draped.bytesPerFeature/=r.numComplexities,r.memory.draped.bytesPerFeatureLabel/=r.numComplexities,r.memory.draped.bytesPerCoordinate/=r.numComplexities),r}const n={};function m(r,s){const o=l(r,s),u=i(s)?2:0;switch(s.type){case"extrude":return{primitivesPerFeature:-4,primitivesPerCoordinate:4,drawCallsPerFeature:u,estimated:!1,memory:o};case"fill":return"mesh-3d"===r.type?{primitivesPerFeature:0,primitivesPerCoordinate:0,drawCallsPerFeature:u,estimated:!1,memory:o}:t(s.outline)&&s.outline.size>0?{primitivesPerFeature:-4,primitivesPerCoordinate:3,drawCallsPerFeature:0,estimated:!1,memory:o}:{primitivesPerFeature:-2,primitivesPerCoordinate:1,drawCallsPerFeature:0,estimated:!1,memory:o};case"water":return{primitivesPerFeature:-2,primitivesPerCoordinate:1,drawCallsPerFeature:0,estimated:!1,memory:o};case"line":return{primitivesPerFeature:-2,primitivesPerCoordinate:2,drawCallsPerFeature:0,estimated:!1,memory:o};case"object":if(s.resource&&s.resource.href)return{primitivesPerFeature:16,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!0,memory:o};return{...F(s.resource&&s.resource.primitive||a),memory:o};case"path":{const r=3,t=3,a=10;let i=0,u=0;switch(s.profile){case"circle":i=a;break;case"quad":i=4;break;default:return void e(s.profile)}switch(s.join){case"round":u=r;break;case"miter":case"bevel":u=1;break;default:return void e(s.join)}const b=2*i,P=i*u*2;let d=-2*P-b;switch(s.cap){case"none":break;case"butt":case"square":d+=2*(i-1);break;case"round":d+=2*(i*(t-1)*2+i);break;default:return}return{primitivesPerFeature:d,primitivesPerCoordinate:P+b,drawCallsPerFeature:0,estimated:!1,memory:o}}case"text":case"icon":return{primitivesPerFeature:2,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1,memory:o};default:return}}function l(r,a){const s="point-3d"===r.type;switch(a.type){case"extrude":return a.edges&&a.edges.size>0?C.EXTRUDE_EDGES:C.EXTRUDE;case"fill":return t(a.outline)&&a.outline.size>0?C.FILL_OUTLINE:C.FILL;case"water":return C.FILL;case"line":return"round"===a.join?C.LINE_ROUND:C.LINE_MITER;case"path":switch(a.join){case"round":switch(a.profile){case"circle":return C.PATH_ROUND_CIRCLE;case"quad":return C.PATH_ROUND_QUAD;default:return void e(a.profile)}case"miter":case"bevel":switch(a.profile){case"circle":return C.PATH_MITER_CIRCLE;case"quad":return C.PATH_MITER_QUAD;default:return void e(a.profile)}default:return void e(a.join)}case"object":return s?C.OBJECT_POINT:C.OBJECT_POLYGON;case"icon":case"text":return s?C.ICON_POINT:C.ICON_POLYGON;default:return}}function F(e){let r=n[e];if(r)return r;const t=s(e,null);return r={primitivesPerFeature:u(t.levels[0]).reduce(((e,r)=>e+r.indices.get(o.POSITION).length/3),0),primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1},n[e]=r,r}const C={ICON_POINT:{bytesPerFeature:7127.413186968842,bytesPerFeatureLabel:4826.302896296296,bytesPerCoordinate:0,draped:{bytesPerFeature:3929.4396628895197,bytesPerFeatureLabel:3550.1332222222227,bytesPerCoordinate:0}},ICON_POLYGON:{bytesPerFeature:9329.452613976147,bytesPerFeatureLabel:3675.3372604938268,bytesPerCoordinate:60.177252982212096,draped:{bytesPerFeature:6190.247450139383,bytesPerFeatureLabel:3744.074358024691,bytesPerCoordinate:59.488211068026104}},OBJECT_POINT:{bytesPerFeature:2350.5884192634558,bytesPerFeatureLabel:4446.651003703703,bytesPerCoordinate:0,draped:{bytesPerFeature:2350.5884192634558,bytesPerFeatureLabel:4446.651003703703,bytesPerCoordinate:0}},OBJECT_POLYGON:{bytesPerFeature:4583.807620302299,bytesPerFeatureLabel:3665.342685185186,bytesPerCoordinate:60.11621818101506,draped:{bytesPerFeature:4583.807620302299,bytesPerFeatureLabel:3665.342685185186,bytesPerCoordinate:60.11621818101506}},LINE_MITER:{bytesPerFeature:7321.028181375921,bytesPerFeatureLabel:4048.0226716049388,bytesPerCoordinate:186.55621386363578,draped:{bytesPerFeature:4246.856619435009,bytesPerFeatureLabel:3852.3737679012347,bytesPerCoordinate:163.47884002621583}},LINE_ROUND:{bytesPerFeature:7482.205842738954,bytesPerFeatureLabel:4045.886987654321,bytesPerCoordinate:191.5452524171851,draped:{bytesPerFeature:4473.481387957992,bytesPerFeatureLabel:3842.1112395061728,bytesPerCoordinate:167.27703460226945}},PATH_MITER_CIRCLE:{bytesPerFeature:9010.489006415351,bytesPerFeatureLabel:4230.9109,bytesPerCoordinate:4618.2594178027275,draped:{bytesPerFeature:9010.489006415351,bytesPerFeatureLabel:4230.9109,bytesPerCoordinate:4618.2594178027275}},PATH_ROUND_CIRCLE:{bytesPerFeature:4104.727250200398,bytesPerFeatureLabel:4251.8525,bytesPerCoordinate:8019.043777064957,draped:{bytesPerFeature:4104.727250200398,bytesPerFeatureLabel:4251.8525,bytesPerCoordinate:8019.043777064957}},PATH_MITER_QUAD:{bytesPerFeature:9416.372942261387,bytesPerFeatureLabel:4241.2757,bytesPerCoordinate:3176.7222742582203,draped:{bytesPerFeature:9416.372942261387,bytesPerFeatureLabel:4241.2757,bytesPerCoordinate:3176.7222742582203}},PATH_ROUND_QUAD:{bytesPerFeature:6614.431545308682,bytesPerFeatureLabel:4206.7461,bytesPerCoordinate:5141.817789093826,draped:{bytesPerFeature:6614.431545308682,bytesPerFeatureLabel:4206.7461,bytesPerCoordinate:5141.817789093826}},FILL:{bytesPerFeature:9478.244183633637,bytesPerFeatureLabel:3713.816824691358,bytesPerCoordinate:95.9343604185578,draped:{bytesPerFeature:6287.911108168086,bytesPerFeatureLabel:3790.785032098766,bytesPerCoordinate:83.08783220478168}},FILL_OUTLINE:{bytesPerFeature:13085.871870349445,bytesPerFeatureLabel:3392.613241975309,bytesPerCoordinate:118.63968023169875,draped:{bytesPerFeature:8437.199992480122,bytesPerFeatureLabel:3973.5431172839503,bytesPerCoordinate:106.33556817014312}},EXTRUDE:{bytesPerFeature:19459.53727140414,bytesPerFeatureLabel:3743.7045209876546,bytesPerCoordinate:372.6819978900477,draped:{bytesPerFeature:19459.53727140414,bytesPerFeatureLabel:3743.7045209876546,bytesPerCoordinate:372.6819978900477}},EXTRUDE_EDGES:{bytesPerFeature:22266.888534913724,bytesPerFeatureLabel:3064.3193358024696,bytesPerCoordinate:374.3725221561312,draped:{bytesPerFeature:22266.888534913724,bytesPerFeatureLabel:3064.3193358024696,bytesPerCoordinate:374.3725221561312}}};export{y as averageSymbolComplexities,P as defaultSymbolComplexity,m as defaultSymbolLayerComplexity,l as defaultSymbolLayerMemoryComplexity,b as emptySymbolComplexity,C as memoryEstimators,d as totalSymbolComplexities};
5
+ import{neverReached as e}from"../../../../core/compilerUtils.js";import{isNone as r,isSome as t}from"../../../../core/maybe.js";import{defaultPrimitive as a}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{primitiveLodResources as s}from"./primitiveObjectSymbolUtils.js";import{hasEdges as i}from"../support/edgeUtils.js";import{VertexAttribute as o}from"../../webgl-engine/lib/VertexAttribute.js";import{geometriesFromLodLevelResources as u}from"../../webgl-engine/lib/lodRendering/LodResources.js";const b={primitivesPerFeature:0,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!0,memory:{bytesPerFeature:0,bytesPerCoordinate:0,bytesPerFeatureLabel:0,draped:{bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0}}};function P(e){if("web-style"===e.type)return b;return d(e.symbolLayers.toArray().map((r=>m(e,r))))}function d(e){let t=0,a=0,s=0,i=!1,o=0;const u={bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0,draped:{bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0}};for(const b of e)r(b)||(t+=b.primitivesPerFeature,a+=b.primitivesPerCoordinate,s+=b.drawCallsPerFeature,u.bytesPerFeature+=b.memory.bytesPerFeature,u.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,u.bytesPerCoordinate+=b.memory.bytesPerCoordinate,u.draped.bytesPerFeature+=b.memory.bytesPerFeature,u.draped.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,u.draped.bytesPerCoordinate+=b.memory.bytesPerCoordinate,i=i||b.estimated,++o);return{primitivesPerFeature:t,primitivesPerCoordinate:a,drawCallsPerFeature:s,estimated:i,memory:u,numComplexities:o}}function y(e){const r=d(e);return r.numComplexities>0&&(r.primitivesPerFeature/=r.numComplexities,r.primitivesPerCoordinate/=r.numComplexities,r.drawCallsPerFeature/=r.numComplexities,r.memory.bytesPerFeature/=r.numComplexities,r.memory.bytesPerFeatureLabel/=r.numComplexities,r.memory.bytesPerCoordinate/=r.numComplexities,r.memory.draped.bytesPerFeature/=r.numComplexities,r.memory.draped.bytesPerFeatureLabel/=r.numComplexities,r.memory.draped.bytesPerCoordinate/=r.numComplexities),r}const n={};function m(r,s){const o=l(r,s),u=i(s)?2:0;switch(s.type){case"extrude":return{primitivesPerFeature:-4,primitivesPerCoordinate:4,drawCallsPerFeature:u,estimated:!1,memory:o};case"fill":return"mesh-3d"===r.type?{primitivesPerFeature:0,primitivesPerCoordinate:0,drawCallsPerFeature:u,estimated:!1,memory:o}:t(s.outline)&&s.outline.size>0?{primitivesPerFeature:-4,primitivesPerCoordinate:3,drawCallsPerFeature:0,estimated:!1,memory:o}:{primitivesPerFeature:-2,primitivesPerCoordinate:1,drawCallsPerFeature:0,estimated:!1,memory:o};case"water":return{primitivesPerFeature:-2,primitivesPerCoordinate:1,drawCallsPerFeature:0,estimated:!1,memory:o};case"line":return{primitivesPerFeature:-2,primitivesPerCoordinate:2,drawCallsPerFeature:0,estimated:!1,memory:o};case"object":if(s.resource&&s.resource.href)return{primitivesPerFeature:16,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!0,memory:o};return{...F(s.resource&&s.resource.primitive||a),memory:o};case"path":{const r=3,t=3,a=10;let i=0,u=0;switch(s.profile){case"circle":i=a;break;case"quad":i=4;break;default:return void e(s.profile)}switch(s.join){case"round":u=r;break;case"miter":case"bevel":u=1;break;default:return void e(s.join)}const b=2*i,P=i*u*2;let d=-2*P-b;switch(s.cap){case"none":break;case"butt":case"square":d+=2*(i-1);break;case"round":d+=2*(i*(t-1)*2+i);break;default:return}return{primitivesPerFeature:d,primitivesPerCoordinate:P+b,drawCallsPerFeature:0,estimated:!1,memory:o}}case"text":case"icon":return{primitivesPerFeature:2,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1,memory:o};default:return}}function l(r,a){const s="point-3d"===r.type;switch(a.type){case"extrude":return a.edges&&a.edges.size>0?C.EXTRUDE_EDGES:C.EXTRUDE;case"fill":return t(a.outline)&&a.outline.size>0?C.FILL_OUTLINE:C.FILL;case"water":return C.FILL;case"line":return"round"===a.join?C.LINE_ROUND:C.LINE_MITER;case"path":switch(a.join){case"round":switch(a.profile){case"circle":return C.PATH_ROUND_CIRCLE;case"quad":return C.PATH_ROUND_QUAD;default:return void e(a.profile)}case"miter":case"bevel":switch(a.profile){case"circle":return C.PATH_MITER_CIRCLE;case"quad":return C.PATH_MITER_QUAD;default:return void e(a.profile)}default:return void e(a.join)}case"object":return s?C.OBJECT_POINT:C.OBJECT_POLYGON;case"icon":case"text":return s?C.ICON_POINT:C.ICON_POLYGON;default:return}}function F(e){let r=n[e];if(r)return r;const t=s(e,null);return r={primitivesPerFeature:u(t.levels[0]).reduce(((e,r)=>e+r.indices.get(o.POSITION).length/3),0),primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1},n[e]=r,r}const C={ICON_POINT:{bytesPerFeature:7127.413186968842,bytesPerFeatureLabel:4826.302896296296,bytesPerCoordinate:0,draped:{bytesPerFeature:3929.4396628895197,bytesPerFeatureLabel:3550.1332222222227,bytesPerCoordinate:0}},ICON_POLYGON:{bytesPerFeature:9329.452613976147,bytesPerFeatureLabel:3675.3372604938268,bytesPerCoordinate:60.177252982212096,draped:{bytesPerFeature:6190.247450139383,bytesPerFeatureLabel:3744.074358024691,bytesPerCoordinate:59.488211068026104}},OBJECT_POINT:{bytesPerFeature:2350.5884192634558,bytesPerFeatureLabel:4446.651003703703,bytesPerCoordinate:0,draped:{bytesPerFeature:2350.5884192634558,bytesPerFeatureLabel:4446.651003703703,bytesPerCoordinate:0}},OBJECT_POLYGON:{bytesPerFeature:4583.807620302299,bytesPerFeatureLabel:3665.342685185186,bytesPerCoordinate:60.11621818101506,draped:{bytesPerFeature:4583.807620302299,bytesPerFeatureLabel:3665.342685185186,bytesPerCoordinate:60.11621818101506}},LINE_MITER:{bytesPerFeature:7321.028181375921,bytesPerFeatureLabel:4048.0226716049388,bytesPerCoordinate:186.55621386363578,draped:{bytesPerFeature:4246.856619435009,bytesPerFeatureLabel:3852.3737679012347,bytesPerCoordinate:163.47884002621583}},LINE_ROUND:{bytesPerFeature:7482.205842738954,bytesPerFeatureLabel:4045.886987654321,bytesPerCoordinate:191.5452524171851,draped:{bytesPerFeature:4473.481387957992,bytesPerFeatureLabel:3842.1112395061728,bytesPerCoordinate:167.27703460226945}},PATH_MITER_CIRCLE:{bytesPerFeature:9010.489006415351,bytesPerFeatureLabel:4230.9109,bytesPerCoordinate:4618.2594178027275,draped:{bytesPerFeature:9010.489006415351,bytesPerFeatureLabel:4230.9109,bytesPerCoordinate:4618.2594178027275}},PATH_ROUND_CIRCLE:{bytesPerFeature:4104.727250200398,bytesPerFeatureLabel:4251.8525,bytesPerCoordinate:8019.043777064957,draped:{bytesPerFeature:4104.727250200398,bytesPerFeatureLabel:4251.8525,bytesPerCoordinate:8019.043777064957}},PATH_MITER_QUAD:{bytesPerFeature:9416.372942261387,bytesPerFeatureLabel:4241.2757,bytesPerCoordinate:3176.7222742582203,draped:{bytesPerFeature:9416.372942261387,bytesPerFeatureLabel:4241.2757,bytesPerCoordinate:3176.7222742582203}},PATH_ROUND_QUAD:{bytesPerFeature:6614.431545308682,bytesPerFeatureLabel:4206.7461,bytesPerCoordinate:5141.817789093826,draped:{bytesPerFeature:6614.431545308682,bytesPerFeatureLabel:4206.7461,bytesPerCoordinate:5141.817789093826}},FILL:{bytesPerFeature:9478.244183633637,bytesPerFeatureLabel:3713.816824691358,bytesPerCoordinate:95.9343604185578,draped:{bytesPerFeature:6287.911108168086,bytesPerFeatureLabel:3790.785032098766,bytesPerCoordinate:83.08783220478168}},FILL_OUTLINE:{bytesPerFeature:13085.871870349445,bytesPerFeatureLabel:3392.613241975309,bytesPerCoordinate:118.63968023169875,draped:{bytesPerFeature:8437.199992480122,bytesPerFeatureLabel:3973.5431172839503,bytesPerCoordinate:106.33556817014312}},EXTRUDE:{bytesPerFeature:19459.53727140414,bytesPerFeatureLabel:3743.7045209876546,bytesPerCoordinate:372.6819978900477,draped:{bytesPerFeature:19459.53727140414,bytesPerFeatureLabel:3743.7045209876546,bytesPerCoordinate:372.6819978900477}},EXTRUDE_EDGES:{bytesPerFeature:22266.888534913724,bytesPerFeatureLabel:3064.3193358024696,bytesPerCoordinate:374.3725221561312,draped:{bytesPerFeature:22266.888534913724,bytesPerFeatureLabel:3064.3193358024696,bytesPerCoordinate:374.3725221561312}}};export{y as averageSymbolComplexities,P as defaultSymbolComplexity,m as defaultSymbolLayerComplexity,l as defaultSymbolLayerMemoryComplexity,b as emptySymbolComplexity,C as memoryEstimators,d as totalSymbolComplexities};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{clone as t}from"../../../../core/lang.js";import n from"../../../../core/Logger.js";import{decodeRGB as r,decodeIntensity as o}from"./LEPCC.js";import{VertexAttribute as i}from"../../webgl-engine/lib/basicInterfaces.js";const a=n.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function u(t,n,r){let o="",i=0;for(;i<r;){const a=t[n+i];if(a<128)o+=String.fromCharCode(a),i++;else if(a>=192&&a<224){if(i+1>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const u=(31&a)<<6|63&t[n+i+1];o+=String.fromCharCode(u),i+=2}else if(a>=224&&a<240){if(i+2>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const u=(15&a)<<12|(63&t[n+i+1])<<6|63&t[n+i+2];o+=String.fromCharCode(u),i+=3}else{if(!(a>=240&&a<248))throw new e("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(i+3>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const u=(7&a)<<18|(63&t[n+i+1])<<12|(63&t[n+i+2])<<6|63&t[n+i+3];if(u>=65536){const e=55296+(u-65536>>10),t=56320+(1023&u);o+=String.fromCharCode(e,t)}else o+=String.fromCharCode(u);i+=4}}}return o}function s(e,t){const n={byteOffset:0,byteCount:0,fields:Object.create(null)};let r=0;for(let o=0;o<t.length;o++){const i=t[o],a=i.valueType||i.type,u=h[a];n.fields[i.property]=u(e,r),r+=m[a].BYTES_PER_ELEMENT}return n.byteCount=r,n}function c(t,n,r){const o=[];let i,a,s=0;for(a=0;a<t;a+=1){if(i=n[a],i>0){if(o.push(u(r,s,i-1)),0!==r[s+i-1])throw new e("string-array-error","Invalid string array: missing null termination.")}else o.push(null);s+=i}return o}function f(e,t){return new(0,m[t.valueType])(e,t.byteOffset,t.count*t.valuesPerElement)}function l(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}function b(n,r,o){const i=null!=r.header?s(n,r.header):{byteOffset:0,byteCount:0,fields:{count:o}},a={header:i,byteOffset:i.byteCount,byteCount:0,entries:Object.create(null)};let u=i.byteCount;for(let s=0;s<r.ordering.length;s++){const n=r.ordering[s],o=t(r[n]);if(o.count=i.fields.count,"String"===o.valueType){if(o.byteOffset=u,o.byteCount=i.fields[n+"ByteCount"],"UTF-8"!==o.encoding)throw new e("unsupported-encoding","Unsupported String encoding.",{encoding:o.encoding})}else{if(!A(o.valueType))throw new e("unsupported-value-type","Unsupported binary valueType",{valueType:o.valueType});{const e=O(o.valueType);u+=u%e!=0?e-u%e:0,o.byteOffset=u,o.byteCount=e*o.valuesPerElement*o.count}}u+=o.byteCount,a.entries[n]=o}return a.byteCount=u-a.byteOffset,a}function d(t,n,r){if(n!==t&&a.error(`Invalid ${r} buffer size\n expected: ${t}, actual: ${n})`),n<t)throw new e("buffer-too-small","Binary buffer is too small",{expectedSize:t,actualSize:n})}function y(e){return{isDraco:!1,isLegacy:!1,color:null!=e.color,normal:null!=e.normal,uv0:null!=e.uv0,uvRegion:null!=e.uvRegion,featureIndex:null!=e.faceRange&&null!=e.featureId}}function g(e,t){const n=s(e,t&&t.header);let r=n.byteCount;const o={isDraco:!1,header:n,byteOffset:n.byteCount,byteCount:0,vertexAttributes:{}},i=n.fields,a=null!=i.vertexCount?i.vertexCount:i.count;for(const s of t.ordering){if(!t.vertexAttributes[s])continue;const e={...t.vertexAttributes[s],byteOffset:r,count:a},n=C[s]?C[s]:"_"+s;o.vertexAttributes[n]=e,r+=O(e.valueType)*e.valuesPerElement*a}const u=i.faceCount;if(t.faces&&u){o.faces={};for(const e of t.ordering){if(!t.faces[e])continue;const n={...t.faces[e],byteOffset:r,count:u};o.faces[e]=n,r+=O(n.valueType)*n.valuesPerElement*u}}const c=i.featureCount;if(t.featureAttributes&&t.featureAttributeOrder&&c){o.featureAttributes={};for(const e of t.featureAttributeOrder){if(!t.featureAttributes[e])continue;const n={...t.featureAttributes[e],byteOffset:r,count:c};o.featureAttributes[e]=n;r+=("UInt64"===n.valueType?8:O(n.valueType))*n.valuesPerElement*c}}return d(r,e.byteLength,"geometry"),o.byteCount=r-o.byteOffset,o}function w(e,t){return!(!e||!e.compressedAttributes||"draco"!==e.compressedAttributes.encoding)?v(e.compressedAttributes.attributes):e?y(e):p(t)}function p(e){const t={isDraco:!1,isLegacy:!0,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e.ordering)if(e.vertexAttributes[n])switch(n){case"position":break;case"normal":t.normal=!0;break;case"color":t.color=!0;break;case"uv0":t.uv0=!0;break;case"region":t.uvRegion=!0}return e.featureAttributes&&e.featureAttributeOrder&&(t.featureIndex=!0),t}function v(e){const t={isDraco:!0,isLegacy:!1,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e)switch(n){case"position":break;case"normal":t.normal=!0;break;case"uv0":t.uv0=!0;break;case"color":t.color=!0;break;case"uv-region":t.uvRegion=!0;break;case"feature-index":t.featureIndex=!0}return t}const C={position:i.POSITION,normal:i.NORMAL,color:i.COLOR,uv0:i.UV0,region:i.UVREGION};function I(t,n,i){if("lepcc-rgb"===t.encoding)return r(n);if("lepcc-intensity"===t.encoding)return o(n);if(null!=t.encoding&&""!==t.encoding)throw new e("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");t["attributeByteCounts "]&&!t.attributeByteCounts&&(a.warn("Warning: Trailing space in 'attributeByteCounts '."),t.attributeByteCounts=t["attributeByteCounts "]),"ObjectIds"===t.ordering[0]&&t.hasOwnProperty("objectIds")&&(a.warn("Warning: Case error in objectIds"),t.ordering[0]="objectIds");const u=b(n,t,i);d(u.byteOffset+u.byteCount,n.byteLength,"attribute");const s=u.entries.attributeValues||u.entries.objectIds;if(s){if("String"===s.valueType){const e=u.entries.attributeByteCounts,t=f(n,e),r=l(n,s);return c(e.count,t,r)}return f(n,s)}throw new e("bad-attribute-storage-info","Bad attributeStorageInfo specification.")}const m={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},h={Float32:(e,t)=>new DataView(e,0).getFloat32(t,!0),Float64:(e,t)=>new DataView(e,0).getFloat64(t,!0),UInt8:(e,t)=>new DataView(e,0).getUint8(t),Int8:(e,t)=>new DataView(e,0).getInt8(t),UInt16:(e,t)=>new DataView(e,0).getUint16(t,!0),Int16:(e,t)=>new DataView(e,0).getInt16(t,!0),UInt32:(e,t)=>new DataView(e,0).getUint32(t,!0),Int32:(e,t)=>new DataView(e,0).getInt32(t,!0)};function A(e){return m.hasOwnProperty(e)}function O(e){return A(e)?m[e].BYTES_PER_ELEMENT:0}export{b as createAttributeDataIndex,w as createGeometryDescriptor,v as createGeometryDescriptorForDraco,y as createGeometryDescriptorFromDefinition,p as createGeometryDescriptorFromSchema,g as createGeometryIndexFromSchema,l as createRawView,f as createTypedView,O as getBytesPerValue,A as isValueType,I as readBinaryAttribute,s as readHeader,c as readStringArray,h as valueType2ArrayBufferReader,m as valueType2TypedArrayClassMap};
5
+ import e from"../../../../core/Error.js";import{clone as t}from"../../../../core/lang.js";import n from"../../../../core/Logger.js";import{decodeRGB as r,decodeIntensity as o}from"./LEPCC.js";import{VertexAttribute as i}from"../../webgl-engine/lib/VertexAttribute.js";const u=n.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function a(t,n,r){let o="",i=0;for(;i<r;){const u=t[n+i];if(u<128)o+=String.fromCharCode(u),i++;else if(u>=192&&u<224){if(i+1>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const a=(31&u)<<6|63&t[n+i+1];o+=String.fromCharCode(a),i+=2}else if(u>=224&&u<240){if(i+2>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(15&u)<<12|(63&t[n+i+1])<<6|63&t[n+i+2];o+=String.fromCharCode(a),i+=3}else{if(!(u>=240&&u<248))throw new e("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(i+3>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(7&u)<<18|(63&t[n+i+1])<<12|(63&t[n+i+2])<<6|63&t[n+i+3];if(a>=65536){const e=55296+(a-65536>>10),t=56320+(1023&a);o+=String.fromCharCode(e,t)}else o+=String.fromCharCode(a);i+=4}}}return o}function s(e,t){const n={byteOffset:0,byteCount:0,fields:Object.create(null)};let r=0;for(let o=0;o<t.length;o++){const i=t[o],u=i.valueType||i.type,a=h[u];n.fields[i.property]=a(e,r),r+=m[u].BYTES_PER_ELEMENT}return n.byteCount=r,n}function c(t,n,r){const o=[];let i,u,s=0;for(u=0;u<t;u+=1){if(i=n[u],i>0){if(o.push(a(r,s,i-1)),0!==r[s+i-1])throw new e("string-array-error","Invalid string array: missing null termination.")}else o.push(null);s+=i}return o}function f(e,t){return new(0,m[t.valueType])(e,t.byteOffset,t.count*t.valuesPerElement)}function l(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}function b(n,r,o){const i=null!=r.header?s(n,r.header):{byteOffset:0,byteCount:0,fields:{count:o}},u={header:i,byteOffset:i.byteCount,byteCount:0,entries:Object.create(null)};let a=i.byteCount;for(let s=0;s<r.ordering.length;s++){const n=r.ordering[s],o=t(r[n]);if(o.count=i.fields.count,"String"===o.valueType){if(o.byteOffset=a,o.byteCount=i.fields[n+"ByteCount"],"UTF-8"!==o.encoding)throw new e("unsupported-encoding","Unsupported String encoding.",{encoding:o.encoding})}else{if(!A(o.valueType))throw new e("unsupported-value-type","Unsupported binary valueType",{valueType:o.valueType});{const e=O(o.valueType);a+=a%e!=0?e-a%e:0,o.byteOffset=a,o.byteCount=e*o.valuesPerElement*o.count}}a+=o.byteCount,u.entries[n]=o}return u.byteCount=a-u.byteOffset,u}function d(t,n,r){if(n!==t&&u.error(`Invalid ${r} buffer size\n expected: ${t}, actual: ${n})`),n<t)throw new e("buffer-too-small","Binary buffer is too small",{expectedSize:t,actualSize:n})}function y(e){return{isDraco:!1,isLegacy:!1,color:null!=e.color,normal:null!=e.normal,uv0:null!=e.uv0,uvRegion:null!=e.uvRegion,featureIndex:null!=e.faceRange&&null!=e.featureId}}function g(e,t){const n=s(e,t&&t.header);let r=n.byteCount;const o={isDraco:!1,header:n,byteOffset:n.byteCount,byteCount:0,vertexAttributes:{}},i=n.fields,u=null!=i.vertexCount?i.vertexCount:i.count;for(const s of t.ordering){if(!t.vertexAttributes[s])continue;const e={...t.vertexAttributes[s],byteOffset:r,count:u},n=C[s]?C[s]:"_"+s;o.vertexAttributes[n]=e,r+=O(e.valueType)*e.valuesPerElement*u}const a=i.faceCount;if(t.faces&&a){o.faces={};for(const e of t.ordering){if(!t.faces[e])continue;const n={...t.faces[e],byteOffset:r,count:a};o.faces[e]=n,r+=O(n.valueType)*n.valuesPerElement*a}}const c=i.featureCount;if(t.featureAttributes&&t.featureAttributeOrder&&c){o.featureAttributes={};for(const e of t.featureAttributeOrder){if(!t.featureAttributes[e])continue;const n={...t.featureAttributes[e],byteOffset:r,count:c};o.featureAttributes[e]=n;r+=("UInt64"===n.valueType?8:O(n.valueType))*n.valuesPerElement*c}}return d(r,e.byteLength,"geometry"),o.byteCount=r-o.byteOffset,o}function w(e,t){return!(!e||!e.compressedAttributes||"draco"!==e.compressedAttributes.encoding)?v(e.compressedAttributes.attributes):e?y(e):p(t)}function p(e){const t={isDraco:!1,isLegacy:!0,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e.ordering)if(e.vertexAttributes[n])switch(n){case"position":break;case"normal":t.normal=!0;break;case"color":t.color=!0;break;case"uv0":t.uv0=!0;break;case"region":t.uvRegion=!0}return e.featureAttributes&&e.featureAttributeOrder&&(t.featureIndex=!0),t}function v(e){const t={isDraco:!0,isLegacy:!1,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e)switch(n){case"position":break;case"normal":t.normal=!0;break;case"uv0":t.uv0=!0;break;case"color":t.color=!0;break;case"uv-region":t.uvRegion=!0;break;case"feature-index":t.featureIndex=!0}return t}const C={position:i.POSITION,normal:i.NORMAL,color:i.COLOR,uv0:i.UV0,region:i.UVREGION};function I(t,n,i){if("lepcc-rgb"===t.encoding)return r(n);if("lepcc-intensity"===t.encoding)return o(n);if(null!=t.encoding&&""!==t.encoding)throw new e("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");t["attributeByteCounts "]&&!t.attributeByteCounts&&(u.warn("Warning: Trailing space in 'attributeByteCounts '."),t.attributeByteCounts=t["attributeByteCounts "]),"ObjectIds"===t.ordering[0]&&t.hasOwnProperty("objectIds")&&(u.warn("Warning: Case error in objectIds"),t.ordering[0]="objectIds");const a=b(n,t,i);d(a.byteOffset+a.byteCount,n.byteLength,"attribute");const s=a.entries.attributeValues||a.entries.objectIds;if(s){if("String"===s.valueType){const e=a.entries.attributeByteCounts,t=f(n,e),r=l(n,s);return c(e.count,t,r)}return f(n,s)}throw new e("bad-attribute-storage-info","Bad attributeStorageInfo specification.")}const m={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},h={Float32:(e,t)=>new DataView(e,0).getFloat32(t,!0),Float64:(e,t)=>new DataView(e,0).getFloat64(t,!0),UInt8:(e,t)=>new DataView(e,0).getUint8(t),Int8:(e,t)=>new DataView(e,0).getInt8(t),UInt16:(e,t)=>new DataView(e,0).getUint16(t,!0),Int16:(e,t)=>new DataView(e,0).getInt16(t,!0),UInt32:(e,t)=>new DataView(e,0).getUint32(t,!0),Int32:(e,t)=>new DataView(e,0).getInt32(t,!0)};function A(e){return m.hasOwnProperty(e)}function O(e){return A(e)?m[e].BYTES_PER_ELEMENT:0}export{b as createAttributeDataIndex,w as createGeometryDescriptor,v as createGeometryDescriptorForDraco,y as createGeometryDescriptorFromDefinition,p as createGeometryDescriptorFromSchema,g as createGeometryIndexFromSchema,l as createRawView,f as createTypedView,O as getBytesPerValue,A as isValueType,I as readBinaryAttribute,s as readHeader,c as readStringArray,h as valueType2ArrayBufferReader,m as valueType2TypedArrayClassMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e,isNone as i,unwrap as t,disposeMaybe as s}from"../../../../core/maybe.js";import r from"../../../../core/PooledArray.js";import{f as n,m as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f32.js";import{f as a,l,a as c,o as d,d as u,p as m,s as p}from"../../../../chunks/vec3.js";import{c as g}from"../../../../chunks/vec3f32.js";import{c as f}from"../../../../chunks/vec3f64.js";import{s as _}from"../../../../chunks/vec4.js";import{create as S,POSITIVE_INFINITY as x,offset as b,contains as z,containsPoint as P,equals as w,set as R}from"../../../../geometry/support/aaBoundingBox.js";import{create as A}from"../../../../geometry/support/plane.js";import{fromPoints as M}from"../../../../geometry/support/ray.js";import{PointHighlights as j}from"./PointHighlights.js";import{minimumDistancePlane as y,maximumDistancePlane as H,intersectLine as I,toAaBoundingBox as q}from"../../support/orientedBoundingBox.js";import{ShaderOutput as v}from"../../webgl-engine/core/shaderLibrary/ShaderOutputOptions.js";import{bindSliceUniforms as T}from"../../webgl-engine/core/shaderLibrary/Slice.glsl.js";import{bindOutputHighlight as L}from"../../webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{VertexAttribute as E}from"../../webgl-engine/lib/basicInterfaces.js";import{Default3D as F}from"../../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{newIntersectorResult as V}from"../../webgl-engine/lib/Intersector.js";import{IntersectorType as U,StoreResults as C}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{RenderPass as O}from"../../webgl-engine/lib/RenderPass.js";import{PointRendererTechniqueConfiguration as N,PointRendererTechnique as D}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{BufferObject as B}from"../../../webgl/BufferObject.js";import{DataType as W,PrimitiveType as G,Usage as k}from"../../../webgl/enums.js";import{VertexArrayObject as Y}from"../../../webgl/VertexArrayObject.js";import{VertexElementDescriptor as J}from"../../../webgl/VertexElementDescriptor.js";const K={positions:[new J(E.POSITION,3,W.FLOAT,0,12)],colors:[new J(E.COLOR,3,W.UNSIGNED_BYTE,0,3,!0)]};class Q{constructor(e){this._params=e,this.type=U.PCL,this.isGround=!1,this._bindParameters={inverseViewport:[0,0],highlightDepthTexture:null},this._highlights=new j({forEachNode:e=>this.forEachNode(e),addHighlight:(e,i,t)=>this._addHighlight(e,i,t),removeHighlight:(e,i)=>this._removeHighlight(e,i)}),this.canRender=!0,this.layerUid="",this._useFixedSizes=!1,this._scaleFactor=1,this._minSizePx=0,this._useRealWorldSymbolSizes=!1,this._size=0,this._sizePx=0,this._slicePlaneEnabled=!1,this._clipBox=S(x),this._techniqueConfig=new N,this.tempMatrix4=h(),this.tempVec3=g(),this.nodes=new r}get needsHighlight(){return this._highlights.hasHighlights}initializeRenderContext(e){this._context=e,this._techniqueRep=this._context.shaderTechniqueRep,e.requestRender()}uninitializeRenderContext(){}intersect(e,i,t,s){const r=f(),n=f(),o=f(),h=f(),p=A(),g=e.camera.perScreenPixelRatio/2,x=e.camera.near,w=this._getSizeParams();a(n,s,t);const R=1/l(n);c(n,n,R),d(o,n),_(p,n[0],n[1],n[2],-u(n,t));const j=new ne,v=new ne,T=new Array,L=S(),E=S(this._clipBox);b(E,-t[0],-t[1],-t[2],E),this.nodes.forAll((l=>{const c=l.splatSize*this._scaleFactor;let d=y(l.obb,p),f=H(l.obb,p);d-=ee(c,d+x,w,g,l.isLeaf),f-=ee(c,f+x,w,g,l.isLeaf);const _=f<0,S=null!=j.dist&&null!=v.dist&&j.dist<d*R&&v.dist>f*R;if(_||S)return;const A=$(c,f+x,w,g,l.isLeaf);if(!I(l.obb,t,n,A))return;const M=A*A;q(l.obb,L),b(L,-t[0],-t[1],-t[2],L);const F=!z(E,L);a(h,l.origin,t);const V=l.coordinates.length/3;for(let a=0;a<V;a++){if(r[0]=h[0]+l.coordinates[3*a],r[1]=h[1]+l.coordinates[3*a+1],r[2]=h[2]+l.coordinates[3*a+2],F&&!P(E,r))continue;const d=u(r,n),p=m(r)-d*d;if(p>M)continue;let f=d+x;const _=ee(c,f,w,g,l.isLeaf);if(d-_<0)continue;f-=_;const S=$(c,f,w,g,l.isLeaf);if(p>S*S)continue;const b=(d-_)*R,z=e=>(e.point=ie(l,a,e.point),e.dist=b,e.normal=o,e.node=l,e.pointId=a,e.layerUid=this.layerUid,e);if((null==j.dist||b<j.dist)&&(null==i||i(t,s,b))&&z(j),e.options.store!==C.MIN&&(null==v.dist||b>v.dist)&&(null==i||i(t,s,b))&&z(v),e.options.store===C.ALL&&(null==i||i(t,s,b))){const e=new ne;T.push(z(e))}}}));const F=e=>{const{layerUid:i,node:t,pointId:s}=e;return{point:e.point,layerUid:i,graphicUid:s,createGraphic:()=>this._params.createGraphic(t,s,e.point)}},U=(e,i)=>{const t=F(i);e.set(this.type,t,i.dist,i.normal)};if(oe(j)){const i=e.results.min;(null==i.dist||j.dist<i.dist)&&U(i,j)}if(oe(v)&&e.options.store!==C.MIN){const i=e.results.max;(null==i.dist||v.dist>i.dist)&&U(i,v)}if(e.options.store===C.ALL){const i=M(t,s);for(const t of T){const s=V(i);U(s,t),e.results.all.push(s)}}}prepareTechnique(e){if(0===this.nodes.length||e.pass!==O.MATERIAL&&e.pass!==O.MATERIAL_DEPTH&&e.pass!==O.MATERIAL_HIGHLIGHT)return null;this.nodes.forAll((i=>{null==i.vao&&this._initNode(e,i)}));const i=this._getSizeParams();return this._techniqueConfig.drawScreenSize=i.drawScreenSpace,this._techniqueConfig.slicePlaneEnabled=this._slicePlaneEnabled,this._techniqueConfig.sceneHasOcludees=e.hasOccludees,this._techniqueConfig.output=e.pass===O.MATERIAL_DEPTH?v.Depth:e.pass===O.MATERIAL_HIGHLIGHT?v.Highlight:v.Color,this._techniqueRep.releaseAndAcquire(D,this._techniqueConfig,this._technique)}render(e,i){const t=e.rctx,s=this._getSizeParams(),r=i.program;t.useProgram(r),i.bindPipelineState(t);const h=this._clipBox,a=!w(h,x,((e,i)=>e===i));a||(p(this.tempVec3,-1/0,-1/0,-1/0),r.setUniform3fv("uClipMin",this.tempVec3),p(this.tempVec3,1/0,1/0,1/0),r.setUniform3fv("uClipMax",this.tempVec3)),r.setUniformMatrix4fv("uProjectionMatrix",e.camera.projectionMatrix);e.pass===O.MATERIAL_DEPTH&&r.setUniform2f("nearFar",e.camera.near,e.camera.far),e.isHighlightPass&&(this._bindParameters.inverseViewport[0]=1/e.camera.fullViewport[2],this._bindParameters.inverseViewport[1]=1/e.camera.fullViewport[3],this._bindParameters.highlightDepthTexture=e.highlightDepthTexture,L(r,this._bindParameters));const l=e.camera.pixelRatio;s.drawFixedSize&&r.setUniform2f("uPointScale",s.fixedSize*l,e.camera.fullHeight);const c=this._slicePlaneEnabled?e.sliceHelper&&e.sliceHelper.plane:null;this.nodes.forAll((d=>{if(0===d.coordinates.length||e.isHighlightPass&&!d.highlights)return;if(r.setUniform2f("uScreenMinMaxSize",s.screenMinSize*l,Z(d.isLeaf)*l),!s.drawFixedSize){const i=d.splatSize*this._scaleFactor;r.setUniform2f("uPointScale",i*l,e.camera.fullHeight/l)}const u=d.origin;a&&(p(this.tempVec3,h[0]-u[0],h[1]-u[1],h[2]-u[2]),r.setUniform3fv("uClipMin",this.tempVec3),p(this.tempVec3,h[3]-u[0],h[4]-u[1],h[5]-u[2]),r.setUniform3fv("uClipMax",this.tempVec3)),n(this.tempMatrix4,u),o(this.tempMatrix4,e.camera.viewMatrix,this.tempMatrix4),r.setUniformMatrix4fv("uModelViewMatrix",this.tempMatrix4),T(r,i.configuration,c,u),t.bindVAO(d.vao),e.isHighlightPass?this._renderHighlightFragments(t,d):t.drawArrays(G.POINTS,0,d.coordinates.length/3)}))}_renderHighlightFragments(e,s){const r=s.highlights;if(i(r))return;let n=t(r[0].component),o=n+1;for(let i=1;i<r.length;i++){const s=t(r[i].component);if(s!==o){const i=o-n;i>0&&e.drawArrays(G.POINTS,n,i),n=s}o=s+1}const h=o-n;h>0&&e.drawArrays(G.POINTS,n,h)}set useFixedSizes(e){this._useFixedSizes!==e&&(this._useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._useFixedSizes}set scaleFactor(e){this._scaleFactor!==e&&(this._scaleFactor=e,this._requestRender())}get scaleFactor(){return this._scaleFactor}set minSizePx(e){this._minSizePx!==e&&(this._minSizePx=e,this._requestRender())}get minSizePx(){return this._minSizePx}set useRealWorldSymbolSizes(e){this._useRealWorldSymbolSizes!==e&&(this._useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._useRealWorldSymbolSizes}set size(e){this._size!==e&&(this._size=e,this._requestRender())}get size(){return this._size}set sizePx(e){this._sizePx!==e&&(this._sizePx=e,this._requestRender())}get sizePx(){return this._sizePx}set clippingBox(e){R(this._clipBox,e||x)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this.nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let i=null;return this.nodes.filterInPlace((t=>t.id!==e||(i=t,t.vao=s(t.vao),this._highlights.nodeRemoved(t),!1))),this._requestRender(),i}forEachNode(e){this.nodes.forAll(e)}removeAll(){this.nodes.forAll((e=>e.vao=s(e.vao))),this._highlights.removeAll(),this.nodes.clear(),this._requestRender()}highlight(e){return this._highlights.add(e)}_addHighlight(e,i,t){e.highlights=se(e.highlights,i,t),this._requestRender()}_removeHighlight(e,i){e.highlights=re(e.highlights,i),this._requestRender()}_initNode(e,i){const t=e.rctx;i.vao=new Y(t,F,K,{positions:B.createVertex(t,k.STATIC_DRAW,i.coordinates),colors:B.createVertex(t,k.STATIC_DRAW,i.rgb)})}_requestRender(){this._context&&this._context.requestRender()}_getSizeParams(){const e=this._useFixedSizes,i=e&&!this._useRealWorldSymbolSizes;return{drawScreenSpace:i,drawFixedSize:e,fixedSize:i?this._sizePx:this._size,screenMinSize:e?0:this._minSizePx}}}function X(e){return e.hasOwnProperty("splatSize")}function Z(e){return e?256:64}function $(e,i,t,s,r){if(t.drawScreenSpace)return t.fixedSize*i*s;const n=Z(r)*i*s;return t.drawFixedSize?Math.min(t.fixedSize/2,n):t.screenMinSize>0?Math.min(Math.max(t.screenMinSize*i*s,e/2),n):Math.min(e/2,n)}function ee(e,i,t,s,r){return t.drawScreenSpace?0:$(e,i,t,s,r)}function ie(e,t,s){return i(s)&&(s=f()),s[0]=e.origin[0]+e.coordinates[3*t],s[1]=e.origin[1]+e.coordinates[3*t+1],s[2]=e.origin[2]+e.coordinates[3*t+2],s}function te(i){return e(i.component)?i.component:-1}function se(e,t,s){i(e)&&(e=[]);const r={component:t,id:s};e.push(r);const n=te(r);let o=e.length-1;for(;o>0&&n<te(e[o-1]);)[e[o-1],e[o]]=[e[o],e[o-1]],--o;return e}function re(e,t){if(i(e))return e;const s=e.filter((e=>e.id!==t));return 0===s.length?null:s}class ne{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerUid=""}}function oe(i){return e(i.dist)&&e(i.point)&&e(i.pointId)&&e(i.node)}export{Q as PointRenderer,X as isInstanceOfNode};
5
+ import{isSome as e,isNone as i,unwrap as t,disposeMaybe as s}from"../../../../core/maybe.js";import r from"../../../../core/PooledArray.js";import{f as n,m as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f32.js";import{f as a,l,a as c,o as d,d as u,p as m,s as p}from"../../../../chunks/vec3.js";import{c as g}from"../../../../chunks/vec3f32.js";import{c as f}from"../../../../chunks/vec3f64.js";import{s as _}from"../../../../chunks/vec4.js";import{create as S,POSITIVE_INFINITY as x,offset as b,contains as z,containsPoint as P,equals as w,set as R}from"../../../../geometry/support/aaBoundingBox.js";import{create as A}from"../../../../geometry/support/plane.js";import{fromPoints as M}from"../../../../geometry/support/ray.js";import{PointHighlights as j}from"./PointHighlights.js";import{minimumDistancePlane as y,maximumDistancePlane as H,intersectLine as v,toAaBoundingBox as q}from"../../support/orientedBoundingBox.js";import{ShaderOutput as I}from"../../webgl-engine/core/shaderLibrary/ShaderOutputOptions.js";import{bindSliceUniforms as T}from"../../webgl-engine/core/shaderLibrary/Slice.glsl.js";import{bindOutputHighlight as L}from"../../webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{Default3D as E}from"../../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{newIntersectorResult as F}from"../../webgl-engine/lib/Intersector.js";import{IntersectorType as V,StoreResults as U}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{RenderPass as O}from"../../webgl-engine/lib/RenderPass.js";import{VertexAttribute as N}from"../../webgl-engine/lib/VertexAttribute.js";import{PointRendererTechniqueConfiguration as C,PointRendererTechnique as D}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{BufferObject as B}from"../../../webgl/BufferObject.js";import{DataType as W,PrimitiveType as G,Usage as k}from"../../../webgl/enums.js";import{VertexArrayObject as Y}from"../../../webgl/VertexArrayObject.js";import{VertexElementDescriptor as J}from"../../../webgl/VertexElementDescriptor.js";const K={positions:[new J(N.POSITION,3,W.FLOAT,0,12)],colors:[new J(N.COLOR,3,W.UNSIGNED_BYTE,0,3,!0)]};class Q{constructor(e){this._params=e,this.type=V.PCL,this.isGround=!1,this._bindParameters={inverseViewport:[0,0],highlightDepthTexture:null},this._highlights=new j({forEachNode:e=>this.forEachNode(e),addHighlight:(e,i,t)=>this._addHighlight(e,i,t),removeHighlight:(e,i)=>this._removeHighlight(e,i)}),this.canRender=!0,this.layerUid="",this._useFixedSizes=!1,this._scaleFactor=1,this._minSizePx=0,this._useRealWorldSymbolSizes=!1,this._size=0,this._sizePx=0,this._slicePlaneEnabled=!1,this._clipBox=S(x),this._techniqueConfig=new C,this.tempMatrix4=h(),this.tempVec3=g(),this.nodes=new r}get needsHighlight(){return this._highlights.hasHighlights}initializeRenderContext(e){this._context=e,this._techniqueRep=this._context.shaderTechniqueRep,e.requestRender()}uninitializeRenderContext(){}intersect(e,i,t,s){const r=f(),n=f(),o=f(),h=f(),p=A(),g=e.camera.perScreenPixelRatio/2,x=e.camera.near,w=this._getSizeParams();a(n,s,t);const R=1/l(n);c(n,n,R),d(o,n),_(p,n[0],n[1],n[2],-u(n,t));const j=new ne,I=new ne,T=new Array,L=S(),E=S(this._clipBox);b(E,-t[0],-t[1],-t[2],E),this.nodes.forAll((l=>{const c=l.splatSize*this._scaleFactor;let d=y(l.obb,p),f=H(l.obb,p);d-=ee(c,d+x,w,g,l.isLeaf),f-=ee(c,f+x,w,g,l.isLeaf);const _=f<0,S=null!=j.dist&&null!=I.dist&&j.dist<d*R&&I.dist>f*R;if(_||S)return;const A=$(c,f+x,w,g,l.isLeaf);if(!v(l.obb,t,n,A))return;const M=A*A;q(l.obb,L),b(L,-t[0],-t[1],-t[2],L);const F=!z(E,L);a(h,l.origin,t);const V=l.coordinates.length/3;for(let a=0;a<V;a++){if(r[0]=h[0]+l.coordinates[3*a],r[1]=h[1]+l.coordinates[3*a+1],r[2]=h[2]+l.coordinates[3*a+2],F&&!P(E,r))continue;const d=u(r,n),p=m(r)-d*d;if(p>M)continue;let f=d+x;const _=ee(c,f,w,g,l.isLeaf);if(d-_<0)continue;f-=_;const S=$(c,f,w,g,l.isLeaf);if(p>S*S)continue;const b=(d-_)*R,z=e=>(e.point=ie(l,a,e.point),e.dist=b,e.normal=o,e.node=l,e.pointId=a,e.layerUid=this.layerUid,e);if((null==j.dist||b<j.dist)&&(null==i||i(t,s,b))&&z(j),e.options.store!==U.MIN&&(null==I.dist||b>I.dist)&&(null==i||i(t,s,b))&&z(I),e.options.store===U.ALL&&(null==i||i(t,s,b))){const e=new ne;T.push(z(e))}}}));const V=e=>{const{layerUid:i,node:t,pointId:s}=e;return{point:e.point,layerUid:i,graphicUid:s,createGraphic:()=>this._params.createGraphic(t,s,e.point)}},O=(e,i)=>{const t=V(i);e.set(this.type,t,i.dist,i.normal)};if(oe(j)){const i=e.results.min;(null==i.dist||j.dist<i.dist)&&O(i,j)}if(oe(I)&&e.options.store!==U.MIN){const i=e.results.max;(null==i.dist||I.dist>i.dist)&&O(i,I)}if(e.options.store===U.ALL){const i=M(t,s);for(const t of T){const s=F(i);O(s,t),e.results.all.push(s)}}}prepareTechnique(e){if(0===this.nodes.length||e.pass!==O.MATERIAL&&e.pass!==O.MATERIAL_DEPTH&&e.pass!==O.MATERIAL_HIGHLIGHT)return null;this.nodes.forAll((i=>{null==i.vao&&this._initNode(e,i)}));const i=this._getSizeParams();return this._techniqueConfig.drawScreenSize=i.drawScreenSpace,this._techniqueConfig.slicePlaneEnabled=this._slicePlaneEnabled,this._techniqueConfig.sceneHasOcludees=e.hasOccludees,this._techniqueConfig.output=e.pass===O.MATERIAL_DEPTH?I.Depth:e.pass===O.MATERIAL_HIGHLIGHT?I.Highlight:I.Color,this._techniqueRep.releaseAndAcquire(D,this._techniqueConfig,this._technique)}render(e,i){const t=e.rctx,s=this._getSizeParams(),r=i.program;t.useProgram(r),i.bindPipelineState(t);const h=this._clipBox,a=!w(h,x,((e,i)=>e===i));a||(p(this.tempVec3,-1/0,-1/0,-1/0),r.setUniform3fv("clipMin",this.tempVec3),p(this.tempVec3,1/0,1/0,1/0),r.setUniform3fv("clipMax",this.tempVec3)),r.setUniformMatrix4fv("proj",e.camera.projectionMatrix);e.pass===O.MATERIAL_DEPTH&&r.setUniform2fv("nearFar",e.camera.nearFar),e.isHighlightPass&&(this._bindParameters.inverseViewport[0]=1/e.camera.fullViewport[2],this._bindParameters.inverseViewport[1]=1/e.camera.fullViewport[3],this._bindParameters.highlightDepthTexture=e.highlightDepthTexture,L(r,this._bindParameters));const l=e.camera.pixelRatio;s.drawFixedSize&&r.setUniform2f("pointScale",s.fixedSize*l,e.camera.fullHeight);const c=this._slicePlaneEnabled?e.sliceHelper&&e.sliceHelper.plane:null;this.nodes.forAll((d=>{if(0===d.coordinates.length||e.isHighlightPass&&!d.highlights)return;if(r.setUniform2f("screenMinMaxSize",s.screenMinSize*l,Z(d.isLeaf)*l),!s.drawFixedSize){const i=d.splatSize*this._scaleFactor;r.setUniform2f("pointScale",i*l,e.camera.fullHeight/l)}const u=d.origin;a&&(p(this.tempVec3,h[0]-u[0],h[1]-u[1],h[2]-u[2]),r.setUniform3fv("clipMin",this.tempVec3),p(this.tempVec3,h[3]-u[0],h[4]-u[1],h[5]-u[2]),r.setUniform3fv("clipMax",this.tempVec3)),n(this.tempMatrix4,u),o(this.tempMatrix4,e.camera.viewMatrix,this.tempMatrix4),r.setUniformMatrix4fv("modelView",this.tempMatrix4),T(r,i.configuration,c,u),t.bindVAO(d.vao),e.isHighlightPass?this._renderHighlightFragments(t,d):t.drawArrays(G.POINTS,0,d.coordinates.length/3)}))}_renderHighlightFragments(e,s){const r=s.highlights;if(i(r))return;let n=t(r[0].component),o=n+1;for(let i=1;i<r.length;i++){const s=t(r[i].component);if(s!==o){const i=o-n;i>0&&e.drawArrays(G.POINTS,n,i),n=s}o=s+1}const h=o-n;h>0&&e.drawArrays(G.POINTS,n,h)}set useFixedSizes(e){this._useFixedSizes!==e&&(this._useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._useFixedSizes}set scaleFactor(e){this._scaleFactor!==e&&(this._scaleFactor=e,this._requestRender())}get scaleFactor(){return this._scaleFactor}set minSizePx(e){this._minSizePx!==e&&(this._minSizePx=e,this._requestRender())}get minSizePx(){return this._minSizePx}set useRealWorldSymbolSizes(e){this._useRealWorldSymbolSizes!==e&&(this._useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._useRealWorldSymbolSizes}set size(e){this._size!==e&&(this._size=e,this._requestRender())}get size(){return this._size}set sizePx(e){this._sizePx!==e&&(this._sizePx=e,this._requestRender())}get sizePx(){return this._sizePx}set clippingBox(e){R(this._clipBox,e||x)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this.nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let i=null;return this.nodes.filterInPlace((t=>t.id!==e||(i=t,t.vao=s(t.vao),this._highlights.nodeRemoved(t),!1))),this._requestRender(),i}forEachNode(e){this.nodes.forAll(e)}removeAll(){this.nodes.forAll((e=>e.vao=s(e.vao))),this._highlights.removeAll(),this.nodes.clear(),this._requestRender()}highlight(e){return this._highlights.add(e)}_addHighlight(e,i,t){e.highlights=se(e.highlights,i,t),this._requestRender()}_removeHighlight(e,i){e.highlights=re(e.highlights,i),this._requestRender()}_initNode(e,i){const t=e.rctx;i.vao=new Y(t,E,K,{positions:B.createVertex(t,k.STATIC_DRAW,i.coordinates),colors:B.createVertex(t,k.STATIC_DRAW,i.rgb)})}_requestRender(){this._context&&this._context.requestRender()}_getSizeParams(){const e=this._useFixedSizes,i=e&&!this._useRealWorldSymbolSizes;return{drawScreenSpace:i,drawFixedSize:e,fixedSize:i?this._sizePx:this._size,screenMinSize:e?0:this._minSizePx}}}function X(e){return e.hasOwnProperty("splatSize")}function Z(e){return e?256:64}function $(e,i,t,s,r){if(t.drawScreenSpace)return t.fixedSize*i*s;const n=Z(r)*i*s;return t.drawFixedSize?Math.min(t.fixedSize/2,n):t.screenMinSize>0?Math.min(Math.max(t.screenMinSize*i*s,e/2),n):Math.min(e/2,n)}function ee(e,i,t,s,r){return t.drawScreenSpace?0:$(e,i,t,s,r)}function ie(e,t,s){return i(s)&&(s=f()),s[0]=e.origin[0]+e.coordinates[3*t],s[1]=e.origin[1]+e.coordinates[3*t+1],s[2]=e.origin[2]+e.coordinates[3*t+2],s}function te(i){return e(i.component)?i.component:-1}function se(e,t,s){i(e)&&(e=[]);const r={component:t,id:s};e.push(r);const n=te(r);let o=e.length-1;for(;o>0&&n<te(e[o-1]);)[e[o-1],e[o]]=[e[o],e[o-1]],--o;return e}function re(e,t){if(i(e))return e;const s=e.filter((e=>e.id!==t));return 0===s.length?null:s}class ne{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerUid=""}}function oe(i){return e(i.dist)&&e(i.point)&&e(i.pointId)&&e(i.node)}export{Q as PointRenderer,X as isInstanceOfNode};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatePolicy as s}from"../../webgl-engine/lib/basicInterfaces.js";let n=class extends t{constructor(e){super(e),this.type="heatmap",this.filterVisibility={filterChanged(){},dirty:!1},this.preferredUpdatePolicy=s.ASYNC,this.dataExtent=null}initialize(){this.updatingHandles.addOnCollectionChange((()=>this.owner.loadedGraphics),(e=>{}))}destroy(){}get layer(){return this.owner.layer}get updating(){return this.updatingHandles.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get displayFeatureLimit(){return{minimumTotalNumberOfFeatures:0,maximumTotalNumberOfFeatures:1e10,maximumTotalNumberOfPrimitives:1e10,maximumNumberOfFeatures:1e10}}get scaleVisibilitySuspended(){return!1}get usedMemory(){return 0}get usedMemoryPerFeature(){return 0}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return{core:{visible:0,missing:0,pending:0},elevationUpdating:!1,visibilityFrustum:!0,visibilityScale:!0}}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlight(){return a}maskOccludee(){return a}setObjectIdVisibility(){}};e([i()],n.prototype,"type",void 0),e([i()],n.prototype,"owner",void 0),e([i()],n.prototype,"layer",null),e([i()],n.prototype,"featureStore",void 0),e([i()],n.prototype,"updating",null),e([i()],n.prototype,"updatingRemaining",null),e([i()],n.prototype,"suspendInfo",null),e([i()],n.prototype,"legendEnabled",null),e([i()],n.prototype,"filterVisibility",void 0),e([i()],n.prototype,"displayFeatureLimit",null),e([i()],n.prototype,"preferredUpdatePolicy",void 0),e([i()],n.prototype,"dataExtent",void 0),n=e([o("esri.views.3d.layers.support.HeatmapFeatureProcessor")],n);const a=r();export{n as HeatmapFeatureProcessor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{width as t,height as e,intersects as n}from"../../../../geometry/support/aaBoundingRect.js";import{VertexAttribute as i}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as r}from"../../webgl-engine/lib/Geometry.js";import o from"../../webgl-engine/lib/GeometryUtil.js";function a(n,i,r){const o=t(n)/e(n),a={width:r,height:r};return o>1.0001?a.height=r/o:o<.9999&&(a.width=r*o),a.width=Math.round(a.width/(t(n)/t(i))),a.height=Math.round(a.height/(e(n)/e(i))),a}function h(t){return o.createSquareGeometry([[t[0],t[1],-1],[t[2],t[1],-1],[t[2],t[3],-1],[t[0],t[3],-1]])}function s(t,e){if(!n(t,e))return h(e);const o=[t[1]-e[1],Math.min(t[3],e[3])-Math.max(t[1],e[1]),e[3]-t[3],123456],a=[t[0]-e[0],Math.min(t[2],e[2])-Math.max(t[0],e[0]),e[2]-t[2],123456],s=e[2]-e[0],l=e[3]-e[1],m=a[0]>0&&a[2]>0?3:2,u=o[0]>0&&o[2]>0?3:2,g=(u+1)*(m+1),f=new Float64Array(3*g),w=new Float32Array(2*g),d=new Uint32Array(6*(u*m-1));let y=0,M=0,b=0,p=0,x=0;for(let n=0;n<4;n++){const t=o[n];if(t<=0)continue;let i=0;for(let r=0;r<4;r++){const t=a[r];t<=0||(f[M++]=e[0]+i,f[M++]=e[1]+y,f[M++]=-1,w[b++]=i/s,w[b++]=y/l,r<3&&n<3&&(1!==r||1!==n)&&(d[x++]=p,d[x++]=p+1,d[x++]=p+m+1,d[x++]=p+1,d[x++]=p+m+2,d[x++]=p+m+1),p++,i+=t)}y+=t}const A=new Uint32Array(d.length);return new r([[i.POSITION,{size:3,data:f,exclusive:!0}],[i.NORMAL,{size:3,data:c,exclusive:!0}],[i.UV0,{size:2,data:w,exclusive:!0}]],[[i.POSITION,d],[i.NORMAL,A],[i.UV0,d]])}const c=[0,0,1];export{a as computeImageExportSize,h as createGeometryForExtent,s as createOuterImageGeometry};
5
+ import{width as t,height as e,intersects as n}from"../../../../geometry/support/aaBoundingRect.js";import{Geometry as r}from"../../webgl-engine/lib/Geometry.js";import i from"../../webgl-engine/lib/GeometryUtil.js";import{VertexAttribute as o}from"../../webgl-engine/lib/VertexAttribute.js";function a(n,r,i){const o=t(n)/e(n),a={width:i,height:i};return o>1.0001?a.height=i/o:o<.9999&&(a.width=i*o),a.width=Math.round(a.width/(t(n)/t(r))),a.height=Math.round(a.height/(e(n)/e(r))),a}function h(t){return i.createSquareGeometry([[t[0],t[1],-1],[t[2],t[1],-1],[t[2],t[3],-1],[t[0],t[3],-1]])}function l(t,e){if(!n(t,e))return h(e);const i=[t[1]-e[1],Math.min(t[3],e[3])-Math.max(t[1],e[1]),e[3]-t[3],123456],a=[t[0]-e[0],Math.min(t[2],e[2])-Math.max(t[0],e[0]),e[2]-t[2],123456],l=e[2]-e[0],u=e[3]-e[1],m=a[0]>0&&a[2]>0?3:2,c=i[0]>0&&i[2]>0?3:2,g=(c+1)*(m+1),w=new Float64Array(3*g),f=new Float32Array(2*g),d=new Uint32Array(6*(c*m-1));let y=0,M=0,b=0,p=0,x=0;for(let n=0;n<4;n++){const t=i[n];if(t<=0)continue;let r=0;for(let i=0;i<4;i++){const t=a[i];t<=0||(w[M++]=e[0]+r,w[M++]=e[1]+y,w[M++]=-1,f[b++]=r/l,f[b++]=y/u,i<3&&n<3&&(1!==i||1!==n)&&(d[x++]=p,d[x++]=p+1,d[x++]=p+m+1,d[x++]=p+1,d[x++]=p+m+2,d[x++]=p+m+1),p++,r+=t)}y+=t}const A=new Uint32Array(d.length);return new r([[o.POSITION,{size:3,data:w,exclusive:!0}],[o.NORMAL,{size:3,data:s,exclusive:!0}],[o.UV0,{size:2,data:f,exclusive:!0}]],[[o.POSITION,d],[o.NORMAL,A],[o.UV0,d]])}const s=[0,0,1];export{a as computeImageExportSize,h as createGeometryForExtent,l as createOuterImageGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{isSome as r}from"../../../../core/maybe.js";import{f as e}from"../../../../chunks/vec4f64.js";import{BufferViewMat3f64 as t,BufferViewVec3f64 as a,BufferViewVec4f as o}from"../../../../geometry/support/buffer/BufferView.js";import{perVertexElevationAligner as n}from"../graphics/ElevationAligners.js";import{createMapSpaceUVCoords as s}from"./uvUtils.js";import{VertexAttribute as i}from"../../webgl-engine/lib/basicInterfaces.js";import{ColorMaterial as l}from"../../webgl-engine/materials/ColorMaterial.js";import{PatternMaterial as c}from"../../webgl-engine/materials/PatternMaterial.js";import{Style as m}from"../../webgl-engine/materials/PatternStyle.js";function f(r,e,t){return g(u(r),e,t)}function u(r){return r&&r.pattern||null}function g(t,a,o){return r(t)?"none"===t.style||"solid"===t.style?("none"===t.style&&(a.color=e(0,0,0,0),a.transparent=!0),new l(a)):(a.style=p(t.style),a.draped=o.isDraped,new c(a)):new l(a)}function p(r){switch(r){case"horizontal":return m.Horizontal;case"vertical":return m.Vertical;case"cross":return m.Cross;case"forward-diagonal":return m.ForwardDiagonal;case"backward-diagonal":return m.BackwardDiagonal;case"diagonal-cross":return m.DiagonalCross;default:return}}function d(r){return r.material instanceof c&&!r.material.parameters.draped}function y(r,e){if(d(r)){const n=r.geometry.vertexAttributes,l=n.get(i.POSITION).data,c=n.get(i.UVMAPSPACE).data,m=n.get(i.BOUNDINGRECT).data;s(o.fromTypedArray(c),a.fromTypedArray(l),e,t.fromTypedArray(m))}}function w(r,e,t,a){const o=n(r,e,t,a),s=r.stageObject.geometryRecords;for(let n=0;n<s.length;n++)y(s[n],a);return o}export{f as createMaterial,g as createMaterialFromPattern,p as parsePatternStyle,d as requiresUVUpdates,y as updateMapSpaceUVCoords,w as uvElevationAligner};
5
+ import"../../../../core/has.js";import{isSome as r}from"../../../../core/maybe.js";import{f as e}from"../../../../chunks/vec4f64.js";import{BufferViewMat3f64 as t,BufferViewVec3f64 as a,BufferViewVec4f as o}from"../../../../geometry/support/buffer/BufferView.js";import{perVertexElevationAligner as n}from"../graphics/ElevationAligners.js";import{createMapSpaceUVCoords as i}from"./uvUtils.js";import{VertexAttribute as s}from"../../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as l}from"../../webgl-engine/materials/ColorMaterial.js";import{PatternMaterial as m}from"../../webgl-engine/materials/PatternMaterial.js";import{Style as c}from"../../webgl-engine/materials/PatternStyle.js";function f(r,e,t){return g(u(r),e,t)}function u(r){return r&&r.pattern||null}function g(t,a,o){return r(t)?"none"===t.style||"solid"===t.style?("none"===t.style&&(a.color=e(0,0,0,0),a.transparent=!0),new l(a)):(a.style=p(t.style),a.draped=o.isDraped,new m(a)):new l(a)}function p(r){switch(r){case"horizontal":return c.Horizontal;case"vertical":return c.Vertical;case"cross":return c.Cross;case"forward-diagonal":return c.ForwardDiagonal;case"backward-diagonal":return c.BackwardDiagonal;case"diagonal-cross":return c.DiagonalCross;default:return}}function d(r){return r.material instanceof m&&!r.material.parameters.draped}function y(r,e){if(d(r)){const n=r.geometry.vertexAttributes,l=n.get(s.POSITION).data,m=n.get(s.UVMAPSPACE).data,c=n.get(s.BOUNDINGRECT).data;i(o.fromTypedArray(m),a.fromTypedArray(l),e,t.fromTypedArray(c))}}function w(r,e,t,a){const o=n(r,e,t,a),i=r.stageObject.geometryRecords;for(let n=0;n<i.length;n++)y(i[n],a);return o}export{f as createMaterial,g as createMaterialFromPattern,p as parsePatternStyle,d as requiresUVUpdates,y as updateMapSpaceUVCoords,w as uvElevationAligner};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import{asinClamped as i}from"../../../../../core/mathUtils.js";import{createScreenPointArray as e,screenPointObjectToArray as n}from"../../../../../core/screenUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{o as r,g as a,d as m,a as h,f as c,n as l,b as p}from"../../../../../chunks/vec3.js";import{c as u,f as d}from"../../../../../chunks/vec3f64.js";import{wrapAxisAngle as C}from"../../../../../geometry/support/axisAngle.js";import{create as g,fromNormalAndOffset as v,setOffsetFromPoint as M,negate as f,normal as w}from"../../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as b,applyAll as S}from"../../../camera/constraintUtils.js";import{ConstraintTypes as V,InteractionType as E,TiltMode as P}from"../../../camera/constraintUtils/common.js";import{ExponentialFalloff as j}from"../../../input/util.js";import{InteractiveController as z}from"../InteractiveController.js";import{PanPlanarMomentumController as H}from"../momentum/PanPlanarMomentumController.js";import{RotationMomentumController as O}from"../momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as y}from"../momentum/ZoomPlanarMomentumController.js";import{NavigationMode as T,centroid as A,applyZoomToPoint as F,applyPanPlanar as L,normalizeRotationDelta as x,applyRotation as R,intersectPlaneFromScreenPointAtEye as U}from"../../utils/navigationUtils.js";import D from"../../../webgl-engine/lib/Camera.js";import{PanPlanarMomentumEstimator as N}from"../../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as _}from"../../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as k}from"../../../../navigation/ZoomMomentumEstimator.js";const I=d(0,0,1),G={ELEVATION_THRESHOLD:3e4,ANGLE_THRESHOLD:16/180*Math.PI},Z=80;let B=class extends z{constructor(t){super(t),this.view=null,this.rotationValueSmooth=new j(.05),this.scalingValueSmooth=new j(.05),this.planeHorizontal=g(),this.planeVertical=g(),this.rotationMomentumEstimator=new _,this.panMomentumEstimator=new N(300,12,.9),this.zoomMomentumEstimator=new k,this.beginCenter=u(),this.tmpPoints=[],this.beginCenterScreen=e(),this.tmpCentroid3d=u(),this.tmpCentroid2d=e(),this.tmp2d=e(),this.constraintOptions={selection:V.ALL,interactionType:E.NONE,interactionFactor:0,interactionStartCamera:new D,interactionDirection:null,tiltMode:P.TUMBLE}}get intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;const e=this.view.navigation.momentumEnabled;this.zoomMomentumEstimator.enabled=e,this.rotationMomentumEstimator.enabled=e,this.panMomentumEstimator.enabled=e,this.beginRadius=t.radius,this.pointerCount=t.pointers.size,this.beginAngle=t.angle,this.rotationValueSmooth.reset(),this.scalingValueSmooth.reset(),n(t.center,this.beginCenterScreen),v(I,0,this.planeHorizontal);const o=u();this.intersectionHelper.intersectScreenFreePointFallback(this.beginCenterScreen,o);const s=u();r(s,this.startCamera.viewForward);const d=u();a(d,I);const C=m(s,d),g=i(C<0?-C:C);if(this.panMode=g>=G.ANGLE_THRESHOLD?T.Horizontal:T.Vertical,M(this.planeHorizontal,o,this.planeHorizontal),this.startCamera.aboveGround||f(this.planeHorizontal,this.planeHorizontal),this.panMode===T.Vertical){h(d,d,C),c(this.planeVertical,s,d),l(this.planeVertical,this.planeVertical),M(this.planeVertical,o,this.planeVertical);const i=u(),e=u(),n=u();c(i,o,this.currentCamera.eye),l(i,i);const r=5*Math.max(Math.abs(this.view.camera.position.z),50),g=this.view._stage.renderView.getMinimalDepthForArea(this.view.getVoxelWasmPerSceneView(),this.beginCenterScreen[0],this.beginCenterScreen[1],this.view.state.camera,Z),v=g?Math.min(g,r):r;a(n,p(e,this.currentCamera.eye,h(e,i,v))),this.planeVertical[3]=-m(this.planeVertical,n),this.computePlanePoints(t.pointers,this.planeVertical,this.startCamera,this.tmpPoints),A(this.tmpPoints,this.beginCenter)}else this.computePlanePoints(t.pointers,this.planeHorizontal,this.startCamera,this.tmpPoints),A(this.tmpPoints,this.beginCenter);this.constraintOptions.interactionStartCamera.copyFrom(this.startCamera)}update(t){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,e=this.panMode===T.Horizontal?this.planeHorizontal:this.planeVertical,o=this.beginCenter;if(i){const i=this.beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this.scalingValueSmooth.gain=e,this.scalingValueSmooth.update(i),F(this.currentCamera,o,this.scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this.zoomMomentumEstimator.add(this.scalingValueSmooth.value,.001*t.timestamp),this.constraintOptions.interactionType=E.ZOOM,this.constraintOptions.interactionFactor=b(Math.abs(t.radius-this.beginRadius)),S(this.view,this.currentCamera,this.constraintOptions)}if(this.computePlanePoints(t.pointers,e,this.currentCamera,this.tmpPoints),A(this.tmpPoints,this.tmpCentroid3d),n(t.center,this.tmpCentroid2d),L(this.currentCamera,o,this.tmpCentroid3d),this.panMomentumEstimator.add(this.tmpCentroid2d,this.tmpCentroid3d,.001*t.timestamp),this.constraintOptions.interactionType=E.PAN,this.constraintOptions.interactionFactor=b(this.beginCenterScreen,this.tmpCentroid2d),S(this.view,this.currentCamera,this.constraintOptions),i){const i=this.planeHorizontal,e=o,n=this.rotationValueSmooth.value,s=n+x(t.angle-n),r=.00125*Math.min(Math.max(t.radius,40),120);this.rotationValueSmooth.gain=r,this.rotationValueSmooth.update(s);const a=this.rotationValueSmooth.value-this.beginAngle;this.rotationMomentumEstimator.add(a,.001*t.timestamp),R(this.currentCamera,e,C(i,a)),this.constraintOptions.interactionType=E.TUMBLE,this.constraintOptions.interactionFactor=b(Math.abs(t.radius*a)),S(this.view,this.currentCamera,this.constraintOptions)}}end(t){t.pointers.size===this.pointerCount&&this.update(t),this.finishController();const i=this.zoomMomentumEstimator.evaluateMomentum();if(i)return new y({view:this.view,momentum:i,zoomCenter:this.beginCenter});const e=this.rotationMomentumEstimator.evaluateMomentum();if(e)return new O({view:this.view,momentum:e,center:this.beginCenter,axis:w(this.planeHorizontal)});const n=this.panMomentumEstimator.evaluateMomentum();return n?new H({view:this.view,momentum:n}):null}computePlanePoints(t,i,e,n){n.length=t.size;const o=this.tmp2d;let s=0;return t.forEach((t=>{o[0]=t.x,o[1]=t.y,void 0===n[s]&&(n[s]=u()),U(i,e,o,n[s]),s+=1})),n}};t([o({constructOnly:!0})],B.prototype,"view",void 0),B=t([s("esri.views.3d.state.controllers.local.PinchAndPanController")],B);export{B as PinchAndPanController};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import{asinClamped as i}from"../../../../../core/mathUtils.js";import{createScreenPointArray as e,screenPointObjectToArray as n}from"../../../../../core/screenUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{o as r,g as a,d as m,a as h,f as c,n as l,b as p}from"../../../../../chunks/vec3.js";import{c as u,f as d}from"../../../../../chunks/vec3f64.js";import{wrapAxisAngle as C}from"../../../../../geometry/support/axisAngle.js";import{create as g,fromNormalAndOffset as v,setOffsetFromPoint as M,negate as f,normal as w}from"../../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as b,applyAll as S}from"../../../camera/constraintUtils.js";import{ConstraintTypes as V,InteractionType as E,TiltMode as P}from"../../../camera/constraintUtils/common.js";import{ExponentialFalloff as j}from"../../../input/util.js";import{InteractiveController as z}from"../InteractiveController.js";import{PanPlanarMomentumController as H}from"../momentum/PanPlanarMomentumController.js";import{RotationMomentumController as O}from"../momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as y}from"../momentum/ZoomPlanarMomentumController.js";import{NavigationMode as T,centroid as A,applyZoomToPoint as F,applyPanPlanar as L,normalizeRotationDelta as x,applyRotation as R,intersectPlaneFromScreenPointAtEye as U}from"../../utils/navigationUtils.js";import D from"../../../webgl-engine/lib/Camera.js";import{PanPlanarMomentumEstimator as N}from"../../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as _}from"../../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as k}from"../../../../navigation/ZoomMomentumEstimator.js";const I=d(0,0,1),G={ELEVATION_THRESHOLD:3e4,ANGLE_THRESHOLD:16/180*Math.PI},Z=80;let B=class extends z{constructor(t){super(t),this.view=null,this.rotationValueSmooth=new j(.05),this.scalingValueSmooth=new j(.05),this.planeHorizontal=g(),this.planeVertical=g(),this.rotationMomentumEstimator=new _,this.panMomentumEstimator=new N(300,12,.9),this.zoomMomentumEstimator=new k,this.beginCenter=u(),this.tmpPoints=[],this.beginCenterScreen=e(),this.tmpCentroid3d=u(),this.tmpCentroid2d=e(),this.tmp2d=e(),this.constraintOptions={selection:V.ALL,interactionType:E.NONE,interactionFactor:0,interactionStartCamera:new D,interactionDirection:null,tiltMode:P.TUMBLE}}get intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;const e=this.view.navigation.momentumEnabled;this.zoomMomentumEstimator.enabled=e,this.rotationMomentumEstimator.enabled=e,this.panMomentumEstimator.enabled=e,this.beginRadius=t.radius,this.pointerCount=t.pointers.size,this.beginAngle=t.angle,this.rotationValueSmooth.reset(),this.scalingValueSmooth.reset(),n(t.center,this.beginCenterScreen),v(I,0,this.planeHorizontal);const o=u();this.intersectionHelper.intersectScreenFreePointFallback(this.beginCenterScreen,o);const s=u();r(s,this.startCamera.viewForward);const d=u();a(d,I);const C=m(s,d),g=i(C<0?-C:C);if(this.panMode=g>=G.ANGLE_THRESHOLD?T.Horizontal:T.Vertical,M(this.planeHorizontal,this.planeHorizontal,o),this.startCamera.aboveGround||f(this.planeHorizontal,this.planeHorizontal),this.panMode===T.Vertical){h(d,d,C),c(this.planeVertical,s,d),l(this.planeVertical,this.planeVertical),M(this.planeVertical,this.planeVertical,o);const i=u(),e=u(),n=u();c(i,o,this.currentCamera.eye),l(i,i);const r=5*Math.max(Math.abs(this.view.camera.position.z),50),g=this.view._stage.renderView.getMinimalDepthForArea(this.view.getVoxelWasmPerSceneView(),this.beginCenterScreen[0],this.beginCenterScreen[1],this.view.state.camera,Z),v=g?Math.min(g,r):r;a(n,p(e,this.currentCamera.eye,h(e,i,v))),this.planeVertical[3]=-m(this.planeVertical,n),this.computePlanePoints(t.pointers,this.planeVertical,this.startCamera,this.tmpPoints),A(this.tmpPoints,this.beginCenter)}else this.computePlanePoints(t.pointers,this.planeHorizontal,this.startCamera,this.tmpPoints),A(this.tmpPoints,this.beginCenter);this.constraintOptions.interactionStartCamera.copyFrom(this.startCamera)}update(t){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,e=this.panMode===T.Horizontal?this.planeHorizontal:this.planeVertical,o=this.beginCenter;if(i){const i=this.beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this.scalingValueSmooth.gain=e,this.scalingValueSmooth.update(i),F(this.currentCamera,o,this.scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this.zoomMomentumEstimator.add(this.scalingValueSmooth.value,.001*t.timestamp),this.constraintOptions.interactionType=E.ZOOM,this.constraintOptions.interactionFactor=b(Math.abs(t.radius-this.beginRadius)),S(this.view,this.currentCamera,this.constraintOptions)}if(this.computePlanePoints(t.pointers,e,this.currentCamera,this.tmpPoints),A(this.tmpPoints,this.tmpCentroid3d),n(t.center,this.tmpCentroid2d),L(this.currentCamera,o,this.tmpCentroid3d),this.panMomentumEstimator.add(this.tmpCentroid2d,this.tmpCentroid3d,.001*t.timestamp),this.constraintOptions.interactionType=E.PAN,this.constraintOptions.interactionFactor=b(this.beginCenterScreen,this.tmpCentroid2d),S(this.view,this.currentCamera,this.constraintOptions),i){const i=this.planeHorizontal,e=o,n=this.rotationValueSmooth.value,s=n+x(t.angle-n),r=.00125*Math.min(Math.max(t.radius,40),120);this.rotationValueSmooth.gain=r,this.rotationValueSmooth.update(s);const a=this.rotationValueSmooth.value-this.beginAngle;this.rotationMomentumEstimator.add(a,.001*t.timestamp),R(this.currentCamera,e,C(i,a)),this.constraintOptions.interactionType=E.TUMBLE,this.constraintOptions.interactionFactor=b(Math.abs(t.radius*a)),S(this.view,this.currentCamera,this.constraintOptions)}}end(t){t.pointers.size===this.pointerCount&&this.update(t),this.finishController();const i=this.zoomMomentumEstimator.evaluateMomentum();if(i)return new y({view:this.view,momentum:i,zoomCenter:this.beginCenter});const e=this.rotationMomentumEstimator.evaluateMomentum();if(e)return new O({view:this.view,momentum:e,center:this.beginCenter,axis:w(this.planeHorizontal)});const n=this.panMomentumEstimator.evaluateMomentum();return n?new H({view:this.view,momentum:n}):null}computePlanePoints(t,i,e,n){n.length=t.size;const o=this.tmp2d;let s=0;return t.forEach((t=>{o[0]=t.x,o[1]=t.y,void 0===n[s]&&(n[s]=u()),U(i,e,o,n[s]),s+=1})),n}};t([o({constructOnly:!0})],B.prototype,"view",void 0),B=t([s("esri.views.3d.state.controllers.local.PinchAndPanController")],B);export{B as PinchAndPanController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as t}from"../../../core/compilerUtils.js";import{lerp as e}from"../../../core/mathUtils.js";import{a as i}from"../../../chunks/mat4.js";import{c as r}from"../../../chunks/mat4f64.js";import{b as n,a as o,r as s,m as a,s as c,d as l}from"../../../chunks/vec3.js";import{c as p}from"../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as h,projectVectorToVector as d,projectBoundingRect as m}from"../../../geometry/projection.js";import{getReferenceEllipsoid as g}from"../../../geometry/projectionEllipsoid.js";import{create as u,empty as f,expandWithVec3 as x}from"../../../geometry/support/aaBoundingBox.js";import{create as R,center as y}from"../../../geometry/support/aaBoundingRect.js";import{PlaneIndex as j}from"../../../geometry/support/frustum.js";import{create as b,fromPoints as A}from"../../../geometry/support/lineSegment.js";import{create as E,fromVectorsAndPoint as S,copy as C,negate as H}from"../../../geometry/support/plane.js";import{wrap as w}from"../../../geometry/support/ray.js";import{ViewingMode as B}from"../../ViewingMode.js";import{frustumLineSegment as G}from"./intersectionUtils.js";const M=.5*Math.PI,F=M/Math.PI*180;class _{constructor(t){this.renderCoordsHelper=t.renderCoordsHelper,this.extent=new Array(4),this.planes=new Array(6),this.maxSpan=0,this.center={origin:p(),direction:p()};for(let e=0;e<4;e++)this.extent[e]={origin:p(),direction:p(),cap:{next:null,direction:p()}},this.planes[e]=E();this.planes[j.NEAR]=E(),this.planes[j.FAR]=E(),this.planesWithoutFar=this.planes.slice(0,5)}update(t,e,i,r=!0){const a=this.extent;this._toRenderBoundingExtent(t,e,i),n(this.center.origin,a[0].origin,a[2].origin),o(this.center.origin,this.center.origin,.5),this.renderCoordsHelper.worldUpAtPosition(this.center.origin,this.center.direction),r||o(this.center.direction,this.center.direction,-1);for(let n=0;n<4;n++){const t=a[n];this.renderCoordsHelper.worldUpAtPosition(t.origin,t.direction);const e=a[3===n?0:n+1];t.cap.next=e.origin,s(t.cap.direction,t.origin,e.origin),S(t.direction,t.cap.direction,t.origin,this.planes[n]),r||o(t.direction,t.direction,-1)}S(a[0].cap.direction,a[1].cap.direction,a[0].origin,this.planes[j.NEAR]),r?H(this.planes[j.NEAR],this.planes[j.FAR]):(C(this.planes[j.NEAR],this.planes[j.FAR]),H(this.planes[j.NEAR],this.planes[j.NEAR])),this.maxSpan=Math.max(Math.abs(t[0]-t[2]),Math.abs(t[1]-t[3])),this.maxSpanSpatialReference=e,this.minGlobalAltitude=.9*g(this.maxSpanSpatialReference).radius}isVisibleInFrustum(t,e,i=!1){if(null==t)return!1;if(this.renderCoordsHelper.viewingMode===B.Global){const i=this.maxSpanSpatialReference.isGeographic?F:M*e;if(this.maxSpan>i)return!0;if(t.altitude>=this.minGlobalAltitude)return this._isVisibleInFrustumGlobal(t)}if(0===this.maxSpan){const e=this.extent[0];return!(i||!t.intersectsRay(w(e.origin,e.direction)))}for(let n=0;n<this.extent.length;n++){const e=this.extent[n];if(!i&&t.intersectsRay(w(e.origin,e.direction)))return!0;if(t.intersectsLineSegment(A(e.origin,e.cap.next,P),e.cap.direction))return!0}const r=i?this.planes:this.planesWithoutFar;for(let n=0;n<t.lines.length;n++){const e=t.lines[n];if(G(r,e.origin,e.endpoint,e.direction))return!0}return!1}_toRenderBoundingExtentGlobal(t,r,n){const o=5;y(t,N),N[2]=n,h(r,N,v,this.renderCoordsHelper.spatialReference),i(I,v),f(U);for(const{x0:i,x1:s,y0:c,y1:l}of k)for(let p=0;p<o;p++){const h=p/(o-1);N[0]=e(t[i],t[s],h),N[1]=e(t[c],t[l],h),N[2]=n,d(N,r,N,this.renderCoordsHelper.spatialReference),a(N,N,I),x(U,N)}c(this.extent[0].origin,U[0],U[1],U[2]),c(this.extent[1].origin,U[3],U[1],U[2]),c(this.extent[2].origin,U[3],U[4],U[2]),c(this.extent[3].origin,U[0],U[4],U[2]);for(let e=0;e<4;++e)a(this.extent[e].origin,this.extent[e].origin,v)}_toRenderBoundingExtentLocal(t,e,i){m(t,e,L,this.renderCoordsHelper.spatialReference),c(this.extent[0].origin,L[0],L[1],i),c(this.extent[1].origin,L[2],L[1],i),c(this.extent[2].origin,L[2],L[3],i),c(this.extent[3].origin,L[0],L[3],i)}_toRenderBoundingExtent(e,i,r){switch(this.renderCoordsHelper.viewingMode){case B.Global:this._toRenderBoundingExtentGlobal(e,i,r);break;case B.Local:this._toRenderBoundingExtentLocal(e,i,r);break;default:t(this.renderCoordsHelper.viewingMode)}}_isVisibleInFrustumGlobal(t){if(l(this.center.direction,t.direction)<0)return!0;for(let e=0;e<4;e++){const i=this.extent[e];if(l(i.direction,t.direction)<0)return!0}return!1}}const k=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],N=p(),v=r(),I=r(),U=u(),L=R(),P=b();export{_ as FrustumExtentIntersection,_ as default};
5
+ import{neverReached as t}from"../../../core/compilerUtils.js";import{lerp as e}from"../../../core/mathUtils.js";import{a as i}from"../../../chunks/mat4.js";import{c as r}from"../../../chunks/mat4f64.js";import{b as n,a as o,r as s,m as a,s as c,d as l}from"../../../chunks/vec3.js";import{c as p}from"../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as h,projectVectorToVector as d,projectBoundingRect as m}from"../../../geometry/projection.js";import{getReferenceEllipsoid as g}from"../../../geometry/projectionEllipsoid.js";import{create as u,empty as f,expandWithVec3 as x}from"../../../geometry/support/aaBoundingBox.js";import{create as R,center as y}from"../../../geometry/support/aaBoundingRect.js";import{PlaneIndex as j}from"../../../geometry/support/frustum.js";import{create as b,fromPoints as A}from"../../../geometry/support/lineSegment.js";import{create as E,fromVectorsAndPoint as S,copy as C,negate as H}from"../../../geometry/support/plane.js";import{wrap as w}from"../../../geometry/support/ray.js";import{ViewingMode as B}from"../../ViewingMode.js";import{frustumLineSegment as G}from"./intersectionUtils.js";const M=.5*Math.PI,F=M/Math.PI*180;class _{constructor(t){this.renderCoordsHelper=t.renderCoordsHelper,this.extent=new Array(4),this.planes=new Array(6),this.maxSpan=0,this.center={origin:p(),direction:p()};for(let e=0;e<4;e++)this.extent[e]={origin:p(),direction:p(),cap:{next:null,direction:p()}},this.planes[e]=E();this.planes[j.NEAR]=E(),this.planes[j.FAR]=E(),this.planesWithoutFar=this.planes.slice(0,5)}update(t,e,i,r=!0){const a=this.extent;this._toRenderBoundingExtent(t,e,i),n(this.center.origin,a[0].origin,a[2].origin),o(this.center.origin,this.center.origin,.5),this.renderCoordsHelper.worldUpAtPosition(this.center.origin,this.center.direction),r||o(this.center.direction,this.center.direction,-1);for(let n=0;n<4;n++){const t=a[n];this.renderCoordsHelper.worldUpAtPosition(t.origin,t.direction);const e=a[3===n?0:n+1];t.cap.next=e.origin,s(t.cap.direction,t.origin,e.origin),S(t.direction,t.cap.direction,t.origin,this.planes[n]),r||o(t.direction,t.direction,-1)}S(a[0].cap.direction,a[1].cap.direction,a[0].origin,this.planes[j.NEAR]),r?H(this.planes[j.NEAR],this.planes[j.FAR]):(C(this.planes[j.FAR],this.planes[j.NEAR]),H(this.planes[j.NEAR],this.planes[j.NEAR])),this.maxSpan=Math.max(Math.abs(t[0]-t[2]),Math.abs(t[1]-t[3])),this.maxSpanSpatialReference=e,this.minGlobalAltitude=.9*g(this.maxSpanSpatialReference).radius}isVisibleInFrustum(t,e,i=!1){if(null==t)return!1;if(this.renderCoordsHelper.viewingMode===B.Global){const i=this.maxSpanSpatialReference.isGeographic?F:M*e;if(this.maxSpan>i)return!0;if(t.altitude>=this.minGlobalAltitude)return this._isVisibleInFrustumGlobal(t)}if(0===this.maxSpan){const e=this.extent[0];return!(i||!t.intersectsRay(w(e.origin,e.direction)))}for(let n=0;n<this.extent.length;n++){const e=this.extent[n];if(!i&&t.intersectsRay(w(e.origin,e.direction)))return!0;if(t.intersectsLineSegment(A(e.origin,e.cap.next,P),e.cap.direction))return!0}const r=i?this.planes:this.planesWithoutFar;for(let n=0;n<t.lines.length;n++){const e=t.lines[n];if(G(r,e.origin,e.endpoint,e.direction))return!0}return!1}_toRenderBoundingExtentGlobal(t,r,n){const o=5;y(t,N),N[2]=n,h(r,N,v,this.renderCoordsHelper.spatialReference),i(I,v),f(U);for(const{x0:i,x1:s,y0:c,y1:l}of k)for(let p=0;p<o;p++){const h=p/(o-1);N[0]=e(t[i],t[s],h),N[1]=e(t[c],t[l],h),N[2]=n,d(N,r,N,this.renderCoordsHelper.spatialReference),a(N,N,I),x(U,N)}c(this.extent[0].origin,U[0],U[1],U[2]),c(this.extent[1].origin,U[3],U[1],U[2]),c(this.extent[2].origin,U[3],U[4],U[2]),c(this.extent[3].origin,U[0],U[4],U[2]);for(let e=0;e<4;++e)a(this.extent[e].origin,this.extent[e].origin,v)}_toRenderBoundingExtentLocal(t,e,i){m(t,e,L,this.renderCoordsHelper.spatialReference),c(this.extent[0].origin,L[0],L[1],i),c(this.extent[1].origin,L[2],L[1],i),c(this.extent[2].origin,L[2],L[3],i),c(this.extent[3].origin,L[0],L[3],i)}_toRenderBoundingExtent(e,i,r){switch(this.renderCoordsHelper.viewingMode){case B.Global:this._toRenderBoundingExtentGlobal(e,i,r);break;case B.Local:this._toRenderBoundingExtentLocal(e,i,r);break;default:t(this.renderCoordsHelper.viewingMode)}}_isVisibleInFrustumGlobal(t){if(l(this.center.direction,t.direction)<0)return!0;for(let e=0;e<4;e++){const i=this.extent[e];if(l(i.direction,t.direction)<0)return!0}return!1}}const k=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],N=p(),v=r(),I=r(),U=u(),L=R(),P=b();export{_ as FrustumExtentIntersection,_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{deg2rad as e}from"../../../core/mathUtils.js";import{isSome as t,isNone as i,disposeMaybe as n,releaseMaybe as s}from"../../../core/maybe.js";import{a as r}from"../../../chunks/vec2f64.js";import{g as a,m as h,i as l,n as o,c,b as _}from"../../../chunks/vec3.js";import{c as d}from"../../../chunks/vec3f64.js";import{t as m}from"../../../chunks/vec4.js";import{c as p}from"../../../chunks/vec4f64.js";import{create as f,fromRay as g,getStart as u,getEnd as b}from"../../../geometry/support/clipRay.js";import{intersectClipRay as P}from"../../../geometry/support/frustum.js";import{create as V,copy as E,pointAt as L}from"../../../geometry/support/lineSegment.js";import{create as D,fromPositionAndNormal as S}from"../../../geometry/support/plane.js";import{wrap as q}from"../../../geometry/support/ray.js";import{c as R}from"../../../chunks/sphere.js";import{LaserlinePathData as U}from"./LaserlinePathData.js";import{createQuadVAO as T}from"../webgl-engine/lib/glUtil3D.js";import{RenderSlot as M}from"../webgl-engine/lib/RenderSlot.js";import{inverseProjectionInfo as x}from"../webgl-engine/lib/Util.js";import{copyParameters as C,updateParameters as A}from"../webgl-engine/materials/internal/MaterialUtil.js";import{LaserlinePathTechniqueConfiguration as v,LaserlinePathTechnique as j}from"../webgl-engine/shaders/LaserlinePathTechnique.js";import{LaserlineTechniqueConfiguration as w,LaserlineTechnique as I}from"../webgl-engine/shaders/LaserlineTechnique.js";import{PrimitiveType as O}from"../../webgl/enums.js";const y=d(),H=p(),z={glowColor:[1,.5,0],glowWidth:8,glowFalloff:8,innerColor:[1,1,1],innerWidth:1,globalAlpha:.75,angleCutoff:e(6),globalAlphaContrastBoost:2};function N(e,t,i,n){const s=y,r=H;h(s,t,n),a(r,i),r[3]=0,m(r,r,n),S(s,r,e)}class k{constructor(e,t={},i={contrastControlEnabled:!1}){this._renderCoordsHelper=e,this._config=i,this._technique=null,this._projInfo=p(),this._zScale=r(),this._heightManifoldEnabled=!1,this._heightManifoldTarget=d(),this._pointDistanceEnabled=!1,this._pointDistanceOrigin=d(),this._pointDistanceTarget=d(),this._lineVerticalPlaneEnabled=!1,this._lineVerticalPlaneSegment=V(),this._intersectsLineEnabled=!1,this._intersectsLineSegment=V(),this._intersectsLineRadius=3,this._intersectsLineInfinite=!1,this._pathVerticalPlaneEnabled=!1,this._pathVerticalPlaneData=null,this._pathTechnique=null,this.canRender=!0,this._tempNormal=d(),this._tempDir=d(),this._tempUp=d(),this._tempVec3A=d(),this._tempVec3B=d(),this._tempVec4=p(),this._tempPlane=D(),this._tempSphere=R(),this._params=C(t,z)}get renderSlots(){return[this._config.contrastControlEnabled?M.LASERLINES_CONTRAST_CONTROL:M.LASERLINES]}get needsLinearDepth(){return!0}get heightManifoldEnabled(){return this._heightManifoldEnabled}set heightManifoldEnabled(e){this._heightManifoldEnabled!==e&&(this._heightManifoldEnabled=e,this._requestRender())}get heightManifoldTarget(){return this._heightManifoldTarget}set heightManifoldTarget(e){a(this._heightManifoldTarget,e),this._requestRender()}get pointDistanceEnabled(){return this._pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._pointDistanceEnabled&&(this._pointDistanceEnabled=e,this._requestRender())}get pointDistanceTarget(){return this._pointDistanceTarget}set pointDistanceTarget(e){a(this._pointDistanceTarget,e),this._requestRender()}get pointDistanceOrigin(){return this._pointDistanceOrigin}set pointDistanceOrigin(e){a(this._pointDistanceOrigin,e),this._requestRender()}get lineVerticalPlaneEnabled(){return this._lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._lineVerticalPlaneEnabled&&(this._lineVerticalPlaneEnabled=e,this._requestRender())}get lineVerticalPlaneSegment(){return this._lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){E(e,this._lineVerticalPlaneSegment),this._requestRender()}get intersectsLineEnabled(){return this._intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._intersectsLineEnabled&&(this._intersectsLineEnabled=e,this._requestRender())}get intersectsLineSegment(){return this._intersectsLineSegment}set intersectsLineSegment(e){E(e,this._intersectsLineSegment),this._requestRender()}get intersectsLineRadius(){return this._intersectsLineRadius}set intersectsLineRadius(e){e!==this._intersectsLineRadius&&(this._intersectsLineRadius=e,this._requestRender())}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this._requestRender())}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,t(this._pathVerticalPlaneData)&&this._requestRender())}set pathVerticalPlaneVertices(e){i(this._pathVerticalPlaneData)&&(this._pathVerticalPlaneData=new U(this._renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this._requestRender()}set pathVerticalPlaneBuffers(e){i(this._pathVerticalPlaneData)&&(this._pathVerticalPlaneData=new U(this._renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this._requestRender()}setParameters(e){A(this._params,e)&&this._requestRender()}initializeRenderContext(e){this._context=e;const t=e.renderContext.rctx;this._quadVAO=T(t),this._techniqueRepository=e.shaderTechniqueRep,this._techniqueConfig=new w;const i=new v;i.contrastControlEnabled=this._config.contrastControlEnabled,this._pathTechnique=this._techniqueRepository.acquire(j,i)}uninitializeRenderContext(){this._quadVAO=n(this._quadVAO),this._technique=s(this._technique),this._pathVerticalPlaneData=n(this._pathVerticalPlaneData),this._pathTechnique=s(this._pathTechnique)}prepareTechnique(){return this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled?(this._techniqueConfig.heightManifoldEnabled=this.heightManifoldEnabled,this._techniqueConfig.lineVerticalPlaneEnabled=this.lineVerticalPlaneEnabled,this._techniqueConfig.pointDistanceEnabled=this.pointDistanceEnabled,this._techniqueConfig.intersectsLineEnabled=this.intersectsLineEnabled,this._techniqueConfig.contrastControlEnabled=this._config.contrastControlEnabled,this._technique=this._techniqueRepository.releaseAndAcquire(I,this._techniqueConfig,this._technique),this._technique):this._pathTechnique}render(e,t){const i=e.camera;x(i.projectionMatrix,i.fullWidth,i.fullHeight,this._projInfo,this._zScale),(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(e,t),this.pathVerticalPlaneEnabled&&this._renderPath(e)}_renderUnified(e,t){const i=e.rctx,n=t.program;i.useProgram(n),t.bindPipelineState(i),this._bindGlobalUniforms(e,n),this._bindHeightManifoldUniforms(e,n),this._bindPointDistanceUniforms(e,n),this._bindLineVerticalPlaneUniforms(e,n),this._bindIntersectsLineUniforms(e,n),t.bind(this._params,e.camera),i.bindVAO(this._quadVAO),i.drawArrays(O.TRIANGLE_STRIP,0,4)}_renderPath(e){if(i(this._pathVerticalPlaneData)||i(this._pathTechnique))return;const t=e.rctx,n=this._pathTechnique,s=n.program;t.useProgram(s),n.bindPipelineState(t),this._bindGlobalUniforms(e,s),n.bind(this._params,this._pathVerticalPlaneData.origin,e.camera),this._pathVerticalPlaneData.draw(e.rctx)}_bindHeightManifoldUniforms(e,t){if(!this.heightManifoldEnabled)return;const i=this._tempVec3A,n=this._tempPlane;this._renderCoordsHelper.worldUpAtPosition(this._heightManifoldTarget,i),N(n,this._heightManifoldTarget,i,e.camera.viewMatrix),t.setUniform4fv("heightPlane",n)}_bindPointDistanceUniforms(e,t){if(!this._pointDistanceEnabled)return;const i=e.camera,n=this._tempSphere;a(n,this._pointDistanceOrigin),h(n,n,i.viewMatrix),n[3]=l(this._pointDistanceOrigin,this._pointDistanceTarget),t.setUniform4f("pointDistanceSphere",n[0],n[1],n[2],n[3])}_bindLineVerticalPlaneUniforms(e,t){if(!this._lineVerticalPlaneEnabled)return;const i=this._renderCoordsHelper,n=e.camera,s=this._tempPlane,r=this._tempVec3A,l=this._tempUp,d=this._tempDir,m=this._tempNormal;L(this._lineVerticalPlaneSegment,.5,r),i.worldUpAtPosition(r,l),o(d,this._lineVerticalPlaneSegment.vector),c(m,l,d),o(m,m),N(s,this._lineVerticalPlaneSegment.origin,m,n.viewMatrix),t.setUniform4fv("lineVerticalPlane",s);const p=this._tempVec3A;a(p,this._lineVerticalPlaneSegment.origin),i.setAltitude(p,0),h(p,p,n.viewMatrix),t.setUniform3fv("lineVerticalStart",p);const f=this._tempVec3B;_(f,this._lineVerticalPlaneSegment.origin,this._lineVerticalPlaneSegment.vector),i.setAltitude(f,0),h(f,f,n.viewMatrix),t.setUniform3fv("lineVerticalEnd",f)}_bindIntersectsLineUniforms(e,t){if(!this._intersectsLineEnabled)return;const i=G,n=W;if(this._intersectsLineInfinite){const t=e.camera;if(g(q(this._intersectsLineSegment.origin,this._intersectsLineSegment.vector),B),B.c0=-Number.MAX_VALUE,!P(t.frustum,B))return;u(B,i),b(B,n)}else a(i,this._intersectsLineSegment.origin),_(n,this._intersectsLineSegment.origin,this._intersectsLineSegment.vector);const s=this._tempVec3A;h(s,i,e.camera.viewMatrix),t.setUniform3fv("intersectsLineStart",s);const r=this._tempVec4;a(r,this._intersectsLineSegment.vector),this._tempVec4[3]=0,m(this._tempVec4,this._tempVec4,e.camera.viewMatrix),h(n,n,e.camera.viewMatrix),t.setUniform3fv("intersectsLineEnd",n),o(r,r),t.setUniform3f("intersectsLineDirection",r[0],r[1],r[2]),t.setUniform1f("intersectsLineRadius",this._intersectsLineRadius)}_bindGlobalUniforms(e,t){const i=e.camera;t.setUniform4fv("projInfo",this._projInfo),t.setUniform2fv("zScale",this._zScale),t.setUniform2f("nearFar",i.near,i.far),this._heightManifoldEnabled?t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._heightManifoldTarget)):this._pointDistanceEnabled?t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._pointDistanceTarget)):this._lineVerticalPlaneEnabled&&t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._lineVerticalPlaneSegment.origin)),t.bindTexture(e.offscreenRenderingHelper.linearDepthTexture,"depthMap"),t.bindTexture(e.offscreenRenderingHelper.mainColorTexture,"frameColor")}_requestRender(){this._context&&this._context.requestRender()}}const B=f(),G=d(),W=d();export{k as LaserLineRenderer};
5
+ import{deg2rad as e}from"../../../core/mathUtils.js";import{isSome as t,isNone as i,disposeMaybe as n,releaseMaybe as s}from"../../../core/maybe.js";import{a as r}from"../../../chunks/vec2f64.js";import{g as a,m as h,i as l,n as o,c,b as _}from"../../../chunks/vec3.js";import{c as d}from"../../../chunks/vec3f64.js";import{t as m}from"../../../chunks/vec4.js";import{c as p}from"../../../chunks/vec4f64.js";import{create as g,fromRay as f,getStart as u,getEnd as b}from"../../../geometry/support/clipRay.js";import{intersectClipRay as P}from"../../../geometry/support/frustum.js";import{create as V,copy as E,pointAt as L}from"../../../geometry/support/lineSegment.js";import{create as D,fromPositionAndNormal as S}from"../../../geometry/support/plane.js";import{wrap as q}from"../../../geometry/support/ray.js";import{c as R}from"../../../chunks/sphere.js";import{LaserlinePathData as U}from"./LaserlinePathData.js";import{createQuadVAO as T}from"../webgl-engine/lib/glUtil3D.js";import{RenderSlot as M}from"../webgl-engine/lib/RenderSlot.js";import{inverseProjectionInfo as x}from"../webgl-engine/lib/Util.js";import{copyParameters as C,updateParameters as v}from"../webgl-engine/materials/internal/MaterialUtil.js";import{LaserlinePathTechniqueConfiguration as A,LaserlinePathTechnique as j}from"../webgl-engine/shaders/LaserlinePathTechnique.js";import{LaserlineTechniqueConfiguration as w,LaserlineTechnique as I}from"../webgl-engine/shaders/LaserlineTechnique.js";import{PrimitiveType as O}from"../../webgl/enums.js";const y=d(),H=p(),z={glowColor:[1,.5,0],glowWidth:8,glowFalloff:8,innerColor:[1,1,1],innerWidth:1,globalAlpha:.75,angleCutoff:e(6),globalAlphaContrastBoost:2};function N(e,t,i,n){const s=y,r=H;h(s,t,n),a(r,i),r[3]=0,m(r,r,n),S(s,r,e)}class k{constructor(e,t={},i={contrastControlEnabled:!1}){this._renderCoordsHelper=e,this._config=i,this._technique=null,this._projInfo=p(),this._zScale=r(),this._heightManifoldEnabled=!1,this._heightManifoldTarget=d(),this._pointDistanceEnabled=!1,this._pointDistanceOrigin=d(),this._pointDistanceTarget=d(),this._lineVerticalPlaneEnabled=!1,this._lineVerticalPlaneSegment=V(),this._intersectsLineEnabled=!1,this._intersectsLineSegment=V(),this._intersectsLineRadius=3,this._intersectsLineInfinite=!1,this._pathVerticalPlaneEnabled=!1,this._pathVerticalPlaneData=null,this._pathTechnique=null,this.canRender=!0,this._tempNormal=d(),this._tempDir=d(),this._tempUp=d(),this._tempVec3A=d(),this._tempVec3B=d(),this._tempVec4=p(),this._tempPlane=D(),this._tempSphere=R(),this._params=C(t,z)}get renderSlots(){return[this._config.contrastControlEnabled?M.LASERLINES_CONTRAST_CONTROL:M.LASERLINES]}get needsLinearDepth(){return!0}get heightManifoldEnabled(){return this._heightManifoldEnabled}set heightManifoldEnabled(e){this._heightManifoldEnabled!==e&&(this._heightManifoldEnabled=e,this._requestRender())}get heightManifoldTarget(){return this._heightManifoldTarget}set heightManifoldTarget(e){a(this._heightManifoldTarget,e),this._requestRender()}get pointDistanceEnabled(){return this._pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._pointDistanceEnabled&&(this._pointDistanceEnabled=e,this._requestRender())}get pointDistanceTarget(){return this._pointDistanceTarget}set pointDistanceTarget(e){a(this._pointDistanceTarget,e),this._requestRender()}get pointDistanceOrigin(){return this._pointDistanceOrigin}set pointDistanceOrigin(e){a(this._pointDistanceOrigin,e),this._requestRender()}get lineVerticalPlaneEnabled(){return this._lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._lineVerticalPlaneEnabled&&(this._lineVerticalPlaneEnabled=e,this._requestRender())}get lineVerticalPlaneSegment(){return this._lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){E(e,this._lineVerticalPlaneSegment),this._requestRender()}get intersectsLineEnabled(){return this._intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._intersectsLineEnabled&&(this._intersectsLineEnabled=e,this._requestRender())}get intersectsLineSegment(){return this._intersectsLineSegment}set intersectsLineSegment(e){E(e,this._intersectsLineSegment),this._requestRender()}get intersectsLineRadius(){return this._intersectsLineRadius}set intersectsLineRadius(e){e!==this._intersectsLineRadius&&(this._intersectsLineRadius=e,this._requestRender())}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this._requestRender())}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,t(this._pathVerticalPlaneData)&&this._requestRender())}set pathVerticalPlaneVertices(e){i(this._pathVerticalPlaneData)&&(this._pathVerticalPlaneData=new U(this._renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this._requestRender()}set pathVerticalPlaneBuffers(e){i(this._pathVerticalPlaneData)&&(this._pathVerticalPlaneData=new U(this._renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this._requestRender()}setParameters(e){v(this._params,e)&&this._requestRender()}initializeRenderContext(e){this._context=e;const t=e.renderContext.rctx;this._quadVAO=T(t),this._techniqueRepository=e.shaderTechniqueRep,this._techniqueConfig=new w;const i=new A;i.contrastControlEnabled=this._config.contrastControlEnabled,this._pathTechnique=this._techniqueRepository.acquire(j,i)}uninitializeRenderContext(){this._quadVAO=n(this._quadVAO),this._technique=s(this._technique),this._pathVerticalPlaneData=n(this._pathVerticalPlaneData),this._pathTechnique=s(this._pathTechnique)}prepareTechnique(){return this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled?(this._techniqueConfig.heightManifoldEnabled=this.heightManifoldEnabled,this._techniqueConfig.lineVerticalPlaneEnabled=this.lineVerticalPlaneEnabled,this._techniqueConfig.pointDistanceEnabled=this.pointDistanceEnabled,this._techniqueConfig.intersectsLineEnabled=this.intersectsLineEnabled,this._techniqueConfig.contrastControlEnabled=this._config.contrastControlEnabled,this._technique=this._techniqueRepository.releaseAndAcquire(I,this._techniqueConfig,this._technique),this._technique):this._pathTechnique}render(e,t){const i=e.camera;x(i.projectionMatrix,i.fullWidth,i.fullHeight,this._projInfo,this._zScale),(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(e,t),this.pathVerticalPlaneEnabled&&this._renderPath(e)}_renderUnified(e,t){const i=e.rctx,n=t.program;i.useProgram(n),t.bindPipelineState(i),this._bindGlobalUniforms(e,n),this._bindHeightManifoldUniforms(e,n),this._bindPointDistanceUniforms(e,n),this._bindLineVerticalPlaneUniforms(e,n),this._bindIntersectsLineUniforms(e,n),t.bind(this._params,e.camera),i.bindVAO(this._quadVAO),i.drawArrays(O.TRIANGLE_STRIP,0,4)}_renderPath(e){if(i(this._pathVerticalPlaneData)||i(this._pathTechnique))return;const t=e.rctx,n=this._pathTechnique,s=n.program;t.useProgram(s),n.bindPipelineState(t),this._bindGlobalUniforms(e,s),n.bind(this._params,this._pathVerticalPlaneData.origin,e.camera),this._pathVerticalPlaneData.draw(e.rctx)}_bindHeightManifoldUniforms(e,t){if(!this.heightManifoldEnabled)return;const i=this._tempVec3A,n=this._tempPlane;this._renderCoordsHelper.worldUpAtPosition(this._heightManifoldTarget,i),N(n,this._heightManifoldTarget,i,e.camera.viewMatrix),t.setUniform4fv("heightPlane",n)}_bindPointDistanceUniforms(e,t){if(!this._pointDistanceEnabled)return;const i=e.camera,n=this._tempSphere;a(n,this._pointDistanceOrigin),h(n,n,i.viewMatrix),n[3]=l(this._pointDistanceOrigin,this._pointDistanceTarget),t.setUniform4f("pointDistanceSphere",n[0],n[1],n[2],n[3])}_bindLineVerticalPlaneUniforms(e,t){if(!this._lineVerticalPlaneEnabled)return;const i=this._renderCoordsHelper,n=e.camera,s=this._tempPlane,r=this._tempVec3A,l=this._tempUp,d=this._tempDir,m=this._tempNormal;L(this._lineVerticalPlaneSegment,.5,r),i.worldUpAtPosition(r,l),o(d,this._lineVerticalPlaneSegment.vector),c(m,l,d),o(m,m),N(s,this._lineVerticalPlaneSegment.origin,m,n.viewMatrix),t.setUniform4fv("lineVerticalPlane",s);const p=this._tempVec3A;a(p,this._lineVerticalPlaneSegment.origin),i.setAltitude(p,0),h(p,p,n.viewMatrix),t.setUniform3fv("lineVerticalStart",p);const g=this._tempVec3B;_(g,this._lineVerticalPlaneSegment.origin,this._lineVerticalPlaneSegment.vector),i.setAltitude(g,0),h(g,g,n.viewMatrix),t.setUniform3fv("lineVerticalEnd",g)}_bindIntersectsLineUniforms(e,t){if(!this._intersectsLineEnabled)return;const i=G,n=F;if(this._intersectsLineInfinite){const t=e.camera;if(f(q(this._intersectsLineSegment.origin,this._intersectsLineSegment.vector),B),B.c0=-Number.MAX_VALUE,!P(t.frustum,B))return;u(B,i),b(B,n)}else a(i,this._intersectsLineSegment.origin),_(n,this._intersectsLineSegment.origin,this._intersectsLineSegment.vector);const s=this._tempVec3A;h(s,i,e.camera.viewMatrix),t.setUniform3fv("intersectsLineStart",s);const r=this._tempVec4;a(r,this._intersectsLineSegment.vector),this._tempVec4[3]=0,m(this._tempVec4,this._tempVec4,e.camera.viewMatrix),h(n,n,e.camera.viewMatrix),t.setUniform3fv("intersectsLineEnd",n),o(r,r),t.setUniform3f("intersectsLineDirection",r[0],r[1],r[2]),t.setUniform1f("intersectsLineRadius",this._intersectsLineRadius)}_bindGlobalUniforms(e,t){const i=e.camera;t.setUniform4fv("projInfo",this._projInfo),t.setUniform2fv("zScale",this._zScale),t.setUniform2fv("nearFar",i.nearFar),this._heightManifoldEnabled?t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._heightManifoldTarget)):this._pointDistanceEnabled?t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._pointDistanceTarget)):this._lineVerticalPlaneEnabled&&t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._lineVerticalPlaneSegment.origin)),t.bindTexture(e.offscreenRenderingHelper.linearDepthTexture,"depthMap"),t.bindTexture(e.offscreenRenderingHelper.mainColorTexture,"frameColor")}_requestRender(){this._context&&this._context.requestRender()}}const B=g(),G=d(),F=d();export{k as LaserLineRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e,isNone as t}from"../../../core/maybe.js";import{s as r,f as s}from"../../../chunks/vec3.js";import{c as i}from"../../../chunks/vec3f64.js";import{glLayout as o}from"./buffer/glUtil.js";import{newLayout as f}from"./buffer/InterleavedLayout.js";import{VertexAttribute as n}from"../webgl-engine/lib/basicInterfaces.js";import{LaserlinePathTechnique as u}from"../webgl-engine/shaders/LaserlinePathTechnique.js";import{BufferObject as a}from"../../webgl/BufferObject.js";import{PrimitiveType as c,Usage as h}from"../../webgl/enums.js";import{VertexArrayObject as l}from"../../webgl/VertexArrayObject.js";class _{constructor(e){this._renderCoordsHelper=e,this._buffers=null,this._origin=i(),this._dirty=!1,this._count=0,this._vao=null}set vertices(e){const t=new Float64Array(3*e.length);let r=0;for(const s of e)t[r++]=s[0],t[r++]=s[1],t[r++]=s[2];this.buffers=[t]}set buffers(e){if(this._buffers=e,this._buffers.length>0){const e=this._buffers[0],t=3*Math.floor(e.length/3/2);r(this._origin,e[t+0],e[t+1],e[t+2])}else r(this._origin,0,0,0);this._dirty=!0}get origin(){return this._origin}draw(t){const r=this._ensureVAO(t);e(r)&&(t.bindVAO(r),t.drawArrays(c.TRIANGLES,0,this._count))}dispose(){e(this._vao)&&this._vao.dispose()}_ensureVAO(e){return t(this._buffers)?null:(t(this._vao)&&(this._vao=this._createVAO(e,this._buffers)),this._ensureVertexData(this._vao,this._buffers),this._vao)}_createVAO(e,t){const r=this._createDataBuffer(t);return this._dirty=!1,new l(e,u.attributeLocations,{data:o(V)},{data:a.createVertex(e,h.STATIC_DRAW,r)})}_ensureVertexData(e,t){if(!this._dirty)return;const r=this._createDataBuffer(t);e.vertexBuffers.data.setData(r),this._dirty=!1}_numberOfRenderVertices(e){return 3*(2*(e.length/3-1))}_createDataBuffer(e){const t=e.reduce(((e,t)=>e+this._numberOfRenderVertices(t)),0);this._count=t;const i=V.createBuffer(t),o=this._origin;let f=0,n=0;for(const u of e){for(let e=0;e<u.length;e+=3){const t=r(b,u[e+0],u[e+1],u[e+2]);0===e?n=this._renderCoordsHelper.getAltitude(t):this._renderCoordsHelper.setAltitude(t,n);const a=this._renderCoordsHelper.worldUpAtPosition(t,d),c=f+2*e,h=s(b,t,o);if(e<u.length-3){i.up.setVec(c,a),i.up.setVec(c+3,a),i.up.setVec(c+5,a);for(let e=0;e<6;e++)i.start.setVec(c+e,h);i.extrude.setValues(c+0,0,-1),i.extrude.setValues(c+1,1,-1),i.extrude.setValues(c+2,1,1),i.extrude.setValues(c+3,0,-1),i.extrude.setValues(c+4,1,1),i.extrude.setValues(c+5,0,1)}if(e>0){i.up.setVec(c-2,a),i.up.setVec(c-4,a),i.up.setVec(c-5,a);for(let e=-6;e<0;e++)i.end.setVec(c+e,h)}}f+=this._numberOfRenderVertices(u)}return i.buffer}}const d=i(),b=i(),V=f().vec3f(n.START).vec3f(n.END).vec3f(n.UP).vec2f(n.EXTRUDE);export{_ as LaserlinePathData};
5
+ import{isSome as e,isNone as t}from"../../../core/maybe.js";import{s as r,f as s}from"../../../chunks/vec3.js";import{c as i}from"../../../chunks/vec3f64.js";import{glLayout as o}from"./buffer/glUtil.js";import{newLayout as f}from"./buffer/InterleavedLayout.js";import{VertexAttribute as n}from"../webgl-engine/lib/VertexAttribute.js";import{LaserlinePathTechnique as u}from"../webgl-engine/shaders/LaserlinePathTechnique.js";import{BufferObject as a}from"../../webgl/BufferObject.js";import{PrimitiveType as c,Usage as h}from"../../webgl/enums.js";import{VertexArrayObject as l}from"../../webgl/VertexArrayObject.js";class _{constructor(e){this._renderCoordsHelper=e,this._buffers=null,this._origin=i(),this._dirty=!1,this._count=0,this._vao=null}set vertices(e){const t=new Float64Array(3*e.length);let r=0;for(const s of e)t[r++]=s[0],t[r++]=s[1],t[r++]=s[2];this.buffers=[t]}set buffers(e){if(this._buffers=e,this._buffers.length>0){const e=this._buffers[0],t=3*Math.floor(e.length/3/2);r(this._origin,e[t+0],e[t+1],e[t+2])}else r(this._origin,0,0,0);this._dirty=!0}get origin(){return this._origin}draw(t){const r=this._ensureVAO(t);e(r)&&(t.bindVAO(r),t.drawArrays(c.TRIANGLES,0,this._count))}dispose(){e(this._vao)&&this._vao.dispose()}_ensureVAO(e){return t(this._buffers)?null:(t(this._vao)&&(this._vao=this._createVAO(e,this._buffers)),this._ensureVertexData(this._vao,this._buffers),this._vao)}_createVAO(e,t){const r=this._createDataBuffer(t);return this._dirty=!1,new l(e,u.attributeLocations,{data:o(V)},{data:a.createVertex(e,h.STATIC_DRAW,r)})}_ensureVertexData(e,t){if(!this._dirty)return;const r=this._createDataBuffer(t);e.vertexBuffers.data.setData(r),this._dirty=!1}_numberOfRenderVertices(e){return 3*(2*(e.length/3-1))}_createDataBuffer(e){const t=e.reduce(((e,t)=>e+this._numberOfRenderVertices(t)),0);this._count=t;const i=V.createBuffer(t),o=this._origin;let f=0,n=0;for(const u of e){for(let e=0;e<u.length;e+=3){const t=r(b,u[e+0],u[e+1],u[e+2]);0===e?n=this._renderCoordsHelper.getAltitude(t):this._renderCoordsHelper.setAltitude(t,n);const a=this._renderCoordsHelper.worldUpAtPosition(t,d),c=f+2*e,h=s(b,t,o);if(e<u.length-3){i.up.setVec(c,a),i.up.setVec(c+3,a),i.up.setVec(c+5,a);for(let e=0;e<6;e++)i.start.setVec(c+e,h);i.extrude.setValues(c+0,0,-1),i.extrude.setValues(c+1,1,-1),i.extrude.setValues(c+2,1,1),i.extrude.setValues(c+3,0,-1),i.extrude.setValues(c+4,1,1),i.extrude.setValues(c+5,0,1)}if(e>0){i.up.setVec(c-2,a),i.up.setVec(c-4,a),i.up.setVec(c-5,a);for(let e=-6;e<0;e++)i.end.setVec(c+e,h)}}f+=this._numberOfRenderVertices(u)}return i.buffer}}const d=i(),b=i(),V=f().vec3f(n.START).vec3f(n.END).vec3f(n.UP).vec2f(n.EXTRUDE);export{_ as LaserlinePathData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import t from"../../../core/Evented.js";import s from"../../../core/Handles.js";import i from"../../../core/Logger.js";import{someMap as a}from"../../../core/MapUtils.js";import{releaseMaybe as o,disposeMaybe as n,isSome as h,unwrapOr as l,isNone as d,unwrap as c}from"../../../core/maybe.js";import u from"../../../core/PooledArray.js";import{someSet as p}from"../../../core/SetUtils.js";import{init as g}from"../../../core/watchUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import{q as _,f}from"../../../chunks/mat4.js";import{a as R}from"../../../chunks/vec2f64.js";import{f as T,c as b}from"../../../chunks/vec3f64.js";import{I as w}from"../../../chunks/mat4f64.js";import{ViewingMode as v}from"../../ViewingMode.js";import{DrapeTargetType as x,DrapeSourceType as O}from"../layers/interfaces.js";import E from"../support/debugFlags.js";import{OverlayIndex as L,RenderTargetType as j}from"./interfaces.js";import{Overlay as A}from"./Overlay.js";import{OverlayFramebufferObject as S}from"./OverlayFramebufferObject.js";import{OverlayRenderTarget as P}from"./OverlayRenderTarget.js";import{ShaderTechniqueRepository as C}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js";import{autoDispose as D,AutoDisposableMixin as G}from"../webgl-engine/lib/AutoDisposable.js";import{TransparencyPassType as I,UpdatePolicy as M}from"../webgl-engine/lib/basicInterfaces.js";import V from"../webgl-engine/lib/Camera.js";import{GLMaterialRepository as U}from"../webgl-engine/lib/GLMaterialRepository.js";import{createEmptyDepthTexture as F,createQuadVAO as q}from"../webgl-engine/lib/glUtil3D.js";import{GridLocalOriginFactory as H}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{newIntersectorResult as W}from"../webgl-engine/lib/Intersector.js";import{StoreResults as N,IntersectorType as B}from"../webgl-engine/lib/IntersectorInterfaces.js";import{RenderOccludedFlag as k}from"../webgl-engine/lib/Material.js";import{ModelDirty as z}from"../webgl-engine/lib/ModelDirtyTypes.js";import{OverlayRenderContext as Y}from"../webgl-engine/lib/RenderContext.js";import{RenderPass as X}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as Q}from"../webgl-engine/lib/RenderSlot.js";import{SortedRenderGeometryRenderer as J}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{TextureTechniqueConfiguration as K,TextureTechnique as Z}from"../webgl-engine/lib/TextureTechnique.js";import{AmbientLight as $}from"../webgl-engine/lighting/Lightsources.js";import{SceneLighting as ee}from"../webgl-engine/lighting/SceneLighting.js";import{StippleTextureRepository as re}from"../webgl-engine/materials/StippleTextureRepository.js";import{C as te}from"../../../chunks/Compositing.glsl.js";import{AlphaMode as se}from"../webgl-engine/shaders/CompositingTechnique.js";import{ImmediateTask as ie,TaskPriority as ae,noBudget as oe}from"../../support/Scheduler.js";import{ClearBufferBit as ne,PrimitiveType as he,TextureType as le,PixelFormat as de,PixelType as ce,TextureSamplingMode as ue}from"../../webgl/enums.js";import{Texture as pe}from"../../webgl/Texture.js";import{vertexCount as ge}from"../../webgl/Util.js";const me=i.getLogger("esri.views.3d.webgl-engine.lib.OverlayRenderer");let ye=class extends(G(r)){constructor(e){super(e),this._overlays=null,this._overlayRenderTarget=null,this._hasHighlights=!1,this._rendersOccluded=!1,this._hasWater=!1,this._lighting=new ee,this._handles=new s,this._frameTask=ie,this._layerRenderers=new Map,this._sortedLayerRenderersDirty=!1,this._sortedLayerRenderers=new u,this._geometries=new Map,this.worldToPCSRatio=1,this.events=new t,this.longitudeCyclical=null}initialize(){const e=this.view._stage.renderView;this._rctx=e.renderingContext,this._renderContext=new Y(this._rctx);const r=e.waterTextureRepository;this._stippleTextureRepository=new re(e.renderingContext),this._shaderTechniqueRepository=new C({rctx:this._rctx,viewingMode:v.Local,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:r}),this._handles.add([g(r,"loadingState",(()=>this.events.emit("content-changed"))),g(this,"spatialReference",(e=>this._localOrigins=new H(e)))]),this._materialRepository=new U(e.textureRepository,this._shaderTechniqueRepository,(e=>{(e.renderOccluded&Oe)>0!==this._rendersOccluded&&this._updateRendersOccluded(),this.events.emit("content-changed"),this.notifyChange("updating")}),(()=>this.events.emit("content-changed"))),this._lighting.groundLightingFactor=1,this._lighting.globalFactor=0,this._lighting.set([new $(T(1,1,1))]),this._bindParameters={slot:Q.DRAPED_MATERIAL,highlightDepthTexture:F(this._rctx),camera:be,inverseViewport:R(),origin:null,screenToWorldRatio:null,screenToPCSRatio:null,shadowMappingEnabled:!1,slicePlane:null,ssaoEnabled:!1,hasOccludees:!1,linearDepthTexture:null,lastFrameColorTexture:null,reprojectionMatrix:w,ssrEnabled:!1,lighting:this._lighting,transparencyPassType:I.NONE,terrainLinearDepthTexture:null,geometryLinearDepthTexture:null,multipassTerrainEnabled:!1,cullAboveGround:!1,multipassGeometryEnabled:!1,highlightColorTexture:null,cloudsCompositionParams:null},this._frameTask=this.view.resourceController.scheduler.registerTask(ae.STAGE,this),this._handles.add(this._frameTask)}dispose(){this._handles.destroy(),this._layerRenderers.forEach((e=>e.dispose())),this._layerRenderers.clear(),this._debugTextureTechnique=o(this._debugTextureTechnique),this._debugPatternTexture=n(this._debugPatternTexture),this._bindParameters.highlightDepthTexture=n(this._bindParameters.highlightDepthTexture),this._shaderTechniqueRepository=n(this._shaderTechniqueRepository),this._temporaryFBO=n(this._temporaryFBO),this._quadVAO=n(this._quadVAO),this.disposeOverlays()}get updating(){return this._sortedLayerRenderersDirty||this._frameTask.updating||a(this._layerRenderers,(e=>e.updating))}get hasOverlays(){return h(this._overlays)&&h(this._overlayRenderTarget)}get gpuMemoryUsage(){return h(this._overlayRenderTarget)?this._overlayRenderTarget.gpuMemoryUsage:0}collectUnusedRenderTargetMemory(e){let r=!1;if(h(this._overlayRenderTarget))for(const t of this._overlayRenderTarget.renderTargets){const s=this.overlays[0].validTargets[t.type]||!this.overlays[1].validTargets[t.type];r=this._overlayRenderTarget.validateUsageForTarget(s,t,e)||r}return r}get overlays(){return l(this._overlays,[])}ensureDrapeTargets(e){h(this._overlays)&&this._overlays.forEach((r=>{r.hasTargetWithoutRasterImage=p(e,(e=>e.drapeTargetType===x.WithoutRasterImage))}))}ensureDrapeSources(e){h(this._overlays)&&this._overlays.forEach((r=>{r.hasDrapedFeatureSource=a(e,((e,r)=>r.drapeSourceType===O.Features)),r.hasDrapedRasterSource=a(e,((e,r)=>r.drapeSourceType===O.RasterImage))}))}ensureOverlays(e,r){d(this._overlays)&&(this._overlayRenderTarget=new P(this._rctx),this._overlays=[new A(L.INNER,this._overlayRenderTarget),new A(L.OUTER,this._overlayRenderTarget)]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r)}disposeOverlays(){this._overlays=null,this._overlayRenderTarget=n(this._overlayRenderTarget),this.events.emit("textures-disposed")}get running(){return this.updating}runTask(e,r=(()=>!0)){this._frameTask.processQueue(e),e.done||this._processLayers(e,r)}_processLayers(e,r){let t=!1;for(const[s,i]of this._layerRenderers){if(e.done)break;(s.destroyed||r(s))&&(i.commitChanges()&&(t=!0,e.madeProgress()),i.isEmpty&&(t=!0,this._sortedLayerRenderersDirty=!0,this._layerRenderers.delete(s),this._handles.remove(s)))}this._updateSortedLayerRenderers(),t&&(h(this._overlays)&&0===this._layerRenderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.events.emit("content-changed"),this._updateHasHighlights(),this._updateRendersOccluded(),this._updateHasWater())}processSyncLayers(){this._processLayers(oe,(e=>e.updatePolicy===M.SYNC))}addGeometries(e,r,t){for(const s of e)d(s.origin)&&(s.origin=this._localOrigins.getOrigin(s.boundingSphere)),this._geometries.set(s.id,s);this._ensureLayerRenderer(r).add(e),t===z.Geometry.UPDATE&&this._notifyGraphicGeometryChanged(e,r)}removeGeometries(e,r,t){for(const i of e)this._geometries.delete(c(i.id));const s=this._layerRenderers.get(r);s&&(s.remove(e),t===z.Geometry.UPDATE&&this._notifyGraphicGeometryChanged(e,r))}updateGeometries(e,r,t){const s=this._layerRenderers.get(r);if(s)switch(s.modify(e,t),t){case z.State.TRANSFORMATION:case z.State.VERTEXATTRS:return this._notifyGraphicGeometryChanged(e,r);case z.State.VISIBILITIES:return this._notifyGraphicVisibilityChanged(e,r)}else me.warn("Attempted to update geometry for nonexistent layer")}_notifyGraphicGeometryChanged(e,r){if(d(r.notifyGraphicGeometryChanged))return;let t;for(const s of e){const e=s.graphicUid;h(e)&&e!==t&&(r.notifyGraphicGeometryChanged(e),t=e)}}_notifyGraphicVisibilityChanged(e,r){if(d(r.notifyGraphicVisibilityChanged))return;let t;for(const s of e){const e=s.graphicUid;h(e)&&e!==t&&(r.notifyGraphicVisibilityChanged(e),t=e)}}updateHighlights(e,r){const t=this._layerRenderers.get(r);t?t.modify(e,z.State.HIGHLIGHTS):me.warn("Attempted to update highlights for nonexistent layer")}isEmpty(){return 0===this._geometries.size&&!E.OVERLAY_DRAW_DEBUG_TEXTURE}get hasHighlights(){return this._hasHighlights}get hasWater(){return this._hasWater}get rendersOccluded(){return this._rendersOccluded}updateAnimation(e){let r=!1;return this._layerRenderers.forEach((t=>r=t.updateAnimation(e)||r)),r}updateLayerOrder(){this._sortedLayerRenderersDirty=!0}drawTarget(e,r,t){const s=e.canvasGeometries;if(0===s.numViews)return!1;this._screenToWorldRatio=t*e.mapUnitsPerPixel;const i=r.renderPass;if(this.isEmpty()||i===X.MATERIAL_HIGHLIGHT&&!this.hasHighlights||i===X.MATERIAL_NORMAL&&!this.hasWater||!e.hasSomeSizedView())return!1;const a=r.fbo;if(!a.isValid())return!1;const o=2*e.resolution,n=e.resolution;a.resize(o,n);const l=this._rctx;be.pixelRatio=e.pixelRatio*t,this._renderContext.pass=i,this._bindParameters.screenToWorldRatio=this._screenToWorldRatio,this._bindParameters.screenToPCSRatio=this._screenToWorldRatio*this.worldToPCSRatio,this._bindParameters.slot=i===X.MATERIAL_NORMAL?Q.DRAPED_WATER:Q.DRAPED_MATERIAL,e.applyViewport(this._rctx),a.bind(l),e.index===L.INNER&&(l.setClearColor(0,0,0,0),l.clearSafe(ne.COLOR_BUFFER_BIT));const d=r.type===j.ColorNoRasterImage?_e.ExcludeRasterImage:r.type===j.Occluded?_e.OccludedOnly:_e.Normal;if(d===_e.OccludedOnly&&(this._renderContext.renderOccludedMask=Oe),E.OVERLAY_DRAW_DEBUG_TEXTURE&&d!==_e.OccludedOnly)for(let h=0;h<s.numViews;h++)this._setViewParameters(s.extents[h],e,be),this._drawDebugTexture(e.resolution,Re[e.index]);return this._layerRenderers.size>0&&this._sortedLayerRenderers.forAll((({overlayLayer:r,renderer:t})=>{if(d===_e.ExcludeRasterImage&&r.drapeSourceType===O.RasterImage)return;const{fullOpacity:c}=r,u=h(c)&&c<1&&i===X.MATERIAL;u&&(this.bindTemporaryFramebuffer(this._rctx,o,n),l.clearSafe(ne.COLOR_BUFFER_BIT));for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],e,be),t.render(this._renderContext,this._bindParameters);u&&h(this._temporaryFBO)&&(a.bind(l),this.view._stage.renderView.compositingHelper.composite(this._temporaryFBO.getTexture(),se.PremultipliedAlpha,c,te.OverlayWithTransparency,e.index))})),l.bindFramebuffer(null),a.generateMipMap(),this._renderContext.resetRenderOccludedMask(),!0}bindTemporaryFramebuffer(e,r,t){d(this._temporaryFBO)&&(this._temporaryFBO=new S(e,!1)),this._temporaryFBO.resize(r,t),this._temporaryFBO.bind(e)}async reloadShaders(){await this._shaderTechniqueRepository.reloadAll()}intersect(e,r,t,s){let i=0;this._geometries.forEach((a=>{if(s&&!s(a))return;this._intersectRenderGeometry(a,t,r,0,e,i);const o=this.longitudeCyclical;o&&(a.boundingSphere[0]-a.boundingSphere[3]<o.min&&this._intersectRenderGeometry(a,t,r,o.range,e,i),a.boundingSphere[0]+a.boundingSphere[3]>o.max&&this._intersectRenderGeometry(a,t,r,-o.range,e,i)),i++}))}_intersectRenderGeometry(e,r,t,s,i,a){if(!e.instanceParameters.visible)return;let o=0;h(e.transformation)&&(s+=e.transformation[12],o=e.transformation[13]),we[0]=t[0]-s,we[1]=t[1]-o,we[2]=1,ve[0]=t[0]-s,ve[1]=t[1]-o,ve[2]=0,e.screenToWorldRatio=this._screenToWorldRatio,e.material.intersect(e,null,e.getShaderTransformation(),i,we,ve,((t,s,o)=>{Te(r,o,e.material.renderPriority,a,i,e.layerUid,e.graphicUid)}),e.calculateShaderTransformation,r)}_ensureLayerRenderer(e){let r=this._layerRenderers.get(e);return r||(r=new J({rctx:this._rctx,materialRepository:this._materialRepository}),this._layerRenderers.set(e,r),this._sortedLayerRenderersDirty=!0,"fullOpacity"in e&&this._handles.add(e.watch("fullOpacity",(()=>this.events.emit("content-changed"))),e),this._handles.add(g(r,"updating",(()=>this.notifyChange("updating"))),e)),r}_updateSortedLayerRenderers(){if(!this._sortedLayerRenderersDirty)return;if(this._sortedLayerRenderersDirty=!1,this._sortedLayerRenderers.clear(),0===this._layerRenderers.size)return;const e=this.view.map.allLayers;this._layerRenderers.forEach(((r,t)=>{const s=e.indexOf(t.layer);this._sortedLayerRenderers.push(new fe(t,r,s<0?1/0:s))})),this._sortedLayerRenderers.sort(((e,r)=>e.index-r.index))}_setViewParameters(e,r,t){t.viewport[0]=t.viewport[1]=0,t.viewport[2]=t.viewport[3]=r.resolution,_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),f(t.viewMatrix,[-e[0],-e[1],0]),this._renderContext.camera=t,this._bindParameters.camera=t,this._bindParameters.inverseViewport[0]=1/t.fullViewport[2],this._bindParameters.inverseViewport[1]=1/t.fullViewport[3]}_updateHasWater(){const e=a(this._layerRenderers,(e=>e.hasWater));e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water",e))}_updateHasHighlights(){const e=a(this._layerRenderers,(e=>e.hasHighlights));e!==this._hasHighlights&&(this._hasHighlights=e,this.events.emit("has-highlights",e))}_updateRendersOccluded(){const e=a(this._layerRenderers,(e=>e.rendersOccluded));e!==this._rendersOccluded&&(this._rendersOccluded=e,this.events.emit("renders-occluded",e))}_drawDebugTexture(e,r){const t=this._rctx;this._ensureDebugPatternResources(e,e);const s=this._debugTextureTechnique.program;t.useProgram(s),this._debugTextureTechnique.bindPipelineState(t),s.setUniform4f("color",r[0],r[1],r[2],1),s.bindTexture(this._debugPatternTexture,"tex"),t.bindVAO(this._quadVAO),t.drawArrays(he.TRIANGLE_STRIP,0,ge(this._quadVAO,"geometry"))}_ensureDebugPatternResources(e,r){if(this._debugPatternTexture)return;const t=new Uint8Array(e*r*4);let s=0;for(let a=0;a<r;a++)for(let i=0;i<e;i++){const o=Math.floor(i/10),n=Math.floor(a/10);o<2||n<2||10*o>e-20||10*n>r-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&o&&1&n?1&i^1&a?0:255:1&o^1&n?0:128)}this._debugPatternTexture=new pe(this._rctx,{target:le.TEXTURE_2D,pixelFormat:de.RGBA,dataType:ce.UNSIGNED_BYTE,samplingMode:ue.NEAREST,width:e,height:r},t);const i=new K;i.hasAlpha=!0,this._debugTextureTechnique=this._shaderTechniqueRepository.acquire(Z,i),this._quadVAO=q(this._rctx)}get test(){return{layerRenderers:this._layerRenderers}}};var _e;e([m()],ye.prototype,"_frameTask",void 0),e([m()],ye.prototype,"_sortedLayerRenderersDirty",void 0),e([D()],ye.prototype,"_shaderTechniqueRepository",void 0),e([D()],ye.prototype,"_stippleTextureRepository",void 0),e([m({constructOnly:!0})],ye.prototype,"view",void 0),e([m()],ye.prototype,"worldToPCSRatio",void 0),e([m()],ye.prototype,"spatialReference",void 0),e([m({type:Boolean,readOnly:!0})],ye.prototype,"updating",null),ye=e([y("esri.views.3d.terrain.OverlayRenderer")],ye),function(e){e[e.Normal=0]="Normal",e[e.OccludedOnly=1]="OccludedOnly",e[e.ExcludeRasterImage=2]="ExcludeRasterImage"}(_e||(_e={}));class fe{constructor(e,r,t){this.overlayLayer=e,this.renderer=r,this.index=t}}const Re=[[1,.5,.5],[.5,.5,1]];function Te(e,r,t,s,i,a,o){const n={layerUid:a,graphicUid:o,triangleNr:r},h=r=>{r.set(B.OVERLAY,n,e.dist,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.dist||i.results.ground.dist<=i.results.min.dist)&&h(i.results.min),i.options.store!==N.MIN&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.dist||i.results.ground.dist>i.results.max.dist)&&h(i.results.max),i.options.store===N.ALL){const e=W(i.ray);h(e),i.results.all.push(e)}}const be=new V;be.near=1,be.far=1e4,be.relativeElevation=null;const we=b(),ve=b(),xe=-2,Oe=k.OccludeAndTransparent;export{xe as DRAPED_Z,_e as DrawPassOption,ye as OverlayRenderer,Oe as overlayRenderOccludedFlag};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import t from"../../../core/Evented.js";import s from"../../../core/Handles.js";import i from"../../../core/Logger.js";import{someMap as a}from"../../../core/MapUtils.js";import{releaseMaybe as o,disposeMaybe as n,isSome as h,unwrapOr as l,isNone as d,unwrap as c}from"../../../core/maybe.js";import u from"../../../core/PooledArray.js";import{someSet as p}from"../../../core/SetUtils.js";import{init as g}from"../../../core/watchUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import{q as _,f}from"../../../chunks/mat4.js";import{a as R}from"../../../chunks/vec2f64.js";import{f as T,c as b}from"../../../chunks/vec3f64.js";import{I as w}from"../../../chunks/mat4f64.js";import{ViewingMode as v}from"../../ViewingMode.js";import{DrapeTargetType as x,DrapeSourceType as O}from"../layers/interfaces.js";import E from"../support/debugFlags.js";import{OverlayIndex as L,RenderTargetType as j}from"./interfaces.js";import{Overlay as A}from"./Overlay.js";import{OverlayFramebufferObject as S}from"./OverlayFramebufferObject.js";import{OverlayRenderTarget as P}from"./OverlayRenderTarget.js";import{ShaderTechniqueRepository as C}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js";import{autoDispose as D,AutoDisposableMixin as G}from"../webgl-engine/lib/AutoDisposable.js";import{TransparencyPassType as I,UpdatePolicy as M}from"../webgl-engine/lib/basicInterfaces.js";import V from"../webgl-engine/lib/Camera.js";import{GLMaterialRepository as U}from"../webgl-engine/lib/GLMaterialRepository.js";import{createEmptyDepthTexture as F,createQuadVAO as q}from"../webgl-engine/lib/glUtil3D.js";import{GridLocalOriginFactory as H}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{newIntersectorResult as W}from"../webgl-engine/lib/Intersector.js";import{StoreResults as N,IntersectorType as B}from"../webgl-engine/lib/IntersectorInterfaces.js";import{RenderOccludedFlag as k}from"../webgl-engine/lib/Material.js";import{ModelDirty as z}from"../webgl-engine/lib/ModelDirtyTypes.js";import{OverlayRenderContext as Y}from"../webgl-engine/lib/RenderContext.js";import{RenderPass as X}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as Q}from"../webgl-engine/lib/RenderSlot.js";import{SortedRenderGeometryRenderer as J}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{TextureTechniqueConfiguration as K,TextureTechnique as Z}from"../webgl-engine/lib/TextureTechnique.js";import{AmbientLight as $}from"../webgl-engine/lighting/Lightsources.js";import{SceneLighting as ee}from"../webgl-engine/lighting/SceneLighting.js";import{StippleTextureRepository as re}from"../webgl-engine/materials/StippleTextureRepository.js";import{C as te}from"../../../chunks/Compositing.glsl.js";import{AlphaMode as se}from"../webgl-engine/shaders/CompositingTechnique.js";import{ImmediateTask as ie,TaskPriority as ae,noBudget as oe}from"../../support/Scheduler.js";import{ClearBufferBit as ne,PrimitiveType as he,TextureType as le,PixelFormat as de,PixelType as ce,TextureSamplingMode as ue}from"../../webgl/enums.js";import{Texture as pe}from"../../webgl/Texture.js";import{vertexCount as ge}from"../../webgl/Util.js";const me=i.getLogger("esri.views.3d.webgl-engine.lib.OverlayRenderer");let ye=class extends(G(r)){constructor(e){super(e),this._overlays=null,this._overlayRenderTarget=null,this._hasHighlights=!1,this._rendersOccluded=!1,this._hasWater=!1,this._lighting=new ee,this._handles=new s,this._frameTask=ie,this._layerRenderers=new Map,this._sortedLayerRenderersDirty=!1,this._sortedLayerRenderers=new u,this._geometries=new Map,this.worldToPCSRatio=1,this.events=new t,this.longitudeCyclical=null}initialize(){const e=this.view._stage.renderView;this._rctx=e.renderingContext,this._renderContext=new Y(this._rctx);const r=e.waterTextureRepository;this._stippleTextureRepository=new re(e.renderingContext),this._shaderTechniqueRepository=new C({rctx:this._rctx,viewingMode:v.Local,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:r}),this._handles.add([g(r,"loadingState",(()=>this.events.emit("content-changed"))),g(this,"spatialReference",(e=>this._localOrigins=new H(e)))]),this._materialRepository=new U(e.textureRepository,this._shaderTechniqueRepository,(e=>{(e.renderOccluded&Oe)>0!==this._rendersOccluded&&this._updateRendersOccluded(),this.events.emit("content-changed"),this.notifyChange("updating")}),(()=>this.events.emit("content-changed"))),this._lighting.groundLightingFactor=1,this._lighting.globalFactor=0,this._lighting.set([new $(T(1,1,1))]),this._bindParameters={slot:Q.DRAPED_MATERIAL,highlightDepthTexture:F(this._rctx),camera:be,inverseViewport:R(),origin:null,screenToWorldRatio:null,screenToPCSRatio:null,shadowMappingEnabled:!1,slicePlane:null,ssaoEnabled:!1,hasOccludees:!1,linearDepthTexture:null,lastFrameColorTexture:null,reprojectionMatrix:w,ssrEnabled:!1,lighting:this._lighting,transparencyPassType:I.NONE,terrainLinearDepthTexture:null,geometryLinearDepthTexture:null,multipassTerrainEnabled:!1,cullAboveGround:!1,multipassGeometryEnabled:!1,highlightColorTexture:null,cloudsCompositionParams:null},this._frameTask=this.view.resourceController.scheduler.registerTask(ae.STAGE,this),this._handles.add(this._frameTask)}dispose(){this._handles.destroy(),this._layerRenderers.forEach((e=>e.dispose())),this._layerRenderers.clear(),this._debugTextureTechnique=o(this._debugTextureTechnique),this._debugPatternTexture=n(this._debugPatternTexture),this._bindParameters.highlightDepthTexture=n(this._bindParameters.highlightDepthTexture),this._shaderTechniqueRepository=n(this._shaderTechniqueRepository),this._temporaryFBO=n(this._temporaryFBO),this._quadVAO=n(this._quadVAO),this.disposeOverlays()}get updating(){return this._sortedLayerRenderersDirty||this._frameTask.updating||a(this._layerRenderers,(e=>e.updating))}get hasOverlays(){return h(this._overlays)&&h(this._overlayRenderTarget)}get gpuMemoryUsage(){return h(this._overlayRenderTarget)?this._overlayRenderTarget.gpuMemoryUsage:0}collectUnusedRenderTargetMemory(e){let r=!1;if(h(this._overlayRenderTarget))for(const t of this._overlayRenderTarget.renderTargets){const s=this.overlays[0].validTargets[t.type]||!this.overlays[1].validTargets[t.type];r=this._overlayRenderTarget.validateUsageForTarget(s,t,e)||r}return r}get overlays(){return l(this._overlays,[])}ensureDrapeTargets(e){h(this._overlays)&&this._overlays.forEach((r=>{r.hasTargetWithoutRasterImage=p(e,(e=>e.drapeTargetType===x.WithoutRasterImage))}))}ensureDrapeSources(e){h(this._overlays)&&this._overlays.forEach((r=>{r.hasDrapedFeatureSource=a(e,((e,r)=>r.drapeSourceType===O.Features)),r.hasDrapedRasterSource=a(e,((e,r)=>r.drapeSourceType===O.RasterImage))}))}ensureOverlays(e,r){d(this._overlays)&&(this._overlayRenderTarget=new P(this._rctx),this._overlays=[new A(L.INNER,this._overlayRenderTarget),new A(L.OUTER,this._overlayRenderTarget)]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r)}disposeOverlays(){this._overlays=null,this._overlayRenderTarget=n(this._overlayRenderTarget),this.events.emit("textures-disposed")}get running(){return this.updating}runTask(e,r=(()=>!0)){this._frameTask.processQueue(e),e.done||this._processLayers(e,r)}_processLayers(e,r){let t=!1;for(const[s,i]of this._layerRenderers){if(e.done)break;(s.destroyed||r(s))&&(i.commitChanges()&&(t=!0,e.madeProgress()),i.isEmpty&&(t=!0,this._sortedLayerRenderersDirty=!0,this._layerRenderers.delete(s),this._handles.remove(s)))}this._updateSortedLayerRenderers(),t&&(h(this._overlays)&&0===this._layerRenderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.events.emit("content-changed"),this._updateHasHighlights(),this._updateRendersOccluded(),this._updateHasWater())}processSyncLayers(){this._processLayers(oe,(e=>e.updatePolicy===M.SYNC))}addGeometries(e,r,t){for(const s of e)d(s.origin)&&(s.origin=this._localOrigins.getOrigin(s.boundingSphere)),this._geometries.set(s.id,s);this._ensureLayerRenderer(r).add(e),t===z.Geometry.UPDATE&&this._notifyGraphicGeometryChanged(e,r)}removeGeometries(e,r,t){for(const i of e)this._geometries.delete(c(i.id));const s=this._layerRenderers.get(r);s&&(s.remove(e),t===z.Geometry.UPDATE&&this._notifyGraphicGeometryChanged(e,r))}updateGeometries(e,r,t){const s=this._layerRenderers.get(r);if(s)switch(s.modify(e,t),t){case z.State.TRANSFORMATION:case z.State.VERTEXATTRS:return this._notifyGraphicGeometryChanged(e,r);case z.State.VISIBILITIES:return this._notifyGraphicVisibilityChanged(e,r)}else me.warn("Attempted to update geometry for nonexistent layer")}_notifyGraphicGeometryChanged(e,r){if(d(r.notifyGraphicGeometryChanged))return;let t;for(const s of e){const e=s.graphicUid;h(e)&&e!==t&&(r.notifyGraphicGeometryChanged(e),t=e)}}_notifyGraphicVisibilityChanged(e,r){if(d(r.notifyGraphicVisibilityChanged))return;let t;for(const s of e){const e=s.graphicUid;h(e)&&e!==t&&(r.notifyGraphicVisibilityChanged(e),t=e)}}updateHighlights(e,r){const t=this._layerRenderers.get(r);t?t.modify(e,z.State.HIGHLIGHTS):me.warn("Attempted to update highlights for nonexistent layer")}isEmpty(){return 0===this._geometries.size&&!E.OVERLAY_DRAW_DEBUG_TEXTURE}get hasHighlights(){return this._hasHighlights}get hasWater(){return this._hasWater}get rendersOccluded(){return this._rendersOccluded}updateAnimation(e){let r=!1;return this._layerRenderers.forEach((t=>r=t.updateAnimation(e)||r)),r}updateLayerOrder(){this._sortedLayerRenderersDirty=!0}drawTarget(e,r,t){const s=e.canvasGeometries;if(0===s.numViews)return!1;this._screenToWorldRatio=t*e.mapUnitsPerPixel;const i=r.renderPass;if(this.isEmpty()||i===X.MATERIAL_HIGHLIGHT&&!this.hasHighlights||i===X.MATERIAL_NORMAL&&!this.hasWater||!e.hasSomeSizedView())return!1;const a=r.fbo;if(!a.isValid())return!1;const o=2*e.resolution,n=e.resolution;a.resize(o,n);const l=this._rctx;be.pixelRatio=e.pixelRatio*t,this._renderContext.pass=i,this._bindParameters.screenToWorldRatio=this._screenToWorldRatio,this._bindParameters.screenToPCSRatio=this._screenToWorldRatio*this.worldToPCSRatio,this._bindParameters.slot=i===X.MATERIAL_NORMAL?Q.DRAPED_WATER:Q.DRAPED_MATERIAL,e.applyViewport(this._rctx),a.bind(l),e.index===L.INNER&&(l.setClearColor(0,0,0,0),l.clearSafe(ne.COLOR_BUFFER_BIT));const d=r.type===j.ColorNoRasterImage?_e.ExcludeRasterImage:r.type===j.Occluded?_e.OccludedOnly:_e.Normal;if(d===_e.OccludedOnly&&(this._renderContext.renderOccludedMask=Oe),E.OVERLAY_DRAW_DEBUG_TEXTURE&&d!==_e.OccludedOnly)for(let h=0;h<s.numViews;h++)this._setViewParameters(s.extents[h],e,be),this._drawDebugTexture(e.resolution,Re[e.index]);return this._layerRenderers.size>0&&this._sortedLayerRenderers.forAll((({overlayLayer:r,renderer:t})=>{if(d===_e.ExcludeRasterImage&&r.drapeSourceType===O.RasterImage)return;const{fullOpacity:c}=r,u=h(c)&&c<1&&i===X.MATERIAL;u&&(this.bindTemporaryFramebuffer(this._rctx,o,n),l.clearSafe(ne.COLOR_BUFFER_BIT));for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],e,be),t.render(this._renderContext,this._bindParameters);u&&h(this._temporaryFBO)&&(a.bind(l),this.view._stage.renderView.compositingHelper.composite(this._temporaryFBO.getTexture(),se.PremultipliedAlpha,c,te.OverlayWithTransparency,e.index))})),l.bindFramebuffer(null),a.generateMipMap(),this._renderContext.resetRenderOccludedMask(),!0}bindTemporaryFramebuffer(e,r,t){d(this._temporaryFBO)&&(this._temporaryFBO=new S(e,!1)),this._temporaryFBO.resize(r,t),this._temporaryFBO.bind(e)}async reloadShaders(){await this._shaderTechniqueRepository.reloadAll()}intersect(e,r,t,s){let i=0;this._geometries.forEach((a=>{if(s&&!s(a))return;this._intersectRenderGeometry(a,t,r,0,e,i);const o=this.longitudeCyclical;o&&(a.boundingSphere[0]-a.boundingSphere[3]<o.min&&this._intersectRenderGeometry(a,t,r,o.range,e,i),a.boundingSphere[0]+a.boundingSphere[3]>o.max&&this._intersectRenderGeometry(a,t,r,-o.range,e,i)),i++}))}_intersectRenderGeometry(e,r,t,s,i,a){if(!e.instanceParameters.visible)return;let o=0;h(e.transformation)&&(s+=e.transformation[12],o=e.transformation[13]),we[0]=t[0]-s,we[1]=t[1]-o,we[2]=1,ve[0]=t[0]-s,ve[1]=t[1]-o,ve[2]=0,e.screenToWorldRatio=this._screenToWorldRatio,e.material.intersect(e,null,e.getShaderTransformation(),i,we,ve,((t,s,o)=>{Te(r,o,e.material.renderPriority,a,i,e.layerUid,e.graphicUid)}),e.calculateShaderTransformation,r)}_ensureLayerRenderer(e){let r=this._layerRenderers.get(e);return r||(r=new J({rctx:this._rctx,materialRepository:this._materialRepository}),this._layerRenderers.set(e,r),this._sortedLayerRenderersDirty=!0,"fullOpacity"in e&&this._handles.add(e.watch("fullOpacity",(()=>this.events.emit("content-changed"))),e),this._handles.add(g(r,"updating",(()=>this.notifyChange("updating"))),e)),r}_updateSortedLayerRenderers(){if(!this._sortedLayerRenderersDirty)return;if(this._sortedLayerRenderersDirty=!1,this._sortedLayerRenderers.clear(),0===this._layerRenderers.size)return;const e=this.view.map.allLayers;this._layerRenderers.forEach(((r,t)=>{const s=e.indexOf(t.layer);this._sortedLayerRenderers.push(new fe(t,r,s<0?1/0:s))})),this._sortedLayerRenderers.sort(((e,r)=>e.index-r.index))}_setViewParameters(e,r,t){t.viewport[0]=t.viewport[1]=0,t.viewport[2]=t.viewport[3]=r.resolution,_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),f(t.viewMatrix,[-e[0],-e[1],0]),this._renderContext.camera=t,this._bindParameters.camera=t,this._bindParameters.inverseViewport[0]=1/t.fullViewport[2],this._bindParameters.inverseViewport[1]=1/t.fullViewport[3]}_updateHasWater(){const e=a(this._layerRenderers,(e=>e.hasWater));e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water",e))}_updateHasHighlights(){const e=a(this._layerRenderers,(e=>e.hasHighlights));e!==this._hasHighlights&&(this._hasHighlights=e,this.events.emit("has-highlights",e))}_updateRendersOccluded(){const e=a(this._layerRenderers,(e=>e.rendersOccluded));e!==this._rendersOccluded&&(this._rendersOccluded=e,this.events.emit("renders-occluded",e))}_drawDebugTexture(e,r){const t=this._rctx;this._ensureDebugPatternResources(e,e);const s=this._debugTextureTechnique.program;t.useProgram(s),this._debugTextureTechnique.bindPipelineState(t),s.setUniform4f("uColor",r[0],r[1],r[2],1),s.bindTexture(this._debugPatternTexture,"tex"),t.bindVAO(this._quadVAO),t.drawArrays(he.TRIANGLE_STRIP,0,ge(this._quadVAO,"geometry"))}_ensureDebugPatternResources(e,r){if(this._debugPatternTexture)return;const t=new Uint8Array(e*r*4);let s=0;for(let a=0;a<r;a++)for(let i=0;i<e;i++){const o=Math.floor(i/10),n=Math.floor(a/10);o<2||n<2||10*o>e-20||10*n>r-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&o&&1&n?1&i^1&a?0:255:1&o^1&n?0:128)}this._debugPatternTexture=new pe(this._rctx,{target:le.TEXTURE_2D,pixelFormat:de.RGBA,dataType:ce.UNSIGNED_BYTE,samplingMode:ue.NEAREST,width:e,height:r},t);const i=new K;i.hasAlpha=!0,this._debugTextureTechnique=this._shaderTechniqueRepository.acquire(Z,i),this._quadVAO=q(this._rctx)}get test(){return{layerRenderers:this._layerRenderers}}};var _e;e([m()],ye.prototype,"_frameTask",void 0),e([m()],ye.prototype,"_sortedLayerRenderersDirty",void 0),e([D()],ye.prototype,"_shaderTechniqueRepository",void 0),e([D()],ye.prototype,"_stippleTextureRepository",void 0),e([m({constructOnly:!0})],ye.prototype,"view",void 0),e([m()],ye.prototype,"worldToPCSRatio",void 0),e([m()],ye.prototype,"spatialReference",void 0),e([m({type:Boolean,readOnly:!0})],ye.prototype,"updating",null),ye=e([y("esri.views.3d.terrain.OverlayRenderer")],ye),function(e){e[e.Normal=0]="Normal",e[e.OccludedOnly=1]="OccludedOnly",e[e.ExcludeRasterImage=2]="ExcludeRasterImage"}(_e||(_e={}));class fe{constructor(e,r,t){this.overlayLayer=e,this.renderer=r,this.index=t}}const Re=[[1,.5,.5],[.5,.5,1]];function Te(e,r,t,s,i,a,o){const n={layerUid:a,graphicUid:o,triangleNr:r},h=r=>{r.set(B.OVERLAY,n,e.dist,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.dist||i.results.ground.dist<=i.results.min.dist)&&h(i.results.min),i.options.store!==N.MIN&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.dist||i.results.ground.dist>i.results.max.dist)&&h(i.results.max),i.options.store===N.ALL){const e=W(i.ray);h(e),i.results.all.push(e)}}const be=new V;be.near=1,be.far=1e4,be.relativeElevation=null;const we=b(),ve=b(),xe=-2,Oe=k.OccludeAndTransparent;export{xe as DRAPED_Z,_e as DrawPassOption,ye as OverlayRenderer,Oe as overlayRenderOccludedFlag};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{lerp as t}from"../../../core/mathUtils.js";import{isSome as e}from"../../../core/maybe.js";import{c as n}from"../../../chunks/vec3f64.js";import{s as o}from"../../../chunks/vec4.js";import{c as r}from"../../../chunks/vec4f64.js";import{empty as s}from"../../../geometry/support/aaBoundingBox.js";import{earth as i}from"../../../geometry/support/Ellipsoid.js";import{BufferPool as c}from"../../../geometry/support/buffer/BufferPool.js";import{newLayout as u}from"../support/buffer/InterleavedLayout.js";import{sampleElevation as f}from"./ElevationData.js";import{PatchType as a}from"./interfaces.js";import{MAX_PATCH_TESSELATION as m,GEOMETRY_VERTEX_STRIDE as l}from"./TerrainConst.js";import{VertexAttribute as g}from"../webgl-engine/lib/basicInterfaces.js";import{computeNormal as p}from"../webgl-engine/materials/internal/MaterialUtil.js";const h=u().vec3f(g.POSITION).vec2f(g.UV0),d=new c((t=>h.createBuffer(t)),(t=>t.count));class S{constructor(){this.indices=null,this.vertexAttributes=null,this.boundingBox=s(),this.numSurfaceIndices=0,this.numSkirtIndices=0,this.numWithoutSkirtIndices=0,this.numVertsPerRow=0,this.skirtLength=0,this.uvOffsetAndScale=r()}}class y{constructor(t,e,n){this.values=t,this.numSurfaceIndices=e,this.numSkirtIndices=n}}function I(){d.clear(),x.clear()}function A(t){d.release(t.vertexAttributes),t.vertexAttributes=null,t.indices=null}const P=65536;function v(n,r,i,c,u,m,g,p){const h=u[0],S=u[1],y=u[2],I=u[3],A=.1*g.radius*(I-S),P=n.numVertsPerSide-1,v=n.numVertsPerSide*n.numVertsPerSide,M=4*P,x=m&&(p===a.HAS_SOUTH_POLE||p===a.HAS_BOTH_POLES),b=m&&(p===a.HAS_NORTH_POLE||p===a.HAS_BOTH_POLES),L=d.acquire(v+M),k=L.position.typedBuffer,B=L.uv0.typedBuffer,E=c.geometryInfo.boundingBox;s(E);const U=r[2]-r[0],D=r[3]-r[1],N=y-h,q=i[0],G=i[1],W=i[2];for(let t=0;t<=P;t++){const e=t/P,n=h+e*N;T[t]=Math.sin(n),H[t]=Math.cos(n),_[t]=e,R[t]=r[0]+e*U}let C=0;const F=n.samplerData,z=e(F)&&F.some((t=>e(t)))?(t,e)=>f(R[t],e,F):()=>0;for(let o=0;o<=P;o++){let n=o/P;const s=t(S,I,n),i=Math.cos(s),c=Math.sin(s);let u;m?(u=g.halfSemiMajorAxis*Math.log((1+c)/(1-c)),n=(u-r[1])/D):u=180*s/Math.PI;for(let t=0;t<=P;t++){const r=_[t],s=T[t],f=H[t],a=g.radius+z(t,u),m=f*i*a-q,p=s*i*a-G,h=c*a-W;w(m,p,h,E);const d=l*C;k[d+0]=m,k[d+1]=p,k[d+2]=h,B[d+0]=r,B[d+1]=n;const S=j(t,o,P);if(e(S)){const t=l*(v+S),e=x&&0===o?-1:b&&o===P?1:0,s=0===e?m:-q,i=0===e?p:-G,c=0===e?h:g.radius*e-W;k[t+0]=s,k[t+1]=i,k[t+2]=c,B[t+0]=0===e?O(r,n):r,B[t+1]=0===e?A:n,0!==e&&w(s,i,c,E)}++C}}c.geometryInfo.numVertsPerRow=n.numVertsPerSide,c.geometryInfo.vertexAttributes=L,c.geometryInfo.skirtLength=A,o(c.geometryInfo.uvOffsetAndScale,0,0,1,1),V(c.geometryInfo,n.numVertsPerSide,m?p:a.REGULAR,n.wireframe),c.intersectionData=null,c.skirtIntersectionData=null}function M(t,n,r,c,u,m){const g=n[0],p=n[1],h=n[2]-g,S=n[3]-p,y=t.clippingArea,I=e(y)?Math.max(0,(y[0]-n[0])/h):0,A=e(y)?Math.max(0,(y[1]-n[1])/S):0,P=e(y)?Math.min(1,(y[2]-n[0])/h):1,v=e(y)?Math.min(1,(y[3]-n[1])/S):1,M=P>I?1/(P-I):1,x=v>A?1/(v-A):1,b=-I*M,L=-A*x,k=h*c*.1,B=t.numVertsPerSide-1,E=t.numVertsPerSide*t.numVertsPerSide,T=4*B,H=d.acquire(E+T),_=H.position.typedBuffer,R=H.uv0.typedBuffer,U=m.geometryInfo.boundingBox;s(U);let D=0;const N=i.radius,q=t.samplerData,G=e(q)&&q.some((t=>e(t)))?(t,e)=>f(t,e,q):()=>0;for(let o=0;o<=B;o++){const t=o/B;let n=L+t*x,s=p+t*S;e(y)&&(s<y[1]?(s=y[1],n=0):s>y[3]&&(s=y[3],n=1));const i=s,f=(u?(Math.PI/2-2*Math.atan(Math.exp(-i/N)))*N:i*c)-r[1];for(let u=0;u<=B;u++){const t=u/B;let s=b+t*M,a=g+t*h;e(y)&&(a<y[0]?(a=y[0],s=0):a>y[2]&&(a=y[2],s=1));const m=G(a,i),p=a*c-r[0],d=m-r[2];w(p,f,d,U);const S=l*D;_[S+0]=p,_[S+1]=f,_[S+2]=d,R[S+0]=s,R[S+1]=n;const I=j(u,o,B);if(e(I)){const t=l*(E+I);_[t+0]=p,_[t+1]=f,_[t+2]=d,R[t+0]=O(s,n),R[t+1]=k}++D}}m.geometryInfo.numVertsPerRow=t.numVertsPerSide,m.geometryInfo.vertexAttributes=H,m.geometryInfo.skirtLength=k,o(m.geometryInfo.uvOffsetAndScale,I,A,P-I,v-A),V(m.geometryInfo,t.numVertsPerSide,a.REGULAR,t.wireframe),m.intersectionData=null,m.skirtIntersectionData=null}const x=new Map;function V(t,e,n,o){const r=n===a.HAS_NORTH_POLE||n===a.HAS_BOTH_POLES,s=e+(o?1024:0)+(r?2048:0);let i=x.get(s);i||(i=b(e,r,o),x.set(s,i)),t.indices=i.values,t.numSurfaceIndices=i.numSurfaceIndices,t.numSkirtIndices=i.numSkirtIndices,t.numWithoutSkirtIndices=t.numSurfaceIndices+(n===a.REGULAR?0:6*(e-1)*(o?2:1))}function b(t,n,o){const r=t-1,s=t*t,i=4*r;let c=2*s*3,u=6*i,f=6*(2*r+r-1);o&&(c*=2,u*=2,f*=2);const a=s+i>P?new Uint32Array(c+u):new Uint16Array(c+u);let m=0,l=0,g=c;for(let p=0;p<=r;p++){let t=0;n&&(t=0===p?f:p===r?-f:0),g+=t;for(let n=0;n<=r;n++){const t=j(n,p,r);if(e(t)){const e=L(n,p,r);if(0!==e){const r=m,i=s+t,c=s+(0===n&&1===p?0:t+1),u=m+e;o?(a[g++]=r,a[g++]=i,a[g++]=i,a[g++]=c,a[g++]=c,a[g++]=r,a[g++]=c,a[g++]=u,a[g++]=u,a[g++]=r,a[g++]=r,a[g++]=c):(a[g++]=r,a[g++]=i,a[g++]=c,a[g++]=c,a[g++]=u,a[g++]=r)}}if(++m,n<r&&p<r){const t=p*(r+1)+n,e=t+1,s=e+(r+1),i=s-1;o?(a[l++]=t,a[l++]=e,a[l++]=e,a[l++]=s,a[l++]=s,a[l++]=t,a[l++]=s,a[l++]=i,a[l++]=i,a[l++]=t,a[l++]=t,a[l++]=s):(a[l++]=t,a[l++]=e,a[l++]=s,a[l++]=s,a[l++]=i,a[l++]=t)}}g-=t}return new y(a,c,u)}function w(t,e,n,o){t<o[0]&&(o[0]=t),t>o[3]&&(o[3]=t),e<o[1]&&(o[1]=e),e>o[4]&&(o[4]=e),n<o[2]&&(o[2]=n),n>o[5]&&(o[5]=n)}function O(t,e){const n=e>t?1:0;return 2+4*n+(1-2*n)*(t+e)}function j(t,e,n){return 0===e?t:t===n?n+e:e===n?3*n-t:0===t&&e>0?4*n-e:null}function L(t,e,n){return 0===e&&t!==n?1:t===n&&e!==n?n+1:e===n&&0!==t?-1:0===t&&0!==e?-(n+1):0}function k(t,n,o,r,s,i,c,u,f,a){const m=i.position,l=i.uv0,g=t[0],h=t[1],d=t[2],S=n[0]-g,y=n[1]-h,I=n[2]-d;r*=3;for(let A=o*=3;A<r;A+=3){const t=s[A],n=s[A+1],o=s[A+2];let r=m.get(t,0),i=m.get(t,1),P=m.get(t,2),v=m.get(n,0),M=m.get(n,1),x=m.get(n,2),V=m.get(o,0),b=m.get(o,1),w=m.get(o,2);if(l.get(t,0)>=2){const t=r+u[0],e=i+u[1],n=P+u[2],o=c/Math.sqrt(t*t+e*e+n*n);r+=t*o,i+=e*o,P+=n*o}if(l.get(n,0)>=2){const t=v+u[0],e=M+u[1],n=x+u[2],o=c/Math.sqrt(t*t+e*e+n*n);v+=t*o,M+=e*o,x+=n*o}if(l.get(o,0)>=2){const t=V+u[0],e=b+u[1],n=w+u[2],o=c/Math.sqrt(t*t+e*e+n*n);V+=t*o,b+=e*o,w+=n*o}e(f)&&([r,i,P]=f.applyToVertex(r,i,P),[v,M,x]=f.applyToVertex(v,M,x),[V,b,w]=f.applyToVertex(V,b,w));const O=v-r,j=M-i,L=x-P,k=V-r,B=b-i,E=w-P,T=y*E-B*I,H=I*k-E*S,_=S*B-k*y,R=O*T+j*H+L*_;if(Math.abs(R)<=Number.EPSILON)continue;const D=g-r,N=h-i,q=d-P,G=D*T+N*H+q*_;if(R>0){if(G<0||G>R)continue}else if(G>0||G<R)continue;const W=N*L-j*q,C=q*O-L*D,F=D*j-O*N,z=S*W+y*C+I*F;if(R>0){if(z<0||G+z>R)continue}else if(z>0||G+z<R)continue;const J=(k*W+B*C+E*F)/R;if(J>=0){a(J,p(O,j,L,k,B,E,U))}}}function B(t,e,n,o,r,s){const i=o.position,c=o.uv0,u=new Map,f=3*e,a=3*n-f,m=new Uint32Array(a);let l=0;for(let p=0;p<a;++p){const e=t[p+f];if(u.has(e))m[p]=u.get(e);else{const t=l++;u.set(e,t),m[p]=t}}const g=new Float64Array(3*l);return u.forEach(((t,e)=>{let n=i.get(e,0),o=i.get(e,1),u=i.get(e,2);if(c.get(e,0)>=2){const t=n+s[0],e=o+s[1],i=u+s[2],c=r/Math.sqrt(t*t+e*e+i*i);n+=t*c,o+=e*c,u+=i*c}g[3*t+0]=n,g[3*t+1]=o,g[3*t+2]=u})),{vertices:g,indices:m}}function E(t,n,o,r,s,i,c,u,f){const a=i.position,m=i.uv0,l=t[0],g=t[1],h=t[2],d=n[0]-l,S=n[1]-g,y=n[2]-h;r*=3;for(let I=o*=3;I<r;I+=3){const t=s[I],n=s[I+1],o=s[I+2];let r=a.get(t,0),i=a.get(t,1),A=a.get(t,2),P=a.get(n,0),v=a.get(n,1),M=a.get(n,2),x=a.get(o,0),V=a.get(o,1),b=a.get(o,2);m.get(t,0)>=2&&(A+=c);m.get(n,0)>=2&&(M+=c);m.get(o,0)>=2&&(b+=c),e(u)&&([r,i,A]=u.applyToVertex(r,i,A),[P,v,M]=u.applyToVertex(P,v,M),[x,V,b]=u.applyToVertex(x,V,b));const w=P-r,O=v-i,j=M-A,L=x-r,k=V-i,B=b-A,E=S*B-k*y,T=y*L-B*d,H=d*k-L*S,_=w*E+O*T+j*H;if(Math.abs(_)<=Number.EPSILON)continue;const R=l-r,D=g-i,N=h-A,q=R*E+D*T+N*H;if(_>0){if(q<0||q>_)continue}else if(q>0||q<_)continue;const G=D*j-O*N,W=N*w-j*R,C=R*O-w*D,F=d*G+S*W+y*C;if(_>0){if(F<0||q+F>_)continue}else if(F>0||q+F<_)continue;const z=(L*G+k*W+B*C)/_;if(z>=0){f(z,p(w,O,j,L,k,B,U))}}}const T=new Array(m+1),H=new Array(m+1),_=new Array(m+1),R=new Array(m+1),U=n();export{S as PatchGeometry,I as clearCaches,M as createPlanarGlobePatch,v as createSphericalGlobePatch,B as getGlobalSkirtGeometry,k as intersectSkirtsGlobal,E as intersectSkirtsLocal,A as releaseGeometry};
5
+ import{lerp as t}from"../../../core/mathUtils.js";import{isSome as e}from"../../../core/maybe.js";import{c as n}from"../../../chunks/vec3f64.js";import{s as o}from"../../../chunks/vec4.js";import{c as r}from"../../../chunks/vec4f64.js";import{empty as s}from"../../../geometry/support/aaBoundingBox.js";import{earth as i}from"../../../geometry/support/Ellipsoid.js";import{BufferPool as c}from"../../../geometry/support/buffer/BufferPool.js";import{newLayout as u}from"../support/buffer/InterleavedLayout.js";import{sampleElevation as f}from"./ElevationData.js";import{PatchType as a}from"./interfaces.js";import{MAX_PATCH_TESSELATION as m,GEOMETRY_VERTEX_STRIDE as l}from"./TerrainConst.js";import{VertexAttribute as g}from"../webgl-engine/lib/VertexAttribute.js";import{computeNormal as p}from"../webgl-engine/materials/internal/MaterialUtil.js";const h=u().vec3f(g.POSITION).vec2f(g.UV0),d=new c((t=>h.createBuffer(t)),(t=>t.count));class S{constructor(){this.indices=null,this.vertexAttributes=null,this.boundingBox=s(),this.numSurfaceIndices=0,this.numSkirtIndices=0,this.numWithoutSkirtIndices=0,this.numVertsPerRow=0,this.skirtLength=0,this.uvOffsetAndScale=r()}}class y{constructor(t,e,n){this.values=t,this.numSurfaceIndices=e,this.numSkirtIndices=n}}function I(){d.clear(),x.clear()}function A(t){d.release(t.vertexAttributes),t.vertexAttributes=null,t.indices=null}const P=65536;function v(n,r,i,c,u,m,g,p){const h=u[0],S=u[1],y=u[2],I=u[3],A=.1*g.radius*(I-S),P=n.numVertsPerSide-1,v=n.numVertsPerSide*n.numVertsPerSide,M=4*P,x=m&&(p===a.HAS_SOUTH_POLE||p===a.HAS_BOTH_POLES),b=m&&(p===a.HAS_NORTH_POLE||p===a.HAS_BOTH_POLES),L=d.acquire(v+M),k=L.position.typedBuffer,B=L.uv0.typedBuffer,E=c.geometryInfo.boundingBox;s(E);const U=r[2]-r[0],D=r[3]-r[1],N=y-h,q=i[0],G=i[1],W=i[2];for(let t=0;t<=P;t++){const e=t/P,n=h+e*N;T[t]=Math.sin(n),H[t]=Math.cos(n),_[t]=e,R[t]=r[0]+e*U}let C=0;const F=n.samplerData,z=e(F)&&F.some((t=>e(t)))?(t,e)=>f(R[t],e,F):()=>0;for(let o=0;o<=P;o++){let n=o/P;const s=t(S,I,n),i=Math.cos(s),c=Math.sin(s);let u;m?(u=g.halfSemiMajorAxis*Math.log((1+c)/(1-c)),n=(u-r[1])/D):u=180*s/Math.PI;for(let t=0;t<=P;t++){const r=_[t],s=T[t],f=H[t],a=g.radius+z(t,u),m=f*i*a-q,p=s*i*a-G,h=c*a-W;w(m,p,h,E);const d=l*C;k[d+0]=m,k[d+1]=p,k[d+2]=h,B[d+0]=r,B[d+1]=n;const S=j(t,o,P);if(e(S)){const t=l*(v+S),e=x&&0===o?-1:b&&o===P?1:0,s=0===e?m:-q,i=0===e?p:-G,c=0===e?h:g.radius*e-W;k[t+0]=s,k[t+1]=i,k[t+2]=c,B[t+0]=0===e?O(r,n):r,B[t+1]=0===e?A:n,0!==e&&w(s,i,c,E)}++C}}c.geometryInfo.numVertsPerRow=n.numVertsPerSide,c.geometryInfo.vertexAttributes=L,c.geometryInfo.skirtLength=A,o(c.geometryInfo.uvOffsetAndScale,0,0,1,1),V(c.geometryInfo,n.numVertsPerSide,m?p:a.REGULAR,n.wireframe),c.intersectionData=null,c.skirtIntersectionData=null}function M(t,n,r,c,u,m){const g=n[0],p=n[1],h=n[2]-g,S=n[3]-p,y=t.clippingArea,I=e(y)?Math.max(0,(y[0]-n[0])/h):0,A=e(y)?Math.max(0,(y[1]-n[1])/S):0,P=e(y)?Math.min(1,(y[2]-n[0])/h):1,v=e(y)?Math.min(1,(y[3]-n[1])/S):1,M=P>I?1/(P-I):1,x=v>A?1/(v-A):1,b=-I*M,L=-A*x,k=h*c*.1,B=t.numVertsPerSide-1,E=t.numVertsPerSide*t.numVertsPerSide,T=4*B,H=d.acquire(E+T),_=H.position.typedBuffer,R=H.uv0.typedBuffer,U=m.geometryInfo.boundingBox;s(U);let D=0;const N=i.radius,q=t.samplerData,G=e(q)&&q.some((t=>e(t)))?(t,e)=>f(t,e,q):()=>0;for(let o=0;o<=B;o++){const t=o/B;let n=L+t*x,s=p+t*S;e(y)&&(s<y[1]?(s=y[1],n=0):s>y[3]&&(s=y[3],n=1));const i=s,f=(u?(Math.PI/2-2*Math.atan(Math.exp(-i/N)))*N:i*c)-r[1];for(let u=0;u<=B;u++){const t=u/B;let s=b+t*M,a=g+t*h;e(y)&&(a<y[0]?(a=y[0],s=0):a>y[2]&&(a=y[2],s=1));const m=G(a,i),p=a*c-r[0],d=m-r[2];w(p,f,d,U);const S=l*D;_[S+0]=p,_[S+1]=f,_[S+2]=d,R[S+0]=s,R[S+1]=n;const I=j(u,o,B);if(e(I)){const t=l*(E+I);_[t+0]=p,_[t+1]=f,_[t+2]=d,R[t+0]=O(s,n),R[t+1]=k}++D}}m.geometryInfo.numVertsPerRow=t.numVertsPerSide,m.geometryInfo.vertexAttributes=H,m.geometryInfo.skirtLength=k,o(m.geometryInfo.uvOffsetAndScale,I,A,P-I,v-A),V(m.geometryInfo,t.numVertsPerSide,a.REGULAR,t.wireframe),m.intersectionData=null,m.skirtIntersectionData=null}const x=new Map;function V(t,e,n,o){const r=n===a.HAS_NORTH_POLE||n===a.HAS_BOTH_POLES,s=e+(o?1024:0)+(r?2048:0);let i=x.get(s);i||(i=b(e,r,o),x.set(s,i)),t.indices=i.values,t.numSurfaceIndices=i.numSurfaceIndices,t.numSkirtIndices=i.numSkirtIndices,t.numWithoutSkirtIndices=t.numSurfaceIndices+(n===a.REGULAR?0:6*(e-1)*(o?2:1))}function b(t,n,o){const r=t-1,s=t*t,i=4*r;let c=2*s*3,u=6*i,f=6*(2*r+r-1);o&&(c*=2,u*=2,f*=2);const a=s+i>P?new Uint32Array(c+u):new Uint16Array(c+u);let m=0,l=0,g=c;for(let p=0;p<=r;p++){let t=0;n&&(t=0===p?f:p===r?-f:0),g+=t;for(let n=0;n<=r;n++){const t=j(n,p,r);if(e(t)){const e=L(n,p,r);if(0!==e){const r=m,i=s+t,c=s+(0===n&&1===p?0:t+1),u=m+e;o?(a[g++]=r,a[g++]=i,a[g++]=i,a[g++]=c,a[g++]=c,a[g++]=r,a[g++]=c,a[g++]=u,a[g++]=u,a[g++]=r,a[g++]=r,a[g++]=c):(a[g++]=r,a[g++]=i,a[g++]=c,a[g++]=c,a[g++]=u,a[g++]=r)}}if(++m,n<r&&p<r){const t=p*(r+1)+n,e=t+1,s=e+(r+1),i=s-1;o?(a[l++]=t,a[l++]=e,a[l++]=e,a[l++]=s,a[l++]=s,a[l++]=t,a[l++]=s,a[l++]=i,a[l++]=i,a[l++]=t,a[l++]=t,a[l++]=s):(a[l++]=t,a[l++]=e,a[l++]=s,a[l++]=s,a[l++]=i,a[l++]=t)}}g-=t}return new y(a,c,u)}function w(t,e,n,o){t<o[0]&&(o[0]=t),t>o[3]&&(o[3]=t),e<o[1]&&(o[1]=e),e>o[4]&&(o[4]=e),n<o[2]&&(o[2]=n),n>o[5]&&(o[5]=n)}function O(t,e){const n=e>t?1:0;return 2+4*n+(1-2*n)*(t+e)}function j(t,e,n){return 0===e?t:t===n?n+e:e===n?3*n-t:0===t&&e>0?4*n-e:null}function L(t,e,n){return 0===e&&t!==n?1:t===n&&e!==n?n+1:e===n&&0!==t?-1:0===t&&0!==e?-(n+1):0}function k(t,n,o,r,s,i,c,u,f,a){const m=i.position,l=i.uv0,g=t[0],h=t[1],d=t[2],S=n[0]-g,y=n[1]-h,I=n[2]-d;r*=3;for(let A=o*=3;A<r;A+=3){const t=s[A],n=s[A+1],o=s[A+2];let r=m.get(t,0),i=m.get(t,1),P=m.get(t,2),v=m.get(n,0),M=m.get(n,1),x=m.get(n,2),V=m.get(o,0),b=m.get(o,1),w=m.get(o,2);if(l.get(t,0)>=2){const t=r+u[0],e=i+u[1],n=P+u[2],o=c/Math.sqrt(t*t+e*e+n*n);r+=t*o,i+=e*o,P+=n*o}if(l.get(n,0)>=2){const t=v+u[0],e=M+u[1],n=x+u[2],o=c/Math.sqrt(t*t+e*e+n*n);v+=t*o,M+=e*o,x+=n*o}if(l.get(o,0)>=2){const t=V+u[0],e=b+u[1],n=w+u[2],o=c/Math.sqrt(t*t+e*e+n*n);V+=t*o,b+=e*o,w+=n*o}e(f)&&([r,i,P]=f.applyToVertex(r,i,P),[v,M,x]=f.applyToVertex(v,M,x),[V,b,w]=f.applyToVertex(V,b,w));const O=v-r,j=M-i,L=x-P,k=V-r,B=b-i,E=w-P,T=y*E-B*I,H=I*k-E*S,_=S*B-k*y,R=O*T+j*H+L*_;if(Math.abs(R)<=Number.EPSILON)continue;const D=g-r,N=h-i,q=d-P,G=D*T+N*H+q*_;if(R>0){if(G<0||G>R)continue}else if(G>0||G<R)continue;const W=N*L-j*q,C=q*O-L*D,F=D*j-O*N,z=S*W+y*C+I*F;if(R>0){if(z<0||G+z>R)continue}else if(z>0||G+z<R)continue;const J=(k*W+B*C+E*F)/R;if(J>=0){a(J,p(O,j,L,k,B,E,U))}}}function B(t,e,n,o,r,s){const i=o.position,c=o.uv0,u=new Map,f=3*e,a=3*n-f,m=new Uint32Array(a);let l=0;for(let p=0;p<a;++p){const e=t[p+f];if(u.has(e))m[p]=u.get(e);else{const t=l++;u.set(e,t),m[p]=t}}const g=new Float64Array(3*l);return u.forEach(((t,e)=>{let n=i.get(e,0),o=i.get(e,1),u=i.get(e,2);if(c.get(e,0)>=2){const t=n+s[0],e=o+s[1],i=u+s[2],c=r/Math.sqrt(t*t+e*e+i*i);n+=t*c,o+=e*c,u+=i*c}g[3*t+0]=n,g[3*t+1]=o,g[3*t+2]=u})),{vertices:g,indices:m}}function E(t,n,o,r,s,i,c,u,f){const a=i.position,m=i.uv0,l=t[0],g=t[1],h=t[2],d=n[0]-l,S=n[1]-g,y=n[2]-h;r*=3;for(let I=o*=3;I<r;I+=3){const t=s[I],n=s[I+1],o=s[I+2];let r=a.get(t,0),i=a.get(t,1),A=a.get(t,2),P=a.get(n,0),v=a.get(n,1),M=a.get(n,2),x=a.get(o,0),V=a.get(o,1),b=a.get(o,2);m.get(t,0)>=2&&(A+=c);m.get(n,0)>=2&&(M+=c);m.get(o,0)>=2&&(b+=c),e(u)&&([r,i,A]=u.applyToVertex(r,i,A),[P,v,M]=u.applyToVertex(P,v,M),[x,V,b]=u.applyToVertex(x,V,b));const w=P-r,O=v-i,j=M-A,L=x-r,k=V-i,B=b-A,E=S*B-k*y,T=y*L-B*d,H=d*k-L*S,_=w*E+O*T+j*H;if(Math.abs(_)<=Number.EPSILON)continue;const R=l-r,D=g-i,N=h-A,q=R*E+D*T+N*H;if(_>0){if(q<0||q>_)continue}else if(q>0||q<_)continue;const G=D*j-O*N,W=N*w-j*R,C=R*O-w*D,F=d*G+S*W+y*C;if(_>0){if(F<0||q+F>_)continue}else if(F>0||q+F<_)continue;const z=(L*G+k*W+B*C)/_;if(z>=0){f(z,p(w,O,j,L,k,B,U))}}}const T=new Array(m+1),H=new Array(m+1),_=new Array(m+1),R=new Array(m+1),U=n();export{S as PatchGeometry,I as clearCaches,M as createPlanarGlobePatch,v as createSphericalGlobePatch,B as getGlobalSkirtGeometry,k as intersectSkirtsGlobal,E as intersectSkirtsLocal,A as releaseGeometry};