@arcgis/core 6.0.0-next.20 → 6.0.0-next.21

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 (120) hide show
  1. package/arcgisGlobal.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0049b66ccbfb168caa76.js +1 -0
  4. package/assets/esri/core/workers/chunks/17c6d66b47aa690df0d4.js +1 -0
  5. package/assets/esri/core/workers/chunks/{564565246dae080f5e6c.js → 1f6b601147521a42e65c.js} +1 -1
  6. package/assets/esri/core/workers/chunks/25d14874198773d2d836.js +1 -0
  7. package/assets/esri/core/workers/chunks/{00d66e3fba5ab4d2aa3c.js → 461e63a0f436c41a9f4a.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{8a485130781b49dbf608.js → 601e1d020b8115497944.js} +1 -1
  9. package/assets/esri/core/workers/chunks/728837812940d7f2ef43.js +1 -0
  10. package/assets/esri/core/workers/chunks/{9401cc22373566e1171e.js → 8a7b02037151767542f1.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{9fab290090ef2ccae810.js → 9e0559cd0bb01a0ed9d7.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{597db9c90f19092d8d66.js → a0c9e3f8b7d55d6dc1d5.js} +10 -10
  13. package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +1 -0
  14. package/assets/esri/core/workers/chunks/{9d61740ef8bdcc162be1.js → a8df3f59728f841b608e.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{28b74bc77f7c13080074.js → be97a629e2ae4d13ceb3.js} +1 -1
  16. package/assets/esri/core/workers/chunks/db9921fbda556f142c4a.js +1 -0
  17. package/assets/esri/core/workers/chunks/{612104dff305ff062dfa.js → dfc81e66196c402f39b4.js} +2 -2
  18. package/assets/esri/core/workers/chunks/{a34b3d2e11a777e1ff3f.js → f28b63c1179366dac8a2.js} +1 -1
  19. package/chunks/DefaultMaterial.glsl.js +1 -1
  20. package/chunks/RealisticTree.glsl.js +1 -1
  21. package/chunks/RibbonLine.glsl.js +113 -121
  22. package/config.d.ts +62 -34
  23. package/config.js +1 -1
  24. package/core/workers/Connection.d.ts +58 -89
  25. package/core/workers.d.ts +45 -54
  26. package/kernel.js +1 -1
  27. package/layers/FeatureLayer.d.ts +7 -5
  28. package/layers/FeatureLayer.js +1 -1
  29. package/layers/GeospatialPDFLayer.js +1 -1
  30. package/layers/MapImageLayer.d.ts +9 -3
  31. package/layers/MapNotesLayer.d.ts +2 -2
  32. package/layers/SubtypeGroupLayer.d.ts +1 -1
  33. package/layers/SubtypeGroupLayer.js +1 -1
  34. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
  35. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  36. package/layers/graphics/sources/support/QueryTask.js +1 -1
  37. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +16 -16
  38. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  39. package/layers/mixins/ArcGISMapService.js +1 -1
  40. package/layers/ogc/ogcFeatureUtils.js +1 -1
  41. package/layers/support/Sublayer.d.ts +29 -15
  42. package/layers/support/Sublayer.js +1 -1
  43. package/layers/support/commonProperties.js +1 -1
  44. package/package.json +3 -3
  45. package/rest/layerSources/DynamicDataLayer.d.ts +4 -2
  46. package/rest/layerSources/DynamicDataLayer.js +1 -1
  47. package/rest/layerSources/DynamicMapLayer.d.ts +1 -1
  48. package/rest/layerSources/DynamicWorkspaceLayer.d.ts +45 -0
  49. package/rest/layerSources/DynamicWorkspaceLayer.js +2 -0
  50. package/rest/layerSources/typeUtils.js +2 -0
  51. package/rest/print.js +1 -1
  52. package/rest/query/operations/queryRelatedRecords.js +1 -1
  53. package/rest/query/operations/queryUtils.js +1 -1
  54. package/rest/support/Query.js +1 -1
  55. package/rest/support/RelationshipQuery.js +1 -1
  56. package/symbols/LineSymbol3D.d.ts +5 -3
  57. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +6 -0
  58. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  59. package/views/2d/layers/AnnotationFeatureLayerView2D.js +1 -1
  60. package/views/2d/layers/CSVLayerView2D.js +1 -1
  61. package/views/2d/layers/CatalogFootprintLayerView2D.js +1 -1
  62. package/views/2d/layers/DimensionFeatureLayerView2D.js +1 -1
  63. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  64. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  65. package/views/2d/layers/GeoJSONLayerView2D.js +1 -1
  66. package/views/2d/layers/KnowledgeGraphSublayerView2D.js +1 -1
  67. package/views/2d/layers/OGCFeatureLayerView2D.js +1 -1
  68. package/views/2d/layers/OrientedImageryLayerView2D.js +1 -1
  69. package/views/2d/layers/ParquetLayerView2D.js +1 -1
  70. package/views/2d/layers/StreamLayerView2D.js +1 -1
  71. package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
  72. package/views/2d/layers/WFSLayerView2D.js +1 -1
  73. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  74. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  75. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  76. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  77. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  78. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +6 -0
  79. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  80. package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
  81. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  82. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  83. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
  84. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  85. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  86. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  87. package/views/3d/interactive/manipulators/ResizeManipulator.js +1 -1
  88. package/views/3d/interactive/manipulators/RotateManipulator.js +1 -1
  89. package/views/3d/interactive/manipulators/ShiftManipulator.js +1 -1
  90. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  91. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  92. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  93. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  94. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  95. package/views/3d/layers/FlowSubView3D.js +1 -1
  96. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  97. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  98. package/views/3d/support/elevationUpdateUtils.js +1 -1
  99. package/views/3d/terrain/TerrainData.js +1 -1
  100. package/views/3d/terrain/terrainUtils.js +1 -1
  101. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +2 -2
  102. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +3 -3
  103. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +2 -2
  104. package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +2 -2
  105. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  106. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  107. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  108. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  109. package/views/BreakpointsOwner.d.ts +6 -0
  110. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  111. package/views/types.d.ts +3 -0
  112. package/views/ui/UI.js +1 -1
  113. package/views/webgl/ShaderBuilder.js +1 -1
  114. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  115. package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +0 -1
  116. package/assets/esri/core/workers/chunks/370aad23df597db80d65.js +0 -1
  117. package/assets/esri/core/workers/chunks/510502a4c9a2ba8d3f7b.js +0 -1
  118. package/assets/esri/core/workers/chunks/6ad309154fe84210d23c.js +0 -1
  119. package/assets/esri/core/workers/chunks/a49fe94933b65b4b64f8.js +0 -1
  120. package/assets/esri/core/workers/chunks/e8bf653376a607f00897.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{distance as i,normalize as a,subtract as o,copy as s,exactEquals as c,add as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,ZEROS as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as f}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as h}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as g}from"./EngineVisualElement.js";import{drapedZ as _}from"../../terrain/DrapedZ.js";import{Attribute as v}from"../../webgl-engine/lib/Attribute.js";import{Geometry as y}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as b}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as x}from"../../webgl-engine/lib/RenderGeometry.js";import{ColorMaterial as S}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as C}from"../../webgl-engine/materials/RibbonLineMaterial.js";class w extends g{constructor(e){super(e),this._maxSize=0,this._position=u(),this._up=u(),this._right=u(),this._renderOccluded=4,this._color=p(1,0,0,1),this._outlineColor=p(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=16,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D(),forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:T,forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get transparentRenderOrder(){return this._transparentRenderOrder}set transparentRenderOrder(e){this._transparentRenderOrder=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get color(){return this._color}set color(e){f(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){f(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){let t=this._outlineSize===0!=(e===0);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:n}){this._maxSize=Math.min(i(t,e),i(t,n))/3,a(this._up,o(this._up,e,t)),a(this._right,o(this._right,n,t)),s(this._position,t),this.recreateGeometry()}_createObject3DResources(e){let t=new S(this._quadMaterialParameters),n=this._outlineSize===0?void 0:new C(this._outlineMaterialParameters,this.view.state.isGlobal);return this._createObject3DGeometries(e,t,n),{quadMaterial:t,outlineMaterial:n}}_createObject3DGeometries(e,t,n){if(c(this._up,d)&&c(this._right,d))return;let r=this._createGeometries(t,n);for(let t of r)e.addGeometry(t);this._updateTransformObject3D(e)}_createDrapedResources(){let t=new S(this._quadMaterialParameters),n=this._outlineSize===0?void 0:new C(this._outlineMaterialParameters,this.view.state.isGlobal),r=this._createGeometries(t,n).map(e=>new x(e));return this._setTransformDraped(r),{quadMaterial:t,outlineMaterial:n,geometries:r,pixelRatioHandle:e(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry())}}_createGeometries(e,t){let{up:n,right:r,corner:i}=this._getVertices(),a=E(n,r,i,e);return t?[a,b(t,[n,i,r])]:[a]}_getVertices(){let e=this._up,t=this._right,n=l(m.get(),e,t);return this.isDraped&&(e=s(m.get(),e),t=s(m.get(),t),e[2]=0,t[2]=0,n[2]=0),{up:e,right:t,corner:n}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;let r=this.view.state.camera,i=this._size*r.computeScreenPixelSizeAt(this._position),a=Math.min(this._maxSize,i);t(D,this._position),n(D,D,[a,a,a]),e.transformation=D}_setTransformDraped(e){if(e.length===0)return;let{view:{overlayManager:r,state:{contentPixelRatio:i}}}=this,{_position:a,_size:o}=this,c=s(m.get(),a);c[2]=_;let l=O;l.spatialReference=r.spatialReference,l.x=c[0],l.y=c[1];let u=o*(this.view.overlayPixelSizeInMapUnits(l)*i),d=Math.min(this._maxSize,u);t(D,c),n(D,D,[d,d,1]);for(let t of e)t.transformation=D}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:1,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration,testsTransparentRenderOrder:this._transparentRenderOrder}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}function T(e){e.pixelRatioHandle.remove(),e.geometries=[]}function E(e,t,n,r){return new y(r,[[`position`,new v([0,0,0,...t,...e,...n],[0,1,2,1,2,3],3,!0)]])}const D=r(),O=h(0,0,void 0,null);export{w as RightAngleQuadVisualElement};
2
+ import{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{distance as i,normalize as a,subtract as o,copy as s,exactEquals as c,add as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,ZEROS as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as f}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as h}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as g}from"./EngineVisualElement.js";import{drapedZ as _}from"../../terrain/DrapedZ.js";import{Attribute as v}from"../../webgl-engine/lib/Attribute.js";import{Geometry as y}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as b}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as x}from"../../webgl-engine/lib/RenderGeometry.js";import{ColorMaterial as S}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as C}from"../../webgl-engine/materials/RibbonLineMaterial.js";class w extends g{constructor(e){super(e),this._maxSize=0,this._position=u(),this._up=u(),this._right=u(),this._renderOccluded=4,this._color=p(1,0,0,1),this._outlineColor=p(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=16,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D(),forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:T,forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get transparentRenderOrder(){return this._transparentRenderOrder}set transparentRenderOrder(e){this._transparentRenderOrder=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get color(){return this._color}set color(e){f(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){f(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){let t=this._outlineSize===0!=(e===0);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:n}){this._maxSize=Math.min(i(t,e),i(t,n))/3,a(this._up,o(this._up,e,t)),a(this._right,o(this._right,n,t)),s(this._position,t),this.recreateGeometry()}_createObject3DResources(e){let t=new S(this._quadMaterialParameters),n=this._outlineSize===0?void 0:new C(this._outlineMaterialParameters,this.view);return this._createObject3DGeometries(e,t,n),{quadMaterial:t,outlineMaterial:n}}_createObject3DGeometries(e,t,n){if(c(this._up,d)&&c(this._right,d))return;let r=this._createGeometries(t,n);for(let t of r)e.addGeometry(t);this._updateTransformObject3D(e)}_createDrapedResources(){let t=new S(this._quadMaterialParameters),n=this._outlineSize===0?void 0:new C(this._outlineMaterialParameters,this.view),r=this._createGeometries(t,n).map(e=>new x(e));return this._setTransformDraped(r),{quadMaterial:t,outlineMaterial:n,geometries:r,pixelRatioHandle:e(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry())}}_createGeometries(e,t){let{up:n,right:r,corner:i}=this._getVertices(),a=E(n,r,i,e);return t?[a,b(t,[n,i,r])]:[a]}_getVertices(){let e=this._up,t=this._right,n=l(m.get(),e,t);return this.isDraped&&(e=s(m.get(),e),t=s(m.get(),t),e[2]=0,t[2]=0,n[2]=0),{up:e,right:t,corner:n}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;let r=this.view.state.camera,i=this._size*r.computeScreenPixelSizeAt(this._position),a=Math.min(this._maxSize,i);t(D,this._position),n(D,D,[a,a,a]),e.transformation=D}_setTransformDraped(e){if(e.length===0)return;let{view:{overlayManager:r,state:{contentPixelRatio:i}}}=this,{_position:a,_size:o}=this,c=s(m.get(),a);c[2]=_;let l=O;l.spatialReference=r.spatialReference,l.x=c[0],l.y=c[1];let u=o*(this.view.overlayPixelSizeInMapUnits(l)*i),d=Math.min(this._maxSize,u);t(D,c),n(D,D,[d,d,1]);for(let t of e)t.transformation=D}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:1,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration,testsTransparentRenderOrder:this._transparentRenderOrder}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,testsTransparentRenderOrder:this._transparentRenderOrder,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}function T(e){e.pixelRatioHandle.remove(),e.geometries=[]}function E(e,t,n,r){return new y(r,[[`position`,new v([0,0,0,...t,...e,...n],[0,1,2,1,2,3],3,!0)]])}const D=r(),O=h(0,0,void 0,null);export{w as RightAngleQuadVisualElement};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as n,abortMaybe as r}from"../../../core/maybe.js";import{debounce as i,throwIfAborted as a,ignoreAbortErrors as o}from"../../../core/promiseUtils.js";import{watch as s,sync as c,when as l,whenOnce as ee}from"../../../core/reactiveUtils.js";import{addFrameTask as u}from"../../../core/scheduling.js";import{signal as d}from"../../../core/signal.js";import{Seconds as f,secondsFromMilliseconds as te}from"../../../core/time.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{projectOrLoad as h}from"../../../geometry/projectionUtils.js";import ne from"../../../geometry/SpatialReference.js";import{toExtent as g,fromExtent as _,intersection as re,create as ie,intersects as v}from"../../../geometry/support/aaBoundingRect.js";import{isInEffectiveScaleRange as y}from"../../../geometry/support/scaleUtils.js";import{getInfo as b}from"../../../geometry/support/spatialReferenceUtils.js";import x from"../../../symbols/support/ElevationInfo.js";import S from"./SubView3D.js";import{getFeatureTileId as C}from"./support/FeatureTileDescriptor.js";import{makeScheduleFunction as w}from"./support/makeScheduleFunction.js";import{debugFlags as T}from"../support/debugFlags.js";import{tileFilterDistance as E,scaleThresholdForLoadingAllTiles as D,defaultTransitionDuration as O,transitionDurationFactor as k,seamlessTransitionEnabled as A,densityFactor as j,loadAllTilesDensityFactor as M,averageLoadingTimeSmoothingFactor as N,fadeOutTime as P,fadeInTime as F,minimumTracingResolution as I}from"../support/flow/constants.js";import{isFullExtent as L,wrappedWidth as ae,FlowQuery3D as R}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as z}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as B,createStreamlineGeometry as V}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as H}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as U}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as W}from"../support/flow/StreamlineResources3DShape.js";import{webMercatorWorldExtent as G}from"../terrain/TerrainConst.js";import{descendantsAtLevel as K,tilesAreRelated as q}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as J}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as oe}from"../webgl-engine/materials/RibbonLineMaterial.js";import{hasLayerBasedScaleVisibility as se}from"../../support/layerViewUtils.js";import{TaskPriority as ce}from"../../support/Scheduler.js";import{simulationSettingsEqual as le,getPositions as ue,getFlowSimulationSettings as Y}from"../../support/flow/utils.js";let X=class extends S{constructor(e){super(e),this.type=`flow`,this.renderedTiles=null,this.tilesIntersectDataBounds=!0,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=f(0),this._abortController=null,this._loadingState=`ready-to-load`,this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=d(!0),this.emissiveStrength=0,this._materialParametersOverridde=null,this._suspendedOverride=null,this._simulationSettingsOverride=null,this._seamlessTransitionEnabledOverride=null,this._updateTask=null,this._debouncedTileUpdate=i(async e=>{let{allTiles:t}=this.surface,n=this._getTileFilterFunction(),{_dataBounds:r}=this,i=new Set,o=!1;function*s(e){for(let a=0;a<t.length;++a){let s=t.at(a),c=Z(r,s.extent);n(s)&&c&&(i.add(s),o=!0),e.madeProgress(),e.done&&(e=yield)}}await this.frameTask.scheduleGenerator(s,e.signal),a(e.signal),this.tilesIntersectDataBounds=t.length===0||this.loadAllTiles?!0:o,this.renderedTiles=i})}initialize(){let{surface:e,view:t}=this,{resourceController:n}=t;this.workerHandle=new z(w(n)),this.frameTask=n.scheduler.registerTask(ce.FLOW_GENERATOR),this._updateTask=u({update:()=>this._update()}),this.addHandles([s(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>e==null&&t==null||e!=null&&t!=null&&le(e,t)}),this.updatingHandles.add(()=>this.suspended,e=>{e?this._suspend():this._resume()},c),s(()=>{let{elevationInfo:e}=this;return[this._clippingArea,this.visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),c),l(()=>!this._animationsEnabled,()=>{let{_resources:e,_lastResources:t}=this;e!=null&&(e.startTime=Q),t!=null&&(t.startTime=Q)},c),s(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),l(()=>e.allTilesCreated,()=>this._triggerTilesUpdate(),c),t.enableFeatureTiles(),s(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),s(()=>this._flowRenderer,(e,t)=>{let n=t?.visualVariables??[],r=e?.visualVariables??[];r.length===n.length&&r.every((e,t)=>e.type===n[t].type)||this.clear()}),l(()=>!t.featureTiles?.updating,()=>{this._triggerTilesUpdate()})]),this.suspended&&this._suspend(),this._triggerTilesUpdate()}destroy(){this._updateTask=n(this._updateTask),this.abort(),this.clear(),this.notifyChange(`updating`)}abort(){this._abortController=r(this._abortController),this._tilesUpdateIsWaiting=!1,this.requireLoad=!1}_ensureAbortController(){return this._abortController??=new AbortController,this._abortController}_resume(){this._updateTask.resume(),this._triggerTilesUpdate(),this.triggerLoad()}_suspend(){this._updateTask.pause(),this.abort(),this.clear()}get _animationsEnabled(){return this.view.state.animationsEnabled}get _clippingArea(){let e=h(this.view.clippingArea,this.surface.spatialReference).geometry;return e==null?null:_(e)}get _dataBounds(){let e=this._fullExtentSurfaceSpatialReference;return e==null?null:_(e)}get suspended(){return this._suspendedOverride==null?this.layerView.suspended||this.view.groundView.hasTerrainReplacement:this._suspendedOverride}get _fullExtentSurfaceSpatialReference(){return h(this.layer.fullExtent,this.surface.spatialReference).geometry}get _draped(){return this.elevationInfo.mode===`on-the-ground`}get extent(){if(this.loadAllTiles)return $(this._fullExtentSurfaceSpatialReference);let{spatialReference:e}=this.surface,t=this.renderedTiles;if(e==null||t==null)return null;let n=this.view.terrainLevel;if(n!=null){let e=new Set;t.forEach(t=>{Math.abs(n-t.level)<E&&e.add(t)}),t=e}let r=H(t,this.spatialReferenceInfo);return r==null?null:(re(r,this._clippingArea,r),$(g(r,e)))}get loadAllTiles(){return this.view.scale>(T.FLOW_GLOBAL_SCALE_THRESHOLD??D)}get isDataGlobal(){let{extent:e,spatialReferenceInfo:t}=this;return e!=null&&L(e.xmin,e.xmax,t)}get loadAllTilesLevel(){let{tilingScheme:e}=this.surface;return Math.min(Math.ceil(e.levelAtScale(T.FLOW_GLOBAL_SCALE_THRESHOLD??D)),e.getMaxLod())}get targetTiles(){let e=new Map;if(this.loadAllTiles){let{_dataBounds:t}=this;if(t==null)return e;let n=ie(),r=this.loadAllTilesLevel,i=this.surface.tilingScheme,a=i.rootTilesInExtent(t).values().flatMap(e=>K(e,r));for(let o of a){let[a,s,c]=o;i.getExtent(r,s,c,n),Z(t,n)&&e.set(C(r,s,c),o)}return e}let{renderedTiles:t}=this;for(let n of t??[])e.set(n.key,n.lij);return e}get _featureTilesBounds(){let e=this.view.featureTiles?.filterExtent,t=h(e,this.surface.spatialReference).geometry;return t==null?null:_(t)}get _flowRenderer(){let e=this.layer.renderer;return e?.type===`flow`?e:null}get _materialParameters(){return{...B(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),...this._materialParametersOverridde,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&`screenSizePerspectiveEnabled`in this.layer&&J(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){let{_averageLoadingTime:e}=this;return f(e===0?O:this._averageLoadingTime*k)}get _transitionEnabled(){return this.view.qualitySettings.flow.transitionEnabled}get _seamlessTransitionEnabled(){return this._transitionEnabled?this._seamlessTransitionEnabledOverride==null?A:this._seamlessTransitionEnabledOverride:!1}get _tracingResolution(){let{extent:e}=this;if(!e)return[0,0];let t=ae(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[n,r]=this.view.size,i,a;n<r?(i=n,a=n/t):(i=r*t,a=r);let o=I,s=this.view.qualitySettings.flow.maxTracingResolution,c=Math.max(1,o/Math.min(i,a)),l=c*Math.min(1,s/Math.max(i*c,a*c));return[Math.round(i*l),Math.round(a*l)]}get visible(){let e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(e==null||e.a>0)}get _effectiveDensity(){let{_simulationSettings:e}=this;if(e==null)return 0;let t=e.density*this.view.quality;return e.lineSpacing/Math.sqrt(t)<e.lineCollisionWidth?(e.lineSpacing/e.lineCollisionWidth)**2:t}get elevationInfo(){return(`elevationInfo`in this.layer?this.layer.elevationInfo:void 0)??fe}startPositions(e){if(!this._seamlessTransitionEnabled)return[];let{_flowRenderer:t,_resources:n}=this;return t==null||n==null?[]:ue(n.streamlines,n.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return b(this.surface.spatialReference)}get loadingState(){return this._loadingState}get loadRequirementsMet(){return this.renderedTiles!=null&&(this.renderedTiles.size>0||this.loadAllTiles)&&this.extent!=null}hasWork(){return this.updatingHandles.updating||this.requireLoad||this._loadingState===`before-transition`}get updating(){return this._debugAllowAutoLoading.value&&this.visible&&!(this.destroyed||this.destroying)&&this.hasWork()}get visibleAtCurrentScale(){return!se()||y(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){let{_flowRenderer:e,_simulationSettingsOverride:t}=this;if(e==null)return null;let n=Y(e);return n.segmentLength=n.lineCollisionWidth/2,n.onlyForwardTracing=!1,n.maxNumberOfStreamlines=this.view.qualitySettings.flow.maxTotalNumberOfStreamlines,n.density*=j,this.loadAllTiles&&this.isDataGlobal&&(n.density*=M),t!=null&&(n={...n,...t}),n}getSimulationSettings(e){let{_simulationSettings:t,spatialReferenceInfo:n}=this;if(t==null)return null;let r=this.view.viewingMode===`global`&&n!=null&&L(e.extent.xmin,e.extent.xmax,n);return{...t,wrapAround:r,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this.tilesIntersectDataBounds=!0,this._loadingState=`ready-to-load`}_update(){let e=this._time;this._lastResources?.hasFadedOut(e)&&this._lastResources.detach();let t=this._nextStateForTransition(e);!this.requireLoad||this.updatingHandles.updating||t!==`ready-to-load`||!this.loadRequirementsMet?(this._loadingState=t,this.tilesIntersectDataBounds||(this.requireLoad=!1)):(this._loadingState=`loading`,this.updatingHandles.consumePromise(o((async()=>{let t=this._time,n=this._seamlessTransitionEnabled&&this._resources!=null?f(e+this._seamlessTransitionWaitingTime):e;await this._load(n);let r=f((this._time-t)/1e3);this._updateAverageLoadingTime(r)})())),this.requireLoad=!1)}_updateAverageLoadingTime(e){let t=N;this._averageLoadingTime=f(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){!this.suspended&&this._debugAllowAutoLoading.value&&(this.visible?this.requireLoad=!0:this.clear())}get _time(){return te(this.layerView.view.stage.renderer.renderContext.time)}async _load(e){let{extent:t,view:n}=this;if(!this.visible){this.clear();return}if(t==null){this._loadingState=`ready-to-load`;return}this._transitionEnabled||(this._lastResources?.detach(),this._lastResources=null,this._resources?.detach(),this._resources=null);let r=new R(t,this.layerView.timeExtent,this._tracingResolution,n.state.contentPixelRatio,e),i=this._ensureAbortController();try{let t=await this._loadStreamlines(r,i.signal);if(a(i.signal),t!=null){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=t;let n=this._getStartTime(e);this._lastResources!=null&&(this._lastResources.endTime=n),this._resources.startTime=n,this._animationsEnabled||(this._lastResources?.detach(),this._lastResources=null),await t.attach(),this.suspended&&this.clear(),a(i.signal),this._loadingState=this._seamlessTransitionEnabled?`before-transition`:`transitioning`}else this._loadingState=`ready-to-load`}catch{this._loadingState=`ready-to-load`}}async _loadStreamlines(e,t){let n=await this.fetchDataAndGenerateStreamlines(e,t);if(n==null)return null;let{geometries:r,material:i}=await this._createGeometry(e,n,t);return this._draped?new U(e,n,i,r,this.layerView):new W(e,n,i,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t,n){let r=new oe(this._materialParameters,this.view.state.isGlobal),i=[],{elevationInfo:o,_draped:s,view:c}=this;function*l(n){for(let a=0;a<t.length;++a)i.push(V(c,e,t[a],o,r,s)),n.madeProgress(),n.done&&(n=yield)}return await this.frameTask.scheduleGenerator(l,n),a(n),{geometries:i,material:r}}_triggerTilesUpdate(){if(this.suspended||this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;let e=this._ensureAbortController();this.updatingHandles.consumePromise(o((async()=>{try{await ee(()=>this.view.stationary),a(e.signal),await this._debouncedTileUpdate(e)}finally{this._tilesUpdateIsWaiting=!1}})()))}_getTileFilterFunction(){let{view:e,_featureTilesBounds:n,loadAllTiles:r}=this;if(r){let{loadAllTilesLevel:e}=this;return t=>t.level===e}let i=e=>e.rendered&&e.visible,{featureTiles:a}=e;if(!a)return i;let o=a.tiles.filter(e=>e.measures.visible);return e=>i(e)&&Z(n,e.extent)&&o.some(({lij:n})=>t(n,e.lij)||q(n,e.lij))}_nextStateForTransition(e){let{_resources:t}=this;if(this._flowRenderer==null||t==null||this._loadingState===`ready-to-load`||this._loadingState===`loading`)return this._loadingState;let n=t.startTime,r=n+P;return e<n?`before-transition`:e<r?`transitioning`:`ready-to-load`}_getStartTime(e){if(!this._animationsEnabled)return Q;let t=this._time;return f(t>e?t:e)}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([p()],X.prototype,`type`,void 0),e([p()],X.prototype,`renderedTiles`,void 0),e([p()],X.prototype,`_resources`,void 0),e([p()],X.prototype,`_lastResources`,void 0),e([p()],X.prototype,`tilesIntersectDataBounds`,void 0),e([p()],X.prototype,`requireLoad`,void 0),e([p()],X.prototype,`_averageLoadingTime`,void 0),e([p()],X.prototype,`_loadingState`,void 0),e([p()],X.prototype,`emissiveStrength`,void 0),e([p()],X.prototype,`_animationsEnabled`,null),e([p()],X.prototype,`_clippingArea`,null),e([p()],X.prototype,`_dataBounds`,null),e([p()],X.prototype,`suspended`,null),e([p()],X.prototype,`_fullExtentSurfaceSpatialReference`,null),e([p()],X.prototype,`_draped`,null),e([p()],X.prototype,`extent`,null),e([p()],X.prototype,`loadAllTiles`,null),e([p()],X.prototype,`isDataGlobal`,null),e([p()],X.prototype,`loadAllTilesLevel`,null),e([p()],X.prototype,`targetTiles`,null),e([p()],X.prototype,`_featureTilesBounds`,null),e([p()],X.prototype,`_flowRenderer`,null),e([p()],X.prototype,`_materialParameters`,null),e([p()],X.prototype,`_opacity`,null),e([p()],X.prototype,`_seamlessTransitionWaitingTime`,null),e([p()],X.prototype,`_transitionEnabled`,null),e([p()],X.prototype,`_seamlessTransitionEnabled`,null),e([p()],X.prototype,`_tracingResolution`,null),e([p()],X.prototype,`visible`,null),e([p()],X.prototype,`_effectiveDensity`,null),e([p()],X.prototype,`elevationInfo`,null),e([p()],X.prototype,`needsMagnitude`,null),e([p()],X.prototype,`spatialReferenceInfo`,null),e([p()],X.prototype,`loadingState`,null),e([p()],X.prototype,`updating`,null),e([p()],X.prototype,`visibleAtCurrentScale`,null),e([p()],X.prototype,`_materialParametersOverridde`,void 0),e([p()],X.prototype,`_suspendedOverride`,void 0),e([p()],X.prototype,`_simulationSettingsOverride`,void 0),e([p()],X.prototype,`_seamlessTransitionEnabledOverride`,void 0),e([p()],X.prototype,`_simulationSettings`,null),e([p()],X.prototype,`surface`,null),X=e([m(`esri.views.3d.layers.FlowSubView3D`)],X);const de=X,fe=new x({mode:`on-the-ground`});function Z(e,t){return e==null||t==null||v(e,t)}const pe=g(G,ne.WebMercator),Q=f(-F);function $(e){return e!=null&&e.spatialReference.isWebMercator?e?.intersection(pe):e}export{de as default};
2
+ import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as n,abortMaybe as r}from"../../../core/maybe.js";import{debounce as i,throwIfAborted as a,ignoreAbortErrors as o}from"../../../core/promiseUtils.js";import{watch as s,sync as c,when as l,whenOnce as ee}from"../../../core/reactiveUtils.js";import{addFrameTask as u}from"../../../core/scheduling.js";import{signal as d}from"../../../core/signal.js";import{Seconds as f,secondsFromMilliseconds as te}from"../../../core/time.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{projectOrLoad as h}from"../../../geometry/projectionUtils.js";import ne from"../../../geometry/SpatialReference.js";import{toExtent as g,fromExtent as _,intersection as re,create as ie,intersects as v}from"../../../geometry/support/aaBoundingRect.js";import{isInEffectiveScaleRange as y}from"../../../geometry/support/scaleUtils.js";import{getInfo as b}from"../../../geometry/support/spatialReferenceUtils.js";import x from"../../../symbols/support/ElevationInfo.js";import S from"./SubView3D.js";import{getFeatureTileId as C}from"./support/FeatureTileDescriptor.js";import{makeScheduleFunction as w}from"./support/makeScheduleFunction.js";import{debugFlags as T}from"../support/debugFlags.js";import{tileFilterDistance as E,scaleThresholdForLoadingAllTiles as D,defaultTransitionDuration as O,transitionDurationFactor as k,seamlessTransitionEnabled as A,densityFactor as j,loadAllTilesDensityFactor as M,averageLoadingTimeSmoothingFactor as N,fadeOutTime as P,fadeInTime as F,minimumTracingResolution as I}from"../support/flow/constants.js";import{isFullExtent as L,wrappedWidth as ae,FlowQuery3D as R}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as z}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as B,createStreamlineGeometry as V}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as H}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as U}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as W}from"../support/flow/StreamlineResources3DShape.js";import{webMercatorWorldExtent as G}from"../terrain/TerrainConst.js";import{descendantsAtLevel as K,tilesAreRelated as q}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as J}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as oe}from"../webgl-engine/materials/RibbonLineMaterial.js";import{hasLayerBasedScaleVisibility as se}from"../../support/layerViewUtils.js";import{TaskPriority as ce}from"../../support/Scheduler.js";import{simulationSettingsEqual as le,getPositions as ue,getFlowSimulationSettings as Y}from"../../support/flow/utils.js";let X=class extends S{constructor(e){super(e),this.type=`flow`,this.renderedTiles=null,this.tilesIntersectDataBounds=!0,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=f(0),this._abortController=null,this._loadingState=`ready-to-load`,this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=d(!0),this.emissiveStrength=0,this._materialParametersOverridde=null,this._suspendedOverride=null,this._simulationSettingsOverride=null,this._seamlessTransitionEnabledOverride=null,this._updateTask=null,this._debouncedTileUpdate=i(async e=>{let{allTiles:t}=this.surface,n=this._getTileFilterFunction(),{_dataBounds:r}=this,i=new Set,o=!1;function*s(e){for(let a=0;a<t.length;++a){let s=t.at(a),c=Z(r,s.extent);n(s)&&c&&(i.add(s),o=!0),e.madeProgress(),e.done&&(e=yield)}}await this.frameTask.scheduleGenerator(s,e.signal),a(e.signal),this.tilesIntersectDataBounds=t.length===0||this.loadAllTiles?!0:o,this.renderedTiles=i})}initialize(){let{surface:e,view:t}=this,{resourceController:n}=t;this.workerHandle=new z(w(n)),this.frameTask=n.scheduler.registerTask(ce.FLOW_GENERATOR),this._updateTask=u({update:()=>this._update()}),this.addHandles([s(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>e==null&&t==null||e!=null&&t!=null&&le(e,t)}),this.updatingHandles.add(()=>this.suspended,e=>{e?this._suspend():this._resume()},c),s(()=>{let{elevationInfo:e}=this;return[this._clippingArea,this.visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),c),l(()=>!this._animationsEnabled,()=>{let{_resources:e,_lastResources:t}=this;e!=null&&(e.startTime=Q),t!=null&&(t.startTime=Q)},c),s(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),l(()=>e.allTilesCreated,()=>this._triggerTilesUpdate(),c),t.enableFeatureTiles(),s(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),s(()=>this._flowRenderer,(e,t)=>{let n=t?.visualVariables??[],r=e?.visualVariables??[];r.length===n.length&&r.every((e,t)=>e.type===n[t].type)||this.clear()}),l(()=>!t.featureTiles?.updating,()=>{this._triggerTilesUpdate()})]),this.suspended&&this._suspend(),this._triggerTilesUpdate()}destroy(){this._updateTask=n(this._updateTask),this.abort(),this.clear(),this.notifyChange(`updating`)}abort(){this._abortController=r(this._abortController),this._tilesUpdateIsWaiting=!1,this.requireLoad=!1}_ensureAbortController(){return this._abortController??=new AbortController,this._abortController}_resume(){this._updateTask.resume(),this._triggerTilesUpdate(),this.triggerLoad()}_suspend(){this._updateTask.pause(),this.abort(),this.clear()}get _animationsEnabled(){return this.view.state.animationsEnabled}get _clippingArea(){let e=h(this.view.clippingArea,this.surface.spatialReference).geometry;return e==null?null:_(e)}get _dataBounds(){let e=this._fullExtentSurfaceSpatialReference;return e==null?null:_(e)}get suspended(){return this._suspendedOverride==null?this.layerView.suspended||this.view.groundView.hasTerrainReplacement:this._suspendedOverride}get _fullExtentSurfaceSpatialReference(){return h(this.layer.fullExtent,this.surface.spatialReference).geometry}get _draped(){return this.elevationInfo.mode===`on-the-ground`}get extent(){if(this.loadAllTiles)return $(this._fullExtentSurfaceSpatialReference);let{spatialReference:e}=this.surface,t=this.renderedTiles;if(e==null||t==null)return null;let n=this.view.terrainLevel;if(n!=null){let e=new Set;t.forEach(t=>{Math.abs(n-t.level)<E&&e.add(t)}),t=e}let r=H(t,this.spatialReferenceInfo);return r==null?null:(re(r,this._clippingArea,r),$(g(r,e)))}get loadAllTiles(){return this.view.scale>(T.FLOW_GLOBAL_SCALE_THRESHOLD??D)}get isDataGlobal(){let{extent:e,spatialReferenceInfo:t}=this;return e!=null&&L(e.xmin,e.xmax,t)}get loadAllTilesLevel(){let{tilingScheme:e}=this.surface;return Math.min(Math.ceil(e.levelAtScale(T.FLOW_GLOBAL_SCALE_THRESHOLD??D)),e.getMaxLod())}get targetTiles(){let e=new Map;if(this.loadAllTiles){let{_dataBounds:t}=this;if(t==null)return e;let n=ie(),r=this.loadAllTilesLevel,i=this.surface.tilingScheme,a=i.rootTilesInExtent(t).values().flatMap(e=>K(e,r));for(let o of a){let[a,s,c]=o;i.getExtent(r,s,c,n),Z(t,n)&&e.set(C(r,s,c),o)}return e}let{renderedTiles:t}=this;for(let n of t??[])e.set(n.key,n.lij);return e}get _featureTilesBounds(){let e=this.view.featureTiles?.filterExtent,t=h(e,this.surface.spatialReference).geometry;return t==null?null:_(t)}get _flowRenderer(){let e=this.layer.renderer;return e?.type===`flow`?e:null}get _materialParameters(){return{...B(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),...this._materialParametersOverridde,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&`screenSizePerspectiveEnabled`in this.layer&&J(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){let{_averageLoadingTime:e}=this;return f(e===0?O:this._averageLoadingTime*k)}get _transitionEnabled(){return this.view.qualitySettings.flow.transitionEnabled}get _seamlessTransitionEnabled(){return this._transitionEnabled?this._seamlessTransitionEnabledOverride==null?A:this._seamlessTransitionEnabledOverride:!1}get _tracingResolution(){let{extent:e}=this;if(!e)return[0,0];let t=ae(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[n,r]=this.view.size,i,a;n<r?(i=n,a=n/t):(i=r*t,a=r);let o=I,s=this.view.qualitySettings.flow.maxTracingResolution,c=Math.max(1,o/Math.min(i,a)),l=c*Math.min(1,s/Math.max(i*c,a*c));return[Math.round(i*l),Math.round(a*l)]}get visible(){let e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(e==null||e.a>0)}get _effectiveDensity(){let{_simulationSettings:e}=this;if(e==null)return 0;let t=e.density*this.view.quality;return e.lineSpacing/Math.sqrt(t)<e.lineCollisionWidth?(e.lineSpacing/e.lineCollisionWidth)**2:t}get elevationInfo(){return(`elevationInfo`in this.layer?this.layer.elevationInfo:void 0)??fe}startPositions(e){if(!this._seamlessTransitionEnabled)return[];let{_flowRenderer:t,_resources:n}=this;return t==null||n==null?[]:ue(n.streamlines,n.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return b(this.surface.spatialReference)}get loadingState(){return this._loadingState}get loadRequirementsMet(){return this.renderedTiles!=null&&(this.renderedTiles.size>0||this.loadAllTiles)&&this.extent!=null}hasWork(){return this.updatingHandles.updating||this.requireLoad||this._loadingState===`before-transition`}get updating(){return this._debugAllowAutoLoading.value&&this.visible&&!(this.destroyed||this.destroying)&&this.hasWork()}get visibleAtCurrentScale(){return!se()||y(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){let{_flowRenderer:e,_simulationSettingsOverride:t}=this;if(e==null)return null;let n=Y(e);return n.segmentLength=n.lineCollisionWidth/2,n.onlyForwardTracing=!1,n.maxNumberOfStreamlines=this.view.qualitySettings.flow.maxTotalNumberOfStreamlines,n.density*=j,this.loadAllTiles&&this.isDataGlobal&&(n.density*=M),t!=null&&(n={...n,...t}),n}getSimulationSettings(e){let{_simulationSettings:t,spatialReferenceInfo:n}=this;if(t==null)return null;let r=this.view.viewingMode===`global`&&n!=null&&L(e.extent.xmin,e.extent.xmax,n);return{...t,wrapAround:r,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this.tilesIntersectDataBounds=!0,this._loadingState=`ready-to-load`}_update(){let e=this._time;this._lastResources?.hasFadedOut(e)&&this._lastResources.detach();let t=this._nextStateForTransition(e);!this.requireLoad||this.updatingHandles.updating||t!==`ready-to-load`||!this.loadRequirementsMet?(this._loadingState=t,this.tilesIntersectDataBounds||(this.requireLoad=!1)):(this._loadingState=`loading`,this.updatingHandles.consumePromise(o((async()=>{let t=this._time,n=this._seamlessTransitionEnabled&&this._resources!=null?f(e+this._seamlessTransitionWaitingTime):e;await this._load(n);let r=f((this._time-t)/1e3);this._updateAverageLoadingTime(r)})())),this.requireLoad=!1)}_updateAverageLoadingTime(e){let t=N;this._averageLoadingTime=f(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){!this.suspended&&this._debugAllowAutoLoading.value&&(this.visible?this.requireLoad=!0:this.clear())}get _time(){return te(this.layerView.view.stage.renderer.renderContext.time)}async _load(e){let{extent:t,view:n}=this;if(!this.visible){this.clear();return}if(t==null){this._loadingState=`ready-to-load`;return}this._transitionEnabled||(this._lastResources?.detach(),this._lastResources=null,this._resources?.detach(),this._resources=null);let r=new R(t,this.layerView.timeExtent,this._tracingResolution,n.state.contentPixelRatio,e),i=this._ensureAbortController();try{let t=await this._loadStreamlines(r,i.signal);if(a(i.signal),t!=null){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=t;let n=this._getStartTime(e);this._lastResources!=null&&(this._lastResources.endTime=n),this._resources.startTime=n,this._animationsEnabled||(this._lastResources?.detach(),this._lastResources=null),await t.attach(),this.suspended&&this.clear(),a(i.signal),this._loadingState=this._seamlessTransitionEnabled?`before-transition`:`transitioning`}else this._loadingState=`ready-to-load`}catch{this._loadingState=`ready-to-load`}}async _loadStreamlines(e,t){let n=await this.fetchDataAndGenerateStreamlines(e,t);if(n==null)return null;let{geometries:r,material:i}=await this._createGeometry(e,n,t);return this._draped?new U(e,n,i,r,this.layerView):new W(e,n,i,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t,n){let r=new oe(this._materialParameters,this.view),i=[],{elevationInfo:o,_draped:s,view:c}=this;function*l(n){for(let a=0;a<t.length;++a)i.push(V(c,e,t[a],o,r,s)),n.madeProgress(),n.done&&(n=yield)}return await this.frameTask.scheduleGenerator(l,n),a(n),{geometries:i,material:r}}_triggerTilesUpdate(){if(this.suspended||this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;let e=this._ensureAbortController();this.updatingHandles.consumePromise(o((async()=>{try{await ee(()=>this.view.stationary),a(e.signal),await this._debouncedTileUpdate(e)}finally{this._tilesUpdateIsWaiting=!1}})()))}_getTileFilterFunction(){let{view:e,_featureTilesBounds:n,loadAllTiles:r}=this;if(r){let{loadAllTilesLevel:e}=this;return t=>t.level===e}let i=e=>e.rendered&&e.visible,{featureTiles:a}=e;if(!a)return i;let o=a.tiles.filter(e=>e.measures.visible);return e=>i(e)&&Z(n,e.extent)&&o.some(({lij:n})=>t(n,e.lij)||q(n,e.lij))}_nextStateForTransition(e){let{_resources:t}=this;if(this._flowRenderer==null||t==null||this._loadingState===`ready-to-load`||this._loadingState===`loading`)return this._loadingState;let n=t.startTime,r=n+P;return e<n?`before-transition`:e<r?`transitioning`:`ready-to-load`}_getStartTime(e){if(!this._animationsEnabled)return Q;let t=this._time;return f(t>e?t:e)}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([p()],X.prototype,`type`,void 0),e([p()],X.prototype,`renderedTiles`,void 0),e([p()],X.prototype,`_resources`,void 0),e([p()],X.prototype,`_lastResources`,void 0),e([p()],X.prototype,`tilesIntersectDataBounds`,void 0),e([p()],X.prototype,`requireLoad`,void 0),e([p()],X.prototype,`_averageLoadingTime`,void 0),e([p()],X.prototype,`_loadingState`,void 0),e([p()],X.prototype,`emissiveStrength`,void 0),e([p()],X.prototype,`_animationsEnabled`,null),e([p()],X.prototype,`_clippingArea`,null),e([p()],X.prototype,`_dataBounds`,null),e([p()],X.prototype,`suspended`,null),e([p()],X.prototype,`_fullExtentSurfaceSpatialReference`,null),e([p()],X.prototype,`_draped`,null),e([p()],X.prototype,`extent`,null),e([p()],X.prototype,`loadAllTiles`,null),e([p()],X.prototype,`isDataGlobal`,null),e([p()],X.prototype,`loadAllTilesLevel`,null),e([p()],X.prototype,`targetTiles`,null),e([p()],X.prototype,`_featureTilesBounds`,null),e([p()],X.prototype,`_flowRenderer`,null),e([p()],X.prototype,`_materialParameters`,null),e([p()],X.prototype,`_opacity`,null),e([p()],X.prototype,`_seamlessTransitionWaitingTime`,null),e([p()],X.prototype,`_transitionEnabled`,null),e([p()],X.prototype,`_seamlessTransitionEnabled`,null),e([p()],X.prototype,`_tracingResolution`,null),e([p()],X.prototype,`visible`,null),e([p()],X.prototype,`_effectiveDensity`,null),e([p()],X.prototype,`elevationInfo`,null),e([p()],X.prototype,`needsMagnitude`,null),e([p()],X.prototype,`spatialReferenceInfo`,null),e([p()],X.prototype,`loadingState`,null),e([p()],X.prototype,`updating`,null),e([p()],X.prototype,`visibleAtCurrentScale`,null),e([p()],X.prototype,`_materialParametersOverridde`,void 0),e([p()],X.prototype,`_suspendedOverride`,void 0),e([p()],X.prototype,`_simulationSettingsOverride`,void 0),e([p()],X.prototype,`_seamlessTransitionEnabledOverride`,void 0),e([p()],X.prototype,`_simulationSettings`,null),e([p()],X.prototype,`surface`,null),X=e([m(`esri.views.3d.layers.FlowSubView3D`)],X);const de=X,fe=new x({mode:`on-the-ground`});function Z(e,t){return e==null||t==null||v(e,t)}const pe=g(G,ne.WebMercator),Q=f(-F);function $(e){return e!=null&&e.spatialReference.isWebMercator?e?.intersection(pe):e}export{de as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{onePixelInPoints as t,pt2px as n,onePointInPixels as r}from"../../../../core/screenUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as o,clone as s,ones as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as l,fromBuffer as u,intersectsClippingArea as d,empty as f,expandWithAABB as p,expandWithBuffer as m}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as h}from"../../../../renderers/support/renderingInfoUtils.js";import{getTransformationType as g}from"../../../../renderers/visualVariables/support/sizeVariableUtils.js";import{sharedGeometryElevationAligner as _}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as v,needsElevationUpdates2D as y}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as b}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as x}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as S,nanFallbackColor as C}from"./Graphics3DSymbolLayer.js";import{parseCapType as w,computeSymbolLayerIndex as T,parseLineMarkerStyle as E}from"./lineUtils.js";import{initFastSymbolUpdatesState as D,updateFastSymbolUpdatesState as O,getAttributeValue as k,getSizeAttributeValue as A,ConvertOptions as j}from"../support/FastSymbolUpdates.js";import{debugFlags as M}from"../../support/debugFlags.js";import{createGeometry as N}from"../../support/engineContent/line.js";import{geometryToRenderInfo as P,geometryToRenderInfoDraped as F}from"../../support/renderInfoUtils/line.js";import{Object3D as I}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as L}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as R}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as z,patternHidesLine as B}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as V}from"../../webgl-engine/materials/RibbonLineMaterial.js";const H=[`polyline`];class U extends S{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,K(t))}async doLoad(){if(this._fastUpdates=D(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastMarkerUpdates=D(this._context.renderer,this._fastVisualVariableConvertOptions(!0)),!this._drivenProperties.size&&(this.symbolLayer.size==null?t:this.symbolLayer.size)<0)throw new e(`graphics3dlinesymbollayer:invalid-size`,`Symbol sizes may not be negative values`)}_getMaterialParameters(e,t){let n=this._screenSizePerspective,r=!!has(`enable-feature:emissive-on-non-volumetric`)&&!this.draped,{symbolLayer:i}=this,{worldSized:a}=this.symbol,o={...this._getMaterialColorParameters(t),shadingEnabled:r,width:this._computeMaterialWidth(i.size,a),worldSized:a,polygonOffset:3,polygonOffsetIndex:T(this._renderPriority,this._renderPriorityStep),join:i.join||`miter`,cap:w(i.cap||`butt`),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:z(i.pattern??i.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:n};if(t===2){if(this._fastMarkerUpdates?.visualVariables)return{...o,...this._fastMarkerUpdates.materialParameters}}else if(this._fastUpdates?.visualVariables)return{...o,...this._fastUpdates.materialParameters};return o}_getMaterialColorParameters(e){let t=e===2,n=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(n[3]=0),{color:n}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return this._materials[0]??=new V(this._getMaterialParameters(!1,0),this.view.state.isGlobal),this._materials[0]}get _wireframeLineMaterial(){return this._materials[1]??=new V({...this._getMaterialParameters(!1,1),wireframe:!0},this.view.state.isGlobal),this._materials[1]}get _markerMaterial(){return this._materials[2]==null&&this.symbolLayer.marker!=null&&(this._materials[2]=new R({...this._getMaterialParameters(!1,2),placement:this.symbolLayer.marker.placement,markerPrimitive:E(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[2]}_getDrivenSize(e){if(this._drivenProperties.size){let t=e.size;if(t==null)return this._getFallbackSize();let n=h(t.output);return this._getWorldOrScreenSize(n)}return 1}_getDrivenColor({color:e,opacity:t}){let n=c();return this._drivenProperties.color&&(a(n,e?.output??this._getFallbackOpacityAndColor(o)),t==null)||this._drivenProperties.opacity&&(e||this._materialColor)&&(n[3]=t?.output??this._getFallbackOpacity()),n}_getDrivenMarkerColor({color:e,opacity:t}){let n=c();return this._drivenProperties.color&&(a(n,e?.output??this._getFallbackMarkerOpacityAndColor(o)),t==null)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(n[3]=t?.output??this._getFallbackMarkerOpacity()),n}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validatePolylineContext(e))return null;this._warnIfVVRequiresWorldSized(e.renderingInfo);let n=this.createElevationContextForGraphic(t),r=n.mode===`on-the-ground`;return this.ensureDrapedStatus(r),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,n,t.uid)}_validatePolylineContext(e){let t=e.graphic.geometry;return this._validateGeometry(t,H,this.symbolLayer.type)&&t.type===`polyline`}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:{let e=this._fastUpdates;if(O(e,t,this._fastVisualVariableConvertOptions()))for(let t of this._materials)t instanceof V&&t.setParameters(e.materialParameters);else return 0;let n=this._fastMarkerUpdates;if(O(n,t,this._fastVisualVariableConvertOptions(!0)))for(let e of this._materials)e instanceof R&&e.setParameters(n.materialParameters);else return 0}break;default:return 0}return`visualVariables`in e.diff&&this._warnIfVVRequiresWorldSized(),2}_warnIfVVRequiresWorldSized(e){if(this.symbol.worldSized||this.ignoreDrivers)return;let t=this._getSizeVariable(e);t==null||t.useSymbolValue||t.target===`outline`||g(t)===`real-world-size`&&this.logger.warnOnce(`SizeVariable uses real-world units, but LineSymbol3D.worldSized is false. Set LineSymbol3D.worldSized to true to render real-world line widths.`)}_getSizeVariable(e){let t=this._fastUpdates?.visualVariables.size;if(t)return t.variables[0];let n=e?.size,r=n?.output.findIndex(e=>typeof e==`number`);return r==null?null:n?.variables[r]}prepareSymbolLayerPatch(e){if(e.diff.type!==`partial`)return;let t=e.diff.diff,n={};t.size?.type===`complete`&&(n.width=this._computeMaterialWidth(t.size.newValue,this.symbol.worldSized),delete t.size),t.cap?.type===`complete`&&(n.cap=w(t.cap.newValue??`butt`),delete t.cap);let r=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,r),e.symbolLayerStatePatches.push(()=>{for(let e of this._materials)e?.setParameters(n)})}layerOpacityChanged(){for(let e=0;e<3;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){let e=this._screenSizePerspective;for(let t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=v(U.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=y(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){let e={hasSlicePlane:this._context.slicePlaneEnabled};for(let t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,n){let r=e.graphic,i=W(r.geometry);if(i==null)return null;let a=[],o=l(),s=P(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(s,i.paths,`paths`,`LineSymbol3DLayer`);for(let t=0;t<s.lines.length;t++){let r=s.lines[t],c=r.position,l=r.mapPositions;if(this._context.clippingExtent!=null&&(u(l,o),!d(o,this._context.clippingExtent)))continue;let f=this._createGeometry(this._lineMaterial,e,c,l,i.type,1,n);if(a.push(f),M.LINE_WIREFRAMES&&a.push(f.instantiate({material:this._wireframeLineMaterial})),this._markerMaterial!=null){let t=f.instantiate({material:this._markerMaterial});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),a.push(t)}}if(a.length===0)return null;let c=this._context.layerViewUid,f=new I({geometries:a,castShadow:!1,layerViewUid:c,graphicUid:n}),p=new x(this,f,null,_,t);return p.alignedSampledElevation=s.sampledElevation,p.needsElevationUpdates=y(t.mode),p}_createGeometry(e,t,n,r,i,a,o){let s=a===0?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,c=i===`polygon`,l=this._fastUpdates?.visualVariables.color,u=this._fastUpdates?.visualVariables.size,d=this._fastUpdates?.visualVariables.opacity,f=this._context.layerViewUid,p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:f}),{renderingInfo:m}=t,h={position:n,size:u?null:this._getDrivenSize(m),color:l?null:this._getDrivenColor(m),sizeFeature:u?A(u,m.size):null,colorFeature:l?k(l,m.color):null,opacityFeature:d?k(d,m.opacity):null};return N(e,{overlayInfo:s,removeDuplicateStartEnd:c,mapPositions:r,attributeData:h},p)}_createAsOverlay(e){let t=e.graphic,{geometry:n}=t;this._lineMaterial.renderPriority=this._renderPriority;let r=M.LINE_WIREFRAMES?this._wireframeLineMaterial:null,i=this._markerMaterial;r!=null&&(r.renderPriority=this._renderPriority-.001),i!=null&&(i.renderPriority=this._renderPriority-.002);let a=[],o=l(),s=f(),c=F(n,this._context.overlaySR);this._logGeometryCreationWarnings(c,n.paths,`paths`,`LineSymbol3DLayer`);for(let l of c.lines){if(u(l.position,o),!d(o,this._context.clippingExtent))continue;p(s,o);let c=this._createGeometry(this._lineMaterial,e,l.position,void 0,n.type,0,t.uid),f=e=>{let n=this._context.layerViewUid,r=new L(e,{layerViewUid:n,graphicUid:t.uid});a.push(r)};if(i!=null){let t=c.instantiate({material:i});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),f(t);let n=this.symbolLayer.marker.placement;(n===`begin`||n===`begin-end`)&&m(o,l.position,0,1),(n===`end`||n===`begin-end`)&&m(o,l.position,l.position.length-3,1)}f(c),M.LINE_WIREFRAMES&&f(c.instantiate({material:r}))}return new b(this,a,s,this._context.drapeSourceRenderer)}get _patternHidesLine(){return B(this.symbolLayer.pattern)}_computeMaterialWidth(e,i){return i?this._drivenProperties.size?1:e??1:(e??=t,this._drivenProperties.size?this._fastUpdates?.visualVariables.size?r:1:n(e))}_prepareMaterialPatch(e,t,n){let r=t.material;if(r==null){n.changed&&n.useMaterialColor&&G(this._getCombinedOpacityAndColor(this._materialColor),this._materials[2],e);return}if(r.type===`collection`)return;let i=r.type===`complete`?r.newValue?.color:r.diff.color?.type===`complete`?r.diff.color.newValue:null,a=this._getCombinedOpacityAndColor(i);n.useMaterialColor&&G(s(a),this._materials[2],e),this._patternHidesLine&&(a[3]=0),G(a,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){let n=t.marker,r=this._markerMaterial;if(n==null||n.type!==`partial`||n.diff==null||n.diff.placement!=null||n.diff.style!=null&&n.diff.style.type!==`complete`||n.diff.color!=null&&n.diff.color.type!==`complete`||r==null)return{changed:!1,useMaterialColor:this._markerColor==null};let i=n.diff.color,a=i!=null,o=a?i.newValue:null,s=o==null&&this._markerColor==null;o&&G(this._getCombinedOpacityAndColor(o),r,e);let c=n.diff.style?.newValue;return c&&e.symbolLayerStatePatches.push(()=>r.setParameters({markerPrimitive:E(c)})),delete t.marker,{changed:a,useMaterialColor:s}}_fastVisualVariableConvertOptions(e=!1){let t=this._getFallbackSize(),{size:n}=this.symbolLayer;return new j({supports:{size:!0,color:!0,rotation:!1,opacity:!0},symbolSize:i(n,n,n),fallbackColor:e?this._getFallbackMarkerOpacityAndColor(C):this._getFallbackOpacityAndColor(C),fallbackSize:i(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer.marker?.color?.a??this._getFallbackOpacity()}_getWorldOrScreenSize(e){return this.symbol.worldSized?e:n(e)}_getFallbackSize(){return this._getWorldOrScreenSize(this.symbolLayer.size)}}function W(e){return e.type===`polyline`?e:null}function G(e,t,n){t!=null&&n.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function K(e){return(e.material?.color?.a??1)===1&&(e.marker?.color?.a??1)===1}export{U as Graphics3DLineSymbolLayer};
2
+ import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{onePixelInPoints as t,pt2px as n,onePointInPixels as r}from"../../../../core/screenUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as o,clone as s,ones as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as l,fromBuffer as u,intersectsClippingArea as d,empty as f,expandWithAABB as p,expandWithBuffer as m}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as h}from"../../../../renderers/support/renderingInfoUtils.js";import{getTransformationType as g}from"../../../../renderers/visualVariables/support/sizeVariableUtils.js";import{sharedGeometryElevationAligner as _}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as v,needsElevationUpdates2D as y}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as b}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as x}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as S,nanFallbackColor as C}from"./Graphics3DSymbolLayer.js";import{parseCapType as w,computeSymbolLayerIndex as T,parseLineMarkerStyle as E}from"./lineUtils.js";import{initFastSymbolUpdatesState as D,updateFastSymbolUpdatesState as O,getAttributeValue as k,getSizeAttributeValue as A,ConvertOptions as j}from"../support/FastSymbolUpdates.js";import{debugFlags as M}from"../../support/debugFlags.js";import{createGeometry as N}from"../../support/engineContent/line.js";import{geometryToRenderInfo as P,geometryToRenderInfoDraped as F}from"../../support/renderInfoUtils/line.js";import{Object3D as I}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as L}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as R}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as z,patternHidesLine as B}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as V}from"../../webgl-engine/materials/RibbonLineMaterial.js";const H=[`polyline`];class U extends S{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,K(t))}async doLoad(){if(this._fastUpdates=D(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastMarkerUpdates=D(this._context.renderer,this._fastVisualVariableConvertOptions(!0)),!this._drivenProperties.size&&(this.symbolLayer.size==null?t:this.symbolLayer.size)<0)throw new e(`graphics3dlinesymbollayer:invalid-size`,`Symbol sizes may not be negative values`)}_getMaterialParameters(e,t){let n=this._screenSizePerspective,r=!!has(`enable-feature:emissive-on-non-volumetric`)&&!this.draped,{symbolLayer:i}=this,{worldSized:a}=this.symbol,o={...this._getMaterialColorParameters(t),shadingEnabled:r,width:this._computeMaterialWidth(i.size,a),worldSized:a,polygonOffset:3,polygonOffsetIndex:T(this._renderPriority,this._renderPriorityStep),join:i.join||`miter`,cap:w(i.cap||`butt`),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:z(i.pattern??i.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:n};if(t===2){if(this._fastMarkerUpdates?.visualVariables)return{...o,...this._fastMarkerUpdates.materialParameters}}else if(this._fastUpdates?.visualVariables)return{...o,...this._fastUpdates.materialParameters};return o}_getMaterialColorParameters(e){let t=e===2,n=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(n[3]=0),{color:n}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return this._materials[0]??=new V(this._getMaterialParameters(!1,0),this.view),this._materials[0]}get _wireframeLineMaterial(){return this._materials[1]??=new V({...this._getMaterialParameters(!1,1),wireframe:!0},this.view),this._materials[1]}get _markerMaterial(){return this._materials[2]==null&&this.symbolLayer.marker!=null&&(this._materials[2]=new R({...this._getMaterialParameters(!1,2),placement:this.symbolLayer.marker.placement,markerPrimitive:E(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[2]}_getDrivenSize(e){if(this._drivenProperties.size){let t=e.size;if(t==null)return this._getFallbackSize();let n=h(t.output);return this._getWorldOrScreenSize(n)}return 1}_getDrivenColor({color:e,opacity:t}){let n=c();return this._drivenProperties.color&&(a(n,e?.output??this._getFallbackOpacityAndColor(o)),t==null)||this._drivenProperties.opacity&&(e||this._materialColor)&&(n[3]=t?.output??this._getFallbackOpacity()),n}_getDrivenMarkerColor({color:e,opacity:t}){let n=c();return this._drivenProperties.color&&(a(n,e?.output??this._getFallbackMarkerOpacityAndColor(o)),t==null)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(n[3]=t?.output??this._getFallbackMarkerOpacity()),n}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validatePolylineContext(e))return null;this._warnIfVVRequiresWorldSized(e.renderingInfo);let n=this.createElevationContextForGraphic(t),r=n.mode===`on-the-ground`;return this.ensureDrapedStatus(r),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,n,t.uid)}_validatePolylineContext(e){let t=e.graphic.geometry;return this._validateGeometry(t,H,this.symbolLayer.type)&&t.type===`polyline`}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:{let e=this._fastUpdates;if(O(e,t,this._fastVisualVariableConvertOptions()))for(let t of this._materials)t instanceof V&&t.setParameters(e.materialParameters);else return 0;let n=this._fastMarkerUpdates;if(O(n,t,this._fastVisualVariableConvertOptions(!0)))for(let e of this._materials)e instanceof R&&e.setParameters(n.materialParameters);else return 0}break;default:return 0}return`visualVariables`in e.diff&&this._warnIfVVRequiresWorldSized(),2}_warnIfVVRequiresWorldSized(e){if(this.symbol.worldSized||this.ignoreDrivers)return;let t=this._getSizeVariable(e);t==null||t.useSymbolValue||t.target===`outline`||g(t)===`real-world-size`&&this.logger.warnOnce(`SizeVariable uses real-world units, but LineSymbol3D.worldSized is false. Set LineSymbol3D.worldSized to true to render real-world line widths.`)}_getSizeVariable(e){let t=this._fastUpdates?.visualVariables.size;if(t)return t.variables[0];let n=e?.size,r=n?.output.findIndex(e=>typeof e==`number`);return r==null?null:n?.variables[r]}prepareSymbolLayerPatch(e){if(e.diff.type!==`partial`)return;let t=e.diff.diff,n={};t.size?.type===`complete`&&(n.width=this._computeMaterialWidth(t.size.newValue,this.symbol.worldSized),delete t.size),t.cap?.type===`complete`&&(n.cap=w(t.cap.newValue??`butt`),delete t.cap);let r=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,r),e.symbolLayerStatePatches.push(()=>{for(let e of this._materials)e?.setParameters(n)})}layerOpacityChanged(){for(let e=0;e<3;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){let e=this._screenSizePerspective;for(let t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=v(U.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=y(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){let e={hasSlicePlane:this._context.slicePlaneEnabled};for(let t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,n){let r=e.graphic,i=W(r.geometry);if(i==null)return null;let a=[],o=l(),s=P(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(s,i.paths,`paths`,`LineSymbol3DLayer`);for(let t=0;t<s.lines.length;t++){let r=s.lines[t],c=r.position,l=r.mapPositions;if(this._context.clippingExtent!=null&&(u(l,o),!d(o,this._context.clippingExtent)))continue;let f=this._createGeometry(this._lineMaterial,e,c,l,i.type,1,n);if(a.push(f),M.LINE_WIREFRAMES&&a.push(f.instantiate({material:this._wireframeLineMaterial})),this._markerMaterial!=null){let t=f.instantiate({material:this._markerMaterial});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),a.push(t)}}if(a.length===0)return null;let c=this._context.layerViewUid,f=new I({geometries:a,castShadow:!1,layerViewUid:c,graphicUid:n}),p=new x(this,f,null,_,t);return p.alignedSampledElevation=s.sampledElevation,p.needsElevationUpdates=y(t.mode),p}_createGeometry(e,t,n,r,i,a,o){let s=a===0?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,c=i===`polygon`,l=this._fastUpdates?.visualVariables.color,u=this._fastUpdates?.visualVariables.size,d=this._fastUpdates?.visualVariables.opacity,f=this._context.layerViewUid,p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:f}),{renderingInfo:m}=t,h={position:n,size:u?null:this._getDrivenSize(m),color:l?null:this._getDrivenColor(m),sizeFeature:u?A(u,m.size):null,colorFeature:l?k(l,m.color):null,opacityFeature:d?k(d,m.opacity):null};return N(e,{overlayInfo:s,removeDuplicateStartEnd:c,mapPositions:r,attributeData:h},p)}_createAsOverlay(e){let t=e.graphic,{geometry:n}=t;this._lineMaterial.renderPriority=this._renderPriority;let r=M.LINE_WIREFRAMES?this._wireframeLineMaterial:null,i=this._markerMaterial;r!=null&&(r.renderPriority=this._renderPriority-.001),i!=null&&(i.renderPriority=this._renderPriority-.002);let a=[],o=l(),s=f(),c=F(n,this._context.overlaySR);this._logGeometryCreationWarnings(c,n.paths,`paths`,`LineSymbol3DLayer`);for(let l of c.lines){if(u(l.position,o),!d(o,this._context.clippingExtent))continue;p(s,o);let c=this._createGeometry(this._lineMaterial,e,l.position,void 0,n.type,0,t.uid),f=e=>{let n=this._context.layerViewUid,r=new L(e,{layerViewUid:n,graphicUid:t.uid});a.push(r)};if(i!=null){let t=c.instantiate({material:i});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),f(t);let n=this.symbolLayer.marker.placement;(n===`begin`||n===`begin-end`)&&m(o,l.position,0,1),(n===`end`||n===`begin-end`)&&m(o,l.position,l.position.length-3,1)}f(c),M.LINE_WIREFRAMES&&f(c.instantiate({material:r}))}return new b(this,a,s,this._context.drapeSourceRenderer)}get _patternHidesLine(){return B(this.symbolLayer.pattern)}_computeMaterialWidth(e,i){return i?this._drivenProperties.size?1:e??1:(e??=t,this._drivenProperties.size?this._fastUpdates?.visualVariables.size?r:1:n(e))}_prepareMaterialPatch(e,t,n){let r=t.material;if(r==null){n.changed&&n.useMaterialColor&&G(this._getCombinedOpacityAndColor(this._materialColor),this._materials[2],e);return}if(r.type===`collection`)return;let i=r.type===`complete`?r.newValue?.color:r.diff.color?.type===`complete`?r.diff.color.newValue:null,a=this._getCombinedOpacityAndColor(i);n.useMaterialColor&&G(s(a),this._materials[2],e),this._patternHidesLine&&(a[3]=0),G(a,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){let n=t.marker,r=this._markerMaterial;if(n==null||n.type!==`partial`||n.diff==null||n.diff.placement!=null||n.diff.style!=null&&n.diff.style.type!==`complete`||n.diff.color!=null&&n.diff.color.type!==`complete`||r==null)return{changed:!1,useMaterialColor:this._markerColor==null};let i=n.diff.color,a=i!=null,o=a?i.newValue:null,s=o==null&&this._markerColor==null;o&&G(this._getCombinedOpacityAndColor(o),r,e);let c=n.diff.style?.newValue;return c&&e.symbolLayerStatePatches.push(()=>r.setParameters({markerPrimitive:E(c)})),delete t.marker,{changed:a,useMaterialColor:s}}_fastVisualVariableConvertOptions(e=!1){let t=this._getFallbackSize(),{size:n}=this.symbolLayer;return new j({supports:{size:!0,color:!0,rotation:!1,opacity:!0},symbolSize:i(n,n,n),fallbackColor:e?this._getFallbackMarkerOpacityAndColor(C):this._getFallbackOpacityAndColor(C),fallbackSize:i(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer.marker?.color?.a??this._getFallbackOpacity()}_getWorldOrScreenSize(e){return this.symbol.worldSized?e:n(e)}_getFallbackSize(){return this._getWorldOrScreenSize(this.symbolLayer.size)}}function W(e){return e.type===`polyline`?e:null}function G(e,t,n){t!=null&&n.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function K(e){return(e.material?.color?.a??1)===1&&(e.marker?.color?.a??1)===1}export{U as Graphics3DLineSymbolLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{pt2px as e}from"../../../../core/screenUtils.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromBuffer as n,intersectsClippingArea as r,empty as i,expandWithAABB as a,create as o}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as s,doubleSubArray as c}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as l}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as u}from"../../../../geometry/support/Indices.js";import{isDrivenOpacityFallbackAlwaysOpaque as d}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{elevationModeChangeUpdateType as f,needsElevationUpdates2D as p}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as m}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as h}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as g}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as _}from"./graphicUtils.js";import{parseCapType as v,computeSymbolLayerIndex as y}from"./lineUtils.js";import{geometryAsPolygon as b,createColorGeometry as x,PolygonCreationDataBase as S}from"./polygonUtils.js";import{initFastSymbolUpdatesState as C,updateFastSymbolUpdatesState as w,getAttributeValue as T,ConvertOptions as E}from"../support/FastSymbolUpdates.js";import{createMaterial as D,uvElevationAligner as O}from"../support/patternUtils.js";import{writeMapSpaceUVCoordsPerConnectedPart as k,writeMapSpaceUVCoordsDraped as A}from"../support/uvUtils.js";import{createGeometry as j}from"../../support/engineContent/line.js";import{loadTessellationUtils as M,preloadedPolygonToRenderInfoElevationAligned as N,preloadedPolygonToRenderInfoDraped as P}from"../../support/renderInfoUtils/polygon.js";import{Object3D as F}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as I}from"../../webgl-engine/lib/RenderGeometry.js";import{isScreenSizePerspectiveEnabled as L}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{getStipplePatternForLinePattern as R}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as z}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as B}from"../../webgl-engine/materials/RibbonLineMaterial.js";const V=[`polyline`,`polygon`,`extent`];class H extends g{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,d(t)),this._needsUV=!1,this._materials=[]}async doLoad(){this._fastUpdates=C(this._context.renderer,this._vvConvertOptions),await M()}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}_createMaterials(){if(this._materials.length>0)return;let{_materialColor:t,draped:n}=this,r=this._getCombinedOpacityAndColor(t);this._materials[0]=D(this.symbolLayer,{color:r,forceTransparentMode:this.needsDrivenTransparentPass,hasVertexColors:this._drivenProperties.color||this._drivenProperties.opacity,draped:n,hasSlicePlane:this._context.slicePlaneEnabled,emissiveStrength:this._emissiveStrength,...this._fastUpdates?.materialParameters}),this._needsUV=this._materials[0]instanceof z;let i=this.symbolLayer.outline;if(K(i)){let t=R(i.pattern),n=v(i.pattern?i.patternCap||`butt`:`square`);this._materials[1]=new B({width:e(i.size),color:this._getOutlineColor(),polygonOffset:3,polygonOffsetIndex:y(this._renderPriority,this._renderPriorityStep),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:t,cap:n,screenSizePerspective:this._outlineScreenSizePerspective},this.view.state.isGlobal)}}get _outlineScreenSizePerspective(){return!this.draped&&L(this._context.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,V,this.symbolLayer.type))return null;let n=this._getDrivenUInt8Color(e.renderingInfo,this._materialColor,!1),r=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus(r.mode===`on-the-ground`),this._createMaterials(),this.draped?this._createAsOverlay(e.renderingInfo,t,n):this._createAs3DShape(e.renderingInfo,t,n,r)}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:if(w(this._fastUpdates,t,this._vvConvertOptions))this._materials[0]?.setParameters(this._fastUpdates.materialParameters);else return 0;break;default:return 0}return 2}layerOpacityChanged(){if(this._materials[0]!=null){let e=this._materials[0].parameters.color,t=this._materialColor,n=this._getCombinedOpacity(t);this._materials[0].setParameters({color:[e[0],e[1],e[2],n],forceTransparentMode:this.needsDrivenTransparentPass})}if(this._materials[1]!=null){let e=this._materials[1].parameters.color;this._materials[1].setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}}layerScreenSizePerspectiveChanged(){this._materials[1]?.setParameters({screenSizePerspective:this._outlineScreenSizePerspective})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=f(H.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=p(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){if(this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]){let e={hasSlicePlane:this._context.slicePlaneEnabled};this._materials[1].setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}_containsRenderableGeometry(e){return e.polygonIndexCount>0?!0:this._materials[1]==null?!1:e.outline.output===`vertex-data`?e.outline.outlines.length>0:e.outlineIndexCount>0}_createAs3DShape(e,t,n,r){let i=b(t.geometry);if(!i)return null;let a=N(i,this._context.elevationProvider,this._context.renderCoordsHelper,r,{projectIfNearlyVertical:!0,outlineOutput:`vertex-data`,owner:this._context.layer});if(a==null)return null;let o=new W(a,n,this._context.layerViewUid,t.uid),d=o.renderData.vertexCount;if(this._needsUV){o.uvMapSpace=l(d*4,!0),o.textureElementIndices=Array(d),o.boundingRect=s(9*(o.renderData.polygonIndices.length/3));let e=k(o.uvMapSpace,o.boundingRect,o.textureElementIndices,o.renderData.positions,o.renderData.polygonIndices,this._context.renderCoordsHelper);o.boundingRect=c(o.boundingRect,0,9*e),o.boundingRectIndices=u(e)}if(o.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(o),this._createAs3DShapeFill(e,o),this._materials[1]&&this._createAs3DShapeOutline(o),this._logGeometryCreationWarnings(o.renderData,i.rings,`rings`,`FillSymbol3DLayer`),o.outGeometries.length===0)return null;let f=new F({geometries:o.outGeometries,castShadow:!1,layerViewUid:this._context.layerViewUid,graphicUid:t.uid}),m=new h(this,f,null,O,r);return m.alignedSampledElevation=o.renderData.sampledElevation,m.needsElevationUpdates=p(r.mode),m}_createAs3DShapeFill(e,t){let{mapPositions:i,positions:a,polygonIndices:o,polygonIndexCount:s}=t.renderData;if(s===0||this._context.clippingExtent!=null&&(n(i,U),!r(U,this._context.clippingExtent)))return;let c=this._fastUpdates?.visualVariables.color,l=x({material:this._materials[0],indices:o,mapPositions:i,attributeData:{position:a,color:c?null:t.color,colorFeature:c?T(c,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,boundingRect:this._needsUV?t.boundingRect:null,textureElementIndices:this._needsUV?t.textureElementIndices:null,boundingRectIndices:this._needsUV?t.boundingRectIndices:null,olidColor:t.olidColor}});t.outGeometries.push(l)}_createAs3DShapeOutline(e){if(this._materials[1]==null)return;let{outline:t}=e.renderData;if(t.output!==`vertex-data`)return;let{outlines:i}=t;if(i!=null&&i.length!==0)for(let{mapPositions:t,position:a}of i){if(this._context.clippingExtent!=null&&(n(t,U),!r(U,this._context.clippingExtent)))continue;let i=j(this._materials[1],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:t,attributeData:{position:a}},e.olidColor);e.outGeometries.push(i)}}_createAsOverlay(e,t,n){let r=b(t.geometry);if(r==null)return null;this._materials[0].renderPriority=this._renderPriority+this._renderPriorityStep/2,this._materials[1]!=null&&(this._materials[1].renderPriority=this._renderPriority);let a=P(r,{drapedSpatialReference:this._context.overlaySR,outlineOutput:`vertex-data`,owner:this._context.layer});if(a==null)return null;let o=new G(a,n,this._context.layerViewUid,t.uid);return this._needsUV&&(o.uvMapSpace=l(o.renderData.vertexCount*4,!0),A(o.uvMapSpace,o.renderData.positions,this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode)),o.outBoundingBox=i(),o.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(o),this._createAsOverlayFill(e,o),this._materials[1]&&this._createAsOverlayOutline(o),this._logGeometryCreationWarnings(o.renderData,r.rings,`rings`,`FillSymbol3DLayer`),new m(this,o.outGeometries,o.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(e,t){let{positions:i,polygonIndices:o,polygonIndexCount:s}=t.renderData;if(s===0)return;let c=n(i,U);if(!r(c,this._context.clippingExtent))return;a(t.outBoundingBox,c);let l=this._fastUpdates?.visualVariables.color,u=x({material:this._materials[0],indices:o,attributeData:{position:i,color:l?null:t.color,colorFeature:l?T(l,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,olidColor:t.olidColor}});t.outGeometries.push(new I(u,t))}_createAsOverlayOutline(e){if(this._materials[1]==null)return;let{outline:t}=e.renderData;if(t.output!==`vertex-data`)return;let{outlines:i}=t;for(let{position:t}of i){if(n(t,U),!r(U,this._context.clippingExtent))continue;a(e.outBoundingBox,U);let i=j(this._materials[1],{overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:!0,attributeData:{position:t}},e.olidColor);e.outGeometries.push(new I(i,e))}}_getOutlineOpacity(){let e=this.symbolLayer?.outline?.color;return(this.draped?1:this._getLayerOpacity())*(e==null?0:e.a)}_getOutlineColor(){let e=this.symbolLayer?.outline?.color,t=this._getOutlineOpacity();return _(e?.toUnitRGB(),t)}test(){return{...super.test(),createAsOverlay:(e,t,n)=>this._createAsOverlay(e,t,n),createAs3DShape:(e,t,n,r)=>this._createAs3DShape(e,t,n,r)}}get _vvConvertOptions(){return new E({supports:{size:!1,color:!0,rotation:!1,opacity:!1},fallbackColor:this._materialColor?.toUnitRGBA()??t})}}const U=o();class W extends S{constructor(e,t,n,r){super(e,n,r),this.color=t}}class G extends S{constructor(e,t,n,r){super(e,n,r),this.color=t}}function K(e){return e?.size!=null&&e.size>0&&e.color!=null&&(e.pattern==null||e.pattern.type!==`style`||e.pattern.style!==`none`)}export{H as Graphics3DPolygonFillSymbolLayer};
2
+ import{pt2px as e}from"../../../../core/screenUtils.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromBuffer as n,intersectsClippingArea as r,empty as i,expandWithAABB as a,create as o}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as s,doubleSubArray as c}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as l}from"../../../../geometry/support/FloatArray.js";import{getContinuousIndexArray as u}from"../../../../geometry/support/Indices.js";import{isDrivenOpacityFallbackAlwaysOpaque as d}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{elevationModeChangeUpdateType as f,needsElevationUpdates2D as p}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as m}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as h}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as g}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as _}from"./graphicUtils.js";import{parseCapType as v,computeSymbolLayerIndex as y}from"./lineUtils.js";import{geometryAsPolygon as b,createColorGeometry as x,PolygonCreationDataBase as S}from"./polygonUtils.js";import{initFastSymbolUpdatesState as C,updateFastSymbolUpdatesState as w,getAttributeValue as T,ConvertOptions as E}from"../support/FastSymbolUpdates.js";import{createMaterial as D,uvElevationAligner as O}from"../support/patternUtils.js";import{writeMapSpaceUVCoordsPerConnectedPart as k,writeMapSpaceUVCoordsDraped as A}from"../support/uvUtils.js";import{createGeometry as j}from"../../support/engineContent/line.js";import{loadTessellationUtils as M,preloadedPolygonToRenderInfoElevationAligned as N,preloadedPolygonToRenderInfoDraped as P}from"../../support/renderInfoUtils/polygon.js";import{Object3D as F}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as I}from"../../webgl-engine/lib/RenderGeometry.js";import{isScreenSizePerspectiveEnabled as L}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{getStipplePatternForLinePattern as R}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as z}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as B}from"../../webgl-engine/materials/RibbonLineMaterial.js";const V=[`polyline`,`polygon`,`extent`];class H extends g{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,d(t)),this._needsUV=!1,this._materials=[]}async doLoad(){this._fastUpdates=C(this._context.renderer,this._vvConvertOptions),await M()}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}_createMaterials(){if(this._materials.length>0)return;let{_materialColor:t,draped:n}=this,r=this._getCombinedOpacityAndColor(t);this._materials[0]=D(this.symbolLayer,{color:r,forceTransparentMode:this.needsDrivenTransparentPass,hasVertexColors:this._drivenProperties.color||this._drivenProperties.opacity,draped:n,hasSlicePlane:this._context.slicePlaneEnabled,emissiveStrength:this._emissiveStrength,...this._fastUpdates?.materialParameters}),this._needsUV=this._materials[0]instanceof z;let i=this.symbolLayer.outline;if(K(i)){let t=R(i.pattern),n=v(i.pattern?i.patternCap||`butt`:`square`);this._materials[1]=new B({width:e(i.size),color:this._getOutlineColor(),polygonOffset:3,polygonOffsetIndex:y(this._renderPriority,this._renderPriorityStep),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:t,cap:n,screenSizePerspective:this._outlineScreenSizePerspective},this.view)}}get _outlineScreenSizePerspective(){return!this.draped&&L(this._context.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,V,this.symbolLayer.type))return null;let n=this._getDrivenUInt8Color(e.renderingInfo,this._materialColor,!1),r=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus(r.mode===`on-the-ground`),this._createMaterials(),this.draped?this._createAsOverlay(e.renderingInfo,t,n):this._createAs3DShape(e.renderingInfo,t,n,r)}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:if(w(this._fastUpdates,t,this._vvConvertOptions))this._materials[0]?.setParameters(this._fastUpdates.materialParameters);else return 0;break;default:return 0}return 2}layerOpacityChanged(){if(this._materials[0]!=null){let e=this._materials[0].parameters.color,t=this._materialColor,n=this._getCombinedOpacity(t);this._materials[0].setParameters({color:[e[0],e[1],e[2],n],forceTransparentMode:this.needsDrivenTransparentPass})}if(this._materials[1]!=null){let e=this._materials[1].parameters.color;this._materials[1].setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}}layerScreenSizePerspectiveChanged(){this._materials[1]?.setParameters({screenSizePerspective:this._outlineScreenSizePerspective})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=f(H.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=p(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){if(this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]){let e={hasSlicePlane:this._context.slicePlaneEnabled};this._materials[1].setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}_containsRenderableGeometry(e){return e.polygonIndexCount>0?!0:this._materials[1]==null?!1:e.outline.output===`vertex-data`?e.outline.outlines.length>0:e.outlineIndexCount>0}_createAs3DShape(e,t,n,r){let i=b(t.geometry);if(!i)return null;let a=N(i,this._context.elevationProvider,this._context.renderCoordsHelper,r,{projectIfNearlyVertical:!0,outlineOutput:`vertex-data`,owner:this._context.layer});if(a==null)return null;let o=new W(a,n,this._context.layerViewUid,t.uid),d=o.renderData.vertexCount;if(this._needsUV){o.uvMapSpace=l(d*4,!0),o.textureElementIndices=Array(d),o.boundingRect=s(9*(o.renderData.polygonIndices.length/3));let e=k(o.uvMapSpace,o.boundingRect,o.textureElementIndices,o.renderData.positions,o.renderData.polygonIndices,this._context.renderCoordsHelper);o.boundingRect=c(o.boundingRect,0,9*e),o.boundingRectIndices=u(e)}if(o.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(o),this._createAs3DShapeFill(e,o),this._materials[1]&&this._createAs3DShapeOutline(o),this._logGeometryCreationWarnings(o.renderData,i.rings,`rings`,`FillSymbol3DLayer`),o.outGeometries.length===0)return null;let f=new F({geometries:o.outGeometries,castShadow:!1,layerViewUid:this._context.layerViewUid,graphicUid:t.uid}),m=new h(this,f,null,O,r);return m.alignedSampledElevation=o.renderData.sampledElevation,m.needsElevationUpdates=p(r.mode),m}_createAs3DShapeFill(e,t){let{mapPositions:i,positions:a,polygonIndices:o,polygonIndexCount:s}=t.renderData;if(s===0||this._context.clippingExtent!=null&&(n(i,U),!r(U,this._context.clippingExtent)))return;let c=this._fastUpdates?.visualVariables.color,l=x({material:this._materials[0],indices:o,mapPositions:i,attributeData:{position:a,color:c?null:t.color,colorFeature:c?T(c,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,boundingRect:this._needsUV?t.boundingRect:null,textureElementIndices:this._needsUV?t.textureElementIndices:null,boundingRectIndices:this._needsUV?t.boundingRectIndices:null,olidColor:t.olidColor}});t.outGeometries.push(l)}_createAs3DShapeOutline(e){if(this._materials[1]==null)return;let{outline:t}=e.renderData;if(t.output!==`vertex-data`)return;let{outlines:i}=t;if(i!=null&&i.length!==0)for(let{mapPositions:t,position:a}of i){if(this._context.clippingExtent!=null&&(n(t,U),!r(U,this._context.clippingExtent)))continue;let i=j(this._materials[1],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:t,attributeData:{position:a}},e.olidColor);e.outGeometries.push(i)}}_createAsOverlay(e,t,n){let r=b(t.geometry);if(r==null)return null;this._materials[0].renderPriority=this._renderPriority+this._renderPriorityStep/2,this._materials[1]!=null&&(this._materials[1].renderPriority=this._renderPriority);let a=P(r,{drapedSpatialReference:this._context.overlaySR,outlineOutput:`vertex-data`,owner:this._context.layer});if(a==null)return null;let o=new G(a,n,this._context.layerViewUid,t.uid);return this._needsUV&&(o.uvMapSpace=l(o.renderData.vertexCount*4,!0),A(o.uvMapSpace,o.renderData.positions,this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode)),o.outBoundingBox=i(),o.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(o),this._createAsOverlayFill(e,o),this._materials[1]&&this._createAsOverlayOutline(o),this._logGeometryCreationWarnings(o.renderData,r.rings,`rings`,`FillSymbol3DLayer`),new m(this,o.outGeometries,o.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(e,t){let{positions:i,polygonIndices:o,polygonIndexCount:s}=t.renderData;if(s===0)return;let c=n(i,U);if(!r(c,this._context.clippingExtent))return;a(t.outBoundingBox,c);let l=this._fastUpdates?.visualVariables.color,u=x({material:this._materials[0],indices:o,attributeData:{position:i,color:l?null:t.color,colorFeature:l?T(l,e.color):null,uvMapSpace:this._needsUV?t.uvMapSpace:null,olidColor:t.olidColor}});t.outGeometries.push(new I(u,t))}_createAsOverlayOutline(e){if(this._materials[1]==null)return;let{outline:t}=e.renderData;if(t.output!==`vertex-data`)return;let{outlines:i}=t;for(let{position:t}of i){if(n(t,U),!r(U,this._context.clippingExtent))continue;a(e.outBoundingBox,U);let i=j(this._materials[1],{overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:!0,attributeData:{position:t}},e.olidColor);e.outGeometries.push(new I(i,e))}}_getOutlineOpacity(){let e=this.symbolLayer?.outline?.color;return(this.draped?1:this._getLayerOpacity())*(e==null?0:e.a)}_getOutlineColor(){let e=this.symbolLayer?.outline?.color,t=this._getOutlineOpacity();return _(e?.toUnitRGB(),t)}test(){return{...super.test(),createAsOverlay:(e,t,n)=>this._createAsOverlay(e,t,n),createAs3DShape:(e,t,n,r)=>this._createAs3DShape(e,t,n,r)}}get _vvConvertOptions(){return new E({supports:{size:!1,color:!0,rotation:!1,opacity:!1},fallbackColor:this._materialColor?.toUnitRGBA()??t})}}const U=o();class W extends S{constructor(e,t,n,r){super(e,n,r),this.color=t}}class G extends S{constructor(e,t,n,r){super(e,n,r),this.color=t}}function K(e){return e?.size!=null&&e.size>0&&e.color!=null&&(e.pattern==null||e.pattern.type!==`style`||e.pattern.style!==`none`)}export{H as Graphics3DPolygonFillSymbolLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{handlesGroup as e}from"../../../core/handleUtils.js";import{watch as t,initial as n}from"../../../core/reactiveUtils.js";import{assertNotMesh as r}from"../../../geometry/asserts.js";import i from"../../../geometry/Extent.js";import{projectOrLoad as a}from"../../../geometry/projectionUtils.js";import{fromExtent as o,empty as s}from"../../../geometry/support/aaBoundingRect.js";import{projectElevationUpdateExtent as c}from"./elevationUpdateExtentUtils.js";import{intersectsGeographicExtent as l}from"./sphereExtentUtils.js";function u(s){let u=!1,m=(e,t,n)=>{if(u||d(e,n)||t==null)return;r(t);let h=a(t,s.view.spatialReference);if(h.pending!=null){u=!0,h.pending.finally(()=>{u=!1,m(e,t,n)});return}let g=h.geometry;if(g==null)return;let _=g.type===`point`?i.fromPoint(g):g.extent;_!=null&&c(e.extent,e.spatialReference,f,s.view.spatialReference)&&l(f,o(_,p),s.view.spatialReference)&&s.onElevationChanges()},h,g=t(()=>({elevationMode:s.elevationInfo?.mode,geometry:s.geometry}),({elevationMode:e,geometry:t})=>{h?.remove(),e!==`absolute-height`&&(h=s.view.elevationProvider.on(`elevation-change`,n=>m(n,t,e)))},n);return e([g,h])}function d({context:e},t){return t==null?!1:t===`absolute-height`||e===`scene`&&t!==`relative-to-scene`}const f=s(),p=s();export{u as createElevationUpdateHandle};
2
+ import{handlesGroup as e,refHandle as t}from"../../../core/handleUtils.js";import{watch as n,initial as r}from"../../../core/reactiveUtils.js";import{assertNotMesh as i}from"../../../geometry/asserts.js";import a from"../../../geometry/Extent.js";import{projectOrLoad as o}from"../../../geometry/projectionUtils.js";import{fromExtent as s,empty as c}from"../../../geometry/support/aaBoundingRect.js";import{projectElevationUpdateExtent as l}from"./elevationUpdateExtentUtils.js";import{intersectsGeographicExtent as u}from"./sphereExtentUtils.js";function d(c){let d=!1,h=(e,t,n)=>{if(d||f(e,n)||t==null)return;i(t);let r=o(t,c.view.spatialReference);if(r.pending!=null){d=!0,r.pending.finally(()=>{d=!1,h(e,t,n)});return}let g=r.geometry;if(g==null)return;let _=g.type===`point`?a.fromPoint(g):g.extent;_!=null&&l(e.extent,e.spatialReference,p,c.view.spatialReference)&&u(p,s(_,m),c.view.spatialReference)&&c.onElevationChanges()},g,_=n(()=>({elevationMode:c.elevationInfo?.mode,geometry:c.geometry()}),({elevationMode:e,geometry:t})=>{g?.remove(),e!==`absolute-height`&&(g=c.view.elevationProvider.on(`elevation-change`,n=>h(n,t,e)))},r);return e([_,t(()=>g)])}function f({context:e},t){return t==null?!1:t===`absolute-height`||e===`scene`&&t!==`relative-to-scene`}const p=c(),m=c();export{d as createElevationUpdateHandle};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- const e={type:`empty-tile`};function t(e){return e!=null&&`type`in e&&e.type===`vector-tile`}function n(e){return e!=null&&`type`in e&&e.type===`raster-tile`}function r(e){return e!=null&&`type`in e&&e.type===`tile-texture`}function i(e){return e==null||`type`in e&&e.type===`empty-tile`}function a(e){return e!=null&&`type`in e&&`bitmap`in e}export{e as emptyTile,a as isCreateBitmapResult,i as isEmptyTile,n as isRasterTile,r as isTileTexture,t as isVectorTile};
2
+ const e={type:`empty-tile`};function t(e){return e!=null&&`type`in e&&e.type===`vector-tile`}function n(e){return e!=null&&`type`in e&&e.type===`raster-tile`}function r(e){return e!=null&&`type`in e&&e.type===`tile-texture`}function i(e){return e!=null&&`type`in e&&e.type===`empty-tile`}function a(e){return e!=null&&`type`in e&&`bitmap`in e}export{e as emptyTile,a as isCreateBitmapResult,i as isEmptyTile,n as isRasterTile,r as isTileTexture,t as isVectorTile};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../core/Collection.js";import{isEarth as t}from"../../../geometry/ellipsoidUtils.js";import{isCGCS2000 as n}from"../../../geometry/support/spatialReferenceUtils.js";import{getTileMaxtrixSetFromActiveLayer as r}from"../../../layers/support/layerUtils.js";import{isRasterTile as i,isCreateBitmapResult as a,isTileTexture as o,isVectorTile as s}from"./TerrainData.js";import{t as c}from"../../../chunks/terrainUtilsPlanar.js";import{t as l}from"../../../chunks/terrainUtilsSpherical.js";const u={1:l,2:c};function d(e,t){e||console.warn(`Terrain: `+t)}let f=!1,p=!1;function m(e){p=e,f||=e}function h(e){f=e}function g(e,t){if(f&&!e){let e=Error().stack?.slice(5);throw console.warn(`Terrain internal: `+(t??``)+` at `+e),Error(`Assertion failed`+(t?`: `+t:``))}}function _(e){return e?.type===`imagery-tile`||e?.type===`wcs`}function v(e){return e?.type===`imagery-tile-3d`}function y(e){return e?.type===`tile-3d`}function b(e){return e?.type===`vector-tile-3d`}function x(e){return e?.type===`wmts-3d`}function S(e){return e?.type===`elevation-3d`}function C(e){return e?.type===`group`}function w(e){return e&&(y(e)||x(e)||v(e)||b(e))}function T(e){return e&&(y(e)||v(e)||b(e)||x(e))}function E(e){return T(e)||S(e)}function D(e){return i(e?.sourceLayerInfo?.data)}function O(e){return e?.sourceLayerInfo?.data!=null&&j(e.sourceLayerInfo)||!!e?.isVTLBackground}function k(e){return o(e?.sourceLayerInfo?.data)}function A(e){let t=e?.sourceLayerInfo?.data;return a(t)}function j(e){return s(e?.data)}function M(e){return e!=null&&`release`in e&&e.release(),null}function N(e,t,n,r,i){return u[r].checkIfTileInfoSupportedForViewSR(e,n,t,i)}function P(e,t,n){let r=null,i=null;if(e?.type===`wmts`){let a=F(e,t,n);r=a.tileInfo,i=a.fullExtent}else{i=_(e)?e.getCompatibleFullExtent(t):e.fullExtent;let a=n===2;r=_(e)?e.getCompatibleTileInfo(t,i,a):e?.type===`vector-tile`?a&&!I(t)||L.force512VTL?e.tileInfo:e.tileInfo.getCompatibleForVTL(256):e.tileInfo}let a=`tilemapCache`in e?e.tilemapCache?.effectiveMaxLOD:void 0;return r!=null&&i!=null&&N(r,i,t,n,a)==null?{tileInfo:r,fullExtent:i}:null}function F(t,n,i){let a=r(t);if(a!=null){if(e.isCollection(a)){let e=a.find(e=>N(e.tileInfo,e.fullExtent,n,i)==null);if(e)return{tileInfo:e.tileInfo,fullExtent:e.fullExtent}}else return{tileInfo:a.tileInfo,fullExtent:a.fullExtent}}return{tileInfo:null,fullExtent:null}}function I(e){return e.isWGS84||e.isWebMercator||n(e)||!t(e)}const L={force512VTL:!1};function R(e){return`[`+e[0]+`,`+e[1]+`,`+e[2]+`]`}function z(e){return`(`+e[0]+`,`+e[1]+`,`+e[2]+`)`}function B(e,t,n=Z){return Math.abs(e-t)<n}function V(e){return e===1?5:e===7?3:e===5?1:7}function H(e){return e===0?4:e===2?6:e===4?0:2}function U(e){return e===7||e===5}function W(e){return e===7||e===1}function G(e){return e===7||e===6||e===5}function K(e){return e===1||e===2||e===3}function q(e){return e===3||e===4||e===5}function J(e){return e===1||e===0||e===7}const Y=[0,2,4,6],X=[1,3,5,7],Z=1e-5;export{B as almostEquals,N as checkIfTileInfoSupportedForView,h as enableInternalTerrainChecks,f as enableTerrainInternalChecks,m as enableTerrainWaterproofChecks,p as enableWaterproofTests,Z as eps,F as getTileInfoAndExtentFromWMTSLayer,P as getTiledLayerInfo,g as internalAssert,w as isBlendableLayerView,K as isEast,S as isElevationLayerView,C as isGroupLayerView,A as isImageSourceRenderInfo,v as isImageryTileLayerView,D as isImageryTileRenderInfo,T as isMapTileLayerView,J as isNorth,W as isNorthCorner,_ as isProjectableRasterLayer,q as isSouth,E as isSurfaceLayerView,k as isTextureTileRenderInfo,y as isTileLayerView,b as isVectorTileLayerView,j as isVectorTilePerLayerInfo,O as isVectorTileRenderInfo,x as isWMTSLayerView,G as isWest,U as isWestCorner,R as lij2s,X as neighborCornerIndices,Y as neighborEdgeIndices,V as oppositeCorner,H as oppositeEdge,M as releaseTerrainData,L as test,z as v32s,I as vtlAssumes256PixelSizeAsDefault,d as weakAssert};
2
+ import e from"../../../core/Collection.js";import{isEarth as t}from"../../../geometry/ellipsoidUtils.js";import{isCGCS2000 as n}from"../../../geometry/support/spatialReferenceUtils.js";import{getTileMaxtrixSetFromActiveLayer as r}from"../../../layers/support/layerUtils.js";import{isRasterTile as i,isCreateBitmapResult as a,isTileTexture as o,isVectorTile as s}from"./TerrainData.js";import{t as c}from"../../../chunks/terrainUtilsPlanar.js";import{t as l}from"../../../chunks/terrainUtilsSpherical.js";const u={1:l,2:c};function d(e,t){e||console.warn(`Terrain: `+t)}let f=!1,p=!1;function m(e){p=e,f||=e}function h(e){f=e}function g(e,t){if(f&&!e){let e=Error().stack?.slice(5);throw console.warn(`Terrain internal: `+(t??``)+` at `+e),Error(`Assertion failed`+(t?`: `+t:``))}}function _(e){return e?.type===`imagery-tile`||e?.type===`wcs`}function v(e){return e?.type===`imagery-tile-3d`}function y(e){return e?.type===`tile-3d`}function b(e){return e?.type===`vector-tile-3d`}function x(e){return e?.type===`wmts-3d`}function S(e){return e?.type===`elevation-3d`}function C(e){return e?.type===`group`}function w(e){return e&&(y(e)||x(e)||v(e)||b(e))}function T(e){return e&&(y(e)||v(e)||b(e)||x(e))}function E(e){return T(e)||S(e)}function D(e){return i(e?.sourceLayerInfo?.data)}function O(e){return j(e?.sourceLayerInfo)||!!e?.isVTLBackground}function k(e){return o(e?.sourceLayerInfo?.data)}function A(e){let t=e?.sourceLayerInfo?.data;return a(t)}function j(e){return s(e?.data)}function M(e){return e!=null&&`release`in e&&e.release(),null}function N(e,t,n,r,i){return u[r].checkIfTileInfoSupportedForViewSR(e,n,t,i)}function P(e,t,n){let r=null,i=null;if(e?.type===`wmts`){let a=F(e,t,n);r=a.tileInfo,i=a.fullExtent}else{i=_(e)?e.getCompatibleFullExtent(t):e.fullExtent;let a=n===2;r=_(e)?e.getCompatibleTileInfo(t,i,a):e?.type===`vector-tile`?a&&!I(t)||L.force512VTL?e.tileInfo:e.tileInfo.getCompatibleForVTL(256):e.tileInfo}let a=`tilemapCache`in e?e.tilemapCache?.effectiveMaxLOD:void 0;return r!=null&&i!=null&&N(r,i,t,n,a)==null?{tileInfo:r,fullExtent:i}:null}function F(t,n,i){let a=r(t);if(a!=null){if(e.isCollection(a)){let e=a.find(e=>N(e.tileInfo,e.fullExtent,n,i)==null);if(e)return{tileInfo:e.tileInfo,fullExtent:e.fullExtent}}else return{tileInfo:a.tileInfo,fullExtent:a.fullExtent}}return{tileInfo:null,fullExtent:null}}function I(e){return e.isWGS84||e.isWebMercator||n(e)||!t(e)}const L={force512VTL:!1};function R(e){return`[`+e[0]+`,`+e[1]+`,`+e[2]+`]`}function z(e){return`(`+e[0]+`,`+e[1]+`,`+e[2]+`)`}function B(e,t,n=Z){return Math.abs(e-t)<n}function V(e){return e===1?5:e===7?3:e===5?1:7}function H(e){return e===0?4:e===2?6:e===4?0:2}function U(e){return e===7||e===5}function W(e){return e===7||e===1}function G(e){return e===7||e===6||e===5}function K(e){return e===1||e===2||e===3}function q(e){return e===3||e===4||e===5}function J(e){return e===1||e===0||e===7}const Y=[0,2,4,6],X=[1,3,5,7],Z=1e-5;export{B as almostEquals,N as checkIfTileInfoSupportedForView,h as enableInternalTerrainChecks,f as enableTerrainInternalChecks,m as enableTerrainWaterproofChecks,p as enableWaterproofTests,Z as eps,F as getTileInfoAndExtentFromWMTSLayer,P as getTiledLayerInfo,g as internalAssert,w as isBlendableLayerView,K as isEast,S as isElevationLayerView,C as isGroupLayerView,A as isImageSourceRenderInfo,v as isImageryTileLayerView,D as isImageryTileRenderInfo,T as isMapTileLayerView,J as isNorth,W as isNorthCorner,_ as isProjectableRasterLayer,q as isSouth,E as isSurfaceLayerView,k as isTextureTileRenderInfo,y as isTileLayerView,b as isVectorTileLayerView,j as isVectorTilePerLayerInfo,O as isVectorTileRenderInfo,x as isWMTSLayerView,G as isWest,U as isWestCorner,R as lij2s,X as neighborCornerIndices,Y as neighborEdgeIndices,V as oppositeCorner,H as oppositeEdge,M as releaseTerrainData,L as test,z as v32s,I as vtlAssumes256PixelSizeAsDefault,d as weakAssert};
@@ -1,12 +1,12 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{DecodeSymbolColor as t}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as n}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{EmissionsConfiguration as r,hasEmissiveStrengthFromUniform as i}from"../../../core/shaderLibrary/output/getEmissions.glsl.js";import{Float4DrawUniform as a}from"../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as o}from"../../../core/shaderModules/FloatDrawUniform.js";import{glsl as s,If as c}from"../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as l}from"../../../core/shaderModules/IntegerDrawUniform.js";import{Texture2DUintDrawUniform as u}from"../../../core/shaderModules/Texture2DUintDrawUniform.js";import{parameter as d}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{olidEnabled as f}from"../../../effects/geometry/olidUtils.js";import{componentDataLayout as p,componentDataOlidLayout as m}from"../../../materials/DefaultLayouts.js";import{floatBlendScale as h}from"../../../shaders/floatBlendScale.glsl.js";class g extends r{constructor(){super(...arguments),this.componentDataType=0}}e([d({count:2})],g.prototype,`componentDataType`,void 0);function _(e,t){switch(t.componentDataType){case 1:return S(e,t);case 0:case 2:return C(e,t);default:t.componentDataType}}const v=new u(`componentTextureBuffer`,e=>e.textureBackedBuffer?.texture),y=new n({layout:p,itemIndexExpression:`componentIndex`,bufferUniform:v}),b=new n({layout:m,itemIndexExpression:`componentIndex`,bufferUniform:v});function x(){return f()?b:y}function S(e,n){let{vertex:r,fragment:a}=e,{output:o,hasEmission:l}=n,u=o===11,d=x().createBuilder(e,n);e.attributes.add(`componentIndex`,`uint`),e.varyings.add(`vExternalColorMixMode`,`mediump float`),e.varyings.add(`vExternalColor`,`vec4`),u&&e.varyings.add(`vObjectAndLayerIdColor`,`vec4`);let f=l&&!i(n);f&&(e.varyings.add(`emissiveStrength`,`float`),e.varyings.add(`emissiveSource`,`int`)),e.include(t),r.include(h,n),r.code.add(s`
2
+ import{__decorate as e}from"tslib";import{DecodeSymbolColor as t}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as n}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{EmissionsConfiguration as r,hasEmissiveStrengthFromUniform as i}from"../../../core/shaderLibrary/output/getEmissions.glsl.js";import{Float4DrawUniform as a}from"../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as o}from"../../../core/shaderModules/FloatDrawUniform.js";import{glsl as s,If as c}from"../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as l}from"../../../core/shaderModules/IntegerDrawUniform.js";import{Texture2DUintDrawUniform as u}from"../../../core/shaderModules/Texture2DUintDrawUniform.js";import{parameter as d}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{olidEnabled as f}from"../../../effects/geometry/olidUtils.js";import{componentDataLayout as p,componentDataOlidLayout as m}from"../../../materials/DefaultLayouts.js";import{floatBlendScale as h}from"../../../shaders/floatBlendScale.glsl.js";class g extends r{constructor(){super(...arguments),this.componentDataType=0}}e([d({count:2})],g.prototype,`componentDataType`,void 0);function _(e,t){switch(t.componentDataType){case 1:return S(e,t);case 0:case 2:return C(e,t);default:t.componentDataType}}const v=new u(`componentTextureBuffer`,e=>e.textureBackedBuffer?.texture),y=new n({layout:p,itemIndexExpression:`componentIndex`,bufferUniform:v}),b=new n({layout:m,itemIndexExpression:`componentIndex`,bufferUniform:v});function x(){return f()?b:y}function S(e,n){let{vertex:r,fragment:a}=e,{output:o,hasEmission:l}=n,u=o===11,d=x().createBuilder(e,n);e.attributes.add(`componentIndex`,`uint`),e.varyings.add(`vExternalColorMixMode`,`mediump float`),e.varyings.add(`vExternalColor`,`vec4`),u&&e.varyings.add(`vObjectAndLayerIdColor`,`vec4`);let f=l&&!i(n);f&&(e.varyings.add(`emissiveStrength`,`float`),e.varyings.add(`emissiveSource`,`float`)),e.include(t),r.include(h,n),r.code.add(s`
3
3
  float readElevationOffset() {
4
4
  return ${d.getTextureAttribute(`elevationOffset`)};
5
5
  }
6
6
 
7
7
  void forwardEmissiveStrength() {
8
8
  ${c(f,s`emissiveStrength = clamp(${d.getTextureAttribute(`emissiveStrength`)}, 0.0, maxEmissiveStrength);
9
- emissiveSource = ${d.getTextureAttribute(`emissiveSourceMode`)} == 0u ? 0 : 1;`)}
9
+ emissiveSource = ${d.getTextureAttribute(`emissiveSourceMode`)} == 0u ? 0.0 : 1.0;`)}
10
10
  }
11
11
 
12
12
  void forwardObjectAndLayerIdColor() {
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{MaskedColorDefinition as e,CreateMaskedFromUInt8NaNColor as t,MultiplyMaskedColors as n}from"./MaskedColor.glsl.js";import{glsl as r}from"../../shaderModules/glsl.js";import{IntegerPassUniform as i}from"../../shaderModules/IntegerPassUniform.js";import{colorMixModes as a}from"../../../materials/internal/MaterialUtil.js";function o(o,s){o.varyings.add(`colorMixMode`,`int`),o.varyings.add(`opacityMixMode`,`int`),o.vertex.uniforms.add(new i(`symbolColorMixMode`,e=>a[e.colorMixMode])),s.hasSymbolColors?(o.vertex.include(e),o.vertex.include(t),o.vertex.include(n),o.attributes.add(`symbolColor`,`vec4`),o.vertex.code.add(r`
2
+ import{MaskedColorDefinition as e,CreateMaskedFromUInt8NaNColor as t,MultiplyMaskedColors as n}from"./MaskedColor.glsl.js";import{glsl as r}from"../../shaderModules/glsl.js";import{IntegerPassUniform as i}from"../../shaderModules/IntegerPassUniform.js";import{colorMixModes as a}from"../../../materials/internal/MaterialUtil.js";function o(o,s){o.varyings.add(`colorMixMode`,`float`),o.varyings.add(`opacityMixMode`,`float`),o.vertex.uniforms.add(new i(`symbolColorMixMode`,e=>a[e.colorMixMode])),s.hasSymbolColors?(o.vertex.include(e),o.vertex.include(t),o.vertex.include(n),o.attributes.add(`symbolColor`,`vec4`),o.vertex.code.add(r`
3
3
  MaskedColor applySymbolColor(MaskedColor color) {
4
4
  return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${`symbolColor`}));
5
5
  }
@@ -7,7 +7,7 @@ import{MaskedColorDefinition as e,CreateMaskedFromUInt8NaNColor as t,MultiplyMas
7
7
  return color;
8
8
  }`),o.vertex.code.add(r`
9
9
  void forwardColorMixMode(bvec4 mask) {
10
- colorMixMode = mask.r ? ${r.int(a.ignore)} : symbolColorMixMode;
11
- opacityMixMode = mask.a ? ${r.int(a.ignore)} : symbolColorMixMode;
10
+ colorMixMode = float(mask.r ? ${r.int(a.ignore)} : symbolColorMixMode) + 0.5;
11
+ opacityMixMode = float(mask.a ? ${r.int(a.ignore)} : symbolColorMixMode) + 0.5;
12
12
  }
13
13
  `)}export{o as SymbolColor};
@@ -11,7 +11,7 @@ import{InstanceColor as e}from"../attributes/InstanceColor.glsl.js";import{Maske
11
11
  }
12
12
 
13
13
  bool shouldCullByOpacity() {
14
- return opacityMixMode != ${c.int(u.ignore)} && vExternalColor.a < alphaCutoff;
14
+ return int(opacityMixMode) != ${c.int(u.ignore)} && vExternalColor.a < alphaCutoff;
15
15
  }
16
16
  `),h.include(a),h.uniforms.add(new s(`opacity`,e=>e.opacity),new s(`layerOpacity`,e=>e.layerOpacity)),h.code.add(c`
17
17
  float getDefaultMaterialOpacity(float textureOpacity) {
@@ -19,7 +19,7 @@ import{InstanceColor as e}from"../attributes/InstanceColor.glsl.js";import{Maske
19
19
  ${l(p.hasVertexColors,`vColor.a * `)} opacity,
20
20
  textureOpacity,
21
21
  vExternalColor.a,
22
- opacityMixMode
22
+ int(opacityMixMode)
23
23
  );
24
24
  }
25
25
  `)}export{f as DefaultMaterialExternalColor};
@@ -1,7 +1,7 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
2
  import{__decorate as e}from"tslib";import{clamp as t}from"../../../../../../core/mathUtils.js";import{isColor as n}from"../ShaderOutput.js";import{ShaderOutputConfiguration as r}from"../ShaderOutputConfiguration.js";import{VertexTextureCoordinates as i}from"../attributes/VertexTextureCoordinates.glsl.js";import{Gamma as a}from"../shading/Gamma.glsl.js";import{Float3DrawUniform as o}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as s}from"../../shaderModules/Float3PassUniform.js";import{FloatDrawUniform as c}from"../../shaderModules/FloatDrawUniform.js";import{FloatPassUniform as l}from"../../shaderModules/FloatPassUniform.js";import{glsl as u}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as d}from"../../shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as f}from"../../shaderModules/Texture2DPassUniform.js";import{parameter as p}from"../../shaderTechnique/ShaderTechniqueConfiguration.js";import{floatBlendReductionFactor as m}from"../../../shaders/floatBlendScale.glsl.js";const h=1;class g extends r{constructor(){super(...arguments),this.emissionSource=0}}e([p({count:8})],g.prototype,`emissionSource`,void 0),e([p()],g.prototype,`hasEmissiveTextureTransform`,void 0);function _(e,r){let{hasEmission:p,emissionSource:h,hasEmissiveTextureTransform:g,bindType:_}=r;if(!n(r.output)||!p)return;let y=e.fragment;if(y.include(a),h===0){y.code.add(`vec4 getEmissions(vec3 symbolColor) { return vec4(0.0);}`);return}let b=h===3||h===4||h===5;b&&(e.include(i,r),y.uniforms.add(_===1?new f(`texEmission`,e=>e.textureEmissive):new d(`texEmission`,e=>e.textureEmissive)));let x=h===2||b;if(x&&y.uniforms.add(_===1?new s(`emissiveBaseColor`,e=>e.emissiveBaseColor):new o(`emissiveBaseColor`,e=>e.emissiveBaseColor)),v(r)){let e=e=>t(e??0,0,m);y.uniforms.add(_===1?new l(`emissiveStrength`,t=>e(t.emissiveStrength)):new c(`emissiveStrength`,t=>e(t.emissiveStrength)))}let S=h===7,C=h===5,w=h===1||h===6||S;y.code.add(u`vec4 getEmissions(vec3 symbolColor) {
3
- vec4 emissions =`),x?C?y.code.add(`emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)`):y.code.add(`vec4(emissiveBaseColor, 1.0)`):w?S?y.code.add(`emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)`):y.code.add(`vec4(linearizeGamma(symbolColor), 1.0)`):y.code.add(`vec4(0.0)`),y.code.add(`;`),b&&(C?y.code.add(u`
4
- if(emissiveSource == 0) {
3
+ vec4 emissions =`),x?C?y.code.add(`emissiveSource < 0.5 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)`):y.code.add(`vec4(emissiveBaseColor, 1.0)`):w?S?y.code.add(`emissiveSource < 0.5 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)`):y.code.add(`vec4(linearizeGamma(symbolColor), 1.0)`):y.code.add(`vec4(0.0)`),y.code.add(`;`),b&&(C?y.code.add(u`
4
+ if(emissiveSource < 0.5) {
5
5
  vec4 emissiveFromTex = textureLookup(texEmission, ${g?`emissiveUV`:`vuv0`});
6
6
  emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);
7
7
  }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../../../../core/has.js";import{generateUID as e}from"../../../../core/uid.js";import{getMetersPerUnitForSR as t}from"../../../../core/units.js";import{subtract as n,distance as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as o}from"../../../../geometry/projection/projectBuffer.js";import{Attribute as s}from"./Attribute.js";import{Geometry as c}from"./Geometry.js";import{fromValues as l}from"./LocalOriginFactory.js";import{Object3D as u}from"./Object3D.js";import{gridLocalOriginFactory as d}from"./testUtils.js";import{WebGLLayer as f}from"./WebGLLayer.js";import{RibbonLineMaterial as p}from"../materials/RibbonLineMaterial.js";class m{constructor(n){this._originSR=n,this._rootOriginId=`root/`+e(),this._origins=new Map,this._objects=new Map,this._gridSize=5e5,this._originSR?.isGeographic&&(this._gridSize/=t(this._originSR)),this._baselineDistance=this._gridSize*.5;let r=this._baselineDistance*g;this._baselineObjectSize=r/_}getOrigin(e){let t=this._origins.get(this._rootOriginId);if(t==null){let t=d.rootOrigin;if(t!=null)return this._origins.set(this._rootOriginId,l(t[0],t[1],t[2],this._rootOriginId)),this.getOrigin(e);let n=l(e[0],e[1],e[2],this._rootOriginId);return this._origins.set(this._rootOriginId,n),n}let r=this._gridSize,i=Math.round(e[0]/r),a=Math.round(e[1]/r),o=Math.round(e[2]/r),s=`${i}/${a}/${o}`,c=this._origins.get(s),u=r*.5;if(n(h,e,t.vec3),h[0]=Math.abs(h[0]),h[1]=Math.abs(h[1]),h[2]=Math.abs(h[2]),h[0]<u&&h[1]<u&&h[2]<u){if(c){let t=Math.max(...h);if(n(h,e,c.vec3),h[0]=Math.abs(h[0]),h[1]=Math.abs(h[1]),h[2]=Math.abs(h[2]),Math.max(...h)<t)return c}return t}return c||(c=l(i*r,a*r,o*r,s),this._origins.set(s,c)),c}needsOriginUpdate(e,t,n){let i=r(e.vec3,t),a=Math.max(1,n/this._baselineObjectSize);return i>this._baselineDistance*a}_drawOriginBox(e,t=a(1,1,0,1)){let n=window.view,r=n.stage,i=t.toString();if(!this._objects.has(i)){this._material=new p({width:2,color:t},!1);let e=new f(r,{pickable:!1}),n=new u({castShadow:!1});e.add(n),this._objects.set(i,n)}let l=this._objects.get(i),d=[0,1,5,4,0,2,1,7,6,2,0,1,3,7,5,4,6,2,0],m=d.length,h=Array(m*3),g=[],_=this._gridSize*.5;for(let t=0;t<m;t++)h[t*3]=e[0]+(d[t]&1?_:-_),h[t*3+1]=e[1]+(d[t]&2?_:-_),h[t*3+2]=e[2]+(d[t]&4?_:-_),t>0&&g.push(t-1,t);o(h,this._originSR,0,h,n.renderSpatialReference,0,m);let v=new c(this._material,[[`position`,new s(h,g,3,!0)]],null);l.addGeometry(v)}get test(){}}const h=i(),g=2**-23,_=.05;export{m as GridLocalOriginFactory};
2
+ import"../../../../core/has.js";import{generateUID as e}from"../../../../core/uid.js";import{getMetersPerUnitForSR as t}from"../../../../core/units.js";import{subtract as n,distance as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as o}from"../../../../geometry/projection/projectBuffer.js";import{Attribute as s}from"./Attribute.js";import{Geometry as c}from"./Geometry.js";import{fromValues as l}from"./LocalOriginFactory.js";import{Object3D as u}from"./Object3D.js";import{gridLocalOriginFactory as d}from"./testUtils.js";import{WebGLLayer as f}from"./WebGLLayer.js";import{RibbonLineMaterial as p}from"../materials/RibbonLineMaterial.js";class m{constructor(n){this._originSR=n,this._rootOriginId=`root/`+e(),this._origins=new Map,this._objects=new Map,this._gridSize=5e5,this._originSR?.isGeographic&&(this._gridSize/=t(this._originSR)),this._baselineDistance=this._gridSize*.5;let r=this._baselineDistance*g;this._baselineObjectSize=r/_}getOrigin(e){let t=this._origins.get(this._rootOriginId);if(t==null){let t=d.rootOrigin;if(t!=null)return this._origins.set(this._rootOriginId,l(t[0],t[1],t[2],this._rootOriginId)),this.getOrigin(e);let n=l(e[0],e[1],e[2],this._rootOriginId);return this._origins.set(this._rootOriginId,n),n}let r=this._gridSize,i=Math.round(e[0]/r),a=Math.round(e[1]/r),o=Math.round(e[2]/r),s=`${i}/${a}/${o}`,c=this._origins.get(s),u=r*.5;if(n(h,e,t.vec3),h[0]=Math.abs(h[0]),h[1]=Math.abs(h[1]),h[2]=Math.abs(h[2]),h[0]<u&&h[1]<u&&h[2]<u){if(c){let t=Math.max(...h);if(n(h,e,c.vec3),h[0]=Math.abs(h[0]),h[1]=Math.abs(h[1]),h[2]=Math.abs(h[2]),Math.max(...h)<t)return c}return t}return c||(c=l(i*r,a*r,o*r,s),this._origins.set(s,c)),c}needsOriginUpdate(e,t,n){let i=r(e.vec3,t),a=Math.max(1,n/this._baselineObjectSize);return i>this._baselineDistance*a}_drawOriginBox(e,t=a(1,1,0,1)){let n=window.view,r=n.stage,i=t.toString();if(!this._objects.has(i)){this._material=new p({width:2,color:t},n);let e=new f(r,{pickable:!1}),a=new u({castShadow:!1});e.add(a),this._objects.set(i,a)}let l=this._objects.get(i),d=[0,1,5,4,0,2,1,7,6,2,0,1,3,7,5,4,6,2,0],m=d.length,h=Array(m*3),g=[],_=this._gridSize*.5;for(let t=0;t<m;t++)h[t*3]=e[0]+(d[t]&1?_:-_),h[t*3+1]=e[1]+(d[t]&2?_:-_),h[t*3+2]=e[2]+(d[t]&4?_:-_),t>0&&g.push(t-1,t);o(h,this._originSR,0,h,n.renderSpatialReference,0,m);let v=new c(this._material,[[`position`,new s(h,g,3,!0)]],null);l.addGeometry(v)}get test(){}}const h=i(),g=2**-23,_=.05;export{m as GridLocalOriginFactory};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import has from"../../../../core/has.js";import{disposeMaybe as e}from"../../../../core/maybe.js";import{ScreenSpaceGeometry as t}from"../effects/ScreenSpaceGeometry.js";import{createEmptyTexture as n}from"./glUtil3D.js";import{IndexBufferCache as r}from"../materials/renderers/IndexBufferCache.js";import{TextureBufferCache as i}from"../materials/renderers/TextureBufferCache.js";import{VaoCache as a}from"../materials/renderers/VaoCache.js";import{VboCache as o}from"../materials/renderers/VboCache.js";import{RenderingContext as s}from"../../../webgl/RenderingContext.js";class c extends s{constructor(e,r){super(e,r),this.emptyTexture=n(this),this._vaoCaches=new Map,this._vboCaches=new Map,this._indexBufferCache=null,this._textureBufferCaches=new Map,this.debugBoundTechnique=``,this._refCount=1,this._newCache=r.newCache,this._screen=new t(this)}configure(e){super.configure(e),this._newCache=e.newCache}destroy(){this._vaoCaches.forEach(e=>e.dispose()),this._vaoCaches.clear(),this._vboCaches.forEach(e=>e.dispose()),this._vboCaches.clear(),this._indexBufferCache=e(this._indexBufferCache),this._textureBufferCaches.forEach(e=>e.dispose()),this._textureBufferCaches.clear(),!(--this._refCount>0)&&this.dispose()}ref(){++this._refCount}get refCount(){return this._refCount}dispose(){this.emptyTexture.dispose(),this._screen.destroy(),this._screen=null,super.dispose(),this._vaoCaches.forEach(e=>e.dispose()),this._vaoCaches.clear(),this._vboCaches.forEach(e=>e.dispose()),this._vboCaches.clear(),this._indexBufferCache?.dispose(),this._indexBufferCache=null,this._textureBufferCaches.forEach(e=>e.dispose()),this._textureBufferCaches.clear()}get newCache(){return this._newCache}get screen(){return this._screen}getVaoCache(e){let t=JSON.stringify(e),n=this._vaoCaches.get(t);if(n)return n;let r=new a(this,e);return this._vaoCaches.set(t,r),r}getVboCache(e){let t=JSON.stringify(e),n=this._vboCaches.get(t);if(n)return n;let r=new o(this,e);return this._vboCaches.set(t,r),r}get indexBufferCache(){return this._indexBufferCache??=new r(this),this._indexBufferCache}getTextureBufferCache(e){let t=JSON.stringify(e),n=this._textureBufferCaches.get(t);if(n)return n;let r=new i(this,e);return this._textureBufferCaches.set(t,r),r}bindTechnique(e,t,n,r){return this.debugBoundTechnique=e.declaredClass,this.useProgram(e.program),this.setPipelineState(e.getPipeline(t,n)),e.program.bind(t),e.program.bindPass(t,n),r&&e.program.bindDraw(t,n,r),e.program}get isAssumedMetalDriver(){if(this._isAssumedMetalDriver==null&&(this._isAssumedMetalDriver=!!has(`ios`)||!!has(`safari`),!this._isAssumedMetalDriver&&has(`mac`)&&has(`chrome`))){let e=this.capabilities.rendererInfo?.getUnmaskedRenderer().toLowerCase(),t=e?.includes(`apple`)&&e?.includes(`angle`)&&e?.includes(`metal`);this._isAssumedMetalDriver=t??!0}return this._isAssumedMetalDriver}get test(){}}export{c as RenderingContext};
2
+ import has from"../../../../core/has.js";import{disposeMaybe as e}from"../../../../core/maybe.js";import{ScreenSpaceGeometry as t}from"../effects/ScreenSpaceGeometry.js";import{createEmptyTexture as n}from"./glUtil3D.js";import{IndexBufferCache as r}from"../materials/renderers/IndexBufferCache.js";import{TextureBufferCache as i}from"../materials/renderers/TextureBufferCache.js";import{VaoCache as a}from"../materials/renderers/VaoCache.js";import{VboCache as o}from"../materials/renderers/VboCache.js";import{RenderingContext as s}from"../../../webgl/RenderingContext.js";class c extends s{constructor(e,r){super(e,r),this.emptyTexture=n(this),this._vaoCaches=new Map,this._vboCaches=new Map,this._indexBufferCache=null,this._textureBufferCaches=new Map,this.debugBoundTechnique=``,this._refCount=1,this._newCache=r.newCache,this._screen=new t(this)}configure(e){super.configure(e),this._newCache=e.newCache,this._isAssumedMetalDriver=null}destroy(){this._vaoCaches.forEach(e=>e.dispose()),this._vaoCaches.clear(),this._vboCaches.forEach(e=>e.dispose()),this._vboCaches.clear(),this._indexBufferCache=e(this._indexBufferCache),this._textureBufferCaches.forEach(e=>e.dispose()),this._textureBufferCaches.clear(),!(--this._refCount>0)&&this.dispose()}ref(){++this._refCount}get refCount(){return this._refCount}dispose(){this.emptyTexture.dispose(),this._screen.destroy(),this._screen=null,super.dispose(),this._vaoCaches.forEach(e=>e.dispose()),this._vaoCaches.clear(),this._vboCaches.forEach(e=>e.dispose()),this._vboCaches.clear(),this._indexBufferCache?.dispose(),this._indexBufferCache=null,this._textureBufferCaches.forEach(e=>e.dispose()),this._textureBufferCaches.clear()}get newCache(){return this._newCache}get screen(){return this._screen}getVaoCache(e){let t=JSON.stringify(e),n=this._vaoCaches.get(t);if(n)return n;let r=new a(this,e);return this._vaoCaches.set(t,r),r}getVboCache(e){let t=JSON.stringify(e),n=this._vboCaches.get(t);if(n)return n;let r=new o(this,e);return this._vboCaches.set(t,r),r}get indexBufferCache(){return this._indexBufferCache??=new r(this),this._indexBufferCache}getTextureBufferCache(e){let t=JSON.stringify(e),n=this._textureBufferCaches.get(t);if(n)return n;let r=new i(this,e);return this._textureBufferCaches.set(t,r),r}bindTechnique(e,t,n,r){return this.debugBoundTechnique=e.declaredClass,this.useProgram(e.program),this.setPipelineState(e.getPipeline(t,n)),e.program.bind(t),e.program.bindPass(t,n),r&&e.program.bindDraw(t,n,r),e.program}get isAssumedMetalDriver(){if(this._isAssumedMetalDriver==null&&(this._isAssumedMetalDriver=!!has(`ios`)||!!has(`safari`),!this._isAssumedMetalDriver&&has(`mac`)&&has(`chrome`))){let e=this.capabilities.rendererInfo?.getUnmaskedRenderer().toLowerCase(),t=e?.includes(`angle`)&&e?.includes(`metal`);this._isAssumedMetalDriver=t??!0}return this._isAssumedMetalDriver}get test(){}}export{c as RenderingContext};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as C,closestLineSegmentPoint as w,projectPoint as T,projectPointFraction as E,create as D}from"../../../../geometry/support/lineSegment.js";import{fromPoints as O,signedDistance as k,getNormal as ee,create as A}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as j,BufferViewFloat as M,BufferViewVec4Unorm8 as N,BufferViewVec4f16 as te,BufferViewUint32 as ne}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as re,isColor as ie,isDepth as ae,isColorHighlightOLIDOrDepth as oe,is2DGeometryOutput as se}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as ce}from"../effects/geometry/olidUtils.js";import le from"../lib/GLMaterial.js";import{LineMaterial as ue}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as de,screenPolygonIntersectsBufferedSegment as fe}from"../lib/screenPolygonOverlapUtils.js";import{Hit as pe,DrapedHit as me}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as he}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as ge,assert as P}from"../lib/Util.js";import{isImagePattern as _e}from"./lineStippleUtils.js";import{VisualVariablePassParameters as ve}from"./VisualVariablePassParameters.js";import{writeColor as ye}from"./internal/bufferWriterUtils.js";import{n as be}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as xe,getTextureBufferLayout as Se}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Ce}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as we}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Te}from"../../../../webscene/support/AlphaCutoff.js";class Ee extends ue{constructor(e,t){super(e,Oe),this.produces=new Map([[2,e=>re(e)||ie(e)&&this.parameters.renderOccluded===8],[3,e=>ae(e)],[10,e=>oe(e)&&this.parameters.renderOccluded===8],[11,e=>oe(e)&&this.parameters.renderOccluded===8],[4,e=>ie(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>ie(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>se(e)]]),this._configuration=new we(t)}updateConfiguration(e){super.updateConfiguration(e);let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=Ne(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Me(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n}get visible(){return this.parameters.color[3]>=Te||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>Te}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=r[0],u=r[1],d=Ae(c,o,s,this.parameters.usesWorldSizedWidth()),f=Number.MAX_VALUE,p=0;for(let n of je(z,B,this.parameters,e)){let e=l-z[0],r=u-z[1],i=B[0]-z[0],a=B[1]-z[1],o=i*e+a*r,s=i*i+a*a,c=t(o/s,0,1),d=i*c-e,m=a*c-r,h=d*d+m*m;h<f&&(f=h,p=n)}f<d*d&&i(a.distance,a.renderDistance,a.normal,p)}intersectRay(t,n,r,i,a,s){let{options:c,camera:_,rayBegin:v,rayEnd:y}=r;if(!c.selectionMode||!t.visible||!_)return;if(!ge(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let b=t.attributes,x=b.get(`position`).data,T=this._getLineSize(b),E=Ie;o(E,r.point);let D=T*_.pixelRatio,A=$*_.pixelRatio,j=D/2+A;l(X[0],E[0]-j,E[1]+j,0),l(X[1],E[0]+j,E[1]+j,0),l(X[2],E[0]+j,E[1]-j,0),l(X[3],E[0]-j,E[1]-j,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(X[e],Z[e]))return;O(_.eye,Z[0],Z[1],He),O(_.eye,Z[1],Z[2],Ue),O(_.eye,Z[2],Z[3],We),O(_.eye,Z[3],Z[0],Q);let M=Number.MAX_VALUE,N=0;for(let e of this._forEachTransformedLineSegment(L,R,x,n,I(this.parameters,b))){if(k(He,L)<0&&k(He,R)<0||k(Ue,L)<0&&k(Ue,R)<0||k(We,L)<0&&k(We,R)<0||k(Q,L)<0&&k(Q,R)<0)continue;let t=_.projectToRenderScreen(L,G),n=_.projectToRenderScreen(R,K);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(U,L,R);let e=_.frustum,n=-k(e[4],L)/d(U,ee(e[4]));if(f(U,U,n),p(L,L,U),!_.projectToRenderScreen(L,t))continue}else if(t[2]>0&&n[2]<0){u(U,R,L);let e=_.frustum,t=-k(e[4],R)/d(U,ee(e[4]));if(f(U,U,t),p(R,R,U),!_.projectToRenderScreen(R,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let r=S(t,n,q),i=C(r,E);if(!(i>=M)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(r,L,R,E,_,T,A);if(i>=e*e)continue}M=i,m(ze,L),m(Be,R),N=e}}if(M<j*j){let e=Number.MAX_VALUE;if(w(S(ze,Be,q),S(v,y,Ve),W)){u(W,W,v);let t=h(W);f(W,W,1/t),e=t/g(v,y)}s(e,e,W,N)}}intersectScreenPolygon(t,n,r,i){let{options:a,camera:o,screenPolygonPrimitiveProcessor:s}=r;if(!a.selectionMode||!t.visible)return null;if(!ge(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let c=t.attributes,l=c.get(`position`).data,u=this._getLineSize(c),d=$,f=d*o.pixelRatio,p=new pe(4);for(let e of this._forEachTransformedLineSegment(L,R,l,n,I(this.parameters,c)))for(let[t,n]of s.processLineSegment(Ke,L,R)){if(!de(o,t,n,G,K))continue;let r=S(G,K,q),a=u/2+d;this.parameters.screenSizePerspective&&(_(Ie,G,K,.5),a=Math.max(a,this.computeScreenSizePerspectiveWidth(r,t,n,Ie,o,u,f)/o.pixelRatio)),o.renderToScreen(G,Le),o.renderToScreen(K,Re),fe(i,Le,Re,a)&&(T(S(t,n,Ve),o.eye,V),p.updateIfCloserFromValues(g(o.eye,V),e,V,null))}return p}intersectScreenPolygonDraped({attributes:e},t,n,r,i,a){if(!n.options.selectionMode)return null;let o=Ae(this._getLineSize(e,!0),i,a,this.parameters.usesWorldSizedWidth());for(let n of je(z,B,this.parameters,e,t))if(fe(r,z,B,o))return new me(n);return null}createBufferWriter(){return new ke(xe(this.parameters),Se(this.parameters),this.parameters)}createGLMaterial(e){return new De(e)}validateParameters(e){e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=E(e,r);_(V,t,n,s),v(Fe,V,i.viewMatrix);let c=h(Fe),l=this.computeCameraAbsCosAngle(V,i,this._configuration.spherical);return Pe.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Pe.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(W,e):l(W,0,0,1),u(H,e,t.eye),y(H,H),Math.abs(d(W,H))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=e.get(`sizeFeatureAttribute`).data[0];Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has(`size`)&&(r*=e.get(`size`).data[0]);return r}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.length-2:n.length-5;for(let i=0;i<a;i+=3){e[0]=n[i]+r[12],e[1]=n[i+1]+r[13],e[2]=n[i+2]+r[14];let a=(i+3)%n.length;t[0]=n[a]+r[12],t[1]=n[a+1]+r[13],t[2]=n[a+2]+r[14],yield i/3}}}class De extends le{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Ce,e)}}class Oe extends ve{constructor(){super(...arguments),this._width=0,this.color=x,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return _e(this.stipplePattern)&&this.stippleTexture!=null}}class ke{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.numJoinSubdivisions=Ne(this._parameters.join,this._parameters.stipplePattern!=null)}_isClosed(e){return I(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get(`position`).data.length/3+(this._isClosed(e)?3:2)}elementCount(e){let t=e.get(`position`).indices.length/2+1,n=this._isClosed(e),r=n?2:4,i=+!n,a=n?t:t-1,o=this.numJoinSubdivisions*2+4;return r+=(a-i)*o,r+=2,this._parameters.wireframe&&(r=2+(r-2)*4),r}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(e,n,r,i)}_writeTextureBuffer(e,t,n){let r=t.get(`position`),i=r.data.length/3,a=this._isClosed(t),{buffer:o,offset:s}=n,c=o.getField(`position`,j),l=o.getField(`u0`,M),u=o.getField(`sizeFeatureAttribute`,M),d=o.getField(`size`,M),f=o.getField(`colorFeatureAttribute`,M),p=o.getField(`color`,N),h=o.getField(`olidColor`,N),_=o.getField(`timeStamps`,te),v=o.getField(`opacityFeatureAttribute`,M),y=t.get(`sizeFeatureAttribute`)?.data,b=t.get(`size`)?.data,x=t.get(`colorFeatureAttribute`)?.data,S=t.get(`color`)?.data,C=t.get(`opacityFeatureAttribute`)?.data,w=t.get(`distanceToStart`)?.data,T=t.get(`timeStamps`);P(c!==null,`Expected valid position field in texture buffer`),P(l!==null,`Expected valid u0 field in texture buffer`);let E=0;for(let t=0;t<i;++t){this._getTransformedPosition(Y,r.data,t,e),t>0&&(w==null?E+=g(J,Y):E=w[t]??E);let n=s+t+1;if(c.setVec(n,Y),l.set(n,E),m(J,Y),u&&u.set(n,y?.length===1?y[0]:y?.[t]??0),d&&d.set(n,b?.length===1?b[0]:b?.[t]??1),f&&f.set(n,x?.length===1?x[0]:x?.[t]??0),p){if(S!=null){let e=Math.min(t*4,S.length-4);p.setValues(n,S[e],S[e+1],S[e+2],S[e+3])}else p.setValues(n,1,1,1,1)}v&&v.set(n,C?.length===1?C[0]:C?.[t]??0)}if(_!=null&&T!=null){P(T.size===4);let e=T.data;for(let t=0;t<i;++t){let n=t*4,r=s+t+1;_.set(r,0,e[n]),_.set(r,1,e[n+1]),_.set(r,2,e[n+2]),_.set(r,3,e[n+3])}}if(a){let e=s,t=s+1,n=s+2,r=s+i,a=r+1,u=r+2;o.copyItem(r,e),o.copyItem(t,a),o.copyItem(n,u),c.getVec(r,J),c.getVec(t,Y);let d=w?.[i]??E+g(J,Y);l.set(a,d)}else{let e=s,t=s+1,n=s+i,r=n+1;o.copyItem(t,e),o.copyItem(n,r)}let D=t.get(`olidColor`);ce()&&D!=null&&h!=null&&ye(D,4,h,s)}_writeVertexBuffer(e,t,n,r){let{buffer:i,offset:a}=n,{layout:o}=this,s=t.get(`position`),c=s.indices,l=s.data.length/3,u=this._isClosed(t),d=l+(u?3:2);c&&c.length!==2*(l-1)&&console.warn(`RibbonLineMaterial does not support indices`);let f=i.getField(`textureElementIndex`,ne);P(f!=null,`Missing texture buffer index field`),P(r!=null,`Using a texture layout, but the texture range for this instance was not provided`);let p=r.from;P(r.numElements===d,`Expected number of elements in TextureBuffer to equal number of points`);let m=new Float32Array(i.buffer),h=new Float16Array(i.buffer),g=new Uint32Array(i.buffer),_=o.stride/4,v=a*_,y=v,b=m.BYTES_PER_ELEMENT/h.BYTES_PER_ELEMENT,x=(e,t,n)=>{let r=n+1;g[v]=p+r,v++;let i=v*b;h[i++]=e,h[i++]=t,v=Math.ceil(i/b)};v+=_;let S=0,C=0;u?(S=0,C=l):(x(1,-4,0),x(1,4,0),S=1,C=l-1);for(let e=S;e<C;e++){x(0,-1,e),x(0,1,e);let t=this.numJoinSubdivisions;for(let n=0;n<t;++n){let r=(n+1)/(t+1);x(r,-1,e),x(r,1,e)}x(1,-2,e),x(1,2,e)}u?(x(0,-1,C),x(0,1,C)):(x(0,-5,C),x(0,5,C)),F(m,y+_,m,y,_),v=F(m,v-_,m,v,_),this._parameters.wireframe&&this._addWireframeVertices(i,y,v,_)}_getTransformedPosition(e,t,n,r){let i=n*3;l(e,t[i+0],t[i+1],t[i+2]),r&&v(e,e,r)}_addWireframeVertices(e,t,n,r){let i=new Uint8Array(e.buffer,n*Float32Array.BYTES_PER_ELEMENT),a=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(n-t)*Float32Array.BYTES_PER_ELEMENT),o=r*Float32Array.BYTES_PER_ELEMENT,s=0,c=e=>s=F(a,e,i,s,o);for(let e=0;e<=a.length-4*o;e+=o*2)c(e),c(e+2*o),c(e+1*o),c(e+2*o),c(e+1*o),c(e+3*o)}}function F(e,t,n,r,i){for(let a=0;a<i;a++)n[r++]=e[t++];return r}function I(e,t){return e.isClosed?t.get(`position`).indices.length>2:!1}function Ae(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*je(e,t,n,r,i){let a=r.get(`position`).data,c=I(n,r)?a.length-2:a.length-5,l=i?.[0]??0,u=i?.[1]??0;s(e,a[0]+l,a[1]+u);for(let n=3;n<c+3;n+=3){let r=n%a.length;s(t,a[r]+l,a[r+1]+u),yield n/3,o(e,t)}}function Me(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}function Ne(e,t){let n=+!!t;switch(e){case`miter`:case`bevel`:return n;case`round`:return be+n}}const Pe=new he,L=b(),R=b(),z=c(),B=c(),V=b(),Fe=b(),H=b(),U=b(),W=b(),Ie=b(),G=n(),K=n(),Le=r(),Re=r(),ze=b(),Be=b(),q=D(),Ve=D(),J=b(),Y=b(),X=[n(),n(),n(),n()],Z=[b(),b(),b(),b()],He=A(),Ue=A(),We=A(),Q=A(),$=4,Ge={getDrapedRibbonLineMaxDistance:Ae},Ke=[b(),b()];export{Oe as Parameters,Ee as RibbonLineMaterial,Ge as test};
2
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as C,closestLineSegmentPoint as w,projectPoint as T,projectPointFraction as E,create as D}from"../../../../geometry/support/lineSegment.js";import{fromPoints as O,signedDistance as k,getNormal as ee,create as A}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as j,BufferViewFloat as M,BufferViewVec4Unorm8 as N,BufferViewVec4f16 as te,BufferViewUint32 as ne}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as re,isColor as ie,isDepth as ae,isColorHighlightOLIDOrDepth as oe,is2DGeometryOutput as se}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as ce}from"../effects/geometry/olidUtils.js";import le from"../lib/GLMaterial.js";import{LineMaterial as ue}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as de,screenPolygonIntersectsBufferedSegment as fe}from"../lib/screenPolygonOverlapUtils.js";import{Hit as pe,DrapedHit as me}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as he}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as ge,assert as P}from"../lib/Util.js";import{isImagePattern as _e}from"./lineStippleUtils.js";import{VisualVariablePassParameters as ve}from"./VisualVariablePassParameters.js";import{writeColor as ye}from"./internal/bufferWriterUtils.js";import{n as be}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as xe,getTextureBufferLayout as Se}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Ce}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as we}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Te}from"../../../../webscene/support/AlphaCutoff.js";class Ee extends ue{constructor(e,t){super(e,Oe),this.produces=new Map([[2,e=>re(e)||ie(e)&&this.parameters.renderOccluded===8],[3,e=>ae(e)],[10,e=>oe(e)&&this.parameters.renderOccluded===8],[11,e=>oe(e)&&this.parameters.renderOccluded===8],[4,e=>ie(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>ie(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>se(e)]]),this._configuration=new we(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=Ne(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Me(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n}get visible(){return this.parameters.color[3]>=Te||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>Te}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=r[0],u=r[1],d=Ae(c,o,s,this.parameters.usesWorldSizedWidth()),f=Number.MAX_VALUE,p=0;for(let n of je(z,B,this.parameters,e)){let e=l-z[0],r=u-z[1],i=B[0]-z[0],a=B[1]-z[1],o=i*e+a*r,s=i*i+a*a,c=t(o/s,0,1),d=i*c-e,m=a*c-r,h=d*d+m*m;h<f&&(f=h,p=n)}f<d*d&&i(a.distance,a.renderDistance,a.normal,p)}intersectRay(t,n,r,i,a,s){let{options:c,camera:_,rayBegin:v,rayEnd:y}=r;if(!c.selectionMode||!t.visible||!_)return;if(!ge(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let b=t.attributes,x=b.get(`position`).data,T=this._getLineSize(b),E=Ie;o(E,r.point);let D=T*_.pixelRatio,A=$*_.pixelRatio,j=D/2+A;l(X[0],E[0]-j,E[1]+j,0),l(X[1],E[0]+j,E[1]+j,0),l(X[2],E[0]+j,E[1]-j,0),l(X[3],E[0]-j,E[1]-j,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(X[e],Z[e]))return;O(_.eye,Z[0],Z[1],He),O(_.eye,Z[1],Z[2],Ue),O(_.eye,Z[2],Z[3],We),O(_.eye,Z[3],Z[0],Q);let M=Number.MAX_VALUE,N=0;for(let e of this._forEachTransformedLineSegment(L,R,x,n,I(this.parameters,b))){if(k(He,L)<0&&k(He,R)<0||k(Ue,L)<0&&k(Ue,R)<0||k(We,L)<0&&k(We,R)<0||k(Q,L)<0&&k(Q,R)<0)continue;let t=_.projectToRenderScreen(L,G),n=_.projectToRenderScreen(R,K);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(U,L,R);let e=_.frustum,n=-k(e[4],L)/d(U,ee(e[4]));if(f(U,U,n),p(L,L,U),!_.projectToRenderScreen(L,t))continue}else if(t[2]>0&&n[2]<0){u(U,R,L);let e=_.frustum,t=-k(e[4],R)/d(U,ee(e[4]));if(f(U,U,t),p(R,R,U),!_.projectToRenderScreen(R,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let r=S(t,n,q),i=C(r,E);if(!(i>=M)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(r,L,R,E,_,T,A);if(i>=e*e)continue}M=i,m(ze,L),m(Be,R),N=e}}if(M<j*j){let e=Number.MAX_VALUE;if(w(S(ze,Be,q),S(v,y,Ve),W)){u(W,W,v);let t=h(W);f(W,W,1/t),e=t/g(v,y)}s(e,e,W,N)}}intersectScreenPolygon(t,n,r,i){let{options:a,camera:o,screenPolygonPrimitiveProcessor:s}=r;if(!a.selectionMode||!t.visible)return null;if(!ge(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let c=t.attributes,l=c.get(`position`).data,u=this._getLineSize(c),d=$,f=d*o.pixelRatio,p=new pe(4);for(let e of this._forEachTransformedLineSegment(L,R,l,n,I(this.parameters,c)))for(let[t,n]of s.processLineSegment(Ke,L,R)){if(!de(o,t,n,G,K))continue;let r=S(G,K,q),a=u/2+d;this.parameters.screenSizePerspective&&(_(Ie,G,K,.5),a=Math.max(a,this.computeScreenSizePerspectiveWidth(r,t,n,Ie,o,u,f)/o.pixelRatio)),o.renderToScreen(G,Le),o.renderToScreen(K,Re),fe(i,Le,Re,a)&&(T(S(t,n,Ve),o.eye,V),p.updateIfCloserFromValues(g(o.eye,V),e,V,null))}return p}intersectScreenPolygonDraped({attributes:e},t,n,r,i,a){if(!n.options.selectionMode)return null;let o=Ae(this._getLineSize(e,!0),i,a,this.parameters.usesWorldSizedWidth());for(let n of je(z,B,this.parameters,e,t))if(fe(r,z,B,o))return new me(n);return null}createBufferWriter(){return new ke(xe(this.parameters),Se(this.parameters),this.parameters,this._isAssumedMetalDriver)}createGLMaterial(e){return new De(e)}validateParameters(e){e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=E(e,r);_(V,t,n,s),v(Fe,V,i.viewMatrix);let c=h(Fe),l=this.computeCameraAbsCosAngle(V,i,this._configuration.spherical);return Pe.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Pe.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(W,e):l(W,0,0,1),u(H,e,t.eye),y(H,H),Math.abs(d(W,H))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=e.get(`sizeFeatureAttribute`).data[0];Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has(`size`)&&(r*=e.get(`size`).data[0]);return r}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.length-2:n.length-5;for(let i=0;i<a;i+=3){e[0]=n[i]+r[12],e[1]=n[i+1]+r[13],e[2]=n[i+2]+r[14];let a=(i+3)%n.length;t[0]=n[a]+r[12],t[1]=n[a+1]+r[13],t[2]=n[a+2]+r[14],yield i/3}}}class De extends le{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Ce,e)}}class Oe extends ve{constructor(){super(...arguments),this._width=0,this.color=x,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return _e(this.stipplePattern)&&this.stippleTexture!=null}}class ke{constructor(e,t,n,r){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this._isAssumedMetalDriver=r,this.numJoinSubdivisions=Ne(this._parameters.join,this._parameters.stipplePattern!=null)}_isClosed(e){return I(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get(`position`).data.length/3+(this._isClosed(e)?3:2)}elementCount(e){let t=e.get(`position`).indices.length/2+1,n=this._isClosed(e),r=n?2:4,i=+!n,a=n?t:t-1,o=this.numJoinSubdivisions*2+(this._isAssumedMetalDriver?8:4);return r+=(a-i)*o,r+=2,this._parameters.wireframe&&(r=2+(r-2)*4),r}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(e,n,r,i)}_writeTextureBuffer(e,t,n){let r=t.get(`position`),i=r.data.length/3,a=this._isClosed(t),{buffer:o,offset:s}=n,c=o.getField(`position`,j),l=o.getField(`u0`,M),u=o.getField(`sizeFeatureAttribute`,M),d=o.getField(`size`,M),f=o.getField(`colorFeatureAttribute`,M),p=o.getField(`color`,N),h=o.getField(`olidColor`,N),_=o.getField(`timeStamps`,te),v=o.getField(`opacityFeatureAttribute`,M),y=t.get(`sizeFeatureAttribute`)?.data,b=t.get(`size`)?.data,x=t.get(`colorFeatureAttribute`)?.data,S=t.get(`color`)?.data,C=t.get(`opacityFeatureAttribute`)?.data,w=t.get(`distanceToStart`)?.data,T=t.get(`timeStamps`);P(c!==null,`Expected valid position field in texture buffer`),P(l!==null,`Expected valid u0 field in texture buffer`);let E=0;for(let t=0;t<i;++t){this._getTransformedPosition(Y,r.data,t,e),t>0&&(w==null?E+=g(J,Y):E=w[t]??E);let n=s+t+1;if(c.setVec(n,Y),l.set(n,E),m(J,Y),u&&u.set(n,y?.length===1?y[0]:y?.[t]??0),d&&d.set(n,b?.length===1?b[0]:b?.[t]??1),f&&f.set(n,x?.length===1?x[0]:x?.[t]??0),p){if(S!=null){let e=Math.min(t*4,S.length-4);p.setValues(n,S[e],S[e+1],S[e+2],S[e+3])}else p.setValues(n,1,1,1,1)}v&&v.set(n,C?.length===1?C[0]:C?.[t]??0)}if(_!=null&&T!=null){P(T.size===4);let e=T.data;for(let t=0;t<i;++t){let n=t*4,r=s+t+1;_.set(r,0,e[n]),_.set(r,1,e[n+1]),_.set(r,2,e[n+2]),_.set(r,3,e[n+3])}}if(a){let e=s,t=s+1,n=s+2,r=s+i,a=r+1,u=r+2;o.copyItem(r,e),o.copyItem(t,a),o.copyItem(n,u),c.getVec(r,J),c.getVec(t,Y);let d=w?.[i]??E+g(J,Y);l.set(a,d)}else{let e=s,t=s+1,n=s+i,r=n+1;o.copyItem(t,e),o.copyItem(n,r)}let D=t.get(`olidColor`);ce()&&D!=null&&h!=null&&ye(D,4,h,s)}_writeVertexBuffer(e,t,n,r){let{buffer:i,offset:a}=n,{layout:o}=this,s=t.get(`position`),c=s.indices,l=s.data.length/3,u=this._isClosed(t),d=l+(u?3:2);c&&c.length!==2*(l-1)&&console.warn(`RibbonLineMaterial does not support indices`);let f=i.getField(`textureElementIndex`,ne);P(f!=null,`Missing texture buffer index field`),P(r!=null,`Using a texture layout, but the texture range for this instance was not provided`);let p=r.from;P(r.numElements===d,`Expected number of elements in TextureBuffer to equal number of points`);let m=new Float32Array(i.buffer),h=new Float16Array(i.buffer),g=new Uint32Array(i.buffer),_=o.stride/4,v=a*_,y=v,b=m.BYTES_PER_ELEMENT/h.BYTES_PER_ELEMENT,x=(e,t,n,r=!1)=>{let i=n+1;g[v]=p+i,v++;let a=v*b;h[a++]=e,h[a++]=t+(r?Math.sign(t)*8:0),v=Math.ceil(a/b)};v+=_;let S=0,C=0;u?(S=0,C=l):(x(1,-4,0),x(1,4,0),S=1,C=l-1);let w=this._isAssumedMetalDriver;for(let e=S;e<C;e++){x(0,-1,e),x(0,1,e),w&&(x(0,-1,e,!0),x(0,1,e,!0));let t=this.numJoinSubdivisions;for(let n=0;n<t;++n){let r=(n+1)/(t+1);x(r,-1,e,w),x(r,1,e,w)}x(1,-2,e,w),x(1,2,e,w),w&&(x(1,-2,e),x(1,2,e))}u?(x(0,-1,C),x(0,1,C)):(x(0,-5,C),x(0,5,C)),F(m,y+_,m,y,_),v=F(m,v-_,m,v,_),this._parameters.wireframe&&this._addWireframeVertices(i,y,v,_)}_getTransformedPosition(e,t,n,r){let i=n*3;l(e,t[i+0],t[i+1],t[i+2]),r&&v(e,e,r)}_addWireframeVertices(e,t,n,r){let i=new Uint8Array(e.buffer,n*Float32Array.BYTES_PER_ELEMENT),a=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(n-t)*Float32Array.BYTES_PER_ELEMENT),o=r*Float32Array.BYTES_PER_ELEMENT,s=0,c=e=>s=F(a,e,i,s,o);for(let e=0;e<=a.length-4*o;e+=o*2)c(e),c(e+2*o),c(e+1*o),c(e+2*o),c(e+1*o),c(e+3*o)}}function F(e,t,n,r,i){for(let a=0;a<i;a++)n[r++]=e[t++];return r}function I(e,t){return e.isClosed?t.get(`position`).indices.length>2:!1}function Ae(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*je(e,t,n,r,i){let a=r.get(`position`).data,c=I(n,r)?a.length-2:a.length-5,l=i?.[0]??0,u=i?.[1]??0;s(e,a[0]+l,a[1]+u);for(let n=3;n<c+3;n+=3){let r=n%a.length;s(t,a[r]+l,a[r+1]+u),yield n/3,o(e,t)}}function Me(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}function Ne(e,t){let n=+!!t;switch(e){case`miter`:case`bevel`:return n;case`round`:return be+n}}const Pe=new he,L=b(),R=b(),z=c(),B=c(),V=b(),Fe=b(),H=b(),U=b(),W=b(),Ie=b(),G=n(),K=n(),Le=r(),Re=r(),ze=b(),Be=b(),q=D(),Ve=D(),J=b(),Y=b(),X=[n(),n(),n(),n()],Z=[b(),b(),b(),b()],He=A(),Ue=A(),We=A(),Q=A(),$=4,Ge={getDrapedRibbonLineMaxDistance:Ae},Ke=[b(),b()];export{Oe as Parameters,Ee as RibbonLineMaterial,Ge as test};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{LineTechniqueConfiguration as n}from"./LineTechniqueConfiguration.js";const r=16,i=8;class a extends n{constructor(){super(...arguments),this.capType=0,this.animation=2,this.polygonOffsetIndex=0,this.numJoinSubdivisions=1,this.polygonOffset=0,this.writeDepth=!1,this.transparent=!1,this.enableOITOffset=!0,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.roundJoins=!1,this.applyMarkerOffset=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.wireframe=!1,this.imagePattern=!1}get hasAnimation(){return this.animation!==0}get usePerspectiveCorrectStipple(){return this.worldSized&&!this.draped}}e([t({count:3})],a.prototype,`capType`,void 0),e([t({count:4})],a.prototype,`animation`,void 0),e([t({count:16})],a.prototype,`polygonOffsetIndex`,void 0),e([t({count:8})],a.prototype,`numJoinSubdivisions`,void 0),e([t({count:5})],a.prototype,`polygonOffset`,void 0),e([t()],a.prototype,`writeDepth`,void 0),e([t()],a.prototype,`transparent`,void 0),e([t()],a.prototype,`enableOITOffset`,void 0),e([t()],a.prototype,`stippleEnabled`,void 0),e([t()],a.prototype,`stippleOffColorEnabled`,void 0),e([t()],a.prototype,`stipplePreferContinuous`,void 0),e([t()],a.prototype,`roundJoins`,void 0),e([t()],a.prototype,`applyMarkerOffset`,void 0),e([t()],a.prototype,`falloffEnabled`,void 0),e([t()],a.prototype,`innerColorEnabled`,void 0),e([t()],a.prototype,`wireframe`,void 0),e([t()],a.prototype,`imagePattern`,void 0);export{i as NUM_JOIN_SUBDIVISION_COUNT,r as POLYGON_OFFSET_INDEX_COUNT,a as RibbonLineTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{LineTechniqueConfiguration as n}from"./LineTechniqueConfiguration.js";const r=16,i=8;class a extends n{constructor(){super(...arguments),this.capType=0,this.animation=2,this.polygonOffsetIndex=0,this.numJoinSubdivisions=1,this.polygonOffset=0,this.writeDepth=!1,this.transparent=!1,this.enableOITOffset=!0,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.roundJoins=!1,this.applyMarkerOffset=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.wireframe=!1,this.imagePattern=!1,this.useFlatJoinVarying=!1}get hasAnimation(){return this.animation!==0}get usePerspectiveCorrectStipple(){return this.worldSized&&!this.draped}}e([t({count:3})],a.prototype,`capType`,void 0),e([t({count:4})],a.prototype,`animation`,void 0),e([t({count:16})],a.prototype,`polygonOffsetIndex`,void 0),e([t({count:8})],a.prototype,`numJoinSubdivisions`,void 0),e([t({count:5})],a.prototype,`polygonOffset`,void 0),e([t()],a.prototype,`writeDepth`,void 0),e([t()],a.prototype,`transparent`,void 0),e([t()],a.prototype,`enableOITOffset`,void 0),e([t()],a.prototype,`stippleEnabled`,void 0),e([t()],a.prototype,`stippleOffColorEnabled`,void 0),e([t()],a.prototype,`stipplePreferContinuous`,void 0),e([t()],a.prototype,`roundJoins`,void 0),e([t()],a.prototype,`applyMarkerOffset`,void 0),e([t()],a.prototype,`falloffEnabled`,void 0),e([t()],a.prototype,`innerColorEnabled`,void 0),e([t()],a.prototype,`wireframe`,void 0),e([t()],a.prototype,`imagePattern`,void 0),e([t()],a.prototype,`useFlatJoinVarying`,void 0);export{i as NUM_JOIN_SUBDIVISION_COUNT,r as POLYGON_OFFSET_INDEX_COUNT,a as RibbonLineTechniqueConfiguration};
@@ -6,6 +6,7 @@ export interface BreakpointsOwnerProperties extends Partial<Pick<BreakpointsOwne
6
6
  * A mixin that adds [breakpoints](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#breakpoints), [heightBreakpoint](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#heightBreakpoint), [orientation](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#orientation) and
7
7
  * [widthBreakpoint](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#widthBreakpoint) properties to [View2D](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#breakpoints) and [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#breakpoints) classes.
8
8
  *
9
+ * @deprecated since 5.2. Use alternative responsive design techniques such as a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) instead.
9
10
  * @since 4.0
10
11
  */
11
12
  export abstract class BreakpointsOwner {
@@ -28,6 +29,7 @@ export abstract class BreakpointsOwner {
28
29
  * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/styling/#view-size-css-classes) for additional
29
30
  * > information on working with this.
30
31
  *
32
+ * @deprecated since 5.2. Use alternative responsive design techniques such as a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) instead.
31
33
  * @see [Sample: Responsive apps using CSS](https://developers.arcgis.com/javascript/latest/sample-code/view-breakpoints-css/)
32
34
  * @see [MDN Web docs: Media Queries](https://developer.mozilla.org/docs/Web/CSS/Media_Queries)
33
35
  * @example
@@ -75,6 +77,7 @@ export abstract class BreakpointsOwner {
75
77
  * large | The [height](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#height) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#breakpoints). | 993 - 1200
76
78
  * xlarge | The [height](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#height) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#breakpoints). | > 1200
77
79
  *
80
+ * @deprecated since 5.2. Use alternative responsive design techniques such as a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) instead.
78
81
  * @see [Sample: Responsive apps using CSS](https://developers.arcgis.com/javascript/latest/sample-code/view-breakpoints-css/)
79
82
  * @example
80
83
  * reactiveUtils.watch(
@@ -99,6 +102,8 @@ export abstract class BreakpointsOwner {
99
102
  * ---------------|------------
100
103
  * landscape | The [width](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#width) of the view is greater than its [height](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#height).
101
104
  * portrait | The [width](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#width) of the view is equal to or smaller than its [height](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#height).
105
+ *
106
+ * @deprecated since 5.2. Use alternative responsive design techniques such as a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) instead.
102
107
  */
103
108
  get orientation(): BreakpointOrientation;
104
109
  /**
@@ -121,6 +126,7 @@ export abstract class BreakpointsOwner {
121
126
  * large | The [width](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#width) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#breakpoints). | 993 - 1200
122
127
  * xlarge | The [width](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#width) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#breakpoints). | > 1200
123
128
  *
129
+ * @deprecated since 5.2. Use alternative responsive design techniques such as a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) instead.
124
130
  * @see [Sample: Responsive apps using CSS](https://developers.arcgis.com/javascript/latest/sample-code/view-breakpoints-css/)
125
131
  * @example
126
132
  * reactiveUtils.when(