@arcgis/core 6.0.0-next.36 → 6.0.0-next.37

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 (163) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{0202eb8c2b2865f99981.js → 00311d1b18d5952a014b.js} +1 -1
  3. package/assets/esri/core/workers/chunks/0b21d0e2e5a91c34a108.js +1 -0
  4. package/assets/esri/core/workers/chunks/{f717005e14a7e9141df7.js → 2050c844b5a29b1df28a.js} +1 -1
  5. package/assets/esri/core/workers/chunks/2c3612379111457c3221.js +1 -0
  6. package/assets/esri/core/workers/chunks/2f9072563194026e320e.js +1 -0
  7. package/assets/esri/core/workers/chunks/{d9a240a3c6bf85124474.js → 342a97974a78007b25e0.js} +1 -1
  8. package/assets/esri/core/workers/chunks/34467f7d84baffd772a3.js +1 -0
  9. package/assets/esri/core/workers/chunks/{4d18b48d4a282a0f341c.js → 427d929dc7f89b0a1ea9.js} +1 -1
  10. package/assets/esri/core/workers/chunks/432728c557be5dfa26b5.js +1 -0
  11. package/assets/esri/core/workers/chunks/46969f379623810b2eca.js +1 -0
  12. package/assets/esri/core/workers/chunks/592b5db1459c02cf6a0c.js +1 -0
  13. package/assets/esri/core/workers/chunks/6a21dc13a465757ba007.js +1 -0
  14. package/assets/esri/core/workers/chunks/{379db67f78161ebd5468.js → 7023651ed6398dcf8efb.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{90360c0bd053d3e3fd77.js → 7027a0e7bfabb3bb7fc2.js} +1 -1
  16. package/assets/esri/core/workers/chunks/78818c2a898444f7e890.js +1 -0
  17. package/assets/esri/core/workers/chunks/{40c2674dae73f0942751.js → 7d497df6e13162156342.js} +1 -1
  18. package/assets/esri/core/workers/chunks/8a3dfe997712dc2ddead.js +1 -0
  19. package/assets/esri/core/workers/chunks/{81bcc495e6eaf2cf7474.js → 8f82a0a6747f673a2a7e.js} +1 -1
  20. package/assets/esri/core/workers/chunks/9826baa3c15ea2062669.js +1 -0
  21. package/assets/esri/core/workers/chunks/{d3369ffed19f4c264dcd.js → 9ab0735e86cf8932bf9d.js} +1 -1
  22. package/assets/esri/core/workers/chunks/ab0ea4042f4e13874aed.js +1 -0
  23. package/assets/esri/core/workers/chunks/ab98ade3257360015d6c.js +1 -0
  24. package/assets/esri/core/workers/chunks/{796c6195b6bf59dcc9bd.js → b25a05c58b0fd0f6ac60.js} +1 -1
  25. package/assets/esri/core/workers/chunks/b90271ce38522bcf813b.js +1 -0
  26. package/assets/esri/core/workers/chunks/ba91df9835cdea7698a9.js +1 -0
  27. package/assets/esri/core/workers/chunks/bfe13ac9fa1aafb190a1.js +1 -0
  28. package/assets/esri/core/workers/chunks/ce0274847ccce6a1ac53.js +1 -0
  29. package/assets/esri/core/workers/chunks/cf2e5f827cea7d7319ce.js +1 -0
  30. package/assets/esri/core/workers/chunks/dae2036faa28dade2119.js +1 -0
  31. package/assets/esri/core/workers/chunks/{e8fb2ba7b7a4f0916325.js → eed4b90494a54f8b337b.js} +1 -1
  32. package/assets/esri/core/workers/chunks/fc77eb7683e708774168.js +1 -0
  33. package/chunks/Clouds.glsl.js +7 -11
  34. package/config.js +1 -1
  35. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  36. package/kernel.js +1 -1
  37. package/layers/BaseElevationLayer.js +1 -1
  38. package/layers/ElevationLayer.js +1 -1
  39. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  40. package/layers/IntegratedMeshLayer.d.ts +2 -0
  41. package/layers/IntegratedMeshLayer.js +1 -1
  42. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  43. package/layers/support/ElevationQuery.js +1 -1
  44. package/layers/video/VideoController.js +3 -3
  45. package/layers/video/types.d.ts +12 -0
  46. package/package.json +3 -3
  47. package/views/2d/engine/Bitmap.js +1 -1
  48. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  49. package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
  50. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  51. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  52. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  53. package/views/2d/engine/webgl/Overlay.js +1 -1
  54. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  55. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  56. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  57. package/views/2d/engine/webgl/animations/store/AnimationStore.js +1 -1
  58. package/views/2d/engine/webgl/collisions/LabelStore.js +1 -1
  59. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  60. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  61. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  62. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
  63. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  64. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  65. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  66. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  67. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  68. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  69. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  70. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  71. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTexture.js +1 -1
  72. package/views/2d/engine/webgl/textureUtils.js +1 -1
  73. package/views/2d/layers/LayerView2D.js +1 -1
  74. package/views/2d/webglDeps.js +1 -1
  75. package/views/3d/GroundView3D.js +1 -1
  76. package/views/3d/input/SceneInputManager.js +1 -1
  77. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  78. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  79. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  80. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  81. package/views/3d/support/engineContent/line.js +1 -1
  82. package/views/3d/support/engineContent/marker.js +1 -1
  83. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  84. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  85. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  86. package/views/3d/support/flow/geometryUtils.js +1 -1
  87. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  88. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  89. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  90. package/views/3d/support/gaussianSplatting/GaussianTileBuilder.js +2 -0
  91. package/views/3d/support/gaussianSplatting/formatConstants.js +2 -0
  92. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  93. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  94. package/views/3d/terrain/OverlayRenderer.js +1 -1
  95. package/views/3d/terrain/TerrainRenderer.js +1 -1
  96. package/views/3d/terrain/TerrainSurface.js +1 -1
  97. package/views/3d/terrain/TileCompositor.js +1 -1
  98. package/views/3d/terrain/TileRenderer.js +1 -1
  99. package/views/3d/webgl/RenderNode.d.ts +1 -1
  100. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  101. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  102. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
  103. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +15 -11
  104. package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
  105. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  106. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  107. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  108. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  109. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  110. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  111. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  112. package/views/3d/webgl-engine/lib/AttributeView.js +1 -1
  113. package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
  114. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  115. package/views/3d/webgl-engine/lib/DDSUtil.js +1 -1
  116. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  117. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  118. package/views/3d/webgl-engine/lib/GaussianSplatRenderUtils.js +1 -1
  119. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  120. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  121. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
  122. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +1 -1
  123. package/views/3d/webgl-engine/lib/VerticesView.js +2 -0
  124. package/views/3d/webgl-engine/lib/attributeViewUtils.js +1 -1
  125. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  126. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  127. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  128. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  129. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  130. package/views/3d/webgl-engine/materials/internal/lineMarkerBufferUtils.js +2 -0
  131. package/views/3d/webgl-engine/materials/internal/ribbonLineBufferUtils.js +2 -0
  132. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  133. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  134. package/views/draw/support/ManagedTooltipField.js +1 -1
  135. package/views/support/TextureCompressionHelper.js +1 -1
  136. package/views/support/imageReprojection.js +1 -1
  137. package/views/webgl/FramebufferObject.js +1 -1
  138. package/views/webgl/RenderingContext.js +1 -1
  139. package/views/webgl/Texture.js +1 -1
  140. package/views/webgl/rasterUtils.js +1 -1
  141. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  142. package/views/webgl/textureUtils.js +1 -1
  143. package/widgets/ScaleRangeSlider/types.d.ts +3 -3
  144. package/assets/esri/core/workers/chunks/039d9bc5b5015012f811.js +0 -1
  145. package/assets/esri/core/workers/chunks/08140725277de5d2e41a.js +0 -1
  146. package/assets/esri/core/workers/chunks/16cda273927ab0a39544.js +0 -1
  147. package/assets/esri/core/workers/chunks/29c610ce1c81ebb84a6b.js +0 -1
  148. package/assets/esri/core/workers/chunks/3223f9fbc76ba9ef8d13.js +0 -1
  149. package/assets/esri/core/workers/chunks/3fdcc383bbd9cf0d274c.js +0 -1
  150. package/assets/esri/core/workers/chunks/46c290108a90518ef695.js +0 -1
  151. package/assets/esri/core/workers/chunks/48b8b57f559a53c6c513.js +0 -1
  152. package/assets/esri/core/workers/chunks/4a979fce1c971b614a18.js +0 -1
  153. package/assets/esri/core/workers/chunks/5bd1414220e42cb8ebcf.js +0 -1
  154. package/assets/esri/core/workers/chunks/5d781c2c6204cffffd0d.js +0 -1
  155. package/assets/esri/core/workers/chunks/723df53cfa0189837d01.js +0 -1
  156. package/assets/esri/core/workers/chunks/7400b8c454b47ee4fb3c.js +0 -1
  157. package/assets/esri/core/workers/chunks/7af4edc6e87d27b9d467.js +0 -1
  158. package/assets/esri/core/workers/chunks/990e96139b5a1dccb061.js +0 -1
  159. package/assets/esri/core/workers/chunks/a607541959169741a943.js +0 -1
  160. package/assets/esri/core/workers/chunks/aa779896fd9e5c341349.js +0 -1
  161. package/assets/esri/core/workers/chunks/c131e0dd180a4c10e12e.js +0 -1
  162. package/assets/esri/core/workers/chunks/f3b4159c0722df8ffe13.js +0 -1
  163. package/assets/esri/core/workers/chunks/f75eec2cbc541eec9712.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{EventEmitter as n}from"../../../../core/Evented.js";import"../../../../core/has.js";import{disposeMaybe as r,removeMaybe as i}from"../../../../core/maybe.js";import{generateUID as a}from"../../../../core/uid.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{exactEquals as c,set as l}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as u,create as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{textTextureAtlas as f}from"./testUtils.js";import{applyTextureResizeModuloCeil as p}from"./textureUtils.js";import{TaskPriority as m}from"../../../support/Scheduler.js";import{Yield as h}from"../../../support/Yield.js";import g from"../../../webgl/Texture.js";import{TextureDescriptor as _}from"../../../webgl/TextureDescriptor.js";const v=4096;let y=class extends t{constructor(e){super(e),this.id=a(),this.events=new n,this._texture=null,this._atlas=new C(256,256),this._needsRepack=!1,this._needsCleanup=!1,this._canRepack=!0,this._elementsToRender=new Map,this._elements=new Map,this._uvCallbacks=new Map,this.updating=!1}initialize(){this._stage=this.view.stage,this._stage.addTexture(this),this._updateCanvasElementSize(this._atlas),this._reset()}unload(){this._texture=r(this._texture),this._frameWorker=i(this._frameWorker),this.updating=!1,this.events.emit(`unloaded`)}get loaded(){return this._texture!=null}get texture(){return this._texture}static get maxSize(){return T=f.stableRendering?b:0,[v-b-T,v-b-T-x]}load(e){if(this._texture)return this._texture;let t=new _;return t.wrapMode=33071,t.samplingMode=9987,t.hasMipmap=!0,t.preMultiplyAlpha=!0,t.maxAnisotropy=e.parameters.maxMaxAnisotropy,this._texture=new g(e,t,this._canvas),this._frameWorker=this.view.resourceController.scheduler.registerTask(m.TEXT_TEXTURE_ATLAS,this),this.setDirty(),this._texture}dispose(){this._elements.clear(),this._elementsToRender.clear(),this._frameWorker=i(this._frameWorker),this._texture&&=(this._stage.removeTexture(this),r(this._texture)),this._canvas.width=0,this._canvas.height=0,this._canvas=null,this._ctx=null}_updateCanvasElementSize(e){let t=this._canvas;this._canvas=document.createElement(`canvas`),this._canvas.setAttribute(`id`,`textAtlasCanvas`),this._canvas.setAttribute(`style`,`display:none`),this._canvas.width=e.width,this._canvas.height=e.height,this._ctx=this._canvas.getContext(`2d`),t&&(this._ctx.drawImage(t,0,0),t.width=t.height=0)}_resizeAtlas(e,t){(this._atlas.width!==e||this._atlas.height!==t)&&(this._atlas.width=e,this._atlas.height=t,this._reset())}_reset(){this._needsCleanup||=this._elements.size>0||this._atlas.cursors.size>0,this._elementsToRender.clear(),this._atlas.reset(),this._needsRepack=!0,this.setDirty()}_addAtlasElement(e,t,n,r){let i=this._atlas;if(i.width<n||i.height<r)return!1;let a=i.cursors.get(r);if(!a){if(i.height<i.nextY+r)return!1;a=[new w(i.nextY)],i.cursors.set(r,a),i.nextY+=r}let o=a.find(e=>i.width>=e.x+n);if(o==null){if(i.height<i.nextY+r)return!1;o=new w(i.nextY),i.nextY+=r,a.push(o)}return e.setNewPosition(o),this._elements.set(t,e),this._elementsToRender.set(t,e),o.x+=n,!0}_ensureCallbacks(e){let t=this._uvCallbacks.get(e);if(t)return t;let n=new Set;return this._uvCallbacks.set(e,n),n}_addCallback(e,t){this._ensureCallbacks(e).add(t)}_removeCallback(e,t){let n=this._uvCallbacks.get(e);return n?.delete(t)&&n.size===0?(this._uvCallbacks.delete(e),!0):!1}_processAddition(e){let t=e.textRenderer.key;if(this._needsRepack){this._elements.set(t,e);return}let n=this._atlas,r=e.textRenderer.renderedWidth,i=e.textRenderer.renderedHeight,a=r+b,o=i+b+x;if(!this._addAtlasElement(e,t,a,o)){if(this._canRepack)this._reset();else if(n.width<a){let e=p(Math.max(a,n.width*1.5),v);this._resizeAtlas(e,n.height)}else{let e=n.nextY+o,t=p(Math.max(e,n.height*1.5),v);if(t>n.height)this._resizeAtlas(n.width,t);else if(n.width<v){let e=p(n.width*1.5,v);this._resizeAtlas(e,n.height)}}this._elements.set(t,e)}}_renderElement(e){let t=e.commitNewPosition(),n=e.textRenderer;this._ctx.clearRect(t[0]-b,t[1]-b,n.renderedWidth+2*b,n.renderedHeight+2*b),n.render(this._ctx,t[0],t[1]),this._uvCallbacks.get(n.key)?.forEach(t=>t(e.uv))}_clearUnusedPixels(){let e=new Path2D,t=!1;for(let n of this._elements.values()){let{xOffset:r,yOffset:i,textRenderer:a}=n;r!=null&&i!=null&&a.renderedWidth&&a.renderedHeight&&(e.rect(r,i,a.renderedWidth,a.renderedHeight),t=!0)}t?(this._ctx.save(),this._ctx.globalCompositeOperation=`destination-in`,this._ctx.fillStyle=`#000`,this._ctx.fill(e),this._ctx.restore()):this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._needsCleanup=!1}get readyToRun(){return this.updating}runTask(e){if(this._texture==null)return h;for(;this._needsRepack&&(this._canRepack||this._atlas.height<v&&this._atlas.height<v);){this._canRepack=this._needsRepack=!1;let t=this._elements;this._elements=new Map,t.forEach(e=>this._processAddition(e)),e.madeProgress()}let t=this._canvas.height,n=0,{width:r,height:i}=this._atlas;(this._canvas.width!==r||this._canvas.height!==i)&&(this._updateCanvasElementSize(this._atlas),this._texture.clearMipmap(),this._texture.resize(r,i),t=0,n=i,this._elements.forEach(e=>this._uvCallbacks.get(e.textRenderer.key)?.forEach(t=>t(e.uv))));for(let[r,i]of this._elementsToRender){if(e.done)break;this._renderElement(i);let a=i.yOffset;t=Math.min(t,Math.max(0,a-b)),n=Math.max(n,Math.min(this._canvas.height,a+i.textRenderer.renderedHeight+b)),this._elementsToRender.delete(r),e.madeProgress()}this._needsCleanup&&this._elementsToRender.size===0&&(this._clearUnusedPixels(),t=0,n=this._canvas.height),t<n&&(this._texture.updateData(0,0,t,this._canvas.width,n-t,this._canvas,t),this._texture.generateMipmap()),this.updating=this._elementsToRender.size>0}addText(e,t){let n=e.key;this._addCallback(n,t);let r=this._elements.get(n);return r?c(r.uv,u)||t(r.uv):(r=new S(e),this._processAddition(r),this.setDirty()),{remove:()=>this._removeText(e,t)}}_removeText(e,t){let n=e.key;this._elements.get(n)&&this._removeCallback(n,t)&&(this._elements.delete(n),this._elementsToRender.delete(n),this._canRepack=!0)}setDirty(){this._texture&&(this.updating=!0)}get test(){}get usedMemory(){return(this._texture?.usedMemory??0)+(this._canvas?.width??0)*(this._canvas?.height??0)*4}};e([o({constructOnly:!0})],y.prototype,`view`,void 0),e([o({type:Boolean})],y.prototype,`updating`,void 0),y=e([s(`esri.views.3d.webgl-engine.lib.TextTextureAtlas`)],y);const b=2,x=2;class S{constructor(e){this.textRenderer=e,this._uv=d(),this._newPosition=[0,0]}get uv(){if(this._xOffset==null||this._yOffset==null)return u;let{renderedWidth:e,renderedHeight:t}=this.textRenderer;return l(this._uv,this._xOffset,this._yOffset+t,this._xOffset+e,this._yOffset)}setNewPosition(e){this._newPosition[0]=e.x,this._newPosition[1]=e.y}commitNewPosition(){return this._xOffset=this._newPosition[0],this._yOffset=this._newPosition[1],this._newPosition}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}}class C{constructor(e,t){this.width=e,this.height=t,this.cursors=new Map,this.nextY=0}reset(){this.cursors.clear(),this.nextY=T}}class w{constructor(e){this.y=e,this.x=T}}let T=0;export{y as TextTextureAtlas};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{EventEmitter as n}from"../../../../core/Evented.js";import"../../../../core/has.js";import{disposeMaybe as r,removeMaybe as i}from"../../../../core/maybe.js";import{generateUID as a}from"../../../../core/uid.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{exactEquals as c,set as l}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as u,create as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{textTextureAtlas as f}from"./testUtils.js";import{applyTextureResizeModuloCeil as p}from"./textureUtils.js";import{TaskPriority as m}from"../../../support/Scheduler.js";import{Yield as h}from"../../../support/Yield.js";import{Texture as g}from"../../../webgl/Texture.js";import{TextureDescriptor as _}from"../../../webgl/TextureDescriptor.js";const v=4096;let y=class extends t{constructor(e){super(e),this.id=a(),this.events=new n,this._texture=null,this._atlas=new C(256,256),this._needsRepack=!1,this._needsCleanup=!1,this._canRepack=!0,this._elementsToRender=new Map,this._elements=new Map,this._uvCallbacks=new Map,this.updating=!1}initialize(){this._stage=this.view.stage,this._stage.addTexture(this),this._updateCanvasElementSize(this._atlas),this._reset()}unload(){this._texture=r(this._texture),this._frameWorker=i(this._frameWorker),this.updating=!1,this.events.emit(`unloaded`)}get loaded(){return this._texture!=null}get texture(){return this._texture}static get maxSize(){return T=f.stableRendering?b:0,[v-b-T,v-b-T-x]}load(e){if(this._texture)return this._texture;let t=new _;return t.wrapMode=33071,t.samplingMode=9987,t.hasMipmap=!0,t.preMultiplyAlpha=!0,t.maxAnisotropy=e.parameters.maxMaxAnisotropy,this._texture=new g(e,t,this._canvas),this._frameWorker=this.view.resourceController.scheduler.registerTask(m.TEXT_TEXTURE_ATLAS,this),this.setDirty(),this._texture}dispose(){this._elements.clear(),this._elementsToRender.clear(),this._frameWorker=i(this._frameWorker),this._texture&&=(this._stage.removeTexture(this),r(this._texture)),this._canvas.width=0,this._canvas.height=0,this._canvas=null,this._ctx=null}_updateCanvasElementSize(e){let t=this._canvas;this._canvas=document.createElement(`canvas`),this._canvas.setAttribute(`id`,`textAtlasCanvas`),this._canvas.setAttribute(`style`,`display:none`),this._canvas.width=e.width,this._canvas.height=e.height,this._ctx=this._canvas.getContext(`2d`),t&&(this._ctx.drawImage(t,0,0),t.width=t.height=0)}_resizeAtlas(e,t){(this._atlas.width!==e||this._atlas.height!==t)&&(this._atlas.width=e,this._atlas.height=t,this._reset())}_reset(){this._needsCleanup||=this._elements.size>0||this._atlas.cursors.size>0,this._elementsToRender.clear(),this._atlas.reset(),this._needsRepack=!0,this.setDirty()}_addAtlasElement(e,t,n,r){let i=this._atlas;if(i.width<n||i.height<r)return!1;let a=i.cursors.get(r);if(!a){if(i.height<i.nextY+r)return!1;a=[new w(i.nextY)],i.cursors.set(r,a),i.nextY+=r}let o=a.find(e=>i.width>=e.x+n);if(o==null){if(i.height<i.nextY+r)return!1;o=new w(i.nextY),i.nextY+=r,a.push(o)}return e.setNewPosition(o),this._elements.set(t,e),this._elementsToRender.set(t,e),o.x+=n,!0}_ensureCallbacks(e){let t=this._uvCallbacks.get(e);if(t)return t;let n=new Set;return this._uvCallbacks.set(e,n),n}_addCallback(e,t){this._ensureCallbacks(e).add(t)}_removeCallback(e,t){let n=this._uvCallbacks.get(e);return n?.delete(t)&&n.size===0?(this._uvCallbacks.delete(e),!0):!1}_processAddition(e){let t=e.textRenderer.key;if(this._needsRepack){this._elements.set(t,e);return}let n=this._atlas,r=e.textRenderer.renderedWidth,i=e.textRenderer.renderedHeight,a=r+b,o=i+b+x;if(!this._addAtlasElement(e,t,a,o)){if(this._canRepack)this._reset();else if(n.width<a){let e=p(Math.max(a,n.width*1.5),v);this._resizeAtlas(e,n.height)}else{let e=n.nextY+o,t=p(Math.max(e,n.height*1.5),v);if(t>n.height)this._resizeAtlas(n.width,t);else if(n.width<v){let e=p(n.width*1.5,v);this._resizeAtlas(e,n.height)}}this._elements.set(t,e)}}_renderElement(e){let t=e.commitNewPosition(),n=e.textRenderer;this._ctx.clearRect(t[0]-b,t[1]-b,n.renderedWidth+2*b,n.renderedHeight+2*b),n.render(this._ctx,t[0],t[1]),this._uvCallbacks.get(n.key)?.forEach(t=>t(e.uv))}_clearUnusedPixels(){let e=new Path2D,t=!1;for(let n of this._elements.values()){let{xOffset:r,yOffset:i,textRenderer:a}=n;r!=null&&i!=null&&a.renderedWidth&&a.renderedHeight&&(e.rect(r,i,a.renderedWidth,a.renderedHeight),t=!0)}t?(this._ctx.save(),this._ctx.globalCompositeOperation=`destination-in`,this._ctx.fillStyle=`#000`,this._ctx.fill(e),this._ctx.restore()):this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._needsCleanup=!1}get readyToRun(){return this.updating}runTask(e){if(this._texture==null)return h;for(;this._needsRepack&&(this._canRepack||this._atlas.height<v&&this._atlas.height<v);){this._canRepack=this._needsRepack=!1;let t=this._elements;this._elements=new Map,t.forEach(e=>this._processAddition(e)),e.madeProgress()}let t=this._canvas.height,n=0,{width:r,height:i}=this._atlas;(this._canvas.width!==r||this._canvas.height!==i)&&(this._updateCanvasElementSize(this._atlas),this._texture.clearMipmap(),this._texture.resize(r,i),t=0,n=i,this._elements.forEach(e=>this._uvCallbacks.get(e.textRenderer.key)?.forEach(t=>t(e.uv))));for(let[r,i]of this._elementsToRender){if(e.done)break;this._renderElement(i);let a=i.yOffset;t=Math.min(t,Math.max(0,a-b)),n=Math.max(n,Math.min(this._canvas.height,a+i.textRenderer.renderedHeight+b)),this._elementsToRender.delete(r),e.madeProgress()}this._needsCleanup&&this._elementsToRender.size===0&&(this._clearUnusedPixels(),t=0,n=this._canvas.height),t<n&&(this._texture.updateData(0,0,t,this._canvas.width,n-t,this._canvas,t),this._texture.generateMipmap()),this.updating=this._elementsToRender.size>0}addText(e,t){let n=e.key;this._addCallback(n,t);let r=this._elements.get(n);return r?c(r.uv,u)||t(r.uv):(r=new S(e),this._processAddition(r),this.setDirty()),{remove:()=>this._removeText(e,t)}}_removeText(e,t){let n=e.key;this._elements.get(n)&&this._removeCallback(n,t)&&(this._elements.delete(n),this._elementsToRender.delete(n),this._canRepack=!0)}setDirty(){this._texture&&(this.updating=!0)}get test(){}get usedMemory(){return(this._texture?.usedMemory??0)+(this._canvas?.width??0)*(this._canvas?.height??0)*4}};e([o({constructOnly:!0})],y.prototype,`view`,void 0),e([o({type:Boolean})],y.prototype,`updating`,void 0),y=e([s(`esri.views.3d.webgl-engine.lib.TextTextureAtlas`)],y);const b=2,x=2;class S{constructor(e){this.textRenderer=e,this._uv=d(),this._newPosition=[0,0]}get uv(){if(this._xOffset==null||this._yOffset==null)return u;let{renderedWidth:e,renderedHeight:t}=this.textRenderer;return l(this._uv,this._xOffset,this._yOffset+t,this._xOffset+e,this._yOffset)}setNewPosition(e){this._newPosition[0]=e.x,this._newPosition[1]=e.y}commitNewPosition(){return this._xOffset=this._newPosition[0],this._yOffset=this._newPosition[1],this._newPosition}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}}class C{constructor(e,t){this.width=e,this.height=t,this.cursors=new Map,this.nextY=0}reset(){this.cursors.clear(),this.nextY=T}}class w{constructor(e){this.y=e,this.x=T}}let T=0;export{y as TextTextureAtlas};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{maxUint32 as e}from"../../../../../core/typedArrayUtil.js";import{getMaxItemCount as t,getItemsRectangle as n}from"./TextureBackedBufferUtils.js";import r from"../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../webgl/TextureDescriptor.js";class a{constructor(a,o,s){this.layout=o;let c=typeof s!=`number`,l=c?Math.floor(s.byteLength/o.byteStride):s;if(l>t(a,o,e))throw Error(`Cannot allocate TextureBuffer for ${l}. Exceeding hardware texture limits`);let{itemCount:u,itemWidth:d,itemHeight:f}=n(l),{texelStride:p,byteStride:m}=this.layout,h=d*p,g=f;this.itemCount=u,this.byteLength=u*m;let _=o.texelFormatInfo,v=new i(h,g);v.samplingMode=9728,v.wrapMode=33071,v.internalFormat=_.internalFormat,v.pixelFormat=_.pixelFormat,v.dataType=_.dataType,v.isImmutable=!0,v.hasMipmap=!1,this.texture=new r(a,v),c&&this.setSubData(s)}get sizeBytes(){return this.byteLength}get usedMemory(){return this.texture.usedMemory}setSubData(e,t=0,n=0,r=Math.floor((e.byteLength-n)/this.layout.byteStride)){if(r===0)return;let{layout:i,texture:a}=this,{texelStride:o,texelByteStride:s}=i,{width:c}=a.descriptor;if(t+r>this.itemCount)throw Error(`Upload range is outside of texture`);let l=t*o,u=r*o;if(u<=0)return;let d=n,f=l,p=u,m=f%c;if(m!==0){let t=new i.texelElementArrayConstructor(e,d),n=m,r=Math.floor(f/c),o=Math.min(p,c-m);a.updateData(0,n,r,o,1,t),f+=o,d+=o*s,p-=o}let h=Math.floor(p/c);if(h>0){let t=new i.texelElementArrayConstructor(e,d),n=Math.floor(f/c);a.updateData(0,0,n,c,h,t);let r=h*c;f+=r,d+=r*s,p-=r}if(p>0){let t=new i.texelElementArrayConstructor(e,d),n=f%c,r=Math.floor(f/c);a.updateData(0,n,r,p,1,t)}}dispose(){this.texture.dispose()}}export{a as TextureBuffer};
