@arcgis/core 4.33.0-next.20250318 → 4.33.0-next.20250320

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 (179) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0b7331613f91a3258352.js +1 -0
  3. package/assets/esri/core/workers/chunks/2219d970ece5676ca6ee.js +1 -0
  4. package/assets/esri/core/workers/chunks/3fc18638f8799b85001d.js +1 -0
  5. package/assets/esri/core/workers/chunks/630a9afdf0523c27ddb6.js +1 -0
  6. package/assets/esri/core/workers/chunks/657ae4a0461d45044b28.js +1 -0
  7. package/assets/esri/core/workers/chunks/8063e35dacf8f99471d8.js +1 -0
  8. package/assets/esri/core/workers/chunks/{e26e8feabf863350af20.js → 9e11307b4cc3b523d178.js} +66 -73
  9. package/assets/esri/core/workers/chunks/b23d16745674486ddd6c.js +1 -0
  10. package/assets/esri/core/workers/chunks/bfbb118ae3b4a4ce1c74.js +319 -0
  11. package/assets/esri/core/workers/chunks/c528a2ca3b1b73df5a5d.js +1 -0
  12. package/assets/esri/core/workers/chunks/d787474e78360c925fd9.js +1 -0
  13. package/assets/esri/core/workers/chunks/{7ded83eb64eff069b761.js → d8b903b4147b090576f2.js} +1 -1
  14. package/assets/esri/core/workers/chunks/e4290719c8afc2a4ee8c.js +1 -0
  15. package/assets/esri/core/workers/chunks/e5e1f8ac53c70427a60b.js +1 -0
  16. package/assets/esri/core/workers/chunks/fc9758006a7135c7d9c3.js +1 -0
  17. package/assets/esri/core/workers/chunks/fef46b841e8369b30227.js +1 -0
  18. package/assets/esri/libs/dxtEncoder/dxt_encoder.wasm +0 -0
  19. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +20 -0
  20. package/assets/esri/themes/dark/main.css +1 -1
  21. package/assets/esri/themes/light/main.css +1 -1
  22. package/assets/esri/themes/light/view.css +1 -1
  23. package/chunks/HUDMaterial.glsl.js +80 -75
  24. package/chunks/RibbonLine.glsl.js +37 -37
  25. package/chunks/ShadowHighlight.glsl.js +2 -2
  26. package/chunks/Terrain.glsl.js +33 -34
  27. package/copyright.txt +29 -0
  28. package/core/typedArrayUtil.js +1 -1
  29. package/geometry/support/HalfFloatArray.js +5 -0
  30. package/geometry/support/buffer/BufferView.js +1 -1
  31. package/geometry/support/buffer/types.js +1 -1
  32. package/interfaces.d.ts +8 -47
  33. package/layers/VoxelWasmPerSceneView.js +1 -1
  34. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  35. package/package.json +3 -2
  36. package/renderers/support/RasterSymbolizer.js +1 -1
  37. package/support/basemapUtils.js +1 -1
  38. package/support/revision.js +1 -1
  39. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  40. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  41. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  42. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  43. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  44. package/views/3d/layers/BuildingSublayerView3D.js +1 -1
  45. package/views/3d/layers/I3SMeshView3D.js +1 -1
  46. package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
  47. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  48. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  49. package/views/3d/layers/MediaLayerView3D.js +1 -1
  50. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  51. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  52. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  53. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  54. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  55. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  56. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  57. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  58. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  59. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  60. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  61. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  62. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  63. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  64. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  65. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  66. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  67. package/views/3d/layers/graphics/Labeler.js +1 -1
  68. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  69. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  70. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  71. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  72. package/views/3d/layers/graphics/pointUtils.js +1 -1
  73. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  74. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  75. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  76. package/views/3d/layers/i3s/Intersector.js +1 -1
  77. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  78. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  79. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  80. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  81. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  82. package/views/3d/support/buffer/glUtil.js +1 -1
  83. package/views/3d/support/hitTest.js +1 -1
  84. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  85. package/views/3d/terrain/PatchGeometry.js +1 -1
  86. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  87. package/views/3d/terrain/TerrainAttributes.js +1 -1
  88. package/views/3d/terrain/TerrainRenderer.js +1 -1
  89. package/views/3d/terrain/TerrainSurface.js +1 -1
  90. package/views/3d/webgl/ManagedColorAttachment.js +1 -1
  91. package/views/3d/webgl/ManagedDepthAttachment.js +1 -1
  92. package/views/3d/webgl/ManagedFBO.js +1 -1
  93. package/views/3d/webgl/ManagedFBOAttachment.js +1 -1
  94. package/views/3d/webgl/{ManagedFBObject.js → ManagedFBOResource.js} +1 -1
  95. package/views/3d/webgl/formats.js +1 -1
  96. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  97. package/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js +1 -1
  98. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +2 -9
  99. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
  100. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
  101. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  102. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  103. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  104. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  105. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  106. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  107. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  108. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  109. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  110. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  111. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  112. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  113. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  114. package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
  115. package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
  116. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  117. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  118. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  119. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  120. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  121. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  122. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  123. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  124. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  125. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  126. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  127. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  128. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  129. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  130. package/views/3d/webgl-engine/lib/lodRendering/Intersector.js +1 -1
  131. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  132. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  133. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  134. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  135. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  136. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  137. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  138. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  139. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  140. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  141. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  142. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  143. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  144. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  145. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  146. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  147. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  148. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  149. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  150. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  151. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  152. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  153. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  154. package/views/3d/webgl.js +1 -1
  155. package/views/SceneView.js +1 -1
  156. package/views/webgl/FramebufferObject.js +1 -1
  157. package/views/webgl/GLObjectType.js +1 -1
  158. package/views/webgl/Renderbuffer.js +1 -1
  159. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  160. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  161. package/widgets/Editor/UpdateWorkflow.js +1 -1
  162. package/widgets/Editor.js +1 -1
  163. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  164. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  165. package/widgets/support/LabeledSwitch.js +1 -1
  166. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  167. package/assets/esri/core/workers/chunks/048121d433aa9175348c.js +0 -1
  168. package/assets/esri/core/workers/chunks/0f4a2bdf5bb2f4303b7f.js +0 -1
  169. package/assets/esri/core/workers/chunks/147e412de9972da16a1d.js +0 -1
  170. package/assets/esri/core/workers/chunks/1545bd7d6ac7800c71b6.js +0 -1
  171. package/assets/esri/core/workers/chunks/2b21152c7e2d9c170ed7.js +0 -1
  172. package/assets/esri/core/workers/chunks/385dd6466fd967ce3ae9.js +0 -1
  173. package/assets/esri/core/workers/chunks/534f3d7e4300b662191a.js +0 -1
  174. package/assets/esri/core/workers/chunks/8d636075e5aa053940fc.js +0 -1
  175. package/assets/esri/core/workers/chunks/c43c273725b1a33712ec.js +0 -314
  176. package/assets/esri/core/workers/chunks/c8cd9a3175f516624842.js +0 -1
  177. package/assets/esri/core/workers/chunks/d630e64463687090db92.js +0 -1
  178. package/assets/esri/core/workers/chunks/dd6f18bbab50be139d20.js +0 -1
  179. package/assets/esri/core/workers/chunks/de6864e120243cf0bee8.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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{RenderCategory as o,InternalRenderCategory as t}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{FocusAreaColorTechnique as c}from"./FocusAreaColorTechnique.js";import{F as a}from"../../../../../chunks/FocusAreaColor.glsl.js";import{FramebufferBit as n,DepthStencilAttachment as p}from"../../../../webgl/enums.js";let m=class extends i{constructor(e){super({...e,view:e.focusAreas.view}),this.consumes={required:[o.COMPOSITE,t.FOCUSAREA]},this.produces=o.COMPOSITE,this._passParameters=new a}precompile(){this.techniques.precompile(c)}render(e){const r=this.techniques.get(c),s=e.find((({name:e})=>e===o.COMPOSITE));if(!r.compiled)return this.requestRender(),s;const i=this.bindParameters,a=i.camera,m=a.fullViewport[2],u=a.fullViewport[3],h=e.find((({name:e})=>e===t.FOCUSAREA)),d=this.fboCache.acquire(m,u,this.produces),l=this.renderingContext;return l.clear(n.STENCIL),l.bindFramebuffer(d.fbo),this._passParameters.color=s.getTexture(),this._passParameters.focusArea=h.getTexture(),this._passParameters.effect=f[this.focusAreas.style],l.bindTechnique(r,i,this._passParameters),l.screen.draw(),d.attachDepth(s.getAttachment(p)),d}};var u;e([r()],m.prototype,"consumes",void 0),e([r()],m.prototype,"produces",void 0),e([r({constructOnly:!0})],m.prototype,"focusAreas",void 0),m=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaColorNode")],m),function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(u||(u={}));const f={none:u.NONE,bright:u.BRIGHT,dark:u.DARK};export{m as FocusAreaColorNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as o}from"../../../webgl.js";import t from"../../../webgl/RenderNode.js";import{FocusAreaColorTechnique as i}from"./FocusAreaColorTechnique.js";import{F as c}from"../../../../../chunks/FocusAreaColor.glsl.js";import{FramebufferBit as a,DepthStencilAttachment as p}from"../../../../webgl/enums.js";let n=class extends t{constructor(e){super({...e,view:e.focusAreas.view}),this.consumes={required:[o.FOCUSAREA_COLOR,o.FOCUSAREA]},this.produces=o.FOCUSAREA_COLOR,this._passParameters=new c}precompile(){this.techniques.precompile(i)}render(e){const r=this.techniques.get(i),s=e.find((({name:e})=>e===this.produces));if(!r.compiled)return this.requestRender(),s;const t=this.bindParameters,c=t.camera,n=c.fullViewport[2],u=c.fullViewport[3],h=e.find((({name:e})=>e===o.FOCUSAREA)),d=this.fboCache.acquire(n,u,this.produces),f=this.renderingContext;return f.clear(a.STENCIL),f.bindFramebuffer(d.fbo),this._passParameters.color=s.getTexture(),this._passParameters.focusArea=h.getTexture(),this._passParameters.effect=m[this.focusAreas.style],f.bindTechnique(r,t,this._passParameters),f.screen.draw(),d.attachDepth(s.getAttachment(p)),d}};var u;e([r()],n.prototype,"consumes",void 0),e([r()],n.prototype,"produces",void 0),e([r({constructOnly:!0})],n.prototype,"focusAreas",void 0),n=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaColorNode")],n),function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(u||(u={}));const m={none:u.NONE,bright:u.BRIGHT,dark:u.DARK};export{n as FocusAreaColorNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as r,RenderCategory as o}from"../../../webgl.js";import{ColorFormat as i}from"../../../webgl/formats.js";import n from"../../../webgl/RenderNode.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{Default3D as c}from"../../lib/DefaultVertexAttributeLocations.js";import{Pos3 as h}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as p}from"../../lib/VertexArrayObject.js";import{F as u}from"../../../../../chunks/FocusAreaMask.glsl.js";import{BufferObject as l}from"../../../../webgl/BufferObject.js";import{DepthStencilAttachment as m,FramebufferBit as d,Face as f,StencilOperation as g,CompareFunction as A,PrimitiveType as E,Usage as b}from"../../../../webgl/enums.js";import{noParameters as w}from"../../../../webgl/NoParameters.js";let _=class extends n{constructor(e){super({...e,view:e.focusAreas.view}),this.consumes={required:[r.FOCUSAREA,o.TRANSPARENT]},this.produces=r.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new u}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(a)}render(e){const t=this.techniques.get(a),s=this.bindParameters,n=s.camera,c=n.fullViewport[2],h=n.fullViewport[3],p=this.fboCache.acquire(c,h,r.FOCUSAREA,i.RGBA);if(!t.compiled||!this._vaos)return this.requestRender(),p;const u=e.find((({name:e})=>e===o.TRANSPARENT)),l=this.renderingContext;p.attachDepth(u.getAttachment(m)),l.bindFramebuffer(p.fbo),l.clear(d.COLOR|d.STENCIL),l.setViewport(0,0,c,h),l.clear(d.STENCIL,0);const b=l.bindTechnique(t,s);l.setFaceCullingEnabled(!1),l.setStencilTestEnabled(!0),l.setStencilOpSeparate(f.FRONT,g.KEEP,g.INCR_WRAP,g.KEEP),l.setStencilOpSeparate(f.BACK,g.KEEP,g.DECR_WRAP,g.KEEP),l.setDepthWriteEnabled(!1);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],t=this._counts[r];this._maskParameters.origin=this._origins[r],b.bindDraw(s,w,this._maskParameters),l.bindVAO(e),l.setDepthTestEnabled(!0),l.setStencilWriteMask(255),l.setStencilFunction(A.ALWAYS,0,255),l.setColorMask(!1,!1,!1,!1),l.drawArrays(E.TRIANGLES,0,t),l.setDepthTestEnabled(!1),l.setStencilWriteMask(0),l.setStencilFunction(A.NOTEQUAL,0,255),l.setColorMask(!0,!0,!0,!0),l.drawArrays(E.TRIANGLES,0,t)}return p}updateGeometries(){if(!this.view.stage)return;this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0;const e=this.focusAreas.geometries;for(const t of e){const e=new Array,s=t.indicesBottom;for(let n=0;n<s.length;n++)e.push(t.positions[3*(s[n]-1)]),e.push(t.positions[3*(s[n]-1)+1]),e.push(t.positions[3*(s[n]-1)+2]);const r=t.indicesExtruded;for(let n=0;n<r.length;n++)e.push(t.positions[3*r[n]]),e.push(t.positions[3*r[n]+1]),e.push(t.positions[3*r[n]+2]);const o=new Float32Array(e),i=new p(this.renderingContext,c,new Map([["geometry",h]]),new Map([["geometry",l.createVertex(this.renderingContext,b.STATIC_DRAW,o)]]));this._vaos.push(i),this._counts.push(s.length+r.length),this._origins.push(t.origin)}this.requestRender()}};e([t()],_.prototype,"consumes",void 0),e([t()],_.prototype,"produces",void 0),e([t({constructOnly:!0})],_.prototype,"focusAreas",void 0),_=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaMaskNode")],_);class R{constructor(e,t,s,r,o,i){this.positions=e,this.indicesBottom=t,this.indicesExtruded=s,this.height=r,this.origin=o,this.color=i}}var S;!function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(S||(S={}));export{S as FocusAreaEffect,R as FocusAreaGeometry,_ as FocusAreaMaskNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as r,RenderCategory as o}from"../../../webgl.js";import{ColorFormat as i}from"../../../webgl/formats.js";import n from"../../../webgl/RenderNode.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{Default3D as c}from"../../lib/DefaultVertexAttributeLocations.js";import{Pos3 as h}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as p}from"../../lib/VertexArrayObject.js";import{F as u}from"../../../../../chunks/FocusAreaMask.glsl.js";import{BufferObject as l}from"../../../../webgl/BufferObject.js";import{DepthStencilAttachment as m,FramebufferBit as d,Face as f,StencilOperation as g,CompareFunction as A,PrimitiveType as E,Usage as b}from"../../../../webgl/enums.js";import{noParameters as w}from"../../../../webgl/NoParameters.js";let _=class extends n{constructor(e){super({...e,view:e.focusAreas.view}),this.consumes={required:[r.FOCUSAREA,o.TRANSPARENT]},this.produces=r.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new u}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(a)}render(e){const t=this.techniques.get(a),s=this.bindParameters,n=s.camera,c=n.fullViewport[2],h=n.fullViewport[3],p=this.fboCache.acquire(c,h,r.FOCUSAREA,i.RGBA8);if(!t.compiled||!this._vaos)return this.requestRender(),p;const u=e.find((({name:e})=>e===o.TRANSPARENT)),l=this.renderingContext;p.attachDepth(u.getAttachment(m)),l.bindFramebuffer(p.fbo),l.clear(d.COLOR|d.STENCIL),l.setViewport(0,0,c,h),l.clear(d.STENCIL,0);const b=l.bindTechnique(t,s);l.setFaceCullingEnabled(!1),l.setStencilTestEnabled(!0),l.setStencilOpSeparate(f.FRONT,g.KEEP,g.INCR_WRAP,g.KEEP),l.setStencilOpSeparate(f.BACK,g.KEEP,g.DECR_WRAP,g.KEEP),l.setDepthWriteEnabled(!1);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],t=this._counts[r];this._maskParameters.origin=this._origins[r],b.bindDraw(s,w,this._maskParameters),l.bindVAO(e),l.setDepthTestEnabled(!0),l.setStencilWriteMask(255),l.setStencilFunction(A.ALWAYS,0,255),l.setColorMask(!1,!1,!1,!1),l.drawArrays(E.TRIANGLES,0,t),l.setDepthTestEnabled(!1),l.setStencilWriteMask(0),l.setStencilFunction(A.NOTEQUAL,0,255),l.setColorMask(!0,!0,!0,!0),l.drawArrays(E.TRIANGLES,0,t)}return p}updateGeometries(){if(!this.view.stage)return;this._vaos.forEach((e=>e.dispose())),this._vaos.length=this._counts.length=this._origins.length=0;const e=this.focusAreas.geometries;for(const t of e){const e=new Array,s=t.indicesBottom;for(let n=0;n<s.length;n++)e.push(t.positions[3*(s[n]-1)]),e.push(t.positions[3*(s[n]-1)+1]),e.push(t.positions[3*(s[n]-1)+2]);const r=t.indicesExtruded;for(let n=0;n<r.length;n++)e.push(t.positions[3*r[n]]),e.push(t.positions[3*r[n]+1]),e.push(t.positions[3*r[n]+2]);const o=new Float32Array(e),i=new p(this.renderingContext,c,new Map([["geometry",h]]),new Map([["geometry",l.createVertex(this.renderingContext,b.STATIC_DRAW,o)]]));this._vaos.push(i),this._counts.push(s.length+r.length),this._origins.push(t.origin)}this.requestRender()}};e([t()],_.prototype,"consumes",void 0),e([t()],_.prototype,"produces",void 0),e([t({constructOnly:!0})],_.prototype,"focusAreas",void 0),_=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaMaskNode")],_);class R{constructor(e,t,s,r,o,i){this.positions=e,this.indicesBottom=t,this.indicesExtruded=s,this.height=r,this.origin=o,this.color=i}}var S;!function(e){e[e.NONE=0]="NONE",e[e.BRIGHT=1]="BRIGHT",e[e.DARK=2]="DARK"}(S||(S={}));export{S as FocusAreaEffect,R as FocusAreaGeometry,_ as FocusAreaMaskNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import r from"../../../../../core/PooledArray.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as n}from"../../../webgl.js";import{DepthFormat as i}from"../../../webgl/formats.js";import c from"../../../webgl/RenderNode.js";import{Blit as l}from"../blit/Blit.js";import{StencilBits as a}from"../../lib/basicInterfaces.js";import{RenderOccludedFlag as d}from"../../lib/Material.js";import{RenderSlot as p}from"../../lib/RenderSlot.js";import{BlitMode as u}from"../../shaders/CompositingTechniqueConfiguration.js";import{DepthStencilAttachment as m}from"../../../../webgl/enums.js";let f=class extends c{constructor(e){super(e),this.consumes={required:[n.OCCLUDED]},this.produces=n.OCCLUDED,this._blit=new l(e.view.stage.renderView.techniques,u.PremultipliedAlpha)}precompile(){const e=this.view.stage.renderer;e.plugins.plugins.forAll((r=>{e.precompileSlots(r,p.OCCLUDED_TERRAIN,p.TRANSPARENT_OCCLUDER_MATERIAL),r.material&&e.precompileOccludedSlots(r,g)}))}render(e){const r=e.find((({name:e})=>e===this.produces)),t=this.view.stage.renderer;let s=0;if(h.clear(),t.plugins.plugins.forAll((e=>{if(!e.material)return;e.queryRenderOccludedState(d.OccludeAndTransparentStencil)&&(s|=d.OccludeAndTransparentStencil,h.push(e))})),h.length>0&&(t.renderSlots(h,p.OCCLUDER_MATERIAL),s&d.OccludeAndTransparentStencil&&this._renderAndComposite(r,.5,(()=>t.renderSlots(h,p.TRANSPARENT_OCCLUDER_MATERIAL)),!1,!1)),h.clear(),t.plugins.plugins.forAll((e=>{if(!e.material)return;const r=e.queryRenderOccludedState(d.OccludeAndTransparent),t=e.queryRenderOccludedState(d.Transparent),o=e.queryRenderOccludedState(d.Opaque);(r||t||o)&&(s|=r?d.OccludeAndTransparent:t?d.Transparent:d.Opaque,h.push(e))})),s|=t.plugins.renderOccludedFlags,!s)return r;for(const o of g)s&o&&this._renderAndComposite(r,o===d.Opaque?1:.5,(()=>t.renderOccludedSlots(h,o)),!0,a.OutlineVisualElementMask);return h.clear(),r}_renderAndComposite(e,r,t,s,n){const c=this.renderingContext,{width:l,height:a}=e.fbo,d=this.fboCache.acquire(l,a,"tmp color"),p=s?this.fboCache.acquireDepth(i.DEPTH_STENCIL_TEXTURE,l,a,"tmp depth"):e.getAttachment(m);d.attachDepth(p),c.bindFramebuffer(d.fbo),c.clearFramebuffer(o,s,n),t(),d.detachDepth(),this._blit.blend(c,d,e,this.bindParameters,r),s&&p.release(),d.release()}};e([t()],f.prototype,"consumes",void 0),e([t()],f.prototype,"produces",void 0),f=e([s("esri.views.3d.webgl-engine.effects.geometry.RenderOccludedRenderNode")],f);const h=new r,g=[d.OccludeAndTransparent,d.Transparent,d.Opaque];export{f as RenderOccludedRenderNode};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import r from"../../../../../core/PooledArray.js";import{property as t}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as n}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{Blit as c}from"../blit/Blit.js";import{StencilBits as l}from"../../lib/basicInterfaces.js";import{RenderOccludedFlag as a}from"../../lib/Material.js";import{RenderSlot as d}from"../../lib/RenderSlot.js";import{BlitMode as p}from"../../shaders/CompositingTechniqueConfiguration.js";import{DepthStencilAttachment as u}from"../../../../webgl/enums.js";let m=class extends i{constructor(e){super(e),this.consumes={required:[n.OCCLUDED]},this.produces=n.OCCLUDED,this._blit=new c(e.view.stage.renderView.techniques,p.PremultipliedAlpha)}precompile(){const e=this.view.stage.renderer;e.plugins.plugins.forAll((r=>{e.precompileSlots(r,d.OCCLUDED_TERRAIN,d.TRANSPARENT_OCCLUDER_MATERIAL),r.material&&e.precompileOccludedSlots(r,h)}))}render(e){const r=e.find((({name:e})=>e===this.produces)),t=this.view.stage.renderer;let s=0;if(f.clear(),t.plugins.plugins.forAll((e=>{if(!e.material)return;e.queryRenderOccludedState(a.OccludeAndTransparentStencil)&&(s|=a.OccludeAndTransparentStencil,f.push(e))})),f.length>0&&(t.renderSlots(f,d.OCCLUDER_MATERIAL),s&a.OccludeAndTransparentStencil&&this._renderAndComposite(r,.5,(()=>t.renderSlots(f,d.TRANSPARENT_OCCLUDER_MATERIAL)),!1,!1)),f.clear(),t.plugins.plugins.forAll((e=>{if(!e.material)return;const r=e.queryRenderOccludedState(a.OccludeAndTransparent),t=e.queryRenderOccludedState(a.Transparent),o=e.queryRenderOccludedState(a.Opaque);(r||t||o)&&(s|=r?a.OccludeAndTransparent:t?a.Transparent:a.Opaque,f.push(e))})),s|=t.plugins.renderOccludedFlags,!s)return r;for(const o of h)s&o&&this._renderAndComposite(r,o===a.Opaque?1:.5,(()=>t.renderOccludedSlots(f,o)),!0,l.OutlineVisualElementMask);return f.clear(),r}_renderAndComposite(e,r,t,s,n){const i=this.renderingContext,{width:c,height:l}=e.fbo,a=this.fboCache.acquire(c,l,"tmp color"),d=s?this.fboCache.acquireDepth(u,c,l,"tmp depth"):e.getAttachment(u);a.attachDepth(d),i.bindFramebuffer(a.fbo),i.clearFramebuffer(o,s,n),t(),a.detachDepth(),this._blit.blend(i,a,e,this.bindParameters,r),s&&d.release(),a.release()}};e([t()],m.prototype,"consumes",void 0),e([t()],m.prototype,"produces",void 0),m=e([s("esri.views.3d.webgl-engine.effects.geometry.RenderOccludedRenderNode")],m);const f=new r,h=[a.OccludeAndTransparent,a.Transparent,a.Opaque];export{m as RenderOccludedRenderNode};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{lerp as t,clamp as s,smoothstep as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{l as h,k as c}from"../../../../../chunks/vec32.js";import{s as p}from"../../../../../chunks/vec42.js";import{earth as u}from"../../../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as d}from"../../../webgl.js";import{ColorFormat as l}from"../../../webgl/formats.js";import{TransparentEnvironment as f}from"../TransparentEnvironment.js";import{H as _}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as g}from"./HazeCompositingTechnique.js";import{HazePassParameters as b,HazeTechnique as w}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as P}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as j,Layout as v}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as A}from"../../lib/textureUtils.js";import{DepthStencilAttachment as T,PrimitiveType as C}from"../../../../webgl/enums.js";let x=class extends f{constructor(e){super(e),this._compositingPassParameters=new _,this._passParameters=new b,this._hazeConfiguration=new P,this._vao=null,this.requireGeometryDepth=!0,this._oldAmount=1,this._newAmount=1,this._amount=this._newAmount;const t=e.view.stage.renderView.techniques;t.precompile(w,new P);const s=new P;s.reduced=!0,t.precompile(w,s),t.precompile(g)}initialize(){this.addHandles([o((()=>this.view.environment.atmosphereEnabled),(e=>e?this._enable():this._disable()),a),o((()=>this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1),(e=>this._fade(e)),a),o((()=>this.view.environment.weather.type),(e=>this._newAmount="rainy"===e?0:1),a),o((()=>this.view.stage.renderer?.fullResolutionAtmosphere),(e=>this._hazeConfiguration.reduced=!e),a)])}_fade(e){e>=1?(this._amount=this._newAmount,this._oldAmount=this._newAmount):this._amount=e<=0?this._oldAmount:t(this._oldAmount,this._newAmount,e)}destroy(){this._vao=i(this._vao)}render(e){const s=e.find((({name:e})=>e===d.TRANSPARENT_ENVIRONMENT));if(!this.bindParameters.mainDepth)return s;const r=this.renderingContext;this._vao??=j(r,v.Pos2Tex);const i=this.techniques.get(w,this._hazeConfiguration);if(!i.compiled)return s;const o=s.getAttachment(T);if(this._update(),!this._hazeConfiguration.reduced)return s.detachDepth(),r.bindFramebuffer(s.fbo),r.bindTechnique(i,this.bindParameters,this._passParameters),this._renderCommon(r),s.attachDepth(o),s;const a=this.techniques.get(g);if(!a.compiled)return s;const n=r.getViewport(),m=this.camera,c=h(m.eye)-u.radius;let p;const f=u.atmosphereHeight;if(c<f){const e=Math.min(1,Math.max(0,c/f));p=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(c-f)/(15*f)));p=t(.5,1,e)}const _=this.renderingContext.parameters.maxTextureSize,b=A(Math.round(p*m.fullViewport[2]),_),P=A(Math.round(p*m.fullViewport[3]),_);r.setViewport(0,0,b,P);const C=this.fboCache.acquire(b,P,"haze",l.RGBA);return r.bindFramebuffer(C.fbo),r.clearFramebuffer([0,0,0,1],!0,!0),r.bindTechnique(i,this.bindParameters,this._passParameters),this._renderCommon(r),r.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=C.getTexture(),s.detachDepth(),r.bindFramebuffer(s.fbo),r.bindTechnique(a,this.bindParameters,this._compositingPassParameters),r.screen.draw(),s.attachDepth(o),C.release(),s}_renderCommon(e){null!=this._vao&&(e.bindVAO(this._vao),e.drawArrays(C.TRIANGLE_STRIP,0,4))}_update(){const e=this.bindParameters.camera,i=c(e.eye),o=Math.sqrt(i),a=i-this._passParameters.radii[1]*this._passParameters.radii[1],n=s((o-this._passParameters.radii[0])/u.atmosphereHeight,0,1);p(this._passParameters.heightParameters,o,i,a,n);const h=this.view.basemapTerrain?.getLowerBoundRadius()??0;m(this._passParameters.radii,h,h+u.atmosphereHeight),this._passParameters.hazeStrength=t(t(.6,1,r(9500,10500,o-u.radius)),1,this._amount)}};x=e([n("esri.views.3d.webgl-engine.effects.haze.Haze")],x);export{x as Haze};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{lerp as t,clamp as s,smoothstep as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{l as h,k as c}from"../../../../../chunks/vec32.js";import{s as p}from"../../../../../chunks/vec42.js";import{earth as u}from"../../../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as d}from"../../../webgl.js";import{ColorFormat as l}from"../../../webgl/formats.js";import{TransparentEnvironment as f}from"../TransparentEnvironment.js";import{H as _}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as g}from"./HazeCompositingTechnique.js";import{HazePassParameters as b,HazeTechnique as w}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as P}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as j,Layout as v}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as A}from"../../lib/textureUtils.js";import{DepthStencilAttachment as T,PrimitiveType as C}from"../../../../webgl/enums.js";let x=class extends f{constructor(e){super(e),this._compositingPassParameters=new _,this._passParameters=new b,this._hazeConfiguration=new P,this._vao=null,this.requireGeometryDepth=!0,this._oldAmount=1,this._newAmount=1,this._amount=this._newAmount;const t=e.view.stage.renderView.techniques;t.precompile(w,new P);const s=new P;s.reduced=!0,t.precompile(w,s),t.precompile(g)}initialize(){this.addHandles([o((()=>this.view.environment.atmosphereEnabled),(e=>e?this._enable():this._disable()),a),o((()=>this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1),(e=>this._fade(e)),a),o((()=>this.view.environment.weather.type),(e=>this._newAmount="rainy"===e?0:1),a),o((()=>this.view.stage.renderer?.fullResolutionAtmosphere),(e=>this._hazeConfiguration.reduced=!e),a)])}_fade(e){e>=1?(this._amount=this._newAmount,this._oldAmount=this._newAmount):this._amount=e<=0?this._oldAmount:t(this._oldAmount,this._newAmount,e)}destroy(){this._vao=i(this._vao)}render(e){const s=e.find((({name:e})=>e===d.TRANSPARENT_ENVIRONMENT));if(!this.bindParameters.mainDepth)return s;const r=this.renderingContext;this._vao??=j(r,v.Pos2Tex);const i=this.techniques.get(w,this._hazeConfiguration);if(!i.compiled)return s;const o=s.getAttachment(T);if(this._update(),!this._hazeConfiguration.reduced)return s.detachDepth(),r.bindFramebuffer(s.fbo),r.bindTechnique(i,this.bindParameters,this._passParameters),this._renderCommon(r),s.attachDepth(o),s;const a=this.techniques.get(g);if(!a.compiled)return s;const n=r.getViewport(),m=this.camera,c=h(m.eye)-u.radius;let p;const f=u.atmosphereHeight;if(c<f){const e=Math.min(1,Math.max(0,c/f));p=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(c-f)/(15*f)));p=t(.5,1,e)}const _=this.renderingContext.parameters.maxTextureSize,b=A(Math.round(p*m.fullViewport[2]),_),P=A(Math.round(p*m.fullViewport[3]),_);r.setViewport(0,0,b,P);const C=this.fboCache.acquire(b,P,"haze",l.RGBA8);return r.bindFramebuffer(C.fbo),r.clearFramebuffer([0,0,0,1],!0,!0),r.bindTechnique(i,this.bindParameters,this._passParameters),this._renderCommon(r),r.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=C.getTexture(),s.detachDepth(),r.bindFramebuffer(s.fbo),r.bindTechnique(a,this.bindParameters,this._compositingPassParameters),r.screen.draw(),s.attachDepth(o),C.release(),s}_renderCommon(e){null!=this._vao&&(e.bindVAO(this._vao),e.drawArrays(C.TRIANGLE_STRIP,0,4))}_update(){const e=this.bindParameters.camera,i=c(e.eye),o=Math.sqrt(i),a=i-this._passParameters.radii[1]*this._passParameters.radii[1],n=s((o-this._passParameters.radii[0])/u.atmosphereHeight,0,1);p(this._passParameters.heightParameters,o,i,a,n);const h=this.view.basemapTerrain?.getLowerBoundRadius()??0;m(this._passParameters.radii,h,h+u.atmosphereHeight),this._passParameters.hazeStrength=t(t(.6,1,r(9500,10500,o-u.radius)),1,this._amount)}};x=e([n("esri.views.3d.webgl-engine.effects.haze.Haze")],x);export{x as Haze};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import{releaseMaybe as t,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import{ColorFormat as a}from"../../../webgl/formats.js";import g from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as c}from"./HighlightApplyTechnique.js";import{HighlightBlurTechnique as u}from"./HighlightBlurTechnique.js";import{HighlightDownsampleTechnique as m}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as p}from"./HighlightPassParameters.js";import{HighlightToSingleTechnique as d}from"./HighlightToSingleTechnique.js";import{RenderRequestType as f}from"../../lib/basicInterfaces.js";import{Default3D as b}from"../../lib/DefaultVertexAttributeLocations.js";import{NoVertex as T}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as w}from"../../lib/VertexArrayObject.js";import{H as x}from"../../../../../chunks/HighlightBlur.glsl.js";import{H as C,g as v}from"../../../../../chunks/HighlightDownsample.glsl.js";import{BufferObject as _}from"../../../../webgl/BufferObject.js";import{PixelFormat as j,TextureSamplingMode as H,FramebufferBit as P,Usage as R,TextureType as O,PrimitiveType as q,DataType as D}from"../../../../webgl/enums.js";import{Texture as I}from"../../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../../webgl/TextureDescriptor.js";let A=class extends g{constructor(){super(...arguments),this.produces=l.HIGHLIGHTS,this.consumes={required:[l.HIGHLIGHTS,"highlights"]},this._downsampleDrawParameters=new C,this._passParameters=new p,this._highlightBlurDrawParameters=new x,this._grid=new U}initialize(){this.addHandles([i((()=>this._updateOptionsTexture()),(()=>{}),s)])}destroy(){this._grid.coverage=t(this._grid.coverage),this._grid.vao=r(this._grid.vao),this._passParameters.highlightOptionsTexture=t(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new y(16,2);e.internalFormat=j.RGBA,e.samplingMode=H.NEAREST,this._passParameters.highlightOptionsTexture=new I(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(E(this.view.state.highlights)),this.requestRender(f.UPDATE)}precompile(){this.techniques.precompile(m),this.techniques.precompile(d),this.techniques.precompile(u),this.techniques.precompile(c)}render(e){const t=e.find((({name:e})=>e===l.HIGHLIGHTS)),{techniques:r,bindParameters:i,_passParameters:s,renderingContext:o}=this;if(!i.decorations)return t;const h=r.get(m);if(!h.compiled)return this.requestRender(f.UPDATE),t;const n=e.find((({name:e})=>"highlights"===e)).getTexture();s.highlightTexture=n;const a=()=>{this._gridUpdateResources(n);const e=this._gridComputeCoverage(h,n,i),{horizontalCellCount:t,verticalCellCount:r}=e;return s.horizontalCellCount=t,s.verticalCellCount=r,s.coverageTexture=e.coverage?.getTexture(),e},g=e=>{const t=e.verticalCellCount*e.horizontalCellCount;o.bindVAO(e.vao),o.drawElementsInstanced(q.TRIANGLES,6,D.UNSIGNED_BYTE,0,t)},{camera:c}=i,u=()=>{o.bindFramebuffer(t.fbo),o.setViewport4fv(c.fullViewport)};return this._renderHighlightPostprocess(n,a,g,u),s.highlightTexture=null,s.coverageTexture=null,t}_renderHighlightPostprocess(e,t,r,i){const{fboCache:s,techniques:o,bindParameters:h,_passParameters:l,renderingContext:g}=this,m=o.get(d),p=o.get(u),b=o.get(c);if(!b.compiled||!p.compiled||!m.compiled)return void this.requestRender(f.UPDATE);l.highlightTexture=e;const T=t(),{width:w,height:x}=e.descriptor;l.highlightTexture=e;const{camera:C}=h,{fullWidth:v,fullHeight:_,pixelRatio:j}=C,H=Math.ceil(v/j),R=Math.ceil(_/j),{_highlightBlurDrawParameters:O}=this,q=this.view.stage.renderView.renderer,{highlights:D}=h;for(let c=0;c<D.length;++c){const{name:e}=D[c];if(!q.hasHighlight(e))continue;l.highlightLevel=c,g.setClearColor(0,0,0,0);const t=s.acquire(w,x,"single highlight",a.RG);g.bindFramebuffer(t.fbo),g.setViewport(0,0,w,x),g.clear(P.COLOR),g.bindTechnique(m,h,l),r(T),O.blurInput=t.getTexture(),n(O.blurSize,1/H,0);const o=s.acquire(H,R,"single highlight blur h",a.RG);g.unbindTexture(o.fbo?.colorTexture),g.bindFramebuffer(o.fbo),g.setViewport(0,0,H,R),g.clear(P.COLOR),g.bindTechnique(p,h,l,O),r(T),t.release(),n(O.blurSize,0,1/R),l.highlightBlurTexture=o.getTexture(),i(),g.bindTechnique(b,h,l,O),r(T),o.release()}}_gridUpdateResources(e){const t=this._grid,{width:r,height:i}=e.descriptor;if(t.horizontalCellCount=Math.ceil(r/v),t.verticalCellCount=Math.ceil(i/v),t.vao)return;const s=this.renderingContext,o=_.createIndex(s,R.STATIC_DRAW,L);t.vao=new w(s,b,new Map([["geometry",T]]),new Map([["geometry",_.createVertex(s,R.STATIC_DRAW)]]),o)}_gridComputeCoverage(e,t,r){const i=this.renderingContext,s=this._grid,o=t.descriptor,h=Math.ceil(o.width/v),n=Math.ceil(o.height/v);this._downsampleDrawParameters.input=t;const{highlights:l}=r;s.coverage?.release();const g=this.fboCache.acquire(h,n,"highlight coverage",l.length>B?a.RG8UI:a.R8UI);return s.coverage=g,i.bindFramebuffer(g.fbo),i.bindTechnique(e,r,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,h,n),i.screen.draw(),s}get test(){}};e([o()],A.prototype,"produces",void 0),e([o()],A.prototype,"consumes",void 0),A=e([h("esri.views.3d.webgl-engine.effects.highlight.Highlight")],A);class U{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}function E(e){const t=new Uint8Array(128);let r=0;for(const i of e){const e=4*r,s=4*r+64;++r;const{color:o}=i,h=i.haloColor??o;t[e+0]=o.r,t[e+1]=o.g,t[e+2]=o.b,t[e+3]=i.fillOpacity*o.a*255,t[s+0]=h.r,t[s+1]=h.g,t[s+2]=h.b,t[s+3]=i.haloOpacity*h.a*255}return t}let S=0;function G(e){let t=0;for(const i of e){const{name:e}=i;t+=e.length;const{color:r,fillOpacity:s,haloColor:o,haloOpacity:h}=i;t+=r.r+r.g+r.b+r.a+s,t+=o?o.r+o.g+o.b+o.a+h:0}const r=e.at(0);if(r){const{shadowOpacity:e,shadowDifference:i,shadowColor:s}=r;t+=e+i+s.r+s.g+s.b+s.a}return S+++(t>=0?0:1)}const L=new Uint8Array([0,1,2,2,1,3]);function M(e,t,r,i,s,o=0){const{highlights:h}=i,l=h.length>1?t.acquire(r.width,r.height,"highlight mix",h.length>B?a.RG8UI:a.R8UI):null,{gl:g}=e;if(l){const t=e.getBoundFramebufferObject();e.bindFramebuffer(l.fbo),g.clearBufferuiv(g.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const c=l?.getTexture();i.highlightMixTexture=c,n(i.highlightMixOrigin,o,0),h.forEach(((t,h)=>{if(h>0){const t=I.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(c,t),e.setActiveTexture(t),g.copyTexSubImage2D(O.TEXTURE_2D,0,0,0,o,0,r.width,r.height),e.bindTexture(null,t)}e.clear(P.DEPTH),i.highlightLevel=h,s()})),i.highlightLevel=null,i.highlightMixTexture=null,l?.release()}const B=4;export{A as Highlight,B as maxHighlightsPerChannel,M as renderHighlightBuffer,G as trackHighlightOptions};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import{releaseMaybe as t,disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as i,initial as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as l}from"../../../webgl.js";import{ColorFormat as a}from"../../../webgl/formats.js";import g from"../../../webgl/RenderNode.js";import{HighlightApplyTechnique as c}from"./HighlightApplyTechnique.js";import{HighlightBlurTechnique as u}from"./HighlightBlurTechnique.js";import{HighlightDownsampleTechnique as m}from"./HighlightDownsampleTechnique.js";import{HighlightPassParameters as p}from"./HighlightPassParameters.js";import{HighlightToSingleTechnique as d}from"./HighlightToSingleTechnique.js";import{RenderRequestType as f}from"../../lib/basicInterfaces.js";import{Default3D as b}from"../../lib/DefaultVertexAttributeLocations.js";import{NoVertex as T}from"../../lib/DefaultVertexBufferLayouts.js";import{VertexArrayObject as w}from"../../lib/VertexArrayObject.js";import{H as x}from"../../../../../chunks/HighlightBlur.glsl.js";import{H as C,g as v}from"../../../../../chunks/HighlightDownsample.glsl.js";import{BufferObject as _}from"../../../../webgl/BufferObject.js";import{PixelFormat as j,TextureSamplingMode as H,FramebufferBit as P,Usage as R,TextureType as O,PrimitiveType as q,DataType as D}from"../../../../webgl/enums.js";import{Texture as I}from"../../../../webgl/Texture.js";import{TextureDescriptor as y}from"../../../../webgl/TextureDescriptor.js";let A=class extends g{constructor(){super(...arguments),this.produces=l.HIGHLIGHTS,this.consumes={required:[l.HIGHLIGHTS,"highlights"]},this._downsampleDrawParameters=new C,this._passParameters=new p,this._highlightBlurDrawParameters=new x,this._grid=new U}initialize(){this.addHandles([i((()=>this._updateOptionsTexture()),(()=>{}),s)])}destroy(){this._grid.coverage=t(this._grid.coverage),this._grid.vao=r(this._grid.vao),this._passParameters.highlightOptionsTexture=t(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new y(16,2);e.internalFormat=j.RGBA,e.samplingMode=H.NEAREST,this._passParameters.highlightOptionsTexture=new I(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(E(this.view.state.highlights)),this.requestRender(f.UPDATE)}precompile(){this.techniques.precompile(m),this.techniques.precompile(d),this.techniques.precompile(u),this.techniques.precompile(c)}render(e){const t=e.find((({name:e})=>e===l.HIGHLIGHTS)),{techniques:r,bindParameters:i,_passParameters:s,renderingContext:o}=this;if(!i.decorations)return t;const h=r.get(m);if(!h.compiled)return this.requestRender(f.UPDATE),t;const n=e.find((({name:e})=>"highlights"===e)).getTexture();s.highlightTexture=n;const a=()=>{this._gridUpdateResources(n);const e=this._gridComputeCoverage(h,n,i),{horizontalCellCount:t,verticalCellCount:r}=e;return s.horizontalCellCount=t,s.verticalCellCount=r,s.coverageTexture=e.coverage?.getTexture(),e},g=e=>{const t=e.verticalCellCount*e.horizontalCellCount;o.bindVAO(e.vao),o.drawElementsInstanced(q.TRIANGLES,6,D.UNSIGNED_BYTE,0,t)},{camera:c}=i,u=()=>{o.bindFramebuffer(t.fbo),o.setViewport4fv(c.fullViewport)};return this._renderHighlightPostprocess(n,a,g,u),s.highlightTexture=null,s.coverageTexture=null,t}_renderHighlightPostprocess(e,t,r,i){const{fboCache:s,techniques:o,bindParameters:h,_passParameters:l,renderingContext:g}=this,m=o.get(d),p=o.get(u),b=o.get(c);if(!b.compiled||!p.compiled||!m.compiled)return void this.requestRender(f.UPDATE);l.highlightTexture=e;const T=t(),{width:w,height:x}=e.descriptor;l.highlightTexture=e;const{camera:C}=h,{fullWidth:v,fullHeight:_,pixelRatio:j}=C,H=Math.ceil(v/j),R=Math.ceil(_/j),{_highlightBlurDrawParameters:O}=this,q=this.view.stage.renderView.renderer,{highlights:D}=h;for(let c=0;c<D.length;++c){const{name:e}=D[c];if(!q.hasHighlight(e))continue;l.highlightLevel=c,g.setClearColor(0,0,0,0);const t=s.acquire(w,x,"single highlight",a.RG8);g.bindFramebuffer(t.fbo),g.setViewport(0,0,w,x),g.clear(P.COLOR),g.bindTechnique(m,h,l),r(T),O.blurInput=t.getTexture(),n(O.blurSize,1/H,0);const o=s.acquire(H,R,"single highlight blur h",a.RG8);g.unbindTexture(o.fbo?.colorTexture),g.bindFramebuffer(o.fbo),g.setViewport(0,0,H,R),g.clear(P.COLOR),g.bindTechnique(p,h,l,O),r(T),t.release(),n(O.blurSize,0,1/R),l.highlightBlurTexture=o.getTexture(),i(),g.bindTechnique(b,h,l,O),r(T),o.release()}}_gridUpdateResources(e){const t=this._grid,{width:r,height:i}=e.descriptor;if(t.horizontalCellCount=Math.ceil(r/v),t.verticalCellCount=Math.ceil(i/v),t.vao)return;const s=this.renderingContext,o=_.createIndex(s,R.STATIC_DRAW,L);t.vao=new w(s,b,new Map([["geometry",T]]),new Map([["geometry",_.createVertex(s,R.STATIC_DRAW)]]),o)}_gridComputeCoverage(e,t,r){const i=this.renderingContext,s=this._grid,o=t.descriptor,h=Math.ceil(o.width/v),n=Math.ceil(o.height/v);this._downsampleDrawParameters.input=t;const{highlights:l}=r;s.coverage?.release();const g=this.fboCache.acquire(h,n,"highlight coverage",l.length>B?a.RG8UI:a.R8UI);return s.coverage=g,i.bindFramebuffer(g.fbo),i.bindTechnique(e,r,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,h,n),i.screen.draw(),s}get test(){}};e([o()],A.prototype,"produces",void 0),e([o()],A.prototype,"consumes",void 0),A=e([h("esri.views.3d.webgl-engine.effects.highlight.Highlight")],A);class U{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}function E(e){const t=new Uint8Array(128);let r=0;for(const i of e){const e=4*r,s=4*r+64;++r;const{color:o}=i,h=i.haloColor??o;t[e+0]=o.r,t[e+1]=o.g,t[e+2]=o.b,t[e+3]=i.fillOpacity*o.a*255,t[s+0]=h.r,t[s+1]=h.g,t[s+2]=h.b,t[s+3]=i.haloOpacity*h.a*255}return t}let S=0;function G(e){let t=0;for(const i of e){const{name:e}=i;t+=e.length;const{color:r,fillOpacity:s,haloColor:o,haloOpacity:h}=i;t+=r.r+r.g+r.b+r.a+s,t+=o?o.r+o.g+o.b+o.a+h:0}const r=e.at(0);if(r){const{shadowOpacity:e,shadowDifference:i,shadowColor:s}=r;t+=e+i+s.r+s.g+s.b+s.a}return S+++(t>=0?0:1)}const L=new Uint8Array([0,1,2,2,1,3]);function M(e,t,r,i,s,o=0){const{highlights:h}=i,l=h.length>1?t.acquire(r.width,r.height,"highlight mix",h.length>B?a.RG8UI:a.R8UI):null,{gl:g}=e;if(l){const t=e.getBoundFramebufferObject();e.bindFramebuffer(l.fbo),g.clearBufferuiv(g.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const c=l?.getTexture();i.highlightMixTexture=c,n(i.highlightMixOrigin,o,0),h.forEach(((t,h)=>{if(h>0){const t=I.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(c,t),e.setActiveTexture(t),g.copyTexSubImage2D(O.TEXTURE_2D,0,0,0,o,0,r.width,r.height),e.bindTexture(null,t)}e.clear(P.DEPTH),i.highlightLevel=h,s()})),i.highlightLevel=null,i.highlightMixTexture=null,l?.release()}const B=4;export{A as Highlight,B as maxHighlightsPerChannel,M as renderHighlightBuffer,G as trackHighlightOptions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{watch as s,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{requestImage as n}from"../../../../../support/requestImageUtils.js";import{InternalRenderCategory as c,RenderCategory as h}from"../../../webgl.js";import{ColorFormat as m}from"../../../webgl/formats.js";import l from"../../../webgl/RenderNode.js";import{SMAABlendWeightsTechnique as u}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as p}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as d}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as f}from"./SMAAPassParameters.js";import{RenderRequestType as b}from"../../lib/basicInterfaces.js";import{PixelFormat as T,TextureSamplingMode as x,FramebufferBit as _,TextureWrapMode as g}from"../../../../webgl/enums.js";import{Texture as A}from"../../../../webgl/Texture.js";import{TextureDescriptor as C}from"../../../../webgl/TextureDescriptor.js";let w=class extends l{constructor(e){super(e),this.produces="disabled",this.consumes={required:[c.ANTIALIASING],optional:[h.COMPOSITE]},this._areaTexture=null,this._searchTexture=null,this._smaaParameters=new f}initialize(){this.addHandles([s((()=>this.isEnabled()),(e=>e?this.enable():this.disable()),i)])}async enable(){if(this.produces=c.ANTIALIASING,this._abortController||this._areaTexture&&this._searchTexture)return;this._abortController=new AbortController;const e=this._abortController.signal;try{const r=await import("./SMAAData.js");await this._loadTextures(r,e),this.requestRender(b.UPDATE)}catch{}this._abortController=null}async _loadTextures(e,r){t(r);const[s,i]=await Promise.allSettled([n(e.areaTexture,{signal:r}),n(e.searchTexure,{signal:r})]);if(t(r),"fulfilled"!==s.status||"fulfilled"!==i.status)return;const a=this.renderingContext;this._areaTexture=j(a,x.LINEAR,T.RGB,s.value),this._searchTexture=j(a,x.NEAREST,T.LUMINANCE,i.value)}disable(){this.produces="disabled"}destroy(){this._searchTexture=r(this._searchTexture),this._areaTexture=r(this._areaTexture)}precompile(){this.techniques.precompile(d),this.techniques.precompile(u),this.techniques.precompile(p)}render(e){const r=e.find((({name:e})=>e===c.ANTIALIASING));if(!this._areaTexture||!this._searchTexture)return this.requestRender(b.UPDATE),r;const t=this.techniques.get(d),s=this.techniques.get(u),i=this.techniques.get(p);if(!t.compiled||!s.compiled||!i.compiled)return this.requestRender(b.UPDATE),r;const a=e.find((({name:e})=>e===h.COMPOSITE));if(!a)return r;const o=a.fbo.width,n=a.fbo.height,l=this.renderingContext;l.setViewport(0,0,o,n);const f=this.fboCache.acquire(o,n,"smaa edges",m.RG);l.bindFramebuffer(f.fbo),l.setClearColor(0,0,0,1),l.clear(_.COLOR),this._smaaParameters.color=a.getTexture();const T=this.bindParameters;l.bindTechnique(t,T,this._smaaParameters),l.screen.draw();const x=this.fboCache.acquire(o,n,"smaa blend");return l.bindFramebuffer(x.fbo),l.setClearColor(0,0,1,1),l.clear(_.COLOR),this._smaaParameters.inputTexture=f.getTexture(),this._smaaParameters.areaTexture=this._areaTexture,this._smaaParameters.searchTexture=this._searchTexture,l.bindTechnique(s,T,this._smaaParameters),l.screen.draw(),f.release(),l.bindFramebuffer(r.fbo),l.setClearColor(0,1,0,1),l.clear(_.COLOR),this._smaaParameters.inputTexture=x.getTexture(),l.bindTechnique(i,T,this._smaaParameters),l.screen.draw(),x.release(),r}};function j(e,r,t,s){const i=new C;return i.pixelFormat=t,i.wrapMode=g.CLAMP_TO_EDGE,i.width=s.width,i.height=s.height,i.samplingMode=r,new A(e,i,s)}e([a()],w.prototype,"produces",void 0),e([a()],w.prototype,"consumes",void 0),e([a({constructOnly:!0})],w.prototype,"isEnabled",void 0),e([a()],w.prototype,"_abortController",void 0),w=e([o("esri.views.3d.webgl-engine.effects.smaa.SMAA")],w);export{w as SMAA};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{watch as s,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{requestImage as n}from"../../../../../support/requestImageUtils.js";import{InternalRenderCategory as c,RenderCategory as h}from"../../../webgl.js";import{ColorFormat as m}from"../../../webgl/formats.js";import l from"../../../webgl/RenderNode.js";import{SMAABlendWeightsTechnique as u}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as p}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as d}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as f}from"./SMAAPassParameters.js";import{RenderRequestType as b}from"../../lib/basicInterfaces.js";import{PixelFormat as T,TextureSamplingMode as x,FramebufferBit as _,TextureWrapMode as g}from"../../../../webgl/enums.js";import{Texture as A}from"../../../../webgl/Texture.js";import{TextureDescriptor as C}from"../../../../webgl/TextureDescriptor.js";let w=class extends l{constructor(e){super(e),this.produces="disabled",this.consumes={required:[c.ANTIALIASING],optional:[h.COMPOSITE]},this._areaTexture=null,this._searchTexture=null,this._smaaParameters=new f}initialize(){this.addHandles([s((()=>this.isEnabled()),(e=>e?this.enable():this.disable()),i)])}async enable(){if(this.produces=c.ANTIALIASING,this._abortController||this._areaTexture&&this._searchTexture)return;this._abortController=new AbortController;const e=this._abortController.signal;try{const r=await import("./SMAAData.js");await this._loadTextures(r,e),this.requestRender(b.UPDATE)}catch{}this._abortController=null}async _loadTextures(e,r){t(r);const[s,i]=await Promise.allSettled([n(e.areaTexture,{signal:r}),n(e.searchTexure,{signal:r})]);if(t(r),"fulfilled"!==s.status||"fulfilled"!==i.status)return;const a=this.renderingContext;this._areaTexture=j(a,x.LINEAR,T.RGB,s.value),this._searchTexture=j(a,x.NEAREST,T.LUMINANCE,i.value)}disable(){this.produces="disabled"}destroy(){this._searchTexture=r(this._searchTexture),this._areaTexture=r(this._areaTexture)}precompile(){this.techniques.precompile(d),this.techniques.precompile(u),this.techniques.precompile(p)}render(e){const r=e.find((({name:e})=>e===c.ANTIALIASING));if(!this._areaTexture||!this._searchTexture)return this.requestRender(b.UPDATE),r;const t=this.techniques.get(d),s=this.techniques.get(u),i=this.techniques.get(p);if(!t.compiled||!s.compiled||!i.compiled)return this.requestRender(b.UPDATE),r;const a=e.find((({name:e})=>e===h.COMPOSITE));if(!a)return r;const o=a.fbo.width,n=a.fbo.height,l=this.renderingContext;l.setViewport(0,0,o,n);const f=this.fboCache.acquire(o,n,"smaa edges",m.RG8);l.bindFramebuffer(f.fbo),l.setClearColor(0,0,0,1),l.clear(_.COLOR),this._smaaParameters.color=a.getTexture();const T=this.bindParameters;l.bindTechnique(t,T,this._smaaParameters),l.screen.draw();const x=this.fboCache.acquire(o,n,"smaa blend");return l.bindFramebuffer(x.fbo),l.setClearColor(0,0,1,1),l.clear(_.COLOR),this._smaaParameters.inputTexture=f.getTexture(),this._smaaParameters.areaTexture=this._areaTexture,this._smaaParameters.searchTexture=this._searchTexture,l.bindTechnique(s,T,this._smaaParameters),l.screen.draw(),f.release(),l.bindFramebuffer(r.fbo),l.setClearColor(0,1,0,1),l.clear(_.COLOR),this._smaaParameters.inputTexture=x.getTexture(),l.bindTechnique(i,T,this._smaaParameters),l.screen.draw(),x.release(),r}};function j(e,r,t,s){const i=new C;return i.pixelFormat=t,i.wrapMode=g.CLAMP_TO_EDGE,i.width=s.width,i.height=s.height,i.samplingMode=r,new A(e,i,s)}e([a()],w.prototype,"produces",void 0),e([a()],w.prototype,"consumes",void 0),e([a({constructOnly:!0})],w.prototype,"isEnabled",void 0),e([a()],w.prototype,"_abortController",void 0),w=e([o("esri.views.3d.webgl-engine.effects.smaa.SMAA")],w);export{w as SMAA};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as t}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as n}from"../../../webgl.js";import{ColorFormat as p}from"../../../webgl/formats.js";import c from"../../../webgl/RenderNode.js";import{distanceFadeEnd as h,distanceFadeStart as u}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{SSAOBlurTechnique as l}from"./SSAOBlurTechnique.js";import{noiseData as d}from"./SSAONoiseData.js";import{SSAOPassParameters as f,BlurDrawParameters as b}from"./SSAOParameters.js";import{SSAOTechnique as w}from"./SSAOTechnique.js";import{RenderRequestType as T}from"../../lib/basicInterfaces.js";import{g as S}from"../../../../../chunks/SSAO.glsl.js";import{TextureWrapMode as _,PixelFormat as P,DepthStencilAttachment as j,FramebufferBit as g}from"../../../../webgl/enums.js";import{Texture as x}from"../../../../webgl/Texture.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";const A=2;let E=class extends c{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=n.SSAO,this.isEnabled=()=>!1,this._enableTime=i(0),this._passParameters=new f,this._drawParameters=new b}initialize(){const e=Uint8Array.from(atob(d),(e=>e.charCodeAt(0))),r=new q;r.wrapMode=_.CLAMP_TO_EDGE,r.pixelFormat=P.RGB,r.wrapMode=_.REPEAT,r.hasMipmap=!0,r.width=32,r.height=32,this._passParameters.noiseTexture=new x(this.renderingContext,r,e),this.techniques.precompile(w),this.techniques.precompile(l),this.addHandles(t((()=>this.isEnabled()),(()=>this._enableTime=i(0))))}destroy(){this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const s=this.bindParameters,t=e.find((({name:e})=>"normals"===e)),o=t?.getTexture(),a=t?.getTexture(j),c=this.fboCache,d=s.camera,f=d.fullViewport[2],b=d.fullViewport[3],_=Math.round(f/A),P=Math.round(b/A),x=this.techniques.get(w),q=this.techniques.get(l);if(!x.compiled||!q.compiled)return this._enableTime=i(performance.now()),this.requestRender(T.UPDATE),c.acquire(_,P,n.SSAO,p.RED);0===this._enableTime&&(this._enableTime=i(performance.now()));const E=this.renderingContext,y=this.view.qualitySettings.fadeDuration,R=d.relativeElevation,v=r((h-R)/(h-u),0,1),C=y>0?Math.min(y,performance.now()-this._enableTime)/y:1,D=C*v;this._passParameters.normalTexture=o,this._passParameters.depthTexture=a,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*O/S(d)**6*D;const V=c.acquire(f,b,"ssao input",p.RG);E.bindFramebuffer(V.fbo),E.setViewport(0,0,f,b),E.bindTechnique(x,s,this._passParameters,this._drawParameters),E.screen.draw();const M=c.acquire(_,P,"ssao blur",p.RED);E.bindFramebuffer(M.fbo),this._drawParameters.colorTexture=V.getTexture(),m(this._drawParameters.blurSize,0,A/b),E.bindTechnique(q,s,this._passParameters,this._drawParameters),E.setViewport(0,0,_,P),E.screen.draw(),V.release();const L=c.acquire(_,P,n.SSAO,p.RED);return E.bindFramebuffer(L.fbo),E.setViewport(0,0,f,b),E.setClearColor(1,1,1,0),E.clear(g.COLOR),this._drawParameters.colorTexture=M.getTexture(),m(this._drawParameters.blurSize,A/f,0),E.bindTechnique(q,s,this._passParameters,this._drawParameters),E.setViewport(0,0,_,P),E.screen.draw(),E.setViewport4fv(d.fullViewport),M.release(),C<1&&this.requestRender(T.UPDATE),L}};e([o()],E.prototype,"consumes",void 0),e([o()],E.prototype,"produces",void 0),e([o({constructOnly:!0})],E.prototype,"isEnabled",void 0),E=e([a("esri.views.3d.webgl-engine.effects.ssao.SSAO")],E);const O=.5;export{E as SSAO,A as blurSizePixels};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as t}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as n}from"../../../webgl.js";import{ColorFormat as p}from"../../../webgl/formats.js";import c from"../../../webgl/RenderNode.js";import{distanceFadeEnd as h,distanceFadeStart as u}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{SSAOBlurTechnique as l}from"./SSAOBlurTechnique.js";import{noiseData as d}from"./SSAONoiseData.js";import{SSAOPassParameters as f,BlurDrawParameters as b}from"./SSAOParameters.js";import{SSAOTechnique as w}from"./SSAOTechnique.js";import{RenderRequestType as T}from"../../lib/basicInterfaces.js";import{g as S}from"../../../../../chunks/SSAO.glsl.js";import{TextureWrapMode as _,PixelFormat as P,DepthStencilAttachment as j,FramebufferBit as g}from"../../../../webgl/enums.js";import{Texture as x}from"../../../../webgl/Texture.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";const A=2;let O=class extends c{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=n.SSAO,this.isEnabled=()=>!1,this._enableTime=i(0),this._passParameters=new f,this._drawParameters=new b}initialize(){const e=Uint8Array.from(atob(d),(e=>e.charCodeAt(0))),r=new q;r.wrapMode=_.CLAMP_TO_EDGE,r.pixelFormat=P.RGB,r.wrapMode=_.REPEAT,r.hasMipmap=!0,r.width=32,r.height=32,this._passParameters.noiseTexture=new x(this.renderingContext,r,e),this.techniques.precompile(w),this.techniques.precompile(l),this.addHandles(t((()=>this.isEnabled()),(()=>this._enableTime=i(0))))}destroy(){this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const s=this.bindParameters,t=e.find((({name:e})=>"normals"===e)),o=t?.getTexture(),a=t?.getTexture(j),c=this.fboCache,d=s.camera,f=d.fullViewport[2],b=d.fullViewport[3],_=Math.round(f/A),P=Math.round(b/A),x=this.techniques.get(w),q=this.techniques.get(l);if(!x.compiled||!q.compiled)return this._enableTime=i(performance.now()),this.requestRender(T.UPDATE),c.acquire(_,P,n.SSAO,p.R8);0===this._enableTime&&(this._enableTime=i(performance.now()));const O=this.renderingContext,R=this.view.qualitySettings.fadeDuration,v=d.relativeElevation,C=r((h-v)/(h-u),0,1),E=R>0?Math.min(R,performance.now()-this._enableTime)/R:1,V=E*C;this._passParameters.normalTexture=o,this._passParameters.depthTexture=a,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*y/S(d)**6*V;const D=c.acquire(f,b,"ssao input",p.RG8);O.bindFramebuffer(D.fbo),O.setViewport(0,0,f,b),O.bindTechnique(x,s,this._passParameters,this._drawParameters),O.screen.draw();const M=c.acquire(_,P,"ssao blur",p.R8);O.bindFramebuffer(M.fbo),this._drawParameters.colorTexture=D.getTexture(),m(this._drawParameters.blurSize,0,A/b),O.bindTechnique(q,s,this._passParameters,this._drawParameters),O.setViewport(0,0,_,P),O.screen.draw(),D.release();const L=c.acquire(_,P,n.SSAO,p.R8);return O.bindFramebuffer(L.fbo),O.setViewport(0,0,f,b),O.setClearColor(1,1,1,0),O.clear(g.COLOR),this._drawParameters.colorTexture=M.getTexture(),m(this._drawParameters.blurSize,A/f,0),O.bindTechnique(q,s,this._passParameters,this._drawParameters),O.setViewport(0,0,_,P),O.screen.draw(),O.setViewport4fv(d.fullViewport),M.release(),E<1&&this.requestRender(T.UPDATE),L}};e([o()],O.prototype,"consumes",void 0),e([o()],O.prototype,"produces",void 0),e([o({constructOnly:!0})],O.prototype,"isEnabled",void 0),O=e([a("esri.views.3d.webgl-engine.effects.ssao.SSAO")],O);const y=.5;export{O as SSAO,A as blurSizePixels};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{nativeArrayMaxSize as r,isUint16Array as t}from"../../../../core/typedArrayUtil.js";function a(a){if(a.length<r)return Array.from(a);if(Array.isArray(a))return Float64Array.from(a);if(!("BYTES_PER_ELEMENT"in a))return Array.from(a);switch(a.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(a);case 2:return t(a)?Uint16Array.from(a):Int16Array.from(a);case 4:return Float32Array.from(a);default:return Float64Array.from(a)}}export{a as cloneAttributeData};
5
+ import{isFloat16Array as r,Float16Array as t}from"@petamoriken/float16";import{nativeArrayMaxSize as o,isUint16Array as a}from"../../../../core/typedArrayUtil.js";function e(e){if(e.length<o)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return r(e)?t.from(e):a(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}export{e as cloneAttributeData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{VertexAttribute as E}from"./VertexAttribute.js";const O=new Map([[E.POSITION,0],[E.NORMAL,1],[E.NORMALCOMPRESSED,1],[E.UV0,2],[E.COLOR,3],[E.COLORFEATUREATTRIBUTE,3],[E.SIZE,4],[E.TANGENT,4],[E.CENTEROFFSETANDDISTANCE,5],[E.SYMBOLCOLOR,5],[E.FEATUREATTRIBUTE,6],[E.INSTANCEFEATUREATTRIBUTE,6],[E.INSTANCECOLOR,7],[E.OBJECTANDLAYERIDCOLOR,7],[E.INSTANCEOBJECTANDLAYERIDCOLOR,7],[E.ROTATION,8],[E.INSTANCEMODEL,8],[E.INSTANCEMODELNORMAL,12],[E.INSTANCEMODELORIGINHI,11],[E.INSTANCEMODELORIGINLO,15]]);export{O as Default3D};
5
+ import{VertexAttribute as O}from"./VertexAttribute.js";const E=new Map([[O.POSITION,0],[O.NORMAL,1],[O.NORMALCOMPRESSED,1],[O.UV0,2],[O.UVI,2],[O.COLOR,3],[O.COLORFEATUREATTRIBUTE,3],[O.SIZE,4],[O.TANGENT,4],[O.CENTEROFFSETANDDISTANCE,5],[O.SYMBOLCOLOR,5],[O.FEATUREATTRIBUTE,6],[O.INSTANCEFEATUREATTRIBUTE,6],[O.INSTANCECOLOR,7],[O.OLIDCOLOR,7],[O.INSTANCEOBJECTANDLAYERIDCOLOR,7],[O.ROTATION,8],[O.INSTANCEMODEL,8],[O.INSTANCEMODELNORMAL,12],[O.INSTANCEMODELORIGINHI,11],[O.INSTANCEMODELORIGINLO,15]]);export{E as Default3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{VertexAttribute as e}from"./VertexAttribute.js";import{DataType as r}from"../../../webgl/enums.js";import{VertexElementDescriptor as t}from"../../../webgl/VertexElementDescriptor.js";const O=[],o=[new t(e.POSITION,3,r.FLOAT,0,12)],m=[new t(e.POSITION,2,r.FLOAT,0,8)],n=[new t(e.POSITION,2,r.FLOAT,0,16),new t(e.UV0,2,r.FLOAT,8,16)];export{O as NoVertex,m as Pos2,n as Pos2Tex,o as Pos3};
5
+ import{VertexAttribute as e}from"./VertexAttribute.js";import{DataType as r}from"../../../webgl/enums.js";import{VertexElementDescriptor as t}from"../../../webgl/VertexElementDescriptor.js";const O=[],o=[new t(e.POSITION,3,r.FLOAT,0,12)],m=[new t(e.POSITION,2,r.FLOAT,0,8)],n=[new t(e.POSITION,2,r.FLOAT,0,12),new t(e.UV0,2,r.HALF_FLOAT,8,12)];export{O as NoVertex,m as Pos2,n as Pos2Tex,o as Pos3};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{IDENTITY as t,clone as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as e}from"../../../../chunks/vec32.js";import{compactIndices as s,getContinuousIndexArray as n}from"../../../../geometry/support/Indices.js";import{cloneAttributeData as h}from"./AttributeArray.js";import{BoundingInfo as o}from"./BoundingInfo.js";import{ContentObject as r}from"./ContentObject.js";import{ContentObjectType as g}from"./ContentObjectType.js";import{computeAttachmentOriginTriangles as a,computeAttachmentOriginLines as u,computeAttachmentOriginPoints as l}from"./geometryDataUtils.js";import{Object3DHighlightStateID as c}from"./Object3DStateID.js";import{assert as m}from"./Util.js";import{VertexAttribute as d}from"./VertexAttribute.js";class f extends r{constructor(t,i,e=null,n=g.Mesh,h=null,o=-1){super(),this.material=t,this.mapPositions=e,this.type=n,this.objectAndLayerIdColor=h,this.edgeIndicesLength=o,this.highlights=new Set,this._highlightOptionsCounts=new Map,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[r,g]of i)this._attributes.set(r,{...g,indices:s(g.indices)}),r===d.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(r).indices.length:this.edgeIndicesLength)}instantiate(t={}){const i=new f(t.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((t,e)=>{t.exclusive=!1,i._attributes.set(e,t)})),i._boundingInfo=this._boundingInfo,i.transformation=t.transformation||this.transformation,i}get attributes(){return this._attributes}getMutableAttribute(t){let i=this._attributes.get(t);return i&&!i.exclusive&&(i={...i,exclusive:!0,data:h(i.data)},this._attributes.set(t,i)),i}setAttributeData(t,i){const e=this._attributes.get(t);e&&this._attributes.set(t,{...e,exclusive:!0,data:i})}get indexCount(){const t=this._attributes.values().next().value?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(t){return!!(this.type===g.Mesh?this._computeAttachmentOriginTriangles(t):this.type===g.Line?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(null!=this._transformation&&e(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){const i=this.attributes.get(d.POSITION);return a(i,t)}_computeAttachmentOriginLines(t){const i=this.attributes.get(d.POSITION);return u(i,p(this.material.parameters,i),t)}_computeAttachmentOriginPoints(t){const i=this.attributes.get(d.POSITION);return l(i,t)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const t=this.attributes.get(d.POSITION);if(!t||0===t.indices.length)return null;const i=this.type===g.Mesh?3:1;m(t.indices.length%i==0,"Indexing error: "+t.indices.length+" not divisible by "+i);const e=n(t.indices.length/i);return new o(e,i,t)}get transformation(){return this._transformation??t}set transformation(e){this._transformation=e&&e!==t?i(e):null}get highlightNames(){return this._highlightOptionsCounts}get hasHighlights(){return this._highlightOptionsCounts.size>0}foreachHighlightOptions(t){this._highlightOptionsCounts.forEach(((i,e)=>t(e)))}allocateIdAndHighlight(t){const i=new c(t);return this.addHighlight(i)}addHighlight(t){this.highlights.add(t);const{highlightName:i}=t,e=(this._highlightOptionsCounts.get(i)??0)+1;return this._highlightOptionsCounts.set(i,e),t}removeHighlight(t){if(this.highlights.delete(t)){const{highlightName:i}=t,e=this._highlightOptionsCounts.get(i)??0;e<=1?this._highlightOptionsCounts.delete(i):this._highlightOptionsCounts.set(i,e-1)}}}function p(t,i){return!(!("isClosed"in t)||!t.isClosed)&&i.indices.length>2}export{f as Geometry};
5
+ import{IDENTITY as t,clone as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as e}from"../../../../chunks/vec32.js";import{compactIndices as s,getContinuousIndexArray as n}from"../../../../geometry/support/Indices.js";import{cloneAttributeData as h}from"./AttributeArray.js";import{BoundingInfo as o}from"./BoundingInfo.js";import{ContentObject as r}from"./ContentObject.js";import{ContentObjectType as a}from"./ContentObjectType.js";import{computeAttachmentOriginTriangles as g,computeAttachmentOriginLines as u,computeAttachmentOriginPoints as l}from"./geometryDataUtils.js";import{Object3DHighlightStateID as c}from"./Object3DStateID.js";import{assert as m}from"./Util.js";import{VertexAttribute as d}from"./VertexAttribute.js";import{webglDebugEnabled as f}from"../../../webgl/checkWebGLError.js";class p extends r{constructor(t,i,e=null,n=a.Mesh,h=null,o=-1){super(),this.material=t,this.mapPositions=e,this.type=n,this.objectAndLayerIdColor=h,this.edgeIndicesLength=o,this.highlights=new Set,this._highlightOptionsCounts=new Map,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[r,a]of i)this._attributes.set(r,{...a,indices:s(a.indices)}),r===d.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(r).indices.length:this.edgeIndicesLength)}instantiate(t={}){const i=new p(t.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((t,e)=>{t.exclusive=!1,i._attributes.set(e,t)})),i._boundingInfo=this._boundingInfo,i.transformation=t.transformation||this.transformation,i}get attributes(){return this._attributes}getMutableAttribute(t){let i=this._attributes.get(t);return i&&!i.exclusive&&(i={...i,exclusive:!0,data:h(i.data)},this._attributes.set(t,i)),i}setAttributeData(t,i){const e=this._attributes.get(t);e?this._attributes.set(t,{...e,exclusive:!0,data:i}):f()&&console.warn(`Setting undefined attribute ${t} data`)}get indexCount(){const t=this._attributes.values().next().value?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(t){return!!(this.type===a.Mesh?this._computeAttachmentOriginTriangles(t):this.type===a.Line?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(null!=this._transformation&&e(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){const i=this.attributes.get(d.POSITION);return g(i,t)}_computeAttachmentOriginLines(t){const i=this.attributes.get(d.POSITION);return u(i,b(this.material.parameters,i),t)}_computeAttachmentOriginPoints(t){const i=this.attributes.get(d.POSITION);return l(i,t)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const t=this.attributes.get(d.POSITION);if(!t||0===t.indices.length)return null;const i=this.type===a.Mesh?3:1;m(t.indices.length%i==0,"Indexing error: "+t.indices.length+" not divisible by "+i);const e=n(t.indices.length/i);return new o(e,i,t)}get transformation(){return this._transformation??t}set transformation(e){this._transformation=e&&e!==t?i(e):null}get highlightNames(){return this._highlightOptionsCounts}get hasHighlights(){return this._highlightOptionsCounts.size>0}foreachHighlightOptions(t){this._highlightOptionsCounts.forEach(((i,e)=>t(e)))}allocateIdAndHighlight(t){const i=new c(t);return this.addHighlight(i)}addHighlight(t){this.highlights.add(t);const{highlightName:i}=t,e=(this._highlightOptionsCounts.get(i)??0)+1;return this._highlightOptionsCounts.set(i,e),t}removeHighlight(t){if(this.highlights.delete(t)){const{highlightName:i}=t,e=this._highlightOptionsCounts.get(i)??0;e<=1?this._highlightOptionsCounts.delete(i):this._highlightOptionsCounts.set(i,e-1)}}}function b(t,i){return!(!("isClosed"in t)||!t.isClosed)&&i.indices.length>2}export{p as Geometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{d as t,e as n,n as e,h as o,g as s,f as r,i as l,c as h,t as u}from"../../../../chunks/vec32.js";import{fromValues as c,create as a,clone as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{clone as p,create as i,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as g}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as O,floatArrayFrom as m}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as A,getContinuousIndexArray as M}from"../../../../geometry/support/Indices.js";import{create as I,fromPositionAndNormal as y,intersectRay as N}from"../../../../geometry/support/plane.js";import{wrap as P}from"../../../../geometry/support/ray.js";import{Attribute as T}from"./Attribute.js";import{Vec3Compact as S}from"./BufferVectorMath.js";import{ContentObjectType as R}from"./ContentObjectType.js";import{Geometry as b}from"./Geometry.js";import{assert as L}from"./Util.js";import{VertexAttribute as d}from"./VertexAttribute.js";const j=S,E=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],U=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],V=[0,0,1,0,1,1,0,1],v=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],x=new Array(36);for(let Nt=0;Nt<6;Nt++)for(let t=0;t<6;t++)x[6*Nt+t]=Nt;const C=new Array(36);for(let Nt=0;Nt<6;Nt++)C[6*Nt]=0,C[6*Nt+1]=1,C[6*Nt+2]=2,C[6*Nt+3]=2,C[6*Nt+4]=3,C[6*Nt+5]=0;function F(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(24);for(let o=0;o<8;o++)e[3*o]=E[o][0]*n[0],e[3*o+1]=E[o][1]*n[1],e[3*o+2]=E[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,v,3,!0)],[d.NORMAL,new T(U,x,3)],[d.UV0,new T(V,C,2)]])}const G=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],D=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],q=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],z=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function B(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(18);for(let o=0;o<6;o++)e[3*o]=G[o][0]*n[0],e[3*o+1]=G[o][1]*n[1],e[3*o+2]=G[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,q,3,!0)],[d.NORMAL,new T(D,z,3)]])}const k=c(-.5,0,-.5),Z=c(.5,0,-.5),H=c(0,0,.5),J=c(0,.5,0),K=a(),Q=a(),W=a(),X=a(),Y=a();t(K,k,J),t(Q,k,Z),n(W,K,Q),e(W,W),t(K,Z,J),t(Q,Z,H),n(X,K,Q),e(X,X),t(K,H,J),t(Q,H,k),n(Y,K,Q),e(Y,Y);const $=[k,Z,H,J],_=[0,-1,0,W[0],W[1],W[2],X[0],X[1],X[2],Y[0],Y[1],Y[2]],tt=[0,1,2,3,1,0,3,2,1,3,0,2],nt=[0,0,0,1,1,1,2,2,2,3,3,3];function et(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(12);for(let o=0;o<4;o++)e[3*o]=$[o][0]*n[0],e[3*o+1]=$[o][1]*n[1],e[3*o+2]=$[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,tt,3,!0)],[d.NORMAL,new T(_,nt,3)]])}function ot(t,n,e,o,s={uv:!0}){const r=-Math.PI,l=2*Math.PI,h=-Math.PI/2,u=Math.PI,c=Math.max(3,Math.floor(e)),a=Math.max(2,Math.floor(o)),f=(c+1)*(a+1),p=O(3*f),i=O(3*f),w=O(2*f),g=[];let m=0;for(let O=0;O<=a;O++){const t=[],e=O/a,o=h+e*u,s=Math.cos(o);for(let h=0;h<=c;h++){const u=h/c,a=r+u*l,f=Math.cos(a)*s,g=Math.sin(o),O=-Math.sin(a)*s;p[3*m]=f*n,p[3*m+1]=g*n,p[3*m+2]=O*n,i[3*m]=f,i[3*m+1]=g,i[3*m+2]=O,w[2*m]=u,w[2*m+1]=e,t.push(m),++m}g.push(t)}const M=new Array;for(let O=0;O<a;O++)for(let t=0;t<c;t++){const n=g[O][t],e=g[O][t+1],o=g[O+1][t+1],s=g[O+1][t];0===O?(M.push(n),M.push(o),M.push(s)):O===a-1?(M.push(n),M.push(e),M.push(o)):(M.push(n),M.push(e),M.push(o),M.push(o),M.push(s),M.push(n))}const I=[[d.POSITION,new T(p,M,3,!0)],[d.NORMAL,new T(i,M,3,!0)]];return s.uv&&I.push([d.UV0,new T(w,M,2,!0)]),s.offset&&(I[0][0]=d.OFFSET,I.push([d.POSITION,new T(Float64Array.from(s.offset),A(M.length),3,!0)])),new b(t,I)}function st(t,n,e,o){const s=rt(n,e,o);return new b(t,s)}function rt(t,n,e){const o=t;let s,r;if(e)s=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],r=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const t=o*(1+Math.sqrt(5))/2;s=[-o,t,0,o,t,0,-o,-t,0,o,-t,0,0,-o,t,0,o,t,0,-o,-t,0,o,-t,t,0,-o,t,0,o,-t,0,-o,-t,0,o],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let c=0;c<s.length;c+=3)j.scale(s,c,t/j.length(s,c));let l={};function h(n,e){n>e&&([n,e]=[e,n]);const o=n.toString()+"."+e.toString();if(l[o])return l[o];let r=s.length;return s.length+=3,j.add(s,3*n,s,3*e,s,r),j.scale(s,r,t/j.length(s,r)),r/=3,l[o]=r,r}for(let c=0;c<n;c++){const t=r.length,n=new Array(4*t);for(let e=0;e<t;e+=3){const t=r[e],o=r[e+1],s=r[e+2],l=h(t,o),u=h(o,s),c=h(s,t),a=4*e;n[a]=t,n[a+1]=l,n[a+2]=c,n[a+3]=o,n[a+4]=u,n[a+5]=l,n[a+6]=s,n[a+7]=c,n[a+8]=u,n[a+9]=l,n[a+10]=u,n[a+11]=c}r=n,l={}}const u=m(s);for(let c=0;c<u.length;c+=3)j.normalize(u,c);return[[d.POSITION,new T(m(s),r,3,!0)],[d.NORMAL,new T(u,r,3,!0)]]}function lt(t,n={}){const{normal:e,position:o,color:s,rotation:r,size:l,centerOffsetAndDistance:h,uvs:u,featureAttribute:c,objectAndLayerIdColor:a=null}=n,f=o?p(o):i(),g=e?p(e):w(0,0,1),O=s?[255*s[0],255*s[1],255*s[2],s.length>3?255*s[3]:255]:[255,255,255,255],m=null!=l&&2===l.length?l:[1,1],M=null!=r?[r]:[0],I=A(1),y=[[d.POSITION,new T(f,I,3,!0)],[d.NORMAL,new T(g,I,3,!0)],[d.COLOR,new T(O,I,4,!0)],[d.SIZE,new T(m,I,2)],[d.ROTATION,new T(M,I,1,!0)]];if(u&&y.push([d.UV0,new T(u,I,u.length)]),null!=h){const t=[h[0],h[1],h[2],h[3]];y.push([d.CENTEROFFSETANDDISTANCE,new T(t,I,4)])}if(c){const t=[c[0],c[1],c[2],c[3]];y.push([d.FEATUREATTRIBUTE,new T(t,I,4)])}return new b(t,y,null,R.Point,a)}const ht=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function ut(t,n=ht){const e=new Array(12);for(let c=0;c<4;c++)for(let t=0;t<3;t++)e[3*c+t]=n[c][t];const o=[0,1,2,2,3,0],s=[0,0,1],r=[0,0,0,0,0,0],l=[0,0,1,0,1,1,0,1],h=[255,255,255,255],u=[[d.POSITION,new T(e,o,3,!0)],[d.NORMAL,new T(s,r,3,!0)],[d.UV0,new T(l,o,2,!0)],[d.COLOR,new T(h,r,4,!0)]];return new b(t,u)}function ct(t,n,e,o,s=!0,r=!0){let l=0;const h=n,u=t;let a=c(0,l,0),f=c(0,l+u,0),p=c(0,-1,0),i=c(0,1,0);o&&(l=u,f=c(0,0,0),a=c(0,l,0),p=c(0,1,0),i=c(0,-1,0));const w=[f,a],g=[p,i],m=e+2,A=Math.sqrt(u*u+h*h);if(o)for(let O=e-1;O>=0;O--){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*h,l,Math.sin(t)*h);w.push(n);const o=c(u*Math.cos(t)/A,-h/A,u*Math.sin(t)/A);g.push(o)}else for(let O=0;O<e;O++){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*h,l,Math.sin(t)*h);w.push(n);const o=c(u*Math.cos(t)/A,h/A,u*Math.sin(t)/A);g.push(o)}const M=new Array,I=new Array;if(s){for(let t=3;t<w.length;t++)M.push(1),M.push(t-1),M.push(t),I.push(0),I.push(0),I.push(0);M.push(w.length-1),M.push(2),M.push(1),I.push(0),I.push(0),I.push(0)}if(r){for(let t=3;t<w.length;t++)M.push(t),M.push(t-1),M.push(0),I.push(t),I.push(t-1),I.push(1);M.push(0),M.push(2),M.push(w.length-1),I.push(1),I.push(2),I.push(g.length-1)}const y=O(3*m);for(let c=0;c<m;c++)y[3*c]=w[c][0],y[3*c+1]=w[c][1],y[3*c+2]=w[c][2];const N=O(3*m);for(let c=0;c<m;c++)N[3*c]=g[c][0],N[3*c+1]=g[c][1],N[3*c+2]=g[c][2];return[[d.POSITION,new T(y,M,3,!0)],[d.NORMAL,new T(N,I,3,!0)]]}function at(t,n,e,o,s,r=!0,l=!0){return new b(t,ct(n,e,o,s,r,l))}function ft(t,h,u,p,i,w,g){const m=i?f(i):c(1,0,0),A=w?f(w):c(0,0,0);g??=!0;const M=a();e(M,m);const I=a();o(I,M,Math.abs(h));const y=a();o(y,I,-.5),s(y,y,A);const N=c(0,1,0);Math.abs(1-r(M,N))<.2&&l(N,0,0,1);const P=a();n(P,M,N),e(P,P),n(N,P,M);const S=2*p+(g?2:0),R=p+(g?2:0),L=O(3*S),j=O(3*R),E=O(2*S),U=new Array(3*p*(g?4:2)),V=new Array(3*p*(g?4:2));g&&(L[3*(S-2)]=y[0],L[3*(S-2)+1]=y[1],L[3*(S-2)+2]=y[2],E[2*(S-2)]=0,E[2*(S-2)+1]=0,L[3*(S-1)]=L[3*(S-2)]+I[0],L[3*(S-1)+1]=L[3*(S-2)+1]+I[1],L[3*(S-1)+2]=L[3*(S-2)+2]+I[2],E[2*(S-1)]=1,E[2*(S-1)+1]=1,j[3*(R-2)]=-M[0],j[3*(R-2)+1]=-M[1],j[3*(R-2)+2]=-M[2],j[3*(R-1)]=M[0],j[3*(R-1)+1]=M[1],j[3*(R-1)+2]=M[2]);const v=(t,n,e)=>{U[t]=n,V[t]=e};let x=0;const C=a(),F=a();for(let n=0;n<p;n++){const t=n*(2*Math.PI/p);o(C,N,Math.sin(t)),o(F,P,Math.cos(t)),s(C,C,F),j[3*n]=C[0],j[3*n+1]=C[1],j[3*n+2]=C[2],o(C,C,u),s(C,C,y),L[3*n]=C[0],L[3*n+1]=C[1],L[3*n+2]=C[2],E[2*n]=n/p,E[2*n+1]=0,L[3*(n+p)]=L[3*n]+I[0],L[3*(n+p)+1]=L[3*n+1]+I[1],L[3*(n+p)+2]=L[3*n+2]+I[2],E[2*(n+p)]=n/p,E[2*n+1]=1;const e=(n+1)%p;v(x++,n,n),v(x++,n+p,n),v(x++,e,e),v(x++,e,e),v(x++,n+p,n),v(x++,e+p,e)}if(g){for(let t=0;t<p;t++){const n=(t+1)%p;v(x++,S-2,R-2),v(x++,t,R-2),v(x++,n,R-2)}for(let t=0;t<p;t++){const n=(t+1)%p;v(x++,t+p,R-1),v(x++,S-1,R-1),v(x++,n+p,R-1)}}const G=[[d.POSITION,new T(L,U,3,!0)],[d.NORMAL,new T(j,V,3,!0)],[d.UV0,new T(E,U,2,!0)]];return new b(t,G)}function pt(t,n,e,o,s,r){o=o||10,s=null==s||s,L(n.length>1);const l=[[0,0,0]],h=[],u=[];for(let c=0;c<o;c++){h.push([0,-c-1,-(c+1)%o-1]);const t=c/o*2*Math.PI;u.push([Math.cos(t)*e,Math.sin(t)*e])}return it(t,u,n,l,h,s,r)}function it(r,u,a,f,p,w,g=c(0,0,0)){const m=u.length,A=O(a.length*m*3+(6*f.length||0)),M=O(a.length*m*3+(f?6:0)),S=new Array,R=new Array;let L=0,j=0;const E=i(),U=i(),V=i(),v=i(),x=i(),C=i(),F=i(),G=i(),D=i(),q=i(),z=i(),B=i(),k=i(),Z=I();l(D,0,1,0),t(U,a[1],a[0]),e(U,U),w?(s(G,a[0],g),e(V,G)):l(V,0,0,1),Mt(U,V,D,D,x,V,It),h(v,V),h(B,x);for(let t=0;t<f.length;t++)o(C,x,f[t][0]),o(G,V,f[t][2]),s(C,C,G),s(C,C,a[0]),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2];M[j++]=-U[0],M[j++]=-U[1],M[j++]=-U[2];for(let t=0;t<p.length;t++)S.push(p[t][0]>0?p[t][0]:-p[t][0]-1+f.length),S.push(p[t][1]>0?p[t][1]:-p[t][1]-1+f.length),S.push(p[t][2]>0?p[t][2]:-p[t][2]-1+f.length),R.push(0),R.push(0),R.push(0);let H=f.length;const J=f.length-1;for(let l=0;l<a.length;l++){let r=!1;if(l>0){h(E,U),l<a.length-1?(t(U,a[l+1],a[l]),e(U,U)):r=!0,s(q,E,U),e(q,q),s(z,a[l-1],v),y(a[l],q,Z);N(Z,P(z,E),G)?(t(G,G,a[l]),e(V,G),n(x,q,V),e(x,x)):Mt(q,v,B,D,x,V,It),h(v,V),h(B,x)}w&&(s(G,a[l],g),e(k,G));for(let t=0;t<m;t++)if(o(C,x,u[t][0]),o(G,V,u[t][1]),s(C,C,G),e(F,C),M[j++]=F[0],M[j++]=F[1],M[j++]=F[2],s(C,C,a[l]),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2],!r){const n=(t+1)%m;S.push(H+t),S.push(H+m+t),S.push(H+n),S.push(H+n),S.push(H+m+t),S.push(H+m+n);for(let t=0;t<6;t++){const n=S.length-6;R.push(S[n+t]-J)}}H+=m}const K=a[a.length-1];for(let t=0;t<f.length;t++)o(C,x,f[t][0]),o(G,V,f[t][1]),s(C,C,G),s(C,C,K),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2];const Q=j/3;M[j++]=U[0],M[j++]=U[1],M[j++]=U[2];const W=H-m;for(let t=0;t<p.length;t++)S.push(p[t][0]>=0?H+p[t][0]:-p[t][0]-1+W),S.push(p[t][2]>=0?H+p[t][2]:-p[t][2]-1+W),S.push(p[t][1]>=0?H+p[t][1]:-p[t][1]-1+W),R.push(Q),R.push(Q),R.push(Q);const X=[[d.POSITION,new T(A,S,3,!0)],[d.NORMAL,new T(M,R,3,!0)]];return new b(r,X)}function wt(t,n,e,o){L(n.length>1,"createPolylineGeometry(): polyline needs at least 2 points"),L(3===n[0].length,"createPolylineGeometry(): malformed vertex"),L(null==e||e.length===n.length,"createPolylineGeometry: need same number of points and normals"),L(null==e||3===e[0].length,"createPolylineGeometry(): malformed normal");const s=g(3*n.length),r=new Array(2*(n.length-1));let l=0,h=0;for(let c=0;c<n.length;c++){for(let t=0;t<3;t++)s[l++]=n[c][t];c>0&&(r[h++]=c-1,r[h++]=c)}const u=[[d.POSITION,new T(s,r,3,!0)]];if(e){const t=O(3*e.length);let o=0;for(let s=0;s<n.length;s++)for(let n=0;n<3;n++)t[o++]=e[s][n];u.push([d.NORMAL,new T(t,r,3,!0)])}return o&&u.push([d.COLOR,new T(o,M(o.length/4),4)]),new b(t,u,null,R.Line)}function gt(t,n,e,o,s,r=0){const l=new Array(18),h=[[-e,r,s/2],[o,r,s/2],[0,n+r,s/2],[-e,r,-s/2],[o,r,-s/2],[0,n+r,-s/2]],u=[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5];for(let c=0;c<6;c++)l[3*c]=h[c][0],l[3*c+1]=h[c][1],l[3*c+2]=h[c][2];return new b(t,[[d.POSITION,new T(l,u,3,!0)]])}function Ot(t,n){const e=t.getMutableAttribute(d.POSITION).data;for(let o=0;o<e.length;o+=3){const t=e[o],s=e[o+1],r=e[o+2];l(yt,t,s,r),u(yt,yt,n),e[o]=yt[0],e[o+1]=yt[1],e[o+2]=yt[2]}}function mt(t,n=t){const e=t.attributes,o=e.get(d.POSITION).data,s=e.get(d.NORMAL).data;if(s){const t=n.getMutableAttribute(d.NORMAL).data;for(let n=0;n<s.length;n+=3){const e=s[n+1];t[n+1]=-s[n+2],t[n+2]=e}}if(o){const t=n.getMutableAttribute(d.POSITION).data;for(let n=0;n<o.length;n+=3){const e=o[n+1];t[n+1]=-o[n+2],t[n+2]=e}}}function At(t,o,s,l,h){return!(Math.abs(r(o,t))>h)&&(n(s,t,o),e(s,s),n(l,s,t),e(l,l),!0)}function Mt(t,n,e,o,s,r,l){return At(t,n,s,r,l)||At(t,e,s,r,l)||At(t,o,s,r,l)}const It=.99619469809,yt=i();export{mt as cgToGIS,F as createBoxGeometry,at as createConeGeometry,ct as createConeGeometryData,ft as createCylinderGeometry,B as createDiamondGeometry,gt as createExtrudedTriangle,it as createPathExtrusionGeometry,lt as createPointGeometry,rt as createPolySphereData,st as createPolySphereGeometry,wt as createPolylineGeometry,ot as createSphereGeometry,ut as createSquareGeometry,et as createTetrahedronGeometry,pt as createTubeGeometry,Mt as makeOrthoBasisDirUpFallback,Ot as transformInPlace};
5
+ import{d as t,e as n,n as e,h as o,g as s,f as r,i as l,c as h,t as u}from"../../../../chunks/vec32.js";import{fromValues as c,create as a,clone as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{clone as p,create as i,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as g}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as O,floatArrayFrom as m}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as A,getContinuousIndexArray as M}from"../../../../geometry/support/Indices.js";import{create as I,fromPositionAndNormal as y,intersectRay as N}from"../../../../geometry/support/plane.js";import{wrap as P}from"../../../../geometry/support/ray.js";import{Attribute as T}from"./Attribute.js";import{Vec3Compact as S}from"./BufferVectorMath.js";import{ContentObjectType as R}from"./ContentObjectType.js";import{Geometry as b}from"./Geometry.js";import{assert as L}from"./Util.js";import{VertexAttribute as d}from"./VertexAttribute.js";const j=S,E=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],U=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],V=[0,0,1,0,1,1,0,1],v=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],x=new Array(36);for(let Nt=0;Nt<6;Nt++)for(let t=0;t<6;t++)x[6*Nt+t]=Nt;const C=new Array(36);for(let Nt=0;Nt<6;Nt++)C[6*Nt]=0,C[6*Nt+1]=1,C[6*Nt+2]=2,C[6*Nt+3]=2,C[6*Nt+4]=3,C[6*Nt+5]=0;function F(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(24);for(let o=0;o<8;o++)e[3*o]=E[o][0]*n[0],e[3*o+1]=E[o][1]*n[1],e[3*o+2]=E[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,v,3,!0)],[d.NORMAL,new T(U,x,3)],[d.UV0,new T(V,C,2)]])}const G=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],D=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],q=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],z=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function B(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(18);for(let o=0;o<6;o++)e[3*o]=G[o][0]*n[0],e[3*o+1]=G[o][1]*n[1],e[3*o+2]=G[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,q,3,!0)],[d.NORMAL,new T(D,z,3)]])}const k=c(-.5,0,-.5),Z=c(.5,0,-.5),H=c(0,0,.5),J=c(0,.5,0),K=a(),Q=a(),W=a(),X=a(),Y=a();t(K,k,J),t(Q,k,Z),n(W,K,Q),e(W,W),t(K,Z,J),t(Q,Z,H),n(X,K,Q),e(X,X),t(K,H,J),t(Q,H,k),n(Y,K,Q),e(Y,Y);const $=[k,Z,H,J],_=[0,-1,0,W[0],W[1],W[2],X[0],X[1],X[2],Y[0],Y[1],Y[2]],tt=[0,1,2,3,1,0,3,2,1,3,0,2],nt=[0,0,0,1,1,1,2,2,2,3,3,3];function et(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(12);for(let o=0;o<4;o++)e[3*o]=$[o][0]*n[0],e[3*o+1]=$[o][1]*n[1],e[3*o+2]=$[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,tt,3,!0)],[d.NORMAL,new T(_,nt,3)]])}function ot(t,n,e,o,s={uv:!0}){const r=-Math.PI,l=2*Math.PI,h=-Math.PI/2,u=Math.PI,c=Math.max(3,Math.floor(e)),a=Math.max(2,Math.floor(o)),f=(c+1)*(a+1),p=O(3*f),i=O(3*f),w=O(2*f),g=[];let m=0;for(let O=0;O<=a;O++){const t=[],e=O/a,o=h+e*u,s=Math.cos(o);for(let h=0;h<=c;h++){const u=h/c,a=r+u*l,f=Math.cos(a)*s,g=Math.sin(o),O=-Math.sin(a)*s;p[3*m]=f*n,p[3*m+1]=g*n,p[3*m+2]=O*n,i[3*m]=f,i[3*m+1]=g,i[3*m+2]=O,w[2*m]=u,w[2*m+1]=e,t.push(m),++m}g.push(t)}const M=new Array;for(let O=0;O<a;O++)for(let t=0;t<c;t++){const n=g[O][t],e=g[O][t+1],o=g[O+1][t+1],s=g[O+1][t];0===O?(M.push(n),M.push(o),M.push(s)):O===a-1?(M.push(n),M.push(e),M.push(o)):(M.push(n),M.push(e),M.push(o),M.push(o),M.push(s),M.push(n))}const I=[[d.POSITION,new T(p,M,3,!0)],[d.NORMAL,new T(i,M,3,!0)]];return s.uv&&I.push([d.UV0,new T(w,M,2,!0)]),s.offset&&(I[0][0]=d.OFFSET,I.push([d.POSITION,new T(Float64Array.from(s.offset),A(M.length),3,!0)])),new b(t,I)}function st(t,n,e,o){const s=rt(n,e,o);return new b(t,s)}function rt(t,n,e){const o=t;let s,r;if(e)s=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],r=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const t=o*(1+Math.sqrt(5))/2;s=[-o,t,0,o,t,0,-o,-t,0,o,-t,0,0,-o,t,0,o,t,0,-o,-t,0,o,-t,t,0,-o,t,0,o,-t,0,-o,-t,0,o],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let c=0;c<s.length;c+=3)j.scale(s,c,t/j.length(s,c));let l={};function h(n,e){n>e&&([n,e]=[e,n]);const o=n.toString()+"."+e.toString();if(l[o])return l[o];let r=s.length;return s.length+=3,j.add(s,3*n,s,3*e,s,r),j.scale(s,r,t/j.length(s,r)),r/=3,l[o]=r,r}for(let c=0;c<n;c++){const t=r.length,n=new Array(4*t);for(let e=0;e<t;e+=3){const t=r[e],o=r[e+1],s=r[e+2],l=h(t,o),u=h(o,s),c=h(s,t),a=4*e;n[a]=t,n[a+1]=l,n[a+2]=c,n[a+3]=o,n[a+4]=u,n[a+5]=l,n[a+6]=s,n[a+7]=c,n[a+8]=u,n[a+9]=l,n[a+10]=u,n[a+11]=c}r=n,l={}}const u=m(s);for(let c=0;c<u.length;c+=3)j.normalize(u,c);return[[d.POSITION,new T(m(s),r,3,!0)],[d.NORMAL,new T(u,r,3,!0)]]}function lt(t,{normal:n,position:e,color:o,rotation:s,size:r,centerOffsetAndDistance:l,uvi:h,featureAttribute:u,objectAndLayerIdColor:c=null}={}){const a=e?p(e):i(),f=n?p(n):w(0,0,1),g=o?[255*o[0],255*o[1],255*o[2],o.length>3?255*o[3]:255]:[255,255,255,255],O=null!=r&&2===r.length?r:[1,1],m=null!=s?[s]:[0],M=A(1),I=[[d.POSITION,new T(a,M,3,!0)],[d.NORMAL,new T(f,M,3,!0)],[d.COLOR,new T(g,M,4,!0)],[d.SIZE,new T(O,M,2)],[d.ROTATION,new T(m,M,1,!0)]];if(h&&I.push([d.UVI,new T(h,M,h.length)]),null!=l){const t=[l[0],l[1],l[2],l[3]];I.push([d.CENTEROFFSETANDDISTANCE,new T(t,M,4)])}if(u){const t=[u[0],u[1],u[2],u[3]];I.push([d.FEATUREATTRIBUTE,new T(t,M,4)])}return new b(t,I,null,R.Point,c)}const ht=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function ut(t,n=ht){const e=new Array(12);for(let c=0;c<4;c++)for(let t=0;t<3;t++)e[3*c+t]=n[c][t];const o=[0,1,2,2,3,0],s=[0,0,1],r=[0,0,0,0,0,0],l=[0,0,1,0,1,1,0,1],h=[255,255,255,255],u=[[d.POSITION,new T(e,o,3,!0)],[d.NORMAL,new T(s,r,3,!0)],[d.UV0,new T(l,o,2,!0)],[d.COLOR,new T(h,r,4,!0)]];return new b(t,u)}function ct(t,n,e,o,s=!0,r=!0){let l=0;const h=n,u=t;let a=c(0,l,0),f=c(0,l+u,0),p=c(0,-1,0),i=c(0,1,0);o&&(l=u,f=c(0,0,0),a=c(0,l,0),p=c(0,1,0),i=c(0,-1,0));const w=[f,a],g=[p,i],m=e+2,A=Math.sqrt(u*u+h*h);if(o)for(let O=e-1;O>=0;O--){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*h,l,Math.sin(t)*h);w.push(n);const o=c(u*Math.cos(t)/A,-h/A,u*Math.sin(t)/A);g.push(o)}else for(let O=0;O<e;O++){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*h,l,Math.sin(t)*h);w.push(n);const o=c(u*Math.cos(t)/A,h/A,u*Math.sin(t)/A);g.push(o)}const M=new Array,I=new Array;if(s){for(let t=3;t<w.length;t++)M.push(1),M.push(t-1),M.push(t),I.push(0),I.push(0),I.push(0);M.push(w.length-1),M.push(2),M.push(1),I.push(0),I.push(0),I.push(0)}if(r){for(let t=3;t<w.length;t++)M.push(t),M.push(t-1),M.push(0),I.push(t),I.push(t-1),I.push(1);M.push(0),M.push(2),M.push(w.length-1),I.push(1),I.push(2),I.push(g.length-1)}const y=O(3*m);for(let c=0;c<m;c++)y[3*c]=w[c][0],y[3*c+1]=w[c][1],y[3*c+2]=w[c][2];const N=O(3*m);for(let c=0;c<m;c++)N[3*c]=g[c][0],N[3*c+1]=g[c][1],N[3*c+2]=g[c][2];return[[d.POSITION,new T(y,M,3,!0)],[d.NORMAL,new T(N,I,3,!0)]]}function at(t,n,e,o,s,r=!0,l=!0){return new b(t,ct(n,e,o,s,r,l))}function ft(t,h,u,p,i,w,g){const m=i?f(i):c(1,0,0),A=w?f(w):c(0,0,0);g??=!0;const M=a();e(M,m);const I=a();o(I,M,Math.abs(h));const y=a();o(y,I,-.5),s(y,y,A);const N=c(0,1,0);Math.abs(1-r(M,N))<.2&&l(N,0,0,1);const P=a();n(P,M,N),e(P,P),n(N,P,M);const S=2*p+(g?2:0),R=p+(g?2:0),L=O(3*S),j=O(3*R),E=O(2*S),U=new Array(3*p*(g?4:2)),V=new Array(3*p*(g?4:2));g&&(L[3*(S-2)]=y[0],L[3*(S-2)+1]=y[1],L[3*(S-2)+2]=y[2],E[2*(S-2)]=0,E[2*(S-2)+1]=0,L[3*(S-1)]=L[3*(S-2)]+I[0],L[3*(S-1)+1]=L[3*(S-2)+1]+I[1],L[3*(S-1)+2]=L[3*(S-2)+2]+I[2],E[2*(S-1)]=1,E[2*(S-1)+1]=1,j[3*(R-2)]=-M[0],j[3*(R-2)+1]=-M[1],j[3*(R-2)+2]=-M[2],j[3*(R-1)]=M[0],j[3*(R-1)+1]=M[1],j[3*(R-1)+2]=M[2]);const v=(t,n,e)=>{U[t]=n,V[t]=e};let x=0;const C=a(),F=a();for(let n=0;n<p;n++){const t=n*(2*Math.PI/p);o(C,N,Math.sin(t)),o(F,P,Math.cos(t)),s(C,C,F),j[3*n]=C[0],j[3*n+1]=C[1],j[3*n+2]=C[2],o(C,C,u),s(C,C,y),L[3*n]=C[0],L[3*n+1]=C[1],L[3*n+2]=C[2],E[2*n]=n/p,E[2*n+1]=0,L[3*(n+p)]=L[3*n]+I[0],L[3*(n+p)+1]=L[3*n+1]+I[1],L[3*(n+p)+2]=L[3*n+2]+I[2],E[2*(n+p)]=n/p,E[2*n+1]=1;const e=(n+1)%p;v(x++,n,n),v(x++,n+p,n),v(x++,e,e),v(x++,e,e),v(x++,n+p,n),v(x++,e+p,e)}if(g){for(let t=0;t<p;t++){const n=(t+1)%p;v(x++,S-2,R-2),v(x++,t,R-2),v(x++,n,R-2)}for(let t=0;t<p;t++){const n=(t+1)%p;v(x++,t+p,R-1),v(x++,S-1,R-1),v(x++,n+p,R-1)}}const G=[[d.POSITION,new T(L,U,3,!0)],[d.NORMAL,new T(j,V,3,!0)],[d.UV0,new T(E,U,2,!0)]];return new b(t,G)}function pt(t,n,e,o,s,r){o=o||10,s=null==s||s,L(n.length>1);const l=[[0,0,0]],h=[],u=[];for(let c=0;c<o;c++){h.push([0,-c-1,-(c+1)%o-1]);const t=c/o*2*Math.PI;u.push([Math.cos(t)*e,Math.sin(t)*e])}return it(t,u,n,l,h,s,r)}function it(r,u,a,f,p,w,g=c(0,0,0)){const m=u.length,A=O(a.length*m*3+(6*f.length||0)),M=O(a.length*m*3+(f?6:0)),S=new Array,R=new Array;let L=0,j=0;const E=i(),U=i(),V=i(),v=i(),x=i(),C=i(),F=i(),G=i(),D=i(),q=i(),z=i(),B=i(),k=i(),Z=I();l(D,0,1,0),t(U,a[1],a[0]),e(U,U),w?(s(G,a[0],g),e(V,G)):l(V,0,0,1),Mt(U,V,D,D,x,V,It),h(v,V),h(B,x);for(let t=0;t<f.length;t++)o(C,x,f[t][0]),o(G,V,f[t][2]),s(C,C,G),s(C,C,a[0]),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2];M[j++]=-U[0],M[j++]=-U[1],M[j++]=-U[2];for(let t=0;t<p.length;t++)S.push(p[t][0]>0?p[t][0]:-p[t][0]-1+f.length),S.push(p[t][1]>0?p[t][1]:-p[t][1]-1+f.length),S.push(p[t][2]>0?p[t][2]:-p[t][2]-1+f.length),R.push(0),R.push(0),R.push(0);let H=f.length;const J=f.length-1;for(let l=0;l<a.length;l++){let r=!1;if(l>0){h(E,U),l<a.length-1?(t(U,a[l+1],a[l]),e(U,U)):r=!0,s(q,E,U),e(q,q),s(z,a[l-1],v),y(a[l],q,Z);N(Z,P(z,E),G)?(t(G,G,a[l]),e(V,G),n(x,q,V),e(x,x)):Mt(q,v,B,D,x,V,It),h(v,V),h(B,x)}w&&(s(G,a[l],g),e(k,G));for(let t=0;t<m;t++)if(o(C,x,u[t][0]),o(G,V,u[t][1]),s(C,C,G),e(F,C),M[j++]=F[0],M[j++]=F[1],M[j++]=F[2],s(C,C,a[l]),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2],!r){const n=(t+1)%m;S.push(H+t),S.push(H+m+t),S.push(H+n),S.push(H+n),S.push(H+m+t),S.push(H+m+n);for(let t=0;t<6;t++){const n=S.length-6;R.push(S[n+t]-J)}}H+=m}const K=a[a.length-1];for(let t=0;t<f.length;t++)o(C,x,f[t][0]),o(G,V,f[t][1]),s(C,C,G),s(C,C,K),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2];const Q=j/3;M[j++]=U[0],M[j++]=U[1],M[j++]=U[2];const W=H-m;for(let t=0;t<p.length;t++)S.push(p[t][0]>=0?H+p[t][0]:-p[t][0]-1+W),S.push(p[t][2]>=0?H+p[t][2]:-p[t][2]-1+W),S.push(p[t][1]>=0?H+p[t][1]:-p[t][1]-1+W),R.push(Q),R.push(Q),R.push(Q);const X=[[d.POSITION,new T(A,S,3,!0)],[d.NORMAL,new T(M,R,3,!0)]];return new b(r,X)}function wt(t,n,e,o){L(n.length>1,"createPolylineGeometry(): polyline needs at least 2 points"),L(3===n[0].length,"createPolylineGeometry(): malformed vertex"),L(null==e||e.length===n.length,"createPolylineGeometry: need same number of points and normals"),L(null==e||3===e[0].length,"createPolylineGeometry(): malformed normal");const s=g(3*n.length),r=new Array(2*(n.length-1));let l=0,h=0;for(let c=0;c<n.length;c++){for(let t=0;t<3;t++)s[l++]=n[c][t];c>0&&(r[h++]=c-1,r[h++]=c)}const u=[[d.POSITION,new T(s,r,3,!0)]];if(e){const t=O(3*e.length);let o=0;for(let s=0;s<n.length;s++)for(let n=0;n<3;n++)t[o++]=e[s][n];u.push([d.NORMAL,new T(t,r,3,!0)])}return o&&u.push([d.COLOR,new T(o,M(o.length/4),4)]),new b(t,u,null,R.Line)}function gt(t,n,e,o,s,r=0){const l=new Array(18),h=[[-e,r,s/2],[o,r,s/2],[0,n+r,s/2],[-e,r,-s/2],[o,r,-s/2],[0,n+r,-s/2]],u=[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5];for(let c=0;c<6;c++)l[3*c]=h[c][0],l[3*c+1]=h[c][1],l[3*c+2]=h[c][2];return new b(t,[[d.POSITION,new T(l,u,3,!0)]])}function Ot(t,n){const e=t.getMutableAttribute(d.POSITION).data;for(let o=0;o<e.length;o+=3){const t=e[o],s=e[o+1],r=e[o+2];l(yt,t,s,r),u(yt,yt,n),e[o]=yt[0],e[o+1]=yt[1],e[o+2]=yt[2]}}function mt(t,n=t){const e=t.attributes,o=e.get(d.POSITION).data,s=e.get(d.NORMAL).data;if(s){const t=n.getMutableAttribute(d.NORMAL).data;for(let n=0;n<s.length;n+=3){const e=s[n+1];t[n+1]=-s[n+2],t[n+2]=e}}if(o){const t=n.getMutableAttribute(d.POSITION).data;for(let n=0;n<o.length;n+=3){const e=o[n+1];t[n+1]=-o[n+2],t[n+2]=e}}}function At(t,o,s,l,h){return!(Math.abs(r(o,t))>h)&&(n(s,t,o),e(s,s),n(l,s,t),e(l,l),!0)}function Mt(t,n,e,o,s,r,l){return At(t,n,s,r,l)||At(t,e,s,r,l)||At(t,o,s,r,l)}const It=.99619469809,yt=i();export{mt as cgToGIS,F as createBoxGeometry,at as createConeGeometry,ct as createConeGeometryData,ft as createCylinderGeometry,B as createDiamondGeometry,gt as createExtrudedTriangle,it as createPathExtrusionGeometry,lt as createPointGeometry,rt as createPolySphereData,st as createPolySphereGeometry,wt as createPolylineGeometry,ot as createSphereGeometry,ut as createSquareGeometry,et as createTetrahedronGeometry,pt as createTubeGeometry,Mt as makeOrthoBasisDirUpFallback,Ot as transformInPlace};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- var i,e;!function(i){i[i.OBJECT=0]="OBJECT",i[i.HUD=1]="HUD",i[i.TERRAIN=2]="TERRAIN",i[i.OVERLAY=3]="OVERLAY",i[i.I3S=4]="I3S",i[i.PCL=5]="PCL",i[i.LOD=6]="LOD",i[i.VOXEL=7]="VOXEL",i[i.TILES3D=8]="TILES3D"}(i||(i={}));class s{constructor(){this.verticalOffset=0,this.selectionMode=!1,this.hud=!0,this.selectOpaqueTerrainOnly=!0,this.invisibleTerrain=!1,this.backfacesTerrain=!0,this.isFiltered=!1,this.filteredLayerUids=[],this.store=e.ALL,this.normalRequired=!0,this.excludeLabels=!1}}!function(i){i[i.MIN=0]="MIN",i[i.MINMAX=1]="MINMAX",i[i.ALL=2]="ALL"}(e||(e={}));export{s as IntersectorOptions,i as IntersectorType,e as StoreResults};
5
+ var i,e;!function(i){i[i.OBJECT=0]="OBJECT",i[i.HUD=1]="HUD",i[i.TERRAIN=2]="TERRAIN",i[i.OVERLAY=3]="OVERLAY",i[i.I3S=4]="I3S",i[i.PCL=5]="PCL",i[i.LOD=6]="LOD",i[i.VOXEL=7]="VOXEL",i[i.TILES3D=8]="TILES3D"}(i||(i={}));class s{constructor(){this.verticalOffset=0,this.selectionMode=!1,this.hud=!0,this.selectOpaqueTerrainOnly=!0,this.invisibleTerrain=!1,this.backfacesTerrain=!0,this.isFiltered=!1,this.filteredLayerViewUids=[],this.store=e.ALL,this.normalRequired=!0,this.excludeLabels=!1}}!function(i){i[i.MIN=0]="MIN",i[i.MINMAX=1]="MINMAX",i[i.ALL=2]="ALL"}(e||(e={}));export{s as IntersectorOptions,i as IntersectorType,e as StoreResults};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{clone as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";class t{constructor(s,t,r){this.object=s,this.geometryId=t,this.primIndex=r}}class r extends t{constructor(t,r,c,e){super(t,r,c),this.center=null!=e?s(e):null}}class c extends r{}class e{constructor(s){this.layerUid=s}}class o extends e{constructor(s,t){super(s),this.graphicUid=t}}export{o as Graphic3DTarget,r as HudTarget,e as LayerTarget,t as ObjectTarget,c as ValidHudTarget};
5
+ import{clone as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";class t{constructor(s,t,r){this.object=s,this.geometryId=t,this.primIndex=r}}class r extends t{constructor(t,r,e,c){super(t,r,e),this.center=null!=c?s(c):null}}class e extends r{}class c{constructor(s){this.layerViewUid=s}}class i extends c{constructor(s,t){super(s),this.graphicUid=t}}export{i as Graphic3DTarget,r as HudTarget,c as LayerTarget,t as ObjectTarget,e as ValidHudTarget};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{releaseMaybe as e}from"../../../../core/maybe.js";import{c as t}from"../../../../chunks/vec42.js";import{ZEROS as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ColorFormat as r,DepthFormat as o}from"../../webgl/formats.js";import{ViewportSize as h}from"./BindParameters.js";import{FramebufferBit as c,ColorAttachment1 as l}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as _}from"../../../webgl/FramebufferObject.js";class a{constructor(e){this._fbos=e,this._requiresEmission=!1,this._size=new h(0,0),this._clearColor=s()}dispose(){this._color=e(this._color),this.releaseDepth()}initialize(e,i,s,r){this._size.width=e,this._size.height=i,_(this._size,this._fbos.rctx.parameters.maxTextureSize);const o=this._color;return this._color=null,this.releaseDepth(),this._requiresEmission=r,t(this._clearColor,s),o}releaseDepth(){this._color?.detachDepth(),this._depth=e(this._depth)}update(e){const t=this._ensureColor();t.attachDepth(this.depth),this._color=e(t)}bind(){const{rctx:e}=this._fbos,t=null==this._color;this.color.attachDepth(this.depth),e.bindFramebuffer(this.color.fbo),t&&(e.setClearStencil(0),e.setClearColor(this._clearColor[0],this._clearColor[1],this._clearColor[2],this._clearColor[3]),e.clear(c.COLOR|c.DEPTH|c.STENCIL),this._requiresEmission&&e.clearBuffer(1,i))}_acquireColor(){return this._requiresEmission?this._fbos.acquire(this._size.width,this._size.height,"acquired-color").acquireColor(l,r.RGBA16F,"emissive"):this._fbos.acquire(this._size.width,this._size.height,"acquired-color")}_acquireDepth(){return this._fbos.acquireDepth(o.DEPTH_STENCIL_TEXTURE,this._size.width,this._size.height,"depth")}get size(){return this._size}get color(){return this._ensureColor()}get depth(){return this._depth??=this._acquireDepth(),this._depth}_ensureColor(){return this._color??=this._acquireColor(),this._color}}export{a as MainFramebuffer};
5
+ import{releaseMaybe as e}from"../../../../core/maybe.js";import{c as t}from"../../../../chunks/vec42.js";import{ZEROS as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ColorFormat as r}from"../../webgl/formats.js";import{ViewportSize as o}from"./BindParameters.js";import{FramebufferBit as h,ColorAttachment1 as c,DepthStencilAttachment as l}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as _}from"../../../webgl/FramebufferObject.js";class a{constructor(e){this._fbos=e,this._requiresEmission=!1,this._size=new o(0,0),this._clearColor=s()}dispose(){this._color=e(this._color),this.releaseDepth()}initialize(e,i,s,r){this._size.width=e,this._size.height=i,_(this._size,this._fbos.rctx.parameters.maxTextureSize);const o=this._color;return this._color=null,this.releaseDepth(),this._requiresEmission=r,t(this._clearColor,s),o}releaseDepth(){this._color?.detachDepth(),this._depth=e(this._depth)}update(e){const t=this._ensureColor();t.attachDepth(this.depth),this._color=e(t)}bind(){const{rctx:e}=this._fbos,t=null==this._color;this.color.attachDepth(this.depth),e.bindFramebuffer(this.color.fbo),t&&(e.setClearStencil(0),e.setClearColor(this._clearColor[0],this._clearColor[1],this._clearColor[2],this._clearColor[3]),e.clear(h.COLOR|h.DEPTH|h.STENCIL),this._requiresEmission&&e.clearBuffer(1,i))}_acquireColor(){return this._requiresEmission?this._fbos.acquire(this._size.width,this._size.height,"acquired-color").acquireColor(c,r.RGBA16F,"emissive"):this._fbos.acquire(this._size.width,this._size.height,"acquired-color")}_acquireDepth(){return this._fbos.acquireDepth(l,this._size.width,this._size.height,"depth")}get size(){return this._size}get color(){return this._ensureColor()}get depth(){return this._depth??=this._acquireDepth(),this._depth}_ensureColor(){return this._color??=this._acquireColor(),this._color}}export{a as MainFramebuffer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{copy as t,multiply as e,hasIdentityRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{m as o,t as a,j as n,i as h,g as m,p as c,c as l}from"../../../../chunks/vec32.js";import{fromValues as d,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as u,c as f}from"../../../../chunks/sphere.js";import{maxScale as _}from"../../support/mathUtils.js";import{Object3DState as b}from"./basicInterfaces.js";import{ContentObject as p}from"./ContentObject.js";import{ContentObjectType as v}from"./ContentObjectType.js";import{Object3DOccludeeStateID as j,Object3DHighlightStateID as S}from"./Object3DStateID.js";import{assert as y}from"./Util.js";import{affectsGeometry as x}from"./VertexAttribute.js";import{addObject3DStateID as V,removeObject3DStateID as O}from"../materials/renderers/utils.js";class A extends p{get geometries(){return this._geometries}get transformation(){return this._transformation??s}set transformation(e){this._transformation=t(this._transformation??r(),e),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(e){this._shaderTransformation=e?t(this._shaderTransformation??r(),e):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}constructor(t={}){super(),this.type=v.Object,this._shaderTransformation=null,this._parentLayer=null,this._visible=!0,this._highlightIds=new Set,this.castShadow=t.castShadow??!0,this.usesVerticalDistanceToGround=t.usesVerticalDistanceToGround??!1,this.graphicUid=t.graphicUid,this.layerUid=t.layerUid,t.isElevationSource&&(this.lastValidElevationBB=new C),this._geometries=t.geometries?Array.from(t.geometries):new Array}dispose(){this._geometries.length=0}get parentLayer(){return this._parentLayer}set parentLayer(t){y(null==this._parentLayer||null==t,"Object3D can only be added to a single Layer"),this._parentLayer=t}addGeometry(t){t.visible=this._visible,this._geometries.push(t);for(const e of this._highlightIds)t.addHighlight(e);this._emit("geometryAdded",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(t){const e=this._geometries.splice(t,1)[0];if(e){for(const t of this._highlightIds)e.removeHighlight(t);this._emit("geometryRemoved",{object:this,geometry:e}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,e,i=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:e,sync:i}),x(e)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometries)t.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new j;for(const e of this._geometries)e.occludees=V(e.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const e of this._geometries)e.occludees=O(e.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const e=new S(t);for(const i of this._geometries)i.addHighlight(e);return this._emit("highlightChanged",this),this._highlightIds.add(e),e}removeHighlight(t){this._highlightIds.delete(t);for(const e of this._geometries)e.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){t.channel===b.Highlight?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,i){return e(i,this.transformation,t.transformation)}getCombinedShaderTransformation(t,i=r()){return e(i,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=this._bvWorldSpace||new L,this._validateBoundingVolume(this._bvWorldSpace,W.WorldSpace)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=this._bvObjectSpace||new L,this._validateBoundingVolume(this._bvObjectSpace,W.ObjectSpace)),this._bvObjectSpace}_validateBoundingVolume(t,e){const i=e===W.ObjectSpace;for(const s of this._geometries){const e=s.boundingInfo;e&&M(e,t,i?s.transformation:this.getCombinedShaderTransformation(s))}o(u(t.bounds),t.min,t.max,.5);for(const s of this._geometries){const e=s.boundingInfo;if(null==e)continue;const r=i?s.transformation:this.getCombinedShaderTransformation(s),o=_(r);a(I,e.center,r);const h=n(I,u(t.bounds)),m=e.radius*o;t.bounds[3]=Math.max(t.bounds[3],h+m)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this._parentLayer&&t&&this._parentLayer.notifyObjectBBChanged(this,t)}_emit(t,e){this._parentLayer&&this._parentLayer.events.emit(t,e)}get test(){}}class C{constructor(){this.min=d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class L extends C{constructor(){super(...arguments),this.bounds=f()}}function M(t,e,s){const r=t.bbMin,o=t.bbMax;if(i(s)){const t=h(T,s[12],s[13],s[14]);m(B,r,t),m(U,o,t);for(let i=0;i<3;++i)e.min[i]=Math.min(e.min[i],B[i]),e.max[i]=Math.max(e.max[i],U[i])}else if(a(B,r,s),c(r,o))for(let i=0;i<3;++i)e.min[i]=Math.min(e.min[i],B[i]),e.max[i]=Math.max(e.max[i],B[i]);else{a(U,o,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],B[t],U[t]),e.max[t]=Math.max(e.max[t],B[t],U[t]);for(let t=0;t<3;++t){l(B,r),l(U,o),B[t]=o[t],U[t]=r[t],a(B,B,s),a(U,U,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],B[t],U[t]),e.max[t]=Math.max(e.max[t],B[t],U[t])}}}const T=g(),B=g(),U=g(),I=g();var W;!function(t){t[t.WorldSpace=0]="WorldSpace",t[t.ObjectSpace=1]="ObjectSpace"}(W||(W={}));export{L as BoundingVolume,A as Object3D};
5
+ import"../../../../core/has.js";import{copy as t,multiply as e,hasIdentityRotation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{m as o,t as a,j as n,i as h,g as m,p as c,c as l}from"../../../../chunks/vec32.js";import{fromValues as d,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as u,c as f}from"../../../../chunks/sphere.js";import{maxScale as _}from"../../support/mathUtils.js";import{Object3DState as b}from"./basicInterfaces.js";import{ContentObject as p}from"./ContentObject.js";import{ContentObjectType as v}from"./ContentObjectType.js";import{Object3DOccludeeStateID as j,Object3DHighlightStateID as S}from"./Object3DStateID.js";import{assert as y}from"./Util.js";import{affectsGeometry as x}from"./VertexAttribute.js";import{addObject3DStateID as V,removeObject3DStateID as O}from"../materials/renderers/utils.js";class A extends p{get geometries(){return this._geometries}get transformation(){return this._transformation??s}set transformation(e){this._transformation=t(this._transformation??r(),e),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(e){this._shaderTransformation=e?t(this._shaderTransformation??r(),e):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}constructor(t={}){super(),this.type=v.Object,this._shaderTransformation=null,this._parentLayer=null,this._visible=!0,this._highlightIds=new Set,this.castShadow=t.castShadow??!0,this.usesVerticalDistanceToGround=t.usesVerticalDistanceToGround??!1,this.graphicUid=t.graphicUid,this.layerViewUid=t.layerViewUid,t.isElevationSource&&(this.lastValidElevationBB=new C),this._geometries=t.geometries?Array.from(t.geometries):new Array}dispose(){this._geometries.length=0}get parentLayer(){return this._parentLayer}set parentLayer(t){y(null==this._parentLayer||null==t,"Object3D can only be added to a single Layer"),this._parentLayer=t}addGeometry(t){t.visible=this._visible,this._geometries.push(t);for(const e of this._highlightIds)t.addHighlight(e);this._emit("geometryAdded",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(t){const e=this._geometries.splice(t,1)[0];if(e){for(const t of this._highlightIds)e.removeHighlight(t);this._emit("geometryRemoved",{object:this,geometry:e}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,e,i=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:e,sync:i}),x(e)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometries)t.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new j;for(const e of this._geometries)e.occludees=V(e.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const e of this._geometries)e.occludees=O(e.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const e=new S(t);for(const i of this._geometries)i.addHighlight(e);return this._emit("highlightChanged",this),this._highlightIds.add(e),e}removeHighlight(t){this._highlightIds.delete(t);for(const e of this._geometries)e.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){t.channel===b.Highlight?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,i){return e(i,this.transformation,t.transformation)}getCombinedShaderTransformation(t,i=r()){return e(i,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=this._bvWorldSpace||new L,this._validateBoundingVolume(this._bvWorldSpace,w.WorldSpace)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=this._bvObjectSpace||new L,this._validateBoundingVolume(this._bvObjectSpace,w.ObjectSpace)),this._bvObjectSpace}_validateBoundingVolume(t,e){const i=e===w.ObjectSpace;for(const s of this._geometries){const e=s.boundingInfo;e&&M(e,t,i?s.transformation:this.getCombinedShaderTransformation(s))}o(u(t.bounds),t.min,t.max,.5);for(const s of this._geometries){const e=s.boundingInfo;if(null==e)continue;const r=i?s.transformation:this.getCombinedShaderTransformation(s),o=_(r);a(I,e.center,r);const h=n(I,u(t.bounds)),m=e.radius*o;t.bounds[3]=Math.max(t.bounds[3],h+m)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this._parentLayer&&t&&this._parentLayer.notifyObjectBBChanged(this,t)}_emit(t,e){this._parentLayer&&this._parentLayer.events.emit(t,e)}get test(){}}class C{constructor(){this.min=d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]<this.min[0]&&this.max[1]<this.min[1]&&this.max[2]<this.min[2]}}class L extends C{constructor(){super(...arguments),this.bounds=f()}}function M(t,e,s){const r=t.bbMin,o=t.bbMax;if(i(s)){const t=h(T,s[12],s[13],s[14]);m(B,r,t),m(U,o,t);for(let i=0;i<3;++i)e.min[i]=Math.min(e.min[i],B[i]),e.max[i]=Math.max(e.max[i],U[i])}else if(a(B,r,s),c(r,o))for(let i=0;i<3;++i)e.min[i]=Math.min(e.min[i],B[i]),e.max[i]=Math.max(e.max[i],B[i]);else{a(U,o,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],B[t],U[t]),e.max[t]=Math.max(e.max[t],B[t],U[t]);for(let t=0;t<3;++t){l(B,r),l(U,o),B[t]=o[t],U[t]=r[t],a(B,B,s),a(U,U,s);for(let t=0;t<3;++t)e.min[t]=Math.min(e.min[t],B[t],U[t]),e.max[t]=Math.max(e.max[t],B[t],U[t])}}}const T=g(),B=g(),U=g(),I=g();var w;!function(t){t[t.WorldSpace=0]="WorldSpace",t[t.ObjectSpace=1]="ObjectSpace"}(w||(w={}));export{L as BoundingVolume,A as Object3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{NestedMap as e}from"../../../../core/NestedMap.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewVec4u8 as t}from"../../../../geometry/support/buffer/BufferView.js";class o{constructor(){this.declaredClass="esri.views.3d.webgl-engine.lib.ObjectAndLayerIdRenderHelper",this.colorZero=new t(new ArrayBuffer(4)),this._layerToOidToColor=new e,this._colorToUID=new Map,this._layerUidToGraphicsUidToObjectId=new e,this._layerUidToId=new Map,this._layerUidToPopupEnabled=new Map}setUidToObjectAndLayerId(e,r,t,o,i,d=null,a=null,s=null){e&&r&&t&&o&&(this._layerUidToId.set(o,t),this._layerUidToPopupEnabled.set(o,i),i&&this._layerUidToGraphicsUidToObjectId.set(o,r,{objectId:e,attributeNodeId:d,attributeIndex:a,subLayerId:s}))}getObjectAndLayerIdColor(e){const t=this.getObjectAndLayerIdColorArray(e);return r(t.get(0,1),t.get(0,2),t.get(0,3),255)}getObjectAndLayerIdColorArray(e){if(!e.layerUid||!e.graphicUid)return this.colorZero;const r=this._layerUidToPopupEnabled.get(e.layerUid);if(void 0===r)return this.colorZero;if(!1===r)return this.colorZero;const o=this._layerUidToGraphicsUidToObjectId.get(e.layerUid,e.graphicUid)?.objectId;if(!o)return this.colorZero;let i=this._layerToOidToColor.get(e.layerUid,o);if(!i){if(!!has("enable-feature:objectAndLayerId-screenshot-testing"))i=o;else for(;!i;){const e=Math.floor(16777214*Math.random())+1;this._colorToUID.has(e)||(i=e)}if(i>16777215)throw new Error("Object ID Overflow");this._layerToOidToColor.set(e.layerUid,o,i),this._colorToUID.set(i,e)}const d=new ArrayBuffer(4);new DataView(d).setUint32(0,i,!1);return new t(d)}getColorToObjectAndLayerIdMapping(){const e=new Map;for(const[r,t]of this._colorToUID.entries()){const o=this._layerUidToGraphicsUidToObjectId.get(t.layerUid,t.graphicUid),i=this._layerUidToId.get(t.layerUid);o&&i&&e.set(r,o.attributeNodeId?{type:"object-and-layer-and-i3s-id",olid:o.objectId,lid:i,attrId:o.attributeNodeId,attrIdx:o.attributeIndex,subLayerId:o.subLayerId}:{type:"object-and-layer-id",olid:o.objectId,lid:i})}return e}}export{o as ObjectAndLayerIdRenderHelper};
5
+ import has from"../../../../core/has.js";import{NestedMap as e}from"../../../../core/NestedMap.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewVec4u8 as t}from"../../../../geometry/support/buffer/BufferView.js";class o{constructor(){this.declaredClass="esri.views.3d.webgl-engine.lib.ObjectAndLayerIdRenderHelper",this.colorZero=new t(new ArrayBuffer(4)),this._layerToOidToColor=new e,this._colorToUID=new Map,this._layerViewUidToGraphicsUidToObjectId=new e,this._layerViewUidToLayerId=new Map,this._layerViewUidToPopupEnabled=new Map}setUidToObjectAndLayerId(e,r,t,o,i,d=null,a=null,s=null){e&&r&&t&&o&&(this._layerViewUidToLayerId.set(o,t),this._layerViewUidToPopupEnabled.set(o,i),i&&this._layerViewUidToGraphicsUidToObjectId.set(o,r,{objectId:e,attributeNodeId:d,attributeIndex:a,subLayerId:s}))}getObjectAndLayerIdColor(e){const t=this.getObjectAndLayerIdColorArray(e);return r(t.get(0,1),t.get(0,2),t.get(0,3),255)}getObjectAndLayerIdColorArray(e){if(!e.layerViewUid||!e.graphicUid)return this.colorZero;const r=this._layerViewUidToPopupEnabled.get(e.layerViewUid);if(void 0===r)return this.colorZero;if(!1===r)return this.colorZero;const o=this._layerViewUidToGraphicsUidToObjectId.get(e.layerViewUid,e.graphicUid)?.objectId;if(!o)return this.colorZero;let i=this._layerToOidToColor.get(e.layerViewUid,o);if(!i){if(!!has("enable-feature:objectAndLayerId-screenshot-testing"))i=o;else for(;!i;){const e=Math.floor(16777214*Math.random())+1;this._colorToUID.has(e)||(i=e)}if(i>16777215)throw new Error("Object ID Overflow");this._layerToOidToColor.set(e.layerViewUid,o,i),this._colorToUID.set(i,e)}const d=new ArrayBuffer(4);new DataView(d).setUint32(0,i,!1);return new t(d)}getColorToObjectAndLayerIdMapping(){const e=new Map;for(const[r,t]of this._colorToUID.entries()){const o=this._layerViewUidToGraphicsUidToObjectId.get(t.layerViewUid,t.graphicUid),i=this._layerViewUidToLayerId.get(t.layerViewUid);o&&i&&e.set(r,o.attributeNodeId?{type:"object-and-layer-and-i3s-id",olid:o.objectId,lid:i,attrId:o.attributeNodeId,attrIdx:o.attributeIndex,subLayerId:o.subLayerId}:{type:"object-and-layer-id",olid:o.objectId,lid:i})}return e}}export{o as ObjectAndLayerIdRenderHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{generateUID as t}from"../../../../core/uid.js";import{copy as r,multiply as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as s}from"../../../../chunks/vec32.js";import{N as o,c as n,a as h}from"../../../../chunks/sphere.js";import{maxScale as a}from"../../support/mathUtils.js";class g{constructor(r,i={}){this.geometry=r,this.screenToWorldRatio=1,this._transformation=e(),this._shaderTransformation=null,this._boundingSphere=null,this.id=t(),this.layerUid=i.layerUid,this.graphicUid=i.graphicUid,this.castShadow=i.castShadow??!1,i.objectShaderTransformation&&this.objectShaderTransformationChanged(i.objectShaderTransformation)}get transformation(){return this._transformation}set transformation(t){r(this._transformation,t),this._boundingSphere=null}get boundingInfo(){return this.geometry.boundingInfo}objectShaderTransformationChanged(t){null==t?this._shaderTransformation=null:(this._shaderTransformation??=e(),i(this._shaderTransformation,t,this.geometry.transformation)),this._boundingSphere=null}get boundingSphere(){return this.boundingInfo?(null==this._boundingSphere&&(this._boundingSphere??=n(),s(h(this._boundingSphere),this.boundingInfo.center,this.shaderTransformation),this._boundingSphere[3]=this.boundingInfo.radius*a(this.shaderTransformation)),this._boundingSphere):o}get material(){return this.geometry.material}get type(){return this.geometry.type}get shaderTransformation(){return this._shaderTransformation??this.transformation}get attributes(){return this.geometry.attributes}get highlight(){return this.geometry.highlights}foreachHighlightOptions(t){this.geometry.foreachHighlightOptions(t)}get hasHighlights(){return this.geometry.hasHighlights}get occludees(){return this.geometry.occludees}get visible(){return this.geometry.visible}set visible(t){this.geometry.visible=t}}class m extends g{}export{g as RenderGeometry,m as ValidatedRenderGeometry};
5
+ import{generateUID as t}from"../../../../core/uid.js";import{copy as r,multiply as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as s}from"../../../../chunks/vec32.js";import{N as o,c as n,a as h}from"../../../../chunks/sphere.js";import{maxScale as a}from"../../support/mathUtils.js";class g{constructor(r,i={}){this.geometry=r,this.screenToWorldRatio=1,this._transformation=e(),this._shaderTransformation=null,this._boundingSphere=null,this.id=t(),this.layerViewUid=i.layerViewUid,this.graphicUid=i.graphicUid,this.castShadow=i.castShadow??!1,i.objectShaderTransformation&&this.objectShaderTransformationChanged(i.objectShaderTransformation)}get transformation(){return this._transformation}set transformation(t){r(this._transformation,t),this._boundingSphere=null}get boundingInfo(){return this.geometry.boundingInfo}objectShaderTransformationChanged(t){null==t?this._shaderTransformation=null:(this._shaderTransformation??=e(),i(this._shaderTransformation,t,this.geometry.transformation)),this._boundingSphere=null}get boundingSphere(){return this.boundingInfo?(null==this._boundingSphere&&(this._boundingSphere??=n(),s(h(this._boundingSphere),this.boundingInfo.center,this.shaderTransformation),this._boundingSphere[3]=this.boundingInfo.radius*a(this.shaderTransformation)),this._boundingSphere):o}get material(){return this.geometry.material}get type(){return this.geometry.type}get shaderTransformation(){return this._shaderTransformation??this.transformation}get attributes(){return this.geometry.attributes}get highlight(){return this.geometry.highlights}foreachHighlightOptions(t){this.geometry.foreachHighlightOptions(t)}get hasHighlights(){return this.geometry.hasHighlights}get occludees(){return this.geometry.occludees}get visible(){return this.geometry.visible}set visible(t){this.geometry.visible=t}}class m extends g{}export{g as RenderGeometry,m as ValidatedRenderGeometry};