@arcgis/core 4.33.0-next.20250317 → 4.33.0-next.20250319
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.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0b7331613f91a3258352.js +1 -0
- package/assets/esri/core/workers/chunks/2219d970ece5676ca6ee.js +1 -0
- package/assets/esri/core/workers/chunks/3fc18638f8799b85001d.js +1 -0
- package/assets/esri/core/workers/chunks/630a9afdf0523c27ddb6.js +1 -0
- package/assets/esri/core/workers/chunks/657ae4a0461d45044b28.js +1 -0
- package/assets/esri/core/workers/chunks/{23aa7254fffe67e3f1bc.js → 6a97bdd46715fc12e1b4.js} +239 -160
- package/assets/esri/core/workers/chunks/8063e35dacf8f99471d8.js +1 -0
- package/assets/esri/core/workers/chunks/8e20ec4e8e2cfc582fe7.js +319 -0
- package/assets/esri/core/workers/chunks/c528a2ca3b1b73df5a5d.js +1 -0
- package/assets/esri/core/workers/chunks/d787474e78360c925fd9.js +1 -0
- package/assets/esri/core/workers/chunks/{7ded83eb64eff069b761.js → d8b903b4147b090576f2.js} +1 -1
- package/assets/esri/core/workers/chunks/e4290719c8afc2a4ee8c.js +1 -0
- package/assets/esri/core/workers/chunks/e5e1f8ac53c70427a60b.js +1 -0
- package/assets/esri/core/workers/chunks/fc9758006a7135c7d9c3.js +1 -0
- package/assets/esri/core/workers/chunks/fef46b841e8369b30227.js +1 -0
- package/assets/esri/libs/dxtEncoder/dxt_encoder.wasm +0 -0
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +20 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/HUDMaterial.glsl.js +80 -75
- package/chunks/RibbonLine.glsl.js +37 -37
- package/chunks/ShadowCastAccumulate.glsl.js +5 -21
- package/chunks/ShadowHighlight.glsl.js +8 -30
- package/chunks/Terrain.glsl.js +33 -34
- package/copyright.txt +29 -0
- package/core/has.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/geometry/support/HalfFloatArray.js +5 -0
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/buffer/types.js +1 -1
- package/geometry/support/densifyUtils.js +1 -1
- package/interfaces.d.ts +18 -40
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/package.json +2 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
- package/views/2d/layers/graphics/GraphicStoreItem.js +1 -1
- package/views/2d/layers/graphics/densificationConstants.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/support/buffer/glUtil.js +1 -1
- package/views/3d/terrain/PatchGeometry.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainAttributes.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +2 -9
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +4 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +125 -40
- package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
- package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ReadShadowMapConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print/TemplateOptions.js +1 -1
- package/widgets/support/LabeledSwitch.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/048121d433aa9175348c.js +0 -1
- package/assets/esri/core/workers/chunks/0f4a2bdf5bb2f4303b7f.js +0 -1
- package/assets/esri/core/workers/chunks/147e412de9972da16a1d.js +0 -1
- package/assets/esri/core/workers/chunks/1545bd7d6ac7800c71b6.js +0 -1
- package/assets/esri/core/workers/chunks/2b21152c7e2d9c170ed7.js +0 -1
- package/assets/esri/core/workers/chunks/385dd6466fd967ce3ae9.js +0 -1
- package/assets/esri/core/workers/chunks/8d636075e5aa053940fc.js +0 -1
- package/assets/esri/core/workers/chunks/c43c273725b1a33712ec.js +0 -314
- package/assets/esri/core/workers/chunks/c8cd9a3175f516624842.js +0 -1
- package/assets/esri/core/workers/chunks/d630e64463687090db92.js +0 -1
- package/assets/esri/core/workers/chunks/dd6f18bbab50be139d20.js +0 -1
- package/assets/esri/core/workers/chunks/de6864e120243cf0bee8.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l,fromValues as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as f,t as u,n as p,d as h,h as m,c as d,l as g,j as O,g as T,q as S,f as A}from"../../../../chunks/vec32.js";import{create as b,fromValues as E}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as v,create as R,freeze as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as x}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as F}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as P,BufferViewVec3f as _,BufferViewFloat as C,BufferViewVec2f as D,BufferViewVec4f as y}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as N}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as L}from"../../support/debugFlags.js";import{newLayout as j}from"../../support/buffer/InterleavedLayout.js";import{isColorEmissionHighlightOrOID as M,isColorOrColorEmission as U}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as z}from"../core/shaderLibrary/hud/HUD.glsl.js";import{olidEnabled as w}from"../effects/geometry/olidUtils.js";import{GLTextureMaterial as B,GLTextureMaterialBindParameters as V}from"../lib/GLTextureMaterial.js";import{Material as q,RenderOccludedFlag as X}from"../lib/Material.js";import{RenderSlot as G}from"../lib/RenderSlot.js";import{applyScaleFactor as H,applyPrecomputedScaleFactor as W,precomputeScaleFactor as Y}from"../lib/screenSizePerspectiveUtils.js";import{assert as Z}from"../lib/Util.js";import{VertexAttribute as k}from"../lib/VertexAttribute.js";import{ScaleInfo as J}from"./ScaleInfo.js";import{writePosition as K,writeNormal as Q,writeColor as $,writeBufferFloat as ee,writeBufferVec4 as te,writeBufferVec4Zeros as ie,writeObjectAndLayerIdColor as se}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as re}from"./internal/MaterialUtil.js";import{c as ae}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as ne}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as oe}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as le}from"../../../../webscene/support/AlphaCutoff.js";class ce extends q{constructor(e,t){super(e,Me),this.produces=new Map([[G.HUD_MATERIAL,e=>M(e)&&!this.parameters.drawAsLabel],[G.LABEL_MATERIAL,e=>M(e)&&this.parameters.drawAsLabel],[G.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[G.DRAPED_MATERIAL,e=>this.parameters.draped&&M(e)]]),this._visible=!0,this._configuration=new oe(t)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===G.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||t.slot===G.OCCLUSION_PIXELS,U(e)&&(this._configuration.debugDrawLabelBorder=!!L.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:T},point:S,camera:A}=s,{parameters:E}=this;if(!l||!c||T&&E.isLabel||!e.visible||!S)return;const R=e.attributes.get(k.FEATUREATTRIBUTE),I=null==R?null:v(R.data,_e),{scaleX:x,scaleY:F}=Be(I,E,A.pixelRatio);i(ve,t),e.attributes.has(k.FEATUREATTRIBUTE)&&he(ve);const P=e.attributes.get(k.POSITION),_=e.attributes.get(k.SIZE),C=e.attributes.get(k.NORMAL),D=e.attributes.get(k.ROTATION),y=e.attributes.get(k.CENTEROFFSETANDDISTANCE);Z(P.size>=3);const N=ae(E),L="screen"===this.parameters.centerOffsetUnits;for(let i=0;i<P.data.length/P.size;i++){const e=i*P.size;f(ge,P.data[e],P.data[e+1],P.data[e+2]),u(ge,ge,t),u(ge,ge,A.viewMatrix);const a=i*y.size;if(f(Fe,y.data[a],y.data[a+1],y.data[a+2]),!L&&(ge[0]+=Fe[0],ge[1]+=Fe[1],0!==Fe[2])){const e=Fe[2];p(Fe,ge),h(ge,ge,m(Fe,Fe,e))}const n=i*C.size;if(f(Oe,C.data[n],C.data[n+1],C.data[n+2]),pe(Oe,ve,A,Ce),Ve(this.parameters,ge,Ce,A,de),A.applyProjection(ge,Te),Te[0]>-1){L&&(Fe[0]||Fe[1])&&(Te[0]+=Fe[0]*A.pixelRatio,0!==Fe[1]&&(Te[1]+=H(Fe[1],de.factorAlignment)*A.pixelRatio),A.unapplyProjection(Te,ge)),Te[0]+=this.parameters.screenOffset[0]*A.pixelRatio,Te[1]+=this.parameters.screenOffset[1]*A.pixelRatio,Te[0]=Math.floor(Te[0]),Te[1]=Math.floor(Te[1]);const e=i*_.size;Ne[0]=_.data[e],Ne[1]=_.data[e+1],W(Ne,de.factor,Ne);const t=De*A.pixelRatio;let a=0;if(E.textureIsSignedDistanceField){a=Math.min(E.outlineSize,.5*Ne[0])*A.pixelRatio/2}Ne[0]*=x,Ne[1]*=F;const n=i*D.size,l=E.rotation+D.data[n];if(me(S,Te[0],Te[1],Ne,t,a,l,E,N)){const e=s.ray;if(u(Ae,ge,r(Ie,A.viewMatrix)),Te[0]=S[0],Te[1]=S[1],A.unprojectFromRenderScreen(Te,ge)){const t=b();d(t,e.direction);const i=1/g(t);m(t,t,i);o(O(e.origin,ge)*i,t,-1,!0,1,Ae)}}}}}intersectDraped(e,t,i,s,r,a){const n=e.attributes.get(k.POSITION),o=e.attributes.get(k.SIZE),l=e.attributes.get(k.ROTATION),c=this.parameters,f=ae(c),u=e.attributes.get(k.FEATUREATTRIBUTE),p=null==u?null:v(u.data,_e),{scaleX:h,scaleY:m}=Be(p,c,e.screenToWorldRatio),d=ye*e.screenToWorldRatio;for(let g=0;g<n.data.length/n.size;g++){const t=g*n.size,i=n.data[t],u=n.data[t+1],p=g*o.size;Ne[0]=o.data[p],Ne[1]=o.data[p+1];let O=0;if(c.textureIsSignedDistanceField){O=Math.min(c.outlineSize,.5*Ne[0])*e.screenToWorldRatio/2}Ne[0]*=h,Ne[1]*=m;const T=g*l.size,S=c.rotation+l.data[T];me(s,i,u,Ne,d,O,S,c,f)&&r(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new we}applyShaderOffsetsView(e,t,i,s,r,a,n){const o=pe(t,i,r,Ce);return this._applyVerticalGroundOffsetView(e,o,r,n),Ve(this.parameters,n,o,r,a),this._applyPolygonOffsetView(n,o,s[3],r,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,t,i,s,r){return this._applyCenterOffsetNDC(e,t,i,s),null!=r&&d(r,s),this._applyPolygonOffsetNDC(s,t,i,s),s}_applyPolygonOffsetView(t,i,s,r,a){const n=r.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const c=e(Math.abs(i.cosAngle),.01,1),f=1-Math.sqrt(1-c*c)/c/r.viewport[2];return m(a,t,l>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,i,s){const r=g(e),a=i.aboveGround?1:-1,n=i.computeRenderPixelSizeAtDist(r)*z,o=m(ge,t.normal,a*n);return T(s,e,o),s}_applyCenterOffsetView(e,t,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&d(i,e),s&&(i[0]+=t[0],i[1]+=t[1],t[2]&&(p(Oe,i),T(i,i,m(Oe,Oe,t[2])))),i}_applyCenterOffsetNDC(e,t,i,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),r||(s[0]+=t[0]/i.fullWidth*2,s[1]+=t[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,i,s){const r=this.parameters.shaderPolygonOffset;if(e!==s&&d(s,e),r){const e=i.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*r}return s}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:i}=this.parameters,s=e[3]>=le||t>=le&&i[3]>=le;return this._visible&&s}createGLMaterial(e){return new fe(e)}calculateRelativeScreenBounds(e,t,i=F()){return ue(this.parameters,e,t,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}}class fe extends B{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(ne,e)}}function ue(e,t,i,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*i,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*i}function pe(e,t,s,r){return x(t)&&(t=i(Re,t)),S(r.normal,e,t),u(r.normal,r.normal,s.viewInverseTransposeMatrix),r.cosAngle=A(Se,je),r}function he(e){const t=e[0],i=e[1],s=e[2],r=e[3],a=e[4],n=e[5],o=e[6],l=e[7],c=e[8],f=1/Math.sqrt(t*t+i*i+s*s),u=1/Math.sqrt(r*r+a*a+n*n),p=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*f,e[1]=i*f,e[2]=s*f,e[3]=r*u,e[4]=a*u,e[5]=n*u,e[6]=o*p,e[7]=l*p,e[8]=c*p,e}function me(e,i,s,r,a,l,c,f,u){let p=i-a-r[0]*u[0],h=p+r[0]+2*a,m=s-a-r[1]*u[1],d=m+r[1]+2*a;const g=f.distanceFieldBoundingBox;return f.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],m+=r[1]*g[1],h-=r[0]*(1-g[2]),d-=r[1]*(1-g[3]),p-=l,h+=l,m-=l,d+=l),n(Ee,i,s),o(be,e,Ee,t(c)),be[0]>p&&be[0]<h&&be[1]>m&&be[1]<d}const de=new J,ge=b(),Oe=b(),Te=R(),Se=b(),Ae=b(),be=l(),Ee=l(),ve=s(),Re=s(),Ie=a(),xe=R(),Fe=b(),Pe=b(),_e=R(),Ce={normal:Se,cosAngle:0},De=1,ye=2,Ne=c(0,0),Le=6,je=E(0,0,1);class Me extends V{constructor(){super(...arguments),this.renderOccluded=X.Occlude,this.isDecoration=!1,this.color=I(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=I(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=R(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusEffect="none",this.draped=!1,this.isLabel=!1}}const Ue=j().vec3f(k.POSITION).vec3f(k.NORMAL).vec2f(k.UV0).vec4u8(k.COLOR).vec2f(k.SIZE).f32(k.ROTATION).vec4f(k.CENTEROFFSETANDDISTANCE).vec4f(k.FEATUREATTRIBUTE),ze=Ue.clone().vec4u8(k.OBJECTANDLAYERIDCOLOR);class we{constructor(){this.vertexBufferLayout=w()?ze:Ue}elementCount(e){return e.get(k.POSITION).indices.length*Le}write(e,t,i,s,r,a){K(i.get(k.POSITION),e,r.position,a,Le),Q(i.get(k.NORMAL),t,r.normal,a,Le);const n=i.get(k.UV0)?.data;let o=0,l=0,c=1,f=1;n&&n.length>=4&&(o=n[0],l=n[1],c=n[2],f=n[3]),c=Math.min(1.99999,c+1),f=Math.min(1.99999,f+1);let u=i.get(k.POSITION).indices.length,p=a;const h=r.uv0;for(let O=0;O<u;++O)h.set(p,0,o),h.set(p,1,l),p++,h.set(p,0,c),h.set(p,1,l),p++,h.set(p,0,c),h.set(p,1,f),p++,h.set(p,0,c),h.set(p,1,f),p++,h.set(p,0,o),h.set(p,1,f),p++,h.set(p,0,o),h.set(p,1,l),p++;$(i.get(k.COLOR),4,r.color,a,Le);const{data:m,indices:d}=i.get(k.SIZE);u=d.length;const g=r.size;p=a;for(let O=0;O<u;++O){const e=m[2*d[O]],t=m[2*d[O]+1];for(let i=0;i<Le;++i)g.set(p,0,e),g.set(p,1,t),p++}if(ee(i.get(k.ROTATION),r.rotation,a,Le),i.get(k.CENTEROFFSETANDDISTANCE)?te(i.get(k.CENTEROFFSETANDDISTANCE),r.centerOffsetAndDistance,a,Le):ie(r.centerOffsetAndDistance,a,u*Le),i.get(k.FEATUREATTRIBUTE)?te(i.get(k.FEATUREATTRIBUTE),r.featureAttribute,a,Le):ie(r.featureAttribute,a,u*Le),null!=s){const e=i.get(k.POSITION)?.indices;if(e){const t=e.length,i=r.getField(k.OBJECTANDLAYERIDCOLOR,P);se(s,i,t,a,Le)}}return{numVerticesPerItem:Le,numItems:u}}intersect(e,t,i,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:S},point:A,camera:E}=s;if(!l||!c||S&&t.isLabel||!A)return;const v=this.vertexBufferLayout.createView(e),R=v.getField(k.POSITION,_),I=v.getField(k.NORMAL,_),x=v.getField(k.ROTATION,C),F=v.getField(k.SIZE,D),P=v.getField(k.FEATUREATTRIBUTE,y),N=v.getField(k.CENTEROFFSETANDDISTANCE,y),L="screen"===t.centerOffsetUnits,j=ae(t);if(null==R||null==I||null==x||null==F||null==N)return;const M=null==P?null:P.getVec(0,_e),{scaleX:U,scaleY:z}=Be(M,t,E.pixelRatio),w=R.count/Le;for(let _=0;_<w;_++){const e=_*Le;if(R.getVec(e,ge),null!=i&&T(ge,ge,i),u(ge,ge,E.viewMatrix),N.getVec(e,xe),f(Fe,xe[0],xe[1],xe[2]),!L&&(ge[0]+=Fe[0],ge[1]+=Fe[1],0!==Fe[2])){const e=Fe[2];p(Fe,ge),h(ge,ge,m(Fe,Fe,e))}if(I.getVec(e,Oe),pe(Oe,ve,E,Ce),Ve(t,ge,Ce,E,de),E.applyProjection(ge,Te),Te[0]>-1){L&&(Fe[0]||Fe[1])&&(Te[0]+=Fe[0]*E.pixelRatio,0!==Fe[1]&&(Te[1]+=H(Fe[1],de.factorAlignment)*E.pixelRatio),E.unapplyProjection(Te,ge)),Te[0]+=t.screenOffset[0]*E.pixelRatio,Te[1]+=t.screenOffset[1]*E.pixelRatio,Te[0]=Math.floor(Te[0]),Te[1]=Math.floor(Te[1]),F.getVec(e,Ne),W(Ne,de.factor,Ne);const i=De*E.pixelRatio;let a=0;if(t.textureIsSignedDistanceField){a=Math.min(t.outlineSize,.5*Ne[0])*E.pixelRatio/2}Ne[0]*=U,Ne[1]*=z;const n=x.get(e),l=t.rotation+n;if(me(A,Te[0],Te[1],Ne,i,a,l,t,j)){const e=s.ray;if(u(Ae,ge,r(Ie,E.viewMatrix)),Te[0]=A[0],Te[1]=A[1],E.unprojectFromRenderScreen(Te,ge)){const t=b();d(t,e.direction);const i=1/g(t);m(t,t,i);o(O(e.origin,ge)*i,t,_,!0,1,Ae)}}}}}}function Be(e,t,i){return null==e||null==t.vvSize?{scaleX:i,scaleY:i}:(N(Pe,t,e),{scaleX:Pe[0]*i,scaleY:Pe[1]*i})}function Ve(e,t,i,s,r){if(!e.verticalOffset?.screenLength){if(e.screenSizePerspective||e.screenSizePerspectiveAlignment){qe(e,r,g(t),i.cosAngle)}else r.factor.scale=1,r.factorAlignment.scale=1;return t}const a=g(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=re(s,a,e.verticalOffset,i.cosAngle,n);return qe(e,r,a,i.cosAngle),m(i.normal,i.normal,o),T(t,t,i.normal)}function qe(e,t,i,s){null!=e.screenSizePerspective?Y(s,i,e.screenSizePerspective,t.factor):(t.factor.scale=1,t.factor.factor=0,t.factor.minScaleFactor=0),null!=e.screenSizePerspectiveAlignment?Y(s,i,e.screenSizePerspectiveAlignment,t.factorAlignment):(t.factorAlignment.factor=t.factor.factor,t.factorAlignment.scale=t.factor.scale,t.factorAlignment.minScaleFactor=t.factor.minScaleFactor)}export{ce as HUDMaterial,Me as Parameters};
|
|
5
|
+
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as o,rotate as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l,fromValues as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as f,t as u,n as p,d as h,h as m,c as d,l as g,j as O,g as T,q as S,f as b}from"../../../../chunks/vec32.js";import{create as v,fromValues as A}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as E,create as R,freeze as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as x}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as F}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as P,BufferViewVec3f as _,BufferViewFloat as C,BufferViewVec2f as y,BufferViewVec4f as D}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as L}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as N}from"../../support/debugFlags.js";import{newLayout as j}from"../../support/buffer/InterleavedLayout.js";import{isColorEmissionHighlightOrOID as U,isColorOrColorEmission as z}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as M}from"../core/shaderLibrary/hud/HUD.glsl.js";import{olidEnabled as w}from"../effects/geometry/olidUtils.js";import{GLTextureMaterial as B,GLTextureMaterialBindParameters as V}from"../lib/GLTextureMaterial.js";import{Material as q,RenderOccludedFlag as X}from"../lib/Material.js";import{RenderSlot as G}from"../lib/RenderSlot.js";import{applyScaleFactor as H,applyPrecomputedScaleFactor as W,precomputeScaleFactor as Y}from"../lib/screenSizePerspectiveUtils.js";import{assert as Z}from"../lib/Util.js";import{VertexAttribute as k}from"../lib/VertexAttribute.js";import{ScaleInfo as J}from"./ScaleInfo.js";import{writePosition as K,writeNormal as Q,writeColor as $,writeBufferFloat as ee,writeBufferVec4 as te,writeBufferVec4Zeros as ie,writeOlidColor as se}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as re}from"./internal/MaterialUtil.js";import{c as ae,f as oe}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as ne}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as le}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as ce}from"../../../../webscene/support/AlphaCutoff.js";class fe extends q{constructor(e,t){super(e,ze),this.produces=new Map([[G.HUD_MATERIAL,e=>U(e)&&!this.parameters.drawAsLabel],[G.LABEL_MATERIAL,e=>U(e)&&this.parameters.drawAsLabel],[G.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[G.DRAPED_MATERIAL,e=>this.parameters.draped&&U(e)]]),this._visible=!0,this._configuration=new le(t)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===G.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||t.slot===G.OCCLUSION_PIXELS,z(e)&&(this._configuration.debugDrawLabelBorder=!!N.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,s,a,o,n){const{options:{selectionMode:l,hud:c,excludeLabels:T},point:S,camera:b}=s,{parameters:A}=this;if(!l||!c||T&&A.isLabel||!e.visible||!S)return;const R=e.attributes.get(k.FEATUREATTRIBUTE),I=null==R?null:E(R.data,Ce),{scaleX:x,scaleY:F}=Ve(I,A,b.pixelRatio);i(Re,t),e.attributes.has(k.FEATUREATTRIBUTE)&&me(Re);const P=e.attributes.get(k.POSITION),_=e.attributes.get(k.SIZE),C=e.attributes.get(k.NORMAL),y=e.attributes.get(k.ROTATION),D=e.attributes.get(k.CENTEROFFSETANDDISTANCE);Z(P.size>=3);const L=ae(A),N="screen"===this.parameters.centerOffsetUnits;for(let i=0;i<P.data.length/P.size;i++){const e=i*P.size;f(Oe,P.data[e],P.data[e+1],P.data[e+2]),u(Oe,Oe,t),u(Oe,Oe,b.viewMatrix);const a=i*D.size;if(f(Pe,D.data[a],D.data[a+1],D.data[a+2]),!N&&(Oe[0]+=Pe[0],Oe[1]+=Pe[1],0!==Pe[2])){const e=Pe[2];p(Pe,Oe),h(Oe,Oe,m(Pe,Pe,e))}const o=i*C.size;if(f(Te,C.data[o],C.data[o+1],C.data[o+2]),he(Te,Re,b,ye),qe(this.parameters,Oe,ye,b,ge),b.applyProjection(Oe,Se),Se[0]>-1){N&&(Pe[0]||Pe[1])&&(Se[0]+=Pe[0]*b.pixelRatio,0!==Pe[1]&&(Se[1]+=H(Pe[1],ge.factorAlignment)*b.pixelRatio),b.unapplyProjection(Se,Oe)),Se[0]+=this.parameters.screenOffset[0]*b.pixelRatio,Se[1]+=this.parameters.screenOffset[1]*b.pixelRatio,Se[0]=Math.floor(Se[0]),Se[1]=Math.floor(Se[1]);const e=i*_.size;Ne[0]=_.data[e],Ne[1]=_.data[e+1],W(Ne,ge.factor,Ne);const t=De*b.pixelRatio;let a=0;if(A.textureIsSignedDistanceField){a=Math.min(A.outlineSize,.5*Ne[0])*b.pixelRatio/2}Ne[0]*=x,Ne[1]*=F;const o=i*y.size,l=A.rotation+y.data[o];if(de(S,Se[0],Se[1],Ne,t,a,l,A,L)){const e=s.ray;if(u(ve,Oe,r(xe,b.viewMatrix)),Se[0]=S[0],Se[1]=S[1],b.unprojectFromRenderScreen(Se,Oe)){const t=v();d(t,e.direction);const i=1/g(t);m(t,t,i);n(O(e.origin,Oe)*i,t,-1,!0,1,ve)}}}}}intersectDraped(e,t,i,s,r,a){const o=e.attributes.get(k.POSITION),n=e.attributes.get(k.SIZE),l=e.attributes.get(k.ROTATION),c=this.parameters,f=ae(c),u=e.attributes.get(k.FEATUREATTRIBUTE),p=null==u?null:E(u.data,Ce),{scaleX:h,scaleY:m}=Ve(p,c,e.screenToWorldRatio),d=Le*e.screenToWorldRatio;for(let g=0;g<o.data.length/o.size;g++){const t=g*o.size,i=o.data[t],u=o.data[t+1],p=g*n.size;Ne[0]=n.data[p],Ne[1]=n.data[p+1];let O=0;if(c.textureIsSignedDistanceField){O=Math.min(c.outlineSize,.5*Ne[0])*e.screenToWorldRatio/2}Ne[0]*=h,Ne[1]*=m;const T=g*l.size,S=c.rotation+l.data[T];de(s,i,u,Ne,d,O,S,c,f)&&r(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new Be}applyShaderOffsetsView(e,t,i,s,r,a,o){const n=he(t,i,r,ye);return this._applyVerticalGroundOffsetView(e,n,r,o),qe(this.parameters,o,n,r,a),this._applyPolygonOffsetView(o,n,s[3],r,o),this._applyCenterOffsetView(o,s,o),o}applyShaderOffsetsNDC(e,t,i,s,r){return this._applyCenterOffsetNDC(e,t,i,s),null!=r&&d(r,s),this._applyPolygonOffsetNDC(s,t,i,s),s}_applyPolygonOffsetView(t,i,s,r,a){const o=r.aboveGround?1:-1;let n=Math.sign(s);0===n&&(n=o);const l=o*n;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const c=e(Math.abs(i.cosAngle),.01,1),f=1-Math.sqrt(1-c*c)/c/r.viewport[2];return m(a,t,l>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,i,s){const r=g(e),a=i.aboveGround?1:-1,o=i.computeRenderPixelSizeAtDist(r)*M,n=m(Oe,t.normal,a*o);return T(s,e,n),s}_applyCenterOffsetView(e,t,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&d(i,e),s&&(i[0]+=t[0],i[1]+=t[1],t[2]&&(p(Te,i),T(i,i,m(Te,Te,t[2])))),i}_applyCenterOffsetNDC(e,t,i,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),r||(s[0]+=t[0]/i.fullWidth*2,s[1]+=t[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,i,s){const r=this.parameters.shaderPolygonOffset;if(e!==s&&d(s,e),r){const e=i.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*r}return s}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:i}=this.parameters,s=e[3]>=ce||t>=ce&&i[3]>=ce;return this._visible&&s}createGLMaterial(e){return new ue(e)}calculateRelativeScreenBounds(e,t,i=F()){return pe(this.parameters,e,t,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}}class ue extends B{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(ne,e)}}function pe(e,t,i,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*i,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*i}function he(e,t,s,r){return x(t)&&(t=i(Ie,t)),S(r.normal,e,t),u(r.normal,r.normal,s.viewInverseTransposeMatrix),r.cosAngle=b(be,Ue),r}function me(e){const t=e[0],i=e[1],s=e[2],r=e[3],a=e[4],o=e[5],n=e[6],l=e[7],c=e[8],f=1/Math.sqrt(t*t+i*i+s*s),u=1/Math.sqrt(r*r+a*a+o*o),p=1/Math.sqrt(n*n+l*l+c*c);return e[0]=t*f,e[1]=i*f,e[2]=s*f,e[3]=r*u,e[4]=a*u,e[5]=o*u,e[6]=n*p,e[7]=l*p,e[8]=c*p,e}function de(e,i,s,r,a,l,c,f,u){let p=i-a-r[0]*u[0],h=p+r[0]+2*a,m=s-a-r[1]*u[1],d=m+r[1]+2*a;const g=f.distanceFieldBoundingBox;return f.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],m+=r[1]*g[1],h-=r[0]*(1-g[2]),d-=r[1]*(1-g[3]),p-=l,h+=l,m-=l,d+=l),o(Ee,i,s),n(Ae,e,Ee,t(c)),Ae[0]>p&&Ae[0]<h&&Ae[1]>m&&Ae[1]<d}const ge=new J,Oe=v(),Te=v(),Se=R(),be=v(),ve=v(),Ae=l(),Ee=l(),Re=s(),Ie=s(),xe=a(),Fe=R(),Pe=v(),_e=v(),Ce=R(),ye={normal:be,cosAngle:0},De=1,Le=2,Ne=c(0,0),je=6,Ue=A(0,0,1);class ze extends V{constructor(){super(...arguments),this.renderOccluded=X.Occlude,this.isDecoration=!1,this.color=I(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=I(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=R(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusEffect="none",this.draped=!1,this.isLabel=!1}}const Me=j().vec3f(k.POSITION).vec3f(k.NORMAL).vec2i16(k.UVI).vec4u8(k.COLOR).vec2f(k.SIZE).f32(k.ROTATION).vec4f(k.CENTEROFFSETANDDISTANCE).vec4f(k.FEATUREATTRIBUTE),we=Me.clone().vec4u8(k.OLIDCOLOR);class Be{constructor(){this.vertexBufferLayout=w()?we:Me}elementCount(e){return e.get(k.POSITION).indices.length*je}write(e,t,i,s,r,a){const{position:o,normal:n,uvi:l,color:c,size:f,rotation:u,centerOffsetAndDistance:p,featureAttribute:h}=r;K(i.get(k.POSITION),e,o,a,je),Q(i.get(k.NORMAL),t,n,a,je);const m=i.get(k.UVI)?.data;let d=0,g=0,O=-1-oe,T=-1-oe;m&&m.length>=4&&(d=m[0],g=m[1],O=-1-m[2],T=-1-m[3]);let S=i.get(k.POSITION).indices.length,b=a;for(let E=0;E<S;++E)l.set(b,0,d),l.set(b,1,g),b++,l.set(b,0,O),l.set(b,1,g),b++,l.set(b,0,O),l.set(b,1,T),b++,l.set(b,0,O),l.set(b,1,T),b++,l.set(b,0,d),l.set(b,1,T),b++,l.set(b,0,d),l.set(b,1,g),b++;$(i.get(k.COLOR),4,c,a,je);const{data:v,indices:A}=i.get(k.SIZE);S=A.length,b=a;for(let E=0;E<S;++E){const e=v[2*A[E]],t=v[2*A[E]+1];for(let i=0;i<je;++i)f.set(b,0,e),f.set(b,1,t),b++}if(ee(i.get(k.ROTATION),u,a,je),i.get(k.CENTEROFFSETANDDISTANCE)?te(i.get(k.CENTEROFFSETANDDISTANCE),p,a,je):ie(p,a,S*je),i.get(k.FEATUREATTRIBUTE)?te(i.get(k.FEATUREATTRIBUTE),h,a,je):ie(h,a,S*je),null!=s){const e=i.get(k.POSITION)?.indices;if(e){const t=e.length,i=r.getField(k.OLIDCOLOR,P);se(s,i,t,a,je)}}return{numVerticesPerItem:je,numItems:S}}intersect(e,t,i,s,a,o,n){const{options:{selectionMode:l,hud:c,excludeLabels:S},point:b,camera:A}=s;if(!l||!c||S&&t.isLabel||!b)return;const E=this.vertexBufferLayout.createView(e),R=E.getField(k.POSITION,_),I=E.getField(k.NORMAL,_),x=E.getField(k.ROTATION,C),F=E.getField(k.SIZE,y),P=E.getField(k.FEATUREATTRIBUTE,D),L=E.getField(k.CENTEROFFSETANDDISTANCE,D),N="screen"===t.centerOffsetUnits,j=ae(t);if(null==R||null==I||null==x||null==F||null==L)return;const U=null==P?null:P.getVec(0,Ce),{scaleX:z,scaleY:M}=Ve(U,t,A.pixelRatio),w=R.count/je;for(let _=0;_<w;_++){const e=_*je;if(R.getVec(e,Oe),null!=i&&T(Oe,Oe,i),u(Oe,Oe,A.viewMatrix),L.getVec(e,Fe),f(Pe,Fe[0],Fe[1],Fe[2]),!N&&(Oe[0]+=Pe[0],Oe[1]+=Pe[1],0!==Pe[2])){const e=Pe[2];p(Pe,Oe),h(Oe,Oe,m(Pe,Pe,e))}if(I.getVec(e,Te),he(Te,Re,A,ye),qe(t,Oe,ye,A,ge),A.applyProjection(Oe,Se),Se[0]>-1){N&&(Pe[0]||Pe[1])&&(Se[0]+=Pe[0]*A.pixelRatio,0!==Pe[1]&&(Se[1]+=H(Pe[1],ge.factorAlignment)*A.pixelRatio),A.unapplyProjection(Se,Oe)),Se[0]+=t.screenOffset[0]*A.pixelRatio,Se[1]+=t.screenOffset[1]*A.pixelRatio,Se[0]=Math.floor(Se[0]),Se[1]=Math.floor(Se[1]),F.getVec(e,Ne),W(Ne,ge.factor,Ne);const i=De*A.pixelRatio;let a=0;if(t.textureIsSignedDistanceField){a=Math.min(t.outlineSize,.5*Ne[0])*A.pixelRatio/2}Ne[0]*=z,Ne[1]*=M;const o=x.get(e),l=t.rotation+o;if(de(b,Se[0],Se[1],Ne,i,a,l,t,j)){const e=s.ray;if(u(ve,Oe,r(xe,A.viewMatrix)),Se[0]=b[0],Se[1]=b[1],A.unprojectFromRenderScreen(Se,Oe)){const t=v();d(t,e.direction);const i=1/g(t);m(t,t,i);n(O(e.origin,Oe)*i,t,_,!0,1,ve)}}}}}}function Ve(e,t,i){return null==e||null==t.vvSize?{scaleX:i,scaleY:i}:(L(_e,t,e),{scaleX:_e[0]*i,scaleY:_e[1]*i})}function qe(e,t,i,s,r){if(!e.verticalOffset?.screenLength){if(e.screenSizePerspective||e.screenSizePerspectiveAlignment){Xe(e,r,g(t),i.cosAngle)}else r.factor.scale=1,r.factorAlignment.scale=1;return t}const a=g(t),o=e.screenSizePerspectiveAlignment??e.screenSizePerspective,n=re(s,a,e.verticalOffset,i.cosAngle,o);return Xe(e,r,a,i.cosAngle),m(i.normal,i.normal,n),T(t,t,i.normal)}function Xe(e,t,i,s){null!=e.screenSizePerspective?Y(s,i,e.screenSizePerspective,t.factor):(t.factor.scale=1,t.factor.factor=0,t.factor.minScaleFactor=0),null!=e.screenSizePerspectiveAlignment?Y(s,i,e.screenSizePerspectiveAlignment,t.factorAlignment):(t.factorAlignment.factor=t.factor.factor,t.factorAlignment.scale=t.factor.scale,t.factorAlignment.minScaleFactor=t.factor.minScaleFactor)}export{fe as HUDMaterial,ze as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import o from"../lib/GLMaterial.js";import{Material as a}from"../lib/Material.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{writePosition as l,writeBufferFloat as c}from"./internal/bufferWriterUtils.js";import{HeatmapDensityPassParameters as f,HeatmapDensityTechnique as m}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as p}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class T extends f{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class g extends a{constructor(t){super(t,T),this.produces=new Map([[n.DRAPED_MATERIAL,t=>t===i.Color]]),this._configuration=new p}getConfiguration(){return this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats,this._configuration}get visible(){return!0}createGLMaterial(t){return new d(t)}intersect(){}intersectDraped(r,s,i,o,a,n){const l=r.attributes.get(u.POSITION),{parameters:c}=this,{searchRadius:f}=c,{screenToWorldRatio:m}=r,p=f*m+h*m,T=p*p,g=l.data.length/l.size;for(let u=0;u<g;u++){const r=u*l.size,s=t(j,l.data[r],l.data[r+1]);e(s,o)<T&&a(n.dist,n.normal,-1,!1)}}createBufferWriter(){return new b(this.parameters.isAttributeDriven?I:A)}}class d extends o{beginSlot(t){return this.getTechnique(m,t)}}class b{constructor(t){this.vertexBufferLayout=t}elementCount(t){return t.get(u.POSITION).indices.length*v}write(t,e,r,s,i,o){l(r.get(u.POSITION),t,i.position,o,v);const a=r.get(u.POSITION).indices.length,n=i.uv0;let f=o;for(let u=0;u<a;++u)n.setValues(f++,-1,-1),n.setValues(f++,1,-1),n.setValues(f++,1,1),n.setValues(f++,1,1),n.setValues(f++,-1,1),n.setValues(f++,-1,-1);const m=u.FEATUREATTRIBUTE in i?i.featureAttribute:null;return m?(c(r.get(u.FEATUREATTRIBUTE),m,o,v),null):null}}const A=s().vec3f(u.POSITION).
|
|
5
|
+
import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import o from"../lib/GLMaterial.js";import{Material as a}from"../lib/Material.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{writePosition as l,writeBufferFloat as c}from"./internal/bufferWriterUtils.js";import{HeatmapDensityPassParameters as f,HeatmapDensityTechnique as m}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as p}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class T extends f{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class g extends a{constructor(t){super(t,T),this.produces=new Map([[n.DRAPED_MATERIAL,t=>t===i.Color]]),this._configuration=new p}getConfiguration(){return this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats,this._configuration}get visible(){return!0}createGLMaterial(t){return new d(t)}intersect(){}intersectDraped(r,s,i,o,a,n){const l=r.attributes.get(u.POSITION),{parameters:c}=this,{searchRadius:f}=c,{screenToWorldRatio:m}=r,p=f*m+h*m,T=p*p,g=l.data.length/l.size;for(let u=0;u<g;u++){const r=u*l.size,s=t(j,l.data[r],l.data[r+1]);e(s,o)<T&&a(n.dist,n.normal,-1,!1)}}createBufferWriter(){return new b(this.parameters.isAttributeDriven?I:A)}}class d extends o{beginSlot(t){return this.getTechnique(m,t)}}class b{constructor(t){this.vertexBufferLayout=t}elementCount(t){return t.get(u.POSITION).indices.length*v}write(t,e,r,s,i,o){l(r.get(u.POSITION),t,i.position,o,v);const a=r.get(u.POSITION).indices.length,n=i.uv0;let f=o;for(let u=0;u<a;++u)n.setValues(f++,-1,-1),n.setValues(f++,1,-1),n.setValues(f++,1,1),n.setValues(f++,1,1),n.setValues(f++,-1,1),n.setValues(f++,-1,-1);const m=u.FEATUREATTRIBUTE in i?i.featureAttribute:null;return m?(c(r.get(u.FEATUREATTRIBUTE),m,o,v),null):null}}const A=s().vec3f(u.POSITION).vec2f16(u.UV0),I=A.clone().f32(u.FEATUREATTRIBUTE),v=6,j=r();export{g as HeatmapDensityMaterial,T as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as i}from"../lib/basicInterfaces.js";import s from"../lib/GLMaterial.js";import{MaterialParameters as o}from"../lib/Material.js";import{OITPolygonOffsetLimit as a}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{assert as u}from"../lib/Util.js";import{VertexAttribute as l}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as c}from"./DefaultBufferWriter.js";import{
|
|
5
|
+
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as i}from"../lib/basicInterfaces.js";import s from"../lib/GLMaterial.js";import{MaterialParameters as o}from"../lib/Material.js";import{OITPolygonOffsetLimit as a}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{assert as u}from"../lib/Util.js";import{VertexAttribute as l}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as c}from"./DefaultBufferWriter.js";import{PositionUvLayout as p}from"./DefaultLayouts.js";import{TriangleMaterial as f}from"./TriangleMaterial.js";import{writeBufferFloat as h,writeDefaultAttribute as m}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocations as g,ImageMaterialTechnique as T}from"../shaders/ImageMaterialTechnique.js";import{ImageMaterialTechniqueConfiguration as d}from"../shaders/ImageMaterialTechniqueConfiguration.js";class E extends f{constructor(e){super(e,A),this._configuration=new d,this.vertexAttributeLocations=g,this.supportsEdges=!0,this.produces=new Map([[n.OPAQUE_MATERIAL,e=>t(e)],[n.TRANSPARENT_MATERIAL,e=>r(e)&&this.parameters.writeDepth],[n.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>r(e)&&!this.parameters.writeDepth],[n.DRAPED_MATERIAL,e=>r(e)||t(e)]])}dispose(){this.setParameters({texture:void 0})}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=t.hasOccludees,this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<a,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.perspectiveInterpolation=this.parameters.perspectiveInterpolation,this._configuration}get visible(){return!0}createGLMaterial(e){return new I(e)}createBufferWriter(){let e=p;return this.parameters.perspectiveInterpolation&&(e=e.clone().f32(l.PERSPECTIVEDIVIDE)),new b(e)}}class I extends s{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.getTechnique(T,e)}}class b extends c{write(t,r,i,s,o,a){for(const n of this.vertexBufferLayout.fields.keys()){const s=i.get(n);if(s)if(n===l.PERSPECTIVEDIVIDE){u(1===s.size);const t=o.getField(n,e);t&&h(s,t,a)}else m(n,s,t,r,o,a)}return null}}class A extends o{constructor(e){super(),this.texture=e,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=i.None,this.opacity=1,this.perspectiveInterpolation=!1}get glTexture(){return this.texture.glTexture}}export{E as ImageMaterial,A as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as s}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{Material as o,MaterialParameters as a}from"../lib/Material.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{VertexAttribute as l}from"../lib/VertexAttribute.js";import{writePosition as f,writeNormal as u,writeBufferVec4 as h}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as m}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class d extends o{constructor(e,t){super(e,T),this.produces=new Map([[c.LINE_CALLOUTS,e=>s(e)],[c.LINE_CALLOUTS_HUD_DEPTH,e=>s(e)]]),this._configuration=new m(t),this._uniqueMaterialIdentifier=O(this.parameters)}passParameters(){return this.parameters}getConfiguration(e,t){const r=t.slot===c.LINE_CALLOUTS_HUD_DEPTH;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=r,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration}get visible(){return this.parameters.color[3]>=g||(this.parameters.borderColor?.[3]??0)>=g}intersect(){}createGLMaterial(e){return new S(e)}createBufferWriter(){return new b}validateParameters(e){this._uniqueMaterialIdentifier=O(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function O({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,occlusionTest:o,shaderPolygonOffset:a,hudDepthAlignStart:c,centerOffsetUnits:l,hasSlicePlane:f,screenSizePerspective:u,verticalOffset:h,borderColor:p}){return e`${t}:${r}:${i}:[${s}]:${n}:${o}:${a}:${c}:${l}:${f}:${null!=u}:{${h.screenLength}:${h.minWorldLength}:${h.maxWorldLength}}:[${p}]`}class S extends n{beginSlot(e){return this.getTechnique(p,e)}}class T extends a{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=r(0,0,0,1),this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}const L=i().vec3f(l.POSITION).vec3f(l.NORMAL).
|
|
5
|
+
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as s}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{Material as o,MaterialParameters as a}from"../lib/Material.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{VertexAttribute as l}from"../lib/VertexAttribute.js";import{writePosition as f,writeNormal as u,writeBufferVec4 as h}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as m}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class d extends o{constructor(e,t){super(e,T),this.produces=new Map([[c.LINE_CALLOUTS,e=>s(e)],[c.LINE_CALLOUTS_HUD_DEPTH,e=>s(e)]]),this._configuration=new m(t),this._uniqueMaterialIdentifier=O(this.parameters)}passParameters(){return this.parameters}getConfiguration(e,t){const r=t.slot===c.LINE_CALLOUTS_HUD_DEPTH;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=r,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration}get visible(){return this.parameters.color[3]>=g||(this.parameters.borderColor?.[3]??0)>=g}intersect(){}createGLMaterial(e){return new S(e)}createBufferWriter(){return new b}validateParameters(e){this._uniqueMaterialIdentifier=O(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function O({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,occlusionTest:o,shaderPolygonOffset:a,hudDepthAlignStart:c,centerOffsetUnits:l,hasSlicePlane:f,screenSizePerspective:u,verticalOffset:h,borderColor:p}){return e`${t}:${r}:${i}:[${s}]:${n}:${o}:${a}:${c}:${l}:${f}:${null!=u}:{${h.screenLength}:${h.minWorldLength}:${h.maxWorldLength}}:[${p}]`}class S extends n{beginSlot(e){return this.getTechnique(p,e)}}class T extends a{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=r(0,0,0,1),this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}const L=i().vec3f(l.POSITION).vec3f(l.NORMAL).vec2f16(l.UV0).vec4f(l.CENTEROFFSETANDDISTANCE),_=[t(0,0),t(1,0),t(0,1),t(1,0),t(1,1),t(0,1)];class b{constructor(){this.vertexBufferLayout=L}elementCount(e){return 6*e.get(l.POSITION).indices.length}write(e,t,r,i,s,n){f(r.get(l.POSITION),e,s.position,n,6),u(r.get(l.NORMAL),t,s.normal,n,6),h(r.get(l.CENTEROFFSETANDDISTANCE),s.centerOffsetAndDistance,n,6);for(let o=0;o<_.length;++o)s.uv0.setVec(n+o,_[o]);return null}}export{d as LineCalloutMaterial,T as Parameters,O as uniqueMaterialIdentifier};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{i as
|
|
5
|
+
import{Float16Array as e}from"@petamoriken/float16";import{i as t,I as r,t as i}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as n,isColor as o,isDepth as h,isColorHighlightOrDepth as c,isColorOrColorEmission as p}from"../core/shaderLibrary/ShaderOutput.js";import m from"../lib/GLMaterial.js";import{Material as l,RenderOccludedFlag as u}from"../lib/Material.js";import{RenderSlot as T}from"../lib/RenderSlot.js";import{VertexAttribute as f}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as d}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as A,LineMarkerTechnique as v}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as _,LineMarkerSpace as E,LineMarkerAnchor as g}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as O}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as S}from"../../../../webscene/support/AlphaCutoff.js";class R extends l{constructor(e){super(e,L),this._configuration=new _,this.vertexAttributeLocations=A,this.produces=new Map([[T.OPAQUE_MATERIAL,e=>e===n.Highlight||o(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>h(e)],[T.OCCLUDER_MATERIAL,e=>c(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.TRANSPARENT_OCCLUDER_MATERIAL,e=>c(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.TRANSPARENT_MATERIAL,e=>o(e)&&this.parameters.writeDepth],[T.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>o(e)&&!this.parameters.writeDepth],[T.DRAPED_MATERIAL,e=>p(e)||e===n.Highlight]]),this._layout=this.createLayout()}getConfiguration(e,t){return this._configuration.output=e,this._configuration.space=t.slot===T.DRAPED_MATERIAL?E.Draped:this.parameters.worldSpace?E.World:E.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==O.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=t.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===u.OccludeAndTransparentStencil,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest&&p(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color[3]>=S}intersect(){}createLayout(){const e=s().vec3f(f.POSITION).vec3f(f.PREVPOSITION).vec2f16(f.UV0);return this.parameters.worldSpace&&e.vec3f(f.NORMAL),this.parameters.vvSize?e.f32(f.SIZEFEATUREATTRIBUTE):e.f32(f.SIZE),this.parameters.vvColor?e.f32(f.COLORFEATUREATTRIBUTE):e.vec4u8(f.COLOR),this.parameters.vvOpacity&&e.f32(f.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new P(this._layout,this.parameters)}createGLMaterial(e){return new I(e)}}class I extends m{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextures.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(v,e)}}class L extends d{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=O.BUTT,this.anchor=g.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.markerTexture=null}}class P{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(a,s,n,o,h,c){const p=n.get(f.POSITION).data,m=p.length/3;let l=[1,0,0];const u=n.get(f.NORMAL);this._parameters.worldSpace&&null!=u&&(l=u.data);let T=1,d=0;this._parameters.vvSize?d=n.get(f.SIZEFEATUREATTRIBUTE).data[0]:n.has(f.SIZE)&&(T=n.get(f.SIZE).data[0]);let A=[1,1,1,1],v=0;this._parameters.vvColor?v=n.get(f.COLORFEATUREATTRIBUTE).data[0]:n.has(f.COLOR)&&(A=n.get(f.COLOR).data);let _=0;this._parameters.vvOpacity&&(_=n.get(f.OPACITYFEATUREATTRIBUTE).data[0]);const E=new Float32Array(h.buffer),g=new e(h.buffer),O=new Uint8Array(h.buffer);let S=c*(this.vertexBufferLayout.stride/4);const R=(e,t,r,i)=>{E[S++]=e[0],E[S++]=e[1],E[S++]=e[2],E[S++]=t[0],E[S++]=t[1],E[S++]=t[2];const a=2*S;if(S++,g[a]=r[0],g[a+1]=r[1],this._parameters.worldSpace&&(E[S++]=l[0],E[S++]=l[1],E[S++]=l[2]),this._parameters.vvSize?E[S++]=d:E[S++]=T,this._parameters.vvColor)E[S++]=v;else{const e=Math.min(4*i,A.length-4),t=4*S;S++,O[t]=A[e],O[t+1]=A[e+1],O[t+2]=A[e+2],O[t+3]=A[e+3]}this._parameters.vvOpacity&&(E[S++]=_)};let I;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(I||(I={}));const L=(e,s)=>{const n=t(C,p[3*e],p[3*e+1],p[3*e+2]),o=b;let h=e+s;do{t(o,p[3*h],p[3*h+1],p[3*h+2]),h+=s}while(r(n,o)&&h>=0&&h<m);a&&(i(n,n,a),i(o,o,a)),R(n,o,[-1,-1],e),R(n,o,[1,-1],e),R(n,o,[1,1],e),R(n,o,[-1,-1],e),R(n,o,[1,1],e),R(n,o,[-1,1],e)},P=this._parameters.placement;return"begin"!==P&&"begin-end"!==P||L(0,I.ASCENDING),"end"!==P&&"begin-end"!==P||L(m-1,I.DESCENDING),null}}const C=a(),b=a();export{R as LineMarkerMaterial,L as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as e}from"../../../../core/mathUtils.js";import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as i}from"../../../../chunks/vec32.js";import{ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as n,isColorOrColorEmission as c,ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as u}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as m}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as l}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as p}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as
|
|
5
|
+
import{clamp as e}from"../../../../core/mathUtils.js";import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as i}from"../../../../chunks/vec32.js";import{ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as n,isColorOrColorEmission as c,ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as u}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as m}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as l}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as p}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as _}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as y}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as A,PathTechnique as O,PathPassParameters as j}from"./PathTechnique.js";import{PathTechniqueConfiguration as P}from"./PathTechniqueConfiguration.js";import{alphaCutoff as L}from"../../../../webscene/support/AlphaCutoff.js";class R extends d{constructor(e,t){super(e,x),this._vertexBufferLayout=T(),this.vertexAttributeLocations=A,this.supportsEdges=!0,this.produces=new Map([[S.OPAQUE_MATERIAL,e=>(this.parameters.castShadows&&o(e)||n(e))&&!this.transparent],[S.TRANSPARENT_MATERIAL,e=>(this.parameters.castShadows&&o(e)||n(e))&&this.transparent]]),this._configuration=new P(t.spherical)}get hasEmissions(){return!i(this.parameters.emissiveFactor,r)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,c(e)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?m.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?m.WindingOrder:m.None,this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?l.Schematic:l.Disabled,this._configuration.emissionSource=this.parameters.usePBR?u.Value:u.None,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}isVisibleForOutput(e){return e!==h.Shadow&&e!==h.ShadowExcludeHighlight&&e!==h.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=L}intersect(i,r,a,o,n,c){const h=i;if(!b(h))return;const u=h.path,m=t(this.parameters.size);if(this.parameters.vvSize){const{offset:t,factor:i,minSize:r,maxSize:s,fallback:a}=this.parameters.vvSize,o=u.sizeAttributeValue;Number.isNaN(o)?(m[0]*=a[0],m[1]*=a[2]):(m[0]*=e(t[0]+o*i[0],r[0],s[0]),m[1]*=e(t[2]+o*i[2],r[2],s[2]))}const l=new g(!1,a.options.normalRequired),p=Math.max(m[0],m[1]),f=i.boundingInfo;if(null==f)return void M(u,m,o,n,l,c);const d=s(f.bbMin[0]-p,f.bbMin[1]-p,f.bbMin[2]-p,f.bbMax[0]+p,f.bbMax[1]+p,f.bbMax[2]+p),S=[n[0]-o[0],n[1]-o[1],n[2]-o[2]],_=Math.sqrt(S[0]*S[0]+S[1]*S[1]+S[2]*S[2]),y=[_/S[0],_/S[1],_/S[2]];v(d,o,y,a.tolerance)&&M(u,m,o,n,l,c)}createBufferWriter(){return new y(this._vertexBufferLayout)}createGLMaterial(e){return new w(e)}get transparent(){const{parameters:e}=this;return e.drivenOpacity||e.opacity<1}}function T(){const e=a().vec3f(_.POSITION).vec4f(_.PROFILEVERTEXANDNORMAL).vec4f(_.FEATUREVALUE).vec2f(_.PROFILEAUXDATA).vec2i16(_.PROFILERIGHT,{glNormalized:!0}).vec2i16(_.PROFILEUP,{glNormalized:!0});return p()&&e.vec4u8(_.OLIDCOLOR),e}class w extends f{beginSlot(e){return this.getTechnique(O,e)}}function M(e,t,i,r,s,a){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(i,r,s,a)}class x extends j{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{x as Parameters,R as PathMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{freeze as r,create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColorOrColorEmission as t,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as o}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as l}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as m}from"../lib/OITPass.js";import{blending as c,oitDepthTest as p,getDrawBuffers as u,OITPolygonOffset as h}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as d,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{advancedMRRFactors as O}from"./pbrUtils.js";import{P as j}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as P}from"../../../webgl/enums.js";import{makePipelineState as T,frontFaceCullingParams as
|
|
5
|
+
import{freeze as r,create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColorOrColorEmission as t,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as o}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as l}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as m}from"../lib/OITPass.js";import{blending as c,oitDepthTest as p,getDrawBuffers as u,OITPolygonOffset as h}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as d,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{advancedMRRFactors as O}from"./pbrUtils.js";import{P as j}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as P}from"../../../webgl/enums.js";import{makePipelineState as T,frontFaceCullingParams as g,defaultDepthWrite as E,defaultColorWrite as L}from"../../../webgl/renderState.js";class I extends o{constructor(){super(...arguments),this.ambient=r(.2,.2,.2),this.diffuse=r(.8,.8,.8),this.specular=r(0,0,0),this.opacity=1,this.origin=e(),this.modelTransformation=null,this.mrrFactors=O,this.emissiveFactor=s}}class R extends a{constructor(r,e){super(r,e,new n(j,(()=>import("../shaders/Path.glsl.js"))),F)}initializePipeline(r){const{output:e,transparent:s,hasSlicePlane:o,doubleSidedMode:n,hasOccludees:a,oitPass:b}=r,O=b===m.NONE,j=b===m.FrontFace;return T({blending:t(e)&&s?c(b):null,culling:o&&!s&&n!==l.None?g:null,depthTest:{func:p(b)},depthWrite:O||j?E:null,drawBuffers:e===i.Depth?{buffers:[P.NONE]}:u(b,e),colorWrite:L,stencilWrite:a?d:null,stencilTest:a?f:null,polygonOffset:O||j?null:h})}}const F=new Map([[b.POSITION,0],[b.PROFILEVERTEXANDNORMAL,1],[b.FEATUREVALUE,2],[b.PROFILEAUXDATA,3],[b.PROFILERIGHT,4],[b.PROFILEUP,5],[b.OLIDCOLOR,6]]);export{I as PathPassParameters,R as PathTechnique,F as vertexAttributeLocations};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewMat3f as e,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as i,isColorOrColorEmission as o,isDepth as a,isColorEmissionHighlightOrOID as n}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as f}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as c}from"../lib/basicInterfaces.js";import l from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{assert as h}from"../lib/Util.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as d}from"./DefaultBufferWriter.js";import{Style as g}from"./PatternStyle.js";import{TriangleMaterial as A}from"./TriangleMaterial.js";import{VisualVariablePassParameters as T}from"./VisualVariablePassParameters.js";import{writeDefaultAttributes as b,writeBufferVec4 as v}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocationsOID as O,vertexAttributeLocations as _,PatternTechnique as j}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as
|
|
5
|
+
import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewMat3f as e,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as i,isColorOrColorEmission as o,isDepth as a,isColorEmissionHighlightOrOID as n}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as f}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as c}from"../lib/basicInterfaces.js";import l from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{assert as h}from"../lib/Util.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as d}from"./DefaultBufferWriter.js";import{Style as g}from"./PatternStyle.js";import{TriangleMaterial as A}from"./TriangleMaterial.js";import{VisualVariablePassParameters as T}from"./VisualVariablePassParameters.js";import{writeDefaultAttributes as b,writeBufferVec4 as v}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocationsOID as O,vertexAttributeLocations as _,PatternTechnique as j}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as P}from"../shaders/PatternTechniqueConfiguration.js";import{alphaCutoff as C}from"../../../../webscene/support/AlphaCutoff.js";class R extends A{constructor(t){super(t,I),this._configuration=new P,this.vertexAttributeLocations=f()?O:_,this.supportsEdges=!0,this.produces=new Map([[p.OPAQUE_MATERIAL,t=>i(t)],[p.TRANSPARENT_MATERIAL,t=>o(t)],[p.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,t=>a(t)],[p.DRAPED_MATERIAL,t=>this.parameters.draped&&n(t)]])}getConfiguration(t,e){return this._configuration.output=t,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.style=this.parameters.style,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=e.oitPass,this._configuration.enableOffset=e.camera.relativeElevation<u,this._configuration.terrainDepthTest=e.terrainDepthTest&&o(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration}get visible(){return this.parameters.color[3]>=C}createGLMaterial(t){return new y(t)}createBufferWriter(){const t=s().vec3f(m.POSITION).vec4f(m.UVMAPSPACE);return this.parameters.draped||t.mat3f(m.BOUNDINGRECT),this.parameters.vvColor?t.f32(m.COLORFEATUREATTRIBUTE):t.vec4u8(m.COLOR),f()&&t.vec4u8(m.OLIDCOLOR),new E(t)}}class y extends l{beginSlot(t){return this.getTechnique(j,t)}}class E extends d{write(t,s,i,o,a,n){const f=b(i,o,this.vertexBufferLayout,t,s,a,n);for(const c of this.vertexBufferLayout.fields.keys()){const s=i.get(c),o=s?.indices;if(s&&o)switch(c){case m.UVMAPSPACE:{h(4===s.size);const t=a.getField(c,r);t&&v(s,t,n);break}case m.BOUNDINGRECT:{h(9===s.size);const r=a.getField(c,e);r&&L(s,t,r,n);break}}}return f}}function L(t,e,r,s){const{data:i,indices:o}=t,a=e,n=r.typedBuffer,f=r.typedBufferStride,c=o.length;s*=f;for(let l=0;l<c;++l){const t=9*o[l],e=i[t],r=i[t+1],c=i[t+2];n[s]=a[0]*e+a[4]*r+a[8]*c+a[12],n[s+1]=a[1]*e+a[5]*r+a[9]*c+a[13],n[s+2]=a[2]*e+a[6]*r+a[10]*c+a[14];for(let o=3;o<9;++o)n[s+o]=i[t+o];s+=f}}class I extends T{constructor(){super(...arguments),this.color=t(1,1,1,1),this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=c.None,this.hasOccludees=!1,this.style=g.Cross,this.draped=!0}}export{I as Parameters,R as PatternMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,f as n,h as o,g as l,c,l as p,j as h,t as u}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as T}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as _,fromPoints as E,closestLineSegmentPoint as A}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as O,signedDistance as g,getNormal as S}from"../../../../geometry/support/plane.js";import{newLayout as I}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as v,isColorOrColorEmission as N,isDepth as P,isColorEmissionHighlightOIDOrDepth as L,is2DGeometryOutput as b,ShaderOutput as C}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as U}from"../effects/geometry/olidUtils.js";import y from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as j}from"../lib/Material.js";import{RenderSlot as F}from"../lib/RenderSlot.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{VertexAttribute as M}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as B}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as J}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as z,RibbonLineTechnique as H}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as G,CapType as k}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as V}from"../../../../webscene/support/AlphaCutoff.js";var Z;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Z||(Z={}));class W extends D{constructor(e){super(e,q),this._configuration=new G,this.vertexAttributeLocations=z,this.produces=new Map([[F.OPAQUE_MATERIAL,e=>v(e)||N(e)&&this.parameters.renderOccluded===j.OccludeAndTransparentStencil],[F.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>P(e)],[F.OCCLUDER_MATERIAL,e=>L(e)&&this.parameters.renderOccluded===j.OccludeAndTransparentStencil],[F.TRANSPARENT_OCCLUDER_MATERIAL,e=>L(e)&&this.parameters.renderOccluded===j.OccludeAndTransparentStencil],[F.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==j.OccludeAndTransparentStencil],[F.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==j.OccludeAndTransparentStencil],[F.DRAPED_MATERIAL,e=>b(e)]])}getConfiguration(e,t){this._configuration.output=e,this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===F.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==C.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&$(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===j.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=V||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>V}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n,o){if(!s.options.selectionMode)return;const l=e.get(M.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.get(M.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?c*=this.parameters.vvSize.fallback[0]:c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const p=a[0],h=a[1],u=(c/2+4)*r;let m=Number.MAX_VALUE,f=0;const T=e.get(M.POSITION).data,d=K(this.parameters,e)?T.length-2:T.length-5;for(let _=0;_<d;_+=3){const e=T[_],r=T[_+1],i=(_+3)%T.length,s=p-e,a=h-r,n=T[i]-e,o=T[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),c=n*l-s,u=o*l-a,d=c*c+u*u;d<m&&(m=d,f=_/3)}m<u*u&&n(o.dist,o.normal,f,!1)}intersect(r,u,m,f,d,R){if(!m.options.selectionMode||!r.visible)return;if(!w(u))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const I=r.attributes,v=I.get(M.POSITION).data;let N=this.parameters.width;if(this.parameters.vvSize){const e=I.get(M.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(N*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else I.has(M.SIZE)&&(N*=I.get(M.SIZE).data[0]);const P=m.camera,L=se;i(L,m.point);const b=N*P.pixelRatio/2+4*P.pixelRatio;s(fe[0],L[0]-b,L[1]+b,0),s(fe[1],L[0]+b,L[1]+b,0),s(fe[2],L[0]+b,L[1]-b,0),s(fe[3],L[0]-b,L[1]-b,0);for(let e=0;e<4;e++)if(!P.unprojectFromRenderScreen(fe[e],Te[e]))return;O(P.eye,Te[0],Te[1],de),O(P.eye,Te[1],Te[2],_e),O(P.eye,Te[2],Te[3],Ee),O(P.eye,Te[3],Te[0],Ae);let C=Number.MAX_VALUE,U=0;const y=K(this.parameters,I)?v.length-2:v.length-5;for(let e=0;e<y;e+=3){ee[0]=v[e]+u[12],ee[1]=v[e+1]+u[13],ee[2]=v[e+2]+u[14];const t=(e+3)%v.length;if(te[0]=v[t]+u[12],te[1]=v[t+1]+u[13],te[2]=v[t+2]+u[14],g(de,ee)<0&&g(de,te)<0||g(_e,ee)<0&&g(_e,te)<0||g(Ee,ee)<0&&g(Ee,te)<0||g(Ae,ee)<0&&g(Ae,te)<0)continue;if(P.projectToRenderScreen(ee,ae),P.projectToRenderScreen(te,ne),ae[2]<0&&ne[2]>0){a(re,ee,te);const e=P.frustum,t=-g(e[T.NEAR],ee)/n(re,S(e[T.NEAR]));o(re,re,t),l(ee,ee,re),P.projectToRenderScreen(ee,ae)}else if(ae[2]>0&&ne[2]<0){a(re,te,ee);const e=P.frustum,t=-g(e[T.NEAR],te)/n(re,S(e[T.NEAR]));o(re,re,t),l(te,te,re),P.projectToRenderScreen(te,ne)}else if(ae[2]<0&&ne[2]<0)continue;ae[2]=0,ne[2]=0;const r=_(E(ae,ne,ce),L);r<C&&(C=r,c(oe,ee),c(le,te),U=e/3)}const D=m.rayBegin,j=m.rayEnd;if(C<b*b){let e=Number.MAX_VALUE;if(A(E(oe,le,ce),E(D,j,pe),ie)){a(ie,ie,D);const t=p(ie);o(ie,ie,1/t),e=t/h(D,j)}R(e,ie,U,!1)}}get _layout(){const e=I().vec3f(M.POSITION).vec3f(M.PREVPOSITION).vec3f(M.NEXTPOSITION).f32(M.SUBDIVISIONFACTOR).vec2f(M.UV0);return this.parameters.vvSize?e.f32(M.SIZEFEATUREATTRIBUTE):e.f32(M.SIZE),this.parameters.vvColor?e.f32(M.COLORFEATUREATTRIBUTE):e.vec4u8(M.COLOR),this.parameters.vvOpacity&&e.f32(M.OPACITYFEATUREATTRIBUTE),U()&&e.vec4u8(M.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new X(this._layout,this.parameters)}createGLMaterial(e){return new Y(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class Y extends y{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(H,e)}}class q extends x{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=k.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,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}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class X{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t,this.numJoinSubdivisions=0;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=J+r}}_isClosed(e){return K(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(M.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=he,l=ue,p=me,m=r.get(M.POSITION),f=m.indices,T=m.data.length/3,d=r.get(M.DISTANCETOSTART)?.data;f&&f.length!==2*(T-1)&&console.warn("RibbonLineMaterial does not support indices");const _=r.get(M.SIZEFEATUREATTRIBUTE)?.data[0]??r.get(M.SIZE)?.data[0]??1;let E=[1,1,1,1],A=0;const R=this.vertexBufferLayout.fields.has(M.COLORFEATUREATTRIBUTE);R?A=r.get(M.COLORFEATUREATTRIBUTE).data[0]:r.has(M.COLOR)&&(E=r.get(M.COLOR).data);const O=this.vertexBufferLayout.fields.has(M.OPACITYFEATUREATTRIBUTE),g=O?r.get(M.OPACITYFEATUREATTRIBUTE).data[0]:0,S=new Float32Array(a.buffer),I=new Uint8Array(a.buffer),v=this.vertexBufferLayout.stride/4;let N=n*v;const P=N;let L=0;const b=d?(e,t,r)=>L=d[r]:(e,t,r)=>L+=h(e,t),C=(e,t,r,s,a,n,o)=>{if(S[N++]=t[0],S[N++]=t[1],S[N++]=t[2],S[N++]=e[0],S[N++]=e[1],S[N++]=e[2],S[N++]=r[0],S[N++]=r[1],S[N++]=r[2],S[N++]=s,S[N++]=o,S[N++]=a,S[N++]=_,R)S[N++]=A;else{const e=Math.min(4*n,E.length-4),t=4*N;N++,I[t]=E[e],I[t+1]=E[e+1],I[t+2]=E[e+2],I[t+3]=E[e+3]}if(O&&(S[N++]=g),U()){const e=4*N;N++,i&&(I[e]=i[0],I[e+1]=i[1],I[e+2]=i[2],I[e+3]=i[3])}};N+=v,s(l,m.data[0],m.data[1],m.data[2]),e&&u(l,l,e);const y=this._isClosed(r);if(y){const t=m.data.length-3;s(o,m.data[t],m.data[t+1],m.data[t+2]),e&&u(o,o,e)}else s(p,m.data[3],m.data[4],m.data[5]),e&&u(p,p,e),C(l,l,p,1,Z.LEFT_CAP_START,0,0),C(l,l,p,1,Z.RIGHT_CAP_START,0,0),c(o,l),c(l,p);const D=y?0:1,j=y?T:T-1;for(let h=D;h<j;h++){const t=(h+1)%T*3;s(p,m.data[t],m.data[t+1],m.data[t+2]),e&&u(p,p,e),b(o,l,h),C(o,l,p,0,Z.LEFT_JOIN_END,h,L),C(o,l,p,0,Z.RIGHT_JOIN_END,h,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);C(o,l,p,t,Z.LEFT_JOIN_END,h,L),C(o,l,p,t,Z.RIGHT_JOIN_END,h,L)}C(o,l,p,1,Z.LEFT_JOIN_START,h,L),C(o,l,p,1,Z.RIGHT_JOIN_START,h,L),c(o,l),c(l,p)}y?(s(p,m.data[3],m.data[4],m.data[5]),e&&u(p,p,e),L=b(o,l,j),C(o,l,p,0,Z.LEFT_JOIN_END,D,L),C(o,l,p,0,Z.RIGHT_JOIN_END,D,L)):(L=b(o,l,j),C(o,l,l,0,Z.LEFT_CAP_END,j,L),C(o,l,l,0,Z.RIGHT_CAP_END,j,L)),Q(S,P+v,S,P,v);return N=Q(S,N-v,S,N,v),this._parameters.wireframe&&this._addWireframeVertices(a,P,N,v),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=Q(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function Q(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function K(e,t){if(!e.isClosed)return!1;return t.get(M.POSITION).indices.length>2}function $(e){return e.anchor===B.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const ee=m(),te=m(),re=m(),ie=m(),se=m(),ae=r(),ne=r(),oe=m(),le=m(),ce=d(),pe=d(),he=m(),ue=m(),me=m(),fe=[r(),r(),r(),r()],Te=[m(),m(),m(),m()],de=R(),_e=R(),Ee=R(),Ae=R();export{q as Parameters,W as RibbonLineMaterial};
|
|
5
|
+
import{Float16Array as e}from"@petamoriken/float16";import t from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as a,d as n,f as o,h as l,g as c,c as p,l as h,j as m,t as f}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as T}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as E,fromPoints as A,closestLineSegmentPoint as R}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPoints as O,signedDistance as S,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as P,isColorOrColorEmission as N,isDepth as L,isColorEmissionHighlightOIDOrDepth as b,is2DGeometryOutput as C,ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as w}from"../lib/Material.js";import{RenderSlot as F}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as x}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as J}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as B}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as z}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as H,RibbonLineTechnique as G}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as k,CapType as V}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Z}from"../../../../webscene/support/AlphaCutoff.js";var W;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(W||(W={}));class Y extends D{constructor(e){super(e,X),this._configuration=new k,this.vertexAttributeLocations=H,this.produces=new Map([[F.OPAQUE_MATERIAL,e=>P(e)||N(e)&&this.parameters.renderOccluded===w.OccludeAndTransparentStencil],[F.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>L(e)],[F.OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===w.OccludeAndTransparentStencil],[F.TRANSPARENT_OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===w.OccludeAndTransparentStencil],[F.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==w.OccludeAndTransparentStencil],[F.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==w.OccludeAndTransparentStencil],[F.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){this._configuration.output=e,this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===F.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==U.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&ee(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===w.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=Z||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>Z}intersectDraped({attributes:e,screenToWorldRatio:t},i,s,a,n,o){if(!s.options.selectionMode)return;const l=e.get(x.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const t=e.get(x.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(t)?c*=this.parameters.vvSize.fallback[0]:c*=r(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const p=a[0],h=a[1],m=(c/2+4)*t;let f=Number.MAX_VALUE,u=0;const T=e.get(x.POSITION).data,d=$(this.parameters,e)?T.length-2:T.length-5;for(let _=0;_<d;_+=3){const e=T[_],t=T[_+1],i=(_+3)%T.length,s=p-e,a=h-t,n=T[i]-e,o=T[i+1]-t,l=r((n*s+o*a)/(n*n+o*o),0,1),c=n*l-s,m=o*l-a,d=c*c+m*m;d<f&&(f=d,u=_/3)}f<m*m&&n(o.dist,o.normal,u,!1)}intersect(e,i,f,u,T,_){if(!f.options.selectionMode||!e.visible)return;if(!M(i))return void t.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const g=e.attributes,v=g.get(x.POSITION).data;let P=this.parameters.width;if(this.parameters.vvSize){const e=g.get(x.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(P*=r(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else g.has(x.SIZE)&&(P*=g.get(x.SIZE).data[0]);const N=f.camera,L=ae;s(L,f.point);const b=P*N.pixelRatio/2+4*N.pixelRatio;a(Te[0],L[0]-b,L[1]+b,0),a(Te[1],L[0]+b,L[1]+b,0),a(Te[2],L[0]+b,L[1]-b,0),a(Te[3],L[0]-b,L[1]-b,0);for(let t=0;t<4;t++)if(!N.unprojectFromRenderScreen(Te[t],de[t]))return;O(N.eye,de[0],de[1],_e),O(N.eye,de[1],de[2],Ee),O(N.eye,de[2],de[3],Ae),O(N.eye,de[3],de[0],Re);let C=Number.MAX_VALUE,U=0;const y=$(this.parameters,g)?v.length-2:v.length-5;for(let t=0;t<y;t+=3){te[0]=v[t]+i[12],te[1]=v[t+1]+i[13],te[2]=v[t+2]+i[14];const e=(t+3)%v.length;if(re[0]=v[e]+i[12],re[1]=v[e+1]+i[13],re[2]=v[e+2]+i[14],S(_e,te)<0&&S(_e,re)<0||S(Ee,te)<0&&S(Ee,re)<0||S(Ae,te)<0&&S(Ae,re)<0||S(Re,te)<0&&S(Re,re)<0)continue;if(N.projectToRenderScreen(te,ne),N.projectToRenderScreen(re,oe),ne[2]<0&&oe[2]>0){n(ie,te,re);const e=N.frustum,t=-S(e[d.NEAR],te)/o(ie,I(e[d.NEAR]));l(ie,ie,t),c(te,te,ie),N.projectToRenderScreen(te,ne)}else if(ne[2]>0&&oe[2]<0){n(ie,re,te);const e=N.frustum,t=-S(e[d.NEAR],re)/o(ie,I(e[d.NEAR]));l(ie,ie,t),c(re,re,ie),N.projectToRenderScreen(re,oe)}else if(ne[2]<0&&oe[2]<0)continue;ne[2]=0,oe[2]=0;const r=E(A(ne,oe,pe),L);r<C&&(C=r,p(le,te),p(ce,re),U=t/3)}const j=f.rayBegin,D=f.rayEnd;if(C<b*b){let e=Number.MAX_VALUE;if(R(A(le,ce,pe),A(j,D,he),se)){n(se,se,j);const t=h(se);l(se,se,1/t),e=t/m(j,D)}_(e,se,U,!1)}}get _layout(){const e=v().vec3f(x.POSITION).vec3f(x.PREVPOSITION).vec3f(x.NEXTPOSITION).vec2f16(x.LINEPARAMETERS).f32(x.U0);return this.parameters.vvSize?e.f32(x.SIZEFEATUREATTRIBUTE):e.f32(x.SIZE),this.parameters.vvColor?e.f32(x.COLORFEATUREATTRIBUTE):e.vec4u8(x.COLOR),this.parameters.vvOpacity&&e.f32(x.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(x.OLIDCOLOR),e}createBufferWriter(){return new Q(this._layout,this.parameters)}createGLMaterial(e){return new q(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class q extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(G,e)}}class X extends J{constructor(){super(...arguments),this.width=0,this.color=T,this.join="miter",this.cap=V.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,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}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class Q{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t,this.numJoinSubdivisions=0;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=z+r}}_isClosed(e){return $(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(x.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(t,r,i,s,n,o){const l=me,c=fe,h=ue,u=i.get(x.POSITION),T=u.indices,d=u.data.length/3,_=i.get(x.DISTANCETOSTART)?.data;T&&T.length!==2*(d-1)&&console.warn("RibbonLineMaterial does not support indices");const E=i.get(x.SIZEFEATUREATTRIBUTE)?.data[0]??i.get(x.SIZE)?.data[0]??1;let A=[1,1,1,1],R=0;const g=this.vertexBufferLayout.fields.has(x.COLORFEATUREATTRIBUTE);g?R=i.get(x.COLORFEATUREATTRIBUTE).data[0]:i.has(x.COLOR)&&(A=i.get(x.COLOR).data);const O=this.vertexBufferLayout.fields.has(x.OPACITYFEATUREATTRIBUTE),S=O?i.get(x.OPACITYFEATUREATTRIBUTE).data[0]:0,I=new Float32Array(n.buffer),v=new e(n.buffer),P=new Uint8Array(n.buffer),N=this.vertexBufferLayout.stride/4;let L=o*N;const b=L;let C=0;const U=_?(e,t,r)=>C=_[r]:(e,t,r)=>C+=m(e,t),j=(e,t,r,i,a,n,o)=>{I[L++]=t[0],I[L++]=t[1],I[L++]=t[2],I[L++]=e[0],I[L++]=e[1],I[L++]=e[2],I[L++]=r[0],I[L++]=r[1],I[L++]=r[2];const l=2*L;if(L++,v[l]=i,v[l+1]=a,I[L++]=o,I[L++]=E,g)I[L++]=R;else{const e=Math.min(4*n,A.length-4),t=4*L;L++,P[t]=A[e],P[t+1]=A[e+1],P[t+2]=A[e+2],P[t+3]=A[e+3]}if(O&&(I[L++]=S),y()){const e=4*L;L++,s&&(P[e]=s[0],P[e+1]=s[1],P[e+2]=s[2],P[e+3]=s[3])}};L+=N,a(c,u.data[0],u.data[1],u.data[2]),t&&f(c,c,t);const D=this._isClosed(i);if(D){const e=u.data.length-3;a(l,u.data[e],u.data[e+1],u.data[e+2]),t&&f(l,l,t)}else a(h,u.data[3],u.data[4],u.data[5]),t&&f(h,h,t),j(c,c,h,1,W.LEFT_CAP_START,0,0),j(c,c,h,1,W.RIGHT_CAP_START,0,0),p(l,c),p(c,h);const w=D?0:1,F=D?d:d-1;for(let e=w;e<F;e++){const r=(e+1)%d*3;a(h,u.data[r],u.data[r+1],u.data[r+2]),t&&f(h,h,t),U(l,c,e),j(l,c,h,0,W.LEFT_JOIN_END,e,C),j(l,c,h,0,W.RIGHT_JOIN_END,e,C);const i=this.numJoinSubdivisions;for(let t=0;t<i;++t){const r=(t+1)/(i+1);j(l,c,h,r,W.LEFT_JOIN_END,e,C),j(l,c,h,r,W.RIGHT_JOIN_END,e,C)}j(l,c,h,1,W.LEFT_JOIN_START,e,C),j(l,c,h,1,W.RIGHT_JOIN_START,e,C),p(l,c),p(c,h)}D?(a(h,u.data[3],u.data[4],u.data[5]),t&&f(h,h,t),C=U(l,c,F),j(l,c,h,0,W.LEFT_JOIN_END,w,C),j(l,c,h,0,W.RIGHT_JOIN_END,w,C)):(C=U(l,c,F),j(l,c,c,0,W.LEFT_CAP_END,F,C),j(l,c,c,0,W.RIGHT_CAP_END,F,C)),K(I,b+N,I,b,N);return L=K(I,L-N,I,L,N),this._parameters.wireframe&&this._addWireframeVertices(n,b,L,N),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=K(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function K(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function $(e,t){if(!e.isClosed)return!1;return t.get(x.POSITION).indices.length>2}function ee(e){return e.anchor===B.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const te=u(),re=u(),ie=u(),se=u(),ae=u(),ne=i(),oe=i(),le=u(),ce=u(),pe=_(),he=_(),me=u(),fe=u(),ue=u(),Te=[i(),i(),i(),i()],de=[u(),u(),u(),u()],_e=g(),Ee=g(),Ae=g(),Re=g();export{X as Parameters,Y as RibbonLineMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isColorOrColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{NoConfiguration as e}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import t from"../lib/GLMaterial.js";import{RenderOccludedFlag as i}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{DefaultBufferWriter as s}from"./DefaultBufferWriter.js";import{
|
|
5
|
+
import{isColorOrColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{NoConfiguration as e}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import t from"../lib/GLMaterial.js";import{RenderOccludedFlag as i}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{DefaultBufferWriter as s}from"./DefaultBufferWriter.js";import{PositionUvLayout as a}from"./DefaultLayouts.js";import{TriangleMaterial as n}from"./TriangleMaterial.js";import{SlicePlaneMaterialTechnique as u,SlicePlaneMaterialPassParameters as c}from"../shaders/SlicePlaneMaterialTechnique.js";class l extends n{constructor(e){super(e,p),this.produces=new Map([[o.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>r(e)]])}get visible(){return!0}createGLMaterial(r){return new m(r)}createBufferWriter(){return new s(a)}getConfiguration(){return e}}class m extends t{constructor(r){super(r)}beginSlot(r){return this.getTechnique(u,r)}}class p extends c{constructor(){super(...arguments),this.renderOccluded=i.Occlude,this.isDecoration=!1}}export{p as Parameters,l as SlicePlaneMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrColorEmission as a,isHighlightOrOID as s,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{MaterialParameters as l}from"../lib/Material.js";import{OITPolygonOffsetLimit as c}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as m}from"../lib/RenderSlot.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{
|
|
5
|
+
import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrColorEmission as a,isHighlightOrOID as s,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{MaterialParameters as l}from"../lib/Material.js";import{OITPolygonOffsetLimit as c}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as m}from"../lib/RenderSlot.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{PositionUvOlidLayout as p,PositionUvLayout as f}from"./DefaultLayouts.js";import{TriangleMaterial as u}from"./TriangleMaterial.js";import{WaterGLMaterial as d}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as g}from"./WaterTechniqueConfiguration.js";class _ extends u{constructor(t,e){super(t,v),this.produces=new Map([[m.OPAQUE_MATERIAL,t=>a(t)&&!this.parameters.transparent||s(t)],[m.TRANSPARENT_MATERIAL,t=>a(t)&&this.parameters.transparent||s(t)],[m.DRAPED_MATERIAL,t=>this.parameters.draped&&a(t)||s(t)],[m.DRAPED_WATER,t=>t===o.Normal]]),this._configuration=new g(e.spherical)}getConfiguration(t,e){return this._configuration.output=t,this._configuration.writeDepth=!0,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.screenSpaceReflections=null!=e.ssr.lastFrameColor,this._configuration.cloudReflections=null!=e.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=e.oitPass,this._configuration.enableOffset=e.camera.relativeElevation<c,this._configuration.terrainDepthTest=e.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration}get visible(){return!0}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<T}createGLMaterial(t){return new d(t)}createBufferWriter(){return new h(n()?p:f)}get test(){}}class v extends l{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const T=35e3;export{v as Parameters,_ as WaterMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{hasIdentityRotation as e,isOrthoNormal as t}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as f,BufferViewVec2f as r,BufferViewVec4f as o,BufferViewFloat as i,BufferViewVec2i16 as s,BufferViewVec3f as
|
|
5
|
+
import{hasIdentityRotation as e,isOrthoNormal as t}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as f,BufferViewVec2f as r,BufferViewVec4f as o,BufferViewFloat as i,BufferViewVec2i16 as s,BufferViewVec2f16 as n,BufferViewVec3f as c}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as l}from"../../lib/Util.js";import{VertexAttribute as d}from"../../lib/VertexAttribute.js";function u(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l)s[f]=o[i[l]],f+=n;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)s[f]=e,f+=n}}function a(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=s}}function p(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=3*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}}function y(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=4*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}}function B(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function g(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=s}}function b(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=s}}function O(t,f,r,o,i=1){if(!f)return void p(t,r,o,i);const{data:s,indices:n}=t,c=r.typedBuffer,l=r.typedBufferStride,d=n.length,u=f[0],a=f[1],y=f[2],B=f[4],g=f[5],b=f[6],O=f[8],h=f[9],m=f[10],N=f[12],S=f[13],I=f[14];o*=l;let F=0,R=0,z=0;const E=e(f)?e=>{F=s[e]+N,R=s[e+1]+S,z=s[e+2]+I}:e=>{const t=s[e],f=s[e+1],r=s[e+2];F=u*t+B*f+O*r+N,R=a*t+g*f+h*r+S,z=y*t+b*f+m*r+I};if(1===i)for(let e=0;e<d;++e)E(3*n[e]),c[o]=F,c[o+1]=R,c[o+2]=z,o+=l;else for(let e=0;e<d;++e){E(3*n[e]);for(let e=0;e<i;++e)c[o]=F,c[o+1]=R,c[o+2]=z,o+=l}}function h(f,r,o,i,s=1){if(!r)return void p(f,o,i,s);const{data:n,indices:c}=f,l=r,d=o.typedBuffer,u=o.typedBufferStride,a=c.length,y=l[0],B=l[1],g=l[2],b=l[4],O=l[5],h=l[6],m=l[8],N=l[9],S=l[10],I=!t(l),F=1e-6,R=1-F;i*=u;let z=0,E=0,A=0;const L=e(l)?e=>{z=n[e],E=n[e+1],A=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];z=y*t+b*f+m*r,E=B*t+O*f+N*r,A=g*t+h*f+S*r};if(1===s)if(I)for(let e=0;e<a;++e){L(3*c[e]);const t=z*z+E*E+A*A;if(t<R&&t>F){const e=1/Math.sqrt(t);d[i]=z*e,d[i+1]=E*e,d[i+2]=A*e}else d[i]=z,d[i+1]=E,d[i+2]=A;i+=u}else for(let e=0;e<a;++e)L(3*c[e]),d[i]=z,d[i+1]=E,d[i+2]=A,i+=u;else for(let e=0;e<a;++e){if(L(3*c[e]),I){const e=z*z+E*E+A*A;if(e<R&&e>F){const t=1/Math.sqrt(e);z*=t,E*=t,A*=t}}for(let e=0;e<s;++e)d[i]=z,d[i+1]=E,d[i+2]=A,i+=u}}function m(e,f,r,o,i=1){if(!f)return void y(e,r,o,i);const{data:s,indices:n}=e,c=f,l=r.typedBuffer,d=r.typedBufferStride,u=n.length,a=c[0],p=c[1],B=c[2],g=c[4],b=c[5],O=c[6],h=c[8],m=c[9],N=c[10],S=!t(c),I=1e-6,F=1-I;if(o*=d,1===i)for(let t=0;t<u;++t){const e=4*n[t],f=s[e],r=s[e+1],i=s[e+2],c=s[e+3];let u=a*f+g*r+h*i,y=p*f+b*r+m*i,R=B*f+O*r+N*i;if(S){const e=u*u+y*y+R*R;if(e<F&&e>I){const t=1/Math.sqrt(e);u*=t,y*=t,R*=t}}l[o]=u,l[o+1]=y,l[o+2]=R,l[o+3]=c,o+=d}else for(let t=0;t<u;++t){const e=4*n[t],f=s[e],r=s[e+1],c=s[e+2],u=s[e+3];let y=a*f+g*r+h*c,R=p*f+b*r+m*c,z=B*f+O*r+N*c;if(S){const e=y*y+R*R+z*z;if(e<F&&e>I){const t=1/Math.sqrt(e);y*=t,R*=t,z*=t}}for(let t=0;t<i;++t)l[o]=y,l[o+1]=R,l[o+2]=z,l[o+3]=u,o+=d}}function N(e,t,f,r,o=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(r*=c,t!==i.length||4!==t)if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=255,r+=c}}else{n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=s,r+=t}}function S(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length,c=r[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function I(e,t,f,r,o=1){const i=t.typedBuffer,s=t.typedBufferStride;if(r*=s,1===o)for(let n=0;n<f;++n)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s;else for(let n=0;n<f;++n)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s}function F(e,t,r,o,i,s,n){let c={numItems:0,numVerticesPerItem:0};for(const l of r.fields.keys()){const r=e.get(l),u=r?.indices;if(r&&u)l===d.POSITION&&(c={numItems:1,numVerticesPerItem:u.length}),R(l,r,o,i,s,n);else if(l===d.OLIDCOLOR&&null!=t){const r=e.get(d.POSITION)?.indices;if(r){const e=r.length;I(t,s.getField(l,f),e,n)}}}return c}function R(e,t,u,p,B,g){switch(e){case d.POSITION:{l(3===t.size);const f=B.getField(e,c);l(!!f,`No buffer view for ${e}`),f&&O(t,u,f,g);break}case d.NORMAL:{l(3===t.size);const f=B.getField(e,c);l(!!f,`No buffer view for ${e}`),f&&h(t,p,f,g);break}case d.NORMALCOMPRESSED:case d.PROFILERIGHT:case d.PROFILEUP:{l(2===t.size);const f=B.getField(e,s);l(!!f,`No buffer view for ${e}`),f&&a(t,f,g);break}case d.UV0:{l(2===t.size);const f=B.getField(e,n);l(!!f,`No buffer view for ${e}`),f&&a(t,f,g);break}case d.UVI:{l(2===t.size);const f=B.getField(e,s);l(!!f,`No buffer view for ${e}`),f&&a(t,f,g);break}case d.COLOR:case d.SYMBOLCOLOR:{const r=B.getField(e,f);l(!!r,`No buffer view for ${e}`),l(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||N(t,t.size,r,g);break}case d.COLORFEATUREATTRIBUTE:{const f=B.getField(e,i);l(!!f,`No buffer view for ${e}`),l(1===t.size),f&&1===t.size&&S(t,f,g);break}case d.TANGENT:{l(4===t.size);const f=B.getField(e,o);l(!!f,`No buffer view for ${e}`),f&&m(t,u,f,g);break}case d.PROFILEVERTEXANDNORMAL:case d.FEATUREVALUE:{l(4===t.size);const f=B.getField(e,o);l(!!f,`No buffer view for ${e}`),f&&y(t,f,g)}break;case d.PROFILEAUXDATA:{l(2===t.size);const f=B.getField(e,r);l(!!f,`No buffer view for ${e}`),f&&a(t,f,g)}}}export{u as writeBufferFloat,g as writeBufferMat3f,b as writeBufferMat4f,a as writeBufferVec2,p as writeBufferVec3,y as writeBufferVec4,B as writeBufferVec4Zeros,N as writeColor,S as writeColorFeatureAttribute,R as writeDefaultAttribute,F as writeDefaultAttributes,h as writeNormal,I as writeOlidColor,O as writePosition,m as writeTangent};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../../../geometry/support/Ellipsoid.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/hud/AlignPixel.glsl.js";import"../core/shaderLibrary/hud/HUD.glsl.js";import"../core/shaderLibrary/hud/HUDOcclusionPass.glsl.js";import"../core/shaderLibrary/hud/HUDVisibility.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4DrawUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DBindUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../lib/OITPass.js";import"../lib/VertexAttribute.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build,c as calculateAnchorPosition,s as shaderSettings}from"../../../../chunks/HUDMaterial.glsl.js";
|
|
5
|
+
import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../../../geometry/support/Ellipsoid.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/hud/AlignPixel.glsl.js";import"../core/shaderLibrary/hud/HUD.glsl.js";import"../core/shaderLibrary/hud/HUDOcclusionPass.glsl.js";import"../core/shaderLibrary/hud/HUDVisibility.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4DrawUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DBindUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../lib/OITPass.js";import"../lib/VertexAttribute.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build,c as calculateAnchorPosition,f as fullUV,s as shaderSettings}from"../../../../chunks/HUDMaterial.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isColorOrColorEmission as e,ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as s}from"../effects/geometry/olidUtils.js";import{OITPass as l}from"../lib/OITPass.js";import{blending as n,oitDepthTest as o,depthWrite as p,getDrawBuffers as a,getOITPolygonOffset as u}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as c,stencilToolMaskBaseParams as O,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{P as d}from"../../../../chunks/Pattern.glsl.js";import{SpecialDrawBuffers as
|
|
5
|
+
import{isColorOrColorEmission as e,ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as s}from"../effects/geometry/olidUtils.js";import{OITPass as l}from"../lib/OITPass.js";import{blending as n,oitDepthTest as o,depthWrite as p,getDrawBuffers as a,getOITPolygonOffset as u}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as c,stencilToolMaskBaseParams as O,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{P as d}from"../../../../chunks/Pattern.glsl.js";import{SpecialDrawBuffers as P}from"../../../webgl/enums.js";import{makePipelineState as T,cullingParams as h,defaultColorWrite as S}from"../../../webgl/renderState.js";class b extends i{constructor(e,t){super(e,t,new r(d,(()=>import("./Pattern.glsl.js"))),s()?R:E)}_setPipelineState(r,i){const{oitPass:s,output:m,cullFace:d,draped:b,hasOccludees:E,polygonOffset:R,enableOffset:g}=r,I=s===l.NONE,N=s===l.FrontFace;return T({blending:e(m)?n(s):null,culling:h(d),depthTest:b?null:{func:o(s)},depthWrite:p(r),drawBuffers:m===t.Depth?{buffers:[P.NONE]}:a(s,m),colorWrite:S,stencilWrite:E?c:null,stencilTest:E?i?O:f:null,polygonOffset:I||N?R?j:null:u(g)})}initializePipeline(e){return this._occludeePipelineState=this._setPipelineState(e,!0),this._setPipelineState(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}const j={factor:1,units:1},E=new Map([[m.POSITION,0],[m.COLOR,3],[m.UVMAPSPACE,4],[m.COLORFEATUREATTRIBUTE,5],[m.BOUNDINGRECT,6]]),R=new Map([[m.POSITION,0],[m.COLOR,3],[m.UVMAPSPACE,4],[m.COLORFEATUREATTRIBUTE,5],[m.BOUNDINGRECT,6],[m.OLIDCOLOR,9]]);export{b as PatternTechnique,E as vertexAttributeLocations,R as vertexAttributeLocationsOID};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderTechniqueConfiguration as e,parameter as r}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class s extends e{constructor(){super(...arguments),this.receiveShadows=!0,this.worldPositionFromDepthMap=!0}}o([r()],s.prototype,"receiveShadows",void 0),o([r()],s.prototype,"worldPositionFromDepthMap",void 0);export{s as ReadShadowMapConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import{isColorOrColorEmission as e,ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{blending as s,oitDepthTest as n,depthWrite as o,getDrawBuffers as u,OITPolygonOffset as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as a,stencilToolMaskBaseParams as f,stencilBaseAllZerosParams as d,depthCompareAlways as T,stencilToolTransparentOccluderParams as h,stencilWriteMaskOff as O,stencilToolMaskOccluderParams as m,depthCompareLess as E}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as
|
|
5
|
+
import"../../../../core/has.js";import{isColorOrColorEmission as e,ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{blending as s,oitDepthTest as n,depthWrite as o,getDrawBuffers as u,OITPolygonOffset as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as a,stencilToolMaskBaseParams as f,stencilBaseAllZerosParams as d,depthCompareAlways as T,stencilToolTransparentOccluderParams as h,stencilWriteMaskOff as O,stencilToolMaskOccluderParams as m,depthCompareLess as E}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as b,SpecialDrawBuffers as I}from"../../../webgl/enums.js";import{makePipelineState as N,defaultColorWrite as g,premultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";class A extends r{constructor(e,t){super(e,t,new i(R,(()=>import("./RibbonLine.glsl.js"))),L),this.primitiveType=t.wireframe?b.LINES:b.TRIANGLE_STRIP}_makePipelineState(i,r){const{oitPass:c,output:T,hasOccludees:h,hasPolygonOffset:O}=i,m=c===l.NONE,E=c===l.FrontFace;return N({blending:e(T)?s(c):null,depthTest:{func:n(c)},depthWrite:o(i),drawBuffers:T===t.Depth?{buffers:[I.NONE]}:u(c,T),colorWrite:g,stencilWrite:h?a:null,stencilTest:h?r?f:d:null,polygonOffset:m||E?O?_:null:p})}initializePipeline(e){if(e.occluder){const i=e.hasPolygonOffset?_:null;this._occluderPipelineTransparent=N({blending:S,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:g,stencilWrite:null,stencilTest:h,drawBuffers:e.output===t.Depth?{buffers:[I.NONE]}:null}),this._occluderPipelineOpaque=N({blending:S,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:g,stencilWrite:O,stencilTest:m,drawBuffers:e.output===t.Depth?{buffers:[I.NONE]}:null}),this._occluderPipelineMaskWrite=N({blending:null,polygonOffset:i,depthTest:E,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:f,drawBuffers:e.output===t.Depth?{buffers:[I.NONE]}:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case c.TRANSPARENT_OCCLUDER_MATERIAL:return this._occluderPipelineTransparent??super.getPipeline();case c.OCCLUDER_MATERIAL:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const _={factor:0,units:-4},L=new Map([[P.POSITION,0],[P.PREVPOSITION,1],[P.NEXTPOSITION,2],[P.LINEPARAMETERS,3],[P.U0,4],[P.COLOR,5],[P.COLORFEATUREATTRIBUTE,5],[P.SIZE,6],[P.SIZEFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OLIDCOLOR,8]]);export{A as RibbonLineTechnique,L as vertexAttributeLocations};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/
|
|
5
|
+
import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DBindUniform.js";import"./ReadShadowMapConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{S as ShadowCastMaxSamples,b as build}from"../../../../chunks/ShadowCastAccumulate.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../chunks/vec32.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../terrain/OverlayContent.js";import"../../terrain/TransparencyMode.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexTangent.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/terrain/Overlay.glsl.js";import"../core/shaderLibrary/terrain/TerrainTexture.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../core/shaderModules/
|
|
5
|
+
import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../chunks/vec32.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../terrain/OverlayContent.js";import"../../terrain/TransparencyMode.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexTangent.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/terrain/Overlay.glsl.js";import"../core/shaderLibrary/terrain/TerrainTexture.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../lib/VertexAttribute.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{T as TerrainPassParameters,b as build}from"../../../../chunks/Terrain.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{TransparencyMode as r}from"../../terrain/TransparencyMode.js";import{NormalType as t}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as o}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OverlayMode as s}from"../core/shaderLibrary/terrain/Overlay.glsl.js";import{TileBlendInput as a}from"../core/shaderLibrary/terrain/TileBlendInput.js";import{parameter as n}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as p}from"../materials/DefaultTechniqueConfiguration.js";class d extends p{constructor(e){super(),this.spherical=e,this.overlayMode=s.Disabled,this.tileBlendInput=a.LayerOnly,this.transparencyMode=r.Opaque,this.pbrMode=i.Simplified,this.receiveShadows=!1,this.backfaceCullingEnabled=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.tileBorders=!1,this.visualizeNormals=!1,this.screenSizePerspective=!1,this.receiveAmbientOcclusion=!1,this.normalType=t.Compressed,this.textureCoordinateType=o.
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{TransparencyMode as r}from"../../terrain/TransparencyMode.js";import{NormalType as t}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateType as o}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OverlayMode as s}from"../core/shaderLibrary/terrain/Overlay.glsl.js";import{TileBlendInput as a}from"../core/shaderLibrary/terrain/TileBlendInput.js";import{parameter as n}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as p}from"../materials/DefaultTechniqueConfiguration.js";class d extends p{constructor(e){super(),this.spherical=e,this.overlayMode=s.Disabled,this.tileBlendInput=a.LayerOnly,this.transparencyMode=r.Opaque,this.pbrMode=i.Simplified,this.receiveShadows=!1,this.backfaceCullingEnabled=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.tileBorders=!1,this.visualizeNormals=!1,this.screenSizePerspective=!1,this.receiveAmbientOcclusion=!1,this.normalType=t.Compressed,this.textureCoordinateType=o.Default,this.highStepCount=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.canHaveOverlay=!0}}e([n({count:s.COUNT})],d.prototype,"overlayMode",void 0),e([n({count:a.COUNT})],d.prototype,"tileBlendInput",void 0),e([n({count:r.COUNT})],d.prototype,"transparencyMode",void 0),e([n({count:i.COUNT})],d.prototype,"pbrMode",void 0),e([n()],d.prototype,"receiveShadows",void 0),e([n()],d.prototype,"backfaceCullingEnabled",void 0),e([n()],d.prototype,"textureFadingEnabled",void 0),e([n()],d.prototype,"renderOccluded",void 0),e([n()],d.prototype,"screenSpaceReflections",void 0),e([n()],d.prototype,"cloudReflections",void 0),e([n()],d.prototype,"tileBorders",void 0),e([n()],d.prototype,"visualizeNormals",void 0),e([n()],d.prototype,"screenSizePerspective",void 0),e([n()],d.prototype,"receiveAmbientOcclusion",void 0);export{d as TerrainTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Error.js";import{makeHandle as i,abortHandle as o}from"../../core/handleUtils.js";import{isAborted as s}from"../../core/promiseUtils.js";import{watch as r}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Error.js";import{makeHandle as i,abortHandle as o}from"../../core/handleUtils.js";import{isAborted as s}from"../../core/promiseUtils.js";import{watch as r}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{isSubtypeSublayer as n}from"../../layers/support/layerUtils.js";import{createFeatureServices as d}from"../../rest/featureService/utils.js";import c from"../../views/draw/support/HighlightHelper.js";import{temporaryHighlightName as u}from"../../views/support/HighlightDefaults.js";import p from"./AddAssociationWorkflowData.js";import w from"./Workflow.js";import{fetchFullFeature as h}from"./workflowUtils.js";import m from"../FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js";import{getFeatureTitle as y}from"../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";var A;const f={exit:Symbol()};let g=class extends w{static{A=this}constructor(t){super(t),this._utilityNetworkAssociationAddAssociationViewModel=new m,this._highlightHelper=null,this.sourceFeatureItem=null,this.type="add-association"}initialize(){const{data:t}=this,{view:e}=t.viewModel;e&&(this._highlightHelper=new c({view:e,highlightName:u}),this.addHandles(i((()=>this._highlightHelper?.removeAll()))));const s=new AbortController;this.addHandles(o(s)),this._updatingHandles.addPromise(this._setup(s))}get editorItem(){return this.data.editorItem}get featureFormViewModel(){return this._featureFormViewModel}get utilityNetworkAssociationAddAssociationViewModel(){return this._utilityNetworkAssociationAddAssociationViewModel}get hasPendingEdits(){return!!this._utilityNetworkAssociationAddAssociationViewModel.selectedFeature}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get reliesOnOwnerAdminPrivileges(){return this.editorItem.capabilities.create.reliesOnOwnerAdminPrivileges}async enter(){this._initializeUtilityNetworkAssociationAddAssociationViewModel()}exit(){this.removeHandles(f.exit)}async start(){return await super.start(),null}async _setup(t){const{data:i}=this,{feature:o}=i;try{const e=await h(o,i.viewModel.view.spatialReference,t.signal);if(s(t))return;const r=e.sourceLayer&&"getFeatureTitle"in e.sourceLayer?await e.sourceLayer.getFeatureTitle(e):y(e);if(s(t))return;this.sourceFeatureItem={feature:o,label:r},this._initializeUtilityNetworkAssociationAddAssociationViewModel()}catch(r){this.cancel({force:!0,error:new e("editor:failed-to-fetch-full-feature","Failed to retrieve all information for this feature. The update cannot proceed.",{detail:{error:r}})})}}_initializeUtilityNetworkAssociationAddAssociationViewModel(){const{viewModel:{view:t},utilityNetwork:e,associationType:i}=this.data,o=this._utilityNetworkAssociationAddAssociationViewModel;o.graphic=this.sourceFeatureItem.feature,o.map=t?.map,o.utilityNetwork=e,o.layer=this.layer,o.associationType=i,o.highlightHelper=this._highlightHelper,e.networkSystemLayers.loadAssociationsTable(),this.addHandles([r((()=>o.selectedLayer),(t=>{t&&this.go("add-association-select-feature")})),r((()=>o.selectedFeature),(t=>{t&&this.go("add-association-create-association")}))],f.exit)}static async create(t){const e=new A({data:await p.create(t),onCommit:this._onCommitFactory(t.applyEditsFeatureService)});return e._set("steps",this._createWorkflowSteps(e)),e}static _createWorkflowSteps(t){return[{id:"add-association-select-layer",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedLayer=null,e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-select-feature",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-create-association",async setUp(){},async tearDown(){}}]}static{this._onCommitFactory=t=>async i=>{const{feature:o,utilityNetwork:s,associationInput:r}=i,{utilityNetworkAssociationAddAssociationViewModel:a}=i.viewModel,{association:l}=a;await s.networkSystemLayers.loadAssociationsTable();const c=s?.generateAddAssociations([l]);if(!c)throw new e("editor:failed-to-add-association","Could not create payload needed to add association");const u=o.sourceLayer,p=n(u)&&u.parent?u.parent:u,w=d([p]),h=w.values().next().value?.featureService;if(!h)throw new e("editor:failed-to-delete-association","Could not retrieve feature service needed to delete association");await(h?.load());const m=s?.gdbVersion??void 0;await t(h,[c],{gdbVersion:m}),await r.refresh()}}};t([a()],g.prototype,"_utilityNetworkAssociationAddAssociationViewModel",void 0),t([a()],g.prototype,"_featureFormViewModel",void 0),t([a()],g.prototype,"editorItem",null),t([a()],g.prototype,"featureFormViewModel",null),t([a()],g.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),t([a()],g.prototype,"sourceFeatureItem",void 0),t([a()],g.prototype,"hasPendingEdits",null),t([a()],g.prototype,"layer",null),t([a()],g.prototype,"parent",null),t([a()],g.prototype,"parentLayer",null),t([a()],g.prototype,"reliesOnOwnerAdminPrivileges",null),g=A=t([l("esri.widgets.Editor.AddAssociationWorkflow")],g);export{g as AddAssociationWorkflow};
|