@arcgis/core 4.33.0-next.20250318 → 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/{e26e8feabf863350af20.js → 6a97bdd46715fc12e1b4.js} +65 -72
- 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/ShadowHighlight.glsl.js +2 -2
- package/chunks/Terrain.glsl.js +33 -34
- package/copyright.txt +29 -0
- 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/interfaces.d.ts +0 -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/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/shading/ReadShadowMap.glsl.js +6 -6
- 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/RibbonLineTechnique.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/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{d as t,e as n,n as e,h as o,g as s,f as r,i as l,c as h,t as u}from"../../../../chunks/vec32.js";import{fromValues as c,create as a,clone as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{clone as p,create as i,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as g}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as O,floatArrayFrom as m}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as A,getContinuousIndexArray as M}from"../../../../geometry/support/Indices.js";import{create as I,fromPositionAndNormal as y,intersectRay as N}from"../../../../geometry/support/plane.js";import{wrap as P}from"../../../../geometry/support/ray.js";import{Attribute as T}from"./Attribute.js";import{Vec3Compact as S}from"./BufferVectorMath.js";import{ContentObjectType as R}from"./ContentObjectType.js";import{Geometry as b}from"./Geometry.js";import{assert as L}from"./Util.js";import{VertexAttribute as d}from"./VertexAttribute.js";const j=S,E=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],U=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],V=[0,0,1,0,1,1,0,1],v=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],x=new Array(36);for(let Nt=0;Nt<6;Nt++)for(let t=0;t<6;t++)x[6*Nt+t]=Nt;const C=new Array(36);for(let Nt=0;Nt<6;Nt++)C[6*Nt]=0,C[6*Nt+1]=1,C[6*Nt+2]=2,C[6*Nt+3]=2,C[6*Nt+4]=3,C[6*Nt+5]=0;function F(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(24);for(let o=0;o<8;o++)e[3*o]=E[o][0]*n[0],e[3*o+1]=E[o][1]*n[1],e[3*o+2]=E[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,v,3,!0)],[d.NORMAL,new T(U,x,3)],[d.UV0,new T(V,C,2)]])}const G=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],D=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],q=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],z=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function B(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(18);for(let o=0;o<6;o++)e[3*o]=G[o][0]*n[0],e[3*o+1]=G[o][1]*n[1],e[3*o+2]=G[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,q,3,!0)],[d.NORMAL,new T(D,z,3)]])}const k=c(-.5,0,-.5),Z=c(.5,0,-.5),H=c(0,0,.5),J=c(0,.5,0),K=a(),Q=a(),W=a(),X=a(),Y=a();t(K,k,J),t(Q,k,Z),n(W,K,Q),e(W,W),t(K,Z,J),t(Q,Z,H),n(X,K,Q),e(X,X),t(K,H,J),t(Q,H,k),n(Y,K,Q),e(Y,Y);const $=[k,Z,H,J],_=[0,-1,0,W[0],W[1],W[2],X[0],X[1],X[2],Y[0],Y[1],Y[2]],tt=[0,1,2,3,1,0,3,2,1,3,0,2],nt=[0,0,0,1,1,1,2,2,2,3,3,3];function et(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(12);for(let o=0;o<4;o++)e[3*o]=$[o][0]*n[0],e[3*o+1]=$[o][1]*n[1],e[3*o+2]=$[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,tt,3,!0)],[d.NORMAL,new T(_,nt,3)]])}function ot(t,n,e,o,s={uv:!0}){const r=-Math.PI,l=2*Math.PI,h=-Math.PI/2,u=Math.PI,c=Math.max(3,Math.floor(e)),a=Math.max(2,Math.floor(o)),f=(c+1)*(a+1),p=O(3*f),i=O(3*f),w=O(2*f),g=[];let m=0;for(let O=0;O<=a;O++){const t=[],e=O/a,o=h+e*u,s=Math.cos(o);for(let h=0;h<=c;h++){const u=h/c,a=r+u*l,f=Math.cos(a)*s,g=Math.sin(o),O=-Math.sin(a)*s;p[3*m]=f*n,p[3*m+1]=g*n,p[3*m+2]=O*n,i[3*m]=f,i[3*m+1]=g,i[3*m+2]=O,w[2*m]=u,w[2*m+1]=e,t.push(m),++m}g.push(t)}const M=new Array;for(let O=0;O<a;O++)for(let t=0;t<c;t++){const n=g[O][t],e=g[O][t+1],o=g[O+1][t+1],s=g[O+1][t];0===O?(M.push(n),M.push(o),M.push(s)):O===a-1?(M.push(n),M.push(e),M.push(o)):(M.push(n),M.push(e),M.push(o),M.push(o),M.push(s),M.push(n))}const I=[[d.POSITION,new T(p,M,3,!0)],[d.NORMAL,new T(i,M,3,!0)]];return s.uv&&I.push([d.UV0,new T(w,M,2,!0)]),s.offset&&(I[0][0]=d.OFFSET,I.push([d.POSITION,new T(Float64Array.from(s.offset),A(M.length),3,!0)])),new b(t,I)}function st(t,n,e,o){const s=rt(n,e,o);return new b(t,s)}function rt(t,n,e){const o=t;let s,r;if(e)s=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],r=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const t=o*(1+Math.sqrt(5))/2;s=[-o,t,0,o,t,0,-o,-t,0,o,-t,0,0,-o,t,0,o,t,0,-o,-t,0,o,-t,t,0,-o,t,0,o,-t,0,-o,-t,0,o],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let c=0;c<s.length;c+=3)j.scale(s,c,t/j.length(s,c));let l={};function h(n,e){n>e&&([n,e]=[e,n]);const o=n.toString()+"."+e.toString();if(l[o])return l[o];let r=s.length;return s.length+=3,j.add(s,3*n,s,3*e,s,r),j.scale(s,r,t/j.length(s,r)),r/=3,l[o]=r,r}for(let c=0;c<n;c++){const t=r.length,n=new Array(4*t);for(let e=0;e<t;e+=3){const t=r[e],o=r[e+1],s=r[e+2],l=h(t,o),u=h(o,s),c=h(s,t),a=4*e;n[a]=t,n[a+1]=l,n[a+2]=c,n[a+3]=o,n[a+4]=u,n[a+5]=l,n[a+6]=s,n[a+7]=c,n[a+8]=u,n[a+9]=l,n[a+10]=u,n[a+11]=c}r=n,l={}}const u=m(s);for(let c=0;c<u.length;c+=3)j.normalize(u,c);return[[d.POSITION,new T(m(s),r,3,!0)],[d.NORMAL,new T(u,r,3,!0)]]}function lt(t,n={}){const{normal:e,position:o,color:s,rotation:r,size:l,centerOffsetAndDistance:h,uvs:u,featureAttribute:c,objectAndLayerIdColor:a=null}=n,f=o?p(o):i(),g=e?p(e):w(0,0,1),O=s?[255*s[0],255*s[1],255*s[2],s.length>3?255*s[3]:255]:[255,255,255,255],m=null!=l&&2===l.length?l:[1,1],M=null!=r?[r]:[0],I=A(1),y=[[d.POSITION,new T(f,I,3,!0)],[d.NORMAL,new T(g,I,3,!0)],[d.COLOR,new T(O,I,4,!0)],[d.SIZE,new T(m,I,2)],[d.ROTATION,new T(M,I,1,!0)]];if(u&&y.push([d.UV0,new T(u,I,u.length)]),null!=h){const t=[h[0],h[1],h[2],h[3]];y.push([d.CENTEROFFSETANDDISTANCE,new T(t,I,4)])}if(c){const t=[c[0],c[1],c[2],c[3]];y.push([d.FEATUREATTRIBUTE,new T(t,I,4)])}return new b(t,y,null,R.Point,a)}const ht=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function ut(t,n=ht){const e=new Array(12);for(let c=0;c<4;c++)for(let t=0;t<3;t++)e[3*c+t]=n[c][t];const o=[0,1,2,2,3,0],s=[0,0,1],r=[0,0,0,0,0,0],l=[0,0,1,0,1,1,0,1],h=[255,255,255,255],u=[[d.POSITION,new T(e,o,3,!0)],[d.NORMAL,new T(s,r,3,!0)],[d.UV0,new T(l,o,2,!0)],[d.COLOR,new T(h,r,4,!0)]];return new b(t,u)}function ct(t,n,e,o,s=!0,r=!0){let l=0;const h=n,u=t;let a=c(0,l,0),f=c(0,l+u,0),p=c(0,-1,0),i=c(0,1,0);o&&(l=u,f=c(0,0,0),a=c(0,l,0),p=c(0,1,0),i=c(0,-1,0));const w=[f,a],g=[p,i],m=e+2,A=Math.sqrt(u*u+h*h);if(o)for(let O=e-1;O>=0;O--){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*h,l,Math.sin(t)*h);w.push(n);const o=c(u*Math.cos(t)/A,-h/A,u*Math.sin(t)/A);g.push(o)}else for(let O=0;O<e;O++){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*h,l,Math.sin(t)*h);w.push(n);const o=c(u*Math.cos(t)/A,h/A,u*Math.sin(t)/A);g.push(o)}const M=new Array,I=new Array;if(s){for(let t=3;t<w.length;t++)M.push(1),M.push(t-1),M.push(t),I.push(0),I.push(0),I.push(0);M.push(w.length-1),M.push(2),M.push(1),I.push(0),I.push(0),I.push(0)}if(r){for(let t=3;t<w.length;t++)M.push(t),M.push(t-1),M.push(0),I.push(t),I.push(t-1),I.push(1);M.push(0),M.push(2),M.push(w.length-1),I.push(1),I.push(2),I.push(g.length-1)}const y=O(3*m);for(let c=0;c<m;c++)y[3*c]=w[c][0],y[3*c+1]=w[c][1],y[3*c+2]=w[c][2];const N=O(3*m);for(let c=0;c<m;c++)N[3*c]=g[c][0],N[3*c+1]=g[c][1],N[3*c+2]=g[c][2];return[[d.POSITION,new T(y,M,3,!0)],[d.NORMAL,new T(N,I,3,!0)]]}function at(t,n,e,o,s,r=!0,l=!0){return new b(t,ct(n,e,o,s,r,l))}function ft(t,h,u,p,i,w,g){const m=i?f(i):c(1,0,0),A=w?f(w):c(0,0,0);g??=!0;const M=a();e(M,m);const I=a();o(I,M,Math.abs(h));const y=a();o(y,I,-.5),s(y,y,A);const N=c(0,1,0);Math.abs(1-r(M,N))<.2&&l(N,0,0,1);const P=a();n(P,M,N),e(P,P),n(N,P,M);const S=2*p+(g?2:0),R=p+(g?2:0),L=O(3*S),j=O(3*R),E=O(2*S),U=new Array(3*p*(g?4:2)),V=new Array(3*p*(g?4:2));g&&(L[3*(S-2)]=y[0],L[3*(S-2)+1]=y[1],L[3*(S-2)+2]=y[2],E[2*(S-2)]=0,E[2*(S-2)+1]=0,L[3*(S-1)]=L[3*(S-2)]+I[0],L[3*(S-1)+1]=L[3*(S-2)+1]+I[1],L[3*(S-1)+2]=L[3*(S-2)+2]+I[2],E[2*(S-1)]=1,E[2*(S-1)+1]=1,j[3*(R-2)]=-M[0],j[3*(R-2)+1]=-M[1],j[3*(R-2)+2]=-M[2],j[3*(R-1)]=M[0],j[3*(R-1)+1]=M[1],j[3*(R-1)+2]=M[2]);const v=(t,n,e)=>{U[t]=n,V[t]=e};let x=0;const C=a(),F=a();for(let n=0;n<p;n++){const t=n*(2*Math.PI/p);o(C,N,Math.sin(t)),o(F,P,Math.cos(t)),s(C,C,F),j[3*n]=C[0],j[3*n+1]=C[1],j[3*n+2]=C[2],o(C,C,u),s(C,C,y),L[3*n]=C[0],L[3*n+1]=C[1],L[3*n+2]=C[2],E[2*n]=n/p,E[2*n+1]=0,L[3*(n+p)]=L[3*n]+I[0],L[3*(n+p)+1]=L[3*n+1]+I[1],L[3*(n+p)+2]=L[3*n+2]+I[2],E[2*(n+p)]=n/p,E[2*n+1]=1;const e=(n+1)%p;v(x++,n,n),v(x++,n+p,n),v(x++,e,e),v(x++,e,e),v(x++,n+p,n),v(x++,e+p,e)}if(g){for(let t=0;t<p;t++){const n=(t+1)%p;v(x++,S-2,R-2),v(x++,t,R-2),v(x++,n,R-2)}for(let t=0;t<p;t++){const n=(t+1)%p;v(x++,t+p,R-1),v(x++,S-1,R-1),v(x++,n+p,R-1)}}const G=[[d.POSITION,new T(L,U,3,!0)],[d.NORMAL,new T(j,V,3,!0)],[d.UV0,new T(E,U,2,!0)]];return new b(t,G)}function pt(t,n,e,o,s,r){o=o||10,s=null==s||s,L(n.length>1);const l=[[0,0,0]],h=[],u=[];for(let c=0;c<o;c++){h.push([0,-c-1,-(c+1)%o-1]);const t=c/o*2*Math.PI;u.push([Math.cos(t)*e,Math.sin(t)*e])}return it(t,u,n,l,h,s,r)}function it(r,u,a,f,p,w,g=c(0,0,0)){const m=u.length,A=O(a.length*m*3+(6*f.length||0)),M=O(a.length*m*3+(f?6:0)),S=new Array,R=new Array;let L=0,j=0;const E=i(),U=i(),V=i(),v=i(),x=i(),C=i(),F=i(),G=i(),D=i(),q=i(),z=i(),B=i(),k=i(),Z=I();l(D,0,1,0),t(U,a[1],a[0]),e(U,U),w?(s(G,a[0],g),e(V,G)):l(V,0,0,1),Mt(U,V,D,D,x,V,It),h(v,V),h(B,x);for(let t=0;t<f.length;t++)o(C,x,f[t][0]),o(G,V,f[t][2]),s(C,C,G),s(C,C,a[0]),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2];M[j++]=-U[0],M[j++]=-U[1],M[j++]=-U[2];for(let t=0;t<p.length;t++)S.push(p[t][0]>0?p[t][0]:-p[t][0]-1+f.length),S.push(p[t][1]>0?p[t][1]:-p[t][1]-1+f.length),S.push(p[t][2]>0?p[t][2]:-p[t][2]-1+f.length),R.push(0),R.push(0),R.push(0);let H=f.length;const J=f.length-1;for(let l=0;l<a.length;l++){let r=!1;if(l>0){h(E,U),l<a.length-1?(t(U,a[l+1],a[l]),e(U,U)):r=!0,s(q,E,U),e(q,q),s(z,a[l-1],v),y(a[l],q,Z);N(Z,P(z,E),G)?(t(G,G,a[l]),e(V,G),n(x,q,V),e(x,x)):Mt(q,v,B,D,x,V,It),h(v,V),h(B,x)}w&&(s(G,a[l],g),e(k,G));for(let t=0;t<m;t++)if(o(C,x,u[t][0]),o(G,V,u[t][1]),s(C,C,G),e(F,C),M[j++]=F[0],M[j++]=F[1],M[j++]=F[2],s(C,C,a[l]),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2],!r){const n=(t+1)%m;S.push(H+t),S.push(H+m+t),S.push(H+n),S.push(H+n),S.push(H+m+t),S.push(H+m+n);for(let t=0;t<6;t++){const n=S.length-6;R.push(S[n+t]-J)}}H+=m}const K=a[a.length-1];for(let t=0;t<f.length;t++)o(C,x,f[t][0]),o(G,V,f[t][1]),s(C,C,G),s(C,C,K),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2];const Q=j/3;M[j++]=U[0],M[j++]=U[1],M[j++]=U[2];const W=H-m;for(let t=0;t<p.length;t++)S.push(p[t][0]>=0?H+p[t][0]:-p[t][0]-1+W),S.push(p[t][2]>=0?H+p[t][2]:-p[t][2]-1+W),S.push(p[t][1]>=0?H+p[t][1]:-p[t][1]-1+W),R.push(Q),R.push(Q),R.push(Q);const X=[[d.POSITION,new T(A,S,3,!0)],[d.NORMAL,new T(M,R,3,!0)]];return new b(r,X)}function wt(t,n,e,o){L(n.length>1,"createPolylineGeometry(): polyline needs at least 2 points"),L(3===n[0].length,"createPolylineGeometry(): malformed vertex"),L(null==e||e.length===n.length,"createPolylineGeometry: need same number of points and normals"),L(null==e||3===e[0].length,"createPolylineGeometry(): malformed normal");const s=g(3*n.length),r=new Array(2*(n.length-1));let l=0,h=0;for(let c=0;c<n.length;c++){for(let t=0;t<3;t++)s[l++]=n[c][t];c>0&&(r[h++]=c-1,r[h++]=c)}const u=[[d.POSITION,new T(s,r,3,!0)]];if(e){const t=O(3*e.length);let o=0;for(let s=0;s<n.length;s++)for(let n=0;n<3;n++)t[o++]=e[s][n];u.push([d.NORMAL,new T(t,r,3,!0)])}return o&&u.push([d.COLOR,new T(o,M(o.length/4),4)]),new b(t,u,null,R.Line)}function gt(t,n,e,o,s,r=0){const l=new Array(18),h=[[-e,r,s/2],[o,r,s/2],[0,n+r,s/2],[-e,r,-s/2],[o,r,-s/2],[0,n+r,-s/2]],u=[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5];for(let c=0;c<6;c++)l[3*c]=h[c][0],l[3*c+1]=h[c][1],l[3*c+2]=h[c][2];return new b(t,[[d.POSITION,new T(l,u,3,!0)]])}function Ot(t,n){const e=t.getMutableAttribute(d.POSITION).data;for(let o=0;o<e.length;o+=3){const t=e[o],s=e[o+1],r=e[o+2];l(yt,t,s,r),u(yt,yt,n),e[o]=yt[0],e[o+1]=yt[1],e[o+2]=yt[2]}}function mt(t,n=t){const e=t.attributes,o=e.get(d.POSITION).data,s=e.get(d.NORMAL).data;if(s){const t=n.getMutableAttribute(d.NORMAL).data;for(let n=0;n<s.length;n+=3){const e=s[n+1];t[n+1]=-s[n+2],t[n+2]=e}}if(o){const t=n.getMutableAttribute(d.POSITION).data;for(let n=0;n<o.length;n+=3){const e=o[n+1];t[n+1]=-o[n+2],t[n+2]=e}}}function At(t,o,s,l,h){return!(Math.abs(r(o,t))>h)&&(n(s,t,o),e(s,s),n(l,s,t),e(l,l),!0)}function Mt(t,n,e,o,s,r,l){return At(t,n,s,r,l)||At(t,e,s,r,l)||At(t,o,s,r,l)}const It=.99619469809,yt=i();export{mt as cgToGIS,F as createBoxGeometry,at as createConeGeometry,ct as createConeGeometryData,ft as createCylinderGeometry,B as createDiamondGeometry,gt as createExtrudedTriangle,it as createPathExtrusionGeometry,lt as createPointGeometry,rt as createPolySphereData,st as createPolySphereGeometry,wt as createPolylineGeometry,ot as createSphereGeometry,ut as createSquareGeometry,et as createTetrahedronGeometry,pt as createTubeGeometry,Mt as makeOrthoBasisDirUpFallback,Ot as transformInPlace};
|
|
5
|
+
import{d as t,e as n,n as e,h as o,g as s,f as r,i as l,c as h,t as u}from"../../../../chunks/vec32.js";import{fromValues as c,create as a,clone as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{clone as p,create as i,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as g}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as O,floatArrayFrom as m}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as A,getContinuousIndexArray as M}from"../../../../geometry/support/Indices.js";import{create as I,fromPositionAndNormal as y,intersectRay as N}from"../../../../geometry/support/plane.js";import{wrap as P}from"../../../../geometry/support/ray.js";import{Attribute as T}from"./Attribute.js";import{Vec3Compact as S}from"./BufferVectorMath.js";import{ContentObjectType as R}from"./ContentObjectType.js";import{Geometry as b}from"./Geometry.js";import{assert as L}from"./Util.js";import{VertexAttribute as d}from"./VertexAttribute.js";const j=S,E=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],U=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],V=[0,0,1,0,1,1,0,1],v=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],x=new Array(36);for(let Nt=0;Nt<6;Nt++)for(let t=0;t<6;t++)x[6*Nt+t]=Nt;const C=new Array(36);for(let Nt=0;Nt<6;Nt++)C[6*Nt]=0,C[6*Nt+1]=1,C[6*Nt+2]=2,C[6*Nt+3]=2,C[6*Nt+4]=3,C[6*Nt+5]=0;function F(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(24);for(let o=0;o<8;o++)e[3*o]=E[o][0]*n[0],e[3*o+1]=E[o][1]*n[1],e[3*o+2]=E[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,v,3,!0)],[d.NORMAL,new T(U,x,3)],[d.UV0,new T(V,C,2)]])}const G=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],D=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],q=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],z=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function B(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(18);for(let o=0;o<6;o++)e[3*o]=G[o][0]*n[0],e[3*o+1]=G[o][1]*n[1],e[3*o+2]=G[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,q,3,!0)],[d.NORMAL,new T(D,z,3)]])}const k=c(-.5,0,-.5),Z=c(.5,0,-.5),H=c(0,0,.5),J=c(0,.5,0),K=a(),Q=a(),W=a(),X=a(),Y=a();t(K,k,J),t(Q,k,Z),n(W,K,Q),e(W,W),t(K,Z,J),t(Q,Z,H),n(X,K,Q),e(X,X),t(K,H,J),t(Q,H,k),n(Y,K,Q),e(Y,Y);const $=[k,Z,H,J],_=[0,-1,0,W[0],W[1],W[2],X[0],X[1],X[2],Y[0],Y[1],Y[2]],tt=[0,1,2,3,1,0,3,2,1,3,0,2],nt=[0,0,0,1,1,1,2,2,2,3,3,3];function et(t,n){Array.isArray(n)||(n=[n,n,n]);const e=new Array(12);for(let o=0;o<4;o++)e[3*o]=$[o][0]*n[0],e[3*o+1]=$[o][1]*n[1],e[3*o+2]=$[o][2]*n[2];return new b(t,[[d.POSITION,new T(e,tt,3,!0)],[d.NORMAL,new T(_,nt,3)]])}function ot(t,n,e,o,s={uv:!0}){const r=-Math.PI,l=2*Math.PI,h=-Math.PI/2,u=Math.PI,c=Math.max(3,Math.floor(e)),a=Math.max(2,Math.floor(o)),f=(c+1)*(a+1),p=O(3*f),i=O(3*f),w=O(2*f),g=[];let m=0;for(let O=0;O<=a;O++){const t=[],e=O/a,o=h+e*u,s=Math.cos(o);for(let h=0;h<=c;h++){const u=h/c,a=r+u*l,f=Math.cos(a)*s,g=Math.sin(o),O=-Math.sin(a)*s;p[3*m]=f*n,p[3*m+1]=g*n,p[3*m+2]=O*n,i[3*m]=f,i[3*m+1]=g,i[3*m+2]=O,w[2*m]=u,w[2*m+1]=e,t.push(m),++m}g.push(t)}const M=new Array;for(let O=0;O<a;O++)for(let t=0;t<c;t++){const n=g[O][t],e=g[O][t+1],o=g[O+1][t+1],s=g[O+1][t];0===O?(M.push(n),M.push(o),M.push(s)):O===a-1?(M.push(n),M.push(e),M.push(o)):(M.push(n),M.push(e),M.push(o),M.push(o),M.push(s),M.push(n))}const I=[[d.POSITION,new T(p,M,3,!0)],[d.NORMAL,new T(i,M,3,!0)]];return s.uv&&I.push([d.UV0,new T(w,M,2,!0)]),s.offset&&(I[0][0]=d.OFFSET,I.push([d.POSITION,new T(Float64Array.from(s.offset),A(M.length),3,!0)])),new b(t,I)}function st(t,n,e,o){const s=rt(n,e,o);return new b(t,s)}function rt(t,n,e){const o=t;let s,r;if(e)s=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],r=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const t=o*(1+Math.sqrt(5))/2;s=[-o,t,0,o,t,0,-o,-t,0,o,-t,0,0,-o,t,0,o,t,0,-o,-t,0,o,-t,t,0,-o,t,0,o,-t,0,-o,-t,0,o],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let c=0;c<s.length;c+=3)j.scale(s,c,t/j.length(s,c));let l={};function h(n,e){n>e&&([n,e]=[e,n]);const o=n.toString()+"."+e.toString();if(l[o])return l[o];let r=s.length;return s.length+=3,j.add(s,3*n,s,3*e,s,r),j.scale(s,r,t/j.length(s,r)),r/=3,l[o]=r,r}for(let c=0;c<n;c++){const t=r.length,n=new Array(4*t);for(let e=0;e<t;e+=3){const t=r[e],o=r[e+1],s=r[e+2],l=h(t,o),u=h(o,s),c=h(s,t),a=4*e;n[a]=t,n[a+1]=l,n[a+2]=c,n[a+3]=o,n[a+4]=u,n[a+5]=l,n[a+6]=s,n[a+7]=c,n[a+8]=u,n[a+9]=l,n[a+10]=u,n[a+11]=c}r=n,l={}}const u=m(s);for(let c=0;c<u.length;c+=3)j.normalize(u,c);return[[d.POSITION,new T(m(s),r,3,!0)],[d.NORMAL,new T(u,r,3,!0)]]}function lt(t,{normal:n,position:e,color:o,rotation:s,size:r,centerOffsetAndDistance:l,uvi:h,featureAttribute:u,objectAndLayerIdColor:c=null}={}){const a=e?p(e):i(),f=n?p(n):w(0,0,1),g=o?[255*o[0],255*o[1],255*o[2],o.length>3?255*o[3]:255]:[255,255,255,255],O=null!=r&&2===r.length?r:[1,1],m=null!=s?[s]:[0],M=A(1),I=[[d.POSITION,new T(a,M,3,!0)],[d.NORMAL,new T(f,M,3,!0)],[d.COLOR,new T(g,M,4,!0)],[d.SIZE,new T(O,M,2)],[d.ROTATION,new T(m,M,1,!0)]];if(h&&I.push([d.UVI,new T(h,M,h.length)]),null!=l){const t=[l[0],l[1],l[2],l[3]];I.push([d.CENTEROFFSETANDDISTANCE,new T(t,M,4)])}if(u){const t=[u[0],u[1],u[2],u[3]];I.push([d.FEATUREATTRIBUTE,new T(t,M,4)])}return new b(t,I,null,R.Point,c)}const ht=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function ut(t,n=ht){const e=new Array(12);for(let c=0;c<4;c++)for(let t=0;t<3;t++)e[3*c+t]=n[c][t];const o=[0,1,2,2,3,0],s=[0,0,1],r=[0,0,0,0,0,0],l=[0,0,1,0,1,1,0,1],h=[255,255,255,255],u=[[d.POSITION,new T(e,o,3,!0)],[d.NORMAL,new T(s,r,3,!0)],[d.UV0,new T(l,o,2,!0)],[d.COLOR,new T(h,r,4,!0)]];return new b(t,u)}function ct(t,n,e,o,s=!0,r=!0){let l=0;const h=n,u=t;let a=c(0,l,0),f=c(0,l+u,0),p=c(0,-1,0),i=c(0,1,0);o&&(l=u,f=c(0,0,0),a=c(0,l,0),p=c(0,1,0),i=c(0,-1,0));const w=[f,a],g=[p,i],m=e+2,A=Math.sqrt(u*u+h*h);if(o)for(let O=e-1;O>=0;O--){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*h,l,Math.sin(t)*h);w.push(n);const o=c(u*Math.cos(t)/A,-h/A,u*Math.sin(t)/A);g.push(o)}else for(let O=0;O<e;O++){const t=O*(2*Math.PI/e),n=c(Math.cos(t)*h,l,Math.sin(t)*h);w.push(n);const o=c(u*Math.cos(t)/A,h/A,u*Math.sin(t)/A);g.push(o)}const M=new Array,I=new Array;if(s){for(let t=3;t<w.length;t++)M.push(1),M.push(t-1),M.push(t),I.push(0),I.push(0),I.push(0);M.push(w.length-1),M.push(2),M.push(1),I.push(0),I.push(0),I.push(0)}if(r){for(let t=3;t<w.length;t++)M.push(t),M.push(t-1),M.push(0),I.push(t),I.push(t-1),I.push(1);M.push(0),M.push(2),M.push(w.length-1),I.push(1),I.push(2),I.push(g.length-1)}const y=O(3*m);for(let c=0;c<m;c++)y[3*c]=w[c][0],y[3*c+1]=w[c][1],y[3*c+2]=w[c][2];const N=O(3*m);for(let c=0;c<m;c++)N[3*c]=g[c][0],N[3*c+1]=g[c][1],N[3*c+2]=g[c][2];return[[d.POSITION,new T(y,M,3,!0)],[d.NORMAL,new T(N,I,3,!0)]]}function at(t,n,e,o,s,r=!0,l=!0){return new b(t,ct(n,e,o,s,r,l))}function ft(t,h,u,p,i,w,g){const m=i?f(i):c(1,0,0),A=w?f(w):c(0,0,0);g??=!0;const M=a();e(M,m);const I=a();o(I,M,Math.abs(h));const y=a();o(y,I,-.5),s(y,y,A);const N=c(0,1,0);Math.abs(1-r(M,N))<.2&&l(N,0,0,1);const P=a();n(P,M,N),e(P,P),n(N,P,M);const S=2*p+(g?2:0),R=p+(g?2:0),L=O(3*S),j=O(3*R),E=O(2*S),U=new Array(3*p*(g?4:2)),V=new Array(3*p*(g?4:2));g&&(L[3*(S-2)]=y[0],L[3*(S-2)+1]=y[1],L[3*(S-2)+2]=y[2],E[2*(S-2)]=0,E[2*(S-2)+1]=0,L[3*(S-1)]=L[3*(S-2)]+I[0],L[3*(S-1)+1]=L[3*(S-2)+1]+I[1],L[3*(S-1)+2]=L[3*(S-2)+2]+I[2],E[2*(S-1)]=1,E[2*(S-1)+1]=1,j[3*(R-2)]=-M[0],j[3*(R-2)+1]=-M[1],j[3*(R-2)+2]=-M[2],j[3*(R-1)]=M[0],j[3*(R-1)+1]=M[1],j[3*(R-1)+2]=M[2]);const v=(t,n,e)=>{U[t]=n,V[t]=e};let x=0;const C=a(),F=a();for(let n=0;n<p;n++){const t=n*(2*Math.PI/p);o(C,N,Math.sin(t)),o(F,P,Math.cos(t)),s(C,C,F),j[3*n]=C[0],j[3*n+1]=C[1],j[3*n+2]=C[2],o(C,C,u),s(C,C,y),L[3*n]=C[0],L[3*n+1]=C[1],L[3*n+2]=C[2],E[2*n]=n/p,E[2*n+1]=0,L[3*(n+p)]=L[3*n]+I[0],L[3*(n+p)+1]=L[3*n+1]+I[1],L[3*(n+p)+2]=L[3*n+2]+I[2],E[2*(n+p)]=n/p,E[2*n+1]=1;const e=(n+1)%p;v(x++,n,n),v(x++,n+p,n),v(x++,e,e),v(x++,e,e),v(x++,n+p,n),v(x++,e+p,e)}if(g){for(let t=0;t<p;t++){const n=(t+1)%p;v(x++,S-2,R-2),v(x++,t,R-2),v(x++,n,R-2)}for(let t=0;t<p;t++){const n=(t+1)%p;v(x++,t+p,R-1),v(x++,S-1,R-1),v(x++,n+p,R-1)}}const G=[[d.POSITION,new T(L,U,3,!0)],[d.NORMAL,new T(j,V,3,!0)],[d.UV0,new T(E,U,2,!0)]];return new b(t,G)}function pt(t,n,e,o,s,r){o=o||10,s=null==s||s,L(n.length>1);const l=[[0,0,0]],h=[],u=[];for(let c=0;c<o;c++){h.push([0,-c-1,-(c+1)%o-1]);const t=c/o*2*Math.PI;u.push([Math.cos(t)*e,Math.sin(t)*e])}return it(t,u,n,l,h,s,r)}function it(r,u,a,f,p,w,g=c(0,0,0)){const m=u.length,A=O(a.length*m*3+(6*f.length||0)),M=O(a.length*m*3+(f?6:0)),S=new Array,R=new Array;let L=0,j=0;const E=i(),U=i(),V=i(),v=i(),x=i(),C=i(),F=i(),G=i(),D=i(),q=i(),z=i(),B=i(),k=i(),Z=I();l(D,0,1,0),t(U,a[1],a[0]),e(U,U),w?(s(G,a[0],g),e(V,G)):l(V,0,0,1),Mt(U,V,D,D,x,V,It),h(v,V),h(B,x);for(let t=0;t<f.length;t++)o(C,x,f[t][0]),o(G,V,f[t][2]),s(C,C,G),s(C,C,a[0]),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2];M[j++]=-U[0],M[j++]=-U[1],M[j++]=-U[2];for(let t=0;t<p.length;t++)S.push(p[t][0]>0?p[t][0]:-p[t][0]-1+f.length),S.push(p[t][1]>0?p[t][1]:-p[t][1]-1+f.length),S.push(p[t][2]>0?p[t][2]:-p[t][2]-1+f.length),R.push(0),R.push(0),R.push(0);let H=f.length;const J=f.length-1;for(let l=0;l<a.length;l++){let r=!1;if(l>0){h(E,U),l<a.length-1?(t(U,a[l+1],a[l]),e(U,U)):r=!0,s(q,E,U),e(q,q),s(z,a[l-1],v),y(a[l],q,Z);N(Z,P(z,E),G)?(t(G,G,a[l]),e(V,G),n(x,q,V),e(x,x)):Mt(q,v,B,D,x,V,It),h(v,V),h(B,x)}w&&(s(G,a[l],g),e(k,G));for(let t=0;t<m;t++)if(o(C,x,u[t][0]),o(G,V,u[t][1]),s(C,C,G),e(F,C),M[j++]=F[0],M[j++]=F[1],M[j++]=F[2],s(C,C,a[l]),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2],!r){const n=(t+1)%m;S.push(H+t),S.push(H+m+t),S.push(H+n),S.push(H+n),S.push(H+m+t),S.push(H+m+n);for(let t=0;t<6;t++){const n=S.length-6;R.push(S[n+t]-J)}}H+=m}const K=a[a.length-1];for(let t=0;t<f.length;t++)o(C,x,f[t][0]),o(G,V,f[t][1]),s(C,C,G),s(C,C,K),A[L++]=C[0],A[L++]=C[1],A[L++]=C[2];const Q=j/3;M[j++]=U[0],M[j++]=U[1],M[j++]=U[2];const W=H-m;for(let t=0;t<p.length;t++)S.push(p[t][0]>=0?H+p[t][0]:-p[t][0]-1+W),S.push(p[t][2]>=0?H+p[t][2]:-p[t][2]-1+W),S.push(p[t][1]>=0?H+p[t][1]:-p[t][1]-1+W),R.push(Q),R.push(Q),R.push(Q);const X=[[d.POSITION,new T(A,S,3,!0)],[d.NORMAL,new T(M,R,3,!0)]];return new b(r,X)}function wt(t,n,e,o){L(n.length>1,"createPolylineGeometry(): polyline needs at least 2 points"),L(3===n[0].length,"createPolylineGeometry(): malformed vertex"),L(null==e||e.length===n.length,"createPolylineGeometry: need same number of points and normals"),L(null==e||3===e[0].length,"createPolylineGeometry(): malformed normal");const s=g(3*n.length),r=new Array(2*(n.length-1));let l=0,h=0;for(let c=0;c<n.length;c++){for(let t=0;t<3;t++)s[l++]=n[c][t];c>0&&(r[h++]=c-1,r[h++]=c)}const u=[[d.POSITION,new T(s,r,3,!0)]];if(e){const t=O(3*e.length);let o=0;for(let s=0;s<n.length;s++)for(let n=0;n<3;n++)t[o++]=e[s][n];u.push([d.NORMAL,new T(t,r,3,!0)])}return o&&u.push([d.COLOR,new T(o,M(o.length/4),4)]),new b(t,u,null,R.Line)}function gt(t,n,e,o,s,r=0){const l=new Array(18),h=[[-e,r,s/2],[o,r,s/2],[0,n+r,s/2],[-e,r,-s/2],[o,r,-s/2],[0,n+r,-s/2]],u=[0,1,2,3,0,2,2,5,3,1,4,5,5,2,1,1,0,3,3,4,1,4,3,5];for(let c=0;c<6;c++)l[3*c]=h[c][0],l[3*c+1]=h[c][1],l[3*c+2]=h[c][2];return new b(t,[[d.POSITION,new T(l,u,3,!0)]])}function Ot(t,n){const e=t.getMutableAttribute(d.POSITION).data;for(let o=0;o<e.length;o+=3){const t=e[o],s=e[o+1],r=e[o+2];l(yt,t,s,r),u(yt,yt,n),e[o]=yt[0],e[o+1]=yt[1],e[o+2]=yt[2]}}function mt(t,n=t){const e=t.attributes,o=e.get(d.POSITION).data,s=e.get(d.NORMAL).data;if(s){const t=n.getMutableAttribute(d.NORMAL).data;for(let n=0;n<s.length;n+=3){const e=s[n+1];t[n+1]=-s[n+2],t[n+2]=e}}if(o){const t=n.getMutableAttribute(d.POSITION).data;for(let n=0;n<o.length;n+=3){const e=o[n+1];t[n+1]=-o[n+2],t[n+2]=e}}}function At(t,o,s,l,h){return!(Math.abs(r(o,t))>h)&&(n(s,t,o),e(s,s),n(l,s,t),e(l,l),!0)}function Mt(t,n,e,o,s,r,l){return At(t,n,s,r,l)||At(t,e,s,r,l)||At(t,o,s,r,l)}const It=.99619469809,yt=i();export{mt as cgToGIS,F as createBoxGeometry,at as createConeGeometry,ct as createConeGeometryData,ft as createCylinderGeometry,B as createDiamondGeometry,gt as createExtrudedTriangle,it as createPathExtrusionGeometry,lt as createPointGeometry,rt as createPolySphereData,st as createPolySphereGeometry,wt as createPolylineGeometry,ot as createSphereGeometry,ut as createSquareGeometry,et as createTetrahedronGeometry,pt as createTubeGeometry,Mt as makeOrthoBasisDirUpFallback,Ot as transformInPlace};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Evented.js";import"../../../../core/has.js";import{disposeMaybe as i,removeMaybe as r}from"../../../../core/maybe.js";import{generateUID as
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Evented.js";import"../../../../core/has.js";import{disposeMaybe as i,removeMaybe as r}from"../../../../core/maybe.js";import{generateUID as n}from"../../../../core/uid.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as o,s as l}from"../../../../chunks/vec42.js";import{ZEROS as _,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ContentObjectType as d}from"./ContentObjectType.js";import{textTextureAtlas as u}from"./testUtils.js";import{applyTextureResizeModuloCeil as m}from"./textureUtils.js";import{TaskPriority as p}from"../../../support/Scheduler.js";import{Yield as g}from"../../../support/Yield.js";import{TextureWrapMode as f,TextureSamplingMode as x}from"../../../webgl/enums.js";import{Texture as v}from"../../../webgl/Texture.js";import{TextureDescriptor as w}from"../../../webgl/TextureDescriptor.js";const T=4096;let k=class extends t{constructor(e){super(e),this.type=d.Texture,this.id=n(),this.events=new s,this._glTexture=null,this._atlas=new A(256,256),this._needsRepack=!1,this._canRepack=!0,this._elementsToRender=new Map,this._elements=new Map,this._uvCallbacks=new Map,this.updating=!1}initialize(){this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","textAtlasCanvas"),this._canvas.setAttribute("style","display:none"),this._ctx=this._canvas.getContext("2d"),this._stage=this.view.stage,this._stage.add(this),this._updateCanvasElementSize(this._atlas),this._reset()}unload(){this._glTexture=i(this._glTexture),this._frameWorker=r(this._frameWorker),this.updating=!1,this.events.emit("unloaded")}get loaded(){return null!=this._glTexture}get glTexture(){return this._glTexture}static get maxSize(){return j=u.stableRendering?R:0,[T-R-j,T-R-j-y]}load(e){if(this._glTexture)return this._glTexture;const t=new w;return t.wrapMode=f.CLAMP_TO_EDGE,t.samplingMode=x.LINEAR_MIPMAP_LINEAR,t.hasMipmap=!0,t.preMultiplyAlpha=!0,t.maxAnisotropy=e.parameters.maxMaxAnisotropy,this._glTexture=new v(e,t,this._canvas),this._frameWorker=this.view.resourceController.scheduler.registerTask(p.TEXT_TEXTURE_ATLAS,this),this.setDirty(),this._glTexture}dispose(){this._elements.clear(),this._elementsToRender.clear(),this._frameWorker=r(this._frameWorker),this._glTexture&&(this._stage.remove(this),this._glTexture=i(this._glTexture)),this._canvas.width=0,this._canvas.height=0,this._canvas=null,this._ctx=null}_updateCanvasElementSize(e){this._canvas.width=e.width,this._canvas.height=e.height}_resizeAtlas(e,t){const{width:s,height:i}=this._atlas;s===e&&i===t||(this._atlas.width=e,this._atlas.height=t,this._glTexture?.resize(e,t),this._glTexture?.updateData(0,0,0,s,i,this._canvas),this._updateCanvasElementSize(this._atlas),this._elements.forEach((e=>this._uvCallbacks.get(e.textRenderer.key)?.forEach((t=>t(e.uv))))),this._reset())}_reset(){this._elementsToRender.clear(),this._atlas.reset(),this._needsRepack=!0,this.setDirty()}_addAtlasElement(e,t,s,i){const r=this._atlas;if(r.width<s||r.height<i)return!1;let n=r.cursors.get(i);if(!n){if(r.height<r.nextY+i)return!1;n=[new C(r.nextY)],r.cursors.set(i,n),r.nextY+=i}let h=n.find((e=>r.width>=e.x+s));if(null==h){if(r.height<r.nextY+i)return!1;h=new C(r.nextY),r.nextY+=i,n.push(h)}return e.setNewPosition(h),this._elements.set(t,e),this._elementsToRender.set(t,e),h.x+=s,!0}_ensureCallbacks(e){const t=this._uvCallbacks.get(e);if(t)return t;const s=new Set;return this._uvCallbacks.set(e,s),s}_addCallback(e,t){this._ensureCallbacks(e).add(t)}_removeCallback(e,t){const s=this._uvCallbacks.get(e);return!(!s?.delete(t)||0!==s.size)&&(this._uvCallbacks.delete(e),!0)}_processAddition(e){const t=e.textRenderer.key;if(this._needsRepack)return void this._elements.set(t,e);const s=this._atlas,i=e.textRenderer.renderedWidth,r=e.textRenderer.renderedHeight,n=i+R,h=r+R+y;if(!this._addAtlasElement(e,t,n,h)){if(this._canRepack)this._reset();else if(s.width<n){const e=m(Math.max(n,1.5*s.width),T);this._resizeAtlas(e,s.height)}else{const e=s.nextY+h,t=m(Math.max(e,1.5*s.height),T);if(t>s.height)this._resizeAtlas(s.width,t);else if(s.width<T){const e=m(1.5*s.width,T);this._resizeAtlas(e,s.height)}}this._elements.set(t,e)}}_renderElement(e){const t=e.commitNewPosition(),s=e.textRenderer;this._ctx.clearRect(t[0]-R,t[1]-R,s.renderedWidth+2*R,s.renderedHeight+2*R),s.render(this._ctx,t[0],t[1]),this._uvCallbacks.get(s.key)?.forEach((t=>t(e.uv)))}get running(){return this.updating}runTask(e){if(null==this._glTexture)return g;for(;this._needsRepack&&(this._canRepack||this._atlas.height<T&&this._atlas.height<T);){this._canRepack=this._needsRepack=!1;const t=this._elements;this._elements=new Map,t.forEach((e=>this._processAddition(e))),e.madeProgress()}if(this._elementsToRender.size>0){for(const[t,s]of this._elementsToRender){if(e.done)break;this._renderElement(s),this._elementsToRender.delete(t),e.madeProgress()}this._glTexture.setData(this._canvas)}this.updating=this._elementsToRender.size>0}addText(e,t){const s=e.key;this._addCallback(s,t);let i=this._elements.get(s);return i?o(i.uv,_)||t(i.uv):(i=new b(e),this._processAddition(i),this.setDirty()),{remove:()=>this._removeText(e,t)}}_removeText(e,t){const s=e.key;this._elements.get(s)&&this._removeCallback(s,t)&&(this._elements.delete(s),this._elementsToRender.delete(s),this._canRepack=!0)}setDirty(){this._glTexture&&(this.updating=!0)}get test(){}};e([h({constructOnly:!0})],k.prototype,"view",void 0),e([h({type:Boolean})],k.prototype,"updating",void 0),k=e([a("esri.views.3d.webgl-engine.lib.TextTextureAtlas")],k);const R=2,y=2;class b{constructor(e){this.textRenderer=e,this._uv=c(),this._newPosition=[0,0]}get uv(){if(null==this._xOffset||null==this._yOffset)return _;const{renderedWidth:e,renderedHeight:t}=this.textRenderer;return l(this._uv,this._xOffset,this._yOffset+t,this._xOffset+e,this._yOffset)}setNewPosition(e){this._newPosition[0]=e.x,this._newPosition[1]=e.y}commitNewPosition(){return this._xOffset=this._newPosition[0],this._yOffset=this._newPosition[1],this._newPosition}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}}class A{constructor(e,t){this.width=e,this.height=t,this.cursors=new Map,this.nextY=0}reset(){this.cursors.clear(),this.nextY=j}}class C{constructor(e){this.y=e,this.x=j}}let j=0;export{k as TextTextureAtlas};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
var e;function E(E){return E===e.POSITION}!function(e){e.POSITION="position",e.NORMAL="normal",e.NORMALCOMPRESSED="normalCompressed",e.UV0="uv0",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.ROTATION="rotation",e.TANGENT="tangent",e.OFFSET="offset",e.PERSPECTIVEDIVIDE="perspectiveDivide",e.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",e.LENGTH="length",e.PREVPOSITION="prevPosition",e.NEXTPOSITION="nextPosition",e.
|
|
5
|
+
var e;function E(E){return E===e.POSITION}!function(e){e.POSITION="position",e.NORMAL="normal",e.NORMALCOMPRESSED="normalCompressed",e.UV0="uv0",e.UVI="uvi",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.ROTATION="rotation",e.TANGENT="tangent",e.OFFSET="offset",e.PERSPECTIVEDIVIDE="perspectiveDivide",e.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",e.LENGTH="length",e.PREVPOSITION="prevPosition",e.NEXTPOSITION="nextPosition",e.U0="u0",e.LINEPARAMETERS="lineParameters",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.PROFILEAUXDATA="profileAuxData",e.FEATUREVALUE="featureValue",e.INSTANCEMODELORIGINHI="instanceModelOriginHi",e.INSTANCEMODELORIGINLO="instanceModelOriginLo",e.INSTANCEMODEL="instanceModel",e.INSTANCEMODELNORMAL="instanceModelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMAL2COMPRESSED="normal2Compressed",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.START_UP="startUp",e.END_UP="endUp",e.EXTRUDE="extrude",e.OLIDCOLOR="objectAndLayerIdColor",e.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(e||(e={}));export{e as VertexAttribute,E as affectsGeometry};
|
|
@@ -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{
|
|
5
|
+
import{Float16Array as e}from"@petamoriken/float16";import{Default3D as o}from"./DefaultVertexAttributeLocations.js";import{Pos2 as r,Pos2Tex as t}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as s}from"./VertexArrayObject.js";import{BufferObject as n}from"../../../webgl/BufferObject.js";import{Usage as f,TextureSamplingMode as m}from"../../../webgl/enums.js";import{Texture as a}from"../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../webgl/TextureDescriptor.js";function u(r,t=w.Pos2,m=o,a=-1,i=1){const u=t===w.Pos2?new Float32Array([a,a,i,a,a,i,i,i]):new Float32Array([a,a,0,i,a,0,a,i,0,i,i,0]);if(t===w.Pos2Tex){const o=new e(u.buffer);o[10]=o[17]=o[22]=o[23]=1}return new s(r,m,new Map([["geometry",x.get(t)]]),new Map([["geometry",n.createVertex(r,f.STATIC_DRAW,u)]]))}const p=4;function c(e){const o=new i(p);return o.samplingMode=m.NEAREST,new a(e,o)}var w;!function(e){e[e.Pos2=0]="Pos2",e[e.Pos2Tex=1]="Pos2Tex"}(w||(w={}));const x=new Map([[w.Pos2,r],[w.Pos2Tex,t]]);export{w as Layout,c as createEmptyTexture,u as createQuadVAO};
|
|
@@ -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/Accessor.js";import{reallocGrowthFactor as s}from"../../../../../core/arrayUtils.js";import i from"../../../../../core/Evented.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as o,invert as n,transpose as h}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{multiply as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as g}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as m}from"../../../../../chunks/vec32.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BufferViewMat4f64 as d,BufferViewVec3f64 as p,BufferViewMat3f as _,BufferViewVec2f as T,BufferViewVec4f64 as u,BufferViewVec4f as L,BufferViewVec4u8 as O,BufferViewUint8 as A}from"../../../../../geometry/support/buffer/BufferView.js";import{scaleFromMatrix as E}from"../../../support/mathUtils.js";import{newLayout as v}from"../../../support/buffer/InterleavedLayout.js";import{assert as M}from"../Util.js";import{VertexAttribute as I}from"../VertexAttribute.js";import{initialCapacity as F}from"./RenderInstanceData.js";var S;function
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{reallocGrowthFactor as s}from"../../../../../core/arrayUtils.js";import i from"../../../../../core/Evented.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as o,invert as n,transpose as h}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{multiply as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as g}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as m}from"../../../../../chunks/vec32.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BufferViewMat4f64 as d,BufferViewVec3f64 as p,BufferViewMat3f as _,BufferViewVec2f as T,BufferViewVec4f64 as u,BufferViewVec4f as L,BufferViewVec4u8 as O,BufferViewUint8 as A}from"../../../../../geometry/support/buffer/BufferView.js";import{scaleFromMatrix as E}from"../../../support/mathUtils.js";import{newLayout as v}from"../../../support/buffer/InterleavedLayout.js";import{assert as M}from"../Util.js";import{VertexAttribute as I}from"../VertexAttribute.js";import{initialCapacity as F}from"./RenderInstanceData.js";var S;function b(t){let e=v().mat4f64(I.LOCALTRANSFORM).mat4f64(I.GLOBALTRANSFORM).vec4f64(I.BOUNDINGSPHERE).vec3f64(I.MODELORIGIN).mat3f(I.INSTANCEMODEL).mat3f(I.INSTANCEMODELNORMAL).vec2f(I.MODELSCALEFACTORS);return t.includes(I.FEATUREATTRIBUTE)&&(e=e.vec4f(I.FEATUREATTRIBUTE)),t.includes(I.COLOR)&&(e=e.vec4u8(I.COLOR)),t.includes(I.OLIDCOLOR)&&(e=e.vec4u8(I.OLIDCOLOR)),e=e.u8(I.STATE).u8(I.LODLEVEL),e}!function(t){t[t.ALLOCATED=1]="ALLOCATED",t[t.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",t[t.VISIBLE=4]="VISIBLE",t[t.HIGHLIGHT=8]="HIGHLIGHT",t[t.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",t[t.REMOVE=32]="REMOVE",t[t.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",t[t.ACTIVE=18]="ACTIVE"}(S||(S={}));class C{constructor(t){this.localTransform=t.getField(I.LOCALTRANSFORM,d),this.globalTransform=t.getField(I.GLOBALTRANSFORM,d),this.modelOrigin=t.getField(I.MODELORIGIN,p),this.model=t.getField(I.INSTANCEMODEL,_),this.modelNormal=t.getField(I.INSTANCEMODELNORMAL,_),this.modelScaleFactors=t.getField(I.MODELSCALEFACTORS,T),this.boundingSphere=t.getField(I.BOUNDINGSPHERE,u),this.featureAttribute=t.getField(I.FEATUREATTRIBUTE,L),this.color=t.getField(I.COLOR,O),this.objectAndLayerIdColor=t.getField(I.OLIDCOLOR,O),this.state=t.getField(I.STATE,A),this.lodLevel=t.getField(I.LODLEVEL,A)}}let R=class extends e{constructor(t,e){super(t),this.events=new i,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=b(e),this._capacity=F,this._buffer=this._layout.createBuffer(this._capacity),this._view=new C(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const t=this._findSlot();return this._view.state.set(t,S.ALLOCATED),this._size++,this.events.emit("instances-changed"),t}removeInstance(t){const e=this._view.state;M(t>=0&&t<this._capacity&&!!(e.get(t)&S.ALLOCATED),"invalid instance handle"),this._getStateFlag(t,S.ACTIVE)?this._setStateFlags(t,S.REMOVE):this.freeInstance(t),this.events.emit("instances-changed")}freeInstance(t){const e=this._view.state;M(t>=0&&t<this._capacity&&!!(e.get(t)&S.ALLOCATED),"invalid instance handle"),e.set(t,0),this._size--}setLocalTransform(t,e,s=!0){this._view.localTransform.setMat(t,e),s&&this.updateModelTransform(t)}getLocalTransform(t,e){this._view.localTransform.getMat(t,e)}setGlobalTransform(t,e,s=!0){this._view.globalTransform.setMat(t,e),s&&this.updateModelTransform(t)}getGlobalTransform(t,e){this._view.globalTransform.getMat(t,e)}updateModelTransform(t){const e=this._view,s=y,i=H;e.localTransform.getMat(t,N),e.globalTransform.getMat(t,D);const a=c(D,D,N);m(s,a[12],a[13],a[14]),e.modelOrigin.setVec(t,s),o(i,a),e.model.setMat(t,i);const r=E(y,a);r.sort(),e.modelScaleFactors.set(t,0,r[1]),e.modelScaleFactors.set(t,1,r[2]),n(i,i),h(i,i),e.modelNormal.setMat(t,i),this._setStateFlags(t,S.TRANSFORM_CHANGED),this.events.emit("instance-transform-changed",{index:t})}getModelTransform(t,e){const s=this._view;s.model.getMat(t,H),s.modelOrigin.getVec(t,y),e[0]=H[0],e[1]=H[1],e[2]=H[2],e[3]=0,e[4]=H[3],e[5]=H[4],e[6]=H[5],e[7]=0,e[8]=H[6],e[9]=H[7],e[10]=H[8],e[11]=0,e[12]=y[0],e[13]=y[1],e[14]=y[2],e[15]=1}applyShaderTransformation(t,e){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,t,e)}getCombinedModelTransform(t,e){return this.getModelTransform(t,e),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,t,e),e}getCombinedLocalTransform(t,e){this._view.localTransform.getMat(t,e),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,t,e)}getCombinedMaxScaleFactor(t){let e=this._view.modelScaleFactors.get(t,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(y,this,t),e*=Math.max(y[0],y[1],y[2])),e}getCombinedMedianScaleFactor(t){let e=this._view.modelScaleFactors.get(t,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(y,this,t),e*=w(y[0],y[1],y[2])),e}getModel(t,e){this._view.model.getMat(t,e)}setFeatureAttribute(t,e){this._view.featureAttribute.setVec(t,e)}getFeatureAttribute(t,e){this._view.featureAttribute.getVec(t,e)}setColor(t,e){this._view.color.setVec(t,e)}setObjectAndLayerIdColor(t,e){this._view.objectAndLayerIdColor.setVec(t,e)}setVisible(t,e){e!==this.getVisible(t)&&(this._setStateFlag(t,S.VISIBLE,e),this.events.emit("instance-visibility-changed",{index:t}))}getVisible(t){return this._getStateFlag(t,S.VISIBLE)}setHighlight(t,e){const{_highlightOptionsMap:s}=this,i=s.get(t);e?e!==i&&(s.set(t,e),this._setStateFlag(t,S.HIGHLIGHT,!0),this.events.emit("instance-highlight-changed")):i&&(s.delete(t),this._setStateFlag(t,S.HIGHLIGHT,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(t){return this._getStateFlag(t,S.HIGHLIGHT)}geHighlightOptionsPrev(t){const e=this._highlightOptionsMapPrev.get(t)??null;return this._highlightOptionsMapPrev.delete(t),e}getHighlightName(t){const e=this.highlightOptionsMap.get(t)??null;return e?this._highlightOptionsMapPrev.set(t,e):this._highlightOptionsMapPrev.delete(t),e}getState(t){return this._view.state.get(t)}getLodLevel(t){return this._view.lodLevel.get(t)}countFlags(t){let e=0;for(let s=0;s<this._capacity;++s){this.getState(s)&t&&++e}return e}_setStateFlags(t,e){const s=this._view.state;e=s.get(t)|e,s.set(t,e)}_clearStateFlags(t,e){const s=this._view.state;e=s.get(t)&~e,s.set(t,e)}_setStateFlag(t,e,s){s?this._setStateFlags(t,e):this._clearStateFlags(t,e)}_getStateFlag(t,e){return!!(this._view.state.get(t)&e)}_grow(){this._capacity=Math.max(F,Math.floor(this._capacity*s)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new C(this._buffer)}_findSlot(){const t=this._view.state;let e=this._next;for(;t.get(e)&S.ALLOCATED;)e=e+1===this._capacity?0:e+1;return this._next=e+1===this._capacity?0:e+1,e}};function w(t,e,s){return Math.max(Math.min(t,e),Math.min(Math.max(t,e),s))}t([a({constructOnly:!0})],R.prototype,"shaderTransformation",void 0),t([a()],R.prototype,"_size",void 0),t([a({readOnly:!0})],R.prototype,"size",null),R=t([r("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],R);const y=f(),H=l(),N=g(),D=g();export{R as InstanceData,C as InstanceDataView,S as StateFlags};
|
|
@@ -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 r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as e}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{MaterialParameters as s}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{DefaultBufferWriter as a}from"./DefaultBufferWriter.js";import{
|
|
5
|
+
import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as e}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{MaterialParameters as s}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{DefaultBufferWriter as a}from"./DefaultBufferWriter.js";import{PositionUvLayout as n}from"./DefaultLayouts.js";import{TriangleMaterial as p}from"./TriangleMaterial.js";import{CheckerBoardTechnique as h}from"../shaders/CheckerBoardTechnique.js";import{CheckerBoardTechniqueConfiguration as f}from"../shaders/CheckerBoardTechniqueConfiguration.js";import{alphaCutoff as c}from"../../../../webscene/support/AlphaCutoff.js";class u extends p{constructor(r){super(r,m),this._configuration=new f,this.produces=new Map([[o.OPAQUE_MATERIAL,r=>e(r)&&!this.transparent],[o.TRANSPARENT_MATERIAL,r=>e(r)&&this.transparent&&this.parameters.writeDepth],[o.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,r=>e(r)&&this.transparent&&!this.parameters.writeDepth]])}getConfiguration(r,t){return this._configuration.transparent=this.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color1[3]>=c||this.parameters.color2[3]>=c}get transparent(){return this.parameters.color1[3]<1||this.parameters.color2[3]<1}createGLMaterial(r){return new l(r)}createBufferWriter(){return new a(n)}}class l extends i{beginSlot(r){return this.getTechnique(h,r)}}class m extends s{constructor(){super(...arguments),this.size=r(1,1),this.color1=t(.75,.75,.75,1),this.color2=t(.5,.5,.5,1),this.writeDepth=!0,this.polygonOffset=!1}}export{u as CheckerBoardMaterial,m 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{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmissionOrOID as e,isDepth as s,is2DGeometryOutput as i,isColorOrColorEmission as a,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as h}from"../lib/basicInterfaces.js";import p from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as l}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as u}from"../lib/RenderSlot.js";import{VertexAttribute as c}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as f}from"./DefaultBufferWriter.js";import{TriangleMaterial as m}from"./TriangleMaterial.js";import{VisualVariablePassParameters as _}from"./VisualVariablePassParameters.js";import{ColorMaterialTechnique as g}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as
|
|
5
|
+
import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmissionOrOID as e,isDepth as s,is2DGeometryOutput as i,isColorOrColorEmission as a,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as h}from"../lib/basicInterfaces.js";import p from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as l}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as u}from"../lib/RenderSlot.js";import{VertexAttribute as c}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as f}from"./DefaultBufferWriter.js";import{TriangleMaterial as m}from"./TriangleMaterial.js";import{VisualVariablePassParameters as _}from"./VisualVariablePassParameters.js";import{ColorMaterialTechnique as g}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as O}from"../shaders/ColorMaterialTechniqueConfiguration.js";import{alphaCutoff as T}from"../../../../webscene/support/AlphaCutoff.js";class A extends m{constructor(t){super(t,P),this._configuration=new O,this.supportsEdges=!0,this.produces=new Map([[u.OPAQUE_MATERIAL,t=>this._isOpaqueMaterialPass(t)],[u.OPAQUE_MATERIAL_WITHOUT_NORMALS,t=>this._isOpaqueNoSSAODepthPass(t)],[u.TRANSPARENT_MATERIAL,t=>e(t)&&this._transparent&&this.parameters.writeDepth],[u.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,t=>s(t)&&this._transparent&&this.parameters.writeDepth],[u.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,t=>e(t)&&this._transparent&&!this.parameters.writeDepth],[u.DRAPED_MATERIAL,t=>i(t)]])}getConfiguration(t,r){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.transparent=this._transparent,this._configuration.discardInvisibleFragments=this._transparent&&!this._isOpaquePass(t)&&this.parameters.discardInvisibleFragments,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=r.hasOccludees,this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation<l,this._configuration.terrainDepthTest=r.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.draped=this.parameters.draped,this._configuration}get visible(){return this.parameters.color[3]>=T}get _transparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}_isOpaquePass(t){return this._isOpaqueMaterialPass(t)||this._isOpaqueNoSSAODepthPass(t)}_isOpaqueMaterialPass(t){return t===o.Highlight||e(t)&&!this._transparent}_isOpaqueNoSSAODepthPass(t){return s(t)&&this.parameters.writeDepth&&!this._transparent}createGLMaterial(t){return new d(t)}createBufferWriter(){const t=r().vec3f(c.POSITION);return n()&&t.vec4u8(c.OLIDCOLOR),this.parameters.vvColor?t.f32(c.COLORFEATUREATTRIBUTE):t.vec4u8(c.COLOR),new f(t)}}class d extends p{beginSlot(t){return this.getTechnique(g,t)}}class P extends _{constructor(){super(...arguments),this.color=t,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=h.None,this.draped=!1,this.discardInvisibleFragments=!1}}export{A as ColorMaterial,P 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{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{VertexAttribute as O}from"../lib/VertexAttribute.js";const t=e().vec3f(O.POSITION),f=e().vec3f(O.POSITION).
|
|
5
|
+
import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{VertexAttribute as O}from"../lib/VertexAttribute.js";const t=e().vec3f(O.POSITION),f=e().vec3f(O.POSITION).vec2f16(O.UV0),r=e().vec3f(O.POSITION).vec4u8(O.COLOR),I=e().vec3f(O.POSITION).vec2f16(O.UV0).vec4u8(O.OLIDCOLOR);export{r as PositionColorLayout,t as PositionLayout,f as PositionUvLayout,I as PositionUvOlidLayout};
|
|
@@ -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{p as e,i as t,c as r,n as i,d as s,l as a,h as o,f as n,q as c}from"../../../../chunks/vec32.js";import{ZEROS as l,create as u,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as f}from"../../../ViewingMode.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import{is3DGeometryOutputMRT as p,isShadowRelatedOutput as d,is3DGeometryOutput as g,ShaderOutput as T,isColorOrColorEmission as x}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as _}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as v}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as b}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as O}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as M}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as S,AlphaDiscardMode as w}from"../lib/basicInterfaces.js";import{GLTextureMaterial as y}from"../lib/GLTextureMaterial.js";import{Material as
|
|
5
|
+
import{p as e,i as t,c as r,n as i,d as s,l as a,h as o,f as n,q as c}from"../../../../chunks/vec32.js";import{ZEROS as l,create as u,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as f}from"../../../ViewingMode.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import{is3DGeometryOutputMRT as p,isShadowRelatedOutput as d,is3DGeometryOutput as g,ShaderOutput as T,isColorOrColorEmission as x}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as _}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as v}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as b}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as O}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as M}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as S,AlphaDiscardMode as w}from"../lib/basicInterfaces.js";import{GLTextureMaterial as y}from"../lib/GLTextureMaterial.js";import{Material as R}from"../lib/Material.js";import{OITPolygonOffsetLimit as A}from"../lib/OrderIndependentTransparency.js";import{intersectTriangleGeometry as I}from"../lib/RayIntersections.js";import{RenderSlot as P}from"../lib/RenderSlot.js";import{VertexAttribute as j}from"../lib/VertexAttribute.js";import{getVerticalOffsetObject3D as C}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as L}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as D}from"./internal/MaterialUtil.js";import{DefaultMaterialTechnique as N,DefaultMaterialPassParameters as E}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as V}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as B}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as z}from"../../../../webscene/support/AlphaCutoff.js";class q extends R{constructor(e,t){super(e,k),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[P.OPAQUE_MATERIAL,e=>(p(e)||d(e))&&!this.transparent],[P.TRANSPARENT_MATERIAL,e=>(p(e)||d(e))&&this.transparent&&this.parameters.writeDepth],[P.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>(g(e)||d(e))&&this.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=F(this.parameters),this._configuration=new V(t.spherical)}isVisibleForOutput(e){return e!==T.Shadow&&e!==T.ShadowExcludeHighlight&&e!==T.ShadowHighlight||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t?1:i[3])>=z}get hasEmissions(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveFactor,l)}getConfiguration(e,t){const r=this.parameters,{treeRendering:i,doubleSided:s,doubleSidedType:a}=r;return this._configuration.output=e,this._configuration.hasNormalTexture=!i&&!!r.normalTextureId,this._configuration.hasColorTexture=!!r.textureId,this._configuration.hasVertexTangents=!i&&r.hasVertexTangents,this._configuration.instanced=r.isInstanced,this._configuration.instancedDoublePrecision=r.instancedDoublePrecision,this._configuration.vvSize=!!r.vvSize,this._configuration.hasVerticalOffset=null!=r.verticalOffset,this._configuration.hasScreenSizePerspective=null!=r.screenSizePerspective,this._configuration.hasSlicePlane=r.hasSlicePlane,this._configuration.alphaDiscardMode=r.textureAlphaMode,this._configuration.normalType=i?_.Attribute:r.normalType,this._configuration.transparent=this.transparent,this._configuration.writeDepth=r.writeDepth,null!=r.customDepthTest&&(this._configuration.customDepthTest=r.customDepthTest),this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=r.hasSlicePlane?S.None:r.cullFace,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.hasModelTransformation=!i&&null!=r.modelTransformation,this._configuration.hasVertexColors=r.hasVertexColors,this._configuration.hasSymbolColors=r.hasSymbolColors,this._configuration.doubleSidedMode=i?b.WindingOrder:s&&"normal"===a?b.View:s&&"winding-order"===a?b.WindingOrder:b.None,this._configuration.instancedColor=r.hasInstancedColor,x(e)?(this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.receiveShadows=r.receiveShadows,this._configuration.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(this._configuration.terrainDepthTest=!1,this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1),this._configuration.vvColor=!!r.vvColor,this._configuration.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,this._configuration.pbrMode=r.usePBR?r.isSchematic?O.Schematic:O.Normal:O.Disabled,this._configuration.hasMetallicRoughnessTexture=!i&&!!r.metallicRoughnessTextureId,this._configuration.emissionSource=i?v.None:null!=r.emissiveTextureId?v.Texture:r.usePBR?v.Value:v.None,this._configuration.hasOcclusionTexture=!i&&!!r.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<A,this._configuration.snowCover=W(t),this._configuration.hasColorTextureTransform=!!r.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,this._configuration}intersect(e,l,u,h,m,p){if(null!=this.parameters.verticalOffset){const e=u.camera;t(K,l[12],l[13],l[14]);let p=null;switch(u.viewingMode){case f.Global:p=i(Y,K);break;case f.Local:p=r(Y,Q)}let d=0;const g=s(X,K,e.eye),T=a(g),x=o(g,g,1/T);let _=null;this.parameters.screenSizePerspective&&(_=n(p,x)),d+=D(e,T,this.parameters.verticalOffset,_??0,this.parameters.screenSizePerspective),o(p,p,d),c(J,p,u.transform.inverseRotation),h=s(G,h,J),m=s(H,m,J)}I(e,u,h,m,C(u.verticalOffset),p)}createGLMaterial(e){return new U(e)}createBufferWriter(){return new L(this._vertexBufferLayout)}get transparent(){const{parameters:{drivenOpacity:e,opacity:t,externalColor:[r,i,s,a],layerOpacity:o,texture:n,textureId:c,textureAlphaMode:l,colorMixMode:u}}=this;return e||t<1&&"replace"!==u||a<1&&"ignore"!==u||o<1||(null!=n||null!=c)&&l!==w.Opaque&&l!==w.Mask&&"replace"!==u}}class U extends y{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const r=this._material.parameters;this.updateTexture(r.textureId);const i=e.camera.viewInverseTransposeMatrix;return t(r.origin,i[3],i[7],i[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(r.treeRendering?B:N,e)}}class k extends E{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}function W(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}function F(e){const t=m().vec3f(j.POSITION);e.normalType===_.Compressed?t.vec2i16(j.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(j.NORMAL),e.hasVertexTangents&&t.vec4f(j.TANGENT);return(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f16(j.UV0),e.hasVertexColors&&t.vec4u8(j.COLOR),e.hasSymbolColors&&t.vec4u8(j.SYMBOLCOLOR),M()&&t.vec4u8(j.OLIDCOLOR),t}const G=u(),H=u(),Q=h(0,0,1),Y=u(),J=u(),K=u(),X=u();export{U as DefaultGLMaterial,q as DefaultMaterial,k as DefaultMaterialParameters};
|
|
@@ -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};
|