2
+ import{maxUint32 as e}from"../../../../../core/typedArrayUtil.js";import{getMaxItemCount as t,getItemsRectangle as n}from"./TextureBackedBufferUtils.js";import{Texture as r}from"../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../webgl/TextureDescriptor.js";class a{constructor(a,o,s){this.layout=o;let c=typeof s!=`number`,l=c?Math.floor(s.byteLength/o.byteStride):s;if(l>t(a,o,e))throw Error(`Cannot allocate TextureBuffer for ${l}. Exceeding hardware texture limits`);let{itemCount:u,itemWidth:d,itemHeight:f}=n(l),{texelStride:p,byteStride:m}=this.layout,h=d*p,g=f;this.itemCount=u,this.byteLength=u*m;let _=o.texelFormatInfo,v=new i(h,g);v.samplingMode=9728,v.wrapMode=33071,v.internalFormat=_.internalFormat,v.pixelFormat=_.pixelFormat,v.dataType=_.dataType,v.isImmutable=!0,v.hasMipmap=!1,this.texture=new r(a,v),c&&this.setSubData(s)}get sizeBytes(){return this.byteLength}get usedMemory(){return this.texture.usedMemory}setSubData(e,t=0,n=0,r=Math.floor((e.byteLength-n)/this.layout.byteStride)){if(r===0)return;let{layout:i,texture:a}=this,{texelStride:o,texelByteStride:s}=i,{width:c}=a.descriptor;if(t+r>this.itemCount)throw Error(`Upload range is outside of texture`);let l=t*o,u=r*o;if(u<=0)return;let d=n,f=l,p=u,m=f%c;if(m!==0){let t=new i.texelElementArrayConstructor(e,d),n=m,r=Math.floor(f/c),o=Math.min(p,c-m);a.updateData(0,n,r,o,1,t),f+=o,d+=o*s,p-=o}let h=Math.floor(p/c);if(h>0){let t=new i.texelElementArrayConstructor(e,d),n=Math.floor(f/c);a.updateData(0,0,n,c,h,t);let r=h*c;f+=r,d+=r*s,p-=r}if(p>0){let t=new i.texelElementArrayConstructor(e,d),n=f%c,r=Math.floor(f/c);a.updateData(0,n,r,p,1,t)}}dispose(){this.texture.dispose()}}export{a as TextureBuffer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- class e{constructor(e,t,n,r=0){this.layout=e,this.byteOffset=r,this._bufferViews=new Map,this.buffer=typeof t==`number`?new ArrayBuffer(t*e.byteStride):t,this.texelElementBuffer=new n(this.buffer,r);let i=this._bufferViews;for(let[e,t]of this.layout.fields)i.set(e,new t.bufferViewConstructor(this.buffer,r+t.byteOffset,this.layout.byteStride))}get stride(){return this.layout.byteStride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){let n=this._bufferViews.get(e);return n!=null&&n.elementCount===t.ElementCount&&n.elementType===t.ElementType?n:null}copyItem(e,t){let{buffer:n,layout:r,byteOffset:i}=this,a=new Uint8Array(n),o=r.byteStride,s=i+e*o,c=i+t*o;a.copyWithin(c,s,s+o)}get usedMemory(){return this.byteLength}}export{e as TextureBufferView};
2
+ class e{constructor(e,t,n,r=0){this.layout=e,this.byteOffset=r,this._bufferViews=new Map,this.buffer=typeof t==`number`?new ArrayBuffer(t*e.byteStride):t,this.texelElementBuffer=new n(this.buffer,r);let i=this._bufferViews;for(let[e,t]of this.layout.fields)i.set(e,new t.bufferViewConstructor(this.buffer,r+t.byteOffset,this.layout.byteStride))}get stride(){return this.layout.byteStride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){let n=this._bufferViews.get(e);return n!=null&&n.elementCount===t.ElementCount&&n.elementType===t.ElementType?n:null}copyItem(e,t){let{buffer:n,layout:r,byteOffset:i}=this,a=new Uint8Array(n),o=r.byteStride,s=i+e*o,c=i+t*o;a.copyWithin(c,s,s+o)}copyFrom(e,t=0,n=0,r=e.count){let i=this.stride,a=e.byteOffset+t*i,o=this.byteOffset+n*i,s=r*i;if(i%4==0&&a%4==0&&o%4==0){let t=new Uint32Array(e.buffer,a,s/4);new Uint32Array(this.buffer,o,s/4).set(t)}else{let t=new Uint8Array(e.buffer,a,s);new Uint8Array(this.buffer,o,s).set(t)}return this}get usedMemory(){return this.byteLength}}export{e as TextureBufferView};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ function e(e,n){return e.size===n?new t(e):null}class t{constructor(e){this._vertices=e}get count(){return this._vertices.data.length/this._vertices.stride}get(e,t=0){return this._vertices.data[this._getOffset(e)+t]}getVec(e,t){let{data:n,size:r}=this._vertices,i=this._getOffset(e);for(let e=0;e<r;e++)t[e]=n[i+e];return t}_getOffset(e){return e*this._vertices.stride}}export{t as VerticesView,e as createVerticesView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{createAttributeView as e}from"./AttributeView.js";function t(t,n){return a(t,n,1,e)}function n(t,n){return a(t,n,2,e)}function r(t,n){return a(t,n,3,e)}function i(t,n){return a(t,n,4,e)}function a(e,t,n,r){if(e.type===1){let{vertex:r}=e.buffers,i=r.layout.fields.get(t);return i==null||i.constructor.ElementCount!==n?null:r.getField(t,i.constructor)}let i=e.attributes.get(t);return i==null?null:r(i,n)}export{t as getScalarAttributeView,n as getVec2AttributeView,r as getVec3AttributeView,i as getVec4AttributeView};
2
+ import{createAttributeView as e}from"./AttributeView.js";function t(t,n){return a(t,n,1,e)}function n(t,n){return a(t,n,2,e)}function r(t,n){return a(t,n,3,e)}function i(t,n){return a(t,n,4,e)}function a(e,t,n,r){if(e.type===1){let{vertex:r,storage:i}=e.buffers;if(i!=null){let e=i.layout.fields.get(t);if(e!=null&&e.bufferViewConstructor.ElementCount===n)return i.getField(t,e.bufferViewConstructor)}let a=r.layout.fields.get(t);return a==null||a.constructor.ElementCount!==n?null:r.getField(t,a.constructor)}let i=e.attributes.get(t);return i==null?null:r(i,n)}export{t as getScalarAttributeView,n as getVec2AttributeView,r as getVec3AttributeView,i as getVec4AttributeView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{disposeMaybe as e}from"../../../../../core/maybe.js";import{PixelType as t,SizedPixelFormat as n}from"../../../../webgl/enums.js";import r from"../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../webgl/TextureDescriptor.js";function a(e){let a=u.resolution,s=a/2,c=new Float32Array(a*a),d=a*s,f=u.amplitude,p=a,m=Math.log2(a)+1,h=u.strokes.length,g=(m-1)*h*p;for(let{distance:e,pressure:t}of u.strokes){let n=e,r=t,i=g;for(let e=0;e<m;e++){e!==0&&(n=o(n,0),r=o(r,1));for(let e=0;e<u.resolution;e++){let t=n[e%n.length],a=r?.[e%r.length]??1;c[i]=t,c[i+d]=a,++i}i-=p*(h+1)}g+=p}let _=new i(a);_.dataType=t.FLOAT,_.pixelFormat=6403,_.internalFormat=n.R16F;let v=new r(e,_,c);return new l(a,f,h,v)}function o(e,t){if(!e)return null;let n=e.length/2,r=s*n,i=Array(n),a=0,o=t===1;for(let t=0;t<e.length;t+=2){let n=(e[t]+e[t+1])/2;o?i[a++]=Math.min(r,1-(1-n)*c):i[a++]=Math.min(r,n*c)}return i}const s=1/10,c=.5;class l{constructor(e,t,n,r){this.resolution=e,this.amplitude=t,this.variants=n,this.texture=r}dispose(){this.texture=e(this.texture)}}const u={amplitude:8,resolution:256,strokes:[{distance:[-1.59027,-1.59426,-1.59674,-1.59766,-1.59702,-1.59479,-1.59095,-1.5855,-1.57843,-1.56973,-1.55942,-1.5475,-1.53398,-1.5189,-1.50226,-1.4841,-1.46446,-1.44337,-1.42088,-1.39703,-1.37188,-1.34547,-1.31786,-1.28912,-1.2593,-1.22847,-1.19668,-1.16402,-1.13053,-1.09629,-1.06137,-1.02582,-.98972,-.95313,-.91611,-.87872,-.84102,-.80306,-.76488,-.72654,-.68807,-.64952,-.61092,-.57232,-.53375,-.49527,-.45692,-.41874,-.38078,-.34309,-.3057,-.26867,-.23204,-.19585,-.16015,-.12497,-.09036,-.05634,-.02296,.00977,.04183,.07321,.10389,.13386,.16313,.19169,.21956,.24672,.27321,.299,.32413,.34858,.37237,.3955,.41798,.43981,.461,.48154,.50145,.52073,.53939,.55744,.57488,.5917,.6079,.62347,.63837,.65259,.66609,.67885,.69083,.70201,.71235,.72183,.73042,.73812,.7449,.75076,.7557,.75973,.76284,.76507,.76642,.76692,.76659,.76545,.76352,.76083,.7574,.75324,.74837,.74279,.73652,.72959,.72199,.71377,.70493,.69553,.68558,.67515,.66426,.65298,.64135,.62944,.6173,.60499,.59257,.58008,.56759,.55513,.54275,.5305,.51842,.50654,.4949,.48353,.47246,.4617,.45128,.44121,.43149,.42213,.41313,.40448,.39617,.38818,.3805,.37309,.36594,.35902,.35229,.34572,.33927,.33292,.32663,.32035,.31407,.30774,.30135,.29486,.28824,.28148,.27454,.26739,.26002,.25241,.24454,.23639,.22796,.21922,.21016,.20076,.19098,.18082,.17023,.1592,.14768,.13566,.1231,.10996,.09624,.08188,.06688,.05121,.03485,.01778,0,-.0185,-.03771,-.05763,-.07824,-.09952,-.12144,-.14396,-.16706,-.19069,-.21481,-.23938,-.26436,-.28971,-.31539,-.34136,-.36759,-.39404,-.42067,-.44746,-.47437,-.50136,-.52839,-.55544,-.58248,-.60948,-.63642,-.66329,-.6901,-.71684,-.74352,-.77015,-.79675,-.82332,-.84988,-.87644,-.90301,-.92958,-.95615,-.98272,-1.00926,-1.03575,-1.06217,-1.08847,-1.11463,-1.1406,-1.16633,-1.19178,-1.2169,-1.24164,-1.26595,-1.28979,-1.31312,-1.3359,-1.35809,-1.37963,-1.4005,-1.42064,-1.44,-1.45853,-1.47616,-1.49285,-1.50853,-1.52313,-1.53659,-1.54886,-1.55986,-1.56955,-1.57788,-1.5848],pressure:[-.01365,-.00206,.01025,.02327,.03696,.05129,.06619,.08163,.09755,.11393,.1307,.14784,.16531,.18308,.20111,.21938,.23786,.25651,.2753,.29419,.31315,.33215,.35115,.37015,.38913,.40806,.42694,.44576,.46449,.48313,.50167,.5201,.53839,.55653,.57448,.59222,.60971,.62692,.6438,.66033,.67648,.69221,.70753,.72242,.73688,.75093,.76456,.77779,.79063,.80309,.81517,.82686,.83817,.84911,.85967,.86987,.87972,.88924,.89845,.90734,.91594,.92425,.93229,.94005,.94754,.95475,.96166,.96826,.97451,.9804,.98588,.99092,.99549,.99957,.99685,.99381,.99131,.98936,.98796,.98711,.98681,.98706,.98787,.98923,.99113,.99357,.99654,1,.99607,.99171,.98695,.98181,.97634,.97057,.96452,.95824,.95175,.94506,.93818,.93113,.92389,.91647,.90887,.90109,.89314,.88501,.87672,.86831,.85978,.85119,.84256,.83393,.82533,.8168,.80836,.80002,.79181,.78374,.77582,.7681,.76059,.75331,.74629,.73955,.73311,.72697,.72116,.71568,.71054,.70572,.70121,.697,.69304,.68931,.68576,.68236,.67905,.67582,.67262,.66941,.66619,.66291,.65957,.65613,.65259,.64892,.6451,.6411,.6369,.63248,.62783,.62295,.61783,.61247,.60688,.60104,.59498,.58868,.58216,.57542,.56845,.56125,.5538,.5461,.53813,.52986,.52129,.51239,.50316,.49359,.4837,.47349,.46299,.45223,.44124,.43005,.41869,.40719,.39557,.38386,.37207,.36023,.34836,.33648,.32464,.31287,.30119,.28963,.27822,.26698,.25594,.2451,.23448,.22409,.21391,.20394,.19415,.18452,.17503,.16565,.15636,.14713,.13794,.1288,.11968,.11058,.10151,.09247,.08346,.07447,.06552,.05659,.0477,.03885,.03007,.02137,.01278,.00433,-.00393,-.012,-.01983,-.02738,-.03463,-.04155,-.0481,-.05429,-.0601,-.06553,-.07057,-.07524,-.07954,-.08347,-.08703,-.09022,-.09303,-.09544,-.09744,-.09898,-.10004,-.10059,-.1006,-.10005,-.09892,-.0972,-.09487,-.09192,-.08833,-.08409,-.07918,-.07357,-.06724,-.06019,-.0524,-.04386,-.03455,-.02448]},{distance:[-3.46259,-3.47131,-3.47668,-3.47863,-3.47712,-3.4721,-3.46352,-3.45138,-3.43566,-3.41635,-3.39347,-3.36704,-3.33709,-3.30368,-3.26684,-3.22667,-3.18322,-3.1366,-3.08689,-3.0342,-2.97865,-2.92036,-2.85946,-2.79607,-2.73034,-2.66241,-2.59242,-2.52052,-2.44686,-2.37159,-2.29485,-2.2168,-2.13757,-2.05731,-1.97616,-1.89426,-1.81174,-1.72875,-1.64543,-1.56191,-1.47833,-1.39483,-1.3115,-1.22847,-1.14581,-1.06361,-.98193,-.90083,-.82036,-.74054,-.66141,-.583,-.50532,-.4284,-.35228,-.277,-.20261,-.12916,-.05672,.01463,.08485,.15384,.22153,.28784,.35269,.41602,.47776,.53787,.59629,.653,.70799,.76123,.81274,.86253,.9106,.95698,1.0017,1.04477,1.0862,1.126,1.16415,1.20065,1.23546,1.26857,1.29994,1.32953,1.35731,1.38321,1.40719,1.42921,1.44922,1.46719,1.48309,1.49691,1.50862,1.51825,1.52581,1.53133,1.53486,1.53644,1.53616,1.53409,1.53031,1.52493,1.51803,1.50972,1.50009,1.48924,1.47725,1.46421,1.45019,1.43527,1.4195,1.40295,1.38568,1.36778,1.34929,1.3303,1.31087,1.29108,1.27099,1.25066,1.23018,1.2096,1.18898,1.16838,1.14785,1.12745,1.10721,1.08719,1.06741,1.04791,1.02871,1.00986,.99136,.97324,.95551,.93819,.92127,.90476,.88866,.87296,.85767,.84277,.82823,.81406,.80022,.7867,.77346,.76049,.74774,.73519,.72278,.71049,.69827,.68606,.67381,.66145,.64893,.63618,.62313,.60973,.5959,.5816,.56675,.5513,.53516,.51826,.50053,.4819,.46231,.44169,.42002,.39725,.37336,.34834,.32219,.2949,.2665,.23698,.20638,.17469,.14193,.10809,.07316,.03714,0,-.03827,-.07772,-.11836,-.16022,-.20332,-.24768,-.29332,-.34024,-.38844,-.43788,-.48854,-.54036,-.59329,-.64724,-.70211,-.75782,-.81425,-.87128,-.92881,-.98674,-1.04498,-1.10346,-1.1621,-1.22086,-1.27969,-1.33854,-1.3974,-1.45625,-1.51511,-1.57396,-1.63283,-1.69173,-1.75067,-1.80968,-1.86875,-1.9279,-1.98712,-2.04639,-2.10568,-2.16495,-2.22416,-2.28322,-2.34208,-2.40063,-2.4588,-2.51647,-2.57354,-2.62989,-2.68543,-2.74002,-2.79357,-2.84597,-2.89711,-2.94689,-2.99521,-3.04195,-3.087,-3.13023,-3.17152,-3.21075,-3.24779,-3.28252,-3.3148,-3.34451,-3.37154,-3.39577,-3.41709,-3.43539,-3.45059],pressure:[.87183,.87151,.87129,.87118,.87117,.87128,.87149,.87182,.87225,.8728,.87347,.87424,.87513,.87613,.87723,.87845,.87978,.88122,.88276,.88441,.88616,.88801,.88996,.892,.89414,.89637,.89868,.90108,.90356,.90611,.90874,.91144,.91421,.91704,.91993,.92287,.92587,.92892,.93201,.93514,.93831,.94151,.94474,.94799,.95126,.95456,.95786,.96118,.9645,.96783,.97116,.97448,.9778,.98111,.98441,.9877,.99096,.99421,.99742,.99938,.99622,.9931,.99001,.98697,.98397,.98101,.97811,.97526,.97246,.96972,.96703,.96441,.96185,.95935,.95691,.95455,.95225,.95002,.94786,.94577,.94376,.94182,.93995,.93817,.93646,.93483,.93328,.93181,.93042,.92911,.92788,.92673,.92566,.92467,.92376,.92293,.92217,.92149,.92088,.92034,.91987,.91947,.91913,.91886,.91864,.91849,.91838,.91833,.91834,.91839,.91849,.91863,.91883,.91907,.91935,.91968,.92005,.92046,.92092,.92142,.92195,.92253,.92314,.9238,.92449,.92521,.92598,.92677,.9276,.92847,.92936,.93029,.93125,.93224,.93325,.9343,.93537,.93646,.93758,.93872,.93988,.94106,.94225,.94346,.94469,.94593,.94718,.94844,.94971,.95098,.95226,.95354,.95482,.9561,.95738,.95867,.95995,.96122,.9625,.96377,.96504,.9663,.96757,.96883,.97009,.97135,.97261,.97387,.97513,.9764,.97767,.97895,.98023,.98153,.98284,.98416,.98549,.98684,.98821,.9896,.99101,.99244,.99389,.99537,.99688,.99842,1,.99839,.99675,.99508,.99336,.99161,.98982,.98799,.98613,.98422,.98228,.98029,.97827,.97622,.97414,.97202,.96987,.9677,.96551,.9633,.96107,.95882,.95656,.9543,.95202,.94975,.94747,.94519,.94292,.94065,.93838,.93613,.93388,.93164,.92941,.9272,.92499,.9228,.92062,.91846,.91631,.91418,.91207,.90998,.90792,.90588,.90387,.90189,.89995,.89804,.89617,.89434,.89256,.89083,.88914,.88752,.88595,.88443,.88299,.88161,.8803,.87907,.87791,.87683,.87584,.87494,.87412,.8734,.87278,.87225]},{distance:[.39335,.43437,.47737,.52234,.56923,.61801,.66864,.72109,.7753,.83123,.88882,.94801,1.00875,1.07097,1.13461,1.1996,1.26586,1.33333,1.40193,1.47158,1.54221,1.61373,1.68607,1.75913,1.83284,1.90711,1.98186,2.05699,2.13243,2.20809,2.28387,2.35971,2.4355,2.51117,2.58663,2.66179,2.73658,2.81092,2.88473,2.95792,3.03043,3.10217,3.17308,3.24309,3.31211,3.3801,3.44697,3.51267,3.57712,3.64028,3.70208,3.76247,3.8214,3.87881,3.93467,3.98892,4.04152,4.09244,4.14164,4.18908,4.23474,4.27859,4.32061,4.36077,4.39905,4.43544,4.46992,4.50249,4.53314,4.56185,4.58864,4.61349,4.63642,4.65745,4.67657,4.69381,4.7092,4.72274,4.73447,4.74441,4.75259,4.75903,4.76376,4.76682,4.76822,4.768,4.76618,4.76279,4.75786,4.75142,4.74348,4.73409,4.72326,4.71102,4.69739,4.68241,4.6661,4.64849,4.6296,4.60948,4.58816,4.56567,4.54204,4.51732,4.49154,4.46473,4.43694,4.4082,4.37854,4.348,4.31662,4.28443,4.25145,4.21773,4.1833,4.14819,4.11243,4.07606,4.03912,4.00162,3.96361,3.92512,3.88618,3.84683,3.80708,3.76697,3.72653,3.68579,3.64478,3.60351,3.56202,3.52033,3.47845,3.43642,3.39425,3.35196,3.30957,3.2671,3.22455,3.18196,3.13933,3.09668,3.05402,3.01136,2.96873,2.92613,2.88357,2.84108,2.79865,2.75631,2.71407,2.67195,2.62994,2.58807,2.54634,2.50477,2.46338,2.42216,2.38114,2.34032,2.29971,2.25933,2.21916,2.17923,2.13954,2.10008,2.06087,2.02189,1.98316,1.94468,1.90644,1.86845,1.83069,1.79316,1.75586,1.71877,1.68189,1.6452,1.60868,1.57232,1.53611,1.50004,1.46407,1.4282,1.39241,1.35668,1.321,1.28535,1.24972,1.2141,1.17849,1.14286,1.10723,1.07158,1.03593,1.00028,.96464,.92902,.89344,.85793,.8225,.78719,.75203,.71705,.68231,.64784,.61369,.57991,.54656,.51368,.48134,.44959,.41849,.3881,.35848,.32967,.30174,.27474,.24872,.22373,.19982,.17702,.15539,.13497,.11579,.09791,.08137,.06621,.05248,.04022,.02948,.02029,.01271,.00677,.00252,0,-76e-5,27e-5,.00314,.00788,.01451,.02307,.03357,.04604,.0605,.07697,.09546,.11599,.13858,.16322,.18992,.21869,.24952,.28241,.31735,.35434],pressure:[.95248,.95236,.95228,.95223,.95222,.95224,.95231,.95241,.95256,.95274,.95296,.95322,.95352,.95385,.95423,.95465,.9551,.9556,.95613,.9567,.95731,.95796,.95864,.95936,.96012,.96091,.96173,.96259,.96348,.9644,.96535,.96633,.96734,.96838,.96944,.97053,.97164,.97277,.97393,.9751,.97629,.9775,.97873,.97997,.98122,.98249,.98376,.98505,.98634,.98763,.98893,.99023,.99154,.99284,.99414,.99544,.99673,.99802,.9993,.99942,.99816,.99691,.99568,.99445,.99324,.99205,.99087,.98972,.98858,.98746,.98636,.98528,.98423,.9832,.98219,.98121,.98025,.97931,.9784,.97752,.97666,.97582,.97501,.97423,.97347,.97274,.97203,.97135,.9707,.97007,.96948,.9689,.96836,.96784,.96735,.96689,.96646,.96605,.96567,.96533,.965,.96471,.96445,.96421,.964,.96382,.96367,.96355,.96346,.96339,.96335,.96334,.96336,.9634,.96348,.96358,.9637,.96385,.96403,.96423,.96446,.96471,.96499,.96529,.96561,.96595,.96631,.96669,.96709,.96751,.96795,.9684,.96887,.96935,.96984,.97035,.97087,.9714,.97194,.97249,.97304,.97361,.97418,.97476,.97534,.97592,.97651,.97711,.9777,.9783,.9789,.9795,.9801,.9807,.9813,.9819,.9825,.98309,.98369,.98428,.98486,.98545,.98603,.98661,.98718,.98775,.98832,.98888,.98944,.99,.99056,.99112,.99167,.99223,.99279,.99335,.99392,.99449,.99507,.99565,.99624,.99684,.99745,.99807,.9987,.99934,1,.99933,.99866,.99797,.99727,.99656,.99583,.9951,.99435,.99359,.99283,.99205,.99126,.99046,.98966,.98885,.98803,.9872,.98637,.98554,.9847,.98387,.98303,.98219,.98134,.9805,.97967,.97883,.978,.97717,.97634,.97552,.97471,.97389,.97309,.97229,.9715,.97071,.96993,.96915,.96838,.96762,.96687,.96612,.96539,.96466,.96395,.96324,.96255,.96187,.9612,.96055,.95991,.95929,.95869,.95811,.95754,.957,.95648,.95599,.95552,.95508,.95467,.95428,.95393,.9536,.95331,.95305,.95283,.95264]},{distance:[2.85606,2.86149,2.86432,2.8645,2.862,2.85686,2.84912,2.83886,2.82618,2.81117,2.79393,2.77456,2.75314,2.72975,2.70447,2.67734,2.64844,2.61784,2.58564,2.55196,2.5169,2.48057,2.44305,2.40438,2.36462,2.32383,2.28208,2.23943,2.19591,2.15153,2.10628,2.06016,2.01321,1.96548,1.91702,1.86793,1.8183,1.76829,1.71803,1.66767,1.61737,1.56726,1.51746,1.46803,1.41902,1.37044,1.32228,1.27452,1.22716,1.18023,1.13376,1.08781,1.04244,.99769,.95357,.91003,.86701,.82447,.78238,.74069,.69938,.65836,.61758,.57699,.53656,.49627,.45611,.41611,.37632,.33683,.29776,.25924,.22141,.18441,.14839,.11346,.07972,.04727,.01619,-.01348,-.0417,-.0684,-.09351,-.11698,-.13875,-.1588,-.17713,-.19381,-.20889,-.22242,-.23444,-.24501,-.25421,-.26216,-.26897,-.27473,-.27951,-.28336,-.28631,-.28836,-.28948,-.28963,-.28873,-.28673,-.28355,-.27916,-.27354,-.26673,-.25878,-.2498,-.23992,-.22929,-.21802,-.20623,-.19398,-.18134,-.16836,-.1551,-.14163,-.12809,-.11461,-.1013,-.08826,-.07557,-.06335,-.0517,-.04077,-.03065,-.02143,-.01321,-.00606,0,.00496,.00888,.01181,.01385,.01511,.0157,.01574,.01533,.01458,.01358,.0124,.01112,.00979,.00851,.00738,.0065,.006,.00596,.00646,.00754,.00924,.01161,.01471,.01858,.02323,.02865,.03481,.04169,.0493,.05765,.06677,.07671,.08754,.09934,.11222,.12628,.14159,.15823,.17624,.19561,.21632,.23828,.26142,.28563,.31083,.33696,.36397,.39185,.42057,.4501,.48036,.51125,.54264,.5744,.60646,.63871,.67105,.70337,.73556,.76751,.79918,.83048,.86139,.8919,.92202,.95184,.98144,1.01094,1.04045,1.0701,1.10002,1.13029,1.16103,1.1923,1.22416,1.25664,1.28979,1.32364,1.35824,1.39363,1.42985,1.4669,1.50475,1.54332,1.58252,1.62227,1.6625,1.70312,1.744,1.78501,1.82598,1.8668,1.90734,1.94754,1.98732,2.02666,2.06555,2.10402,2.1421,2.17985,2.2173,2.25448,2.29139,2.328,2.36424,2.4,2.43515,2.46955,2.50309,2.53565,2.56717,2.59761,2.62692,2.65505,2.68191,2.7074,2.73138,2.75375,2.7744,2.79324,2.81017,2.82504,2.83772,2.8481],pressure:[.22758,.23641,.24578,.25568,.26609,.27699,.28835,.30016,.31237,.32495,.33789,.35113,.36466,.37843,.39241,.40658,.4209,.43535,.44989,.4645,.47916,.49385,.50853,.5232,.53784,.55243,.56696,.58141,.59578,.61004,.62419,.63821,.65209,.6658,.67934,.69268,.70582,.71873,.73139,.7438,.75594,.76779,.77935,.79061,.80156,.81221,.82254,.83258,.84231,.85176,.86091,.86978,.87837,.88669,.89473,.9025,.91,.91725,.92425,.931,.93752,.9438,.94985,.95566,.96124,.96658,.97168,.97652,.98109,.98539,.98939,.99309,.99646,.99949,.99783,.99552,.99361,.99209,.99098,.99029,.99003,.99019,.99079,.99181,.99324,.9951,.99735,1,.99698,.99361,.98992,.98592,.98163,.97709,.97231,.96731,.96212,.95676,.95122,.94554,.93973,.93378,.92773,.92157,.91532,.90899,.90258,.89612,.88961,.88308,.87653,.87,.8635,.85705,.85068,.8444,.83823,.83219,.82628,.82052,.81493,.80952,.8043,.79929,.7945,.78994,.78561,.78151,.77765,.77402,.77062,.76742,.76443,.76161,.75896,.75645,.75406,.75175,.74951,.7473,.74511,.74289,.74064,.73833,.73592,.73341,.73078,.728,.72507,.72197,.71869,.71522,.71156,.70769,.70363,.69936,.69489,.69021,.68533,.68023,.67492,.66939,.66363,.65765,.65145,.64501,.63833,.63143,.62428,.61691,.60931,.60148,.59344,.58521,.57679,.5682,.55948,.55063,.54167,.53264,.52354,.51439,.50522,.49603,.48686,.47773,.46865,.45964,.45072,.44192,.43324,.42469,.41629,.40804,.39994,.392,.3842,.37655,.36903,.36164,.35437,.3472,.34012,.33312,.3262,.31933,.31251,.30574,.299,.2923,.28563,.27899,.27239,.26583,.25933,.25288,.24652,.24025,.2341,.22808,.22221,.21653,.21104,.20576,.20072,.19592,.19138,.18712,.18313,.17943,.17602,.17292,.17013,.16766,.16551,.16369,.16222,.1611,.16036,.16001,.16007,.16055,.16148,.16286,.16471,.16705,.16988,.17321,.17706,.18144,.18636,.19182,.19785,.20443,.21158,.2193]},{distance:[-2.31317,-2.3191,-2.32189,-2.32154,-2.31811,-2.31174,-2.30254,-2.29062,-2.27609,-2.25904,-2.23954,-2.21767,-2.19355,-2.16732,-2.13907,-2.10885,-2.07672,-2.04268,-2.00677,-1.96911,-1.92985,-1.88914,-1.84713,-1.80397,-1.75979,-1.71467,-1.66864,-1.62171,-1.57395,-1.52546,-1.47625,-1.42628,-1.3755,-1.32384,-1.27131,-1.218,-1.16408,-1.10972,-1.05508,-1.00031,-.94551,-.89077,-.83615,-.7817,-.72757,-.6739,-.62076,-.56821,-.51625,-.46484,-.41397,-.36366,-.314,-.26506,-.21689,-.16957,-.12316,-.07766,-.03301,.01085,.05399,.09643,.13827,.17967,.22079,.26176,.30265,.34342,.38397,.42414,.46381,.50285,.54115,.57863,.61524,.65093,.6856,.71914,.75153,.78275,.81283,.84182,.86972,.89651,.92208,.94634,.96919,.99052,1.01025,1.02835,1.04484,1.05976,1.07309,1.08479,1.09492,1.1036,1.11096,1.11714,1.12224,1.12627,1.12916,1.13083,1.13125,1.13036,1.12816,1.12466,1.11992,1.11397,1.10677,1.09827,1.08849,1.07746,1.06527,1.05203,1.03786,1.02283,1.00695,.99025,.97279,.9546,.93573,.9163,.8965,.8765,.85647,.83652,.81687,.79775,.77939,.76199,.74568,.73049,.71635,.70316,.69082,.67925,.66834,.65804,.64831,.63911,.63032,.62184,.61363,.60564,.59788,.59036,.58308,.57597,.5689,.56177,.55447,.5469,.53896,.53062,.5219,.51283,.5034,.49355,.48335,.47287,.46223,.45154,.44085,.43012,.41923,.40805,.39648,.38441,.37176,.35849,.34458,.32999,.31461,.29833,.28109,.26288,.2437,.22361,.20265,.18082,.15807,.13434,.1096,.0838,.0569,.02894,0,-.0298,-.0604,-.09173,-.12364,-.15594,-.18843,-.22092,-.25331,-.28559,-.31781,-.35006,-.38244,-.41502,-.44785,-.48098,-.5144,-.54811,-.58218,-.61666,-.65153,-.68677,-.72232,-.75807,-.79397,-.83002,-.86628,-.90281,-.93968,-.97693,-1.01465,-1.05282,-1.09139,-1.13031,-1.16956,-1.20917,-1.24905,-1.28907,-1.32908,-1.36891,-1.40844,-1.44765,-1.48658,-1.52527,-1.56376,-1.60206,-1.64016,-1.67801,-1.71552,-1.75264,-1.78936,-1.8257,-1.86161,-1.89702,-1.93182,-1.96584,-1.99894,-2.03102,-2.06203,-2.0919,-2.12056,-2.14794,-2.17397,-2.19852,-2.22138,-2.24235,-2.26129,-2.27805,-2.29243,-2.30422],pressure:[.9681,.97424,.98046,.98674,.99309,.9995,.99404,.98754,.981,.97444,.96785,.96124,.95462,.94801,.94139,.93479,.92822,.92167,.91515,.90868,.90225,.89589,.88959,.88336,.87722,.87115,.86519,.85932,.85356,.84792,.84239,.83699,.83173,.8266,.82162,.81679,.81211,.80759,.80324,.79906,.79505,.79121,.78756,.78409,.78081,.77771,.77481,.77211,.76959,.76728,.76516,.76324,.76153,.76001,.75869,.75757,.75665,.75593,.7554,.75507,.75493,.75498,.75523,.75565,.75627,.75706,.75803,.75917,.76049,.76197,.76361,.76541,.76737,.76947,.77172,.77409,.7766,.77923,.78198,.78484,.7878,.79086,.79401,.79724,.80055,.80394,.8074,.81092,.8145,.81813,.82182,.82556,.82934,.83317,.83703,.84093,.84487,.84884,.85284,.85687,.86094,.86503,.86915,.87329,.87746,.88166,.88587,.89011,.89436,.89863,.90291,.9072,.91149,.91579,.92009,.92438,.92867,.93295,.9372,.94144,.94566,.94985,.954,.95812,.96219,.96623,.97021,.97415,.97802,.98184,.9856,.9893,.99293,.9965,1,.99657,.9932,.98991,.98668,.98352,.98042,.97738,.9744,.97148,.9686,.96577,.96298,.96023,.95751,.95482,.95214,.94949,.94684,.9442,.94156,.93892,.93627,.93361,.93094,.92825,.92555,.92284,.9201,.91735,.91458,.91179,.90899,.90616,.90332,.90047,.8976,.89472,.89183,.88893,.88603,.88314,.88024,.87735,.87448,.87162,.86878,.86597,.86319,.86044,.85774,.85508,.85247,.84993,.84744,.84503,.84269,.84042,.83825,.83616,.83417,.83227,.83048,.8288,.82724,.82578,.82445,.82324,.82215,.82119,.82037,.81967,.81911,.81868,.81839,.81824,.81823,.81835,.81862,.81903,.81957,.82026,.82109,.82206,.82317,.82443,.82583,.82737,.82906,.83089,.83287,.83499,.83726,.83968,.84223,.84494,.84778,.85077,.8539,.85717,.86058,.86412,.86781,.87163,.87559,.87968,.88391,.88826,.89275,.89737,.90211,.90698,.91198,.91709,.92233,.92768,.93315,.93873,.94441,.95019,.95607,.96205]},{distance:[4.72925,4.81721,4.9037,4.98859,5.07177,5.15311,5.23249,5.3098,5.38491,5.45772,5.52811,5.59598,5.66122,5.72375,5.78346,5.84028,5.8941,5.94486,5.99248,6.03689,6.07803,6.11584,6.15028,6.18128,6.20882,6.23285,6.25336,6.27031,6.28369,6.29348,6.29969,6.3023,6.30133,6.29678,6.28867,6.27703,6.26187,6.24324,6.22116,6.19567,6.16683,6.13468,6.09928,6.06068,6.01896,5.97417,5.92639,5.87569,5.82217,5.76589,5.70696,5.64545,5.58147,5.5151,5.44644,5.37559,5.30265,5.2277,5.15085,5.0722,4.99184,4.90987,4.82639,4.74151,4.65533,4.56794,4.47945,4.38996,4.29959,4.20843,4.11658,4.02416,3.93125,3.83796,3.74437,3.65057,3.55666,3.46272,3.36884,3.27509,3.18155,3.08831,2.99545,2.90303,2.81114,2.71984,2.62922,2.53933,2.45026,2.36207,2.27484,2.18862,2.10349,2.01951,1.93675,1.85528,1.77515,1.69644,1.61919,1.54348,1.46935,1.39685,1.32605,1.25698,1.18967,1.12417,1.06049,.99863,.93862,.88044,.82408,.76953,.71676,.66574,.61644,.56882,.52282,.47841,.43553,.39413,.35414,.31551,.27817,.24206,.20712,.17328,.14048,.10866,.07776,.04772,.01848,-.00999,-.03776,-.06487,-.09134,-.11721,-.14251,-.16725,-.19144,-.21509,-.2382,-.26076,-.28275,-.30416,-.32496,-.34511,-.36459,-.38334,-.40134,-.41852,-.43485,-.45026,-.46471,-.47815,-.49052,-.50179,-.51189,-.52081,-.52849,-.5349,-.54003,-.54383,-.54627,-.54734,-.54702,-.54528,-.54211,-.53752,-.53149,-.52403,-.51515,-.50487,-.4932,-.48015,-.46575,-.45001,-.43297,-.41463,-.39503,-.37419,-.35213,-.32887,-.30443,-.27885,-.25214,-.22432,-.19541,-.16544,-.13442,-.10235,-.06926,-.03514,0,.03616,.07336,.11159,.15088,.19125,.23272,.27531,.31906,.36401,.41019,.45764,.5064,.55651,.60802,.66096,.71538,.77129,.82874,.88776,.94836,1.01056,1.07438,1.13982,1.20687,1.27554,1.34581,1.41766,1.49107,1.56599,1.64239,1.72025,1.79951,1.88013,1.96209,2.04532,2.12979,2.21546,2.30226,2.39017,2.47911,2.56905,2.65991,2.75164,2.84416,2.93742,3.03133,3.12582,3.2208,3.31619,3.41191,3.50785,3.60393,3.70006,3.79612,3.89202,3.98765,4.08291,4.17767,4.27182,4.36525,4.45783,4.54944,4.63995],pressure:[.30942,.30838,.30765,.30724,.30715,.30738,.30795,.30884,.31007,.31164,.31354,.31578,.31837,.32129,.32455,.32815,.33209,.33636,.34097,.34591,.35117,.35675,.36265,.36887,.37539,.38221,.38933,.39674,.40442,.41238,.4206,.42907,.43779,.44675,.45593,.46533,.47493,.48473,.49471,.50486,.51517,.52563,.53623,.54694,.55777,.5687,.57971,.59079,.60194,.61313,.62435,.6356,.64686,.65811,.66935,.68056,.69174,.70286,.71391,.72489,.73579,.74659,.75728,.76785,.7783,.7886,.79876,.80877,.81861,.82827,.83776,.84706,.85617,.86507,.87378,.88227,.89056,.89863,.90649,.91412,.92153,.92872,.93568,.94241,.94892,.95519,.96122,.96702,.97258,.97791,.98299,.98783,.99242,.99677,.99911,.99525,.99164,.98827,.98515,.98228,.97966,.97728,.97514,.97324,.97159,.97017,.96898,.96801,.96727,.96674,.96641,.96629,.96635,.96661,.96703,.96762,.96838,.96928,.97032,.97149,.97279,.9742,.97572,.97734,.97905,.98085,.98273,.98468,.98669,.98877,.99091,.99311,.99535,.99765,1,.9976,.99516,.99267,.99014,.98755,.98491,.98222,.97947,.97666,.97378,.97083,.96781,.96471,.96153,.95826,.9549,.95144,.94787,.9442,.94042,.93651,.93249,.92834,.92407,.91966,.91512,.91045,.90564,.90069,.8956,.89037,.885,.87949,.87384,.86806,.86214,.85608,.84988,.84356,.83711,.83053,.82383,.81702,.81009,.80306,.79594,.78872,.78141,.77403,.76657,.75905,.75148,.74385,.73619,.72849,.72076,.71302,.70526,.69749,.68972,.68195,.67419,.66644,.65871,.65099,.64329,.63561,.62795,.62032,.61271,.60512,.59755,.59001,.58248,.57497,.56749,.56002,.55256,.54512,.5377,.5303,.52291,.51554,.50819,.50087,.49358,.48632,.4791,.47192,.4648,.45773,.45072,.44378,.43692,.43015,.42346,.41687,.41039,.40403,.39779,.39168,.38571,.37989,.37423,.36873,.36342,.35828,.35335,.34862,.34409,.3398,.33573,.3319,.32831,.32498,.32192,.31912,.3166,.31436,.31242,.31077]}]};export{l as StrokesTexture,a as generateStrokesTexture,u as strokesDefinition};
2
+ import{disposeMaybe as e}from"../../../../../core/maybe.js";import{PixelType as t,SizedPixelFormat as n}from"../../../../webgl/enums.js";import{Texture as r}from"../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../webgl/TextureDescriptor.js";function a(e){let a=u.resolution,s=a/2,c=new Float32Array(a*a),d=a*s,f=u.amplitude,p=a,m=Math.log2(a)+1,h=u.strokes.length,g=(m-1)*h*p;for(let{distance:e,pressure:t}of u.strokes){let n=e,r=t,i=g;for(let e=0;e<m;e++){e!==0&&(n=o(n,0),r=o(r,1));for(let e=0;e<u.resolution;e++){let t=n[e%n.length],a=r?.[e%r.length]??1;c[i]=t,c[i+d]=a,++i}i-=p*(h+1)}g+=p}let _=new i(a);_.dataType=t.FLOAT,_.pixelFormat=6403,_.internalFormat=n.R16F;let v=new r(e,_,c);return new l(a,f,h,v)}function o(e,t){if(!e)return null;let n=e.length/2,r=s*n,i=Array(n),a=0,o=t===1;for(let t=0;t<e.length;t+=2){let n=(e[t]+e[t+1])/2;o?i[a++]=Math.min(r,1-(1-n)*c):i[a++]=Math.min(r,n*c)}return i}const s=1/10,c=.5;class l{constructor(e,t,n,r){this.resolution=e,this.amplitude=t,this.variants=n,this.texture=r}dispose(){this.texture=e(this.texture)}}const u={amplitude:8,resolution:256,strokes:[{distance:[-1.59027,-1.59426,-1.59674,-1.59766,-1.59702,-1.59479,-1.59095,-1.5855,-1.57843,-1.56973,-1.55942,-1.5475,-1.53398,-1.5189,-1.50226,-1.4841,-1.46446,-1.44337,-1.42088,-1.39703,-1.37188,-1.34547,-1.31786,-1.28912,-1.2593,-1.22847,-1.19668,-1.16402,-1.13053,-1.09629,-1.06137,-1.02582,-.98972,-.95313,-.91611,-.87872,-.84102,-.80306,-.76488,-.72654,-.68807,-.64952,-.61092,-.57232,-.53375,-.49527,-.45692,-.41874,-.38078,-.34309,-.3057,-.26867,-.23204,-.19585,-.16015,-.12497,-.09036,-.05634,-.02296,.00977,.04183,.07321,.10389,.13386,.16313,.19169,.21956,.24672,.27321,.299,.32413,.34858,.37237,.3955,.41798,.43981,.461,.48154,.50145,.52073,.53939,.55744,.57488,.5917,.6079,.62347,.63837,.65259,.66609,.67885,.69083,.70201,.71235,.72183,.73042,.73812,.7449,.75076,.7557,.75973,.76284,.76507,.76642,.76692,.76659,.76545,.76352,.76083,.7574,.75324,.74837,.74279,.73652,.72959,.72199,.71377,.70493,.69553,.68558,.67515,.66426,.65298,.64135,.62944,.6173,.60499,.59257,.58008,.56759,.55513,.54275,.5305,.51842,.50654,.4949,.48353,.47246,.4617,.45128,.44121,.43149,.42213,.41313,.40448,.39617,.38818,.3805,.37309,.36594,.35902,.35229,.34572,.33927,.33292,.32663,.32035,.31407,.30774,.30135,.29486,.28824,.28148,.27454,.26739,.26002,.25241,.24454,.23639,.22796,.21922,.21016,.20076,.19098,.18082,.17023,.1592,.14768,.13566,.1231,.10996,.09624,.08188,.06688,.05121,.03485,.01778,0,-.0185,-.03771,-.05763,-.07824,-.09952,-.12144,-.14396,-.16706,-.19069,-.21481,-.23938,-.26436,-.28971,-.31539,-.34136,-.36759,-.39404,-.42067,-.44746,-.47437,-.50136,-.52839,-.55544,-.58248,-.60948,-.63642,-.66329,-.6901,-.71684,-.74352,-.77015,-.79675,-.82332,-.84988,-.87644,-.90301,-.92958,-.95615,-.98272,-1.00926,-1.03575,-1.06217,-1.08847,-1.11463,-1.1406,-1.16633,-1.19178,-1.2169,-1.24164,-1.26595,-1.28979,-1.31312,-1.3359,-1.35809,-1.37963,-1.4005,-1.42064,-1.44,-1.45853,-1.47616,-1.49285,-1.50853,-1.52313,-1.53659,-1.54886,-1.55986,-1.56955,-1.57788,-1.5848],pressure:[-.01365,-.00206,.01025,.02327,.03696,.05129,.06619,.08163,.09755,.11393,.1307,.14784,.16531,.18308,.20111,.21938,.23786,.25651,.2753,.29419,.31315,.33215,.35115,.37015,.38913,.40806,.42694,.44576,.46449,.48313,.50167,.5201,.53839,.55653,.57448,.59222,.60971,.62692,.6438,.66033,.67648,.69221,.70753,.72242,.73688,.75093,.76456,.77779,.79063,.80309,.81517,.82686,.83817,.84911,.85967,.86987,.87972,.88924,.89845,.90734,.91594,.92425,.93229,.94005,.94754,.95475,.96166,.96826,.97451,.9804,.98588,.99092,.99549,.99957,.99685,.99381,.99131,.98936,.98796,.98711,.98681,.98706,.98787,.98923,.99113,.99357,.99654,1,.99607,.99171,.98695,.98181,.97634,.97057,.96452,.95824,.95175,.94506,.93818,.93113,.92389,.91647,.90887,.90109,.89314,.88501,.87672,.86831,.85978,.85119,.84256,.83393,.82533,.8168,.80836,.80002,.79181,.78374,.77582,.7681,.76059,.75331,.74629,.73955,.73311,.72697,.72116,.71568,.71054,.70572,.70121,.697,.69304,.68931,.68576,.68236,.67905,.67582,.67262,.66941,.66619,.66291,.65957,.65613,.65259,.64892,.6451,.6411,.6369,.63248,.62783,.62295,.61783,.61247,.60688,.60104,.59498,.58868,.58216,.57542,.56845,.56125,.5538,.5461,.53813,.52986,.52129,.51239,.50316,.49359,.4837,.47349,.46299,.45223,.44124,.43005,.41869,.40719,.39557,.38386,.37207,.36023,.34836,.33648,.32464,.31287,.30119,.28963,.27822,.26698,.25594,.2451,.23448,.22409,.21391,.20394,.19415,.18452,.17503,.16565,.15636,.14713,.13794,.1288,.11968,.11058,.10151,.09247,.08346,.07447,.06552,.05659,.0477,.03885,.03007,.02137,.01278,.00433,-.00393,-.012,-.01983,-.02738,-.03463,-.04155,-.0481,-.05429,-.0601,-.06553,-.07057,-.07524,-.07954,-.08347,-.08703,-.09022,-.09303,-.09544,-.09744,-.09898,-.10004,-.10059,-.1006,-.10005,-.09892,-.0972,-.09487,-.09192,-.08833,-.08409,-.07918,-.07357,-.06724,-.06019,-.0524,-.04386,-.03455,-.02448]},{distance:[-3.46259,-3.47131,-3.47668,-3.47863,-3.47712,-3.4721,-3.46352,-3.45138,-3.43566,-3.41635,-3.39347,-3.36704,-3.33709,-3.30368,-3.26684,-3.22667,-3.18322,-3.1366,-3.08689,-3.0342,-2.97865,-2.92036,-2.85946,-2.79607,-2.73034,-2.66241,-2.59242,-2.52052,-2.44686,-2.37159,-2.29485,-2.2168,-2.13757,-2.05731,-1.97616,-1.89426,-1.81174,-1.72875,-1.64543,-1.56191,-1.47833,-1.39483,-1.3115,-1.22847,-1.14581,-1.06361,-.98193,-.90083,-.82036,-.74054,-.66141,-.583,-.50532,-.4284,-.35228,-.277,-.20261,-.12916,-.05672,.01463,.08485,.15384,.22153,.28784,.35269,.41602,.47776,.53787,.59629,.653,.70799,.76123,.81274,.86253,.9106,.95698,1.0017,1.04477,1.0862,1.126,1.16415,1.20065,1.23546,1.26857,1.29994,1.32953,1.35731,1.38321,1.40719,1.42921,1.44922,1.46719,1.48309,1.49691,1.50862,1.51825,1.52581,1.53133,1.53486,1.53644,1.53616,1.53409,1.53031,1.52493,1.51803,1.50972,1.50009,1.48924,1.47725,1.46421,1.45019,1.43527,1.4195,1.40295,1.38568,1.36778,1.34929,1.3303,1.31087,1.29108,1.27099,1.25066,1.23018,1.2096,1.18898,1.16838,1.14785,1.12745,1.10721,1.08719,1.06741,1.04791,1.02871,1.00986,.99136,.97324,.95551,.93819,.92127,.90476,.88866,.87296,.85767,.84277,.82823,.81406,.80022,.7867,.77346,.76049,.74774,.73519,.72278,.71049,.69827,.68606,.67381,.66145,.64893,.63618,.62313,.60973,.5959,.5816,.56675,.5513,.53516,.51826,.50053,.4819,.46231,.44169,.42002,.39725,.37336,.34834,.32219,.2949,.2665,.23698,.20638,.17469,.14193,.10809,.07316,.03714,0,-.03827,-.07772,-.11836,-.16022,-.20332,-.24768,-.29332,-.34024,-.38844,-.43788,-.48854,-.54036,-.59329,-.64724,-.70211,-.75782,-.81425,-.87128,-.92881,-.98674,-1.04498,-1.10346,-1.1621,-1.22086,-1.27969,-1.33854,-1.3974,-1.45625,-1.51511,-1.57396,-1.63283,-1.69173,-1.75067,-1.80968,-1.86875,-1.9279,-1.98712,-2.04639,-2.10568,-2.16495,-2.22416,-2.28322,-2.34208,-2.40063,-2.4588,-2.51647,-2.57354,-2.62989,-2.68543,-2.74002,-2.79357,-2.84597,-2.89711,-2.94689,-2.99521,-3.04195,-3.087,-3.13023,-3.17152,-3.21075,-3.24779,-3.28252,-3.3148,-3.34451,-3.37154,-3.39577,-3.41709,-3.43539,-3.45059],pressure:[.87183,.87151,.87129,.87118,.87117,.87128,.87149,.87182,.87225,.8728,.87347,.87424,.87513,.87613,.87723,.87845,.87978,.88122,.88276,.88441,.88616,.88801,.88996,.892,.89414,.89637,.89868,.90108,.90356,.90611,.90874,.91144,.91421,.91704,.91993,.92287,.92587,.92892,.93201,.93514,.93831,.94151,.94474,.94799,.95126,.95456,.95786,.96118,.9645,.96783,.97116,.97448,.9778,.98111,.98441,.9877,.99096,.99421,.99742,.99938,.99622,.9931,.99001,.98697,.98397,.98101,.97811,.97526,.97246,.96972,.96703,.96441,.96185,.95935,.95691,.95455,.95225,.95002,.94786,.94577,.94376,.94182,.93995,.93817,.93646,.93483,.93328,.93181,.93042,.92911,.92788,.92673,.92566,.92467,.92376,.92293,.92217,.92149,.92088,.92034,.91987,.91947,.91913,.91886,.91864,.91849,.91838,.91833,.91834,.91839,.91849,.91863,.91883,.91907,.91935,.91968,.92005,.92046,.92092,.92142,.92195,.92253,.92314,.9238,.92449,.92521,.92598,.92677,.9276,.92847,.92936,.93029,.93125,.93224,.93325,.9343,.93537,.93646,.93758,.93872,.93988,.94106,.94225,.94346,.94469,.94593,.94718,.94844,.94971,.95098,.95226,.95354,.95482,.9561,.95738,.95867,.95995,.96122,.9625,.96377,.96504,.9663,.96757,.96883,.97009,.97135,.97261,.97387,.97513,.9764,.97767,.97895,.98023,.98153,.98284,.98416,.98549,.98684,.98821,.9896,.99101,.99244,.99389,.99537,.99688,.99842,1,.99839,.99675,.99508,.99336,.99161,.98982,.98799,.98613,.98422,.98228,.98029,.97827,.97622,.97414,.97202,.96987,.9677,.96551,.9633,.96107,.95882,.95656,.9543,.95202,.94975,.94747,.94519,.94292,.94065,.93838,.93613,.93388,.93164,.92941,.9272,.92499,.9228,.92062,.91846,.91631,.91418,.91207,.90998,.90792,.90588,.90387,.90189,.89995,.89804,.89617,.89434,.89256,.89083,.88914,.88752,.88595,.88443,.88299,.88161,.8803,.87907,.87791,.87683,.87584,.87494,.87412,.8734,.87278,.87225]},{distance:[.39335,.43437,.47737,.52234,.56923,.61801,.66864,.72109,.7753,.83123,.88882,.94801,1.00875,1.07097,1.13461,1.1996,1.26586,1.33333,1.40193,1.47158,1.54221,1.61373,1.68607,1.75913,1.83284,1.90711,1.98186,2.05699,2.13243,2.20809,2.28387,2.35971,2.4355,2.51117,2.58663,2.66179,2.73658,2.81092,2.88473,2.95792,3.03043,3.10217,3.17308,3.24309,3.31211,3.3801,3.44697,3.51267,3.57712,3.64028,3.70208,3.76247,3.8214,3.87881,3.93467,3.98892,4.04152,4.09244,4.14164,4.18908,4.23474,4.27859,4.32061,4.36077,4.39905,4.43544,4.46992,4.50249,4.53314,4.56185,4.58864,4.61349,4.63642,4.65745,4.67657,4.69381,4.7092,4.72274,4.73447,4.74441,4.75259,4.75903,4.76376,4.76682,4.76822,4.768,4.76618,4.76279,4.75786,4.75142,4.74348,4.73409,4.72326,4.71102,4.69739,4.68241,4.6661,4.64849,4.6296,4.60948,4.58816,4.56567,4.54204,4.51732,4.49154,4.46473,4.43694,4.4082,4.37854,4.348,4.31662,4.28443,4.25145,4.21773,4.1833,4.14819,4.11243,4.07606,4.03912,4.00162,3.96361,3.92512,3.88618,3.84683,3.80708,3.76697,3.72653,3.68579,3.64478,3.60351,3.56202,3.52033,3.47845,3.43642,3.39425,3.35196,3.30957,3.2671,3.22455,3.18196,3.13933,3.09668,3.05402,3.01136,2.96873,2.92613,2.88357,2.84108,2.79865,2.75631,2.71407,2.67195,2.62994,2.58807,2.54634,2.50477,2.46338,2.42216,2.38114,2.34032,2.29971,2.25933,2.21916,2.17923,2.13954,2.10008,2.06087,2.02189,1.98316,1.94468,1.90644,1.86845,1.83069,1.79316,1.75586,1.71877,1.68189,1.6452,1.60868,1.57232,1.53611,1.50004,1.46407,1.4282,1.39241,1.35668,1.321,1.28535,1.24972,1.2141,1.17849,1.14286,1.10723,1.07158,1.03593,1.00028,.96464,.92902,.89344,.85793,.8225,.78719,.75203,.71705,.68231,.64784,.61369,.57991,.54656,.51368,.48134,.44959,.41849,.3881,.35848,.32967,.30174,.27474,.24872,.22373,.19982,.17702,.15539,.13497,.11579,.09791,.08137,.06621,.05248,.04022,.02948,.02029,.01271,.00677,.00252,0,-76e-5,27e-5,.00314,.00788,.01451,.02307,.03357,.04604,.0605,.07697,.09546,.11599,.13858,.16322,.18992,.21869,.24952,.28241,.31735,.35434],pressure:[.95248,.95236,.95228,.95223,.95222,.95224,.95231,.95241,.95256,.95274,.95296,.95322,.95352,.95385,.95423,.95465,.9551,.9556,.95613,.9567,.95731,.95796,.95864,.95936,.96012,.96091,.96173,.96259,.96348,.9644,.96535,.96633,.96734,.96838,.96944,.97053,.97164,.97277,.97393,.9751,.97629,.9775,.97873,.97997,.98122,.98249,.98376,.98505,.98634,.98763,.98893,.99023,.99154,.99284,.99414,.99544,.99673,.99802,.9993,.99942,.99816,.99691,.99568,.99445,.99324,.99205,.99087,.98972,.98858,.98746,.98636,.98528,.98423,.9832,.98219,.98121,.98025,.97931,.9784,.97752,.97666,.97582,.97501,.97423,.97347,.97274,.97203,.97135,.9707,.97007,.96948,.9689,.96836,.96784,.96735,.96689,.96646,.96605,.96567,.96533,.965,.96471,.96445,.96421,.964,.96382,.96367,.96355,.96346,.96339,.96335,.96334,.96336,.9634,.96348,.96358,.9637,.96385,.96403,.96423,.96446,.96471,.96499,.96529,.96561,.96595,.96631,.96669,.96709,.96751,.96795,.9684,.96887,.96935,.96984,.97035,.97087,.9714,.97194,.97249,.97304,.97361,.97418,.97476,.97534,.97592,.97651,.97711,.9777,.9783,.9789,.9795,.9801,.9807,.9813,.9819,.9825,.98309,.98369,.98428,.98486,.98545,.98603,.98661,.98718,.98775,.98832,.98888,.98944,.99,.99056,.99112,.99167,.99223,.99279,.99335,.99392,.99449,.99507,.99565,.99624,.99684,.99745,.99807,.9987,.99934,1,.99933,.99866,.99797,.99727,.99656,.99583,.9951,.99435,.99359,.99283,.99205,.99126,.99046,.98966,.98885,.98803,.9872,.98637,.98554,.9847,.98387,.98303,.98219,.98134,.9805,.97967,.97883,.978,.97717,.97634,.97552,.97471,.97389,.97309,.97229,.9715,.97071,.96993,.96915,.96838,.96762,.96687,.96612,.96539,.96466,.96395,.96324,.96255,.96187,.9612,.96055,.95991,.95929,.95869,.95811,.95754,.957,.95648,.95599,.95552,.95508,.95467,.95428,.95393,.9536,.95331,.95305,.95283,.95264]},{distance:[2.85606,2.86149,2.86432,2.8645,2.862,2.85686,2.84912,2.83886,2.82618,2.81117,2.79393,2.77456,2.75314,2.72975,2.70447,2.67734,2.64844,2.61784,2.58564,2.55196,2.5169,2.48057,2.44305,2.40438,2.36462,2.32383,2.28208,2.23943,2.19591,2.15153,2.10628,2.06016,2.01321,1.96548,1.91702,1.86793,1.8183,1.76829,1.71803,1.66767,1.61737,1.56726,1.51746,1.46803,1.41902,1.37044,1.32228,1.27452,1.22716,1.18023,1.13376,1.08781,1.04244,.99769,.95357,.91003,.86701,.82447,.78238,.74069,.69938,.65836,.61758,.57699,.53656,.49627,.45611,.41611,.37632,.33683,.29776,.25924,.22141,.18441,.14839,.11346,.07972,.04727,.01619,-.01348,-.0417,-.0684,-.09351,-.11698,-.13875,-.1588,-.17713,-.19381,-.20889,-.22242,-.23444,-.24501,-.25421,-.26216,-.26897,-.27473,-.27951,-.28336,-.28631,-.28836,-.28948,-.28963,-.28873,-.28673,-.28355,-.27916,-.27354,-.26673,-.25878,-.2498,-.23992,-.22929,-.21802,-.20623,-.19398,-.18134,-.16836,-.1551,-.14163,-.12809,-.11461,-.1013,-.08826,-.07557,-.06335,-.0517,-.04077,-.03065,-.02143,-.01321,-.00606,0,.00496,.00888,.01181,.01385,.01511,.0157,.01574,.01533,.01458,.01358,.0124,.01112,.00979,.00851,.00738,.0065,.006,.00596,.00646,.00754,.00924,.01161,.01471,.01858,.02323,.02865,.03481,.04169,.0493,.05765,.06677,.07671,.08754,.09934,.11222,.12628,.14159,.15823,.17624,.19561,.21632,.23828,.26142,.28563,.31083,.33696,.36397,.39185,.42057,.4501,.48036,.51125,.54264,.5744,.60646,.63871,.67105,.70337,.73556,.76751,.79918,.83048,.86139,.8919,.92202,.95184,.98144,1.01094,1.04045,1.0701,1.10002,1.13029,1.16103,1.1923,1.22416,1.25664,1.28979,1.32364,1.35824,1.39363,1.42985,1.4669,1.50475,1.54332,1.58252,1.62227,1.6625,1.70312,1.744,1.78501,1.82598,1.8668,1.90734,1.94754,1.98732,2.02666,2.06555,2.10402,2.1421,2.17985,2.2173,2.25448,2.29139,2.328,2.36424,2.4,2.43515,2.46955,2.50309,2.53565,2.56717,2.59761,2.62692,2.65505,2.68191,2.7074,2.73138,2.75375,2.7744,2.79324,2.81017,2.82504,2.83772,2.8481],pressure:[.22758,.23641,.24578,.25568,.26609,.27699,.28835,.30016,.31237,.32495,.33789,.35113,.36466,.37843,.39241,.40658,.4209,.43535,.44989,.4645,.47916,.49385,.50853,.5232,.53784,.55243,.56696,.58141,.59578,.61004,.62419,.63821,.65209,.6658,.67934,.69268,.70582,.71873,.73139,.7438,.75594,.76779,.77935,.79061,.80156,.81221,.82254,.83258,.84231,.85176,.86091,.86978,.87837,.88669,.89473,.9025,.91,.91725,.92425,.931,.93752,.9438,.94985,.95566,.96124,.96658,.97168,.97652,.98109,.98539,.98939,.99309,.99646,.99949,.99783,.99552,.99361,.99209,.99098,.99029,.99003,.99019,.99079,.99181,.99324,.9951,.99735,1,.99698,.99361,.98992,.98592,.98163,.97709,.97231,.96731,.96212,.95676,.95122,.94554,.93973,.93378,.92773,.92157,.91532,.90899,.90258,.89612,.88961,.88308,.87653,.87,.8635,.85705,.85068,.8444,.83823,.83219,.82628,.82052,.81493,.80952,.8043,.79929,.7945,.78994,.78561,.78151,.77765,.77402,.77062,.76742,.76443,.76161,.75896,.75645,.75406,.75175,.74951,.7473,.74511,.74289,.74064,.73833,.73592,.73341,.73078,.728,.72507,.72197,.71869,.71522,.71156,.70769,.70363,.69936,.69489,.69021,.68533,.68023,.67492,.66939,.66363,.65765,.65145,.64501,.63833,.63143,.62428,.61691,.60931,.60148,.59344,.58521,.57679,.5682,.55948,.55063,.54167,.53264,.52354,.51439,.50522,.49603,.48686,.47773,.46865,.45964,.45072,.44192,.43324,.42469,.41629,.40804,.39994,.392,.3842,.37655,.36903,.36164,.35437,.3472,.34012,.33312,.3262,.31933,.31251,.30574,.299,.2923,.28563,.27899,.27239,.26583,.25933,.25288,.24652,.24025,.2341,.22808,.22221,.21653,.21104,.20576,.20072,.19592,.19138,.18712,.18313,.17943,.17602,.17292,.17013,.16766,.16551,.16369,.16222,.1611,.16036,.16001,.16007,.16055,.16148,.16286,.16471,.16705,.16988,.17321,.17706,.18144,.18636,.19182,.19785,.20443,.21158,.2193]},{distance:[-2.31317,-2.3191,-2.32189,-2.32154,-2.31811,-2.31174,-2.30254,-2.29062,-2.27609,-2.25904,-2.23954,-2.21767,-2.19355,-2.16732,-2.13907,-2.10885,-2.07672,-2.04268,-2.00677,-1.96911,-1.92985,-1.88914,-1.84713,-1.80397,-1.75979,-1.71467,-1.66864,-1.62171,-1.57395,-1.52546,-1.47625,-1.42628,-1.3755,-1.32384,-1.27131,-1.218,-1.16408,-1.10972,-1.05508,-1.00031,-.94551,-.89077,-.83615,-.7817,-.72757,-.6739,-.62076,-.56821,-.51625,-.46484,-.41397,-.36366,-.314,-.26506,-.21689,-.16957,-.12316,-.07766,-.03301,.01085,.05399,.09643,.13827,.17967,.22079,.26176,.30265,.34342,.38397,.42414,.46381,.50285,.54115,.57863,.61524,.65093,.6856,.71914,.75153,.78275,.81283,.84182,.86972,.89651,.92208,.94634,.96919,.99052,1.01025,1.02835,1.04484,1.05976,1.07309,1.08479,1.09492,1.1036,1.11096,1.11714,1.12224,1.12627,1.12916,1.13083,1.13125,1.13036,1.12816,1.12466,1.11992,1.11397,1.10677,1.09827,1.08849,1.07746,1.06527,1.05203,1.03786,1.02283,1.00695,.99025,.97279,.9546,.93573,.9163,.8965,.8765,.85647,.83652,.81687,.79775,.77939,.76199,.74568,.73049,.71635,.70316,.69082,.67925,.66834,.65804,.64831,.63911,.63032,.62184,.61363,.60564,.59788,.59036,.58308,.57597,.5689,.56177,.55447,.5469,.53896,.53062,.5219,.51283,.5034,.49355,.48335,.47287,.46223,.45154,.44085,.43012,.41923,.40805,.39648,.38441,.37176,.35849,.34458,.32999,.31461,.29833,.28109,.26288,.2437,.22361,.20265,.18082,.15807,.13434,.1096,.0838,.0569,.02894,0,-.0298,-.0604,-.09173,-.12364,-.15594,-.18843,-.22092,-.25331,-.28559,-.31781,-.35006,-.38244,-.41502,-.44785,-.48098,-.5144,-.54811,-.58218,-.61666,-.65153,-.68677,-.72232,-.75807,-.79397,-.83002,-.86628,-.90281,-.93968,-.97693,-1.01465,-1.05282,-1.09139,-1.13031,-1.16956,-1.20917,-1.24905,-1.28907,-1.32908,-1.36891,-1.40844,-1.44765,-1.48658,-1.52527,-1.56376,-1.60206,-1.64016,-1.67801,-1.71552,-1.75264,-1.78936,-1.8257,-1.86161,-1.89702,-1.93182,-1.96584,-1.99894,-2.03102,-2.06203,-2.0919,-2.12056,-2.14794,-2.17397,-2.19852,-2.22138,-2.24235,-2.26129,-2.27805,-2.29243,-2.30422],pressure:[.9681,.97424,.98046,.98674,.99309,.9995,.99404,.98754,.981,.97444,.96785,.96124,.95462,.94801,.94139,.93479,.92822,.92167,.91515,.90868,.90225,.89589,.88959,.88336,.87722,.87115,.86519,.85932,.85356,.84792,.84239,.83699,.83173,.8266,.82162,.81679,.81211,.80759,.80324,.79906,.79505,.79121,.78756,.78409,.78081,.77771,.77481,.77211,.76959,.76728,.76516,.76324,.76153,.76001,.75869,.75757,.75665,.75593,.7554,.75507,.75493,.75498,.75523,.75565,.75627,.75706,.75803,.75917,.76049,.76197,.76361,.76541,.76737,.76947,.77172,.77409,.7766,.77923,.78198,.78484,.7878,.79086,.79401,.79724,.80055,.80394,.8074,.81092,.8145,.81813,.82182,.82556,.82934,.83317,.83703,.84093,.84487,.84884,.85284,.85687,.86094,.86503,.86915,.87329,.87746,.88166,.88587,.89011,.89436,.89863,.90291,.9072,.91149,.91579,.92009,.92438,.92867,.93295,.9372,.94144,.94566,.94985,.954,.95812,.96219,.96623,.97021,.97415,.97802,.98184,.9856,.9893,.99293,.9965,1,.99657,.9932,.98991,.98668,.98352,.98042,.97738,.9744,.97148,.9686,.96577,.96298,.96023,.95751,.95482,.95214,.94949,.94684,.9442,.94156,.93892,.93627,.93361,.93094,.92825,.92555,.92284,.9201,.91735,.91458,.91179,.90899,.90616,.90332,.90047,.8976,.89472,.89183,.88893,.88603,.88314,.88024,.87735,.87448,.87162,.86878,.86597,.86319,.86044,.85774,.85508,.85247,.84993,.84744,.84503,.84269,.84042,.83825,.83616,.83417,.83227,.83048,.8288,.82724,.82578,.82445,.82324,.82215,.82119,.82037,.81967,.81911,.81868,.81839,.81824,.81823,.81835,.81862,.81903,.81957,.82026,.82109,.82206,.82317,.82443,.82583,.82737,.82906,.83089,.83287,.83499,.83726,.83968,.84223,.84494,.84778,.85077,.8539,.85717,.86058,.86412,.86781,.87163,.87559,.87968,.88391,.88826,.89275,.89737,.90211,.90698,.91198,.91709,.92233,.92768,.93315,.93873,.94441,.95019,.95607,.96205]},{distance:[4.72925,4.81721,4.9037,4.98859,5.07177,5.15311,5.23249,5.3098,5.38491,5.45772,5.52811,5.59598,5.66122,5.72375,5.78346,5.84028,5.8941,5.94486,5.99248,6.03689,6.07803,6.11584,6.15028,6.18128,6.20882,6.23285,6.25336,6.27031,6.28369,6.29348,6.29969,6.3023,6.30133,6.29678,6.28867,6.27703,6.26187,6.24324,6.22116,6.19567,6.16683,6.13468,6.09928,6.06068,6.01896,5.97417,5.92639,5.87569,5.82217,5.76589,5.70696,5.64545,5.58147,5.5151,5.44644,5.37559,5.30265,5.2277,5.15085,5.0722,4.99184,4.90987,4.82639,4.74151,4.65533,4.56794,4.47945,4.38996,4.29959,4.20843,4.11658,4.02416,3.93125,3.83796,3.74437,3.65057,3.55666,3.46272,3.36884,3.27509,3.18155,3.08831,2.99545,2.90303,2.81114,2.71984,2.62922,2.53933,2.45026,2.36207,2.27484,2.18862,2.10349,2.01951,1.93675,1.85528,1.77515,1.69644,1.61919,1.54348,1.46935,1.39685,1.32605,1.25698,1.18967,1.12417,1.06049,.99863,.93862,.88044,.82408,.76953,.71676,.66574,.61644,.56882,.52282,.47841,.43553,.39413,.35414,.31551,.27817,.24206,.20712,.17328,.14048,.10866,.07776,.04772,.01848,-.00999,-.03776,-.06487,-.09134,-.11721,-.14251,-.16725,-.19144,-.21509,-.2382,-.26076,-.28275,-.30416,-.32496,-.34511,-.36459,-.38334,-.40134,-.41852,-.43485,-.45026,-.46471,-.47815,-.49052,-.50179,-.51189,-.52081,-.52849,-.5349,-.54003,-.54383,-.54627,-.54734,-.54702,-.54528,-.54211,-.53752,-.53149,-.52403,-.51515,-.50487,-.4932,-.48015,-.46575,-.45001,-.43297,-.41463,-.39503,-.37419,-.35213,-.32887,-.30443,-.27885,-.25214,-.22432,-.19541,-.16544,-.13442,-.10235,-.06926,-.03514,0,.03616,.07336,.11159,.15088,.19125,.23272,.27531,.31906,.36401,.41019,.45764,.5064,.55651,.60802,.66096,.71538,.77129,.82874,.88776,.94836,1.01056,1.07438,1.13982,1.20687,1.27554,1.34581,1.41766,1.49107,1.56599,1.64239,1.72025,1.79951,1.88013,1.96209,2.04532,2.12979,2.21546,2.30226,2.39017,2.47911,2.56905,2.65991,2.75164,2.84416,2.93742,3.03133,3.12582,3.2208,3.31619,3.41191,3.50785,3.60393,3.70006,3.79612,3.89202,3.98765,4.08291,4.17767,4.27182,4.36525,4.45783,4.54944,4.63995],pressure:[.30942,.30838,.30765,.30724,.30715,.30738,.30795,.30884,.31007,.31164,.31354,.31578,.31837,.32129,.32455,.32815,.33209,.33636,.34097,.34591,.35117,.35675,.36265,.36887,.37539,.38221,.38933,.39674,.40442,.41238,.4206,.42907,.43779,.44675,.45593,.46533,.47493,.48473,.49471,.50486,.51517,.52563,.53623,.54694,.55777,.5687,.57971,.59079,.60194,.61313,.62435,.6356,.64686,.65811,.66935,.68056,.69174,.70286,.71391,.72489,.73579,.74659,.75728,.76785,.7783,.7886,.79876,.80877,.81861,.82827,.83776,.84706,.85617,.86507,.87378,.88227,.89056,.89863,.90649,.91412,.92153,.92872,.93568,.94241,.94892,.95519,.96122,.96702,.97258,.97791,.98299,.98783,.99242,.99677,.99911,.99525,.99164,.98827,.98515,.98228,.97966,.97728,.97514,.97324,.97159,.97017,.96898,.96801,.96727,.96674,.96641,.96629,.96635,.96661,.96703,.96762,.96838,.96928,.97032,.97149,.97279,.9742,.97572,.97734,.97905,.98085,.98273,.98468,.98669,.98877,.99091,.99311,.99535,.99765,1,.9976,.99516,.99267,.99014,.98755,.98491,.98222,.97947,.97666,.97378,.97083,.96781,.96471,.96153,.95826,.9549,.95144,.94787,.9442,.94042,.93651,.93249,.92834,.92407,.91966,.91512,.91045,.90564,.90069,.8956,.89037,.885,.87949,.87384,.86806,.86214,.85608,.84988,.84356,.83711,.83053,.82383,.81702,.81009,.80306,.79594,.78872,.78141,.77403,.76657,.75905,.75148,.74385,.73619,.72849,.72076,.71302,.70526,.69749,.68972,.68195,.67419,.66644,.65871,.65099,.64329,.63561,.62795,.62032,.61271,.60512,.59755,.59001,.58248,.57497,.56749,.56002,.55256,.54512,.5377,.5303,.52291,.51554,.50819,.50087,.49358,.48632,.4791,.47192,.4648,.45773,.45072,.44378,.43692,.43015,.42346,.41687,.41039,.40403,.39779,.39168,.38571,.37989,.37423,.36873,.36342,.35828,.35335,.34862,.34409,.3398,.33573,.3319,.32831,.32498,.32192,.31912,.3166,.31436,.31242,.31077]}]};export{l as StrokesTexture,a as generateStrokesTexture,u as strokesDefinition};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{Pos2TexF16 as e,Pos2 as t}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as n}from"./VertexArrayObject.js";import r from"../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../webgl/TextureDescriptor.js";import{VertexBuffer as a}from"../../../webgl/VertexBuffer.js";function o(r,i=0,o=-1,s=1){let c=i===1,l=c?new Float32Array([o,o,0,s,o,0,o,s,0,s,s,0]):new Float32Array([o,o,s,o,o,s,s,s]);if(c){let e=new Float16Array(l.buffer);e[10]=e[17]=e[22]=e[23]=1}return new n(r,new a(r,c?e:t,l))}function s(e){let t=new i(4);return t.samplingMode=9728,new r(e,t)}export{s as createEmptyTexture,o as createQuadVAO};
2
+ import{Pos2TexF16 as e,Pos2 as t}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as n}from"./VertexArrayObject.js";import{Texture as r}from"../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../webgl/TextureDescriptor.js";import{VertexBuffer as a}from"../../../webgl/VertexBuffer.js";function o(r,i=0,o=-1,s=1){let c=i===1,l=c?new Float32Array([o,o,0,s,o,0,o,s,0,s,s,0]):new Float32Array([o,o,s,o,o,s,s,s]);if(c){let e=new Float16Array(l.buffer);e[10]=e[17]=e[22]=e[23]=1}return new n(r,new a(r,c?e:t,l))}function s(e){let t=new i(4);return t.samplingMode=9728,new r(e,t)}export{s as createEmptyTexture,o as createQuadVAO};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{set as e,equals as t,transformMat4 as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColor as i,isDepth as a,isColorHighlightOLIDOrDepth as o}from"../core/shaderLibrary/ShaderOutput.js";import s from"../lib/GLMaterial.js";import{LineMaterial as c}from"../lib/LineMaterial.js";import{VisualVariablePassParameters as l}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as u}from"./internal/bufferWriterUtils.js";import{getLayout as d,LineMarkerTechnique as f}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as p}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as m}from"../../../../webscene/support/AlphaCutoff.js";class h extends c{constructor(e,t){super(e,_),this.produces=new Map([[2,e=>e===10||i(e)&&this.parameters.renderOccluded===8],[3,e=>a(e)],[10,e=>o(e)&&this.parameters.renderOccluded===8],[11,e=>o(e)&&this.parameters.renderOccluded===8],[4,e=>i(e)],[18,e=>i(e)||e===10]]),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this._configuration=new p(t)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==0,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.worldSpace=this.parameters.worldSpace&&!this._configuration.draped,this._configuration.hasScreenSizePerspective=this.parameters.screenSizePerspective!=null&&!this._configuration.worldSized}get visible(){return this.parameters.color[3]>=m}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}intersectRay(){}intersectScreenPolygon(){return null}createBufferWriter(){return new v(d(this.parameters),this.parameters)}createGLMaterial(e){return new g(e)}}class g extends s{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){let t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(f,e)}}class _ extends l{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive=`arrow`,this.markerScale=1,this.placement=`end`,this.cap=0,this.anchor=0,this.hasTip=!1,this.shadingEnabled=!1,this.worldSpace=!1,this.worldSized=!1,this.hideOnShortSegments=!1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class v{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return this._parameters.placement===`begin-end`?12:6}write(r,i,a,o){if(o==null)return;let{buffer:s,offset:c}=o,l=a.get(`position`).data,d=l.length/3,f=[1,0,0],p=a.get(`normal`);this._parameters.worldSpace&&p!=null&&(f=p.data);let m=1,h=0;this._parameters.vvSize?h=a.get(`sizeFeatureAttribute`).data[0]:a.has(`size`)&&(m=a.get(`size`).data[0]);let g=[1,1,1,1],_=0;this._parameters.vvColor?_=a.get(`colorFeatureAttribute`).data[0]:a.has(`color`)&&(g=a.get(`color`).data);let v=0;this._parameters.vvOpacity&&(v=a.get(`opacityFeatureAttribute`).data[0]);let x=new Float32Array(s.buffer),S=new Float16Array(s.buffer),C=new Uint8Array(s.buffer),w=c*(this.layout.stride/4),T=x.BYTES_PER_ELEMENT/S.BYTES_PER_ELEMENT,E=4/T,D=(e,t,n,r)=>{x[w++]=e[0],x[w++]=e[1],x[w++]=e[2],u(t,e,S,w*T),w+=E;let i=w*T;if(S[i++]=n[0],S[i++]=n[1],w=Math.ceil(i/T),this._parameters.vvColor)x[w++]=_;else{let e=Math.min(r*4,g.length-4),t=w++*4;C[t]=g[e]*255,C[t+1]=g[e+1]*255,C[t+2]=g[e+2]*255,C[t+3]=g[e+3]*255}this._parameters.vvOpacity&&(x[w++]=v),i=w*T,this._parameters.vvSize?(x[w++]=h,i+=2):S[i++]=m,this._parameters.worldSpace&&(S[i++]=f[0],S[i++]=f[1],S[i++]=f[2]),w=Math.ceil(i/T)},O=(i,a)=>{let o=e(y,l[i*3],l[i*3+1],l[i*3+2]),s=b,c=i+a;do e(s,l[c*3],l[c*3+1],l[c*3+2]),c+=a;while(t(o,s)&&c>=0&&c<d);r&&(n(o,o,r),n(s,s,r)),D(o,s,[-1,-1],i),D(o,s,[1,-1],i),D(o,s,[1,1],i),D(o,s,[-1,-1],i),D(o,s,[1,1],i),D(o,s,[-1,1],i)},k=this._parameters.placement;(k===`begin`||k===`begin-end`)&&O(0,1),(k===`end`||k===`begin-end`)&&O(d-1,-1)}}const y=r(),b=r();export{h as LineMarkerMaterial,_ as Parameters};
2
+ import{BufferViewVec3f as e}from"../../../../geometry/support/buffer/BufferView.js";import{isColor as t,isDepth as n,isColorHighlightOLIDOrDepth as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{LineMaterial as a}from"../lib/LineMaterial.js";import{createVerticesView as o}from"../lib/VerticesView.js";import{VisualVariablePassParameters as s}from"./VisualVariablePassParameters.js";import{writeLineMarkerBuffer as c}from"./internal/lineMarkerBufferUtils.js";import{getLayout as l,LineMarkerTechnique as u}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as f}from"../../../../webscene/support/AlphaCutoff.js";class p extends a{constructor(e,i){super(e,h),this.produces=new Map([[2,e=>e===10||t(e)&&this.parameters.renderOccluded===8],[3,e=>n(e)],[10,e=>r(e)&&this.parameters.renderOccluded===8],[11,e=>r(e)&&this.parameters.renderOccluded===8],[4,e=>t(e)],[18,e=>t(e)||e===10]]),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this._configuration=new d(i)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==0,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.worldSpace=this.parameters.worldSpace&&!this._configuration.draped,this._configuration.hasScreenSizePerspective=this.parameters.screenSizePerspective!=null&&!this._configuration.worldSized}get visible(){return this.parameters.color[3]>=f}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}intersectRay(){}intersectScreenPolygon(){return null}computeAttachmentOrigin(){return!1}createPrimitivePositionReader(t){let n=t.vertex.getField(`position`,e);return(e,t)=>n.getVec(t,e)}createBufferWriter(){return new g(l(this.parameters),this.parameters)}createGLMaterial(e){return new m(e)}}class m extends i{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){let t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(u,e)}}class h extends s{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive=`arrow`,this.markerScale=1,this.placement=`end`,this.cap=0,this.anchor=0,this.hasTip=!1,this.shadingEnabled=!1,this.worldSpace=!1,this.worldSized=!1,this.hideOnShortSegments=!1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class g{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return this._parameters.placement===`begin-end`?12:6}rebaseBuffers(e,t){t?.buffer.copyFrom(e.vertex,0,t.offset)}write(e,t,n,r){if(r==null)return;let i=n.get(`position`);c({position:o(i,3),normal:n.get(`normal`)?.data,color:n.get(`color`)?.data,size:n.get(`size`)?.data[0],colorFeature:this._parameters.vvColor?n.get(`colorFeatureAttribute`).data[0]:void 0,sizeFeature:this._parameters.vvSize?n.get(`sizeFeatureAttribute`).data[0]:void 0,opacityFeature:this._parameters.vvOpacity?n.get(`opacityFeatureAttribute`).data[0]:void 0},this._parameters,r,e)}}export{p as LineMarkerMaterial,h as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as C,closestLineSegmentPoint as w,projectPoint as T,projectPointFraction as E,create as D}from"../../../../geometry/support/lineSegment.js";import{fromPoints as O,signedDistance as k,getNormal as ee,create as A}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as te,BufferViewFloat as j,BufferViewVec4Unorm8 as ne,BufferViewVec4f16 as re,BufferViewUint32 as ie}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as ae,isColor as M,isDepth as oe,isColorHighlightOLIDOrDepth as se,is2DGeometryOutput as ce}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as le}from"../effects/geometry/olidUtils.js";import ue from"../lib/GLMaterial.js";import{LineMaterial as de}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as fe,encodeRibbonLineVertexInfo as pe}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as me,screenPolygonIntersectsBufferedSegment as he}from"../lib/screenPolygonOverlapUtils.js";import{Hit as ge,DrapedHit as _e}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as ve}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as ye,assert as N}from"../lib/Util.js";import{isImagePattern as be}from"./lineStippleUtils.js";import{VisualVariablePassParameters as xe}from"./VisualVariablePassParameters.js";import{writeColor as Se}from"./internal/bufferWriterUtils.js";import{intersectRayWithWorldSizedLineSegment as Ce,intersectScreenPolygonWithWorldSizedLineSegment as we}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{n as Te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as Ee,getTextureBufferLayout as De}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Oe}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ke}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Ae}from"../../../../webscene/support/AlphaCutoff.js";class je extends de{constructor(e,t){super(e,Ne),this.produces=new Map([[2,e=>ae(e)||M(e)&&this.parameters.renderOccluded===8],[3,e=>oe(e)],[10,e=>se(e)&&this.parameters.renderOccluded===8],[11,e=>se(e)&&this.parameters.renderOccluded===8],[4,e=>M(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>M(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>ce(e)]]),this._configuration=new ke(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=Le(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Ie(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=Ae||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>Ae}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=r[0],u=r[1],d=F(c,o,s,this.parameters.usesWorldSizedWidth()),f=Number.MAX_VALUE,p=0;for(let n of Fe(R,z,this.parameters,e)){let e=l-R[0],r=u-R[1],i=z[0]-R[0],a=z[1]-R[1],o=i*e+a*r,s=i*i+a*a,c=t(o/s,0,1),d=i*c-e,m=a*c-r,h=d*d+m*m;h<f&&(f=h,p=n)}f<d*d&&i(a.distance,a.renderDistance,a.normal,p)}intersectRay(t,n,r,i,a,o){let{options:s,camera:c}=r;if(!s.selectionMode||!t.visible||!c)return;if(!ye(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let l=this._getLineSize(t.attributes);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(t,n,r,l,o):this._intersectRayWithScreenSizedLine(t,n,r,l,o)}_intersectRayWithScreenSizedLine(e,t,n,r,i){let{camera:a}=n,s=e.attributes,c=s.get(`position`).data,_=W;o(_,n.point);let v=r*a.pixelRatio,y=$*a.pixelRatio,b=v/2+y;l(Y[0],_[0]-b,_[1]+b,0),l(Y[1],_[0]+b,_[1]+b,0),l(Y[2],_[0]+b,_[1]-b,0),l(Y[3],_[0]-b,_[1]-b,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(Y[e],X[e]))return;O(a.eye,X[0],X[1],Z),O(a.eye,X[1],X[2],qe),O(a.eye,X[2],X[3],Je),O(a.eye,X[3],X[0],Q);let x=Number.MAX_VALUE,T=0;for(let e of this._forEachTransformedLineSegment(I,L,c,t,P(this.parameters,s))){if(k(Z,I)<0&&k(Z,L)<0||k(qe,I)<0&&k(qe,L)<0||k(Je,I)<0&&k(Je,L)<0||k(Q,I)<0&&k(Q,L)<0)continue;let t=a.projectToRenderScreen(I,G),n=a.projectToRenderScreen(L,K);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(H,I,L);let e=a.frustum,n=-k(e[4],I)/d(H,ee(e[4]));if(f(H,H,n),p(I,I,H),!a.projectToRenderScreen(I,t))continue}else if(t[2]>0&&n[2]<0){u(H,L,I);let e=a.frustum,t=-k(e[4],L)/d(H,ee(e[4]));if(f(H,H,t),p(L,L,H),!a.projectToRenderScreen(L,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let i=S(t,n,Ge),o=C(i,_);if(!(o>=x)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(i,I,L,_,a,r,y);if(o>=e*e)continue}x=o,m(He,I),m(Ue,L),T=e}}if(x<b*b){let{rayBegin:e,rayEnd:t}=n,r=Number.MAX_VALUE;if(w(S(He,Ue,Ge),S(e,t,Ke),U)){u(U,U,e);let n=h(U);f(U,U,1/n),r=n/g(e,t)}i(r,r,U,T)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,c=e.attributes,l=c.get(`position`).data,u=r/(2*s),d=1/0,f=0;for(let e of this._forEachTransformedLineSegment(I,L,l,t,P(this.parameters,c))){let t=Ce(I,L,u,a,o,We);if(t!=null&&t<d&&(d=t,f=e,m(U,We),t===0))break}d<1/0&&i(d,d,U,f)}intersectScreenPolygon(t,n,r,i){let{options:a}=r;if(!a.selectionMode||!t.visible)return null;if(!ye(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let o=this._getLineSize(t.attributes);return this.parameters.worldSized?this._intersectWorldSizedPolygon(t,n,r,i,o):this._intersectScreenSizedPolygon(t,n,r,i,o)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=e.attributes,c=s.get(`position`).data,l=$,u=l*a.pixelRatio,d=new ge(4);for(let e of this._forEachTransformedLineSegment(I,L,c,t,P(this.parameters,s)))for(let[t,n]of o.processLineSegment(Xe,I,L)){if(!me(a,t,n,G,K))continue;let o=S(G,K,Ge),s=i/2+l;this.parameters.screenSizePerspective&&(_(W,G,K,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,W,a,i,u)/a.pixelRatio)),a.renderToScreen(G,Be),a.renderToScreen(K,Ve),he(r,Be,Ve,s)&&(T(S(t,n,Ke),a.eye,B),d.updateIfCloserFromValues(g(a.eye,B),e,B,null))}return d}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,{attributes:c}=e,l=c.get(`position`).data,u=i/(2*s),d=new ge(4);for(let e of this._forEachTransformedLineSegment(I,L,l,t,P(this.parameters,c)))for(let[t,n]of o.processLineSegment(Xe,I,L)){T(S(t,n,Ke),a.eye,B);let i=g(a.eye,B);d.valid&&i>=d.distance||we(t,n,u,a,r)&&d.updateIfCloserFromValues(i,e,B,null)}return d}intersectScreenPolygonDraped({attributes:e},t,n,r,i,a){if(!n.options.selectionMode)return null;let o=F(this._getLineSize(e,!0),i,a,this.parameters.usesWorldSizedWidth());for(let n of Fe(R,z,this.parameters,e,t))if(he(r,R,z,o))return new _e(n);return null}createBufferWriter(){return new Pe(Ee(this.parameters),De(this.parameters),this.parameters)}createGLMaterial(e){return new Me(e)}validateParameters(e){N(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=E(e,r);_(B,t,n,s),v(ze,B,i.viewMatrix);let c=h(ze),l=this.computeCameraAbsCosAngle(B,i,this._configuration.spherical);return Re.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Re.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(U,e):l(U,0,0,1),u(V,e,t.eye),y(V,V),Math.abs(d(U,V))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=e.get(`sizeFeatureAttribute`).data[0];Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else this.parameters.hasVertexSize&&e.has(`size`)&&(r*=e.get(`size`).data[0]);return r}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.length-2:n.length-5;for(let i=0;i<a;i+=3){e[0]=n[i]+r[12],e[1]=n[i+1]+r[13],e[2]=n[i+2]+r[14];let a=(i+3)%n.length;t[0]=n[a]+r[12],t[1]=n[a+1]+r[13],t[2]=n[a+2]+r[14],yield i/3}}}class Me extends ue{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Oe,e)}}class Ne extends xe{constructor(){super(...arguments),this._width=0,this.color=x,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return be(this.stipplePattern)&&this.stippleTexture!=null}}class Pe{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.maxTextureBufferItemIndex=fe.getField(0).max,this.numJoinSubdivisions=Le(this._parameters.join,this._parameters.stipplePattern!=null)}_isClosed(e){return P(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get(`position`).data.length/3+(this._isClosed(e)?3:2)}elementCount(e){let t=e.get(`position`).indices.length/2+1,n=this._isClosed(e),r=n?2:4,i=+!n,a=n?t:t-1,o=this.numJoinSubdivisions*2+4;return r+=(a-i)*o,r+=2,this._parameters.wireframe&&(r=2+(r-2)*4),r}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=t.get(`position`),i=r.data.length/3,a=this._isClosed(t),{buffer:o,offset:s}=n,c=o.getField(`position`,te),l=o.getField(`u0`,j),u=o.getField(`sizeFeatureAttribute`,j),d=o.getField(`size`,j),f=o.getField(`colorFeatureAttribute`,j),p=o.getField(`color`,ne),h=o.getField(`olidColor`,ne),_=o.getField(`timeStamps`,re),v=o.getField(`opacityFeatureAttribute`,j),y=t.get(`sizeFeatureAttribute`)?.data,b=t.get(`size`)?.data,x=t.get(`colorFeatureAttribute`)?.data,S=t.get(`color`)?.data,C=t.get(`opacityFeatureAttribute`)?.data,w=t.get(`distanceToStart`)?.data,T=t.get(`timeStamps`);N(c!==null,`Expected valid position field in texture buffer`);let E=0;for(let t=0;t<i;++t){this._getTransformedPosition(J,r.data,t,e),l!=null&&t>0&&(w==null?E+=g(q,J):E=w[t]??E);let n=s+t+1;if(c.setVec(n,J),l!=null&&(l.set(n,E),m(q,J)),u&&u.set(n,y?.length===1?y[0]:y?.[t]??0),d&&d.set(n,b?.length===1?b[0]:b?.[t]??1),f&&f.set(n,x?.length===1?x[0]:x?.[t]??0),p){if(S!=null){let e=Math.min(t*4,S.length-4);p.setValues(n,S[e],S[e+1],S[e+2],S[e+3])}else p.setValues(n,1,1,1,1)}v&&v.set(n,C?.length===1?C[0]:C?.[t]??0)}if(_!=null&&T!=null){N(T.size===4);let e=T.data;for(let t=0;t<i;++t){let n=t*4,r=s+t+1;_.set(r,0,e[n]),_.set(r,1,e[n+1]),_.set(r,2,e[n+2]),_.set(r,3,e[n+3])}}if(a){let e=s,t=s+1,n=s+2,r=s+i,a=r+1,u=r+2;if(o.copyItem(r,e),o.copyItem(t,a),o.copyItem(n,u),l!=null){c.getVec(r,q),c.getVec(t,J);let e=w?.[i]??E+g(q,J);l.set(a,e)}}else{let e=s,t=s+1,n=s+i,r=n+1;o.copyItem(t,e),o.copyItem(n,r)}let D=t.get(`olidColor`);le()&&D!=null&&h!=null&&Se(D,4,h,s)}_writeVertexBuffer(e,t,n){let{buffer:r,offset:i}=t,a=e.get(`position`),o=a.indices,s=a.data.length/3,c=this._isClosed(e),l=s+(c?3:2);o&&o.length!==2*(s-1)&&console.warn(`RibbonLineMaterial does not support indices`);let u=r.getField(`ribbonLineVertexInfo`,ie);N(u!=null,`Missing ribbon vertex information field`),N(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let d=n.from;N(n.numElements===l,`Expected number of elements in TextureBuffer to equal number of points`);let f=u.typedBuffer,p=i+1,m=(e,t,n)=>{f[p++]=pe(d+n+1,t,e)},h=0,g=0;c?(h=0,g=s):(m(1,7,0),m(1,5,0),h=1,g=s-1);for(let e=h;e<g;e++){m(0,2,e),m(0,0,e);let t=this.numJoinSubdivisions;for(let n=0;n<t;++n){let r=(n+1)/(t+1);m(r,2,e),m(r,0,e)}m(1,6,e),m(1,4,e)}c?(m(0,2,g),m(0,0,g)):(m(0,3,g),m(0,1,g)),f[i]=f[i+1],f[p]=f[p-1],p++,this._parameters.wireframe&&this._addWireframeVertices(f,i,p)}_getTransformedPosition(e,t,n,r){let i=n*3;l(e,t[i+0],t[i+1],t[i+2]),r&&v(e,e,r)}_addWireframeVertices(e,t,n){let r=n;for(let i=t;i<=n-4;i+=2)e[r++]=e[i],e[r++]=e[i+2],e[r++]=e[i+1],e[r++]=e[i+2],e[r++]=e[i+1],e[r++]=e[i+3]}}function P(e,t){return e.isClosed?t.get(`position`).indices.length>2:!1}function F(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*Fe(e,t,n,r,i){let a=r.get(`position`).data,c=P(n,r)?a.length-2:a.length-5,l=i?.[0]??0,u=i?.[1]??0;s(e,a[0]+l,a[1]+u);for(let n=3;n<c+3;n+=3){let r=n%a.length;s(t,a[r]+l,a[r+1]+u),yield n/3,o(e,t)}}function Ie(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}function Le(e,t){let n=+!!t;switch(e){case`miter`:case`bevel`:return n;case`round`:return Te+n}}const Re=new ve,I=b(),L=b(),R=c(),z=c(),B=b(),ze=b(),V=b(),H=b(),U=b(),W=b(),G=n(),K=n(),Be=r(),Ve=r(),He=b(),Ue=b(),We=b(),Ge=D(),Ke=D(),q=b(),J=b(),Y=[n(),n(),n(),n()],X=[b(),b(),b(),b()],Z=A(),qe=A(),Je=A(),Q=A(),$=4,Ye={getDrapedRibbonLineMaxDistance:F},Xe=[b(),b()];export{Ne as Parameters,je as RibbonLineMaterial,Ye as test};
2
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y,applyTranslation as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as ee}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as te,closestLineSegmentPoint as ne,projectPoint as re,projectPointFraction as ie,create as ae}from"../../../../geometry/support/lineSegment.js";import{fromPoints as C,signedDistance as w,getNormal as oe,create as T}from"../../../../geometry/support/plane.js";import{BufferViewUint32 as E,BufferViewVec3f as se}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as ce,isColor as D,isDepth as le,isColorHighlightOLIDOrDepth as ue,is2DGeometryOutput as de}from"../core/shaderLibrary/ShaderOutput.js";import{getScalarAttributeView as fe}from"../lib/attributeViewUtils.js";import pe from"../lib/GLMaterial.js";import{LineMaterial as me}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as O}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as he,screenPolygonIntersectsBufferedSegment as ge}from"../lib/screenPolygonOverlapUtils.js";import{Hit as _e,DrapedHit as ve}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as ye}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as be,assert as k}from"../lib/Util.js";import{createVerticesView as xe}from"../lib/VerticesView.js";import{isImagePattern as Se}from"./lineStippleUtils.js";import{VisualVariablePassParameters as Ce}from"./VisualVariablePassParameters.js";import{getNumJoinSubdivisions as we,getRibbonLinePositions as A,ribbonLineVertexCount as Te,writeRibbonLineTextureBuffer as Ee,writeRibbonLineVertices as De}from"./internal/ribbonLineBufferUtils.js";import{intersectRayWithWorldSizedLineSegment as Oe,intersectScreenPolygonWithWorldSizedLineSegment as ke}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{getLayout as Ae,getTextureBufferLayout as je}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Me}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Pe}from"../../../../webscene/support/AlphaCutoff.js";class Fe extends me{constructor(e,t){super(e,Le),this.produces=new Map([[2,e=>ce(e)||D(e)&&this.parameters.renderOccluded===8],[3,e=>le(e)],[10,e=>ue(e)&&this.parameters.renderOccluded===8],[11,e=>ue(e)&&this.parameters.renderOccluded===8],[4,e=>D(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>D(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>de(e)]]),this._configuration=new Ne(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=we(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Be(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=Pe||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>Pe}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped(e,n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=A(e,!!this.parameters.isClosed),u=r[0],d=r[1],f=M(c,o,s,this.parameters.usesWorldSizedWidth()),p=Number.MAX_VALUE,m=0;for(let e of ze(F,I,l,j(this.parameters,l.count))){let n=u-F[0],r=d-F[1],i=I[0]-F[0],a=I[1]-F[1],o=i*n+a*r,s=i*i+a*a,c=t(o/s,0,1),l=i*c-n,f=a*c-r,h=l*l+f*f;h<p&&(p=h,m=e)}p<f*f&&i(a.distance,a.renderDistance,a.normal,m)}intersectRay(t,n,r,i,a,o){let{options:s,camera:c}=r;if(!s.selectionMode||!t.visible||!c)return;if(!be(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let l=this._getLineSize(t);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(t,n,r,l,o):this._intersectRayWithScreenSizedLine(t,n,r,l,o)}_intersectRayWithScreenSizedLine(e,t,n,r,i){let{camera:a}=n,s=A(e,!!this.parameters.isClosed),c=V;o(c,n.point);let _=r*a.pixelRatio,v=$*a.pixelRatio,y=_/2+v;l(q[0],c[0]-y,c[1]+y,0),l(q[1],c[0]+y,c[1]+y,0),l(q[2],c[0]+y,c[1]-y,0),l(q[3],c[0]-y,c[1]-y,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(q[e],J[e]))return;C(a.eye,J[0],J[1],Y),C(a.eye,J[1],J[2],X),C(a.eye,J[2],J[3],Z),C(a.eye,J[3],J[0],Q);let b=Number.MAX_VALUE,x=0;for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count))){if(w(Y,N)<0&&w(Y,P)<0||w(X,N)<0&&w(X,P)<0||w(Z,N)<0&&w(Z,P)<0||w(Q,N)<0&&w(Q,P)<0)continue;let t=a.projectToRenderScreen(N,H),n=a.projectToRenderScreen(P,U);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(z,N,P);let e=a.frustum,n=-w(e[4],N)/d(z,oe(e[4]));if(f(z,z,n),p(N,N,z),!a.projectToRenderScreen(N,t))continue}else if(t[2]>0&&n[2]<0){u(z,P,N);let e=a.frustum,t=-w(e[4],P)/d(z,oe(e[4]));if(f(z,z,t),p(P,P,z),!a.projectToRenderScreen(P,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let i=S(t,n,G),o=te(i,c);if(!(o>=b)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(i,N,P,c,a,r,v);if(o>=e*e)continue}b=o,m(Ge,N),m(Ke,P),x=e}}if(b<y*y){let{rayBegin:e,rayEnd:t}=n,r=Number.MAX_VALUE;if(ne(S(Ge,Ke,G),S(e,t,K),B)){u(B,B,e);let n=h(B);f(B,B,1/n),r=n/g(e,t)}i(r,r,B,x)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=r/(2*s),u=1/0,d=0;for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count))){let t=Oe(N,P,l,a,o,W);if(t!=null&&t<u&&(u=t,d=e,m(B,W),t===0))break}u<1/0&&i(u,u,B,d)}intersectScreenPolygon(t,n,r,i){let{options:a}=r;if(!a.selectionMode||!t.visible)return null;if(!be(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let o=this._getLineSize(t);return this.parameters.worldSized?this._intersectWorldSizedPolygon(t,n,r,i,o):this._intersectScreenSizedPolygon(t,n,r,i,o)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=A(e,!!this.parameters.isClosed),c=$,l=c*a.pixelRatio,u=new _e(4);for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count)))for(let[t,n]of o.processLineSegment(Je,N,P)){if(!he(a,t,n,H,U))continue;let o=S(H,U,G),s=i/2+c;this.parameters.screenSizePerspective&&(_(V,H,U,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,V,a,i,l)/a.pixelRatio)),a.renderToScreen(H,Ue),a.renderToScreen(U,We),ge(r,Ue,We,s)&&(re(S(t,n,K),a.eye,L),u.updateIfCloserFromValues(g(a.eye,L),e,L,null))}return u}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=i/(2*s),u=new _e(4);for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count)))for(let[t,n]of o.processLineSegment(Je,N,P)){re(S(t,n,K),a.eye,L);let i=g(a.eye,L);u.valid&&i>=u.distance||ke(t,n,l,a,r)&&u.updateIfCloserFromValues(i,e,L,null)}return u}intersectScreenPolygonDraped(e,t,n,r,i,a){if(!n.options.selectionMode)return null;let o=this._getLineSize(e,!0),s=A(e,!!this.parameters.isClosed),c=M(o,i,a,this.parameters.usesWorldSizedWidth());for(let e of ze(F,I,s,j(this.parameters,s.count),t))if(ge(r,F,I,c))return new ve(e);return null}createPrimitivePositionReader(e){let t=e.vertex.getField(`ribbonLineVertexInfo`,E),n=e.storage.getField(`position`,se),r=O.getField(0);return(e,i)=>n.getVec(r.get(t.get(i)),e)}computeAttachmentOrigin(e,t,n){return!this.parameters.wireframe&&super.computeAttachmentOrigin(e,t,n)}createBufferWriter(){return new Re(Ae(this.parameters),je(this.parameters),this.parameters)}createGLMaterial(e){return new Ie(e)}validateParameters(e){k(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=ie(e,r);_(L,t,n,s),v(He,L,i.viewMatrix);let c=h(He),l=this.computeCameraAbsCosAngle(L,i,this._configuration.spherical);return Ve.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Ve.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(B,e):l(B,0,0,1),u(R,e,t.eye),y(R,R),Math.abs(d(B,R))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=fe(e,`sizeFeatureAttribute`).get(0);Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else if(this.parameters.hasVertexSize){let t=fe(e,`size`);t!=null&&(r*=t.get(0))}return r}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.count:n.count-1;for(let i=0;i<a;i++)n.getVec(i,e),b(e,e,r),n.getVec((i+1)%n.count,t),b(t,t,r),yield i}}class Ie extends pe{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Me,e)}}class Le extends Ce{constructor(){super(...arguments),this._width=0,this.color=ee,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return Se(this.stipplePattern)&&this.stippleTexture!=null}}class Re{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.maxTextureBufferItemIndex=O.getField(0).max}_isClosed(e){return j(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){let t=e.get(`position`);return t.data.length/3+(this._isClosed(t.data.length/t.stride)?3:2)}elementCount(e){let t=e.get(`position`),n=t.indices.length/2+1;return Te(n,this._isClosed(t.data.length/t.stride),this._parameters)}rebaseBuffers(e,t,n,r){if(r?.buffer.copyFrom(e.storage,0,r.offset),t!=null){let r=n.from,i=e.vertex.getField(`ribbonLineVertexInfo`,E),a=t.buffer.getField(`ribbonLineVertexInfo`,E),o=O.getField(0);for(let e=0;e<i.count;e++){let n=i.get(e),s=o.get(n)+r;a.set(t.offset+e,n===0?0:o.set(n,s))}}}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=xe(t.get(`position`),3),i=t.get(`timeStamps`);i!=null&&n.buffer.layout.fields.has(`timeStamps`)&&k(i.size===4),Ee({position:r,color:t.get(`color`)?.data,size:t.get(`size`)?.data,colorFeature:t.get(`colorFeatureAttribute`)?.data,sizeFeature:t.get(`sizeFeatureAttribute`)?.data,opacityFeature:t.get(`opacityFeatureAttribute`)?.data,distancesToStart:t.get(`distanceToStart`)?.data,timeStamps:i?.data,olidColor:t.get(`olidColor`)?.data},this._isClosed(r.count),n,e)}_writeVertexBuffer(e,t,n){let r=e.get(`position`),i=r.indices,a=r.data.length/3,o=this._isClosed(r.data.length/r.stride),s=a+(o?3:2);i&&i.length!==2*(a-1)&&console.warn(`RibbonLineMaterial does not support indices`),k(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let c=n.from;k(n.numElements===s,`Expected number of elements in TextureBuffer to equal number of points`),De(a,o,this._parameters,t,c)}}function j(e,t){return e.isClosed&&t>2}function M(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*ze(e,t,n,r,i){let a=r?n.count:n.count-1,c=i?.[0]??0,l=i?.[1]??0;s(e,n.get(0,0)+c,n.get(0,1)+l);for(let r=1;r<=a;r++){let i=r%n.count;s(t,n.get(i,0)+c,n.get(i,1)+l),yield r,o(e,t)}}function Be(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}const Ve=new ye,N=x(),P=x(),F=c(),I=c(),L=x(),He=x(),R=x(),z=x(),B=x(),V=x(),H=n(),U=n(),Ue=r(),We=r(),Ge=x(),Ke=x(),W=x(),G=ae(),K=ae(),q=[n(),n(),n(),n()],J=[x(),x(),x(),x()],Y=T(),X=T(),Z=T(),Q=T(),$=4,qe={getDrapedRibbonLineMaxDistance:M},Je=[x(),x()];export{Le as Parameters,Fe as RibbonLineMaterial,qe as test};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../../../../../assets.js";import n from"../../../../../core/Accessor.js";import{createTask as r}from"../../../../../core/asyncUtils.js";import i from"../../../../../core/Logger.js";import{abortMaybe as a,disposeMaybe as o}from"../../../../../core/maybe.js";import{throwIfAborted as s}from"../../../../../core/promiseUtils.js";import{property as c,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as u}from"../../../../../request/image.js";import{NoParameters as d}from"../../../../webgl/NoParameters.js";import f from"../../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../../webgl/TextureDescriptor.js";let m=class extends n{constructor(){super(...arguments),this._passParameters=new h,this._resourcesTask=null}get passParameters(){return this._passParameters}destroy(){this._resourcesTask=a(this._resourcesTask),this._passParameters.waveNormal=o(this._passParameters.waveNormal),this._passParameters.wavePerturbation=o(this._passParameters.wavePerturbation)}get updating(){return!!this._resourcesTask&&!this._resourcesTask.finished}ensureResources(e){return this._resourcesTask||=r(async n=>{await Promise.allSettled([this._loadImageResource(e,t(`esri/images/materials/water/normals.jpg`),e=>this._passParameters.waveNormal=e,n),this._loadImageResource(e,t(`esri/images/materials/water/perturbation.jpg`),e=>this._passParameters.wavePerturbation=e,n)])}),this._resourcesTask.finished?2:1}async _loadImageResource(e,t,n,r){try{let i=await u(t,{signal:r});s(r);let a=new p(i.width,i.height);a.pixelFormat=6407,a.samplingMode=9987,a.hasMipmap=!0,a.maxAnisotropy=8,n(new f(e,a,i))}catch(e){i.getLogger(this).error(`Failed to load water material normal texture.`,e)}}};e([c()],m.prototype,`_resourcesTask`,void 0),e([c({type:Boolean,readOnly:!0})],m.prototype,`updating`,null),m=e([l(`esri.views.3d.webgl-engine.materials.internal.WaterTextureRepository`)],m);class h extends d{}export{h as WaterTexturePassParameters,m as WaterTextureRepository};
2
+ import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../../../../../assets.js";import n from"../../../../../core/Accessor.js";import{createTask as r}from"../../../../../core/asyncUtils.js";import i from"../../../../../core/Logger.js";import{abortMaybe as a,disposeMaybe as o}from"../../../../../core/maybe.js";import{throwIfAborted as s}from"../../../../../core/promiseUtils.js";import{property as c,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as u}from"../../../../../request/image.js";import{NoParameters as d}from"../../../../webgl/NoParameters.js";import{Texture as f}from"../../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../../webgl/TextureDescriptor.js";let m=class extends n{constructor(){super(...arguments),this._passParameters=new h,this._resourcesTask=null}get passParameters(){return this._passParameters}destroy(){this._resourcesTask=a(this._resourcesTask),this._passParameters.waveNormal=o(this._passParameters.waveNormal),this._passParameters.wavePerturbation=o(this._passParameters.wavePerturbation)}get updating(){return!!this._resourcesTask&&!this._resourcesTask.finished}ensureResources(e){return this._resourcesTask||=r(async n=>{await Promise.allSettled([this._loadImageResource(e,t(`esri/images/materials/water/normals.jpg`),e=>this._passParameters.waveNormal=e,n),this._loadImageResource(e,t(`esri/images/materials/water/perturbation.jpg`),e=>this._passParameters.wavePerturbation=e,n)])}),this._resourcesTask.finished?2:1}async _loadImageResource(e,t,n,r){try{let i=await u(t,{signal:r});s(r);let a=new p(i.width,i.height);a.pixelFormat=6407,a.samplingMode=9987,a.hasMipmap=!0,a.maxAnisotropy=8,n(new f(e,a,i))}catch(e){i.getLogger(this).error(`Failed to load water material normal texture.`,e)}}};e([c()],m.prototype,`_resourcesTask`,void 0),e([c({type:Boolean,readOnly:!0})],m.prototype,`updating`,null),m=e([l(`esri.views.3d.webgl-engine.materials.internal.WaterTextureRepository`)],m);class h extends d{}export{h as WaterTexturePassParameters,m as WaterTextureRepository};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{fromTranslation as e}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{negate as n,equals as r,transformMat4 as i}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a,UNIT_X as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as s}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewVec4f16 as c,BufferViewVec3f as l,BufferViewVec2f16 as u,BufferViewVec4u8 as d,BufferViewFloat as f,BufferViewFloat16 as p,BufferViewVec3f16 as m}from"../../../../../geometry/support/buffer/BufferView.js";import{BufferGeometry as h}from"../../lib/BufferGeometry.js";import{Buffers as g}from"../../lib/Buffers.js";import{createVerticesView as _}from"../../lib/VerticesView.js";import{writeDeltaF16Vector as v}from"./bufferWriterUtils.js";import{getLayout as y}from"../../shaders/LineMarkerTechnique.js";function b(t,r,i){let{attributeData:a}=r,o=y(t.parameters).createBuffer(t.parameters.placement===`begin-end`?12:6);return n(k,i.vec3),e(A,k),x({position:_({data:a.position,size:3,stride:3},3),color:a.color??void 0,size:a.size??void 0,normal:a.normal??void 0,colorFeature:C(a.colorFeature),sizeFeature:C(a.sizeFeature),opacityFeature:C(a.opacityFeature)},t.parameters,{buffer:o,offset:0},A),new h(t,new g(o),i,r.mapPositions)}function x(e,t,n,r){S(e.position,t,{position:n.buffer.getField(`position`,l),previousDelta:n.buffer.getField(`previousDelta`,c),offset:n.offset},r);let{buffer:i,offset:a}=n,o=i.getField(`uv0`,u),s=i.getField(`color`,d),h=i.getField(`colorFeatureAttribute`,f),g=i.getField(`size`,p),_=i.getField(`sizeFeatureAttribute`,f),v=i.getField(`opacityFeatureAttribute`,f),y=i.getField(`normal`,m),b=t.placement===`begin-end`?12:6;for(let n=0;n<b;n++){let r=a+n,i=t.placement===`begin`||t.placement===`begin-end`&&n<6?0:e.position.count-1;if(o.setValues(r,w[n%6][0],w[n%6][1]),s!=null){let t=e.color??T,n=Math.min(i*4,t.length-4);s.setValues(r,t[n]*255,t[n+1]*255,t[n+2]*255,t[n+3]*255)}if(h?.set(r,e.colorFeature??0),v?.set(r,e.opacityFeature??0),g?.set(r,e.size??1),_?.set(r,e.sizeFeature??0),t.worldSpace){let t=e.normal??E;y.setValues(r,t[0],t[1],t[2])}}}function S(e,t,n,a=null){let{position:o,previousDelta:s}=n,c=n.offset,l=(t,n)=>{e.getVec(t,D);let l=t+n;do e.getVec(l,O),l+=n;while(r(D,O)&&l>=0&&l<e.count);a!=null&&(i(D,D,a),i(O,O,a));for(let e=0;e<6;e++,c++)o.setVec(c,D),v(O,D,s.typedBuffer,c*s.typedBufferStride)};(t.placement===`begin`||t.placement===`begin-end`)&&l(0,1),(t.placement===`end`||t.placement===`begin-end`)&&l(e.count-1,-1)}function C(e){return typeof e==`number`?e:e?.[0]}const w=[[-1,-1],[1,-1],[1,1],[-1,-1],[1,1],[-1,1]],T=s,E=o,D=a(),O=a(),k=a(),A=t();export{b as createLineMarkerBufferGeometry,x as writeLineMarkerBuffer,S as writeLineMarkerPositions};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{transformMat4 as e,distance as t,copy as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BufferViewVec3f as i,BufferViewFloat as a,BufferViewVec4Unorm8 as o,BufferViewVec4u8 as s,BufferViewVec4f16 as c,BufferViewUint32 as l}from"../../../../../geometry/support/buffer/BufferView.js";import{olidEnabled as u}from"../../effects/geometry/olidUtils.js";import{encodeRibbonLineVertexInfo as d}from"../../lib/RibbonLineVertexInfo.js";import{assert as f}from"../../lib/Util.js";import{createVerticesView as p}from"../../lib/VerticesView.js";import{n as m}from"../../../../../chunks/RibbonLine.glsl.js";function h(e,t){return(e===`round`?m:0)+ +!!t}function g(e,t,n){let r=t?e:e-2,i=h(n.join,n.stipplePattern!=null),a=(t?2:4)+r*(i*2+4)+2;return n.wireframe?2+(a-2)*4:a}function _(e,t,n,r,i){let{buffer:a,offset:o}=r,s=a.getField(`ribbonLineVertexInfo`,l).typedBuffer,c=h(n.join,n.stipplePattern!=null),u=o+1,f=(e,t,n)=>{s[u++]=d(i+n+1,t,e)};t||(f(1,7,0),f(1,5,0));let p=t?e:e-1;for(let e=+!t;e<p;e++){f(0,2,e),f(0,0,e);for(let t=0;t<c;t++){let n=(t+1)/(c+1);f(n,2,e),f(n,0,e)}f(1,6,e),f(1,4,e)}f(0,t?2:3,p),f(0,+!t,p),s[o]=s[o+1],s[u]=s[u-1],u++,n.wireframe&&v(s,o,u)}function v(e,t,n){let r=n;for(let i=t;i<=n-4;i+=2)e[r++]=e[i],e[r++]=e[i+2],e[r++]=e[i+1],e[r++]=e[i+2],e[r++]=e[i+1],e[r++]=e[i+3]}function y(r,l,d,p){let m=r.position,{buffer:h,offset:g}=d,_=h.getField(`position`,i);f(_!=null,`Expected valid position field in texture buffer`);let v=h.getField(`u0`,a),y=r.distancesToStart,x=h.getField(`color`,o),S=h.getField(`size`,a),C=h.getField(`colorFeatureAttribute`,a),O=h.getField(`sizeFeatureAttribute`,a),k=h.getField(`opacityFeatureAttribute`,a),A=u()?h.getField(`olidColor`,o):null,j=A==null?null:new s(A.buffer,A.start,A.stride),M=h.getField(`timeStamps`,c),N=0;for(let i=0;i<m.count;i++){m.getVec(i,E),p!=null&&e(E,E,p),v!=null&&i>0&&(y==null?N+=t(D,E):N=y[i]??N);let a=g+i+1;if(_.setVec(a,E),v!=null&&(v.set(a,N),n(D,E)),S?.set(a,w(r.size,i,1)),x!=null){let e=r.color??T,t=Math.min(i*4,e.length-4);x.setValues(a,e[t],e[t+1],e[t+2],e[t+3])}if(C?.set(a,w(r.colorFeature,i)),k?.set(a,w(r.opacityFeature,i)),O?.set(a,w(r.sizeFeature,i)),M!=null&&r.timeStamps!=null&&M.setValues(a,r.timeStamps[i*4],r.timeStamps[i*4+1],r.timeStamps[i*4+2],r.timeStamps[i*4+3]),j!=null&&r.olidColor!=null){let e=Math.min(i*4,r.olidColor.length-4);j.setValues(a,r.olidColor[e],r.olidColor[e+1],r.olidColor[e+2],r.olidColor[e+3])}}b(h,m.count,l,g),l&&v!=null&&(m.getVec(0,E),p!=null&&e(E,E,p),v.set(g+m.count+1,y?.[m.count]??N+t(D,E)))}function b(e,t,n,r=0){let i=r+1,a=r+t;n?(e.copyItem(a,r),e.copyItem(i,a+1),e.copyItem(i+1,a+2)):(e.copyItem(i,r),e.copyItem(a,a+1))}function x(e,t){let n=e.count-(t&&e.count>4?3:2);return e.slice(1,n)}function S(e,t){if(e.type===1)return x(e.buffers.storage.getField(`position`,i),t);let n=e.attributes.get(`position`);return p(n,3)}function C(e,r){let o=e.buffers.storage,s=o.getField(`u0`,a);if(s==null)return;let c=x(o.getField(`position`,i),r),l=0;for(let e=0;e<c.count;e++)c.getVec(e,E),e>0&&(l+=t(D,E)),s.set(e+1,l),n(D,E);r&&c.count>2?(c.getVec(0,E),s.set(0,l),s.set(c.count+1,l+t(D,E)),s.set(c.count+2,s.get(2))):(s.set(0,0),s.set(c.count+1,l))}function w(e,t,n=0){return typeof e==`number`?e:e?.[e.length===1?0:t]??n}const T=[1,1,1,1],E=r(),D=r();export{b as fillRibbonLinePadding,h as getNumJoinSubdivisions,x as getRibbonLineBufferPositions,S as getRibbonLinePositions,g as ribbonLineVertexCount,C as updateRibbonLineDistances,y as writeRibbonLineTextureBuffer,_ as writeRibbonLineVertices};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{disposeMaybe as n}from"../../../../../core/maybe.js";import{property as r,subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{GLMaterialLoader as a}from"../../lib/GLMaterialLoader.js";import{assert as o}from"../../lib/Util.js";import{DrawParameters as s}from"../DrawParameters.js";import{getStrideForDataType as c}from"./IndexLayout.js";import{defaultHighlightName as l}from"../../../../support/HighlightDefaults.js";let u=class extends t{constructor(e){super(e),this._glMaterialLoader=null,this._drawParameters=new s,this._highlightNames=new Set,this._produces=new Map}initialize(){this._updateProduces()}destroy(){this.uninitializeRenderContext()}get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(e){return this._highlightNames.has(e)}get produces(){return this._produces}_updateProduces(){this.material.produces.forEach((e,t)=>{this._produces.set(t,t=>this.dataByBaseInstance.size===0||(t===10||t===6)&&!this._hasHighlights?!1:e(t))})}initializeRenderContext(e){this._glMaterialLoader=new a(this.material,e.materials)}uninitializeRenderContext(){this._glMaterialLoader=n(this._glMaterialLoader)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;let{output:t,bind:n}=e;if(!this.material.produces.get(n.slot)?.(t))return null;let{highlight:r,slot:i}=n,a=t===6,o=t===10,s=o||a,c=r?.name;if(s&&(this._highlightNames.size===0||o&&c&&!this._highlightNames.has(c)))return null;let u=e=>o&&!!c&&!e.has(c),d=t===7,f=!(s||d);for(let r of this.dataByBaseInstance.values())for(let o of r.dataByOrigin.values())for(let r of o.buffers){if(u(r.highlightNames))continue;let o=a?r.drawCommandsHighlights.get(l):s?c?r.drawCommandsHighlights.get(c):r.drawCommandsHighlights.size>0:((d&&r.needsMultipleCommands?r.drawCommandsShadowHighlightRest:r.drawCommandsDefault)||null)?.length??!1,p=f&&r.drawCommandsOccludees||null;if(o||p?.length){let r=this._glMaterialLoader.load(e.rctx,i,t)?.beginSlot(n);if(r)return r}}return null}render(e,t){let{output:n,bind:r}=e,{highlight:i}=r,a=n===10,s=i?.name??``;if(a&&!i)return;let c=n===6,u=a||c,g=n===7,_=!(u||g),{rctx:v}=e,x=v.bindTechnique(t,r,this.material.parameters),S=this.material.useIndexing;for(let e of this.dataByBaseInstance.values()){let{baseInstanceData:n}=e,i=n!=null;o(!(i&&S),`Instanced indexed rendering is not supported`);let C=i?h:S?m:p,w=i?f:d;for(let i of e.dataByOrigin.values()){this._drawParameters.origin=i.origin;for(let e of i.buffers){if(a&&(!e.hasHighlights||!e.drawCommandsHighlights.has(s))||c&&(!e.hasHighlights||!e.drawCommandsHighlights.has(l)))continue;this._drawParameters.textureBuffer=e.textureBuffer?.texture;let i=w(e),o=y(i,e.needsMultipleCommands,s,c,u,g),d=b(i,_);(o?.length||d?.length)&&(x.bindDraw(r,this.material.parameters,this._drawParameters),C(v,e,n,t,o,d,r,this.material.parameters)),this._drawParameters.textureBuffer=null}}}}updateHighlights(){let{_highlightNames:e}=this;e.clear();for(let t of this.dataByBaseInstance.values())for(let n of t.dataByOrigin.values())for(let t of n.buffers)for(let n of t.highlightNames)e.add(n);this._updateProduces()}get test(){}};e([r({constructOnly:!0})],u.prototype,`material`,void 0),e([r({constructOnly:!0})],u.prototype,`dataByBaseInstance`,void 0),u=e([i(`esri.views.3d.webgl-engine.materials.renderers.VaoRenderer`)],u);const d=e=>e,f=e=>e.instancedCommandVAOs,p=(e,{vao:t},n,r,i,a,o,s)=>{r.ensureAttributeLocations(t),e.bindVAO(t),g(e,r,i,o,s,!1),g(e,r,a,o,s,!0)},m=(e,{vao:t},n,r,i,a,s,c)=>{r.ensureAttributeLocations(t),e.bindVAO(t);let l=t.indexBuffer?.indexType;o(l!=null,`Missing index array`),_(e,r,i,s,c,!1,l),_(e,r,a,s,c,!0,l)},h=(e,t,{baseCommand:n},r,i,a,o,s)=>{v(e,r,n,i,o,s,!1),v(e,r,n,a,o,s,!0)};function g(e,t,n,r,i,a){if(n?.length){e.setPipelineState(t.getPipeline(r,i,a));for(let r of n)e.drawArrays(t.primitiveType,r.first,r.count)}}function _(e,t,n,r,i,a,o){if(!n?.length)return;let s=c(o);e.setPipelineState(t.getPipeline(r,i,a));for(let r of n)e.drawElements(t.primitiveType,r.count,o,r.first*s)}function v(e,t,{first:n,count:r},i,a,o,s){if(i?.length){e.setPipelineState(t.getPipeline(a,o,s));for(let{vao:a,instanceCount:o}of i)t.ensureAttributeLocations(a),e.bindVAO(a),e.drawArraysInstanced(t.primitiveType,n,r,o)}}function y(e,t,n,r,i,a){let o=i&&!r?e.drawCommandsHighlights.get(n)??null:null;return r?e.drawCommandsHighlights.get(l):i?o:a&&t?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault}function b(e,t){return t&&e.drawCommandsOccludees||null}export{u as VaoRenderer};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{disposeMaybe as n}from"../../../../../core/maybe.js";import{property as r,subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{GLMaterialLoader as a}from"../../lib/GLMaterialLoader.js";import{assert as o}from"../../lib/Util.js";import{DrawParameters as s}from"../DrawParameters.js";import{getStrideForDataType as c}from"./IndexLayout.js";import{defaultHighlightName as l}from"../../../../support/HighlightDefaults.js";let u=class extends t{constructor(e){super(e),this._glMaterialLoader=null,this._drawParameters=new s,this._highlightNames=new Set,this._produces=new Map}initialize(){this.material.produces.forEach((e,t)=>{this._produces.set(t,t=>this.dataByBaseInstance.size===0||(t===10||t===6)&&!this._hasHighlights?!1:e(t))})}destroy(){this.uninitializeRenderContext()}get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(e){return this._highlightNames.has(e)}get produces(){return this._produces}initializeRenderContext(e){this._glMaterialLoader=new a(this.material,e.materials)}uninitializeRenderContext(){this._glMaterialLoader=n(this._glMaterialLoader)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;let{output:t,bind:n}=e;if(!this.material.produces.get(n.slot)?.(t))return null;let{highlight:r,slot:i}=n,a=t===6,o=t===10,s=o||a,c=r?.name;if(s&&(this._highlightNames.size===0||o&&c&&!this._highlightNames.has(c)))return null;let u=e=>o&&!!c&&!e.has(c),d=t===7,f=!(s||d);for(let r of this.dataByBaseInstance.values())for(let o of r.dataByOrigin.values())for(let r of o.buffers){if(u(r.highlightNames))continue;let o=a?r.drawCommandsHighlights.get(l):s?c?r.drawCommandsHighlights.get(c):r.drawCommandsHighlights.size>0:((d&&r.needsMultipleCommands?r.drawCommandsShadowHighlightRest:r.drawCommandsDefault)||null)?.length??!1,p=f&&r.drawCommandsOccludees||null;if(o||p?.length){let r=this._glMaterialLoader.load(e.rctx,i,t)?.beginSlot(n);if(r)return r}}return null}render(e,t){let{output:n,bind:r}=e,{highlight:i}=r,a=n===10,s=i?.name??``;if(a&&!i)return;let c=n===6,u=a||c,g=n===7,_=!(u||g),{rctx:v}=e,x=v.bindTechnique(t,r,this.material.parameters),S=this.material.useIndexing;for(let e of this.dataByBaseInstance.values()){let{baseInstanceData:n}=e,i=n!=null;o(!(i&&S),`Instanced indexed rendering is not supported`);let C=i?h:S?m:p,w=i?f:d;for(let i of e.dataByOrigin.values()){this._drawParameters.origin=i.origin;for(let e of i.buffers){if(a&&(!e.hasHighlights||!e.drawCommandsHighlights.has(s))||c&&(!e.hasHighlights||!e.drawCommandsHighlights.has(l)))continue;this._drawParameters.textureBuffer=e.textureBuffer?.texture;let i=w(e),o=y(i,e.needsMultipleCommands,s,c,u,g),d=b(i,_);(o?.length||d?.length)&&(x.bindDraw(r,this.material.parameters,this._drawParameters),C(v,e,n,t,o,d,r,this.material.parameters)),this._drawParameters.textureBuffer=null}}}}updateHighlights(){let{_highlightNames:e}=this;e.clear();for(let t of this.dataByBaseInstance.values())for(let n of t.dataByOrigin.values())for(let t of n.buffers)for(let n of t.highlightNames)e.add(n)}get test(){}};e([r({constructOnly:!0})],u.prototype,`material`,void 0),e([r({constructOnly:!0})],u.prototype,`dataByBaseInstance`,void 0),u=e([i(`esri.views.3d.webgl-engine.materials.renderers.VaoRenderer`)],u);const d=e=>e,f=e=>e.instancedCommandVAOs,p=(e,{vao:t},n,r,i,a,o,s)=>{r.ensureAttributeLocations(t),e.bindVAO(t),g(e,r,i,o,s,!1),g(e,r,a,o,s,!0)},m=(e,{vao:t},n,r,i,a,s,c)=>{r.ensureAttributeLocations(t),e.bindVAO(t);let l=t.indexBuffer?.indexType;o(l!=null,`Missing index array`),_(e,r,i,s,c,!1,l),_(e,r,a,s,c,!0,l)},h=(e,t,{baseCommand:n},r,i,a,o,s)=>{v(e,r,n,i,o,s,!1),v(e,r,n,a,o,s,!0)};function g(e,t,n,r,i,a){if(n?.length){e.setPipelineState(t.getPipeline(r,i,a));for(let r of n)e.drawArrays(t.primitiveType,r.first,r.count)}}function _(e,t,n,r,i,a,o){if(!n?.length)return;let s=c(o);e.setPipelineState(t.getPipeline(r,i,a));for(let r of n)e.drawElements(t.primitiveType,r.count,o,r.first*s)}function v(e,t,{first:n,count:r},i,a,o,s){if(i?.length){e.setPipelineState(t.getPipeline(a,o,s));for(let{vao:a,instanceCount:o}of i)t.ensureAttributeLocations(a),e.bindVAO(a),e.drawArraysInstanced(t.primitiveType,n,r,o)}}function y(e,t,n,r,i,a){let o=i&&!r?e.drawCommandsHighlights.get(n)??null:null;return r?e.drawCommandsHighlights.get(l):i?o:a&&t?e.drawCommandsShadowHighlightRest:e.drawCommandsDefault}function b(e,t){return t&&e.drawCommandsOccludees||null}export{u as VaoRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{isImagePattern as e}from"./lineStippleUtils.js";import{ProceduralTextureRepository as t}from"./ProceduralTextureRepository.js";import{PixelType as n,SizedPixelFormat as r}from"../../../webgl/enums.js";import i from"../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../webgl/TextureDescriptor.js";function o(o,c){return new t(t=>{if(e(t))return u(o,t.image);let{data:c,textureSize:l}=s(t),d=new a(l,1);return d.dataType=n.FLOAT,d.pixelFormat=6403,d.internalFormat=r.R16F,d.wrapMode=10497,new i(o,d,c)},t=>e(t)?`image-${t.uuid}`:`${t.pattern.join(`,`)}-r${t.pixelRatio}`,c)}function s(e){let t=c(e),n=1/e.pixelRatio,r=l(e),i=[],a=0,o=0,s=0,u=1;for(let e of t)e>0&&(o!==u&&(i.push(s),a||=u),o=u,s+=e),u=-u;i.length>1&&a===o&&(i[0]=i.pop());let d=Math.round(t[0]/2),f=new Float32Array(r);if(i.length===1)f.fill(a*65504);else if(i.length>1){let e=0,t=a,o=i[0]===0?0:i[0]-r,s=i[1];for(let a=0;a<r;a++){let c=a+d+.5;if(c>=s){e=(e+1)%i.length,t=-t,o=s;let n=i[(e+1)%i.length];s+=(n-i[e]+r)%r}f[a]=t*Math.min(c-o,s-c)*n}}return{data:f,textureSize:r}}function c(e){return e.pattern.map(t=>Math.round(t*e.pixelRatio))}function l(e){if(e==null)return 1;let t=c(e);return Math.floor(t.reduce((e,t)=>e+t,0))}function u(e,t){let{data:o,width:s,height:c}=t,l=new a(s,c);return l.dataType=n.UNSIGNED_BYTE,l.pixelFormat=6408,l.internalFormat=r.RGBA8,l.wrapMode={s:10497,t:33071},l.hasMipmap=!0,l.samplingMode=9987,new i(e,l,o)}export{l as computeTextureSize,o as createStippleTextureRepository,u as imageToTexture,s as patternToTextureData};
2
+ import{isImagePattern as e}from"./lineStippleUtils.js";import{ProceduralTextureRepository as t}from"./ProceduralTextureRepository.js";import{PixelType as n,SizedPixelFormat as r}from"../../../webgl/enums.js";import{Texture as i}from"../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../webgl/TextureDescriptor.js";function o(o,c){return new t(t=>{if(e(t))return u(o,t.image);let{data:c,textureSize:l}=s(t),d=new a(l,1);return d.dataType=n.FLOAT,d.pixelFormat=6403,d.internalFormat=r.R16F,d.wrapMode=10497,new i(o,d,c)},t=>e(t)?`image-${t.uuid}`:`${t.pattern.join(`,`)}-r${t.pixelRatio}`,c)}function s(e){let t=c(e),n=1/e.pixelRatio,r=l(e),i=[],a=0,o=0,s=0,u=1;for(let e of t)e>0&&(o!==u&&(i.push(s),a||=u),o=u,s+=e),u=-u;i.length>1&&a===o&&(i[0]=i.pop());let d=Math.round(t[0]/2),f=new Float32Array(r);if(i.length===1)f.fill(a*65504);else if(i.length>1){let e=0,t=a,o=i[0]===0?0:i[0]-r,s=i[1];for(let a=0;a<r;a++){let c=a+d+.5;if(c>=s){e=(e+1)%i.length,t=-t,o=s;let n=i[(e+1)%i.length];s+=(n-i[e]+r)%r}f[a]=t*Math.min(c-o,s-c)*n}}return{data:f,textureSize:r}}function c(e){return e.pattern.map(t=>Math.round(t*e.pixelRatio))}function l(e){if(e==null)return 1;let t=c(e);return Math.floor(t.reduce((e,t)=>e+t,0))}function u(e,t){let{data:o,width:s,height:c}=t,l=new a(s,c);return l.dataType=n.UNSIGNED_BYTE,l.pixelFormat=6408,l.internalFormat=r.RGBA8,l.wrapMode={s:10497,t:33071},l.hasMipmap=!0,l.samplingMode=9987,new i(e,l,o)}export{l as computeTextureSize,o as createStippleTextureRepository,u as imageToTexture,s as patternToTextureData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{ignoreAbortErrors as n,debounce as r,isAbortError as i}from"../../../core/promiseUtils.js";import{pausable as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../core/support/UpdatingHandles.js";let l=class extends t{constructor(e){super(e),this._debouncedMeasure=null,this._pausableWatch=null,this._inputWatch=null,this._lastSeenValue=void 0,this._getContext=null,this._updatingHandles=new c,this.field=null,this.appliesToHandlesWithRole=null,this.appliesToHandlesWithName=null,this.displayGroup=null}get name(){return this.field.name}get displayOrder(){return this.field.displayOrder}set displayOrder(e){this.field.displayOrder=e}get readOnly(){return this.field.readOnly}set readonly(e){this.field.readOnly=e}get lockable(){return this.field.lockable}set lockable(e){this.field.lockable=e}get unlockOnVertexPlacement(){return this.field.unlockOnVertexPlacement}set unlockOnVertexPlacement(e){this.field.unlockOnVertexPlacement=e}get parse(){return this.field.parse}set parse(e){this.field.parse=e}get format(){return this.field.format}set format(e){this.field.format=e}get formatForInputMode(){return this.field.formatForInputMode}set formatForInputMode(e){this.field.formatForInputMode=e}get suffix(){return this.field.suffix}set suffix(e){this.field.suffix=e}get enabled(){return this._get(`enabled`)}set enabled(e){this._set(`enabled`,e),e?(this._pausableWatch?.resume(),this._debouncedMeasure&&this._updatingHandles.addPromise(n(this._debouncedMeasure(this._inputWatch?.(),this._getContext?.(),this._lastSeenValue)))):this._pausableWatch?.pause()}get updating(){return this._updatingHandles.updating}setActual(e){this.field.setActual(e)}getCommitted(){return this.field.committed}getActual(){return this.field.actual}getInput(){return this.field.inputValue}registerMeasurement(e,t,o){this._inputWatch=e,this._getContext=o;let s=(e,n,r)=>t(e,n,r).then(e=>(this.setActual(e),e)).catch(e=>{if(!i(e))return this.setActual(null),null});this._debouncedMeasure=r(s);let c=this._pausableWatch=a(e,(e,t)=>{this._lastSeenValue=e,o()&&this._debouncedMeasure&&this._updatingHandles.addPromise(n(this._debouncedMeasure(e,o(),t)))});if(!this.enabled)c.pause();else{let t=e();this._updatingHandles.addPromise(n(this._debouncedMeasure(t,o(),void 0)))}this.addHandles(c)}show(){this.field.visible=!0}hide(){this.field.visible=!1}};e([o({constructOnly:!0})],l.prototype,`field`,void 0),e([o()],l.prototype,`name`,null),e([o()],l.prototype,`displayOrder`,null),e([o()],l.prototype,`readOnly`,null),e([o()],l.prototype,`lockable`,null),e([o()],l.prototype,`unlockOnVertexPlacement`,null),e([o()],l.prototype,`parse`,null),e([o()],l.prototype,`format`,null),e([o()],l.prototype,`formatForInputMode`,null),e([o()],l.prototype,`suffix`,null),e([o()],l.prototype,`appliesToHandlesWithRole`,void 0),e([o()],l.prototype,`appliesToHandlesWithName`,void 0),e([o()],l.prototype,`enabled`,null),e([o()],l.prototype,`displayGroup`,void 0),e([o()],l.prototype,`updating`,null),l=e([s(`esri.views.draw.support.ManagedTooltipField`)],l);export{l as ManagedTooltipField};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{ignoreAbortErrors as n,debounce as r,isAbortError as i}from"../../../core/promiseUtils.js";import{pausable as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../core/support/UpdatingHandles.js";let l=class extends t{constructor(e){super(e),this._debouncedMeasure=null,this._pausableWatch=null,this._inputWatch=null,this._lastSeenValue=void 0,this._getContext=null,this._updatingHandles=new c,this.field=null,this.appliesToHandlesWithRole=null,this.appliesToHandlesWithName=null,this.displayGroup=null}get name(){return this.field.name}get displayOrder(){return this.field.displayOrder}set displayOrder(e){this.field.displayOrder=e}get readOnly(){return this.field.readOnly}set readOnly(e){this.field.readOnly=e}get lockable(){return this.field.lockable}set lockable(e){this.field.lockable=e}get unlockOnVertexPlacement(){return this.field.unlockOnVertexPlacement}set unlockOnVertexPlacement(e){this.field.unlockOnVertexPlacement=e}get parse(){return this.field.parse}set parse(e){this.field.parse=e}get format(){return this.field.format}set format(e){this.field.format=e}get formatForInputMode(){return this.field.formatForInputMode}set formatForInputMode(e){this.field.formatForInputMode=e}get suffix(){return this.field.suffix}set suffix(e){this.field.suffix=e}get enabled(){return this._get(`enabled`)}set enabled(e){this._set(`enabled`,e),e?(this._pausableWatch?.resume(),this._debouncedMeasure&&this._updatingHandles.addPromise(n(this._debouncedMeasure(this._inputWatch?.(),this._getContext?.(),this._lastSeenValue)))):this._pausableWatch?.pause()}get updating(){return this._updatingHandles.updating}setActual(e){this.field.setActual(e)}getCommitted(){return this.field.committed}getActual(){return this.field.actual}getInput(){return this.field.inputValue}registerMeasurement(e,t,o){this._inputWatch=e,this._getContext=o;let s=(e,n,r)=>t(e,n,r).then(e=>(this.setActual(e),e)).catch(e=>{if(!i(e))return this.setActual(null),null});this._debouncedMeasure=r(s);let c=this._pausableWatch=a(e,(e,t)=>{this._lastSeenValue=e,o()&&this._debouncedMeasure&&this._updatingHandles.addPromise(n(this._debouncedMeasure(e,o(),t)))});if(!this.enabled)c.pause();else{let t=e();this._updatingHandles.addPromise(n(this._debouncedMeasure(t,o(),void 0)))}this.addHandles(c)}show(){this.field.visible=!0}hide(){this.field.visible=!1}};e([o({constructOnly:!0})],l.prototype,`field`,void 0),e([o()],l.prototype,`name`,null),e([o()],l.prototype,`displayOrder`,null),e([o()],l.prototype,`readOnly`,null),e([o()],l.prototype,`lockable`,null),e([o()],l.prototype,`unlockOnVertexPlacement`,null),e([o()],l.prototype,`parse`,null),e([o()],l.prototype,`format`,null),e([o()],l.prototype,`formatForInputMode`,null),e([o()],l.prototype,`suffix`,null),e([o()],l.prototype,`appliesToHandlesWithRole`,void 0),e([o()],l.prototype,`appliesToHandlesWithName`,void 0),e([o()],l.prototype,`enabled`,null),e([o()],l.prototype,`displayGroup`,void 0),e([o()],l.prototype,`updating`,null),l=e([s(`esri.views.draw.support.ManagedTooltipField`)],l);export{l as ManagedTooltipField};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../core/Logger.js";import{makeScheduleFunction as t}from"../3d/layers/support/makeScheduleFunction.js";import{TextureCompressionWorkerHandle as n}from"./TextureCompressionWorkerHandle.js";import r from"../webgl/Texture.js";const i=new Set,a=()=>e.getLogger(`esri/views/support/TextureCompressionHelper`);function o(e,o){return r.compressionWorkerHandle??=new n(t(o)),i.has(e)?a().warn(`Repeated texture compression worker initialization by the same view.`):i.add(e),r.compressionWorkerHandle}function s(e){let t=r.compressionWorkerHandle;t&&(i.delete(e)||a().warn(`Unknown view attempted to destroy the texture compression worker.`),i.size||(t.destroyWorkerAndSelf(),r.compressionWorkerHandle=null))}export{s as destroyTextureCompressionWorker,o as initializeTextureCompressionWorker};
2
+ import e from"../../core/Logger.js";import{makeScheduleFunction as t}from"../3d/layers/support/makeScheduleFunction.js";import{TextureCompressionWorkerHandle as n}from"./TextureCompressionWorkerHandle.js";import{Texture as r}from"../webgl/Texture.js";const i=new Set,a=()=>e.getLogger(`esri/views/support/TextureCompressionHelper`);function o(e,o){return r.compressionWorkerHandle??=new n(t(o)),i.has(e)?a().warn(`Repeated texture compression worker initialization by the same view.`):i.add(e),r.compressionWorkerHandle}function s(e){let t=r.compressionWorkerHandle;t&&(i.delete(e)||a().warn(`Unknown view attempted to destroy the texture compression worker.`),i.size||(t.destroyWorkerAndSelf(),r.compressionWorkerHandle=null))}export{s as destroyTextureCompressionWorker,o as initializeTextureCompressionWorker};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../request.js";import t from"../../geometry/Point.js";import{projectExecute as n}from"../../geometry/operators/projectOperator.js";import{projectResolution as r,getProjectionOffsetGrid as i,load as a}from"../../layers/raster/functions/rasterProjectionHelper.js";import{isImageSource as o,rasterize as s}from"../2d/engine/Bitmap.js";import{RenderingDevice as c}from"../2d/engine/webgl/RenderingDevice.js";import{SimpleMesh as l}from"../2d/engine/webgl/meshing/SimpleMesh.js";import{ReprojectShader as u}from"../2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ReprojectShader.js";import{PixelType as d}from"../webgl/enums.js";import{DisposableFramebufferObject as f}from"../webgl/FramebufferObject.js";import{createTransformTexture as p}from"../webgl/rasterUtils.js";import{RenderingContext as m}from"../webgl/RenderingContext.js";import{RenderingContextOptions as h}from"../webgl/RenderingContextOptions.js";import g from"../webgl/Texture.js";import{TextureDescriptor as _}from"../webgl/TextureDescriptor.js";const v={color:{blendMode:`none`,write:[!0,!0,!0,!0]},depth:!1,stencil:!1};class y{static{this._instanceRefCount=0}constructor(e){if(this._ownsRctx=!1,e)this._ownsRctx=!1,this._rctx=e;else{if(y._instance)return y._instanceRefCount++,y._instance;y._instanceRefCount=1,y._instance=this,this._ownsRctx=!0;let e=document.createElement(`canvas`).getContext(`webgl2`);e.getExtension(`OES_texture_float`),this._rctx=new m(e,new h)}this._renderingDevice=new c,this._renderingDevice.setPipelineState(v),this._shader=new u,this._quad=l.fromVertexStream(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(e,a,o=!1){let s=n(e.extent,a),c=new t({x:(e.extent.xmax-e.extent.xmin)/e.texture.descriptor.width,y:(e.extent.ymax-e.extent.ymin)/e.texture.descriptor.height,spatialReference:e.extent.spatialReference}),{x:l,y:u}=r(c,a,e.extent),m=(l+u)/2,h=Math.round((s.xmax-s.xmin)/m),g=Math.round((s.ymax-s.ymin)/m);m=(s.width/h+s.height/g)/2;let v=new t({x:m,y:m,spatialReference:s.spatialReference}),y=i({projectedExtent:s,srcBufferExtent:e.extent,pixelSize:v,hasWrapAround:!0,spacing:[16,16]}),b=p(this._rctx,y),x=new _(h,g);x.wrapMode=33071;let S=new f(this._rctx,x);if(this._rctx.bindFramebuffer(S),this._rctx.setViewport(0,0,h,g),this._drawReprojectedTexture(e.texture,b,{targetImageSize:[h,g],transformSpacing:y.spacing,transformGridSize:y.size}),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),b.dispose(),o){let{width:e,height:t}=S,n=new ImageData(e??0,t??0);S.readPixels(0,0,e??0,t??0,6408,d.UNSIGNED_BYTE,n.data);let r=S.detachColorTexture();return S.dispose(),{texture:r,extent:s,imageData:n}}let C=S.detachColorTexture();return S.dispose(),{texture:C,extent:s}}reprojectBitmapData(e,t){let n=o(e.bitmapData)?s(e.bitmapData):e.bitmapData,r=new _(e.bitmapData.width,e.bitmapData.height);r.wrapMode=33071;let i=new g(this._rctx,r,n),a=this.reprojectTexture({texture:i,extent:e.extent},t,!0);a.texture.dispose();let c=document.createElement(`canvas`),l=a.imageData;return c.width=l.width,c.height=l.height,c.getContext(`2d`).putImageData(l,0,0),{bitmapData:c,extent:a.extent}}async loadAndReprojectBitmapData(t,n,r){let[i]=await Promise.all([e(t,{responseType:`image`}).then(e=>e.data),a()]),o=document.createElement(`canvas`);o.width=i.width,o.height=i.height;let s=o.getContext(`2d`);s.drawImage(i,0,0);let c=s.getImageData(0,0,o.width,o.height);if(n.spatialReference.equals(r))return{bitmapData:c,extent:n};let l=this.reprojectBitmapData({bitmapData:c,extent:n},r);return{bitmapData:l.bitmapData,extent:l.extent}}_drawReprojectedTexture(e,t,n){let{width:r=0,height:i=0}=e.descriptor,a={coordScale:[1,1],srcImageSize:[r,i],opacity:1},o={texture:{texture:e,unit:0},projectionTextures:{transformTexture:{texture:t,unit:1}},pixelMaskTexture:null,highlightTexture:null},s={shader:this._shader,uniforms:{config:a,projectionConfig:n},textures:o,defines:{applyProjection:!0,lookupProjection:n.transformSpacing[0]===1,bilinear:!1,bicubic:!1,nearestOnEdge:!1,applyPixelMask:!1,applyPixelHighlights:!1},optionalAttributes:{},useComputeBuffer:!1};this._renderingDevice.setPipelineStateNeedsUpdate(!0),this._renderingDevice.submitDrawMesh(this._rctx,s,this._quad)}destroy(){this._ownsRctx?(y._instanceRefCount--,y._instanceRefCount===0&&(this._destroyWebGLResource(),this._rctx.dispose(),y._instance=null)):this._destroyWebGLResource()}_destroyWebGLResource(){this._quad.destroy(),this._renderingDevice.dispose()}}export{y as ImageReprojector};
2
+ import e from"../../request.js";import t from"../../geometry/Point.js";import{projectExecute as n}from"../../geometry/operators/projectOperator.js";import{projectResolution as r,getProjectionOffsetGrid as i,load as a}from"../../layers/raster/functions/rasterProjectionHelper.js";import{isImageSource as o,rasterize as s}from"../2d/engine/Bitmap.js";import{RenderingDevice as c}from"../2d/engine/webgl/RenderingDevice.js";import{SimpleMesh as l}from"../2d/engine/webgl/meshing/SimpleMesh.js";import{ReprojectShader as u}from"../2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ReprojectShader.js";import{PixelType as d}from"../webgl/enums.js";import{DisposableFramebufferObject as f}from"../webgl/FramebufferObject.js";import{createTransformTexture as p}from"../webgl/rasterUtils.js";import{RenderingContext as m}from"../webgl/RenderingContext.js";import{RenderingContextOptions as h}from"../webgl/RenderingContextOptions.js";import{Texture as g}from"../webgl/Texture.js";import{TextureDescriptor as _}from"../webgl/TextureDescriptor.js";const v={color:{blendMode:`none`,write:[!0,!0,!0,!0]},depth:!1,stencil:!1};class y{static{this._instanceRefCount=0}constructor(e){if(this._ownsRctx=!1,e)this._ownsRctx=!1,this._rctx=e;else{if(y._instance)return y._instanceRefCount++,y._instance;y._instanceRefCount=1,y._instance=this,this._ownsRctx=!0;let e=document.createElement(`canvas`).getContext(`webgl2`);e.getExtension(`OES_texture_float`),this._rctx=new m(e,new h)}this._renderingDevice=new c,this._renderingDevice.setPipelineState(v),this._shader=new u,this._quad=l.fromVertexStream(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(e,a,o=!1){let s=n(e.extent,a),c=new t({x:(e.extent.xmax-e.extent.xmin)/e.texture.descriptor.width,y:(e.extent.ymax-e.extent.ymin)/e.texture.descriptor.height,spatialReference:e.extent.spatialReference}),{x:l,y:u}=r(c,a,e.extent),m=(l+u)/2,h=Math.round((s.xmax-s.xmin)/m),g=Math.round((s.ymax-s.ymin)/m);m=(s.width/h+s.height/g)/2;let v=new t({x:m,y:m,spatialReference:s.spatialReference}),y=i({projectedExtent:s,srcBufferExtent:e.extent,pixelSize:v,hasWrapAround:!0,spacing:[16,16]}),b=p(this._rctx,y),x=new _(h,g);x.wrapMode=33071;let S=new f(this._rctx,x);if(this._rctx.bindFramebuffer(S),this._rctx.setViewport(0,0,h,g),this._drawReprojectedTexture(e.texture,b,{targetImageSize:[h,g],transformSpacing:y.spacing,transformGridSize:y.size}),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),b.dispose(),o){let{width:e,height:t}=S,n=new ImageData(e??0,t??0);S.readPixels(0,0,e??0,t??0,6408,d.UNSIGNED_BYTE,n.data);let r=S.detachColorTexture();return S.dispose(),{texture:r,extent:s,imageData:n}}let C=S.detachColorTexture();return S.dispose(),{texture:C,extent:s}}reprojectBitmapData(e,t){let n=o(e.bitmapData)?s(e.bitmapData):e.bitmapData,r=new _(e.bitmapData.width,e.bitmapData.height);r.wrapMode=33071;let i=new g(this._rctx,r,n),a=this.reprojectTexture({texture:i,extent:e.extent},t,!0);a.texture.dispose();let c=document.createElement(`canvas`),l=a.imageData;return c.width=l.width,c.height=l.height,c.getContext(`2d`).putImageData(l,0,0),{bitmapData:c,extent:a.extent}}async loadAndReprojectBitmapData(t,n,r){let[i]=await Promise.all([e(t,{responseType:`image`}).then(e=>e.data),a()]),o=document.createElement(`canvas`);o.width=i.width,o.height=i.height;let s=o.getContext(`2d`);s.drawImage(i,0,0);let c=s.getImageData(0,0,o.width,o.height);if(n.spatialReference.equals(r))return{bitmapData:c,extent:n};let l=this.reprojectBitmapData({bitmapData:c,extent:n},r);return{bitmapData:l.bitmapData,extent:l.extent}}_drawReprojectedTexture(e,t,n){let{width:r=0,height:i=0}=e.descriptor,a={coordScale:[1,1],srcImageSize:[r,i],opacity:1},o={texture:{texture:e,unit:0},projectionTextures:{transformTexture:{texture:t,unit:1}},pixelMaskTexture:null,highlightTexture:null},s={shader:this._shader,uniforms:{config:a,projectionConfig:n},textures:o,defines:{applyProjection:!0,lookupProjection:n.transformSpacing[0]===1,bilinear:!1,bicubic:!1,nearestOnEdge:!1,applyPixelMask:!1,applyPixelHighlights:!1},optionalAttributes:{},useComputeBuffer:!1};this._renderingDevice.setPipelineStateNeedsUpdate(!0),this._renderingDevice.submitDrawMesh(this._rctx,s,this._quad)}destroy(){this._ownsRctx?(y._instanceRefCount--,y._instanceRefCount===0&&(this._destroyWebGLResource(),this._rctx.dispose(),y._instance=null)):this._destroyWebGLResource()}_destroyWebGLResource(){this._quad.destroy(),this._renderingDevice.dispose()}}export{y as ImageReprojector};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../core/Logger.js";import{disposeMaybe as t}from"../../core/maybe.js";import{BufferObject as n}from"./BufferObject.js";import{webglDebugEnabled as r}from"./checkWebGLError.js";import{ResourceType as i,ColorAttachment0 as a,PixelType as o,StencilAttachment as s,SizedDepthStencilFormat as c,DepthStencilAttachment as l,SizedDepthFormat as u,DepthAttachment as d}from"./enums.js";import{Renderbuffer as f}from"./Renderbuffer.js";import p from"./Texture.js";const m=()=>e.getLogger(`esri.views.webgl.FramebufferObject`);class h{constructor(e,t,n){if(this._context=e,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,e.instanceCounter.increment(i.FramebufferObject,this),t!=null){let n=C(e,t);n!=null&&(this._colorAttachments.set(a,n),_(n)?this._validateTextureDescriptor(n.descriptor):this._validateRenderbufferDescriptor(n.descriptor)),this._validateColorAttachmentPoint(a)}if(n!=null){if(y(n))this._depthStencilTexture=_(n)?n:new p(e,n),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{let t=v(n)?n:new f(e,n);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}}get glName(){return this._glName}get colorTexture(){let e=this._colorAttachments.get(a);return _(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return(this._colorAttachments.get(a)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.width??0}get height(){return(this._colorAttachments.get(a)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.height??0}get usedMemory(){return this._colorAttachments.values().reduce((e,t)=>e+t.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(e){this._level!==e&&(this._level=e,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){let t=this._colorAttachments.get(e);return!t||!_(t)?null:t}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=a){if(!e)return;this._validateColorAttachmentPoint(t);let{descriptor:n}=e;this._validateTextureDescriptor(n),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=a){let t=this._colorAttachments.get(e);if(!t)return;let n=_(t);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(n)this._framebufferTexture2D(null,e);else{let t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),n?t:void 0}detachColorTextures(...e){if(e.length!==0){if(this._glName){let t=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{e.forEach(e=>{_(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=a,n=0){let r=this._colorAttachments.get(t);r&&(e===35866?this._framebufferTextureLayer(r.glName,t,36160,n):this._framebufferTexture2D(r.glName,t,e,36160))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(e==null)return;let{descriptor:t}=e,{pixelFormat:n,dataType:r}=t;n!==34041&&n!==6402?console.error(`Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!`):n===34041&&r!==o.UNSIGNED_INT_24_8?console.error(`Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!`):n===6402&&r!==o.UNSIGNED_INT&&r!==o.UNSIGNED_SHORT?console.error(`Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!`):(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,E(n))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e)}detachDepthStencilTexture(){let e=this._depthStencilTexture;return e&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,E(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(e==null)return;let t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);let{gl:n}=this._context,r=this._getGLAttachmentPoint(t);n.framebufferRenderbuffer(36160,r,n.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){let e=this._depthStencilBuffer;if(e&&this._glName){let{_context:t}=this,n=t.boundFramebuffer;t.bindFramebuffer(this);let{gl:r}=t,i=this._getGLAttachmentPoint(e.descriptor);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,null),t.bindFramebuffer(n)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){let{_context:t}=this;t.temporaryBindFramebuffer(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,n,r,i,a,o){(e<0||t<0||i<0||a<0)&&console.error(`Offsets cannot be negative!`),(n<=0||r<=0)&&console.error(`Copy width and height must be greater than zero!`);let s=o.descriptor;o.descriptor.target!==3553&&console.error(`Texture target must be TEXTURE_2D!`),(s?.width==null||s?.height==null||e+n>this.width||t+r>this.height||i+n>s.width||a+r>s.height)&&console.error(`Bad dimensions, the current input values will attempt to read or copy out of bounds!`);let c=this._context,l=c.bindTexture(o,p.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(p.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,i,a,e,t,n,r),c.bindTexture(l,p.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,n,r,i,a,o){(n<=0||r<=0)&&console.error(`Copy width and height must be greater than zero!`),o||console.error(`Target memory is not initialized!`),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,n,r,i,a,o)}async readPixelsAsync(e,t,r,i,a,o,s,c){let{gl:l}=this._context,u=n.createPixelPack(this._context,35041,s.byteLength);try{this._context.bindBuffer(u);let n=this._context.boundFramebuffer;try{this._context.bindFramebuffer(this),l.readPixels(e,t,r,i,a,o,0)}finally{this._context.unbindBuffer(35051),this._context.bindFramebuffer(n)}await u.getSubDataAsync(s,void 0,void 0,void 0,c)}finally{u.dispose()}}resize(e,t){if(this.width===e&&this.height===t)return;let n={width:e,height:t};if(w(n,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(n.width,n.height)),this._depthStencilTexture?.resize(n.width,n.height),this._glName&&(w(n,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(n.width,n.height),r())){let{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error(`Framebuffer is incomplete!`)}}initializeAndBind(e=36160){let{gl:t}=this._context;this._glName?t.bindFramebuffer(e,this._glName):(this._glName&&t.deleteFramebuffer(this._glName),this._glName=t.createFramebuffer(),t.bindFramebuffer(e,this._glName),this._initializeAttachments(e))}_initializeAttachments(e=36160){let{gl:t}=this._context;if(this._colorAttachments.forEach((t,n)=>{if(_(t)){let r=T(t);r===35866?this._framebufferTextureLayer(t.glName,n,e):this._framebufferTexture2D(t.glName,n,r,e)}else if(v(t)){let r=this._context.gl;r.framebufferRenderbuffer(e,n,r.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){let n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,n,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){let t=E(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,T(this._depthStencilTexture),e)}r()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error(`Framebuffer is incomplete!`)}_framebufferTexture2D(e,t=a,n=3553,r=36160){this._context.gl.framebufferTexture2D(r,t,n,e,this._level)}_framebufferTextureLayer(e,t=a,n=36160,r=0){this._context.gl.framebufferTextureLayer(n,t,e,this._level,r)}_disposeDepthStencilAttachments(){let e=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);let t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=t(this._depthStencilBuffer)}this._depthStencilTexture&&=(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,E(this._depthStencilTexture.descriptor.pixelFormat))),t(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==3553&&e.target!==34067&&e.target!==35866&&console.error(`Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!`),w(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){w(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width!==e.width||this.height!==e.height)&&console.error(`Attachment size must match framebuffer size!`)}_getGLAttachmentPoint(e){switch(e.internalFormat){case u.DEPTH_COMPONENT16:case u.DEPTH_COMPONENT24:case u.DEPTH_COMPONENT32F:return d;case c.DEPTH24_STENCIL8:case c.DEPTH32F_STENCIL8:return l;case 36168:return s;default:return a}}_validateColorAttachmentPoint(t){if(h._MAX_COLOR_ATTACHMENTS===-1){let{gl:e}=this._context;h._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}let n=t-a;n+1>h._MAX_COLOR_ATTACHMENTS&&e.getLogger(`esri.views.webgl.FrameBufferObject`).error(`esri.FrameBufferObject`,`illegal attachment point for color attachment: ${n+1}. Implementation supports up to ${h._MAX_COLOR_ATTACHMENTS} color attachments`)}}class g extends h{constructor(e,t,n){super(e,t,n)}dispose(){let{_colorAttachments:e,_glName:t,_context:n}=this;if(n.instanceCounter.decrement(i.FramebufferObject,this),e.size===0&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!t)return;let r=n.boundFramebuffer,a=Array.from(e.values());this.detachColorTextures(...e.keys()),a.forEach(e=>e.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),n.gl.deleteFramebuffer(this._glName),this._glName=null,n.bindFramebuffer(r===this?null:r)}}function _(e){return S(e)===1}function v(e){return S(e)===2}function y(e){return _(e)||b(e)}function b(e){return S(e)===0}function x(e){return S(e)===3||e!=null&&`samples`in e}function S(e){return e!=null&&`type`in e?e.type:null}function C(e,t){return _(t)||v(t)?t:b(t)?new p(e,t):x(t)?new f(e,t):null}function w(e,t){let n=Math.max(e.width,e.height);if(n>t){m().warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);let r=t/n;return e.width=Math.round(e.width*r),e.height=Math.round(e.height*r),!1}return!0}function T(e){return e.descriptor.target===34067?34069:e.descriptor.target===35866?35866:3553}function E(e){return e===6402?d:l}export{g as DisposableFramebufferObject,h as FramebufferObject,w as ensureAttachmentMaxSize};
2
+ import e from"../../core/Logger.js";import{disposeMaybe as t}from"../../core/maybe.js";import{BufferObject as n}from"./BufferObject.js";import{webglDebugEnabled as r}from"./checkWebGLError.js";import{ResourceType as i,ColorAttachment0 as a,PixelType as o,StencilAttachment as s,SizedDepthStencilFormat as c,DepthStencilAttachment as l,SizedDepthFormat as u,DepthAttachment as d}from"./enums.js";import{Renderbuffer as f}from"./Renderbuffer.js";import{Texture as p}from"./Texture.js";const m=()=>e.getLogger(`esri.views.webgl.FramebufferObject`);class h{constructor(e,t,n){if(this._context=e,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,e.instanceCounter.increment(i.FramebufferObject,this),t!=null){let n=C(e,t);n!=null&&(this._colorAttachments.set(a,n),_(n)?this._validateTextureDescriptor(n.descriptor):this._validateRenderbufferDescriptor(n.descriptor)),this._validateColorAttachmentPoint(a)}if(n!=null){if(y(n))this._depthStencilTexture=_(n)?n:new p(e,n),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{let t=v(n)?n:new f(e,n);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}}get glName(){return this._glName}get colorTexture(){let e=this._colorAttachments.get(a);return _(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return(this._colorAttachments.get(a)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.width??0}get height(){return(this._colorAttachments.get(a)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.height??0}get usedMemory(){return this._colorAttachments.values().reduce((e,t)=>e+t.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(e){this._level!==e&&(this._level=e,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){let t=this._colorAttachments.get(e);return!t||!_(t)?null:t}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=a){if(!e)return;this._validateColorAttachmentPoint(t);let{descriptor:n}=e;this._validateTextureDescriptor(n),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=a){let t=this._colorAttachments.get(e);if(!t)return;let n=_(t);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(n)this._framebufferTexture2D(null,e);else{let t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),n?t:void 0}detachColorTextures(...e){if(e.length!==0){if(this._glName){let t=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{e.forEach(e=>{_(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=a,n=0){let r=this._colorAttachments.get(t);r&&(e===35866?this._framebufferTextureLayer(r.glName,t,36160,n):this._framebufferTexture2D(r.glName,t,e,36160))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(e==null)return;let{descriptor:t}=e,{pixelFormat:n,dataType:r}=t;n!==34041&&n!==6402?console.error(`Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!`):n===34041&&r!==o.UNSIGNED_INT_24_8?console.error(`Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!`):n===6402&&r!==o.UNSIGNED_INT&&r!==o.UNSIGNED_SHORT?console.error(`Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!`):(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,E(n))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e)}detachDepthStencilTexture(){let e=this._depthStencilTexture;return e&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,E(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(e==null)return;let t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);let{gl:n}=this._context,r=this._getGLAttachmentPoint(t);n.framebufferRenderbuffer(36160,r,n.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){let e=this._depthStencilBuffer;if(e&&this._glName){let{_context:t}=this,n=t.boundFramebuffer;t.bindFramebuffer(this);let{gl:r}=t,i=this._getGLAttachmentPoint(e.descriptor);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,null),t.bindFramebuffer(n)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){let{_context:t}=this;t.temporaryBindFramebuffer(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,n,r,i,a,o){(e<0||t<0||i<0||a<0)&&console.error(`Offsets cannot be negative!`),(n<=0||r<=0)&&console.error(`Copy width and height must be greater than zero!`);let s=o.descriptor;o.descriptor.target!==3553&&console.error(`Texture target must be TEXTURE_2D!`),(s?.width==null||s?.height==null||e+n>this.width||t+r>this.height||i+n>s.width||a+r>s.height)&&console.error(`Bad dimensions, the current input values will attempt to read or copy out of bounds!`);let c=this._context,l=c.bindTexture(o,p.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(p.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,i,a,e,t,n,r),c.bindTexture(l,p.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,n,r,i,a,o){(n<=0||r<=0)&&console.error(`Copy width and height must be greater than zero!`),o||console.error(`Target memory is not initialized!`),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,n,r,i,a,o)}async readPixelsAsync(e,t,r,i,a,o,s,c){let{gl:l}=this._context,u=n.createPixelPack(this._context,35041,s.byteLength);try{this._context.bindBuffer(u);let n=this._context.boundFramebuffer;try{this._context.bindFramebuffer(this),l.readPixels(e,t,r,i,a,o,0)}finally{this._context.unbindBuffer(35051),this._context.bindFramebuffer(n)}await u.getSubDataAsync(s,void 0,void 0,void 0,c)}finally{u.dispose()}}resize(e,t){if(this.width===e&&this.height===t)return;let n={width:e,height:t};if(w(n,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(n.width,n.height)),this._depthStencilTexture?.resize(n.width,n.height),this._glName&&(w(n,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(n.width,n.height),r())){let{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error(`Framebuffer is incomplete!`)}}initializeAndBind(e=36160){let{gl:t}=this._context;this._glName?t.bindFramebuffer(e,this._glName):(this._glName&&t.deleteFramebuffer(this._glName),this._glName=t.createFramebuffer(),t.bindFramebuffer(e,this._glName),this._initializeAttachments(e))}_initializeAttachments(e=36160){let{gl:t}=this._context;if(this._colorAttachments.forEach((t,n)=>{if(_(t)){let r=T(t);r===35866?this._framebufferTextureLayer(t.glName,n,e):this._framebufferTexture2D(t.glName,n,r,e)}else if(v(t)){let r=this._context.gl;r.framebufferRenderbuffer(e,n,r.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){let n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,n,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){let t=E(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,T(this._depthStencilTexture),e)}r()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error(`Framebuffer is incomplete!`)}_framebufferTexture2D(e,t=a,n=3553,r=36160){this._context.gl.framebufferTexture2D(r,t,n,e,this._level)}_framebufferTextureLayer(e,t=a,n=36160,r=0){this._context.gl.framebufferTextureLayer(n,t,e,this._level,r)}_disposeDepthStencilAttachments(){let e=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);let t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=t(this._depthStencilBuffer)}this._depthStencilTexture&&=(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,E(this._depthStencilTexture.descriptor.pixelFormat))),t(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==3553&&e.target!==34067&&e.target!==35866&&console.error(`Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!`),w(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){w(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width!==e.width||this.height!==e.height)&&console.error(`Attachment size must match framebuffer size!`)}_getGLAttachmentPoint(e){switch(e.internalFormat){case u.DEPTH_COMPONENT16:case u.DEPTH_COMPONENT24:case u.DEPTH_COMPONENT32F:return d;case c.DEPTH24_STENCIL8:case c.DEPTH32F_STENCIL8:return l;case 36168:return s;default:return a}}_validateColorAttachmentPoint(t){if(h._MAX_COLOR_ATTACHMENTS===-1){let{gl:e}=this._context;h._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}let n=t-a;n+1>h._MAX_COLOR_ATTACHMENTS&&e.getLogger(`esri.views.webgl.FrameBufferObject`).error(`esri.FrameBufferObject`,`illegal attachment point for color attachment: ${n+1}. Implementation supports up to ${h._MAX_COLOR_ATTACHMENTS} color attachments`)}}class g extends h{constructor(e,t,n){super(e,t,n)}dispose(){let{_colorAttachments:e,_glName:t,_context:n}=this;if(n.instanceCounter.decrement(i.FramebufferObject,this),e.size===0&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!t)return;let r=n.boundFramebuffer,a=Array.from(e.values());this.detachColorTextures(...e.keys()),a.forEach(e=>e.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),n.gl.deleteFramebuffer(this._glName),this._glName=null,n.bindFramebuffer(r===this?null:r)}}function _(e){return S(e)===1}function v(e){return S(e)===2}function y(e){return _(e)||b(e)}function b(e){return S(e)===0}function x(e){return S(e)===3||e!=null&&`samples`in e}function S(e){return e!=null&&`type`in e?e.type:null}function C(e,t){return _(t)||v(t)?t:b(t)?new p(e,t):x(t)?new f(e,t):null}function w(e,t){let n=Math.max(e.width,e.height);if(n>t){m().warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);let r=t/n;return e.width=Math.round(e.width*r),e.height=Math.round(e.height*r),!1}return!0}function T(e){return e.descriptor.target===34067?34069:e.descriptor.target===35866?35866:3553}function E(e){return e===6402?d:l}export{g as DisposableFramebufferObject,h as FramebufferObject,w as ensureAttachmentMaxSize};