@arcgis/core 5.0.0-next.17 → 5.0.0-next.19

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 (192) hide show
  1. package/AttributeBinsGraphic.js +1 -1
  2. package/analysis/ElevationProfile/ElevationProfileLineGround.js +1 -1
  3. package/analysis/ElevationProfile/ElevationProfileLineInput.js +1 -1
  4. package/analysis/ElevationProfile/ElevationProfileLineQuery.js +1 -1
  5. package/analysis/ElevationProfile/ElevationProfileLineScene.js +1 -1
  6. package/arcade/featureSetUtils.js +1 -1
  7. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  8. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  9. package/arcade/featureset/sources/FeatureLayerOGC.js +5 -0
  10. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  11. package/arcade/featureset/support/FeatureSet.js +1 -1
  12. package/arcade/featureset/support/shared.js +1 -1
  13. package/assets/esri/core/workers/RemoteClient.js +1 -1
  14. package/assets/esri/core/workers/chunks/057d59ee6144e5890780.js +1 -0
  15. package/assets/esri/core/workers/chunks/{adf7ccf4ef629211c7ee.js → 08aacbfb651cc2e1c054.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{31b5900119dd7cd9e7d3.js → 0a6ad58ca4ca0cba2fa0.js} +1 -1
  17. package/assets/esri/core/workers/chunks/0d8d3d0de49064971874.js +1 -0
  18. package/assets/esri/core/workers/chunks/{b87bc987983b31c13f64.js → 0f1b9d69961dad0b922f.js} +1 -1
  19. package/assets/esri/core/workers/chunks/110cc01dd6af7ee125d4.js +1 -0
  20. package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +1 -0
  21. package/assets/esri/core/workers/chunks/{5f6df4a3376b52ead53f.js → 14f994b1dd682bf2d61a.js} +1 -1
  22. package/assets/esri/core/workers/chunks/3538eb39ebb58acedd67.js +1 -0
  23. package/assets/esri/core/workers/chunks/{658cd45b5fb304fd840a.js → 3aa77696c5ea54a238da.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{49571d6875de1f2e7e25.js → 4b9dfdc23ba3d6ebcc1b.js} +2 -2
  25. package/assets/esri/core/workers/chunks/{02a22dd6d208a925cc5a.js → 52cf643621662712dc85.js} +1 -1
  26. package/assets/esri/core/workers/chunks/5755b11272b777507612.js +1 -0
  27. package/assets/esri/core/workers/chunks/{d69265ceabfa92b40bb7.js → 58969dde8c3d0b2a9829.js} +1 -1
  28. package/assets/esri/core/workers/chunks/6e4829b52ade3e41ccc4.js +1 -0
  29. package/assets/esri/core/workers/chunks/{4a89e120be142ab58a27.js → 7224b321606116fd691c.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{888f188541f8bd68e33e.js → 72f1c3d97e7b9546c113.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{a4518f25b9f8fe704286.js → 76e945da8f30d8641c3d.js} +4 -4
  32. package/assets/esri/core/workers/chunks/{257f17b3836a623a9dbe.js → 795b09ff7a8f4e91f4dc.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{3ac7562ea90f91a9f30c.js → 82b2741e75c2e9b88252.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{5d2e5774768d8f290343.js → b656e8fd374113523404.js} +1 -1
  35. package/assets/esri/core/workers/chunks/bccb9ac572bc093fb177.js +1 -0
  36. package/assets/esri/core/workers/chunks/{79dbfa2b9b332ca0002f.js → c52161b94c0fb071747e.js} +1 -1
  37. package/assets/esri/core/workers/chunks/db76958fd9f54b6bd324.js +1 -0
  38. package/assets/esri/core/workers/chunks/e61d7762b56e36dc7e8a.js +1 -0
  39. package/assets/esri/core/workers/chunks/{b30897952494a3e5b9fe.js → e69c2b613bd0210e25ba.js} +1 -1
  40. package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +1 -0
  41. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  42. package/chunks/GlowComposition.glsl.js +46 -46
  43. package/chunks/ImageMaterial.glsl.js +1 -1
  44. package/chunks/ShadedColorMaterial.glsl.js +10 -10
  45. package/config.js +1 -1
  46. package/editing/templateUtils.js +1 -1
  47. package/interfaces.d.ts +167 -51
  48. package/intl/locale.js +1 -1
  49. package/kernel.js +1 -1
  50. package/layers/BingMapsLayer.js +1 -1
  51. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  52. package/layers/PointCloudLayer.js +1 -1
  53. package/layers/SceneLayer.js +1 -1
  54. package/layers/VideoLayer.js +1 -1
  55. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  56. package/layers/mixins/SceneService.js +1 -1
  57. package/layers/ogc/ogcFeatureUtils.js +1 -1
  58. package/libs/parquet/parquet.js +1 -1
  59. package/package.json +1 -1
  60. package/renderers/support/RasterSymbolizer.js +1 -1
  61. package/rest/support/QueryMixin.js +1 -1
  62. package/support/revision.js +1 -1
  63. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  64. package/symbols/cim/cimAnalyzer.js +1 -1
  65. package/undoredo/support/ServiceVersionInfo.js +1 -1
  66. package/undoredo/support/Services.js +1 -1
  67. package/views/2d/LabelManager.js +1 -1
  68. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  69. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  70. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  71. package/views/2d/engine/webgl/animations/store/AnimationStore.js +1 -1
  72. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
  73. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  74. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  75. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  76. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  77. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  78. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  79. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterHighlightShader.js +5 -0
  80. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterRangeHighlightShader.js +1 -1
  81. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterXYBandHighlightShader.js +5 -0
  82. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  83. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
  84. package/views/2d/engine/webgl/textureUtils.js +1 -1
  85. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  86. package/views/2d/layers/features/FeatureContainer.js +1 -1
  87. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  88. package/views/3d/GroundView3D.js +1 -1
  89. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  90. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  91. package/views/3d/analysis/images/Factory.js +1 -1
  92. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  93. package/views/3d/environment/EnvironmentManager.js +1 -1
  94. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  95. package/views/3d/environment/SunLighting.js +1 -1
  96. package/views/3d/environment/VirtualLighting.js +1 -1
  97. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  98. package/views/3d/layers/DrapedSubView3D.js +1 -1
  99. package/views/3d/layers/FlowSubView3D.js +1 -1
  100. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  101. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  102. package/views/3d/layers/MediaLayerView3D.js +1 -1
  103. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  104. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  105. package/views/3d/layers/SceneLayerView3D.js +1 -1
  106. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  107. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  108. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  109. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  110. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  111. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  112. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  113. package/views/3d/support/QualityProfile.js +5 -0
  114. package/views/3d/support/QualitySettings.js +1 -1
  115. package/views/3d/support/StreamTextureCollection.js +1 -1
  116. package/views/3d/support/TextureCollection.js +1 -1
  117. package/views/3d/support/engineContent/marker.js +1 -1
  118. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  119. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  120. package/views/3d/terrain/OverlayRenderer.js +1 -1
  121. package/views/3d/terrain/TerrainSurface.js +1 -1
  122. package/views/3d/terrain/TileCompositor.js +1 -1
  123. package/views/3d/webgl-engine/Stage.js +1 -1
  124. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  125. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  126. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  127. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  128. package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
  129. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  130. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  131. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  132. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  133. package/views/3d/webgl-engine/lib/AnimationTimeStep.js +1 -1
  134. package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
  135. package/views/3d/webgl-engine/lib/DDSUtil.js +1 -1
  136. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  137. package/views/3d/webgl-engine/lib/ManagedTexture.js +5 -0
  138. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  139. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  140. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  141. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  142. package/views/3d/webgl-engine/lib/TextTextureFactory.js +1 -1
  143. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  144. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  145. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  146. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  147. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  148. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  149. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  150. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  151. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  152. package/views/GroundView.js +1 -1
  153. package/views/SceneView.js +1 -1
  154. package/views/support/layerViewUtils.js +1 -1
  155. package/views/webgl/Texture.js +1 -1
  156. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  157. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  158. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  159. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  160. package/widgets/Editor/VisibleElements.js +1 -1
  161. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  162. package/widgets/Editor/workflowUtils.js +1 -1
  163. package/widgets/Editor.js +1 -1
  164. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  165. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  166. package/widgets/FeatureTable/FieldColumn.js +1 -1
  167. package/widgets/FeatureTable/Grid/Column.js +1 -1
  168. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  169. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  170. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  171. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  172. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  173. package/widgets/OrientedImageryViewer.js +1 -1
  174. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  175. package/widgets/smartMapping/SizeSlider.js +1 -1
  176. package/widgets/support/SelectionList/VisibleElements.js +1 -1
  177. package/widgets/support/SelectionList.js +1 -1
  178. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  179. package/assets/esri/core/workers/chunks/080268f78436a2f0d996.js +0 -1
  180. package/assets/esri/core/workers/chunks/18474c017ddacd1d3d2c.js +0 -1
  181. package/assets/esri/core/workers/chunks/27e6a6c5610007ac6a54.js +0 -1
  182. package/assets/esri/core/workers/chunks/5415fbcc7ed203fc5575.js +0 -1
  183. package/assets/esri/core/workers/chunks/631fb2e62e48f8be4051.js +0 -1
  184. package/assets/esri/core/workers/chunks/722da7a39a0ad9300752.js +0 -1
  185. package/assets/esri/core/workers/chunks/9595aabbaf411eceea1e.js +0 -1
  186. package/assets/esri/core/workers/chunks/a470f662d73aa8d5d90f.js +0 -1
  187. package/assets/esri/core/workers/chunks/a57751f3d78524c876cd.js +0 -1
  188. package/assets/esri/core/workers/chunks/ac366221e8636b60aee5.js +0 -1
  189. package/assets/esri/core/workers/chunks/dec336700cfb83abbbeb.js +0 -1
  190. package/views/3d/support/DisplayQualityProfile.js +0 -5
  191. package/views/3d/webgl-engine/lib/Texture.js +0 -5
  192. /package/views/3d/webgl-engine/lib/{ITexture.js → IManagedTexture.js} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{on as t}from"../../../../core/events.js";import e from"../../../../core/Handles.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{when as i,initial as s}from"../../../../core/reactiveUtils.js";import{createScreenPoint as o}from"../../../../core/screenUtils.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import a from"../../../../geometry/Point.js";import l from"../../../../geometry/Polygon.js";import{project as h}from"../../../../geometry/projectionUtils.js";import u from"../../../../layers/support/ControlPoint.js";import{DisplayObject as m}from"../DisplayObject.js";import p from"../../../layers/support/Geometry.js";import{Texture as d}from"../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../webgl/TextureDescriptor.js";const f=2;class x extends m{constructor(r){super(),this.element=r,this._handles=new e,this.isWrapAround=!1,this.perspectiveTransform=n(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(i(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(t(e,"play",()=>this.requestRender()))},s))}getMesh(t){throw new Error("Method not implemented.")}destroy(){super.destroy(),this._handles.destroy(),this.texture=r(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(null==e)return;const{context:r}=t,{videoWidth:i,videoHeight:s}=e;if(0!==i&&0!==s){if(this.texture)e.paused||t.animationsEnabled&&this.texture.setData(e);else{const t=new c(i,s);t.wrapMode=33071,t.preMultiplyAlpha=!0,this.texture=new d(r,t,e)}e.paused||this.texture.generateMipmap(),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const s=this.element,o=this._getFrameInfo();if(!s||!o)return;const{spatialReference:n}=r;this._initializeData(t,o,n);const{controlPoints:a,horizon:u}=o,m=Math.sqrt(a.length),d=m,{x:c,y:x}=t,y=this._vertices,g=a[0],w=a[m-1],P=a[(d-1)*m],_=a[(d-1)*m+m-1],v=h(u?u[0].mapPoint:g.mapPoint,n),j=h(u?u[1].mapPoint:w.mapPoint,n),M=h(P.mapPoint,n),A=h(_.mapPoint,n);this.clipGeometry=u?new p({geometry:l.fromJSON({rings:[[[M.x,M.y],[A.x,A.y],[j.x,j.y],[v.x,v.y],[M.x,M.y]]],spatialReference:n})}):null;for(let l=0;l<a.length;l++){const t=a[l],{sourcePoint:e,mapPoint:r}=t;if(null==e||null==r)continue;const i=h(r,n);y[l*f+0]=i.x-c,y[l*f+1]=i.y-x}let b=e;if(i){const t=Math.min(v.x,j.x,M.x,A.x),e=Math.max(v.x,j.x,M.x,A.x),{worldWidth:r,xBounds:s}=i,[o,n]=s;t<o&&e>o?b=r:e>n&&t<n&&(b=-r)}this.wrapAroundShift=b,this.isWrapAround=0!==b}draw(t,e){if(!this.visible)return;if(!(this.isReady&&this._vertices&&this._indices&&this._texCoords))return void this.requestRender();this.stage||console.warn("OverlayMultipoint: stage is null"),e.render(t,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:this.textureSize,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._texCoords,index:this._indices})}_initializeData(t,e,r){if(null!=this._vertices&&null!=this._indices)return;const{controlPoints:i}=e,s=Math.sqrt(i.length),o=s,n=new Float32Array(f*i.length),a=new Uint16Array(2*i.length);for(let m=0;m<i.length;m++){const e=i[m],{sourcePoint:s,mapPoint:o}=e;if(null==s||null==o)continue;const l=h(o,r);n[m*f+0]=l.x-t.x,n[m*f+1]=l.y-t.y,a[2*m+0]=s.x,a[2*m+1]=s.y}const l=new Uint16Array(o*s+(o-2)*(s+2));let u=0;for(let h=0;h<o;h++){for(let t=0;t<s;t++)l[u++]=h*s+t,l[u++]=(h+1)*s+t;h<o-2&&(l[u++]=(h+1)*s+(s-1),l[u++]=(h+1)*s)}this._vertices=n,this._texCoords=a,this._indices=l}_getFrameInfo(){if(!this.groundControlPoints)return null;const t=this._getFrameControlPoints(),e=this.frameHorizonPoints;let r=null;if(e){const t=e.startX,i=e.startY,s=e.endX,n=e.endY;r=[new u({sourcePoint:o(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)}),new u({sourcePoint:o(s,n),mapPoint:new a(e.endLongitude,e.endLatitude)})]}return{controlPoints:t,horizon:r}}_getFrameControlPoints(){const t=this.groundControlPoints,e=t?.length;if(!e)return[];const r=new Array(e),i=Math.max(...t.map(({x:t})=>t)),s=this.element.videoWidth/i;for(let n=0;n<e;n++){const{x:e,y:i,lat:l,lon:h}=t[n];r[n]=new u({sourcePoint:o(e*s,-i*s),mapPoint:new a(h,l)})}return r}}export{x as default};
5
+ import{on as t}from"../../../../core/events.js";import e from"../../../../core/Handles.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{when as i,initial as o}from"../../../../core/reactiveUtils.js";import{createScreenPoint as s}from"../../../../core/screenUtils.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import a from"../../../../geometry/Point.js";import l from"../../../../geometry/Polygon.js";import{project as h}from"../../../../geometry/projectionUtils.js";import u from"../../../../layers/support/ControlPoint.js";import{DisplayObject as m}from"../DisplayObject.js";import p from"../../../layers/support/Geometry.js";import{Texture as d}from"../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../webgl/TextureDescriptor.js";const f=2;class x extends m{constructor(r){super(),this.element=r,this._handles=new e,this.isWrapAround=!1,this.perspectiveTransform=n(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(i(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(t(e,"play",()=>this.requestRender()))},o))}getMesh(t){throw new Error("Method not implemented.")}destroy(){super.destroy(),this._handles.destroy(),this.texture=r(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(null==e)return;const{context:r}=t,{videoWidth:i,videoHeight:o}=e;if(0!==i&&0!==o){if(this.texture)e.paused||t.animationsEnabled&&this.texture.setData(e);else{const t=new c(i,o);t.wrapMode=33071,t.preMultiplyAlpha=!0,this.texture=new d(r,t,e)}e.paused||this.texture.generateMipmap(),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const o=this.element,s=this._getFrameInfo();if(!o||!s)return;const{spatialReference:n}=r;this._initializeData(t,s,n);const{controlPoints:a,horizon:u}=s,m=Math.sqrt(a.length),d=m,{x:c,y:x}=t,y=this._vertices,g=a[0],w=a[m-1],P=a[(d-1)*m],_=a[(d-1)*m+m-1],v=h(u?u[0].mapPoint:g.mapPoint,n),j=h(u?u[1].mapPoint:w.mapPoint,n),M=h(P.mapPoint,n),A=h(_.mapPoint,n);this.clipGeometry=u?new p({geometry:l.fromJSON({rings:[[[M.x,M.y],[A.x,A.y],[j.x,j.y],[v.x,v.y],[M.x,M.y]]],spatialReference:n})}):null;for(let l=0;l<a.length;l++){const t=a[l],{sourcePoint:e,mapPoint:r}=t;if(null==e||null==r)continue;const i=h(r,n);y[l*f+0]=i.x-c,y[l*f+1]=i.y-x}let b=e;if(i){const t=Math.min(v.x,j.x,M.x,A.x),e=Math.max(v.x,j.x,M.x,A.x),{worldWidth:r,xBounds:o}=i,[s,n]=o;t<s&&e>s?b=r:e>n&&t<n&&(b=-r)}this.wrapAroundShift=b,this.isWrapAround=0!==b}draw(t,e){if(!this.visible)return;if(!(this.isReady&&this._vertices&&this._indices&&this._texCoords))return void this.requestRender();this.stage||console.warn("OverlayMultipoint: stage is null"),e.render(t,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:this.textureSize,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._texCoords,index:this._indices})}_initializeData(t,e,r){if(null!=this._vertices&&null!=this._indices)return;const{controlPoints:i}=e,o=Math.sqrt(i.length),s=o,n=new Float32Array(f*i.length),a=new Uint16Array(2*i.length);for(let m=0;m<i.length;m++){const e=i[m],{sourcePoint:o,mapPoint:s}=e;if(null==o||null==s)continue;const l=h(s,r);n[m*f+0]=l.x-t.x,n[m*f+1]=l.y-t.y,a[2*m+0]=o.x,a[2*m+1]=o.y}const l=new Uint16Array(s*o+(s-2)*(o+2));let u=0;for(let h=0;h<s;h++){for(let t=0;t<o;t++)l[u++]=h*o+t,l[u++]=(h+1)*o+t;h<s-2&&(l[u++]=(h+1)*o+(o-1),l[u++]=(h+1)*o)}this._vertices=n,this._texCoords=a,this._indices=l}_getFrameInfo(){if(!this.groundControlPoints)return null;const t=this._getFrameControlPoints(),e=this.frameHorizonPoints;let r=null;if(e){const t=e.startX,i=e.startY,o=e.endX,n=e.endY;r=[new u({sourcePoint:s(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)}),new u({sourcePoint:s(o,n),mapPoint:new a(e.endLongitude,e.endLatitude)})]}return{controlPoints:t,horizon:r}}_getFrameControlPoints(){const t=this.groundControlPoints,e=t?.length;if(!e)return[];const r=new Array(e),i=Math.max(...t.map(({x:t})=>t)),o=this.element.videoWidth/i;for(let n=0;n<e;n++){const{x:e,y:i,lat:l,lon:h}=t[n];r[n]=new u({sourcePoint:s(e*o,-i*o),mapPoint:new a(h,l)})}return r}}export{x as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../core/maybe.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import o from"../../../../geometry/Point.js";import{load as s,execute as i}from"../../../../geometry/operators/projectOperator.js";import{DisplayObject as a}from"../DisplayObject.js";import{VideoScreenTechnique as n}from"./shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js";import{ColorAttachment0 as c,SizedPixelFormat as d}from"../../../webgl/enums.js";import{FramebufferObject as h}from"../../../webgl/FramebufferObject.js";import{Texture as u}from"../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../webgl/TextureDescriptor.js";class m extends a{constructor(e,t){super(),this._controlPointsOwner=t,this.readbackScreenCoords=r(),this.videoTextureCoords=new Array(36),this.overlayTextureCoords=new Array(36),this._prevFBO=null,this._acquiredFBO=null,this._isBound=!1,this._hasCoordinates=!1,this._geIsLoaded=!1,this._ndcRect=[0,0,2,2],this._technique=new n,this.visible=!1,this.stage=e;for(let r=0;r<6;r++){const e=r/5;for(let t=0;t<6;t++){const o=t/5;this.videoTextureCoords[6*r+t]={u:o,v:e}}}}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),e(this._readbackTexture)}bind(e){const{context:t,pixelRatio:r,state:o}=e;if(this._update(e),!this.ready||0===this.readbackScreenCoords[2]||0===this.readbackScreenCoords[3])return this.requestRender(),!1;const{size:s}=o,i=Math.round(r*s[0]),a=Math.round(r*s[1]),n=new l(i,a);return n.samplingMode=9729,n.wrapMode=33071,this._acquiredFBO||(this._acquiredFBO=new h(t,n)),this._acquiredFBO.resize(i,a),t.bindFramebuffer(this._acquiredFBO),this._isBound=!0,!0}unbind(e){if(!this._isBound)return;const{context:t,pixelRatio:r,state:o}=e,{size:s}=o,i=this._acquiredFBO;if(!i.getColorTexture(c))throw new Error("Failed to get color texture from FBO.");const a=this._getReadbackTexture(e),n=this.readbackScreenCoords,d=Math.round(r*n[0]),h=Math.round(r*(s[1]-n[1]))-a.descriptor.height,u=d+a.descriptor.width,l=h+a.descriptor.height,m=Math.max(d,0),_=Math.max(h,0),x=Math.min(u,i.width)-m,b=Math.min(l,i.height)-_;x>0&&b>0&&i.copyToTexture(m,_,x,b,m-d,_-h,a),t.bindFramebuffer(this._prevFBO)}_update(e){const{state:r}=e,a=this._controlPointsOwner,n=a.groundControlPoints(),c=a.getSize(),d=r.size,h=n?.length;if(!h)return;if(s().then(()=>{this._geIsLoaded=!0}),!this._geIsLoaded)return void this.requestRender();const u=c[0],l=c[1],m=d[0],_=l/d[1],x=u/m;if(_>x){const e=x/_*2,t=(2-e)/2;this._ndcRect[0]=-1+t,this._ndcRect[1]=1,this._ndcRect[2]=e,this._ndcRect[3]=2}else{const e=_/x*2,t=(2-e)/2;this._ndcRect[0]=-1,this._ndcRect[1]=1-t,this._ndcRect[2]=2,this._ndcRect[3]=e}const b=new Array(h),f=r.spatialReference;for(let t=0;t<h;t++){const{lat:e,lon:r}=n[t],s=new o(r,e);b[t]=i(s,f)}const p=[];let M=1/0,g=1/0,w=-1/0,C=-1/0;for(const o of b){const e=t();r.toScreen(e,o.x,o.y),p.push({x:e[0],y:e[1]}),M=Math.min(M,e[0]),g=Math.min(g,e[1]),w=Math.max(w,e[0]),C=Math.max(C,e[1])}const R=[M,C],T=[w,g];this.readbackScreenCoords[0]=Math.max(Math.floor(R[0]),0),this.readbackScreenCoords[1]=Math.max(Math.floor(T[1]),0),this.readbackScreenCoords[2]=Math.ceil(T[0]),this.readbackScreenCoords[3]=Math.ceil(R[1]);for(let t=0;t<p.length;t++){const e=p[t],r=(e.x-M)/(w-M),o=(C-e.y)/(C-g);this.overlayTextureCoords[t]={u:r,v:o}}this._hasCoordinates=!0}_createTransforms(){return null}doRender(e){this._readbackTexture&&this._hasCoordinates?this._technique.render(e,{texture:this._readbackTexture,textureCoords:this.overlayTextureCoords,opacity:1,ndcRect:this._ndcRect}):this.requestRender()}_getReadbackTexture(e){const{context:t,pixelRatio:r}=e,o=Math.round(r*Math.abs(this.readbackScreenCoords[2]-this.readbackScreenCoords[0])),s=Math.round(r*Math.abs(this.readbackScreenCoords[3]-this.readbackScreenCoords[1]));if(this._readbackTexture)this._readbackTexture.resize(o,s);else{const e=new l(o,s);e.wrapMode=33071,e.internalFormat=d.RGBA8,this._readbackTexture=new u(t,e)}return this._readbackTexture}}export{m as default};
5
+ import{disposeMaybe as e}from"../../../../core/maybe.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import o from"../../../../geometry/Point.js";import{load as s,execute as i}from"../../../../geometry/operators/projectOperator.js";import{DisplayObject as a}from"../DisplayObject.js";import{VideoScreenTechnique as n}from"./shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js";import{ColorAttachment0 as c,SizedPixelFormat as d}from"../../../webgl/enums.js";import{FramebufferObject as h}from"../../../webgl/FramebufferObject.js";import{Texture as u}from"../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../webgl/TextureDescriptor.js";class m extends a{constructor(e,t){super(),this._controlPointsOwner=t,this.readbackScreenCoords=r(),this.videoTextureCoords=new Array(36),this.overlayTextureCoords=new Array(36),this._prevFBO=null,this._acquiredFBO=null,this._isBound=!1,this._hasCoordinates=!1,this._geIsLoaded=!1,this._ndcRect=[0,0,2,2],this._technique=new n,this.visible=!1,this.stage=e;for(let r=0;r<6;r++){const e=r/5;for(let t=0;t<6;t++){const o=t/5;this.videoTextureCoords[6*r+t]={u:o,v:e}}}}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),e(this._readbackTexture)}bind(e){const{context:t,pixelRatio:r,state:o}=e;if(this._update(e),!this.ready||0===this.readbackScreenCoords[2]||0===this.readbackScreenCoords[3])return this.requestRender(),!1;const{size:s}=o,i=Math.round(r*s[0]),a=Math.round(r*s[1]),n=new l(i,a);return n.samplingMode=9729,n.wrapMode=33071,this._acquiredFBO||(this._acquiredFBO=new h(t,n)),this._acquiredFBO.resize(i,a),t.bindFramebuffer(this._acquiredFBO),this._isBound=!0,!0}unbind(e){if(!this._isBound)return;const{context:t,pixelRatio:r,state:o}=e,{size:s}=o,i=this._acquiredFBO;if(!i.getColorTexture(c))throw new Error("Failed to get color texture from FBO.");const a=this._getReadbackTexture(e),n=this.readbackScreenCoords,d=Math.round(r*n[0]),h=Math.round(r*(s[1]-n[1]))-a.descriptor.height,u=d+a.descriptor.width,l=h+a.descriptor.height,m=Math.max(d,0),_=Math.max(h,0),b=Math.min(u,i.width)-m,f=Math.min(l,i.height)-_;b>0&&f>0&&i.copyToTexture(m,_,b,f,m-d,_-h,a),t.bindFramebuffer(this._prevFBO)}_update(e){const{state:r}=e,a=this._controlPointsOwner,n=a.groundControlPoints(),c=a.getSize(),d=r.size,h=n?.length;if(!h)return;if(s().then(()=>{this._geIsLoaded=!0}),!this._geIsLoaded)return void this.requestRender();const u=c[0],l=c[1],m=d[0],_=l/d[1],b=u/m;if(_>b){const e=b/_*2,t=(2-e)/2;this._ndcRect[0]=-1+t,this._ndcRect[1]=1,this._ndcRect[2]=e,this._ndcRect[3]=2}else{const e=_/b*2,t=(2-e)/2;this._ndcRect[0]=-1,this._ndcRect[1]=1-t,this._ndcRect[2]=2,this._ndcRect[3]=e}const f=new Array(h),x=r.spatialReference;for(let t=0;t<h;t++){const{lat:e,lon:r}=n[t],s=new o(r,e);f[t]=i(s,x)}const p=[];let M=1/0,g=1/0,w=-1/0,C=-1/0;for(const o of f){const e=t();r.toScreen(e,o.x,o.y),p.push({x:e[0],y:e[1]}),M=Math.min(M,e[0]),g=Math.min(g,e[1]),w=Math.max(w,e[0]),C=Math.max(C,e[1])}const R=[M,C],k=[w,g];this.readbackScreenCoords[0]=Math.max(Math.floor(R[0]),0),this.readbackScreenCoords[1]=Math.max(Math.floor(k[1]),0),this.readbackScreenCoords[2]=Math.ceil(k[0]),this.readbackScreenCoords[3]=Math.ceil(R[1]);for(let t=0;t<p.length;t++){const e=p[t],r=(e.x-M)/(w-M),o=(C-e.y)/(C-g);this.overlayTextureCoords[t]={u:r,v:o}}this._hasCoordinates=!0}_createTransforms(){return null}doRender(e){this._readbackTexture&&this._hasCoordinates?this._technique.render(e,{texture:this._readbackTexture,textureCoords:this.overlayTextureCoords,opacity:1,ndcRect:this._ndcRect}):this.requestRender()}_getReadbackTexture(e){const{context:t,pixelRatio:r}=e,o=Math.round(r*Math.abs(this.readbackScreenCoords[2]-this.readbackScreenCoords[0])),s=Math.round(r*Math.abs(this.readbackScreenCoords[3]-this.readbackScreenCoords[1]));if(this._readbackTexture)this._readbackTexture.resize(o,s);else{const e=new l(o,s);e.wrapMode=33071,e.internalFormat=d.RGBA8,this._readbackTexture=new u(t,e)}return this._readbackTexture}}export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{PixelType as t}from"../../../../../webgl/enums.js";import{Texture as e}from"../../../../../webgl/Texture.js";import{TextureDescriptor as s}from"../../../../../webgl/TextureDescriptor.js";import{ValidatedTextureDescriptor as r}from"../../../../../webgl/ValidatedTextureDescriptor.js";class o{constructor(){this._entries=new n,this._nodes=new Map,this._book=new h}add(t){let e=this._entries.get(t);if(!e){const s=this._book.add(t),r=new Object;e={location:s,references:0,handle:r};const o=this._entries.set(t,e);this._nodes.set(r,o)}return e.references++,e}remove(t){const e=this._nodes.get(t.handle);e&&e.payload&&(e.payload.references--,0===e.payload.references&&(this._book.remove(e.payload.location),this._entries.delete(e),this._nodes.delete(t.handle)))}getTexture(t,e){return this._book.getTexture(t,e)}destroy(){this._book.destroy()}}class i{constructor(t,e){this.parent=t,this.key=e,this.payload=null,this._children=new Map}get(t){return this._children.get(t)}ensure(t){let e=this._children.get(t);return e||(e=new i(this,t),this._children.set(t,e)),e}delete(t){this._children.delete(t)}}class n{constructor(){this._root=new i(null,NaN)}set(t,e){let s=this._root;for(const r of t)for(const t of r)s=s.ensure(t);return s.payload=e,s}delete(t){t.parent?.delete(t.key)}get(t){let e=this._root;for(const s of t)for(const t of s){const s=e.get(t);if(!s)return;e=s}return e.payload||void 0}}class h{constructor(){this._pages=[]}add(t){0===this._pages.length&&this._pages.push(new u);let e=this._pages.length-1,s=this._pages[e].add(t);if(s||(this._pages.push(new u),e=this._pages.length-1,s=this._pages[e].add(t)),!s)throw new Error("Data allocation failed.");return{...s,page:e}}remove(t){this._pages[t.page].remove(t)}getTexture(t,e){return this._pages[e].getTexture(t)}destroy(){}}class u{constructor(){this._cursor={row:0,column:0},this._columns=1024,this._rows=1024,this._data=new Float32Array(this._columns*this._rows*4),this._texture=null,this._textureCursor={row:0,column:0}}add(t){if(t.length>this._columns)throw new Error(`The maximum allocation size is ${this._columns} texels.`);const e={...this._cursor};if(e.column+=t.length,e.column>=this._columns&&(e.column=t.length,e.row++),e.row>=this._rows)return null;this._cursor=e;const s={...this._cursor};s.column-=t.length;let r=4*(s.row*this._columns+s.column);for(let o=0;o<t.length;o++)this._data[r++]=t[o][0],this._data[r++]=t[o][1],this._data[r++]=t[o][2],this._data[r++]=t[o][3];return s}remove(t){}getTexture(o){if(!this._texture){const i=new s(this._columns,this._rows);i.pixelFormat=6408,i.dataType=t.FLOAT,i.wrapMode=33071,i.samplingMode=9728,i.hasMipmap=!1;const n=new r(o,i);this._texture=new e(o,n)}if(this._cursor.row===this._textureCursor.row&&this._cursor.column===this._textureCursor.column)return this._texture;const i=this._textureCursor.row,n=this._cursor.row-i+1;return this._texture.updateData(0,0,i,this._columns,n,this._data,i),this._textureCursor.row=this._cursor.row,this._textureCursor.column=this._cursor.column,this._texture}destroy(){this._texture?.dispose()}}export{o as AnimationStore,n as PrefixMap};
5
+ import{PixelType as t}from"../../../../../webgl/enums.js";import{Texture as e}from"../../../../../webgl/Texture.js";import{TextureDescriptor as s}from"../../../../../webgl/TextureDescriptor.js";import{ValidatedTextureDescriptor as r}from"../../../../../webgl/ValidatedTextureDescriptor.js";class o{constructor(){this._entries=new n,this._nodes=new Map,this._book=new h}add(t){let e=this._entries.get(t);if(!e){const s=this._book.add(t),r=new Object;e={location:s,references:0,handle:r};const o=this._entries.set(t,e);this._nodes.set(r,o)}return e.references++,e}remove(t){const e=this._nodes.get(t.handle);e&&e.payload&&(e.payload.references--,0===e.payload.references&&(this._book.remove(e.payload.location),this._entries.delete(e),this._nodes.delete(t.handle)))}getTexture(t,e){return this._book.getTexture(t,e)}destroy(){this._book.destroy()}}class i{constructor(t,e){this.parent=t,this.key=e,this.payload=null,this._children=new Map}get(t){return this._children.get(t)}ensure(t){let e=this._children.get(t);return e||(e=new i(this,t),this._children.set(t,e)),e}delete(t){this._children.delete(t)}}class n{constructor(){this._root=new i(null,NaN)}set(t,e){let s=this._root;for(const r of t)for(const t of r)s=s.ensure(t);return s.payload=e,s}delete(t){t.parent?.delete(t.key)}get(t){let e=this._root;for(const s of t)for(const t of s){const s=e.get(t);if(!s)return;e=s}return e.payload||void 0}}class h{constructor(){this._pages=[]}add(t){0===this._pages.length&&this._pages.push(new l);let e=this._pages.length-1,s=this._pages[e].add(t);if(s||(this._pages.push(new l),e=this._pages.length-1,s=this._pages[e].add(t)),!s)throw new Error("Data allocation failed.");return{...s,page:e}}remove(t){this._pages[t.page].remove(t)}getTexture(t,e){return this._pages[e].getTexture(t)}destroy(){}}class l{constructor(){this._cursor={row:0,column:0},this._columns=1024,this._rows=1024,this._data=new Float32Array(this._columns*this._rows*4),this._texture=null,this._textureCursor={row:0,column:0}}add(t){if(t.length>this._columns)throw new Error(`The maximum allocation size is ${this._columns} texels.`);const e={...this._cursor};if(e.column+=t.length,e.column>=this._columns&&(e.column=t.length,e.row++),e.row>=this._rows)return null;this._cursor=e;const s={...this._cursor};s.column-=t.length;let r=4*(s.row*this._columns+s.column);for(let o=0;o<t.length;o++)this._data[r++]=t[o][0],this._data[r++]=t[o][1],this._data[r++]=t[o][2],this._data[r++]=t[o][3];return s}remove(t){}getTexture(o){if(!this._texture){const i=new s(this._columns,this._rows);i.pixelFormat=6408,i.dataType=t.FLOAT,i.wrapMode=33071,i.samplingMode=9728,i.hasMipmap=!1;const n=new r(o,i);this._texture=new e(o,n)}if(this._cursor.row===this._textureCursor.row&&this._cursor.column===this._textureCursor.column)return this._texture;const i=this._textureCursor.row,n=this._cursor.row-i+1;return this._texture.updateData(0,0,i,this._columns,n,this._data,i),this._textureCursor.row=this._cursor.row,this._textureCursor.column=this._cursor.column,this._texture}destroy(){this._texture?.dispose()}}export{o as AnimationStore,n as PrefixMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{simplePipelineState as t}from"../../utils.js";import{Technique as r}from"../Technique.js";import{FilterEffectShader as s}from"../shaders/ColorizeShader.js";import{Texture as i}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as o}from"../../../../../../webgl/TextureDescriptor.js";class l extends r{constructor(){super(...arguments),this.type=8,this._layerFBOTexture=null,this._size=[0,0],this.shaders={filterEffect:new s}}shutdown(){super.shutdown(),this._layerFBOTexture=e(this._layerFBOTexture)}render(e,r){const{width:s,height:i}=r.layerFBO;this._createOrResizeResources(e,s,i);const{context:o,painter:l}=e,a=r.effect.colorMatrix,n=this._layerFBOTexture;o.bindFramebuffer(r.layerFBO),r.layerFBO.copyToTexture(0,0,s,i,0,0,n);const u={color:{write:[!0,!0,!0,!0],blendMode:"none"},depth:!1,stencil:!1};l.setPipelineState(u);const c={colorTexture:{texture:n,unit:2},coefficients:a};l.submitDrawMesh(o,{shader:this.shaders.filterEffect,uniforms:{filterEffectConfig:c},defines:null,optionalAttributes:null,useComputeBuffer:!1},l.quadMesh),l.setPipelineState({...t,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1}})}_createOrResizeResources(e,t,r){const{context:s}=e;if(!this._layerFBOTexture||this._size[0]!==t||this._size[1]!==r)if(this._size[0]=t,this._size[1]=r,this._layerFBOTexture)this._layerFBOTexture.resize(t,r);else{const e=new o(t,r);e.internalFormat=6408,e.wrapMode=33071,this._layerFBOTexture=new i(s,e)}}}export{l as ColorizeTechnique};
5
+ import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{simplePipelineState as t}from"../../utils.js";import{Technique as r}from"../Technique.js";import{FilterEffectShader as s}from"../shaders/ColorizeShader.js";import{Texture as i}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as o}from"../../../../../../webgl/TextureDescriptor.js";class l extends r{constructor(){super(...arguments),this.type=8,this._layerFBOTexture=null,this._size=[0,0],this.shaders={filterEffect:new s}}shutdown(){super.shutdown(),this._layerFBOTexture=e(this._layerFBOTexture)}render(e,r){const{width:s,height:i}=r.layerFBO;this._createOrResizeResources(e,s,i);const{context:o,painter:l}=e,n=r.effect.colorMatrix,a=this._layerFBOTexture;o.bindFramebuffer(r.layerFBO),r.layerFBO.copyToTexture(0,0,s,i,0,0,a);const u={color:{write:[!0,!0,!0,!0],blendMode:"none"},depth:!1,stencil:!1};l.setPipelineState(u);const c={colorTexture:{texture:a,unit:2},coefficients:n};l.submitDrawMesh(o,{shader:this.shaders.filterEffect,uniforms:{filterEffectConfig:c},defines:null,optionalAttributes:null,useComputeBuffer:!1},l.quadMesh),l.setPipelineState({...t,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1}})}_createOrResizeResources(e,t,r){const{context:s}=e;if(!this._layerFBOTexture||this._size[0]!==t||this._size[1]!==r)if(this._size[0]=t,this._size[1]=r,this._layerFBOTexture)this._layerFBOTexture.resize(t,r);else{const e=new o(t,r);e.internalFormat=6408,e.wrapMode=33071,this._layerFBOTexture=new i(s,e)}}}export{l as ColorizeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{SizedDepthStencilFormat as o,DataType as r,PrimitiveType as i,PixelType as n}from"../../../../../../webgl/enums.js";import{FramebufferObject as d}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as h}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as u}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as l}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as _}from"../../../../../../webgl/TextureDescriptor.js";const T={pos:{count:2,type:r.UNSIGNED_SHORT}};class m{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,r=e,i=new _(s,r);i.samplingMode=9728,i.wrapMode=33071;const n=new h(t,new u(o.DEPTH24_STENCIL8,s,r));this._dotFBO=new d(t,i,n)}return this._dotFBO}getDotDensityMesh(t){if(null==this._dotMesh){const o=e,r=o*o,n=2,d=new Int16Array(r*n);for(let t=0;t<o;t++)for(let e=0;e<o;e++)d[n*(e+t*o)]=e,d[n*(e+t*o)+1]=t;this._dotMesh=s.create(t,{primitive:i.POINTS,vertex:d,count:r,layout:T})}return this._dotMesh}getDotDensityTextures(e,s,o){if(this._dotTextureSize===s&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=s,this._seed=o),null===this._dotTextures){const r=new t(o);this._dotTextures=[this._allocDotDensityTexture(e,s,r),this._allocDotDensityTexture(e,s,r)]}return this._dotTextures}_disposeTextures(){if(this._dotTextures){for(let t=0;t<this._dotTextures.length;t++)this._dotTextures[t].dispose();this._dotTextures=null}}_allocDotDensityTexture(t,e,s){const o=new Float32Array(e*e*4);for(let i=0;i<o.length;i++)o[i]=s.getFloat();const r=new _(e);return r.dataType=n.FLOAT,r.samplingMode=9728,new l(t,r,o)}}export{m as DotDensityResources};
5
+ import t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{SizedDepthStencilFormat as o,DataType as r,PrimitiveType as i,PixelType as n}from"../../../../../../webgl/enums.js";import{FramebufferObject as d}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as h}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as u}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as l}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as _}from"../../../../../../webgl/TextureDescriptor.js";const m={pos:{count:2,type:r.UNSIGNED_SHORT}};class T{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,r=e,i=new _(s,r);i.samplingMode=9728,i.wrapMode=33071;const n=new h(t,new u(o.DEPTH24_STENCIL8,s,r));this._dotFBO=new d(t,i,n)}return this._dotFBO}getDotDensityMesh(t){if(null==this._dotMesh){const o=e,r=o*o,n=2,d=new Int16Array(r*n);for(let t=0;t<o;t++)for(let e=0;e<o;e++)d[n*(e+t*o)]=e,d[n*(e+t*o)+1]=t;this._dotMesh=s.create(t,{primitive:i.POINTS,vertex:d,count:r,layout:m})}return this._dotMesh}getDotDensityTextures(e,s,o){if(this._dotTextureSize===s&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=s,this._seed=o),null===this._dotTextures){const r=new t(o);this._dotTextures=[this._allocDotDensityTexture(e,s,r),this._allocDotDensityTexture(e,s,r)]}return this._dotTextures}_disposeTextures(){if(this._dotTextures){for(let t=0;t<this._dotTextures.length;t++)this._dotTextures[t].dispose();this._dotTextures=null}}_allocDotDensityTexture(t,e,s){const o=new Float32Array(e*e*4);for(let i=0;i<o.length;i++)o[i]=s.getFloat();const r=new _(e);return r.dataType=n.FLOAT,r.samplingMode=9728,new l(t,r,o)}}export{T as DotDensityResources};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{simplePipelineState as r}from"../../utils.js";import{Technique as s}from"../Technique.js";import{BlitShader as i}from"../shaders/BlitShader.js";import{GaussianBlurShader as o}from"../shaders/BlurShader.js";import{DropShadowCompositeShader as a}from"../shaders/DropShadowShader.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Texture as l}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../../../../webgl/TextureDescriptor.js";const h=[1,0],B=[0,1];class c extends s{constructor(){super(...arguments),this.type=12,this._layerFBOTexture=null,this._horizontalBlurFBO=null,this._verticalBlurFBO=null,this._size=[0,0],this.shaders={gaussianBlur:new o,composite:new a,blit:new i}}shutdown(){super.shutdown(),this._horizontalBlurFBO=e(this._horizontalBlurFBO),this._verticalBlurFBO=e(this._verticalBlurFBO),this._layerFBOTexture=e(this._layerFBOTexture)}render(e,s){const{context:i,state:o,painter:a}=e,{layerFBO:u}=s,l=u.width,n=u.height,c=[Math.round(l),Math.round(n)],{blurRadius:f,offsetX:d,offsetY:m,color:p}=s.effect,F=[t(d),t(m)];this._createOrResizeResources(e,l,n,c);const w=this._horizontalBlurFBO,_=this._verticalBlurFBO,x={color:{write:[!0,!0,!0,!0],blendMode:"none"},depth:{write:!1,test:!1},stencil:{write:{mask:0},test:!1}};a.setPipelineState(x);const O=this._layerFBOTexture;u.copyToTexture(0,0,l,n,0,0,O),i.setViewport(0,0,c[0],c[1]),i.bindFramebuffer(w),a.submitDrawMesh(i,{shader:this.shaders.gaussianBlur,uniforms:{gaussianBlurConfig:{texture:{texture:u.colorTexture,unit:4},texSize:c,direction:h,sigma:f}},defines:{kernelRadius:Math.ceil(f)},optionalAttributes:null,useComputeBuffer:!1},a.quadMesh),i.bindFramebuffer(_),a.submitDrawMesh(i,{shader:this.shaders.gaussianBlur,uniforms:{gaussianBlurConfig:{texture:{texture:w?.colorTexture,unit:5},texSize:c,direction:B,sigma:f}},defines:{kernelRadius:Math.ceil(f)},optionalAttributes:null,useComputeBuffer:!1},a.quadMesh),i.bindFramebuffer(u),i.setViewport(0,0,l,n),a.submitDrawMesh(i,{shader:this.shaders.composite,uniforms:{compositeConfig:{blurTexture:{texture:_?.colorTexture,unit:2},layerFBOTexture:{texture:O,unit:3},shadowColor:[p[3]*(p[0]/255),p[3]*(p[1]/255),p[3]*(p[2]/255),p[3]],displayViewMat3:o.displayMat3,shadowOffset:F}},defines:null,optionalAttributes:null,useComputeBuffer:!1},a.quadMesh),a.setPipelineState({...r,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1}})}_createOrResizeResources(e,t,r,s){const{context:i}=e;if(!this._horizontalBlurFBO||this._size[0]!==t||this._size[1]!==r){if(this._size[0]=t,this._size[1]=r,this._horizontalBlurFBO)this._horizontalBlurFBO.resize(s[0],s[1]);else{const e=new n(s[0],s[1]);e.internalFormat=6408,e.wrapMode=33071,this._horizontalBlurFBO=new u(i,e)}if(this._verticalBlurFBO)this._verticalBlurFBO.resize(s[0],s[1]);else{const e=new n(s[0],s[1]);e.internalFormat=6408,e.wrapMode=33071,this._verticalBlurFBO=new u(i,e)}if(this._layerFBOTexture)this._layerFBOTexture.resize(t,r);else{const e=new n(t,r);e.internalFormat=6408,e.wrapMode=33071,this._layerFBOTexture=new l(i,e)}}}}export{c as DropShadowTechnique};
5
+ import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{simplePipelineState as r}from"../../utils.js";import{Technique as s}from"../Technique.js";import{BlitShader as i}from"../shaders/BlitShader.js";import{GaussianBlurShader as o}from"../shaders/BlurShader.js";import{DropShadowCompositeShader as a}from"../shaders/DropShadowShader.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Texture as l}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../../../../webgl/TextureDescriptor.js";const h=[1,0],B=[0,1];class c extends s{constructor(){super(...arguments),this.type=12,this._layerFBOTexture=null,this._horizontalBlurFBO=null,this._verticalBlurFBO=null,this._size=[0,0],this.shaders={gaussianBlur:new o,composite:new a,blit:new i}}shutdown(){super.shutdown(),this._horizontalBlurFBO=e(this._horizontalBlurFBO),this._verticalBlurFBO=e(this._verticalBlurFBO),this._layerFBOTexture=e(this._layerFBOTexture)}render(e,s){const{context:i,state:o,painter:a}=e,{layerFBO:u}=s,l=u.width,n=u.height,c=[Math.round(l),Math.round(n)],{blurRadius:f,offsetX:d,offsetY:m,color:p}=s.effect,F=[t(d),t(m)];this._createOrResizeResources(e,l,n,c);const w=this._horizontalBlurFBO,_=this._verticalBlurFBO,O={color:{write:[!0,!0,!0,!0],blendMode:"none"},depth:{write:!1,test:!1},stencil:{write:{mask:0},test:!1}};a.setPipelineState(O);const x=this._layerFBOTexture;u.copyToTexture(0,0,l,n,0,0,x),i.setViewport(0,0,c[0],c[1]),i.bindFramebuffer(w),a.submitDrawMesh(i,{shader:this.shaders.gaussianBlur,uniforms:{gaussianBlurConfig:{texture:{texture:u.colorTexture,unit:4},texSize:c,direction:h,sigma:f}},defines:{kernelRadius:Math.ceil(f)},optionalAttributes:null,useComputeBuffer:!1},a.quadMesh),i.bindFramebuffer(_),a.submitDrawMesh(i,{shader:this.shaders.gaussianBlur,uniforms:{gaussianBlurConfig:{texture:{texture:w?.colorTexture,unit:5},texSize:c,direction:B,sigma:f}},defines:{kernelRadius:Math.ceil(f)},optionalAttributes:null,useComputeBuffer:!1},a.quadMesh),i.bindFramebuffer(u),i.setViewport(0,0,l,n),a.submitDrawMesh(i,{shader:this.shaders.composite,uniforms:{compositeConfig:{blurTexture:{texture:_?.colorTexture,unit:2},layerFBOTexture:{texture:x,unit:3},shadowColor:[p[3]*(p[0]/255),p[3]*(p[1]/255),p[3]*(p[2]/255),p[3]],displayViewMat3:o.displayMat3,shadowOffset:F}},defines:null,optionalAttributes:null,useComputeBuffer:!1},a.quadMesh),a.setPipelineState({...r,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1}})}_createOrResizeResources(e,t,r,s){const{context:i}=e;if(!this._horizontalBlurFBO||this._size[0]!==t||this._size[1]!==r){if(this._size[0]=t,this._size[1]=r,this._horizontalBlurFBO)this._horizontalBlurFBO.resize(s[0],s[1]);else{const e=new n(s[0],s[1]);e.internalFormat=6408,e.wrapMode=33071,this._horizontalBlurFBO=new u(i,e)}if(this._verticalBlurFBO)this._verticalBlurFBO.resize(s[0],s[1]);else{const e=new n(s[0],s[1]);e.internalFormat=6408,e.wrapMode=33071,this._verticalBlurFBO=new u(i,e)}if(this._layerFBOTexture)this._layerFBOTexture.resize(t,r);else{const e=new n(t,r);e.internalFormat=6408,e.wrapMode=33071,this._layerFBOTexture=new l(i,e)}}}}export{c as DropShadowTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{Technique as t}from"../Technique.js";import{OpacityShader as r}from"../shaders/OpacityShader.js";import{Texture as s}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../../../webgl/TextureDescriptor.js";class o extends t{constructor(){super(...arguments),this.type=23,this._layerFBOTexture=null,this._size=[0,0],this.shaders={opacity:new r}}shutdown(){super.shutdown(),this._layerFBOTexture=e(this._layerFBOTexture)}render(e,t){const{layerFBO:r}=t,{width:s,height:i}=r;this._createOrResizeResources(e,s,i);const{context:o,painter:a}=e,{amount:u}=t.effect,l=this._layerFBOTexture;o.bindFramebuffer(r),t.layerFBO.copyToTexture(0,0,s,i,0,0,l);const n={color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:771,srcAlpha:1,dstAlpha:771}},depth:!1,stencil:!1},h={layerTexture:{texture:l,unit:0},opacity:u};l.setSamplingMode(9728),o.setClearColor(0,0,0,0),o.clear(16384),a.setPipelineState(n),a.submitDrawMesh(o,{shader:this.shaders.opacity,uniforms:{config:h},defines:null,optionalAttributes:null,useComputeBuffer:!1},a.quadMesh)}_createOrResizeResources(e,t,r){const{context:o}=e;if(!this._layerFBOTexture||this._size[0]!==t||this._size[1]!==r)if(this._size[0]=t,this._size[1]=r,this._layerFBOTexture)this._layerFBOTexture.resize(t,r);else{const e=new i(t,r);e.internalFormat=6408,e.wrapMode=33071,e.samplingMode=9728,this._layerFBOTexture=new s(o,e)}}}export{o as OpacityTechnique};
5
+ import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{Technique as t}from"../Technique.js";import{OpacityShader as r}from"../shaders/OpacityShader.js";import{Texture as s}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../../../webgl/TextureDescriptor.js";class o extends t{constructor(){super(...arguments),this.type=23,this._layerFBOTexture=null,this._size=[0,0],this.shaders={opacity:new r}}shutdown(){super.shutdown(),this._layerFBOTexture=e(this._layerFBOTexture)}render(e,t){const{layerFBO:r}=t,{width:s,height:i}=r;this._createOrResizeResources(e,s,i);const{context:o,painter:a}=e,{amount:l}=t.effect,n=this._layerFBOTexture;o.bindFramebuffer(r),t.layerFBO.copyToTexture(0,0,s,i,0,0,n);const u={color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:771,srcAlpha:1,dstAlpha:771}},depth:!1,stencil:!1},h={layerTexture:{texture:n,unit:0},opacity:l};n.setSamplingMode(9728),o.setClearColor(0,0,0,0),o.clear(16384),a.setPipelineState(u),a.submitDrawMesh(o,{shader:this.shaders.opacity,uniforms:{config:h},defines:null,optionalAttributes:null,useComputeBuffer:!1},a.quadMesh)}_createOrResizeResources(e,t,r){const{context:o}=e;if(!this._layerFBOTexture||this._size[0]!==t||this._size[1]!==r)if(this._size[0]=t,this._size[1]=r,this._layerFBOTexture)this._layerFBOTexture.resize(t,r);else{const e=new i(t,r);e.internalFormat=6408,e.wrapMode=33071,e.samplingMode=9728,this._layerFBOTexture=new s(o,e)}}}export{o as OpacityTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{Technique as t}from"../Technique.js";import{TextureStatisticsTechnique as i}from"../TextureStatisticsTechnique.js";import{getInterpolationDefines as s}from"./processor/textureUtils.js";import{RasterColorizerLUTShader as o}from"../shaders/raster/RasterColorizerLUTShader.js";import{RasterColorizerShadedReliefShader as r}from"../shaders/raster/RasterColorizerShadedReliefShader.js";import{RasterColorizerStretchShader as n}from"../shaders/raster/RasterColorizerStretchShader.js";import{SizedPixelFormat as a,PixelType as u}from"../../../../../../webgl/enums.js";import{FramebufferObject as c}from"../../../../../../webgl/FramebufferObject.js";import{Texture as m}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../../../../webgl/TextureDescriptor.js";class p extends t{constructor(){super(...arguments),this.name="BrushRasterColorizer",this.type=0,this.shaders={lut:new o,stretch:new n,shadedRelief:new r},this._mosaicFbo=null,this._statisticsTechnique=null}shutdown(t){super.shutdown(t),this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique)}render(t,i){const s=i.bitmaps.some(f);s||(this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique));const o=s?this._computeStatisticsTextures(t,i):void 0;for(const e of i.bitmaps){if(!e.source||e.suspended)continue;t.timeline.begin(this.name);const{painter:i}=t;i.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}}),e.updateTexture(t),e.updateProcessedTexture();const{type:s}=e.symbolizerParameters,r="stretch"===s?this._getStretchOptions(e,o):"lut"===s?this._getLutOptions(e):this._getShadedReliefOptions(e);"bilinear"!==e.interpolation||t.context.capabilities.textureFloatLinear||(r.defines.bilinear=!0),i.submitDrawMesh(t.context,r,i.quadMesh,e),t.timeline.end(this.name)}}_computeStatisticsTextures(e,t){this._statisticsTechnique??=new i;const s=this._statisticsTechnique;return this._mosaic(e,t),s.render(e,{fbo:this._mosaicFbo}),{minTexture:s.minValuesTexture,maxTexture:s.maxValuesTexture,meanTexture:s.meanValuesTexture,stddevTexture:s.stdDevValuesTexture}}_mosaic(e,t){const{context:i,painter:s}=e,o=i.getBoundFramebufferObject();if(this._mosaicFbo)this._mosaicFbo.resize(o.width,o.height);else{const e=h(i,o.width,o.height);this._mosaicFbo=new c(i,e)}i.bindFramebuffer(this._mosaicFbo);const r="RasterColorizerMosaic";for(const n of t.bitmaps){if(!f(n))continue;e.timeline.begin(r),s.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}});const t=n.interpolation;n.interpolation="nearest",n.updateTexture(e),n.updateProcessedTexture();const i=this._getStretchOptions(n);i.defines.noOp=!0,s.submitDrawMesh(e.context,i,s.quadMesh,n),n.interpolation=t,e.timeline.end(r)}i.bindFramebuffer(o)}_getLutOptions(e){const{config:t,projectionConfig:i,colormapConfig:o,pixelMaskConfig:r,highlightConfig:n,projectionDefines:a}=this._getCommonConfig(e),u=s(e);return{shader:this.shaders.lut,uniforms:{projectionConfig:i,config:t,colormapConfig:o,pixelMaskConfig:r,highlightConfig:n},defines:{...a,...u,applyPixelMask:!!r,applyPixelHighlights:!!n},optionalAttributes:null,useComputeBuffer:!1}}_getStretchOptions(e,t){const i=e.symbolizerParameters,{config:o,projectionConfig:r,colormapConfig:n,pixelMaskConfig:a,highlightConfig:u,projectionDefines:c,textureUnit:m}=this._getCommonConfig(e),l=s(e),p=t?{minTexture:{texture:t.minTexture,unit:m},maxTexture:{texture:t.maxTexture,unit:m+1},meanTexture:{texture:t.meanTexture,unit:m+2},stddevTexture:{texture:t.stddevTexture,unit:m+3},numberOfStandardDeviations:i.numberOfStandardDeviations||2}:void 0,h=t?"standardDeviation"===i.stretchType?2:1:0;return{shader:this.shaders.stretch,uniforms:{projectionConfig:r,config:o,stretchConfig:i,colormapConfig:n,pixelMaskConfig:a,highlightConfig:u,statisticsConfig:p},defines:{...c,...l,isMultiband:i.bandCount>1,applyColormap:!!n,useGamma:i.useGamma,noOp:e.isRendereredSource&&!e.processed,applyPixelMask:!!a,applyPixelHighlights:!!u,draStretchType:h},optionalAttributes:null,useComputeBuffer:!1}}_getShadedReliefOptions(e){const t=e.symbolizerParameters,{config:i,projectionConfig:o,colormapConfig:r,pixelMaskConfig:n,highlightConfig:a,projectionDefines:u}=this._getCommonConfig(e),c=s(e);return{shader:this.shaders.shadedRelief,uniforms:{projectionConfig:o,config:i,hillshadeConfig:t,colormapConfig:r,pixelMaskConfig:n,highlightConfig:a},defines:{...u,...c,isMultidirectional:t.hillshadeType>0,applyColormap:!!r,applyPixelMask:!!n,applyPixelHighlights:!!a},optionalAttributes:null,useComputeBuffer:!1}}_getCommonConfig(e){const{coordScale:t,computedOpacity:i,transforms:s}=e,{names:o,textures:r}=e.getTextures({useProcessedTexture:e.processed}),n=r[o.indexOf("u_image")],a=e.getRasterTextureSize();let u=0;const c={texture:{texture:n,unit:u++},dvsMat3:s.displayViewScreenMat3,coordScale:t,srcImageSize:a,opacity:i},m=r[o.indexOf("u_transformGrid")],{transformGrid:l}=e,p=!(!m||!l),h=p?{transformTexture:{texture:m,unit:u++},targetImageSize:[e.width,e.height],transformSpacing:l.spacing,transformGridSize:l.size}:void 0,f=r[o.indexOf("u_colormap")],{colormap:d,colormapOffset:g}=e.symbolizerParameters,x=f&&d?{colormapTexture:{texture:f,unit:u++},colormapOffset:g??0,colormapMaxIndex:d.length/4-1}:void 0,C=r[o.indexOf("u_mask")],b=C?{maskTexture:{texture:C,unit:u++}}:void 0,{highlightTexture:T}=e;return{config:c,projectionConfig:h,colormapConfig:x,pixelMaskConfig:b,highlightConfig:T?{highlightTexture:{texture:T,unit:u++}}:void 0,projectionDefines:{applyProjection:p,lookupProjection:p&&1===l.spacing[0]},textureUnit:u}}}function h(e,t,i){const s=new l(t,i);return s.internalFormat=a.RGBA32F,s.samplingMode=9728,s.dataType=u.FLOAT,s.wrapMode=33071,new m(e,s)}function f(e){return!e.suspended&&null!=e.source&&!e.isRendereredSource&&"stretch"===e.symbolizerParameters.type&&!!e.symbolizerParameters.dynamicRangeAdjustment}export{p as RasterColorizerTechnique};
5
+ import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{Technique as t}from"../Technique.js";import{TextureStatisticsTechnique as i}from"../TextureStatisticsTechnique.js";import{getInterpolationDefines as o}from"./processor/textureUtils.js";import{RasterColorizerLUTShader as s}from"../shaders/raster/RasterColorizerLUTShader.js";import{RasterColorizerShadedReliefShader as r}from"../shaders/raster/RasterColorizerShadedReliefShader.js";import{RasterColorizerStretchShader as n}from"../shaders/raster/RasterColorizerStretchShader.js";import{SizedPixelFormat as a,PixelType as u}from"../../../../../../webgl/enums.js";import{FramebufferObject as c}from"../../../../../../webgl/FramebufferObject.js";import{Texture as m}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../../../../webgl/TextureDescriptor.js";class p extends t{constructor(){super(...arguments),this.name="BrushRasterColorizer",this.type=0,this.shaders={lut:new s,stretch:new n,shadedRelief:new r},this._mosaicFbo=null,this._statisticsTechnique=null}shutdown(t){super.shutdown(t),this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique)}render(t,i){const o=i.bitmaps.some(f);o||(this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique));const s=o?this._computeStatisticsTextures(t,i):void 0;for(const e of i.bitmaps){if(!e.source||e.suspended)continue;t.timeline.begin(this.name);const{painter:i}=t;i.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}}),e.updateTexture(t),e.updateProcessedTexture();const{type:o}=e.symbolizerParameters,r="stretch"===o?this._getStretchOptions(e,s):"lut"===o?this._getLutOptions(e):this._getShadedReliefOptions(e);"bilinear"!==e.interpolation||t.context.capabilities.textureFloatLinear||(r.defines.bilinear=!0),i.submitDrawMesh(t.context,r,i.quadMesh,e),t.timeline.end(this.name)}}_computeStatisticsTextures(e,t){this._statisticsTechnique??=new i;const o=this._statisticsTechnique;return this._mosaic(e,t),o.render(e,{fbo:this._mosaicFbo}),{minTexture:o.minValuesTexture,maxTexture:o.maxValuesTexture,meanTexture:o.meanValuesTexture,stddevTexture:o.stdDevValuesTexture}}_mosaic(e,t){const{context:i,painter:o}=e,s=i.getBoundFramebufferObject();if(this._mosaicFbo)this._mosaicFbo.resize(s.width,s.height);else{const e=h(i,s.width,s.height);this._mosaicFbo=new c(i,e)}i.bindFramebuffer(this._mosaicFbo);const r="RasterColorizerMosaic";for(const n of t.bitmaps){if(!f(n))continue;e.timeline.begin(r),o.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}});const t=n.interpolation;n.interpolation="nearest",n.updateTexture(e),n.updateProcessedTexture();const i=this._getStretchOptions(n);i.defines.noOp=!0,o.submitDrawMesh(e.context,i,o.quadMesh,n),n.interpolation=t,e.timeline.end(r)}i.bindFramebuffer(s)}_getLutOptions(e){const{config:t,projectionConfig:i,colormapConfig:s,pixelMaskConfig:r,highlightConfig:n,projectionDefines:a}=this._getCommonConfig(e),u=o(e);return{shader:this.shaders.lut,uniforms:{projectionConfig:i,config:t,colormapConfig:s,pixelMaskConfig:r,highlightConfig:n},defines:{...a,...u,applyPixelMask:!!r,applyPixelHighlights:!!n},optionalAttributes:null,useComputeBuffer:!1}}_getStretchOptions(e,t){const i=e.symbolizerParameters,{config:s,projectionConfig:r,colormapConfig:n,pixelMaskConfig:a,highlightConfig:u,projectionDefines:c,textureUnit:m}=this._getCommonConfig(e),l=o(e),p=t?{minTexture:{texture:t.minTexture,unit:m},maxTexture:{texture:t.maxTexture,unit:m+1},meanTexture:{texture:t.meanTexture,unit:m+2},stddevTexture:{texture:t.stddevTexture,unit:m+3},numberOfStandardDeviations:i.numberOfStandardDeviations||2}:void 0,h=t?"standardDeviation"===i.stretchType?2:1:0;return{shader:this.shaders.stretch,uniforms:{projectionConfig:r,config:s,stretchConfig:i,colormapConfig:n,pixelMaskConfig:a,highlightConfig:u,statisticsConfig:p},defines:{...c,...l,isMultiband:i.bandCount>1,applyColormap:!!n,useGamma:i.useGamma,noOp:e.isRendereredSource&&!e.processed,applyPixelMask:!!a,applyPixelHighlights:!!u,draStretchType:h},optionalAttributes:null,useComputeBuffer:!1}}_getShadedReliefOptions(e){const t=e.symbolizerParameters,{config:i,projectionConfig:s,colormapConfig:r,pixelMaskConfig:n,highlightConfig:a,projectionDefines:u}=this._getCommonConfig(e),c=o(e);return{shader:this.shaders.shadedRelief,uniforms:{projectionConfig:s,config:i,hillshadeConfig:t,colormapConfig:r,pixelMaskConfig:n,highlightConfig:a},defines:{...u,...c,isMultidirectional:t.hillshadeType>0,applyColormap:!!r,applyPixelMask:!!n,applyPixelHighlights:!!a},optionalAttributes:null,useComputeBuffer:!1}}_getCommonConfig(e){const{coordScale:t,computedOpacity:i,transforms:o}=e,{names:s,textures:r}=e.getTextures({useProcessedTexture:e.processed}),n=r[s.indexOf("u_image")],a=e.getRasterTextureSize();let u=0;const c={texture:{texture:n,unit:u++},dvsMat3:o.displayViewScreenMat3,coordScale:t,srcImageSize:a,opacity:i},m=r[s.indexOf("u_transformGrid")],{transformGrid:l}=e,p=!(!m||!l),h=p?{transformTexture:{texture:m,unit:u++},targetImageSize:[e.width,e.height],transformSpacing:l.spacing,transformGridSize:l.size}:void 0,f=r[s.indexOf("u_colormap")],{colormap:d,colormapOffset:g}=e.symbolizerParameters,x=f&&d?{colormapTexture:{texture:f,unit:u++},colormapOffset:g??0,colormapMaxIndex:d.length/4-1}:void 0,C=r[s.indexOf("u_mask")],b=C?{maskTexture:{texture:C,unit:u++}}:void 0,{highlightTexture:T}=e;return{config:c,projectionConfig:h,colormapConfig:x,pixelMaskConfig:b,highlightConfig:T?{highlightTexture:{texture:T,unit:u++}}:void 0,projectionDefines:{applyProjection:p,lookupProjection:p&&1===l.spacing[0]},textureUnit:u}}}function h(e,t,i){const o=new l(t,i);return o.internalFormat=a.RGBA32F,o.samplingMode=9728,o.dataType=u.FLOAT,o.wrapMode=33071,new m(e,o)}function f(e){return!e.suspended&&null!=e.source&&!e.isRendereredSource&&"stretch"===e.symbolizerParameters.type&&!!e.symbolizerParameters.dynamicRangeAdjustment}export{p as RasterColorizerTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{tileSize as e}from"../../../definitions.js";import{Technique as t}from"../Technique.js";import{getInterpolationDefines as i}from"./processor/textureUtils.js";import{RasterRangeHighlightShader as r}from"../shaders/raster/RasterRangeHighlightShader.js";import{SizedPixelFormat as o,PixelType as s}from"../../../../../../webgl/enums.js";import{FramebufferObject as n}from"../../../../../../webgl/FramebufferObject.js";import{Texture as a}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../../../../webgl/TextureDescriptor.js";class g extends t{constructor(){super(...arguments),this.name="BrushRasterHighlight",this.type=2,this.shaders={range:new r}}shutdown(e){super.shutdown(e),this._fbo?.dispose(),this._fbo=void 0}render(t,r){const{context:o}=t;if(!this._fbo){const i=u(t.context,e,e);this._fbo=new n(o,i)}const s=o.getBoundFramebufferObject(),a=o.getViewport(),{pixelHighlightOptions:h}=t;for(const n of r.bitmaps){if(!h||!n.source||n.highlighted||n.suspended||n.isRendereredSource)continue;const r=n.bandIds?.length?n.bandIds.indexOf(h.bandId):0;if(r<0||r>2)continue;t.timeline.begin(this.name);const{painter:s}=t;s.setPipelineState({depth:!1,stencil:{test:!1,write:!1},color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0}}}),n.updateTexture(t),n.updateProcessedTexture(!1);const{config:a,projectionConfig:g,highlightConfig:c,projectionDefines:d}=this._getCommonConfig(n),f=i(n);"bilinear"!==n.interpolation||t.context.capabilities.textureFloatLinear||(f.bilinear=!0);const p=new Float32Array(9);p[3*r]=1;const l={...h,bandSwap:p},m={shader:this.shaders.range,uniforms:{projectionConfig:g,config:a,rangeHighlightConfig:l,highlightConfig:c},defines:{...d,...f,applyPixelMask:!1,applyPixelHighlights:!1,hasExistingHighlights:!!c},optionalAttributes:null,useComputeBuffer:!1};o.bindFramebuffer(this._fbo),o.setViewport(0,0,e,e),s.submitDrawMesh(t.context,m,s.quadMesh);const x=u(t.context,e,e);this._fbo.copyToTexture(0,0,e,e,0,0,x),n.highlightTexture=x,t.timeline.end(this.name)}o.bindFramebuffer(s),o.setViewport(a.x,a.y,a.width,a.height)}_getCommonConfig(e){const{names:t,textures:i}=e.getTextures({forProcessing:!0,useProcessedTexture:e.processed}),r=i[t.indexOf("u_image")],o=e.getRasterTextureSize(),s={texture:{texture:r,unit:0},dvsMat3:new Float32Array([2,0,0,0,2,0,-1,-1,0]),coordScale:[1,1],srcImageSize:o,opacity:1},n=i[t.indexOf("u_transformGrid")],{transformGrid:a}=e,h=!(!n||!a),g=h?{transformTexture:{texture:n,unit:1},targetImageSize:[e.width,e.height],transformSpacing:a.spacing,transformGridSize:a.size}:void 0,{highlightTexture:u}=e;return{config:s,projectionConfig:g,highlightConfig:u?{highlightTexture:{texture:u,unit:2}}:void 0,projectionDefines:{applyProjection:h,lookupProjection:h&&1===a.spacing[0]}}}}function u(e,t,i){const r=new h(t,i);return r.internalFormat=o.RGBA8,r.samplingMode=9728,r.dataType=s.UNSIGNED_BYTE,r.isImmutable=!0,r.wrapMode=33071,new a(e,r)}export{g as RasterHighlightTechnique};
5
+ import{tileSize as e}from"../../../definitions.js";import{Technique as t}from"../Technique.js";import{getInterpolationDefines as i}from"./processor/textureUtils.js";import{RasterRangeHighlightShader as n}from"../shaders/raster/RasterRangeHighlightShader.js";import{RasterXYBandHighlightShader as o}from"../shaders/raster/RasterXYBandHighlightShader.js";import{SizedPixelFormat as r,PixelType as s}from"../../../../../../webgl/enums.js";import{FramebufferObject as a}from"../../../../../../webgl/FramebufferObject.js";import{Texture as g}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../../../../webgl/TextureDescriptor.js";class d extends t{constructor(){super(...arguments),this.name="BrushRasterHighlight",this.type=2,this.shaders={range:new n,xyBand:new o}}shutdown(e){super.shutdown(e),this._fbo?.dispose(),this._fbo=void 0}_getBandIds(e,t){const{type:i}=e,n="xy-band"===i?e.bandIds:[e.bandId];return t?.length?n.map(e=>t.indexOf(e)):"xy-band"===i?[0,1]:[0]}_getSingleBandShaderOptions(e,t,n,o){const{config:r,projectionConfig:s,highlightConfig:a,projectionDefines:g}=this._getCommonConfig(t),h=i(t,o),d={bandSwap:n,ranges:e.ranges,color:e.color};return{shader:this.shaders.range,uniforms:{projectionConfig:s,config:r,rangeHighlightConfig:d,highlightConfig:a},defines:{...g,...h,applyPixelMask:!1,applyPixelHighlights:!1,hasExistingHighlights:!!a},optionalAttributes:null,useComputeBuffer:!1}}_getXYBandShaderOptions(e,t,n,o,r){const{config:s,projectionConfig:a,highlightConfig:g,projectionDefines:h}=this._getCommonConfig(t),d=i(t,o),u={bandSwap:n,xRange:e.xRange,yRange:e.yRange,color:e.color},p=r?{maskTexture:{texture:r,unit:4}}:void 0;return{shader:this.shaders.xyBand,uniforms:{projectionConfig:a,config:s,xyRangeHighlightConfig:u,xyMaskHighlightConfig:p,highlightConfig:g},defines:{...h,...d,applyPixelMask:!1,applyPixelHighlights:!1,hasExistingHighlights:!!g,useMask:!!p},optionalAttributes:null,useComputeBuffer:!1}}render(t,i){const{pixelHighlightOptions:n}=t;if(!n)return;const{context:o}=t;if(!this._fbo){const i=u(t.context,e,e);this._fbo=new a(o,i)}const{type:r}=n,s="xy-band"===r?p(t.context,n):void 0,g=o.getBoundFramebufferObject(),h=o.getViewport();for(const a of i.bitmaps){if(!a.source||a.highlighted||a.suspended||a.isRendereredSource)continue;const i=this._getBandIds(n,a.bandIds);if(i.some(e=>e<0||e>2))continue;t.timeline.begin(this.name);const{painter:g}=t;g.setPipelineState({depth:!1,stencil:{test:!1,write:!1},color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0}}}),a.updateTexture(t),a.updateProcessedTexture(!1);const h=new Float32Array(9);h[3*i[0]]=1,h[3*i[1]+1]="xy-band"===r?1:0;const d="single-band"===r?this._getSingleBandShaderOptions(n,a,h,o):this._getXYBandShaderOptions(n,a,h,o,s);o.bindFramebuffer(this._fbo),o.setViewport(0,0,e,e),g.submitDrawMesh(t.context,d,g.quadMesh);const p=u(t.context,e,e);this._fbo.copyToTexture(0,0,e,e,0,0,p),a.highlightTexture=p,t.timeline.end(this.name)}s?.dispose(),o.bindFramebuffer(g),o.setViewport(h.x,h.y,h.width,h.height)}_getCommonConfig(e){const{names:t,textures:i}=e.getTextures({forProcessing:!0,useProcessedTexture:e.processed}),n=i[t.indexOf("u_image")],o=e.getRasterTextureSize(),r={texture:{texture:n,unit:0},dvsMat3:new Float32Array([2,0,0,0,2,0,-1,-1,0]),coordScale:[1,1],srcImageSize:o,opacity:1},s=i[t.indexOf("u_transformGrid")],{transformGrid:a}=e,g=!(!s||!a),h=g?{transformTexture:{texture:s,unit:1},targetImageSize:[e.width,e.height],transformSpacing:a.spacing,transformGridSize:a.size}:void 0,{highlightTexture:d}=e;return{config:r,projectionConfig:h,highlightConfig:d?{highlightTexture:{texture:d,unit:2}}:void 0,projectionDefines:{applyProjection:g,lookupProjection:g&&1===a.spacing[0]}}}}function u(e,t,i){const n=new h(t,i);return n.internalFormat=r.RGBA8,n.samplingMode=9728,n.dataType=s.UNSIGNED_BYTE,n.isImmutable=!0,n.wrapMode=33071,new g(e,n)}function p(e,t){const{mask:i,maskSize:n}=t;if(!i?.length||!n?.length)return;const o=new h(n[0],n[1]);return o.internalFormat=r.R8,o.samplingMode=9728,o.dataType=s.UNSIGNED_BYTE,o.isImmutable=!0,o.wrapMode=33071,new g(e,o,i)}export{d as RasterHighlightTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{SizedPixelFormat as e,PixelType as t}from"../../../../../../../webgl/enums.js";import{FramebufferObject as r}from"../../../../../../../webgl/FramebufferObject.js";import{Texture as n}from"../../../../../../../webgl/Texture.js";import{TextureDescriptor as o}from"../../../../../../../webgl/TextureDescriptor.js";function i(r,n){const i=new o(r,n);return i.internalFormat=e.RGBA32F,i.samplingMode=9728,i.dataType=t.FLOAT,i.isImmutable=!0,i.wrapMode=33071,i}function u(e,t,r){const o=i(t,r);return new n(e,o)}function s(e,t,n){const o=i(t,n);return new r(e,o)}function a(e){const{symbolizerParameters:t}=e,{type:r}=t,n="lut"===r?"nearest":e.interpolation,o="bilinear"===n&&("lut"!==r&&("stretch"!==r||1===t.bandCount));return{bilinear:o,bicubic:"cubic"===n,nearestOnEdge:o}}export{s as createNewFBO,u as createProcessedTexture,a as getInterpolationDefines};
5
+ import{SizedPixelFormat as e,PixelType as t}from"../../../../../../../webgl/enums.js";import{FramebufferObject as r}from"../../../../../../../webgl/FramebufferObject.js";import{Texture as n}from"../../../../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../../../../webgl/TextureDescriptor.js";function o(r,n){const o=new i(r,n);return o.internalFormat=e.RGBA32F,o.samplingMode=9728,o.dataType=t.FLOAT,o.isImmutable=!0,o.wrapMode=33071,o}function a(e,t,r){const i=o(t,r);return new n(e,i)}function u(e,t,n){const i=o(t,n);return new r(e,i)}function l(e,t){const{symbolizerParameters:r}=e,{type:n}=r,i="lut"===n?"nearest":e.interpolation,o="bilinear"===i&&("lut"!==n&&("stretch"!==n||1===r.bandCount)),a="cubic"===i;return{bilinear:o||"bilinear"===i&&null!=t&&!t.capabilities.textureFloatLinear,bicubic:a,nearestOnEdge:o}}export{u as createNewFBO,a as createProcessedTexture,l as getInterpolationDefines};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as i}from"tslib";import{define as t}from"../../../GraphShaderModule.js";import{mix as r,Vec4 as s,texture2D as h}from"../../../graph/glsl.js";import{BaseRasterColorizerShader as o}from"./BaseRasterColorizerShader.js";class e extends o{constructor(){super(...arguments),this.hasExistingHighlights=!1}_computeHighlightedColor(i,t,o){const e=r(new s(0),t,i);if(this.hasExistingHighlights){const{highlightTexture:t}=this.highlightConfig,s=h(t,o);return r(s,e,i)}return e}}i([t],e.prototype,"hasExistingHighlights",void 0);export{e as BaseRasterHighlightShader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{maxMapSizeGpu as i}from"../../../../../../../../layers/support/rasterFunctions/pixelUtils.js";import{uniform as o,define as r,UniformGroup as s}from"../../../GraphShaderModule.js";import{sign as e,mix as h,Vec4 as g,texture2D as p,FixedArray as a,Float as l,Mat3 as n}from"../../../graph/glsl.js";import{BaseRasterColorizerShader as m}from"./BaseRasterColorizerShader.js";import{computeSingleBandRangeFactor as d}from"./processor/math.js";class c extends s{}t([o(a.ofType(l,2*i))],c.prototype,"ranges",void 0),t([o(n)],c.prototype,"bandSwap",void 0),t([o(g)],c.prototype,"color",void 0);class f extends m{constructor(){super(...arguments),this.type="RasterRangeHighlightShader",this.hasExistingHighlights=!1}_colorize(t,i){const o=this._getPixel(t),{ranges:r,color:s,bandSwap:a}=this.rangeHighlightConfig,l=a.multiply(o.rgb).x,n=d(l,r).multiply(e(o.a)),m=h(new g(0),s,n);if(this.hasExistingHighlights){const{highlightTexture:t}=this.highlightConfig,o=p(t,i);return h(o,m,n)}return m}}t([r],f.prototype,"hasExistingHighlights",void 0),t([o(c)],f.prototype,"rangeHighlightConfig",void 0);export{c as RangeHighlightConfig,f as RasterRangeHighlightShader};
5
+ import{__decorate as o}from"tslib";import{maxMapSizeGpu as r}from"../../../../../../../../layers/support/rasterFunctions/pixelUtils.js";import{uniform as t,UniformGroup as e}from"../../../GraphShaderModule.js";import{sign as i,FixedArray as s,Float as p,Mat3 as a,Vec4 as l}from"../../../graph/glsl.js";import{BaseRasterHighlightShader as g}from"./BaseRasterHighlightShader.js";import{computeSingleBandRangeFactor as h}from"./processor/math.js";class m extends e{}o([t(s.ofType(p,2*r))],m.prototype,"ranges",void 0),o([t(a)],m.prototype,"bandSwap",void 0),o([t(l)],m.prototype,"color",void 0);class n extends g{constructor(){super(...arguments),this.type="RasterRangeHighlightShader"}_colorize(o,r){const t=this._getPixel(o),{ranges:e,color:s,bandSwap:p}=this.rangeHighlightConfig,a=p.multiply(t.rgb).x,l=h(a,e).multiply(i(t.a));return this._computeHighlightedColor(l,s,r)}}o([t(m)],n.prototype,"rangeHighlightConfig",void 0);export{m as RangeHighlightConfig,n as RasterRangeHighlightShader};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import{uniform as o,define as e,option as i,UniformGroup as r}from"../../../GraphShaderModule.js";import{sign as s,clamp as a,Float as p,texture2D as g,Vec2 as l,Mat3 as h,Vec4 as n,Sampler2D as d}from"../../../graph/glsl.js";import{BaseRasterHighlightShader as y}from"./BaseRasterHighlightShader.js";import{getRangeClipFactor as m}from"./processor/math.js";class u extends r{}t([o(l)],u.prototype,"xRange",void 0),t([o(l)],u.prototype,"yRange",void 0),t([o(h)],u.prototype,"bandSwap",void 0),t([o(n)],u.prototype,"color",void 0);class x extends r{}t([o(d)],x.prototype,"maskTexture",void 0);class c extends y{constructor(){super(...arguments),this.type="RasterXYBandHighlightShader",this.useMask=!1}_colorize(t,o){const e=this._getPixel(t),{xRange:i,yRange:r,color:h,bandSwap:n}=this.xyRangeHighlightConfig,{x:d,y}=n.multiply(e.rgb);let u=m(d,i).multiply(m(y,r)).multiply(s(e.a));if(this.useMask){const{maskTexture:t}=this.xyMaskHighlightConfig,o=a(d.subtract(i.x).divide(i.y.subtract(i.x)),new p(0),new p(1)),e=a(r.y.subtract(y).divide(r.y.subtract(r.x)),new p(0),new p(1)),s=g(t,new l(o,e)).r;u=u.multiply(s)}return this._computeHighlightedColor(u,h,o)}}t([e],c.prototype,"useMask",void 0),t([o(u)],c.prototype,"xyRangeHighlightConfig",void 0),t([i(x)],c.prototype,"xyMaskHighlightConfig",void 0);export{c as RasterXYBandHighlightShader,x as XYMaskHighlightConfig,u as XYRangeHighlightConfig};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{maxMapSizeGpu as n}from"../../../../../../../../../layers/support/rasterFunctions/pixelUtils.js";import{Vec3 as t,step as e,sign as r,dot as l,abs as o,Vec4 as u,floor as i,Float as s,mix as c}from"../../../../graph/glsl.js";function w(n){const t=r(n),e=n.add(o(t).subtract(1));return t.multiply(t).divide(e)}function a(n){return new u(i(n.rgb.add(.5)),n.a)}function p(n,t){return e(t.x,n).multiply(e(n,t.y))}function d(o,u){let i=new t(0,0,0);const s=new t(o);for(let r=0;r<n/3;r++){const n=6*r,l=new t(u[n],u[n+2],u[n+4]),o=new t(u[n+1],u[n+3],u[n+5]);i=i.add(e(l,s).multiply(e(s,o)))}return r(l(i,new t(1,1,1)))}function f(n,o,u){const i=new t(n);let w=new t(0,0,0),a=new s(0);for(let r=0;r<u/3;r++){const n=9*r,l=new t(o[n],o[n+3],o[n+6]),u=new t(o[n+1],o[n+4],o[n+7]),s=e(l,i).multiply(e(i,u)),p=new t(o[n+2],o[n+5],o[n+8]);a=c(a,p.x,s.x),a=c(a,p.y,s.y),a=c(a,p.z,s.z),w=w.add(s)}return{mapValue:a,includeMask:r(l(w,new t(1,1,1)))}}export{f as computeMapValue,d as computeSingleBandRangeFactor,p as getRangeClipFactor,w as invertValue,a as roundOutput};
5
+ import{maxMapSizeGpu as n}from"../../../../../../../../../layers/support/rasterFunctions/pixelUtils.js";import{step as t,Vec3 as e,sign as r,dot as l,abs as o,Vec4 as u,floor as i,Float as s,mix as c}from"../../../../graph/glsl.js";function w(n){const t=r(n),e=n.add(o(t).subtract(1));return t.multiply(t).divide(e)}function a(n){return new u(i(n.rgb.add(.5)),n.a)}function p(n,e){return t(e.x,n).multiply(t(n,e.y))}function d(o,u){let i=new e(0,0,0);const s=new e(o);for(let r=0;r<n/3;r++){const n=6*r,l=new e(u[n],u[n+2],u[n+4]),o=new e(u[n+1],u[n+3],u[n+5]);i=i.add(t(l,s).multiply(t(s,o)))}return r(l(i,new e(1,1,1)))}function f(n,o,u){const i=new e(n);let w=new e(0,0,0),a=new s(0);for(let r=0;r<u/3;r++){const n=9*r,l=new e(o[n],o[n+3],o[n+6]),u=new e(o[n+1],o[n+4],o[n+7]),s=t(l,i).multiply(t(i,u)),p=new e(o[n+2],o[n+5],o[n+8]);a=c(a,p.x,s.x),a=c(a,p.y,s.y),a=c(a,p.z,s.z),w=w.add(s)}return{mapValue:a,includeMask:r(l(w,new e(1,1,1)))}}export{f as computeMapValue,d as computeSingleBandRangeFactor,p as getRangeClipFactor,w as invertValue,a as roundOutput};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{uniform as r,UniformGroup as o}from"../../../GraphShaderModule.js";import{Vec4 as e,IVec2 as i,Int as u,texelFetch as m,max as p,min as a,Vec3 as n,clamp as d,step as s,Float as f,sign as c,pow as l,Sampler2D as v}from"../../../graph/glsl.js";import{oneMinus as x}from"../utils.js";import{invertValue as y}from"./processor/math.js";class b extends o{}t([r(f)],b.prototype,"minOutput",void 0),t([r(f)],b.prototype,"maxOutput",void 0),t([r(n)],b.prototype,"minCutOff",void 0),t([r(n)],b.prototype,"maxCutOff",void 0),t([r(n)],b.prototype,"factor",void 0),t([r(n)],b.prototype,"gamma",void 0),t([r(n)],b.prototype,"gammaCorrection",void 0);class O extends o{}function g(t,r){const{minCutOff:o,maxCutOff:e,factor:i,minOutput:u}=r;return d(t,o,e).subtract(o).multiply(i).add(u)}function C(t,r){const{minCutOff:o,maxCutOff:e,minOutput:i,maxOutput:u,gamma:m,gammaCorrection:p}=r,a=d(t,o,e).subtract(o),v=e.subtract(o),y=a.divide(v),b=s(new f(1),m),O=c(m.subtract(1)),g=u.subtract(i),C=new n(1),T=l(C.divide(g),y.multiply(p)),w=x(b.multiply(O).multiply(T)),h=l(y,C.divide(m)),j=w.multiply(g).multiply(h).add(i);return d(j,i,u)}function T(t,r,o,i=255){const u=o?C(t.rgb,r).divide(i):g(t.rgb,r);return new e(u,t.a)}function w(t,r,o,d,s){const f=new i(0,0),c=new u(0);let l=m(o.minTexture,f,c).rgb,v=m(o.maxTexture,f,c).rgb;if(s){const t=m(o.meanTexture,f,c).rgb,r=m(o.stddevTexture,f,c).rgb.multiply(o.numberOfStandardDeviations);l=p(l,t.subtract(r)),v=a(v,t.add(r))}const x=v.subtract(l),b=new n(y(x.x),y(x.y),y(x.z)),O=r.maxOutput.subtract(r.minOutput).multiply(b),T={...r,minCutOff:l,maxCutOff:v,factor:O},w=d?C(t.rgb,r).divide(255):g(t.rgb,T);return new e(w,t.a)}t([r(v)],O.prototype,"minTexture",void 0),t([r(v)],O.prototype,"maxTexture",void 0),t([r(v)],O.prototype,"meanTexture",void 0),t([r(v)],O.prototype,"stddevTexture",void 0),t([r(f)],O.prototype,"numberOfStandardDeviations",void 0);export{O as StatisticsConfig,b as StretchConfig,T as stretch,w as stretchWithStatisticsTexture};
5
+ import{__decorate as t}from"tslib";import{uniform as r,UniformGroup as o}from"../../../GraphShaderModule.js";import{Vec4 as e,IVec2 as i,Int as u,texelFetch as m,max as p,min as a,Vec3 as n,clamp as d,step as s,Float as f,sign as c,pow as l,Sampler2D as v}from"../../../graph/glsl.js";import{oneMinus as x}from"../utils.js";import{invertValue as y}from"./processor/math.js";class b extends o{}t([r(f)],b.prototype,"minOutput",void 0),t([r(f)],b.prototype,"maxOutput",void 0),t([r(n)],b.prototype,"minCutOff",void 0),t([r(n)],b.prototype,"maxCutOff",void 0),t([r(n)],b.prototype,"factor",void 0),t([r(n)],b.prototype,"gamma",void 0),t([r(n)],b.prototype,"gammaCorrection",void 0);class O extends o{}function g(t,r){const{minCutOff:o,maxCutOff:e,factor:i,minOutput:u}=r;return d(t,o,e).subtract(o).multiply(i).add(u)}function C(t,r){const{minCutOff:o,maxCutOff:e,minOutput:i,maxOutput:u,gamma:m,gammaCorrection:p}=r,a=d(t,o,e).subtract(o),v=e.subtract(o),y=a.divide(v),b=s(new f(1),m),O=c(m.subtract(1)),g=u.subtract(i),C=new n(1),T=l(C.divide(g),y.multiply(p)),w=x(b.multiply(O).multiply(T)),h=l(y,C.divide(m)),j=w.multiply(g).multiply(h).add(i);return d(j,i,u)}function T(t,r,o,i=255){const u=o?C(t.rgb,r).divide(i):g(t.rgb,r);return new e(u,t.a)}function w(t,r,o,d,s){const f=new i(0,0),c=new u(0);let l=m(o.minTexture,f,c).rgb,v=m(o.maxTexture,f,c).rgb;if(s){const t=m(o.meanTexture,f,c).rgb,r=m(o.stddevTexture,f,c).rgb.multiply(o.numberOfStandardDeviations);l=p(l,t.subtract(r)),v=a(v,t.add(r))}const x=v.subtract(l),b=new n(y(x.x),y(x.y),y(x.z)),O=r.maxOutput.subtract(r.minOutput).multiply(b),T={...r,minCutOff:l,maxCutOff:v,factor:O},w=d?C(t.rgb,T).divide(255):g(t.rgb,T);return new e(w,t.a)}t([r(v)],O.prototype,"minTexture",void 0),t([r(v)],O.prototype,"maxTexture",void 0),t([r(v)],O.prototype,"meanTexture",void 0),t([r(v)],O.prototype,"stddevTexture",void 0),t([r(f)],O.prototype,"numberOfStandardDeviations",void 0);export{O as StatisticsConfig,b as StretchConfig,T as stretch,w as stretchWithStatisticsTexture};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import{Texture as e}from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import"../../../webgl/enums.js";import"../../../webgl/checkWebGLError.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";function r(r,t,a){const i=new p(t.width,t.height);return i.dataType=t.dataType,t.depth&&(i.depth=t.depth),t.flipped&&(i.flipped=t.flipped),t.hasMipmap&&(i.hasMipmap=t.hasMipmap),i.internalFormat=t.internalFormat,t.isImmutable&&(i.isImmutable=t.isImmutable),t.isOpaque&&(i.isOpaque=t.isOpaque),t.maxAnisotropy&&(i.maxAnisotropy=t.maxAnisotropy),i.pixelFormat=t.pixelFormat,t.preMultiplyAlpha&&(i.preMultiplyAlpha=t.preMultiplyAlpha),t.samplingMode&&(i.samplingMode=t.samplingMode),t.target&&(i.target=t.target),i.uniform=t.uniform,t.unpackAlignment&&(i.unpackAlignment=t.unpackAlignment),t.wrapMode&&(i.wrapMode=t.wrapMode),new e(r,i,a)}export{r as createTexture};
5
+ import"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import{Texture as e}from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import"../../../webgl/enums.js";import"../../../webgl/checkWebGLError.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";function r(r,t,i){const a=new p(t.width,t.height);return a.dataType=t.dataType,t.depth&&(a.depth=t.depth),t.flipped&&(a.flipped=t.flipped),t.hasMipmap&&(a.hasMipmap=t.hasMipmap),a.internalFormat=t.internalFormat,t.isImmutable&&(a.isImmutable=t.isImmutable),t.isOpaque&&(a.isOpaque=t.isOpaque),t.maxAnisotropy&&(a.maxAnisotropy=t.maxAnisotropy),a.pixelFormat=t.pixelFormat,t.preMultiplyAlpha&&(a.preMultiplyAlpha=t.preMultiplyAlpha),t.samplingMode&&(a.samplingMode=t.samplingMode),t.target&&(a.target=t.target),a.uniform=t.uniform,t.unpackAlignment&&(a.unpackAlignment=t.unpackAlignment),t.wrapMode&&(a.wrapMode=t.wrapMode),new e(r,a,i)}export{r as createTexture};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import s from"../../../core/Logger.js";import{isAbortError as t}from"../../../core/promiseUtils.js";import{watch as r,sync as o,initial as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{hasExcludedVariableOrDimension as u}from"../../../layers/support/rasterDatasets/multidimensionalUtils.js";import l from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import d from"./imagery/ImageryTileView2D.js";import c from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as g}from"./support/util.js";import m from"../../layers/ImageryTileLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as w}from"../../layers/RefreshableLayerView.js";let b=class extends(m(w(p(v)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this._pixelHighlights=[],this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,i=this._get("displayParameters");return e.renderer&&e.visible?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:"imagery-tile"===e.type?e.rasterFunction:null}:i}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([r(()=>this.displayParameters,(e,i)=>{const r=e.interpolation!==i?.interpolation&&("majority"===e.interpolation||"majority"===i?.interpolation)&&g(this.layer),o=!!this.layer.serviceRasterInfo?.storageInfo?.isBsqTile&&e.bandIds?.join()!==i?.bandIds?.join(),a=e.renderer!==i?.renderer&&this._getSubviewType(i?.renderer)!==this._getSubviewType(e.renderer);a&&this._updateSubview();const n=e.multidimensionalDefinition!==i?.multidimensionalDefinition,h=e.rasterFunction!==i?.rasterFunction,u=h&&!this._useWebGLForProcessing,l=n||r||a||u||o;this.subview.redrawOrRefetch({refetch:l,reprocess:h}).catch(e=>{t(e)||s.getLogger(this).error(e)}),this.notifyChange("updating")}),r(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;null!=r&&u(r,e)!==u(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{t(e)||s.getLogger(this).error(e)}),this.notifyChange("updating"))},o),r(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{t(e)||s.getLogger(this).error(e)})},a),r(()=>this.view.highlights.items.map(({name:e,color:i})=>({name:e,color:i})),()=>this._updateHighlightOptions(this.subview),a)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}highlight(e,s){if(!e.pixelRanges?.length)return i();const t={target:{...e},options:{...s}};return this._pixelHighlights.push(t),this._updateHighlightOptions(this.subview),i(()=>{const e=this._pixelHighlights.indexOf(t);-1!==e&&(this._pixelHighlights.splice(e,1),this._updateHighlightOptions(this.subview))})}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const i=this._getSubviewType(e);if(this.subview){if(this.subview.type===i)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:s}=this;let t;if(t="rasterVF"===i?new c({layer:s,layerView:this,scheduler:this.scheduler}):"flow"===i?new l({layer:s,layerView:this,scheduler:this.scheduler}):new d({layer:s,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in t&&(t.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in t&&(t.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in t){const{subview:e}=this;t.previousLOD=e&&"previousLOD"in e?e.previousLOD:null}this._attachSubview(t),this._updateHighlightOptions(t),this.subview=t,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const i=e?.type;return"vector-field"===i?"rasterVF":"flow"===i?"flow":"raster"}_updateHighlightOptions(e){"raster"===e?.type&&e.updateHighlightOptions(this._pixelHighlights)}};e([n()],b.prototype,"subview",void 0),e([n()],b.prototype,"useWebGLForProcessing",null),e([n()],b.prototype,"useProgressiveUpdate",null),e([n({readOnly:!0})],b.prototype,"displayParameters",null),b=e([h("esri.views.2d.layers.ImageryTileLayerView2D")],b);const y=b;export{y as default};
5
+ import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import s from"../../../core/Logger.js";import{isAbortError as t}from"../../../core/promiseUtils.js";import{watch as r,sync as o,initial as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{hasExcludedVariableOrDimension as u}from"../../../layers/support/rasterDatasets/multidimensionalUtils.js";import l from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import d from"./imagery/ImageryTileView2D.js";import c from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as g}from"./support/util.js";import m from"../../layers/ImageryTileLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as w}from"../../layers/RefreshableLayerView.js";let b=class extends(m(w(p(v)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this._pixelHighlights=[],this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,i=this._get("displayParameters");return e.renderer&&e.visible?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:"imagery-tile"===e.type?e.rasterFunction:null}:i}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([r(()=>this.displayParameters,(e,i)=>{const r=e.interpolation!==i?.interpolation&&("majority"===e.interpolation||"majority"===i?.interpolation)&&g(this.layer),o=!!this.layer.serviceRasterInfo?.storageInfo?.isBsqTile&&e.bandIds?.join()!==i?.bandIds?.join(),a=e.renderer!==i?.renderer&&this._getSubviewType(i?.renderer)!==this._getSubviewType(e.renderer);a&&this._updateSubview();const n=e.multidimensionalDefinition!==i?.multidimensionalDefinition,h=e.rasterFunction!==i?.rasterFunction,u=h&&!this._useWebGLForProcessing,l=n||r||a||u||o;this.subview.redrawOrRefetch({refetch:l,reprocess:h}).catch(e=>{t(e)||s.getLogger(this).error(e)}),this.notifyChange("updating")}),r(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;null!=r&&u(r,e)!==u(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{t(e)||s.getLogger(this).error(e)}),this.notifyChange("updating"))},o),r(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{t(e)||s.getLogger(this).error(e)})},a),r(()=>this.view.highlights.items.map(({name:e,color:i})=>({name:e,color:i})),()=>this._updateHighlightOptions(this.subview),a)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}highlight(e,s){if(!e.pixelRanges||Array.isArray(e.pixelRanges)&&0===e.pixelRanges.length)return i();const t={target:{...e},options:{...s}};return this._pixelHighlights.push(t),this._updateHighlightOptions(this.subview),i(()=>{const e=this._pixelHighlights.indexOf(t);-1!==e&&(this._pixelHighlights.splice(e,1),this._updateHighlightOptions(this.subview))})}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const i=this._getSubviewType(e);if(this.subview){if(this.subview.type===i)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:s}=this;let t;if(t="rasterVF"===i?new c({layer:s,layerView:this,scheduler:this.scheduler}):"flow"===i?new l({layer:s,layerView:this,scheduler:this.scheduler}):new d({layer:s,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in t&&(t.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in t&&(t.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in t){const{subview:e}=this;t.previousLOD=e&&"previousLOD"in e?e.previousLOD:null}this._attachSubview(t),this._updateHighlightOptions(t),this.subview=t,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const i=e?.type;return"vector-field"===i?"rasterVF":"flow"===i?"flow":"raster"}_updateHighlightOptions(e){"raster"===e?.type&&e.updateHighlightOptions(this._pixelHighlights)}};e([n()],b.prototype,"subview",void 0),e([n()],b.prototype,"useWebGLForProcessing",null),e([n()],b.prototype,"useProgressiveUpdate",null),e([n({readOnly:!0})],b.prototype,"displayParameters",null),b=e([h("esri.views.2d.layers.ImageryTileLayerView2D")],b);const y=b;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t,createResolver as s}from"../../../../core/promiseUtils.js";import{UpdatingHandles as r}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as i}from"../../engine/AFeatureContainer.js";import n from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as a}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{RenderState as o}from"./RenderState.js";import{renderHighlight as h}from"../support/util.js";class d{constructor(e,t){this.id=e,this.version=t,this._resolver=s(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class l extends i{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new r,this._hitTestsRequests=[],this._store=new n,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){this.updatingHandles.destroy(),super.destroy(),this._renderState=e(this._renderState),this._renderStateNext=e(this._renderStateNext)}renderChildren(e){if(this._updateAttributeView(),this._renderState?.update(this.attributeView.currentEpoch),this._layerView.requestUpdate(),this._renderState){const e=Array.from(this._renderState.tiles()).filter(e=>e.needsUpload);if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(t.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter(),this.requestRender())}const t=this._layerView.subscriptionManager.updateVisibility();this.setVisibleTiles(t);for(const s of this.children)s.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 16:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}get usedMemory(){let e=0;return this._renderState&&(e+=this._renderState.usedMemory),this._renderStateNext&&(e+=this._renderStateNext.usedMemory),e+=this.attributeView.usedMemory,e}get instanceStore(){return this._store}get layerView(){return this._layerView}get tiles(){return this._renderState?.tiles()}get _instanceStore(){return this._store}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&a.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(u(t))return t;return null}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&(this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter())}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe){if(!this._subscriptions.has(t)){const e=new d(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise);continue}this._subscriptions.get(t).version=s}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new o(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.layerView.view.labelManager.symbolFader,this,this.tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const r of t)s.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}lockForOverrides(){this._renderState?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState?.unlockUploads(),this._shouldUnlockAttributeView&&(this.attributeView.unlockTextureUploads(),this._shouldUnlockAttributeView=!1),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState?.flush(),this.requestRender()}trySwapRenderState(){if(this._renderStateNext){has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`);const e=new Map;for(const t of this._renderState?.tiles()||[])e.set(t.id,t.metricsVisibility);this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderState.flush();for(const t of this._renderState.tiles())t.copyMetricsVisibility(e.get(t.id)||new Set);this._renderStateNext=null}this.requestRender()}setVisibleTiles(e){this._visibleTiles=e;for(const t of this.tiles??[])t.rendering=e.has(t.key.id)}async onMessage(e,s){t(s);const r=e.inner;if(!this._subscriptions.has(r.id))return;const i=this._subscriptions.get(r.id);if(i.version!==r.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${r.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${r.id}] FeatureContainer - Dropping message, outdated version]`,r)}return}const n=this._renderStateNext??this._renderState;if(!n)throw new Error("InternalError: No renderState defined");n.version!==r.version&&console.error(`InternalError: Version mismatch. [renderState: ${n.version}, message: ${r.version}]`),n.enqueueUpdate(e),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:t,y:s})=>t===e.x&&s===e.y);const r=s();return t?t.resolvers.push(r):(t={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(t)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach((e,t)=>s.set(t,e)),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=a.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&h(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),i=t.getViewport(),n=e.passOptions,a=e.drawPhase;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),e.drawPhase=8;const{distance:o,smallSymbolDistance:h}=e.passOptions,d=Math.max(o,h);for(const l of this.children)l.visible&&l.containsScreenPoint(e.state,e.passOptions.position,2*d)&&this._renderTile(l,e,0);s.draw(e),s.unbind(),t.bindFramebuffer(r),t.restoreViewport(i),e.passOptions=n,e.drawPhase=a}_renderFeatures(e,t){const s=this._getHeatmapInstance(e);null!=s?this._renderHeatmapFeatures(e,t,s):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const s of this.children)s.visible&&this._renderTile(s,e,t)}_renderHeatmapFeatures(e,t,s){for(const r of this.children)r.visible&&this._renderTile(r,e,t,17);s.techniqueRef.renderResolvePass(e,s)}_renderTile(e,t,s,r){const i=has("featurelayer-strict-draw-order")?1:has("featurelayer-force-marker-text-draw-order")?2:0,n=e.getDisplayList(this._instanceStore,i);t.selection=s,n?.render(t,r)}}function u(e){return 17===e.techniqueRef.type}export{l as FeatureContainer};
5
+ import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{throwIfAborted as t,createResolver as s}from"../../../../core/promiseUtils.js";import{UpdatingHandles as r}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as i}from"../../engine/AFeatureContainer.js";import n from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as a}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{RenderState as o}from"./RenderState.js";import{renderHighlight as h}from"../support/util.js";class d{constructor(e,t){this.id=e,this.version=t,this._resolver=s(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class l extends i{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new r,this._hitTestsRequests=[],this._store=new n,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}destroy(){this.updatingHandles.destroy(),super.destroy(),this._renderState=e(this._renderState),this._renderStateNext=e(this._renderStateNext)}renderChildren(e){if(this._updateAttributeView(),this._renderState?.update(this.attributeView.currentEpoch),this._layerView.requestUpdate(),this._renderState){const e=Array.from(this._renderState.tiles()).filter(e=>e.needsUpload);if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender();for(const t of e.filter(e=>e.hasMetrics))t.upload()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(t.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter(),this.requestRender())}const t=this._layerView.subscriptionManager.updateVisibility();this.setVisibleTiles(t);for(const s of this.children)s.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case 1:return this._renderMapPhase(e);case 16:return this._renderHighlightPhase(e);case 2:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}get usedMemory(){let e=0;return this._renderState&&(e+=this._renderState.usedMemory),this._renderStateNext&&(e+=this._renderStateNext.usedMemory),e+=this.attributeView.usedMemory,e}get instanceStore(){return this._store}get layerView(){return this._layerView}get tiles(){return this._renderState?.tiles()}get _instanceStore(){return this._store}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&a.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(u(t))return t;return null}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&(this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter())}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe){if(!this._subscriptions.has(t)){const e=new d(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise);continue}this._subscriptions.get(t).version=s}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new o(()=>this._stage,e=>this._subscriptions.get(e)?.version,e,this.layerView.view.labelManager.symbolFader,this,this.tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const r of t)s.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}lockForOverrides(){this._renderState?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState?.unlockUploads(),this._shouldUnlockAttributeView&&(this.attributeView.unlockTextureUploads(),this._shouldUnlockAttributeView=!1),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState?.flush(),this.requestRender()}trySwapRenderState(){if(this._renderStateNext){has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`);const e=new Map;for(const t of this._renderState?.tiles()||[])e.set(t.id,t.metricsVisibility);this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderState.flush();for(const t of this._renderState.tiles())t.copyMetricsVisibility(e.get(t.id)||new Set);this._renderStateNext=null}this.requestRender()}setVisibleTiles(e){this._visibleTiles=e;for(const t of this.tiles??[])t.rendering=e.has(t.key.id)}async onMessage(e,s){t(s);const r=e.inner;if(!this._subscriptions.has(r.id))return;const i=this._subscriptions.get(r.id);if(i.version!==r.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${r.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${r.id}] FeatureContainer - Dropping message, outdated version]`,r)}return}const n=this._renderStateNext??this._renderState;if(!n)throw new Error("InternalError: No renderState defined");n.version!==r.version&&console.error(`InternalError: Version mismatch. [renderState: ${n.version}, message: ${r.version}]`),n.enqueueUpdate(e),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:t,y:s})=>t===e.x&&s===e.y);const r=s();return t?t.resolvers.push(r):(t={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(t)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach((e,t)=>s.set(t,e)),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=a.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,0),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&h(e,!1,e=>{this._renderFeatures(e,1)})}_renderLabelPhase(e){this._renderFeatures(e,0)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,2),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,3),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),i=t.getViewport(),n=e.passOptions,a=e.drawPhase;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),e.drawPhase=8;const{distance:o,smallSymbolDistance:h}=e.passOptions,d=Math.max(o,h);for(const l of this.children)l.visible&&l.containsScreenPoint(e.state,e.passOptions.position,2*d)&&this._renderTile(l,e,0);s.draw(e),s.unbind(),t.bindFramebuffer(r),t.restoreViewport(i),e.passOptions=n,e.drawPhase=a}_renderFeatures(e,t){const s=this._getHeatmapInstance(e);null!=s?this._renderHeatmapFeatures(e,t,s):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const s of this.children)s.visible&&this._renderTile(s,e,t)}_renderHeatmapFeatures(e,t,s){for(const r of this.children)r.visible&&this._renderTile(r,e,t,17);s.techniqueRef.renderResolvePass(e,s)}_renderTile(e,t,s,r){const i=has("featurelayer-strict-draw-order")?1:has("featurelayer-force-marker-text-draw-order")?2:0,n=e.getDisplayList(this._instanceStore,i);t.selection=s,n?.render(t,r)}}function u(e){return 17===e.techniqueRef.type}export{l as FeatureContainer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import has from"../../../../core/has.js";import{numberMaxFloat32 as r}from"../../../../core/mathUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{isFunctionRaster as o}from"../../../../layers/support/rasterDatasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/support/rasterFormats/pixelRangeUtils.js";import{convertGeometryToMask as a}from"../../../../layers/support/rasterFunctions/clipUtils.js";import{maxMapSizeGpu as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{RasterTileContainer as c}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as p}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as u}from"../support/util.js";import{defaultColor as h}from"../../../support/HighlightDefaults.js";import{getHighlightName as d}from"../../../support/highlightOptionsUtils.js";let m=class extends p{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t)return!1;const r=t.lookup.colormapLut?.indexedColormap,s=r&&r.length>this._maxIndexedColormapSize,i=n(this.layer.serviceRasterInfo);return!(has("ios")&&i>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!s&&!("majority"===this.layer.interpolation&&u(this.layer))}attach(){super.attach(),this.container=new c(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const s=this._rasterFunctionState,{rasterFunction:i,primaryRasters:o}=e,n=i.supportsGPU&&(!o||o.rasters.length<=1),a=n?i.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!n||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const p=null==i?"na":r.rasterFunctionChain?"gpu":"cpu",u=s===p||"na"===s&&"cpu"===p&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!u,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=p}async updateTileSource(e,t){const r=this._getBandIds(),s=this._getLayerInterpolation(),{canUseWebGLForProcessing:i}=this,{source:n,globalSymbolizerParams:l,suspended:c,coords:p,resolution:u}=t,h=this.isCPUBasedDRA?l:t.symbolizerParams,{bitmap:d}=e;if([d.x,d.y]=p,d.resolution=u,null!=n?.pixelBlock){const e={extent:n.extent,pixelBlock:n.pixelBlock,srcPixelSize:n.srcTilePixelSize};if(d.rawPixelData=e,i)d.source=n.pixelBlock,d.isRendereredSource=!1;else{const t=await this.layer.applyRenderer(e,"stretch"===l?.type?l:void 0);d.source=t,d.isRendereredSource=!0}d.symbolizerParameters=i?h:null,d.transformGrid=i?n.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();d.source=e,d.symbolizerParameters=i?h:null,d.transformGrid=null}const{isBsqTile:m}=this.layer.raster.rasterInfo.storageInfo;d.bandIds=i&&!m?r:null,d.width=this._tileInfoView.tileInfo.size[0],d.height=this._tileInfoView.tileInfo.size[1],d.interpolation=s,d.suspended=c;const{raster:f}=this.layer;if(o(f)){const t=f.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=f.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);r&&(d.mask=a({srcExtent:r,geometry:t,size:[d.width,d.height]}))}}d.invalidateTexture()}async updateTileSymbolizerParameters(e,t,r){const{local:s,global:i}=t,o=this._getBandIds(),n=this._getLayerInterpolation(),{canUseWebGLForProcessing:a}=this,{bitmap:l}=e,{rawPixelData:c}=l;a||null==c?(l.isRendereredSource&&null!=c&&(l.source=c.pixelBlock),l.isRendereredSource=!1):(l.source=await this.layer.applyRenderer(c,"stretch"===i?.type?i:void 0,{signal:r}),l.isRendereredSource=!0),l.symbolizerParameters=a?this.layerView.hasTilingEffects?i:s:null;const{isBsqTile:p}=this.layer.raster.rasterInfo.storageInfo;l.bandIds=a&&!p?o:null,l.interpolation=n,l.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const s=[],{highlights:i}=this.layerView.view;e.sort((e,t)=>i.findIndex(({name:e})=>e===d(t.options))-i.findIndex(({name:t})=>t===d(e.options)));for(const{target:o,options:n}of e){const{pixelRanges:e}=o,a=Array.from({length:2*l},()=>0);for(let t=0;t<e.length;t++)a[2*t]=e[t][0],a[2*t+1]=e[t][1];for(let t=e.length;t<l;t++)a[2*t]=r,a[2*t+1]=-r;const c=o.bandId??0,p=d(n),u=i.find(e=>e.name===p)?.color??h,m=t.toUnitRGBA(u);s.push({ranges:a,bandId:c,color:m})}this.container.pixelHighlights=s}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.tileInfo.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}};e([s()],m.prototype,"canUseWebGLForProcessing",null),e([s()],m.prototype,"container",void 0),e([s()],m.prototype,"layer",void 0),e([s()],m.prototype,"type",void 0),m=e([i("esri.views.2d.layers.imagery.ImageryTileView2D")],m);export{m as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import has from"../../../../core/has.js";import{numberMaxFloat32 as r}from"../../../../core/mathUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{isFunctionRaster as o}from"../../../../layers/support/rasterDatasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/support/rasterFormats/pixelRangeUtils.js";import{convertGeometryToMask as a}from"../../../../layers/support/rasterFunctions/clipUtils.js";import{maxMapSizeGpu as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{RasterTileContainer as c}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as p}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as u}from"../support/util.js";import{defaultColor as d}from"../../../support/HighlightDefaults.js";import{getHighlightName as h}from"../../../support/highlightOptionsUtils.js";const m=[1024,1024];let y=class extends p{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t)return!1;const r=t.lookup.colormapLut?.indexedColormap,s=r&&r.length>this._maxIndexedColormapSize,i=n(this.layer.serviceRasterInfo);return!(has("ios")&&i>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!s&&!("majority"===this.layer.interpolation&&u(this.layer))}attach(){super.attach(),this.container=new c(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const s=this._rasterFunctionState,{rasterFunction:i,primaryRasters:o}=e,n=i.supportsGPU&&(!o||o.rasters.length<=1),a=n?i.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!n||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const p=null==i?"na":r.rasterFunctionChain?"gpu":"cpu",u=s===p||"na"===s&&"cpu"===p&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!u,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=p}async updateTileSource(e,t){const r=this._getBandIds(),s=this._getLayerInterpolation(),{canUseWebGLForProcessing:i}=this,{source:n,globalSymbolizerParams:l,suspended:c,coords:p,resolution:u}=t,d=this.isCPUBasedDRA?l:t.symbolizerParams,{bitmap:h}=e;if([h.x,h.y]=p,h.resolution=u,null!=n?.pixelBlock){const e={extent:n.extent,pixelBlock:n.pixelBlock,srcPixelSize:n.srcTilePixelSize};if(h.rawPixelData=e,i)h.source=n.pixelBlock,h.isRendereredSource=!1;else{const t=await this.layer.applyRenderer(e,"stretch"===l?.type?l:void 0);h.source=t,h.isRendereredSource=!0}h.symbolizerParameters=i?d:null,h.transformGrid=i?n.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();h.source=e,h.symbolizerParameters=i?d:null,h.transformGrid=null}const{isBsqTile:m}=this.layer.raster.rasterInfo.storageInfo;h.bandIds=i&&!m?r:null,h.width=this._tileInfoView.tileInfo.size[0],h.height=this._tileInfoView.tileInfo.size[1],h.interpolation=s,h.suspended=c;const{raster:y}=this.layer;if(o(y)){const t=y.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=y.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);r&&(h.mask=a({srcExtent:r,geometry:t,size:[h.width,h.height]}))}}h.invalidateTexture()}async updateTileSymbolizerParameters(e,t,r){const{local:s,global:i}=t,o=this._getBandIds(),n=this._getLayerInterpolation(),{canUseWebGLForProcessing:a}=this,{bitmap:l}=e,{rawPixelData:c}=l;a||null==c?(l.isRendereredSource&&null!=c&&(l.source=c.pixelBlock),l.isRendereredSource=!1):(l.source=await this.layer.applyRenderer(c,"stretch"===i?.type?i:void 0,{signal:r}),l.isRendereredSource=!0),l.symbolizerParameters=a?this.layerView.hasTilingEffects?i:s:null;const{isBsqTile:p}=this.layer.raster.rasterInfo.storageInfo;l.bandIds=a&&!p?o:null,l.interpolation=n,l.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const s=[],{highlights:i}=this.layerView.view;e.sort((e,t)=>i.findIndex(({name:e})=>e===h(t.options))-i.findIndex(({name:t})=>t===h(e.options)));for(const{target:o,options:n}of e){const{pixelRanges:e}=o,c=h(n),p=i.find(e=>e.name===c)?.color??d,u=t.toUnitRGBA(p);if(Array.isArray(e)){const t=Array.from({length:2*l},()=>0);for(let r=0;r<e.length;r++)t[2*r]=e[r][0],t[2*r+1]=e[r][1];for(let s=e.length;s<l;s++)t[2*s]=r,t[2*s+1]=-r;const i=o.bandId??0;s.push({ranges:t,bandId:i,color:u,type:"single-band"})}else{const t="extent"===e.type?e:e.extent;if(!t)continue;const r=[t.xmin,t.xmax],i=[t.ymin,t.ymax],{xBandId:n,yBandId:l}=o,c={xRange:r,yRange:i,bandIds:[n,l],color:u,type:"xy-band"};"polygon"===e.type&&(c.maskSize=m,c.mask=a({srcExtent:t,geometry:e,size:m})),s.push(c)}}this.container.pixelHighlights=s}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.tileInfo.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}};e([s()],y.prototype,"canUseWebGLForProcessing",null),e([s()],y.prototype,"container",void 0),e([s()],y.prototype,"layer",void 0),e([s()],y.prototype,"type",void 0),y=e([i("esri.views.2d.layers.imagery.ImageryTileView2D")],y);export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import{when as r}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import i from"../GroundView.js";let s=class extends(t(i)){constructor(e){super(e),this._allIntegratedMeshLayerViewElevationUpdateHandles=new Map}initialize(){super.initialize(),this.addHandles(r(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e))));const e=this._allIntegratedMeshLayerViewElevationUpdateHandles;this.addHandles(this.view.allLayerViews.on("change",t=>{t.added.forEach(t=>{if(!o(t))return;const r=t.elevationProvider.on("elevation-change",e=>this._elevationChange(e));e.set(t,r)}),t.removed.forEach(t=>{o(t)&&(e.get(t)?.remove(),e.delete(t))})}))}destroy(){this._allIntegratedMeshLayerViewElevationUpdateHandles.forEach(e=>e.remove()),this._allIntegratedMeshLayerViewElevationUpdateHandles.clear()}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerView(){const e=this.ground?.integratedMeshGround;if(e)return this.view.basemapView?.groundLayerViews.find(t=>t.layer===e)}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return this._terrainSurface?.enabled??!1}get _usingIntegratedMesh(){return this._integratedMeshGroundLayerView?.visible??!1}get spatialReference(){return this._terrainSurface?.spatialReference}intersect(e,t,r,a){this._usingTerrain&&this._terrainSurface?.intersect(e,t,r,a);for(const[n,i]of this._allIntegratedMeshLayerViewElevationUpdateHandles)n.intersect(e,t,r,a)}get updating(){return!this.suspended&&((this._source?.updating??!1)||this.layerViews.some(({updating:e})=>e))}get elevationQueryCache(){return this._usingTerrain?this._terrainSurface?.elevationQueryCache:null}get extentAABR(){return this._terrainSurface?.extent}get suspended(){return this._source?.suspended??!1}get ready(){return this._source?.ready??!0}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}get _source(){return this._usingTerrain?this._terrainSurface:this._usingIntegratedMesh?this._integratedMeshGroundLayerView:null}requestRender(e){this.view.stage.renderView?.requestRender(e)}};function o(e){return"integrated-mesh-3d"===e.type||"integrated-mesh-3dtiles"===e.type}e([a({readOnly:!0})],s.prototype,"_integratedMeshGroundLayerView",null),e([a({readOnly:!0})],s.prototype,"_terrainSurface",null),e([a({readOnly:!0})],s.prototype,"_usingTerrain",null),e([a({readOnly:!0})],s.prototype,"_usingIntegratedMesh",null),e([a({readOnly:!0})],s.prototype,"spatialReference",null),e([a({type:Boolean,readOnly:!0})],s.prototype,"updating",null),e([a({readOnly:!0})],s.prototype,"elevationQueryCache",null),e([a({readOnly:!0})],s.prototype,"extentAABR",null),e([a({readOnly:!0})],s.prototype,"suspended",null),e([a({readOnly:!0})],s.prototype,"ready",null),s=e([n("esri.views.3d.GroundView3D")],s);export{s as GroundView3D,o as isIntegratedMeshLayerView};
5
+ import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import{when as r}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import i from"../GroundView.js";import{isIntegratedMeshLayerView as s}from"../support/layerViewUtils.js";let o=class extends(t(i)){constructor(){super(...arguments),this._integratedMeshElevationUpdateHandles=new Map}initialize(){super.initialize(),this.addHandles(r(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e))));const e=this._integratedMeshElevationUpdateHandles;this.addHandles(this.view.allLayerViews.on("change",t=>{t.added.forEach(t=>{s(t)&&e.set(t,t.elevationProvider.on("elevation-change",e=>this._elevationChange(e)))}),t.removed.forEach(t=>{s(t)&&(e.get(t)?.remove(),e.delete(t))})}))}destroy(){this._integratedMeshElevationUpdateHandles.forEach(e=>e.remove()),this._integratedMeshElevationUpdateHandles.clear()}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerView(){const e=this.ground?.integratedMeshGround;if(e)return this.view.basemapView?.groundLayerViews.find(t=>t.layer===e)}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return this._terrainSurface?.enabled??!1}get _usingIntegratedMesh(){return this._integratedMeshGroundLayerView?.visible??!1}get spatialReference(){return this._terrainSurface?.spatialReference}intersect(e,t,r,n){this._usingTerrain&&this._terrainSurface?.intersect(e,t,r,n);for(const a of this._integratedMeshElevationUpdateHandles.keys())a.intersect(e,t,r,n)}get updating(){return!this.suspended&&((this._source?.updating??!1)||this.layerViews.some(({updating:e})=>e))}get elevationQueryCache(){return this._usingTerrain?this._terrainSurface?.elevationQueryCache:null}get extentAABR(){return this._terrainSurface?.extent}get suspended(){return this._source?.suspended??!1}get ready(){return this._source?.ready??!0}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}get _source(){return this._usingTerrain?this._terrainSurface:this._usingIntegratedMesh?this._integratedMeshGroundLayerView:null}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([n({readOnly:!0})],o.prototype,"_integratedMeshGroundLayerView",null),e([n({readOnly:!0})],o.prototype,"_terrainSurface",null),e([n({readOnly:!0})],o.prototype,"_usingTerrain",null),e([n({readOnly:!0})],o.prototype,"_usingIntegratedMesh",null),e([n({readOnly:!0})],o.prototype,"spatialReference",null),e([n({type:Boolean,readOnly:!0})],o.prototype,"updating",null),e([n({readOnly:!0})],o.prototype,"elevationQueryCache",null),e([n({readOnly:!0})],o.prototype,"extentAABR",null),e([n({readOnly:!0})],o.prototype,"suspended",null),e([n({readOnly:!0})],o.prototype,"ready",null),o=e([a("esri.views.3d.GroundView3D")],o);export{o as GroundView3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../../Color.js";import i from"../../../../analysis/LengthDimension.js";import a from"../../../../core/Accessor.js";import n from"../../../../core/Handles.js";import{destroyHandle as s,handlesGroup as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as r}from"../../../../core/lang.js";import{mapCollection as p}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as l,destroyMaybe as u}from"../../../../core/maybe.js";import{memoize as d}from"../../../../core/memoize.js";import{ignoreAbortErrors as c}from"../../../../core/promiseUtils.js";import{watch as m,initial as h,sync as g,syncAndInitial as f,when as _}from"../../../../core/reactiveUtils.js";import{property as M}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as S}from"../../../../core/support/UpdatingHandles.js";import C from"../../../../geometry/Point.js";import{clonePoint as w}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as b,applyConstraint as P,computeConstraint as O,constraintDependencies as D}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as H,LengthDimensionPointManipulator as j,pointManipulatorHandles as T,createOffsetManipulator as x,offsetManipulatorHandles as G,LineOfSightOrientationManipulator as z,headingManipulatorHandles as U,rotationManipulatorHandles as R,createMeasureTypeManipulator as I,measureTypeManipulatorHandles as V,updateOffsetManipulatorTransform as A,updateHeadingManipulatorTransform as E,updateRotationManipulatorTransform as k,updateMeasureTypeManipulatorTransform as L,unfocusedOffsetWidth as F,focusedOffsetWidth as q}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as B,arePointsVerticallyAligned as N,computationToGeometryDependencies as J,computeGeometryFromDimension as K}from"./lengthDimensionUtils.js";import{disabledPointColor as Q,pointRadius as W,getTransparentAccentColor as X,getContrastColor as Y,initialOffsetPx as Z}from"./settings.js";import{getRotateHeadingTexture as $}from"../images/Factory.js";import{SnappingVisualizer3D as tt}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as et}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as it}from"../../interactive/visualElements/VerticesVisualElement.js";import{ImageMaterial as at}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as nt}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends a{constructor(t){super(t),this._stagedDimension=null,this._snappingManagerResult=null,this._computationManipulators=new Map,this._computationHandles=new n,this._updatingHandles=new S,this._getSnappingContext=d(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new tt}));const{view:i}=t;this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:nt(2)}),this._constraintSnappingIndicator=new et({view:i,attached:!0,width:1,renderOccluded:4,stipplePattern:nt(5),isDecoration:!0});const a=e.toUnitRGBA(Q);this._stagedStartIndicator=new it({view:i,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:a,size:2*W,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const i=X(t.effectiveTheme),a=Y(t.effectiveTheme),n=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial=new at({draped:!1,texture:this._textureHandle.texture,writeDepth:!1,renderOccluded:16,isDecoration:!0});const o=p(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([m(()=>({accentColor:X(t.effectiveTheme),contrastColor:Y(t.effectiveTheme)}),({accentColor:i,contrastColor:a})=>{const s=this._textureHandle;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({texture:this._textureHandle.texture}),s?.release();const o=e.toUnitRGBA(i);this._unfocusedOffsetManipulatorMaterial.setParameters({color:o}),this._focusedOffsetManipulatorMaterial.setParameters({color:o}),this._thinOffsetManipulatorMaterial.setParameters({color:o}),this._constraintSnappingIndicator.color=o},h),s(o),m(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=w(t,new C);this._applyPointUpdate(e,{endPoint:i})},g),m(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:a,firstGrabbedManipulator:n}=t;if(i===e?.stagedDimension&&n===e?.firstGrabbedManipulator){for(const s of[a,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},f),m(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),h),m(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),m(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=y();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(c(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",a=this._computeConstraint(t);b(t,i,{constraint:a,view:this.view})}}})}destroy(){this._textureHandle=l(this._textureHandle),this._snappingOperation=u(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),this._orientationManipulatorMaterial.dispose()}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager?.options}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){return this._snappingManagerResult||(this._snappingManagerResult=dt(this.view),this.addHandles(this._snappingManagerResult)),this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[_(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...f,equals:r}),m(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:a}=t;switch(a.previousConstraint){case 0:a.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:a.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:a.preConstraintProperties={measureType:"direct",orientation:i};break;default:a.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},g)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[m(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const a=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)a.attached=!0;else{const{start:e,end:n}=this._computationManipulators.get(i),s=()=>{a.attached=e.grabbing||n.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),n.events.on("grab-changed",s)],t)}else a.attached=!1}),m(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.addPromise(c(this._snappingOperation.snap({point:t},this._ensureSnappingManager(),i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:e}){let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._ensureSnappingManager().update({point:t,context:i})}const n=new i({startPoint:w(a,new C),endPoint:null,measureType:"horizontal"});return this._stagedDimension=n,this._resetSnappingState(),n}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._ensureSnappingManager().update({point:t,context:i})}const n=w(a,new C);this._applyPointUpdate(i,{endPoint:n}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),a=this._setupOffsetManipulator(t),n=this._setupHeadingManipulator(t),s=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new H({start:e,end:i,offset:a,heading:n,rotation:s,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=o(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([m(()=>t.geometry,()=>this._updateManipulators(t,e),{...f,equals:r})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:a}=t,n=new j(i,{metadata:a}),s=T(n,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:a,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),n}_setupOffsetManipulator(t){const{view:e}=this,i=x(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),a=G(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=U(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=R(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,a=I(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),n=V(a,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(n,t),a}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:a,selectedComputation:n,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=n===t,c=B(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==a&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);N(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;A(p,h,g),l.available&&E(l,t,g),u.available&&k(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&L(e,t,i,g)})}_updateManipulatorStyle(t){const e=F(t),i=q(t),a={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:n,heading:s,rotation:o}of this._computationManipulators.values())n.radius=i/2,s.update(a),o.update(a);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,a=J(t);"startPoint"in e&&(a.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(a.elevationAlignedEndPoint=e.endPoint);const n=K(a,i.renderCoordsHelper);if(null==n)return;const s=this._computeConstraint({...a,geometry:n});P(t,e,{...a,constraint:s,unconstrainedGeometry:n,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,a=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Z*a*i.unitInMeters}_computeConstraint(t){return O(D(t,this._ensureSnappingManager().options),this.view)}_createOffsetManipulatorMaterial(t){return new st({width:1,renderOccluded:4,writeDepth:!1,hasPolygonOffset:!0,isDecoration:!0},t.state.isGlobal)}get test(){}};t([M({constructOnly:!0})],ht.prototype,"analysis",void 0),t([M({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([M({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([M({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([M({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([M({readOnly:!0})],ht.prototype,"updating",null),t([M()],ht.prototype,"firstGrabbedManipulator",null),t([M()],ht.prototype,"hasGrabbedManipulators",null),t([M()],ht.prototype,"snappingOptions",null),t([M()],ht.prototype,"_stagedDimension",void 0),t([M()],ht.prototype,"_snappingManager",null),t([M()],ht.prototype,"_activeComputation",null),t([M()],ht.prototype,"_stagedComputation",null),t([M()],ht.prototype,"_snappingManagerResult",void 0),ht=t([v("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=y();export{ht as LengthDimensionSubTool};
5
+ import{__decorate as t}from"tslib";import e from"../../../../Color.js";import i from"../../../../analysis/LengthDimension.js";import a from"../../../../core/Accessor.js";import n from"../../../../core/Handles.js";import{destroyHandle as s,handlesGroup as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as r}from"../../../../core/lang.js";import{mapCollection as p}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as l,destroyMaybe as u}from"../../../../core/maybe.js";import{memoize as d}from"../../../../core/memoize.js";import{ignoreAbortErrors as c}from"../../../../core/promiseUtils.js";import{watch as m,initial as h,sync as g,syncAndInitial as f,when as _}from"../../../../core/reactiveUtils.js";import{property as M}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as S}from"../../../../core/support/UpdatingHandles.js";import C from"../../../../geometry/Point.js";import{clonePoint as w}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as b,applyConstraint as P,computeConstraint as O,constraintDependencies as D}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as H,LengthDimensionPointManipulator as j,pointManipulatorHandles as T,createOffsetManipulator as x,offsetManipulatorHandles as G,LineOfSightOrientationManipulator as z,headingManipulatorHandles as U,rotationManipulatorHandles as R,createMeasureTypeManipulator as I,measureTypeManipulatorHandles as V,updateOffsetManipulatorTransform as A,updateHeadingManipulatorTransform as E,updateRotationManipulatorTransform as k,updateMeasureTypeManipulatorTransform as L,unfocusedOffsetWidth as F,focusedOffsetWidth as q}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as B,arePointsVerticallyAligned as N,computationToGeometryDependencies as J,computeGeometryFromDimension as K}from"./lengthDimensionUtils.js";import{disabledPointColor as Q,pointRadius as W,getTransparentAccentColor as X,getContrastColor as Y,initialOffsetPx as Z}from"./settings.js";import{getRotateHeadingTexture as $}from"../images/Factory.js";import{SnappingVisualizer3D as tt}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as et}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as it}from"../../interactive/visualElements/VerticesVisualElement.js";import{ImageMaterial as at}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as nt}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends a{constructor(t){super(t),this._stagedDimension=null,this._snappingManagerResult=null,this._computationManipulators=new Map,this._computationHandles=new n,this._updatingHandles=new S,this._getSnappingContext=d(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new tt}));const{view:i}=t;this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(i),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:nt(2)}),this._constraintSnappingIndicator=new et({view:i,attached:!0,width:1,renderOccluded:4,stipplePattern:nt(5),isDecoration:!0});const a=e.toUnitRGBA(Q);this._stagedStartIndicator=new it({view:i,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:a,size:2*W,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const i=X(t.effectiveTheme),a=Y(t.effectiveTheme),n=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial=new at({draped:!1,managedTexture:this._textureHandle.managedTexture,writeDepth:!1,renderOccluded:16,isDecoration:!0});const o=p(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([m(()=>({accentColor:X(t.effectiveTheme),contrastColor:Y(t.effectiveTheme)}),({accentColor:i,contrastColor:a})=>{const s=this._textureHandle;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({managedTexture:this._textureHandle.managedTexture}),s?.release();const o=e.toUnitRGBA(i);this._unfocusedOffsetManipulatorMaterial.setParameters({color:o}),this._focusedOffsetManipulatorMaterial.setParameters({color:o}),this._thinOffsetManipulatorMaterial.setParameters({color:o}),this._constraintSnappingIndicator.color=o},h),s(o),m(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=w(t,new C);this._applyPointUpdate(e,{endPoint:i})},g),m(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:a,firstGrabbedManipulator:n}=t;if(i===e?.stagedDimension&&n===e?.firstGrabbedManipulator){for(const s of[a,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},f),m(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),h),m(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),m(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=y();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(c(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",a=this._computeConstraint(t);b(t,i,{constraint:a,view:this.view})}}})}destroy(){this._textureHandle=l(this._textureHandle),this._snappingOperation=u(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),this._orientationManipulatorMaterial.dispose()}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager?.options}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){return this._snappingManagerResult||(this._snappingManagerResult=dt(this.view),this.addHandles(this._snappingManagerResult)),this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[_(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...f,equals:r}),m(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:a}=t;switch(a.previousConstraint){case 0:a.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:a.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:a.preConstraintProperties={measureType:"direct",orientation:i};break;default:a.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},g)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[m(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const a=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)a.attached=!0;else{const{start:e,end:n}=this._computationManipulators.get(i),s=()=>{a.attached=e.grabbing||n.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),n.events.on("grab-changed",s)],t)}else a.attached=!1}),m(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.addPromise(c(this._snappingOperation.snap({point:t},this._ensureSnappingManager(),i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:e}){let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._ensureSnappingManager().update({point:t,context:i})}const n=new i({startPoint:w(a,new C),endPoint:null,measureType:"horizontal"});return this._stagedDimension=n,this._resetSnappingState(),n}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._ensureSnappingManager().update({point:t,context:i})}const n=w(a,new C);this._applyPointUpdate(i,{endPoint:n}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._ensureSnappingManager().doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),a=this._setupOffsetManipulator(t),n=this._setupHeadingManipulator(t),s=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new H({start:e,end:i,offset:a,heading:n,rotation:s,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=o(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([m(()=>t.geometry,()=>this._updateManipulators(t,e),{...f,equals:r})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:a}=t,n=new j(i,{metadata:a}),s=T(n,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:a,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),n}_setupOffsetManipulator(t){const{view:e}=this,i=x(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),a=G(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=U(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=R(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,a=I(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),n=V(a,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(n,t),a}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:a,selectedComputation:n,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=n===t,c=B(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==a&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);N(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;A(p,h,g),l.available&&E(l,t,g),u.available&&k(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&L(e,t,i,g)})}_updateManipulatorStyle(t){const e=F(t),i=q(t),a={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:n,heading:s,rotation:o}of this._computationManipulators.values())n.radius=i/2,s.update(a),o.update(a);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,a=J(t);"startPoint"in e&&(a.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(a.elevationAlignedEndPoint=e.endPoint);const n=K(a,i.renderCoordsHelper);if(null==n)return;const s=this._computeConstraint({...a,geometry:n});P(t,e,{...a,constraint:s,unconstrainedGeometry:n,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,a=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Z*a*i.unitInMeters}_computeConstraint(t){return O(D(t,this._ensureSnappingManager().options),this.view)}_createOffsetManipulatorMaterial(t){return new st({width:1,renderOccluded:4,writeDepth:!1,hasPolygonOffset:!0,isDecoration:!0},t.state.isGlobal)}get test(){}};t([M({constructOnly:!0})],ht.prototype,"analysis",void 0),t([M({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([M({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([M({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([M({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([M({readOnly:!0})],ht.prototype,"updating",null),t([M()],ht.prototype,"firstGrabbedManipulator",null),t([M()],ht.prototype,"hasGrabbedManipulators",null),t([M()],ht.prototype,"snappingOptions",null),t([M()],ht.prototype,"_stagedDimension",void 0),t([M()],ht.prototype,"_snappingManager",null),t([M()],ht.prototype,"_activeComputation",null),t([M()],ht.prototype,"_stagedComputation",null),t([M()],ht.prototype,"_snappingManagerResult",void 0),ht=t([v("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=y();export{ht as LengthDimensionSubTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import{multiplyOpacity as t,getContrast as r}from"../../../../core/colorUtils.js";import{releaseMaybe as i}from"../../../../core/maybe.js";import{watch as o,initial as s}from"../../../../core/reactiveUtils.js";import{DidPointerMoveRecentlyFlag as l}from"./sliceToolUtils.js";import{Manipulator3D as a}from"../../interactive/Manipulator3D.js";import{rotateManipulatorDefaults as n}from"../../interactive/manipulatorUtils.js";import{RenderObject as c}from"../../interactive/RenderObject.js";import{Attribute as m}from"../../webgl-engine/lib/Attribute.js";import{Geometry as u}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as d}from"../../webgl-engine/lib/GeometryUtil.js";import{ImageMaterial as p}from"../../webgl-engine/materials/ImageMaterial.js";import{RibbonLineMaterial as f}from"../../webgl-engine/materials/RibbonLineMaterial.js";class h extends a{constructor(i,l){const a=t(i.effectiveTheme.accentColor,.5),c=r(i.effectiveTheme.accentColor),m=l(a,c),u=new p({draped:!1,texture:m.texture,writeDepth:!1,renderOccluded:16,isDecoration:!0}),d=n.calloutWidth,h=new f({width:d,renderOccluded:4,isDecoration:!0},i.state.isGlobal);super({view:i,...w({imageMaterial:u,calloutMaterial:h})}),this._material=u,this._textureHandle=m,this._themeHandle=o(()=>i.effectiveTheme.accentColor,i=>{const o=t(i,.5),s=r(i),a=this._textureHandle;this._textureHandle=l(o,s),u.setParameters({texture:this._textureHandle.texture}),a?.release(),h.setParameters({color:e.toUnitRGBA(i)})},s)}destroy(){this._textureHandle=i(this._textureHandle),this._themeHandle.remove(),this._material.dispose(),super.destroy()}}function w({imageMaterial:e,calloutMaterial:t}){const{focusMultiplier:r,calloutLength:i,discRadius:o}=n,s=o*r,a=(e,t)=>{const r=[0,1,2,2,3,0];return new u(t,[["position",new m([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],r,3,!0)],["uv0",new m([0,0,1,0,1,1,0,1],r,2,!0)]])},p=d(t,[[0,0,0],[i-o,0,0]]),f=d(t,[[0,0,0],[i-s,0,0]]),h=l;return{autoScaleRenderObjects:!1,collisionPriority:1,collisionType:{type:"disc",direction:[0,0,1],offset:[i,0,0]},focusMultiplier:r,radius:o,renderObjects:[new c(a(o,e),1|h),new c(p,1|h),new c(a(s,e),2|h),new c(f,2|h)],state:h}}export{h as RotateManipulator};
5
+ import e from"../../../../Color.js";import{multiplyOpacity as t,getContrast as r}from"../../../../core/colorUtils.js";import{releaseMaybe as i}from"../../../../core/maybe.js";import{watch as o,initial as a}from"../../../../core/reactiveUtils.js";import{DidPointerMoveRecentlyFlag as s}from"./sliceToolUtils.js";import{Manipulator3D as l}from"../../interactive/Manipulator3D.js";import{rotateManipulatorDefaults as n}from"../../interactive/manipulatorUtils.js";import{RenderObject as m}from"../../interactive/RenderObject.js";import{Attribute as c}from"../../webgl-engine/lib/Attribute.js";import{Geometry as d}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as u}from"../../webgl-engine/lib/GeometryUtil.js";import{ImageMaterial as p}from"../../webgl-engine/materials/ImageMaterial.js";import{RibbonLineMaterial as f}from"../../webgl-engine/materials/RibbonLineMaterial.js";class h extends l{constructor(i,s){const l=t(i.effectiveTheme.accentColor,.5),m=r(i.effectiveTheme.accentColor),c=s(l,m),d=new p({draped:!1,managedTexture:c.managedTexture,writeDepth:!1,renderOccluded:16,isDecoration:!0}),u=n.calloutWidth,h=new f({width:u,renderOccluded:4,isDecoration:!0},i.state.isGlobal);super({view:i,...g({imageMaterial:d,calloutMaterial:h})}),this._material=d,this._textureHandle=c,this._themeHandle=o(()=>i.effectiveTheme.accentColor,i=>{const o=t(i,.5),a=r(i),l=this._textureHandle;this._textureHandle=s(o,a),d.setParameters({managedTexture:this._textureHandle.managedTexture}),l?.release(),h.setParameters({color:e.toUnitRGBA(i)})},a)}destroy(){this._textureHandle=i(this._textureHandle),this._themeHandle.remove(),this._material.dispose(),super.destroy()}}function g({imageMaterial:e,calloutMaterial:t}){const{focusMultiplier:r,calloutLength:i,discRadius:o}=n,a=o*r,l=(e,t)=>{const r=[0,1,2,2,3,0];return new d(t,[["position",new c([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],r,3,!0)],["uv0",new c([0,0,1,0,1,1,0,1],r,2,!0)]])},p=u(t,[[0,0,0],[i-o,0,0]]),f=u(t,[[0,0,0],[i-a,0,0]]),h=s;return{autoScaleRenderObjects:!1,collisionPriority:1,collisionType:{type:"disc",direction:[0,0,1],offset:[i,0,0]},focusMultiplier:r,radius:o,renderObjects:[new m(l(o,e),1|h),new m(p,1|h),new m(l(a,e),2|h),new m(f,2|h)],state:h}}export{h as RotateManipulator};