@arcgis/core 4.33.0-next.20250402 → 4.33.0-next.20250403
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/0cec53e6f1464c69448d.js +1 -0
- package/assets/esri/core/workers/chunks/{322cb1b1871d03b69f0a.js → 5beb525b4adde1d98532.js} +33 -33
- package/assets/esri/core/workers/chunks/6b0a6469673417563616.js +1 -0
- package/assets/esri/core/workers/chunks/c977a47cabc419610277.js +1 -0
- package/assets/esri/core/workers/chunks/{7e00122014d0a55363a8.js → ccb289911e7445b17763.js} +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/buffer/internals/Vec2.js +1 -1
- package/interfaces.d.ts +23 -21
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
- package/views/3d/environment/PrecipitationTechnique.js +1 -1
- package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.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/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/ChangeSet.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
- package/views/3d/webgl-engine/lib/ITexture.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/TextureUpdater.js +5 -0
- package/views/3d/webgl-engine/lib/rendererUtils.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.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/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
- package/views/webgl/renderState.js +1 -1
- package/views/webgl/testFloatBufferBlend.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/assets/esri/core/workers/chunks/a56da688088404259481.js +0 -1
- package/assets/esri/core/workers/chunks/e6469173c65531d6524a.js +0 -1
- package/assets/esri/core/workers/chunks/e9e517a2141e504eec64.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{BufferViewVec2f16 as e,BufferViewVec2f as t,BufferViewVec2f64 as i,BufferViewVec3f16 as s,BufferViewVec3f as r,BufferViewVec3f64 as n,BufferViewVec4f16 as h,BufferViewVec4f as d,BufferViewVec4f64 as u,BufferViewMat3f as f,BufferViewMat3f64 as o,BufferViewMat4f as l,BufferViewMat4f64 as p,BufferViewVec4u8 as c,BufferViewFloat16 as a,BufferViewFloat as _,BufferViewFloat64 as F,BufferViewUint8 as y,BufferViewUint16 as m,BufferViewInt8 as b,BufferViewVec2i8 as g,BufferViewVec2i16 as w,BufferViewVec2u8 as v,
|
|
5
|
+
import{BufferViewVec2f16 as e,BufferViewVec2f as t,BufferViewVec2f64 as i,BufferViewVec3f16 as s,BufferViewVec3f as r,BufferViewVec3f64 as n,BufferViewVec4f16 as h,BufferViewVec4f as d,BufferViewVec4f64 as u,BufferViewMat3f as f,BufferViewMat3f64 as o,BufferViewMat4f as l,BufferViewMat4f64 as p,BufferViewVec4u8 as c,BufferViewFloat16 as a,BufferViewFloat as _,BufferViewFloat64 as F,BufferViewUint8 as y,BufferViewUint16 as m,BufferViewInt8 as b,BufferViewVec2i8 as g,BufferViewVec2i16 as w,BufferViewVec2u8 as v,BufferViewVec2u16 as E,BufferViewVec4u16 as M,BufferViewUint32 as T,BufferViewVec3u8 as A,BufferViewVec3u16 as B,BufferViewVec2u32 as U,BufferViewVec3u32 as C,BufferViewVec4u32 as L,BufferViewVec3i8 as j,BufferViewVec4i8 as x,BufferViewInt16 as z,BufferViewVec3i16 as $,BufferViewVec4i16 as V,BufferViewInt32 as k,BufferViewVec2i32 as q,BufferViewVec3i32 as D,BufferViewVec4i32 as G}from"../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as H}from"../../../../geometry/support/buffer/types.js";import{assert as I}from"../../webgl-engine/lib/Util.js";class J{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const i of e.fields.keys()){const t=e.fields.get(i);this[i]=new t.constructor(this.buffer,t.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const i=this[e];return i&&i.elementCount===t.ElementCount&&i.elementType===t.ElementType?i:null}slice(e,t){return new J(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,i=0,s=e.count){const r=this.stride;if(r%4==0){const n=new Uint32Array(e.buffer,t*r,s*r/4);new Uint32Array(this.buffer,i*r,s*r/4).set(n)}else{const n=new Uint8Array(e.buffer,t*r,s*r);new Uint8Array(this.buffer,i*r,s*r).set(n)}return this}get cachedMemory(){return this.byteLength}dispose(){}}class K{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach((e=>this._fields.set(e[0],{...e[1],constructor:R(e[1].constructor)}))))}freeze(){return this}vec2f16(t,i){return this._appendField(t,e,i),this}vec2f(e,i){return this._appendField(e,t,i),this}vec2f64(e,t){return this._appendField(e,i,t),this}vec3f16(e,t){return this._appendField(e,s,t),this}vec3f(e,t){return this._appendField(e,r,t),this}vec3f64(e,t){return this._appendField(e,n,t),this}vec4f16(e,t){return this._appendField(e,h,t),this}vec4f(e,t){return this._appendField(e,d,t),this}vec4f64(e,t){return this._appendField(e,u,t),this}mat3f(e,t){return this._appendField(e,f,t),this}mat3f64(e,t){return this._appendField(e,o,t),this}mat4f(e,t){return this._appendField(e,l,t),this}mat4f64(e,t){return this._appendField(e,p,t),this}vec4u8(e,t){return this._appendField(e,c,t),this}f16(e,t){return this._appendField(e,a,t),this}f32(e,t){return this._appendField(e,_,t),this}f64(e,t){return this._appendField(e,F,t),this}u8(e,t){return this._appendField(e,y,t),this}u16(e,t){return this._appendField(e,m,t),this}i8(e,t){return this._appendField(e,b,t),this}vec2i8(e,t){return this._appendField(e,g,t),this}vec2i16(e,t){return this._appendField(e,w,t),this}vec2u8(e,t){return this._appendField(e,v,t),this}vec2u16(e,t){return this._appendField(e,E,t),this}vec4u16(e,t){return this._appendField(e,M,t),this}u32(e,t){return this._appendField(e,T,t),this}_appendField(e,t,i){if(this._fields.has(e))return void I(!1,`${e} already added to vertex buffer layout`);const s=t.ElementCount*H(t.ElementType),r=this._stride;this._fields.set(e,{constructor:t,size:s,offset:r,optional:i}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach((i=>{const s=H(i.constructor.ElementType);e=Math.floor((e+s-1)/s)*s,i.offset=e,e+=i.size,t=Math.max(t,s)})),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new J(this,e)}createView(e){return new J(this,e)}clone(){const e=new K;return e._stride=this._stride,e._fields=new Map,this._fields.forEach(((t,i)=>e._fields.set(i,t))),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function N(){return new K}class O{constructor(e){this.fields=new Array,e.fields.forEach(((e,t)=>{const i={...e,constructor:Q(e.constructor)};this.fields.push([t,i])})),this.stride=e.stride}}const P=[_,t,r,d,f,l,F,i,n,u,o,p,y,v,A,c,m,E,B,M,T,U,C,L,b,g,j,x,z,w,$,V,k,q,D,G];function Q(e){return`${e.ElementType}_${e.ElementCount}`}function R(e){return S.get(e)}const S=new Map;P.forEach((e=>S.set(Q(e),e)));export{J as InterleavedBuffer,K as InterleavedLayout,O as PackedLayout,N as newLayout};
|
|
@@ -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{releaseMaybe as t}from"../../../core/maybe.js";import{
|
|
5
|
+
import{releaseMaybe as t}from"../../../core/maybe.js";import{maxUint16 as e}from"../../../core/typedArrayUtil.js";import{g as s}from"../../../chunks/vec32.js";import{empty as i}from"../../../geometry/support/aaBoundingBox.js";import{internalAssert as r}from"./terrainUtils.js";import{decompressNormal as n,compressNormal as o}from"../webgl-engine/lib/Normals.js";class d{constructor(){this.indices=null,this.indexCount=0,this.edgeIndicesStartIndex=0,this.poleIndicesStartIndex=0,this.vertexAttributes=null,this.edgeVerticesStartIndex=0,this.poleVerticesStartIndex=0,this.maxEdgeVertexCount=0,this.boundingBox=i(),this.numVerticesPerSide=0,this.minu=0,this.minv=0,this.maxu=1,this.maxv=1,this.outerEdgesOffsetAndLength=[0,0,0,0,0,0,0,0]}release(){this.vertexAttributes=t(this.vertexAttributes),this.indices=null}reset(){this.indices=null,this.vertexAttributes=null,i(this.boundingBox),this.numVerticesPerSide=0}getEdgeFirstVertexIndex(t){return this.outerEdgesOffsetAndLength[2*t]}getEdgeCount(t){return this.outerEdgesOffsetAndLength[2*t+1]}getEdgeVertexIndex(t,e){return this.getEdgeAttributeIndex(t,e)}getEdgeVertexPosition(t,e,i,r){this._getEdgeVertexRaw(this.getEdgeAttributeIndex(t,r),e),s(e,e,i)}getEdgeNormal(t,e,s){const{typedBuffer:i,typedBufferStride:r}=this.vertexAttributes.normalCompressed;n(e,i,this.getEdgeAttributeIndex(t,s),r)}setEdgeNormalFromValues(t,e,s,i,r){this._setNormal(this.getEdgeAttributeIndex(t,e),s,i,r)}setEdgeVertexFromValuesRawPositionUV(t,e,s,i,r,n,o){const d=this.getEdgeAttributeIndex(t,e);this.vertexAttributes.position.setValues(d,s,i,r),this._setUV(d,n,o)}setEdgeVertexFromValuesRawPositionUVNormal(t,e,s,i,r,n,o,d,u,g){const h=this.getEdgeAttributeIndex(t,e);this.vertexAttributes.position.setValues(h,s,i,r),this._setUV(h,n,o),this._setNormal(h,d,u,g)}_getEdgeVertexRaw(t,e){this.vertexAttributes.position.getVec(t,e)}_setNormal(t,e,s,i){const{typedBuffer:r,typedBufferStride:n}=this.vertexAttributes.normalCompressed;o(r,t,e,s,i,n)}_setUV(t,s,i){this.vertexAttributes.uv0.setValues(t,Math.round(s*e),Math.round(i*e))}getEdgeAttributeIndex(t,e){return r(0<=e&&e<this.getEdgeCount(t)),this.getEdgeFirstVertexIndex(t)+e}}export{d as PatchGeometry};
|
|
@@ -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{isPowerOfTwo as e,clamp as t}from"../../../core/mathUtils.js";import{empty as n}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as o}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as s}from"./ElevationData.js";import{PatchType as r}from"./interfaces.js";import{NeighborIndex as i}from"./NeighborIndex.js";import{PatchGeometryLUT as a}from"./PatchGeometryLUT.js";import{neighborTileIfLoadedOrSelf as c,zeroToFour as l}from"./PatchRenderData.js";import{internalAssert as u,enableTerrainInternalChecks as d,neighborEdgeIndices as f,almostEquals as m}from"./terrainUtils.js";import{isCornerNeighbor as g}from"./Tile.js";import{compareTilesByLij as p}from"./tileUtils.js";import{compressNormal as x}from"../webgl-engine/lib/Normals.js";const h=65536;function M(e,t){const{tile:o,geometry:s,geometryState:i}=e,{extentInRadians:a,surface:c}=o,{isWebMercator:l,renderer:u}=c,{numVerticesPerSide:d,wireframe:f}=i,m=d-1,g=(d-2)**2,p=l&&(t===r.HAS_SOUTH_POLE||t===r.HAS_BOTH_POLES),x=l&&(t===r.HAS_NORTH_POLE||t===r.HAS_BOTH_POLES),h=((p?1:0)+(x?1:0))*ge*d,M=de(i),v=g+h+4*M,V=u.tileGeometryCache.acquire(v);s.numVerticesPerSide=d,s.vertexAttributes=V,s.maxEdgeVertexCount=M;const{boundingBox:B}=s;n(B);const b=E(e);se.update(m,a,b),y(e),s.poleVerticesStartIndex=g;const L=S(e,p,x);s.edgeVerticesStartIndex=g+h,Q(e),I(e),_(s,L,f),e.intersectionData=null}function S(e,t,n){const{tile:o,localOrigin:s,geometry:r}=e,{extent:i,ellipsoid:a}=o,{boundingBox:c,numVerticesPerSide:l,vertexAttributes:u,poleVerticesStartIndex:d}=r,f=l-1,m=s[0],g=s[1],p=s[2],h=a.radius,M=i[1],S=i[3],y=[];let v=d;const V=(e,t)=>{const n=t*l;ue(-m,-g,e*h-p,c),y.push(new ne(1===e,n,1===e?0:2,v,ge));const o=C(-1===e?M:S,h),s=e*Math.PI/2-o,r=.99*(1===e?1:-1),i=h+0,{position:a,uv0:d}=u,{typedBuffer:V,typedBufferStride:B}=u.normalCompressed;for(let l=1;l<=ge;++l){const e=o+s*(l/ge),t=Math.cos(e),n=Math.sin(e);for(let o=0;o<=f;o++){const e=o/f,s=se.sinLonLUT[o],l=se.cosLonLUT[o]*t,u=s*t,h=n,M=l*i-m,S=u*i-g,y=h*i-p;ue(M,S,y,c),a.setValues(v,M,S,y),d.setValues(v,e,r),x(V,v,l,u,h,B),++v}}};return t&&V(-1,0),n&&V(1,f),y}function y(e){const{tile:t}=e;if(!t.intersectsClippingArea)return;const{geometry:n,geometryState:o,localOrigin:r}=e,{numVerticesPerSide:i,samplerData:a}=o,c=i-2,l=i-1,{vertexAttributes:u,boundingBox:d}=n,{position:f,uv0:m}=u,{typedBuffer:g,typedBufferStride:p}=u.normalCompressed,{extent:h}=t,M=h[0],S=h[2],y=h[1],v=h[3],V=t.ellipsoid.radius,B=r[0],I=r[1],b=r[2],L=f.typedBuffer,C=f.typedBufferStride,A=1/l;let P=0;if(1<=c){const e=A,t=y*(1-e)+v*e,n=se.sinLatLUT[1],o=se.cosLatLUT[1];for(let r=1;r<=c;r++){const i=r*A,c=M*(1-i)+S*i,l=se.sinLonLUT[r],u=se.cosLonLUT[r],f=V+s(c,t,a),g=f*u*o-B,p=f*l*o-I,x=f*n-b;ue(g,p,x,d);const h=(r-1)*C;L[h]=g,L[h+1]=p,L[h+2]=x,m.setValues(r-1,i,e)}}for(let E=1;E<=c;E++){const e=E*A,t=y*(1-e)+v*e,n=se.sinLatLUT[E],o=se.cosLatLUT[E],r=E+1,i=r*A,u=y*(1-i)+v*i,f=se.sinLatLUT[r],h=se.cosLatLUT[r],O=se.sinLonLUT[0],T=se.cosLonLUT[0],D=V+s(M,t,a);let R=T*o*D-B,U=O*o*D-I,N=n*D-b;const w=P*C;let j=L[w],F=L[w+1],H=L[w+2];for(let v=1;v<=c;v++){const e=v*A,r=M*(1-e)+S*e,O=se.sinLonLUT[v],T=se.cosLonLUT[v];let D=0,w=0,q=0;if(v<c){const e=(P+1)*C;D=L[e],w=L[e+1],q=L[e+2]}else{const e=se.sinLonLUT[l],r=se.cosLonLUT[l],i=V+s(S,t,a);D=r*o*i-B,w=e*o*i-I,q=n*i-b}const _=R,W=U,k=N;R=j,U=F,N=H,j=D,F=w,H=q;const z=D-_,G=w-W,J=q-k;let K=0,Q=0,X=0;if(E>1){const e=(P-c)*C;K=L[e],Q=L[e+1],X=L[e+2]}else{const e=se.sinLatLUT[0],t=se.cosLatLUT[0],n=V+s(r,y,a);K=T*t*n-B,Q=O*t*n-I,X=e*n-b}const Y=V+s(r,u,a),Z=T*h*Y-B,$=O*h*Y-I,ee=f*Y-b;if(E<c){const t=P+c,n=t*C;L[n]=Z,L[n+1]=$,L[n+2]=ee,ue(Z,$,ee,d),m.setValues(t,e,i)}const te=K-Z,ne=Q-$,oe=X-ee;let re=T*o,ie=O*o,ae=n;ae*ae<.999&&(re=J*ne-G*oe,ie=z*oe-J*te,ae=G*te-z*ne);const ce=1/Math.sqrt(re*re+ie*ie+ae*ae);x(g,P,re*ce,ie*ce,ae*ce,p),++P}}}function v(e){e.tile.intersectsClippingArea&&(I(e),ee(e),e.intersectionData=null)}function V(e){e.tile.intersectsClippingArea&&(X(e),I(e),ee(e),te(e),e.intersectionData=null)}function B(e){e.tile.intersectsClippingArea&&(L(e),b(e,!0),ee(e),e.intersectionData=null)}function I(e){e.tile.intersectsClippingArea&&(L(e),b(e))}function b(t,n=!1){const{geometry:o,geometryState:r,tile:i,localOrigin:a}=t,{level:l,extent:g,extentInRadians:x,ellipsoid:h}=i,M=h.radius,S=x[0],y=x[2],v=x[1],V=x[3],{samplerData:B}=r,I=g[0],b=g[2],L=g[1],C=g[3],A=E(t),{boundingBox:P,vertexAttributes:O}=o,T=a[0],D=a[1],R=a[2],{position:U,uv0:N}=O,w=U.typedBuffer,j=U.typedBufferStride;for(let E=0;E<4;++E){const a=1===E||3===E,x=r.edgeResolutions[E];u(e(x));const h=x+1,O=c(i,r.edgePeerNeighbors[E]);if(ae(i,O,E)){Y(t,E,O);continue}const U=null!=O;u(!U||O.level===i.level),u(!U||p(i,O)<=0);const F=O?.renderData,H=F?.geometryState;if(d){const e=i.surface;if(!O&&e&&!e.updatingRootTiles){const t=f[E],n=i.findNeighborTile(t,(e=>e.loaded||e.leaf||e.level===i.level));n?n.intersectsClippingArea&&(u(!n.loaded),u(!n.leaf),u(n.level===l)):u(null==e?.rootTiles||!i.shouldHaveNeighbor(t))}}const q=1===E?g[2]:g[0],_=O?.extent,W=_&&a?1===E?_[0]:_[2]:q,k=0===E?g[3]:g[1],z=1===E?1:0,G=0===E?1:0,J=1===E?y:S,K=0===E?V:v,Q=Math.sin(J),X=Math.cos(J),Z=Math.sin(K),$=Math.cos(K),ee=H?.samplerData,te=U?(e,t,n)=>.5*(s(e,t,B)+s(n,t,ee)):(e,t,n)=>s(e,t,B),ne=o.outerEdgesOffsetAndLength[2*E+0],oe=n&&h>3?h-3:1,se=null!=B&&B.some((e=>null!=e)),re=null!=ee&&ee.some((e=>null!=e)),ie=se||re,ce=1/x,le=ne;u(!_||m(_[2]-_[0],g[2]-g[0]));(()=>{const e=1===E?-1:3===E?1:0,t=0===E?-1:2===E?1:0,n=(g[2]-g[0])*ce,r=e*n,i=t*n,c=a?e*((y-S)*ce):0,l=a?0:t*ce,u=G,d=a?J+c:J,f=a?Math.sin(d):Q,m=a?Math.cos(d):X,p=a?J-c:J,x=a?Math.sin(p):Q,v=a?Math.cos(p):X,V=a?K:A(u+l),O=a?Z:Math.sin(V),F=a?$:Math.cos(V),H=a?K:A(u-l),_=a?Z:Math.sin(H),Y=a?$:Math.cos(H);let ne=0,se=0,re=0;{const e=0*ce,t=a?q:I*(1-e)+b*e,n=a?W:t,o=a?L*(1-e)+C*e:k,s=a?J:S*(1-e)+y*e,r=a?Q:Math.sin(s),i=a?X:Math.cos(s),c=a?A(e):K,l=a?Math.sin(c):Z,u=a?Math.cos(c):$,d=M+te(t,o,n);ne=i*u*d,se=r*u*d,re=l*d}let ae=0,de=0,fe=0;{const e=1*ce,t=a?q:I*(1-e)+b*e,n=a?W:t,o=a?L*(1-e)+C*e:k,s=a?J:S*(1-e)+y*e,r=a?Q:Math.sin(s),i=a?X:Math.cos(s),c=a?A(e):K,l=a?Math.sin(c):Z,u=a?Math.cos(c):$,d=M+te(t,o,n);ae=i*u*d,de=r*u*d,fe=l*d}for(let g=1;g<h-1;g+=oe){let e=0,t=0,n=0;{const o=(g+1)*ce,s=a?q:I*(1-o)+b*o,r=a?W:s,i=a?L*(1-o)+C*o:k,c=a?J:S*(1-o)+y*o,l=a?Q:Math.sin(c),u=a?X:Math.cos(c),d=a?A(o):K,f=a?Math.sin(d):Z,m=a?Math.cos(d):$,p=M+te(s,i,r);e=u*m*p,t=l*m*p,n=f*p}const c=e,l=t,u=n,d=ae,p=de,h=fe;ae=c,de=l,fe=u;{const e=le+g,t=e*j,n=d-T,o=p-D,s=h-R;w[t]=n,w[t+1]=o,w[t+2]=s,ue(n,o,s,P);const r=g*ce,i=a?z:r,c=a?r:G;N.setValues(e,i,c)}const V=ne,H=se,oe=re;ne=d,se=p,re=h;const me=d,ge=p,pe=h,xe=1/Math.sqrt(me*me+ge*ge+pe*pe),he=pe*xe;let Me=0,Se=0,ye=0;if(ie&&he*he<.999){let e=0,t=0,n=0;{const o=0===E?-1:1;e=o*(c-V),t=o*(l-H),n=o*(u-oe)}{const o=g*ce,c=a?q:I*(1-o)+b*o,l=a?W:c,u=a?L*(1-o)+C*o:k,d=a?J:S*(1-o)+y*o,p=a?Q:Math.sin(d),h=a?X:Math.cos(d),V=a?A(o):K,P=a?Math.sin(V):Z,T=a?Math.cos(V):$;let D=me,R=ge,N=pe;if(U){const e=M+s(l-r,u-i,ee),t=a?T:Y;D=(a?v:h)*t*e,R=(a?x:p)*t*e,N=(a?P:_)*e}{const o=M+s(c+r,u+i,B),l=a?T:F,d=(a?m:h)*l*o,g=(a?f:p)*l*o,x=(a?P:O)*o;U||(D=2*me-d,R=2*ge-g,N=2*pe-x);const S=3===E?-1:1,y=S*(D-d),v=S*(R-g),V=S*(N-x);Me=n*v-t*V,Se=e*V-n*y,ye=t*y-e*v;const I=1/Math.sqrt(Me*Me+Se*Se+ye*ye);Me*=I,Se*=I,ye*=I}}}else Me=me*xe,Se=ge*xe,ye=pe*xe;o.setEdgeNormalFromValues(E,g,Me,Se,ye)}})()}}function L(e){Z(e)}function C(e,t){return Math.PI/2-2*Math.atan(Math.exp(-e/t))}function A(e,t,n,o){return C(e*(1-o)+t*o,n)}function P(e,t,n){return e*(1-n)+t*n}function E(e){const{tile:t}=e;if(t.surface.isWebMercator){const e=t.extent,n=t.ellipsoid.radius;return t=>A(e[1],e[3],n,t)}const n=t.extentInRadians;return e=>P(n[1],n[3],e)}function O(e,t){const{tile:o,geometryState:s,geometry:r}=e,{extent:i,surface:a}=o,{wireframe:c}=s,l=i[0],u=i[1],d=i[2]-l,f=i[3]-u,{numVerticesPerSide:m,clippingArea:g}=s,p=null!=g?Math.max(0,(g[0]-l)/d):0,x=null!=g?Math.max(0,(g[1]-u)/f):0,h=null!=g?Math.min(1,(g[2]-l)/d):1,M=null!=g?Math.min(1,(g[3]-u)/f):1,S=(m-2)**2,y=de(s),v=S+4*y,V=a.renderer.tileGeometryCache.acquire(v),{boundingBox:B}=r;n(B),r.numVerticesPerSide=m,r.vertexAttributes=V,r.maxEdgeVertexCount=y,r.minu=p,r.minv=x,r.maxu=h,r.maxv=M,T(e),r.edgeVerticesStartIndex=S,Q(e),N(e),_(r,[],c),e.intersectionData=null}function T(e){const n=e.tile;if(!n.intersectsClippingArea)return;const{geometry:o,geometryState:r,localOrigin:i}=e,{samplerData:a,clippingArea:c,numVerticesPerSide:l}=r,{surface:u,extent:d,ellipsoid:f}=n,{isWebMercatorOnPlateCarree:m}=u,g=null!=c?c:re,p=d[0],h=d[1],M=d[2],S=d[3],y=Math.max(p,g[0]),v=Math.min(M,g[2]),V=Math.max(h,g[1]),B=Math.min(S,g[3]),I=f.radius,b=n.horizontalScale,L=l-1,C=l-2,{minu:A,minv:P,maxu:E,maxv:O,boundingBox:T,vertexAttributes:D}=o,{position:R,uv0:U}=D,{typedBuffer:N,typedBufferStride:w}=D.normalCompressed,j=i[0],F=i[1],H=i[2],q=R.typedBuffer,_=R.typedBufferStride;let W=0;const k=t(h,V,B),z=m?(Math.PI/2-2*Math.atan(Math.exp(-k/I)))*I:k*b,G=1/L,J=t(h*(1-G)+S*G,V,B);let K=z,Q=m?(Math.PI/2-2*Math.atan(Math.exp(-J/I)))*I:J*b;for(let X=1;X<=C;X++){const e=X/L,n=t(h*(1-e)+S*e,V,B),o=t(e,P,O),r=Q,i=(X-1)/L,c=t(h*(1-i)+S*i,V,B),l=K,u=(X+1)/L,d=t(h*(1-u)+S*u,V,B),f=m?(Math.PI/2-2*Math.atan(Math.exp(-d/I)))*I:d*b,g=t(u,P,O);K=Q,Q=f;const D=t(p,y,v);let R=D*b,k=s(D,n,a);const z=1/L,G=t(z,A,E),J=t(p*(1-G)+M*G,y,v);let Y=G,Z=J,$=J*b,ee=s(J,n,a);if(1===X){const e=$-j,n=K-F,s=ee-H,r=0*_;q[r]=e,q[r+1]=n,q[r+2]=s,ue(e,n,s,T);const i=t(z,A,E);U.setValues(W,i,o)}for(let m=1;m<=C;m++){const e=$,i=ee,u=(m+1)/L,h=t(u,A,E),S=t(p*(1-u)+M*u,y,v),V=Z;Z=S;{const e=W+1,t=e*_;if(1===X||m===C){const i=S*b,c=s(S,n,a);if(1===X&&m<C){const n=i-j,s=r-F,a=c-H;q[t]=n,q[t+1]=s,q[t+2]=a,ue(n,s,a,T),U.setValues(e,h,o)}$=i,ee=c}else $=q[t]+j,ee=q[t+2]+H}const B=$,I=ee,P=R,O=k;R=e,k=i;const D=(W-C)*_,z=1===X?s(V,c,a):q[D+2]+H,G=s(V,d,a);if(X<C){const t=W+C,n=t*_,o=e-j,s=f-F,r=G-H;q[n]=o,q[n+1]=s,q[n+2]=r,ue(o,s,r,T);const i=Y;Y=h,U.setValues(t,i,g)}{const e=B-P,t=l-f,n=t*(I-O),o=e*(z-G),s=-t*e,r=n*n+o*o+s*s;if(0===r)x(N,W,0,0,1,w);else{const e=1/Math.sqrt(r);x(N,W,n*e,o*e,s*e,w)}}++W}}}function D(e,t){e.tile.intersectsClippingArea&&(j(e),w(e,!0),ee(e),e.intersectionData=null)}function R(e,t){e.tile.intersectsClippingArea&&(X(e),N(e),ee(e),te(e),e.intersectionData=null)}function U(e,t){e.tile.intersectsClippingArea&&(N(e),ee(e),e.intersectionData=null)}function N(e,t){e.tile.intersectsClippingArea&&(j(e),w(e,!1))}function w(n,o){const{geometry:r,geometryState:i,localOrigin:a}=n,l=n.tile,{surface:m,extent:g}=l,{clippingArea:x,samplerData:h}=i,M=null!=x?x:re,S=g[0],y=g[2],v=g[1],V=g[3],B=[V>M[3],y>M[2],v<M[1],S<M[0]],I=l.horizontalScale,b=q(m.isWebMercatorOnPlateCarree,l.ellipsoid.radius,I),{minu:L,minv:C,maxu:A,maxv:P,boundingBox:E}=r,O=Math.max(S,M[0]),T=Math.min(y,M[2]),D=Math.max(v,M[1]),R=Math.min(V,M[3]),U=a[0],N=a[1],w=a[2];for(let j=0;j<4;++j){const a=1===j||3===j,g=i.edgeResolutions[j];u(e(g));const x=g+1,M=B[j],F=c(l,i.edgePeerNeighbors[j]);if(!M&&ae(l,F,j)){Y(n,j,F);continue}const H=null!=F&&!M,q=F?.renderData,_=q?.geometryState;if(d&&(u(!H||F.level===l.level),u(!H||p(l,F)<=0),l&&!F&&!m.updatingRootTiles)){const e=f[j],t=l.findNeighborTile(e,(e=>e.loaded||e.leaf||e.level===l.level));m.updatingRootTiles||(t?t.intersectsClippingArea&&(u(!t.loaded),u(!t.leaf),u(t.level===l.level)):u(null==m?.rootTiles||!l.shouldHaveNeighbor(e)))}const W=t(1===j?y:S,O,T),k=t(0===j?V:v,D,R),z=_?.samplerData,G=o&&x>3?x-3:1,J=t(1===j?1:0,L,A),K=t(0===j?1:0,C,P),Q=H?(e,t)=>.5*(s(e,t,z)+s(e,t,h)):(e,t)=>s(e,t,h),X=(y-S)/g,Z=a?1===j?X:-X:0,$=a?0:0===j?X:-X,ee=-Z,te=-$;let ne=0,oe=0,se=0;{const e=0/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,s=Q(n,o);ne=n*I,oe=b(o),se=s}let re=0,ie=0,ce=0;{const e=1/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,s=Q(n,o);re=n*I,ie=b(o),ce=s}for(let e=1;e<x-1;e+=G){const n=e/g,o=re,i=ie,c=ce;{const s=a?J:t(n,L,A),l=a?t(n,C,P):K,u=o-U,d=i-N,f=c-w;ue(o,d,f,E),r.setEdgeVertexFromValuesRawPositionUV(j,e,u,d,f,s,l)}{const n=(e+1)/g,o=a?W:t(S*(1-n)+y*n,O,T),s=a?t(v*(1-n)+V*n,D,R):k,r=Q(o,s);re=o*I,ie=b(s),ce=r}const l=re,u=ce,d=ne,f=oe,m=se;ne=o,oe=i,se=c;let p=0,x=0,M=0;if(a){const e=ie-i,r=u-c,a=f-i,l=m-c,d=t(v*(1-n)+V*n,D,R),g=W+ee,S=g*I-o,y=s(g,d,h)-c,B=3===j?-1:1;if(p=B*(-a+e)*y,x=B*S*(-l+r),M=-B*S*(-a+e),H){const t=W+Z,n=t*I-o;p=(-a+e)*(y-(s(t,d,z)-c)),x=(S-n)*(-l+r),M=-(S-n)*(-a+e)}}else{const e=l-o,r=u-c,a=d-o,f=m-c,g=t(S*(1-n)+y*n,O,T),v=k+te,V=s(g,v,h)-c,B=b(v)-i,I=2===j?-1:1;if(p=I*B*(-f+r),x=I*(-a+e)*V,M=-I*B*(-a+e),H){const t=g,n=k+$,o=b(n)-i;p=(-B+o)*(-f+r),x=(-a+e)*(-V+(s(t,n,z)-c)),M=-(-B+o)*(-a+e)}}const B=1/Math.sqrt(p*p+x*x+M*M);r.setEdgeNormalFromValues(j,e,p*B,x*B,M*B)}}}function j(e,t){Z(e)}function F(e,t){return(Math.PI/2-2*Math.atan(Math.exp(-e/t)))*t}function H(e,t){return e*t}function q(e,t,n){return e?e=>F(e,t):e=>H(e,n)}function _(e,t,n){const{numVerticesPerSide:o,vertexAttributes:s,maxEdgeVertexCount:r}=e,i=o-1,a=s.count,c=2*(o-3)*(o-3),u=4*(i+r-3),d=l.reduce(((t,n)=>t+(i+e.getEdgeCount(n)-3)),0),f=t.reduce(((e,t)=>e+i*(2*(t.latitudeResolution-1)+1)),0),m=3*(n?2:1),g=(c+u+f)*m,p=a>=h?new Uint32Array(g):new Uint16Array(g);for(let l=0;l<g;++l)p[l]=0;e.indices=p,e.indexCount=(c+d+f)*m,e.poleIndicesStartIndex=c*m,e.edgeIndicesStartIndex=(c+f)*m,n?(G(e),J(e,t),K(e)):(W(e),k(e,t),z(e))}function W(e){const{numVerticesPerSide:t,indices:n,vertexAttributes:o}=e,{position:s}=o,{typedBuffer:r,typedBufferStride:i}=s,a=t-2,c=t-3,l=0,u=t-3;let d=0;for(let f=0;f<c;++f){const e=f*a;for(let t=l;t<u;++t){const o=e+t,s=o+1,c=s+a,l=c-1;fe(o,s,c,l,i,r)?(n[d]=o,n[d+1]=s,n[d+2]=c,n[d+3]=c,n[d+4]=l,n[d+5]=o):(n[d]=o,n[d+1]=s,n[d+2]=l,n[d+3]=l,n[d+4]=s,n[d+5]=c),d+=6}}}function k(e,t){const{numVerticesPerSide:n,indices:o,poleIndicesStartIndex:s}=e,r=n-1;let i=s;for(const a of t){const t=a.isNorth?1:2,s=a.isNorth?2:1,c=a.isNorth?3:4,l=a.isNorth?4:3;let u=e.getEdgeVertexIndex(a.connectedOuterEdgeOffset,0),d=1;for(let e=0;e<a.latitudeResolution;++e){const f=0===e?a.rowOffset:u+n;for(let n=0;n<r;n++){const r=f+n;o[i]=u,o[i+t]=u+1,o[i+s]=r,e<a.latitudeResolution-1?(o[i+c]=u+1,o[i+l]=r+1,o[i+5]=r,i+=6):i+=3,u+=d}u=f,d=1}}}function z(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,s=n-1,r=s-2;let i=o;for(let a=0;a<4;++a){const n=le[a];let o=0,c=0;const l=e.getEdgeCount(a),d=n.count;u(d===s-1);const f=1===a||2===a,m=f?1:2,g=f?2:1,p=e.getEdgeFirstVertexIndex(a),x=1,h=n.vertex0Index,M=n.stride;for(;o<l-1||c<d-1;){const e=h+c*M,n=p+o*x,a=o<l-1,u=c<d-1,f=a&&(!u||(a?0+s*(o+.5)/(l-1):0)<=(u?1+r*(c+.5)/(d-1):0));f?++o:++c;const S=f?n+x:e+M;t[i]=e,t[i+m]=n,t[i+g]=S,i+=3}}e.indexCount=i}function G(e){const{indices:t,numVerticesPerSide:n,vertexAttributes:o}=e,{position:s}=o,{typedBuffer:r,typedBufferStride:i}=s,a=n-2;let c=0;for(let l=0;l<n-3;++l){const e=l*a;for(let o=0;o<n-3;++o){const n=l*a+o,s=n+1,u=s+a,d=u-1,f=e+o,m=f+1,g=m+a;fe(f,m,g,g-1,i,r)?(me(t,c,n,s,u),c+=6,me(t,c,u,d,n)):(me(t,c,n,s,d),c+=6,me(t,c,d,u,s)),c+=6}}}function J(e,t){const{indices:n,numVerticesPerSide:o,poleIndicesStartIndex:s}=e,r=o-1;let i=s;for(const a of t){const t=a.connectedOuterEdgeOffset;let s=e.getEdgeVertexIndex(t,0),c=1;for(let e=0;e<a.latitudeResolution;++e){const t=0===e?a.rowOffset:s+o;for(let o=0;o<r;o++)me(n,i,s,s+1,t+o),i+=6,e<a.latitudeResolution-1&&(me(n,i,s+1,t+o+1,t+o),i+=6),s+=c;s=t,c=1}}}function K(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,s=n-1,r=s-2;let i=o;for(let a=0;a<4;++a){const n=le[a];let o=0,c=0;const l=e.getEdgeCount(a),d=n.count;u(d===s-1);const f=1===a||2===a,m=f?1:3,g=f?3:1,p=e.getEdgeFirstVertexIndex(a),x=1,h=n.vertex0Index,M=n.stride;for(;o<l-1||c<d-1;){const e=h+c*M,n=p+o*x,a=o<l-1,u=c<d-1,f=a&&(!u||(a?0+s*(o+.5)/(l-1):0)<=(u?1+r*(c+.5)/(d-1):0));f?++o:++c;const S=f?n+x:e+M;t[i]=e,t[i+m]=n,t[i+m+1]=n,t[i+g]=S,t[i+g+1]=S,t[i+5]=e,i+=6}}e.indexCount=i}function Q(e){const{geometry:t,geometryState:n}=e,{edgeResolutions:o}=n,{numVerticesPerSide:s,edgeVerticesStartIndex:r}=t,i=s-2;let a=r;for(let c=0;c<4;++c){{const e=0===c||2===c,t=(0===c?i-1:0)*i+(1===c?i-1:0),n=(e?0:1)*i+(e?1:0),o=le[c];o.vertex0Index=t,o.stride=n,o.count=i}{const e=o[c]+1;t.outerEdgesOffsetAndLength[2*c+0]=a,t.outerEdgesOffsetAndLength[2*c+1]=e,a+=e}}}function X(e){Q(e),e.geometryState.wireframe?K(e.geometry):z(e.geometry)}function Y(n,o,s){const{geometryState:r,geometry:i,tile:a,localOrigin:c}=n,l=1===o||3===o,d=r.edgeResolutions[o];u(e(d));const f=d+1,{boundingBox:m,minu:g,minv:p,maxu:x,maxv:h,vertexAttributes:M}=i,S=t(1===o?1:0,g,x),y=t(0===o?1:0,p,h),v=s.renderData,V=v.geometryState,B=v.geometry,I=(o+2)%4,b=B.getEdgeCount(I),L=a.getNeighborEdgeStartVertexIndex(o,s)*d,C=d*2**(a.level-s.level);u(V.edgeResolutions[I]===C),u(b-1===C);const A=v.localOrigin[0]-c[0],P=v.localOrigin[1]-c[1],E=v.localOrigin[2]-c[2],O=i.getEdgeFirstVertexIndex(o),{position:T,uv0:D}=M,R=T.typedBuffer,U=T.typedBufferStride,N=M.normalCompressed,w=N.typedBuffer,j=N.typedBufferStride,F=B.vertexAttributes,H=B.getEdgeFirstVertexIndex(I),q=F.position.typedBuffer,_=F.position.typedBufferStride,W=F.normalCompressed.typedBuffer,k=F.normalCompressed.typedBufferStride;for(let e=1;e<f-1;++e){const n=O+e,o=H+(L+e),s=n*U,r=o*_,i=q[r]+A,a=q[r+1]+P,c=q[r+2]+E;R[s]=i,R[s+1]=a,R[s+2]=c,ue(i,a,c,m);const u=n*j,f=o*k;w[u]=W[f],w[u+1]=W[f+1];const M=e/d,v=l?S:t(M,g,x),V=l?t(M,p,h):y;D.setValues(n,v,V)}}function Z(e){const{geometry:n,geometryState:o,localOrigin:r}=e,{clippingArea:i,samplerData:a}=o,{minu:c,minv:l,maxu:d,maxv:f,boundingBox:m,vertexAttributes:g}=n,x=e.tile,{surface:h,ellipsoid:M,extent:S,extentInRadians:y,horizontalScale:v}=x,V="local"===h.view?.viewingMode,B=M.radius;let I=0,b=0,L=0;const C=(e,t,n)=>{const o=y[0===t?1:3],s=y[0===e?0:2],r=Math.cos(o),i=Math.sin(o),a=Math.sin(s),c=Math.cos(s),l=B+n;I=c*r*l,b=a*r*l,L=i*l},A=V?(()=>{const e=i,n=null!=e&&(S[3]>e[3]||S[2]>e[2]||S[1]<e[1]||S[0]<e[0]),o=q(h.isWebMercatorOnPlateCarree,B,v);return(s,r,i)=>{const a=0===s?S[0]:S[2],c=0===r?S[1]:S[3],l=n?t(a,e[0],e[2]):a,u=n?t(c,e[1],e[3]):c,d=i;I=l*v,b=o(u),L=d}})():C;let P=0,O=0,T=0,D=0,R=0,U=0,N=0,w=0,j=0;const F=V&&h.isWebMercatorOnPlateCarree,H=(e,t,n,o,s)=>{let r=0,i=0,a=0;if(V){const e=t*v,s=F?(Math.PI/2-2*Math.atan(Math.exp(-n/B)))*B:n*v;r=e-I,i=s-b,a=o-L}else{const s=E(e),c=e.tile,l=c.extent,u=c.extentInRadians,d=(t-l[0])/(l[2]-l[0]),f=(n-l[1])/(l[3]-l[1]),m=u[0]*(1-d)+u[2]*d,g=s(f),p=Math.cos(g),x=Math.sin(g),h=Math.sin(m),M=Math.cos(m),S=B+o;r=M*p*S-I,i=h*p*S-b,a=x*S-L}switch(s){case 0:N+=r,w+=i,j+=a;break;case 1:D-=r,R-=i,U-=a;break;case 2:N-=r,w-=i,j-=a;break;case 3:D+=r,R+=i,U+=a}},_=i??re,W=S[0],k=S[2],z=S[1],G=S[3],J=[G>_[3],k>_[2],z<_[1],W<_[0]],K=Math.max(W,_[0]),Q=Math.min(k,_[2]),X=Math.max(z,_[1]),Y=Math.min(G,_[3]),Z=e=>Math.max(_[0],Math.min(_[2],e)),ee=e=>Math.max(_[1],Math.min(_[3],e)),te=e=>{const t=o.cornerNeighborCornerTiles;P=0,O=0,T=1,D=0,R=0,U=0,N=0,w=0,j=0;let n=1/0;for(let o=0;o<4;++o){const s=t[4*e+o];n=Math.min(n,s?.level??1/0)}for(let o=0;o<4;++o){const s=t[4*e+o];ie[o]=s?.level===n?s:null}let r=1,i=0;for(let o=0;o<4;++o){const e=ie[o];e&&(r=Math.max(r,e?.renderData.geometryState.numVerticesPerSide),i=e.extent[2]-e.extent[0])}const a=i,c=r;u(c>1);const l=a/c;for(let o=0;o<4;++o){const e=ie[(o+3)%4],t=ie[o%4];if(!e&&!t)continue;const n=0===o?1:1===o?2:2===o?3:0,r=0===o?2:1===o?3:2===o?0:1;if(e&&t){const i=oe[o][0]*l,a=oe[o][1]*l,c=e.extent,u=Z(c[0===n||1===n?2:0]+i),d=ee(c[0===n||3===n?3:1]+a),f=t.extent,m=Z(f[0===r||1===r?2:0]+i),g=ee(f[0===r||3===r?3:1]+a),p=e.renderData,x=t.renderData,h=s(u,d,p.geometryState.samplerData),M=s(m,g,x.geometryState.samplerData);H(p,u,d,.5*(h+M),o)}else{const i=e??t,a=e?n:r,c=i.extent,u=oe[o],d=Z(c[0===a||1===a?2:0]+u[0]*l),f=ee(c[0===a||3===a?3:1]+u[1]*l),m=i.renderData,g=s(d,f,m.geometryState.samplerData);H(m,d,f,g,o)}}if(!V){const e=Math.sqrt(I*I+b*b+L*L);P=I/e,O=b/e,T=L/e}if(V||T*T<.999){const e=Math.sqrt(D*D+R*R+U*U);D/=e,R/=e,U/=e;const t=Math.sqrt(N*N+w*w+j*j);N/=t,w/=t,j/=t,P=U*w-R*j,O=D*j-U*N,T=R*N-D*w;const n=1/Math.sqrt(P*P+O*O+T*T);P*=n,O*=n,T*=n}},ne=o.cornerNeighborCornerTiles;for(let E=0;E<4;++E){const e=E,i=(E+1)%4,h=0===E||1===E?1:0,M=0===E||3===E?1:0,S=t(h,c,d),y=t(M,l,f),v=n.getEdgeFirstVertexIndex(e),V=n.getEdgeCount(e),B=0===E||3===E?V-1:0,C=n.getEdgeFirstVertexIndex(i),D=n.getEdgeCount(i),R=0===E||1===E?D-1:0;let U=-1;for(let t=0;t<4;++t){const e=ne[4*E+t],n=ne[4*E+U];e&&(-1===U||p(n,e)>0)&&(U=t)}const N=U,w=ne[4*E+N];if(w!==x){const e=x.level-w.level,t=2**e,n=[w.lij[0]+e,w.lij[1]*t,w.lij[2]*t],s=[n[1]+t===x.lij[1],0===E&&(1===N||0===N&&w!==ne[4*E+3])||1===E&&(0===N||1===N&&w!==ne[4*E+2]),n[1]===x.lij[1]+1,2===E&&(3===N||2===N&&w!==ne[4*E+1])||3===E&&(2===N||3===N&&w!==ne[4*E+0])],i=s.reduce(((e,t)=>e+(t?1:0)),0);u(1===i||2===i);let a=-1,c=-1;const l=w.renderData;if(1===i){const e=s.findIndex((e=>e));u(0<=e&&e<=3),a=(e+2)%4;const t=o.edgeResolutions[e];c=x.getNeighborEdgeStartVertexIndex(e,w)*t+t*(0===e&&0===E||1===e&&0===E||2===e&&1===E||3===e&&3===E?1:0)}else{u(s[1]||s[3]),a=s[1]?3:1;const e=l.geometryState.edgeResolutions[a];c=0===E||3===E?0:e}const d=l.geometry;{const e=v+B,t=C+R,n=d.getEdgeFirstVertexIndex(a)+c,o=d.vertexAttributes,s=l.localOrigin,i=o.position,u=i.typedBuffer,f=n*i.typedBufferStride,p=u[f]+s[0]-r[0],x=u[f+1]+s[1]-r[1],h=u[f+2]+s[2]-r[2];ue(p,x,h,m);const M=g.position,V=M.typedBuffer,I=e*M.typedBufferStride;V[I]=p,V[I+1]=x,V[I+2]=h;const b=t*M.typedBufferStride;V[b]=p,V[b+1]=x,V[b+2]=h;const L=g.uv0;L.setValues(e,S,y),L.setValues(t,S,y);{const s=o.normalCompressed.typedBuffer,r=n*o.normalCompressed.typedBufferStride,i=g.normalCompressed,a=i.typedBuffer;{const t=e*i.typedBufferStride;a[t]=s[r],a[t+1]=s[r+1]}{const e=t*i.typedBufferStride;a[e]=s[r],a[e+1]=s[r+1]}}}}else{const o=J[e],c=J[i];let l;if(o||c){const e=t(W*(1-h)+k*h,K,Q),n=t(z*(1-M)+G*M,X,Y);l=s(e,n,a)}else l=$(ne,E);A(h,M,l),te(E);const u=I-r[0],d=b-r[1],f=L-r[2];ue(u,d,f,m),n.setEdgeVertexFromValuesRawPositionUVNormal(e,B,u,d,f,S,y,P,O,T),n.setEdgeVertexFromValuesRawPositionUVNormal(i,R,u,d,f,S,y,P,O,T)}}for(let t=0;t<4;++t)ie[t]=null}function $(e,t){const n=4*t,o=l.reduce(((t,o)=>Math.min(t,e[n+o]?.level??1/0)),1/0);d&&(u(!e[n+0]||!e[n+2]||g(e[n+0],e[n+2],i.SOUTH_WEST)),u(!e[n+1]||!e[n+3]||g(e[n+1],e[n+3],i.NORTH_WEST)));let r=0,a=0;for(let i=0;i<4;++i){const t=e[n+i];if(t&&t.level===o){const e=0===i||1===i,n=0===i||3===i,o=t.extent,c=o[e?0:2],l=o[n?1:3],u=t.renderData?.geometryState?.samplerData;a+=s(c,l,u),r++}}const c=r?a/r:0;return u(null!=c),c}function ee(e){const{vao:t,geometry:n}=e,{vertexAttributes:o,edgeVerticesStartIndex:s}=n,r=o.position.typedBuffer;t.vertexBuffers.get("geometry").setSubData(r,s,s,r.length)}function te(e){const{vao:t,geometry:n}=e,{indices:o,indexCount:s,edgeIndicesStartIndex:r}=n;t.indexBuffer.setSubData(o,r,r,s)}class ne{constructor(e,t,n,o,s){this.isNorth=e,this.connectedRowOffset=t,this.connectedOuterEdgeOffset=n,this.rowOffset=o,this.latitudeResolution=s}}const oe=[[0,1],[1,0],[0,-1],[-1,0]],se=new a,re=o(-1/0,-1/0,1/0,1/0),ie=[null,null,null,null];function ae(e,t,n){if(!t)return!1;const o=p(e,t);return o>0||0===o&&n>=2}class ce{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(e){return u(0<=e&&e<this.count),this.vertex0Index+this.stride*e}}const le=[new ce,new ce,new ce,new ce];function ue(e,t,n,o){e<o[0]?o[0]=e:e>o[3]&&(o[3]=e),t<o[1]?o[1]=t:t>o[4]&&(o[4]=t),n<o[2]?o[2]=n:n>o[5]&&(o[5]=n)}function de(e){const{edgeResolutions:t,numVerticesPerSide:n}=e,o=1+Math.max(...t);return Math.max(n,o)}function fe(e,t,n,o,s,r){const i=e*s,a=r[i],c=r[i+1],l=r[i+2],u=t*s,d=r[u],f=r[u+1],m=r[u+2],g=n*s,p=r[g],x=r[g+1],h=r[g+2],M=o*s,S=r[M],y=r[M+1],v=r[M+2];return(d-S)*(d-S)+(f-y)*(f-y)+(m-v)*(m-v)>(a-p)*(a-p)+(c-x)*(c-x)+(l-h)*(l-h)}function me(e,t,n,o,s){e[t]=n,e[t+1]=o,e[t+2]=o,e[t+3]=s,e[t+4]=s,e[t+5]=n}const ge=6;export{O as createPlanarGlobePatch,M as createSphericalGlobePatch,B as updateCornerSpherical,D as updateCornersPlanar,R as updateEdgeElevationsAndResolutionsPlanar,V as updateEdgeElevationsAndResolutionsSpherical,U as updateEdgesAndCornersPlanar,v as updateEdgesAndCornersSpherical};
|
|
5
|
+
import{isPowerOfTwo as e,clamp as t}from"../../../core/mathUtils.js";import{maxUint16 as n}from"../../../core/typedArrayUtil.js";import{empty as o}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as r}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as s}from"./ElevationData.js";import{PatchType as i}from"./interfaces.js";import{NeighborIndex as a}from"./NeighborIndex.js";import{PatchGeometryLUT as c}from"./PatchGeometryLUT.js";import{neighborTileIfLoadedOrSelf as l,zeroToFour as u}from"./PatchRenderData.js";import{internalAssert as d,enableTerrainInternalChecks as f,neighborEdgeIndices as m,almostEquals as g}from"./terrainUtils.js";import{isCornerNeighbor as h}from"./Tile.js";import{compareTilesByLij as p}from"./tileUtils.js";import{compressNormal as x}from"../webgl-engine/lib/Normals.js";const M=65536;function S(e,t){const{tile:n,geometry:r,geometryState:s}=e,{extentInRadians:a,surface:c}=n,{isWebMercator:l,renderer:u}=c,{numVerticesPerSide:d,wireframe:f}=s,m=d-1,g=(d-2)**2,h=l&&(t===i.HAS_SOUTH_POLE||t===i.HAS_BOTH_POLES),p=l&&(t===i.HAS_NORTH_POLE||t===i.HAS_BOTH_POLES),x=((h?1:0)+(p?1:0))*he*d,M=fe(s),S=g+x+4*M,V=u.tileGeometryCache.acquire(S);r.numVerticesPerSide=d,r.vertexAttributes=V,r.maxEdgeVertexCount=M;const{boundingBox:B}=r;o(B);const I=O(e);se.update(m,a,I),v(e),r.poleVerticesStartIndex=g;const L=y(e,h,p);r.edgeVerticesStartIndex=g+x,X(e),b(e),W(r,L,f),e.intersectionData=null}function y(e,t,o){const{tile:r,localOrigin:s,geometry:i}=e,{extent:a,ellipsoid:c}=r,{boundingBox:l,numVerticesPerSide:u,vertexAttributes:d,poleVerticesStartIndex:f}=i,m=u-1,g=s[0],h=s[1],p=s[2],M=c.radius,S=a[1],y=a[3],v=[];let V=f;const B=(e,t)=>{const o=t*u;de(-g,-h,e*M-p,l),v.push(new oe(1===e,o,1===e?0:2,V,he));const r=A(-1===e?S:y,M),s=e*Math.PI/2-r,i=.99*(1===e?1:-1),a=M+0,{position:c,uv0:f}=d,{typedBuffer:B,typedBufferStride:I}=d.normalCompressed;for(let u=1;u<=he;++u){const e=r+s*(u/he),t=Math.cos(e),o=Math.sin(e);for(let r=0;r<=m;r++){const e=r/m,s=se.sinLonLUT[r],u=se.cosLonLUT[r]*t,d=s*t,M=o,S=u*a-g,y=d*a-h,v=M*a-p;de(S,y,v,l),c.setValues(V,S,y,v),f.setValues(V,Math.round(e*n),Math.round(i*n)),x(B,V,u,d,M,I),++V}}};return t&&B(-1,0),o&&B(1,m),v}function v(e){const{tile:t}=e;if(!t.intersectsClippingArea)return;const{geometry:o,geometryState:r,localOrigin:i}=e,{numVerticesPerSide:a,samplerData:c}=r,l=a-2,u=a-1,{vertexAttributes:d,boundingBox:f}=o,{position:m,uv0:g}=d,{typedBuffer:h,typedBufferStride:p}=d.normalCompressed,{extent:M}=t,S=M[0],y=M[2],v=M[1],V=M[3],B=t.ellipsoid.radius,I=i[0],b=i[1],L=i[2],C=m.typedBuffer,A=m.typedBufferStride,P=1/u;let E=0;if(1<=l){const e=P,t=v*(1-e)+V*e,o=se.sinLatLUT[1],r=se.cosLatLUT[1];for(let i=1;i<=l;i++){const a=i*P,l=S*(1-a)+y*a,u=se.sinLonLUT[i],d=se.cosLonLUT[i],m=B+s(l,t,c),h=m*d*r-I,p=m*u*r-b,x=m*o-L;de(h,p,x,f);const M=(i-1)*A;C[M]=h,C[M+1]=p,C[M+2]=x,g.setValues(i-1,Math.round(a*n),Math.round(e*n))}}for(let O=1;O<=l;O++){const e=O*P,t=v*(1-e)+V*e,o=se.sinLatLUT[O],r=se.cosLatLUT[O],i=O+1,a=i*P,d=v*(1-a)+V*a,m=se.sinLatLUT[i],M=se.cosLatLUT[i],T=se.sinLonLUT[0],D=se.cosLonLUT[0],R=B+s(S,t,c);let U=D*r*R-I,N=T*r*R-b,w=o*R-L;const j=E*A;let F=C[j],H=C[j+1],q=C[j+2];for(let V=1;V<=l;V++){const e=V*P,i=S*(1-e)+y*e,T=se.sinLonLUT[V],D=se.cosLonLUT[V];let R=0,j=0,_=0;if(V<l){const e=(E+1)*A;R=C[e],j=C[e+1],_=C[e+2]}else{const e=se.sinLonLUT[u],n=se.cosLonLUT[u],i=B+s(y,t,c);R=n*r*i-I,j=e*r*i-b,_=o*i-L}const W=U,k=N,z=w;U=F,N=H,w=q,F=R,H=j,q=_;const G=R-W,J=j-k,K=_-z;let Q=0,X=0,Y=0;if(O>1){const e=(E-l)*A;Q=C[e],X=C[e+1],Y=C[e+2]}else{const e=se.sinLatLUT[0],t=se.cosLatLUT[0],n=B+s(i,v,c);Q=D*t*n-I,X=T*t*n-b,Y=e*n-L}const Z=B+s(i,d,c),$=D*M*Z-I,ee=T*M*Z-b,te=m*Z-L;if(O<l){const t=E+l,o=t*A;C[o]=$,C[o+1]=ee,C[o+2]=te,de($,ee,te,f),g.setValues(t,Math.round(e*n),Math.round(a*n))}const ne=Q-$,oe=X-ee,re=Y-te;let ie=D*r,ae=T*r,ce=o;ce*ce<.999&&(ie=K*oe-J*re,ae=G*re-K*ne,ce=J*ne-G*oe);const le=1/Math.sqrt(ie*ie+ae*ae+ce*ce);x(h,E,ie*le,ae*le,ce*le,p),++E}}}function V(e){e.tile.intersectsClippingArea&&(b(e),te(e),e.intersectionData=null)}function B(e){e.tile.intersectsClippingArea&&(Y(e),b(e),te(e),ne(e),e.intersectionData=null)}function I(e){e.tile.intersectsClippingArea&&(C(e),L(e,!0),te(e),e.intersectionData=null)}function b(e){e.tile.intersectsClippingArea&&(C(e),L(e))}function L(t,o=!1){const{geometry:r,geometryState:i,tile:a,localOrigin:c}=t,{level:u,extent:h,extentInRadians:x,ellipsoid:M}=a,S=M.radius,y=x[0],v=x[2],V=x[1],B=x[3],{samplerData:I}=i,b=h[0],L=h[2],C=h[1],A=h[3],P=O(t),{boundingBox:E,vertexAttributes:T}=r,D=c[0],R=c[1],U=c[2],{position:N,uv0:w}=T,j=N.typedBuffer,F=N.typedBufferStride;for(let O=0;O<4;++O){const c=1===O||3===O,x=i.edgeResolutions[O];d(e(x));const M=x+1,T=l(a,i.edgePeerNeighbors[O]);if(ce(a,T,O)){Z(t,O,T);continue}const N=null!=T;d(!N||T.level===a.level),d(!N||p(a,T)<=0);const H=T?.renderData,q=H?.geometryState;if(f){const e=a.surface;if(!T&&e&&!e.updatingRootTiles){const t=m[O],n=a.findNeighborTile(t,(e=>e.loaded||e.leaf||e.level===a.level));n?n.intersectsClippingArea&&(d(!n.loaded),d(!n.leaf),d(n.level===u)):d(null==e?.rootTiles||!a.shouldHaveNeighbor(t))}}const _=1===O?h[2]:h[0],W=T?.extent,k=W&&c?1===O?W[0]:W[2]:_,z=0===O?h[3]:h[1],G=1===O?1:0,J=0===O?1:0,K=1===O?v:y,Q=0===O?B:V,X=Math.sin(K),Y=Math.cos(K),$=Math.sin(Q),ee=Math.cos(Q),te=q?.samplerData,ne=N?(e,t,n)=>.5*(s(e,t,I)+s(n,t,te)):(e,t,n)=>s(e,t,I),oe=r.outerEdgesOffsetAndLength[2*O+0],re=o&&M>3?M-3:1,se=null!=I&&I.some((e=>null!=e)),ie=null!=te&&te.some((e=>null!=e)),ae=se||ie,le=1/x,ue=oe;d(!W||g(W[2]-W[0],h[2]-h[0]));(()=>{const e=1===O?-1:3===O?1:0,t=0===O?-1:2===O?1:0,o=(h[2]-h[0])*le,i=e*o,a=t*o,l=c?e*((v-y)*le):0,u=c?0:t*le,d=J,f=c?K+l:K,m=c?Math.sin(f):X,g=c?Math.cos(f):Y,p=c?K-l:K,x=c?Math.sin(p):X,V=c?Math.cos(p):Y,B=c?Q:P(d+u),T=c?$:Math.sin(B),H=c?ee:Math.cos(B),q=c?Q:P(d-u),W=c?$:Math.sin(q),Z=c?ee:Math.cos(q);let oe=0,se=0,ie=0;{const e=0*le,t=c?_:b*(1-e)+L*e,n=c?k:t,o=c?C*(1-e)+A*e:z,r=c?K:y*(1-e)+v*e,s=c?X:Math.sin(r),i=c?Y:Math.cos(r),a=c?P(e):Q,l=c?Math.sin(a):$,u=c?Math.cos(a):ee,d=S+ne(t,o,n);oe=i*u*d,se=s*u*d,ie=l*d}let ce=0,fe=0,me=0;{const e=1*le,t=c?_:b*(1-e)+L*e,n=c?k:t,o=c?C*(1-e)+A*e:z,r=c?K:y*(1-e)+v*e,s=c?X:Math.sin(r),i=c?Y:Math.cos(r),a=c?P(e):Q,l=c?Math.sin(a):$,u=c?Math.cos(a):ee,d=S+ne(t,o,n);ce=i*u*d,fe=s*u*d,me=l*d}for(let h=1;h<M-1;h+=re){let e=0,t=0,o=0;{const n=(h+1)*le,r=c?_:b*(1-n)+L*n,s=c?k:r,i=c?C*(1-n)+A*n:z,a=c?K:y*(1-n)+v*n,l=c?X:Math.sin(a),u=c?Y:Math.cos(a),d=c?P(n):Q,f=c?Math.sin(d):$,m=c?Math.cos(d):ee,g=S+ne(r,i,s);e=u*m*g,t=l*m*g,o=f*g}const l=e,u=t,d=o,f=ce,p=fe,M=me;ce=l,fe=u,me=d;{const e=ue+h,t=e*F,o=f-D,r=p-R,s=M-U;j[t]=o,j[t+1]=r,j[t+2]=s,de(o,r,s,E);const i=h*le,a=c?G:i,l=c?i:J;w.setValues(e,Math.round(a*n),Math.round(l*n))}const B=oe,q=se,re=ie;oe=f,se=p,ie=M;const ge=f,he=p,pe=M,xe=1/Math.sqrt(ge*ge+he*he+pe*pe),Me=pe*xe;let Se=0,ye=0,ve=0;if(ae&&Me*Me<.999){let e=0,t=0,n=0;{const o=0===O?-1:1;e=o*(l-B),t=o*(u-q),n=o*(d-re)}{const o=h*le,r=c?_:b*(1-o)+L*o,l=c?k:r,u=c?C*(1-o)+A*o:z,d=c?K:y*(1-o)+v*o,f=c?X:Math.sin(d),p=c?Y:Math.cos(d),M=c?P(o):Q,B=c?Math.sin(M):$,E=c?Math.cos(M):ee;let D=ge,R=he,U=pe;if(N){const e=S+s(l-i,u-a,te),t=c?E:Z;D=(c?V:p)*t*e,R=(c?x:f)*t*e,U=(c?B:W)*e}{const o=S+s(r+i,u+a,I),l=c?E:H,d=(c?g:p)*l*o,h=(c?m:f)*l*o,x=(c?B:T)*o;N||(D=2*ge-d,R=2*he-h,U=2*pe-x);const M=3===O?-1:1,y=M*(D-d),v=M*(R-h),V=M*(U-x);Se=n*v-t*V,ye=e*V-n*y,ve=t*y-e*v;const b=1/Math.sqrt(Se*Se+ye*ye+ve*ve);Se*=b,ye*=b,ve*=b}}}else Se=ge*xe,ye=he*xe,ve=pe*xe;r.setEdgeNormalFromValues(O,h,Se,ye,ve)}})()}}function C(e){$(e)}function A(e,t){return Math.PI/2-2*Math.atan(Math.exp(-e/t))}function P(e,t,n,o){return A(e*(1-o)+t*o,n)}function E(e,t,n){return e*(1-n)+t*n}function O(e){const{tile:t}=e;if(t.surface.isWebMercator){const e=t.extent,n=t.ellipsoid.radius;return t=>P(e[1],e[3],n,t)}const n=t.extentInRadians;return e=>E(n[1],n[3],e)}function T(e,t){const{tile:n,geometryState:r,geometry:s}=e,{extent:i,surface:a}=n,{wireframe:c}=r,l=i[0],u=i[1],d=i[2]-l,f=i[3]-u,{numVerticesPerSide:m,clippingArea:g}=r,h=null!=g?Math.max(0,(g[0]-l)/d):0,p=null!=g?Math.max(0,(g[1]-u)/f):0,x=null!=g?Math.min(1,(g[2]-l)/d):1,M=null!=g?Math.min(1,(g[3]-u)/f):1,S=(m-2)**2,y=fe(r),v=S+4*y,V=a.renderer.tileGeometryCache.acquire(v),{boundingBox:B}=s;o(B),s.numVerticesPerSide=m,s.vertexAttributes=V,s.maxEdgeVertexCount=y,s.minu=h,s.minv=p,s.maxu=x,s.maxv=M,D(e),s.edgeVerticesStartIndex=S,X(e),w(e),W(s,[],c),e.intersectionData=null}function D(e){const o=e.tile;if(!o.intersectsClippingArea)return;const{geometry:r,geometryState:i,localOrigin:a}=e,{samplerData:c,clippingArea:l,numVerticesPerSide:u}=i,{surface:d,extent:f,ellipsoid:m}=o,{isWebMercatorOnPlateCarree:g}=d,h=null!=l?l:ie,p=f[0],M=f[1],S=f[2],y=f[3],v=Math.max(p,h[0]),V=Math.min(S,h[2]),B=Math.max(M,h[1]),I=Math.min(y,h[3]),b=m.radius,L=o.horizontalScale,C=u-1,A=u-2,{minu:P,minv:E,maxu:O,maxv:T,boundingBox:D,vertexAttributes:R}=r,{position:U,uv0:N}=R,{typedBuffer:w,typedBufferStride:j}=R.normalCompressed,F=a[0],H=a[1],q=a[2],_=U.typedBuffer,W=U.typedBufferStride;let k=0;const z=t(M,B,I),G=g?(Math.PI/2-2*Math.atan(Math.exp(-z/b)))*b:z*L,J=1/C,K=t(M*(1-J)+y*J,B,I);let Q=G,X=g?(Math.PI/2-2*Math.atan(Math.exp(-K/b)))*b:K*L;for(let Y=1;Y<=A;Y++){const e=Y/C,o=t(M*(1-e)+y*e,B,I),r=t(e,E,T),i=X,a=(Y-1)/C,l=t(M*(1-a)+y*a,B,I),u=Q,d=(Y+1)/C,f=t(M*(1-d)+y*d,B,I),m=g?(Math.PI/2-2*Math.atan(Math.exp(-f/b)))*b:f*L,h=t(d,E,T);Q=X,X=m;const R=t(p,v,V);let U=R*L,z=s(R,o,c);const G=1/C,J=t(G,P,O),K=t(p*(1-J)+S*J,v,V);let Z=J,$=K,ee=K*L,te=s(K,o,c);if(1===Y){const e=ee-F,o=Q-H,s=te-q,i=0*W;_[i]=e,_[i+1]=o,_[i+2]=s,de(e,o,s,D);const a=t(G,P,O);N.setValues(k,Math.round(a*n),Math.round(r*n))}for(let g=1;g<=A;g++){const e=ee,a=te,d=(g+1)/C,M=t(d,P,O),y=t(p*(1-d)+S*d,v,V),B=$;$=y;{const e=k+1,t=e*W;if(1===Y||g===A){const a=y*L,l=s(y,o,c);if(1===Y&&g<A){const o=a-F,s=i-H,c=l-q;_[t]=o,_[t+1]=s,_[t+2]=c,de(o,s,c,D),N.setValues(e,Math.round(M*n),Math.round(r*n))}ee=a,te=l}else ee=_[t]+F,te=_[t+2]+q}const I=ee,b=te,E=U,T=z;U=e,z=a;const R=(k-A)*W,G=1===Y?s(B,l,c):_[R+2]+q,J=s(B,f,c);if(Y<A){const t=k+A,o=t*W,r=e-F,s=m-H,i=J-q;_[o]=r,_[o+1]=s,_[o+2]=i,de(r,s,i,D);const a=Z;Z=M,N.setValues(t,Math.round(a*n),Math.round(h*n))}{const e=I-E,t=u-m,n=t*(b-T),o=e*(G-J),r=-t*e,s=n*n+o*o+r*r;if(0===s)x(w,k,0,0,1,j);else{const e=1/Math.sqrt(s);x(w,k,n*e,o*e,r*e,j)}}++k}}}function R(e,t){e.tile.intersectsClippingArea&&(F(e),j(e,!0),te(e),e.intersectionData=null)}function U(e,t){e.tile.intersectsClippingArea&&(Y(e),w(e),te(e),ne(e),e.intersectionData=null)}function N(e,t){e.tile.intersectsClippingArea&&(w(e),te(e),e.intersectionData=null)}function w(e,t){e.tile.intersectsClippingArea&&(F(e),j(e,!1))}function j(n,o){const{geometry:r,geometryState:i,localOrigin:a}=n,c=n.tile,{surface:u,extent:g}=c,{clippingArea:h,samplerData:x}=i,M=null!=h?h:ie,S=g[0],y=g[2],v=g[1],V=g[3],B=[V>M[3],y>M[2],v<M[1],S<M[0]],I=c.horizontalScale,b=_(u.isWebMercatorOnPlateCarree,c.ellipsoid.radius,I),{minu:L,minv:C,maxu:A,maxv:P,boundingBox:E}=r,O=Math.max(S,M[0]),T=Math.min(y,M[2]),D=Math.max(v,M[1]),R=Math.min(V,M[3]),U=a[0],N=a[1],w=a[2];for(let j=0;j<4;++j){const a=1===j||3===j,g=i.edgeResolutions[j];d(e(g));const h=g+1,M=B[j],F=l(c,i.edgePeerNeighbors[j]);if(!M&&ce(c,F,j)){Z(n,j,F);continue}const H=null!=F&&!M,q=F?.renderData,_=q?.geometryState;if(f&&(d(!H||F.level===c.level),d(!H||p(c,F)<=0),c&&!F&&!u.updatingRootTiles)){const e=m[j],t=c.findNeighborTile(e,(e=>e.loaded||e.leaf||e.level===c.level));u.updatingRootTiles||(t?t.intersectsClippingArea&&(d(!t.loaded),d(!t.leaf),d(t.level===c.level)):d(null==u?.rootTiles||!c.shouldHaveNeighbor(e)))}const W=t(1===j?y:S,O,T),k=t(0===j?V:v,D,R),z=_?.samplerData,G=o&&h>3?h-3:1,J=t(1===j?1:0,L,A),K=t(0===j?1:0,C,P),Q=H?(e,t)=>.5*(s(e,t,z)+s(e,t,x)):(e,t)=>s(e,t,x),X=(y-S)/g,Y=a?1===j?X:-X:0,$=a?0:0===j?X:-X,ee=-Y,te=-$;let ne=0,oe=0,re=0;{const e=0/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,r=Q(n,o);ne=n*I,oe=b(o),re=r}let se=0,ie=0,ae=0;{const e=1/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,r=Q(n,o);se=n*I,ie=b(o),ae=r}for(let e=1;e<h-1;e+=G){const n=e/g,o=se,i=ie,c=ae;{const s=a?J:t(n,L,A),l=a?t(n,C,P):K,u=o-U,d=i-N,f=c-w;de(o,d,f,E),r.setEdgeVertexFromValuesRawPositionUV(j,e,u,d,f,s,l)}{const n=(e+1)/g,o=a?W:t(S*(1-n)+y*n,O,T),r=a?t(v*(1-n)+V*n,D,R):k,s=Q(o,r);se=o*I,ie=b(r),ae=s}const l=se,u=ae,d=ne,f=oe,m=re;ne=o,oe=i,re=c;let h=0,p=0,M=0;if(a){const e=ie-i,r=u-c,a=f-i,l=m-c,d=t(v*(1-n)+V*n,D,R),g=W+ee,S=g*I-o,y=s(g,d,x)-c,B=3===j?-1:1;if(h=B*(-a+e)*y,p=B*S*(-l+r),M=-B*S*(-a+e),H){const t=W+Y,n=t*I-o;h=(-a+e)*(y-(s(t,d,z)-c)),p=(S-n)*(-l+r),M=-(S-n)*(-a+e)}}else{const e=l-o,r=u-c,a=d-o,f=m-c,g=t(S*(1-n)+y*n,O,T),v=k+te,V=s(g,v,x)-c,B=b(v)-i,I=2===j?-1:1;if(h=I*B*(-f+r),p=I*(-a+e)*V,M=-I*B*(-a+e),H){const t=g,n=k+$,o=b(n)-i;h=(-B+o)*(-f+r),p=(-a+e)*(-V+(s(t,n,z)-c)),M=-(-B+o)*(-a+e)}}const B=1/Math.sqrt(h*h+p*p+M*M);r.setEdgeNormalFromValues(j,e,h*B,p*B,M*B)}}}function F(e,t){$(e)}function H(e,t){return(Math.PI/2-2*Math.atan(Math.exp(-e/t)))*t}function q(e,t){return e*t}function _(e,t,n){return e?e=>H(e,t):e=>q(e,n)}function W(e,t,n){const{numVerticesPerSide:o,vertexAttributes:r,maxEdgeVertexCount:s}=e,i=o-1,a=r.count,c=2*(o-3)*(o-3),l=4*(i+s-3),d=u.reduce(((t,n)=>t+(i+e.getEdgeCount(n)-3)),0),f=t.reduce(((e,t)=>e+i*(2*(t.latitudeResolution-1)+1)),0),m=3*(n?2:1),g=(c+l+f)*m,h=a>=M?new Uint32Array(g):new Uint16Array(g);for(let u=0;u<g;++u)h[u]=0;e.indices=h,e.indexCount=(c+d+f)*m,e.poleIndicesStartIndex=c*m,e.edgeIndicesStartIndex=(c+f)*m,n?(J(e),K(e,t),Q(e)):(k(e),z(e,t),G(e))}function k(e){const{numVerticesPerSide:t,indices:n,vertexAttributes:o}=e,{position:r}=o,{typedBuffer:s,typedBufferStride:i}=r,a=t-2,c=t-3,l=0,u=t-3;let d=0;for(let f=0;f<c;++f){const e=f*a;for(let t=l;t<u;++t){const o=e+t,r=o+1,c=r+a,l=c-1;me(o,r,c,l,i,s)?(n[d]=o,n[d+1]=r,n[d+2]=c,n[d+3]=c,n[d+4]=l,n[d+5]=o):(n[d]=o,n[d+1]=r,n[d+2]=l,n[d+3]=l,n[d+4]=r,n[d+5]=c),d+=6}}}function z(e,t){const{numVerticesPerSide:n,indices:o,poleIndicesStartIndex:r}=e,s=n-1;let i=r;for(const a of t){const t=a.isNorth?1:2,r=a.isNorth?2:1,c=a.isNorth?3:4,l=a.isNorth?4:3;let u=e.getEdgeVertexIndex(a.connectedOuterEdgeOffset,0),d=1;for(let e=0;e<a.latitudeResolution;++e){const f=0===e?a.rowOffset:u+n;for(let n=0;n<s;n++){const s=f+n;o[i]=u,o[i+t]=u+1,o[i+r]=s,e<a.latitudeResolution-1?(o[i+c]=u+1,o[i+l]=s+1,o[i+5]=s,i+=6):i+=3,u+=d}u=f,d=1}}}function G(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,r=n-1,s=r-2;let i=o;for(let a=0;a<4;++a){const n=ue[a];let o=0,c=0;const l=e.getEdgeCount(a),u=n.count;d(u===r-1);const f=1===a||2===a,m=f?1:2,g=f?2:1,h=e.getEdgeFirstVertexIndex(a),p=1,x=n.vertex0Index,M=n.stride;for(;o<l-1||c<u-1;){const e=x+c*M,n=h+o*p,a=o<l-1,d=c<u-1,f=a&&(!d||(a?0+r*(o+.5)/(l-1):0)<=(d?1+s*(c+.5)/(u-1):0));f?++o:++c;const S=f?n+p:e+M;t[i]=e,t[i+m]=n,t[i+g]=S,i+=3}}e.indexCount=i}function J(e){const{indices:t,numVerticesPerSide:n,vertexAttributes:o}=e,{position:r}=o,{typedBuffer:s,typedBufferStride:i}=r,a=n-2;let c=0;for(let l=0;l<n-3;++l){const e=l*a;for(let o=0;o<n-3;++o){const n=l*a+o,r=n+1,u=r+a,d=u-1,f=e+o,m=f+1,g=m+a;me(f,m,g,g-1,i,s)?(ge(t,c,n,r,u),c+=6,ge(t,c,u,d,n)):(ge(t,c,n,r,d),c+=6,ge(t,c,d,u,r)),c+=6}}}function K(e,t){const{indices:n,numVerticesPerSide:o,poleIndicesStartIndex:r}=e,s=o-1;let i=r;for(const a of t){const t=a.connectedOuterEdgeOffset;let r=e.getEdgeVertexIndex(t,0),c=1;for(let e=0;e<a.latitudeResolution;++e){const t=0===e?a.rowOffset:r+o;for(let o=0;o<s;o++)ge(n,i,r,r+1,t+o),i+=6,e<a.latitudeResolution-1&&(ge(n,i,r+1,t+o+1,t+o),i+=6),r+=c;r=t,c=1}}}function Q(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,r=n-1,s=r-2;let i=o;for(let a=0;a<4;++a){const n=ue[a];let o=0,c=0;const l=e.getEdgeCount(a),u=n.count;d(u===r-1);const f=1===a||2===a,m=f?1:3,g=f?3:1,h=e.getEdgeFirstVertexIndex(a),p=1,x=n.vertex0Index,M=n.stride;for(;o<l-1||c<u-1;){const e=x+c*M,n=h+o*p,a=o<l-1,d=c<u-1,f=a&&(!d||(a?0+r*(o+.5)/(l-1):0)<=(d?1+s*(c+.5)/(u-1):0));f?++o:++c;const S=f?n+p:e+M;t[i]=e,t[i+m]=n,t[i+m+1]=n,t[i+g]=S,t[i+g+1]=S,t[i+5]=e,i+=6}}e.indexCount=i}function X(e){const{geometry:t,geometryState:n}=e,{edgeResolutions:o}=n,{numVerticesPerSide:r,edgeVerticesStartIndex:s}=t,i=r-2;let a=s;for(let c=0;c<4;++c){{const e=0===c||2===c,t=(0===c?i-1:0)*i+(1===c?i-1:0),n=(e?0:1)*i+(e?1:0),o=ue[c];o.vertex0Index=t,o.stride=n,o.count=i}{const e=o[c]+1;t.outerEdgesOffsetAndLength[2*c+0]=a,t.outerEdgesOffsetAndLength[2*c+1]=e,a+=e}}}function Y(e){X(e),e.geometryState.wireframe?Q(e.geometry):G(e.geometry)}function Z(o,r,s){const{geometryState:i,geometry:a,tile:c,localOrigin:l}=o,u=1===r||3===r,f=i.edgeResolutions[r];d(e(f));const m=f+1,{boundingBox:g,minu:h,minv:p,maxu:x,maxv:M,vertexAttributes:S}=a,y=t(1===r?1:0,h,x),v=t(0===r?1:0,p,M),V=s.renderData,B=V.geometryState,I=V.geometry,b=(r+2)%4,L=I.getEdgeCount(b),C=c.getNeighborEdgeStartVertexIndex(r,s)*f,A=f*2**(c.level-s.level);d(B.edgeResolutions[b]===A),d(L-1===A);const P=V.localOrigin[0]-l[0],E=V.localOrigin[1]-l[1],O=V.localOrigin[2]-l[2],T=a.getEdgeFirstVertexIndex(r),{position:D,uv0:R}=S,U=D.typedBuffer,N=D.typedBufferStride,w=S.normalCompressed,j=w.typedBuffer,F=w.typedBufferStride,H=I.vertexAttributes,q=I.getEdgeFirstVertexIndex(b),_=H.position.typedBuffer,W=H.position.typedBufferStride,k=H.normalCompressed.typedBuffer,z=H.normalCompressed.typedBufferStride;for(let e=1;e<m-1;++e){const o=T+e,r=q+(C+e),s=o*N,i=r*W,a=_[i]+P,c=_[i+1]+E,l=_[i+2]+O;U[s]=a,U[s+1]=c,U[s+2]=l,de(a,c,l,g);const d=o*F,m=r*z;j[d]=k[m],j[d+1]=k[m+1];const S=e/f,V=u?y:t(S,h,x),B=u?t(S,p,M):v;R.setValues(o,Math.round(V*n),Math.round(B*n))}}function $(e){const{geometry:o,geometryState:r,localOrigin:i}=e,{clippingArea:a,samplerData:c}=r,{minu:l,minv:u,maxu:f,maxv:m,boundingBox:g,vertexAttributes:h}=o,x=e.tile,{surface:M,ellipsoid:S,extent:y,extentInRadians:v,horizontalScale:V}=x,B="local"===M.view?.viewingMode,I=S.radius;let b=0,L=0,C=0;const A=(e,t,n)=>{const o=v[0===t?1:3],r=v[0===e?0:2],s=Math.cos(o),i=Math.sin(o),a=Math.sin(r),c=Math.cos(r),l=I+n;b=c*s*l,L=a*s*l,C=i*l},P=B?(()=>{const e=a,n=null!=e&&(y[3]>e[3]||y[2]>e[2]||y[1]<e[1]||y[0]<e[0]),o=_(M.isWebMercatorOnPlateCarree,I,V);return(r,s,i)=>{const a=0===r?y[0]:y[2],c=0===s?y[1]:y[3],l=n?t(a,e[0],e[2]):a,u=n?t(c,e[1],e[3]):c,d=i;b=l*V,L=o(u),C=d}})():A;let E=0,T=0,D=0,R=0,U=0,N=0,w=0,j=0,F=0;const H=B&&M.isWebMercatorOnPlateCarree,q=(e,t,n,o,r)=>{let s=0,i=0,a=0;if(B){const e=t*V,r=H?(Math.PI/2-2*Math.atan(Math.exp(-n/I)))*I:n*V;s=e-b,i=r-L,a=o-C}else{const r=O(e),c=e.tile,l=c.extent,u=c.extentInRadians,d=(t-l[0])/(l[2]-l[0]),f=(n-l[1])/(l[3]-l[1]),m=u[0]*(1-d)+u[2]*d,g=r(f),h=Math.cos(g),p=Math.sin(g),x=Math.sin(m),M=Math.cos(m),S=I+o;s=M*h*S-b,i=x*h*S-L,a=p*S-C}switch(r){case 0:w+=s,j+=i,F+=a;break;case 1:R-=s,U-=i,N-=a;break;case 2:w-=s,j-=i,F-=a;break;case 3:R+=s,U+=i,N+=a}},W=a??ie,k=y[0],z=y[2],G=y[1],J=y[3],K=[J>W[3],z>W[2],G<W[1],k<W[0]],Q=Math.max(k,W[0]),X=Math.min(z,W[2]),Y=Math.max(G,W[1]),Z=Math.min(J,W[3]),$=e=>Math.max(W[0],Math.min(W[2],e)),te=e=>Math.max(W[1],Math.min(W[3],e)),ne=e=>{const t=r.cornerNeighborCornerTiles;E=0,T=0,D=1,R=0,U=0,N=0,w=0,j=0,F=0;let n=1/0;for(let r=0;r<4;++r){const o=t[4*e+r];n=Math.min(n,o?.level??1/0)}for(let r=0;r<4;++r){const o=t[4*e+r];ae[r]=o?.level===n?o:null}let o=1,i=0;for(let r=0;r<4;++r){const e=ae[r];e&&(o=Math.max(o,e?.renderData.geometryState.numVerticesPerSide),i=e.extent[2]-e.extent[0])}const a=i,c=o;d(c>1);const l=a/c;for(let r=0;r<4;++r){const e=ae[(r+3)%4],t=ae[r%4];if(!e&&!t)continue;const n=0===r?1:1===r?2:2===r?3:0,o=0===r?2:1===r?3:2===r?0:1;if(e&&t){const i=re[r][0]*l,a=re[r][1]*l,c=e.extent,u=$(c[0===n||1===n?2:0]+i),d=te(c[0===n||3===n?3:1]+a),f=t.extent,m=$(f[0===o||1===o?2:0]+i),g=te(f[0===o||3===o?3:1]+a),h=e.renderData,p=t.renderData,x=s(u,d,h.geometryState.samplerData),M=s(m,g,p.geometryState.samplerData);q(h,u,d,.5*(x+M),r)}else{const i=e??t,a=e?n:o,c=i.extent,u=re[r],d=$(c[0===a||1===a?2:0]+u[0]*l),f=te(c[0===a||3===a?3:1]+u[1]*l),m=i.renderData,g=s(d,f,m.geometryState.samplerData);q(m,d,f,g,r)}}if(!B){const e=Math.sqrt(b*b+L*L+C*C);E=b/e,T=L/e,D=C/e}if(B||D*D<.999){const e=Math.sqrt(R*R+U*U+N*N);R/=e,U/=e,N/=e;const t=Math.sqrt(w*w+j*j+F*F);w/=t,j/=t,F/=t,E=N*j-U*F,T=R*F-N*w,D=U*w-R*j;const n=1/Math.sqrt(E*E+T*T+D*D);E*=n,T*=n,D*=n}},oe=r.cornerNeighborCornerTiles;for(let O=0;O<4;++O){const e=O,a=(O+1)%4,M=0===O||1===O?1:0,S=0===O||3===O?1:0,y=t(M,l,f),v=t(S,u,m),V=o.getEdgeFirstVertexIndex(e),B=o.getEdgeCount(e),I=0===O||3===O?B-1:0,A=o.getEdgeFirstVertexIndex(a),R=o.getEdgeCount(a),U=0===O||1===O?R-1:0;let N=-1;for(let t=0;t<4;++t){const e=oe[4*O+t],n=oe[4*O+N];e&&(-1===N||p(n,e)>0)&&(N=t)}const w=N,j=oe[4*O+w];if(j!==x){const e=x.level-j.level,t=2**e,o=[j.lij[0]+e,j.lij[1]*t,j.lij[2]*t],s=[o[1]+t===x.lij[1],0===O&&(1===w||0===w&&j!==oe[4*O+3])||1===O&&(0===w||1===w&&j!==oe[4*O+2]),o[1]===x.lij[1]+1,2===O&&(3===w||2===w&&j!==oe[4*O+1])||3===O&&(2===w||3===w&&j!==oe[4*O+0])],a=s.reduce(((e,t)=>e+(t?1:0)),0);d(1===a||2===a);let c=-1,l=-1;const u=j.renderData;if(1===a){const e=s.findIndex((e=>e));d(0<=e&&e<=3),c=(e+2)%4;const t=r.edgeResolutions[e];l=x.getNeighborEdgeStartVertexIndex(e,j)*t+t*(0===e&&0===O||1===e&&0===O||2===e&&1===O||3===e&&3===O?1:0)}else{d(s[1]||s[3]),c=s[1]?3:1;const e=u.geometryState.edgeResolutions[c];l=0===O||3===O?0:e}const f=u.geometry;{const e=V+I,t=A+U,o=f.getEdgeFirstVertexIndex(c)+l,r=f.vertexAttributes,s=u.localOrigin,a=r.position,d=a.typedBuffer,m=o*a.typedBufferStride,p=d[m]+s[0]-i[0],x=d[m+1]+s[1]-i[1],M=d[m+2]+s[2]-i[2];de(p,x,M,g);const S=h.position,B=S.typedBuffer,b=e*S.typedBufferStride;B[b]=p,B[b+1]=x,B[b+2]=M;const L=t*S.typedBufferStride;B[L]=p,B[L+1]=x,B[L+2]=M;const C=h.uv0;C.setValues(e,Math.round(y*n),Math.round(v*n)),C.setValues(t,Math.round(y*n),Math.round(v*n));{const n=r.normalCompressed.typedBuffer,s=o*r.normalCompressed.typedBufferStride,i=h.normalCompressed,a=i.typedBuffer;{const t=e*i.typedBufferStride;a[t]=n[s],a[t+1]=n[s+1]}{const e=t*i.typedBufferStride;a[e]=n[s],a[e+1]=n[s+1]}}}}else{const n=K[e],r=K[a];let l;if(n||r){const e=t(k*(1-M)+z*M,Q,X),n=t(G*(1-S)+J*S,Y,Z);l=s(e,n,c)}else l=ee(oe,O);P(M,S,l),ne(O);const u=b-i[0],d=L-i[1],f=C-i[2];de(u,d,f,g),o.setEdgeVertexFromValuesRawPositionUVNormal(e,I,u,d,f,y,v,E,T,D),o.setEdgeVertexFromValuesRawPositionUVNormal(a,U,u,d,f,y,v,E,T,D)}}for(let t=0;t<4;++t)ae[t]=null}function ee(e,t){const n=4*t,o=u.reduce(((t,o)=>Math.min(t,e[n+o]?.level??1/0)),1/0);f&&(d(!e[n+0]||!e[n+2]||h(e[n+0],e[n+2],a.SOUTH_WEST)),d(!e[n+1]||!e[n+3]||h(e[n+1],e[n+3],a.NORTH_WEST)));let r=0,i=0;for(let a=0;a<4;++a){const t=e[n+a];if(t&&t.level===o){const e=0===a||1===a,n=0===a||3===a,o=t.extent,c=o[e?0:2],l=o[n?1:3],u=t.renderData?.geometryState?.samplerData;i+=s(c,l,u),r++}}const c=r?i/r:0;return d(null!=c),c}function te(e){const{vao:t,geometry:n}=e,{vertexAttributes:o,edgeVerticesStartIndex:r}=n,s=o.position.typedBuffer;t.vertexBuffers.get("geometry").setSubData(s,r,r,s.length)}function ne(e){const{vao:t,geometry:n}=e,{indices:o,indexCount:r,edgeIndicesStartIndex:s}=n;t.indexBuffer.setSubData(o,s,s,r)}class oe{constructor(e,t,n,o,r){this.isNorth=e,this.connectedRowOffset=t,this.connectedOuterEdgeOffset=n,this.rowOffset=o,this.latitudeResolution=r}}const re=[[0,1],[1,0],[0,-1],[-1,0]],se=new c,ie=r(-1/0,-1/0,1/0,1/0),ae=[null,null,null,null];function ce(e,t,n){if(!t)return!1;const o=p(e,t);return o>0||0===o&&n>=2}class le{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(e){return d(0<=e&&e<this.count),this.vertex0Index+this.stride*e}}const ue=[new le,new le,new le,new le];function de(e,t,n,o){e<o[0]?o[0]=e:e>o[3]&&(o[3]=e),t<o[1]?o[1]=t:t>o[4]&&(o[4]=t),n<o[2]?o[2]=n:n>o[5]&&(o[5]=n)}function fe(e){const{edgeResolutions:t,numVerticesPerSide:n}=e,o=1+Math.max(...t);return Math.max(n,o)}function me(e,t,n,o,r,s){const i=e*r,a=s[i],c=s[i+1],l=s[i+2],u=t*r,d=s[u],f=s[u+1],m=s[u+2],g=n*r,h=s[g],p=s[g+1],x=s[g+2],M=o*r,S=s[M],y=s[M+1],v=s[M+2];return(d-S)*(d-S)+(f-y)*(f-y)+(m-v)*(m-v)>(a-h)*(a-h)+(c-p)*(c-p)+(l-x)*(l-x)}function ge(e,t,n,o,r){e[t]=n,e[t+1]=o,e[t+2]=o,e[t+3]=r,e[t+4]=r,e[t+5]=n}const he=6;export{T as createPlanarGlobePatch,S as createSphericalGlobePatch,I as updateCornerSpherical,R as updateCornersPlanar,U as updateEdgeElevationsAndResolutionsPlanar,B as updateEdgeElevationsAndResolutionsSpherical,N as updateEdgesAndCornersPlanar,V as updateEdgesAndCornersSpherical};
|
|
@@ -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 r}from"../webgl-engine/lib/VertexAttribute.js";const t=e().vec3f(r.POSITION).
|
|
5
|
+
import{newLayout as e}from"../support/buffer/InterleavedLayout.js";import{VertexAttribute as r}from"../webgl-engine/lib/VertexAttribute.js";const t=e().vec3f(r.POSITION).vec2u16(r.UV0,{glNormalized:!0}).vec2i16(r.NORMALCOMPRESSED,{glNormalized:!0});export{t as terrainAttributesLayout};
|
|
@@ -2,8 +2,8 @@
|
|
|
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 e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as
|
|
6
|
-
return
|
|
5
|
+
import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as i}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as r}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as v}from"../../shaderModules/FloatsPassUniform.js";import{glsl as l}from"../../shaderModules/glsl.js";import{VertexAttribute as s}from"../../../lib/VertexAttribute.js";import{vvColorNumber as c,VisualVariablePassParameters as p}from"../../../materials/VisualVariablePassParameters.js";const f=8;function n(e,p){e.attributes.add(s.POSITION,"vec3"),e.attributes.add(s.FEATUREVALUE,"vec3"),e.attributes.add(s.PROFILEVERTEXANDNORMAL,"vec4"),e.attributes.add(s.PROFILEAUXDATA,"vec3"),e.attributes.add(s.PROFILERIGHT,"vec2"),e.attributes.add(s.PROFILEUP,"vec2");const n=e.vertex;n.code.add(l`bool isCapVertex() {
|
|
6
|
+
return profileAuxData.z == 1.0;
|
|
7
7
|
}`),n.uniforms.add(new o("size",(e=>e.size))),p.vvSize?(n.uniforms.add(new a("vvSizeMinSize",(e=>e.vvSize.minSize)),new a("vvSizeMaxSize",(e=>e.vvSize.maxSize)),new a("vvSizeOffset",(e=>e.vvSize.offset)),new a("vvSizeFactor",(e=>e.vvSize.factor)),new a("vvSizeFallback",(e=>e.vvSize.fallback))),n.code.add(l`vec2 getSize() {
|
|
8
8
|
float value = featureValue.x;
|
|
9
9
|
if (isnan(value)) {
|
|
@@ -29,7 +29,7 @@ return vec4( color.xyz, mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f));
|
|
|
29
29
|
return vec4( color.xyz, vvOpacityOpacities[vvOpacityNumber - 1]);
|
|
30
30
|
}`)):n.code.add(l`vec4 applyOpacity(vec4 color){
|
|
31
31
|
return color;
|
|
32
|
-
}`),p.vvColor?(n.constants.add("vvColorNumber","int",c),n.uniforms.add(new v("vvColorValues",(e=>e.vvColor.values),c),new
|
|
32
|
+
}`),p.vvColor?(n.constants.add("vvColorNumber","int",c),n.uniforms.add(new v("vvColorValues",(e=>e.vvColor.values),c),new r("vvColorColors",(e=>e.vvColor.colors),c),new i("vvColorFallback",(e=>e.vvColor.fallback))),n.code.add(l`vec4 getColor() {
|
|
33
33
|
float value = featureValue.y;
|
|
34
34
|
if (isnan(value)) {
|
|
35
35
|
return applyOpacity(vvColorFallback);
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../core/Logger.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{Default3D as t}from"../../lib/DefaultVertexAttributeLocations.js";import{Program as r}from"../../lib/Program.js";import{PrimitiveType as o}from"../../../../webgl/enums.js";import{makePipelineState as s,
|
|
5
|
+
import e from"../../../../../core/Logger.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{Default3D as t}from"../../lib/DefaultVertexAttributeLocations.js";import{Program as r}from"../../lib/Program.js";import{PrimitiveType as o}from"../../../../webgl/enums.js";import{makePipelineState as s,premultipliedAlpha as n,defaultColorWrite as a}from"../../../../webgl/renderState.js";const p=()=>e.getLogger("esri.views.3d.webgl.ShaderTechnique");class l{constructor(e,s,n,a=t){this.locations=a,this.primitiveType=o.TRIANGLES,this.key=s.key,this._program=new r(e.rctx,n.get().build(s),a),this._pipeline=this.initializePipeline(s),this.reload=async t=>{t&&await n.reload(),this.key.equals(s.key)||p().warn("Configuration was changed after construction, cannot reload shader.",n),i(this._program),this._program=new r(e.rctx,n.get().build(s),a),this._pipeline=this.initializePipeline(s)}}destroy(){this._program=i(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,i){return this._pipeline}initializePipeline(e){return s({blending:n,colorWrite:a})}}export{l as ShaderTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Accessor.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";const t={required:[]},s={required:[r.Depth]};class n extends e{precompile(e){return!!this.acquireTechniques(e)}consumes(){return t}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}modify(e){}get numGeometries(){return 0}get hasOccludees(){return!1}get hasEmissions(){return!1}forEachGeometry(e){}queryRenderOccludedState(e){return!1}}class u extends n{}class o extends n{}export{o as AsyncRenderPlugin,s as ConsumesDepth,t as ConsumesNone,u as SyncRenderPlugin};
|
|
5
|
+
import e from"../../../../core/Accessor.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";const t={required:[]},s={required:[r.Depth]};class n extends e{precompile(e){return!!this.acquireTechniques(e)}consumes(){return t}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}modify(e,r){}get numGeometries(){return 0}get hasOccludees(){return!1}get hasEmissions(){return!1}forEachGeometry(e){}queryRenderOccludedState(e){return!1}}class u extends n{}class o extends n{}export{o as AsyncRenderPlugin,s as ConsumesDepth,t as ConsumesNone,u as SyncRenderPlugin};
|
|
@@ -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{ChapmanApproximationParameters as e}from"../../../environment/ChapmanApproximation.glsl.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as s}from"../../../../../chunks/Haze.glsl.js";import{CompareFunction as t,BlendFactor as n}from"../../../../webgl/enums.js";import{makePipelineState as i,
|
|
5
|
+
import{ChapmanApproximationParameters as e}from"../../../environment/ChapmanApproximation.glsl.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as s}from"../../../../../chunks/Haze.glsl.js";import{CompareFunction as t,BlendFactor as n}from"../../../../webgl/enums.js";import{makePipelineState as i,copySource as l,defaultColorWrite as a,separateBlendingParams as m}from"../../../../webgl/renderState.js";class c extends e{constructor(){super(...arguments),this.hazeStrength=1}}class p extends o{constructor(e,o){super(e,o,new r(s,(()=>import("./Haze.glsl.js"))))}initializePipeline(e){return e.reduced?i({blending:l,depthTest:{func:t.ALWAYS},colorWrite:a}):i({blending:m(n.ONE,n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ONE),colorWrite:a})}}export{c as HazePassParameters,p as HazeTechnique};
|
|
@@ -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{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as i}from"../../../../../chunks/HighlightApply.glsl.js";import{makePipelineState as o,
|
|
5
|
+
import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as i}from"../../../../../chunks/HighlightApply.glsl.js";import{makePipelineState as o,unpremultipliedAlphaToPremultipliedAlpha as s,defaultColorWrite as l}from"../../../../webgl/renderState.js";class t extends r{constructor(r,o){super(r,o,new e(i,(()=>import("../../shaders/HighlightApply.glsl.js"))))}initializePipeline(){return o({blending:s,colorWrite:l})}}export{t as HighlightApplyTechnique};
|
|
@@ -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 e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReadShadowMapPassParameters as r}from"../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{ReloadableShaderModule as i}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as s}from"../../../../../chunks/ShadowHighlight.glsl.js";import{PrimitiveType as t}from"../../../../webgl/enums.js";import{makePipelineState as a,
|
|
5
|
+
import{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReadShadowMapPassParameters as r}from"../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{ReloadableShaderModule as i}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as s}from"../../../../../chunks/ShadowHighlight.glsl.js";import{PrimitiveType as t}from"../../../../webgl/enums.js";import{makePipelineState as a,unpremultipliedAlphaToPremultipliedAlpha as h,defaultColorWrite as l}from"../../../../webgl/renderState.js";class d extends r{constructor(){super(...arguments),this.shadowColor=e(1,0,1,1),this.shadowOpacity=.2,this.occludedShadowOpacity=.1,this.opacityElevation=1,this.dayNightTerminator=1}}class c extends o{constructor(e,r){super(e,r,new i(s,(()=>import("../../shaders/ShadowHighlight.glsl.js")))),this.primitiveType=t.TRIANGLE_STRIP}initializePipeline(){return a({blending:h,colorWrite:l,depthTest:null,depthWrite:null})}}export{d as ShadowHighlightPassParameters,c as ShadowHighlightTechnique};
|
|
@@ -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{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/Magnifier.glsl.js";import{makePipelineState as s,
|
|
5
|
+
import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/Magnifier.glsl.js";import{makePipelineState as s,premultipliedAlpha as o,defaultColorWrite as t}from"../../../../webgl/renderState.js";class l extends r{constructor(r,s){super(r,s,new e(i,(()=>import("../../shaders/Magnifier.glsl.js"))))}initializePipeline(){return s({blending:o,depthTest:null,depthWrite:null,colorWrite:t})}}export{l as MagnifierTechnique};
|
|
@@ -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{create as e}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as o}from"../../../../../chunks/Stars.glsl.js";import{CompareFunction as t}from"../../../../webgl/enums.js";import{NoParameters as i}from"../../../../webgl/NoParameters.js";import{makePipelineState as m,
|
|
5
|
+
import{create as e}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as o}from"../../../../../chunks/Stars.glsl.js";import{CompareFunction as t}from"../../../../webgl/enums.js";import{NoParameters as i}from"../../../../webgl/NoParameters.js";import{makePipelineState as m,unpremultipliedAlphaToPremultipliedAlpha as a,defaultColorWrite as l}from"../../../../webgl/renderState.js";class n extends i{constructor(){super(...arguments),this.modelMatrix=e()}}class c extends s{constructor(e,s){super(e,s,new r(o,(()=>import("./Stars.glsl.js"))))}initializePipeline(){return m({blending:a,depthTest:{func:t.LEQUAL},colorWrite:l})}}export{n as StarPassParameters,c as StarsTechnique};
|
|
@@ -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{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../../chunks/OITBlend.glsl.js";import{ColorAttachment0 as o,ColorAttachment1 as i}from"../../../../webgl/enums.js";import{makePipelineState as n,
|
|
5
|
+
import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../../chunks/OITBlend.glsl.js";import{ColorAttachment0 as o,ColorAttachment1 as i}from"../../../../webgl/enums.js";import{makePipelineState as n,unpremultipliedAlphaToPremultipliedAlpha as l,defaultColorWrite as t}from"../../../../webgl/renderState.js";class a extends r{constructor(r,o){super(r,o,new e(s,(()=>import("./OITBlend.glsl.js"))))}initializePipeline(e){return n({blending:l,colorWrite:t,drawBuffers:e.hasEmission?{buffers:[o,i]}:{buffers:[o]}})}}export{a as OITBlendTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/PooledArray.js";class s{constructor(){this.adds=new e,this.removes=new e,this.updates=new e({allocator:e=>e||new r,deallocator:e=>(e.renderGeometry=null,e)})}clear(){this.adds.clear(),this.removes.clear(),this.updates.clear()}prune(){this.adds.prune(),this.removes.prune(),this.updates.prune()}get empty(){return 0===this.adds.length&&0===this.removes.length&&0===this.updates.length}}class r{}class t{constructor(){this.adds=new Array,this.removes=new Array,this.updates=new Array}}export{s as ChangeSet,t as MaterialChangeSet,r as RenderGeometryUpdate};
|
|
5
|
+
import e from"../../../../core/PooledArray.js";class s{constructor(){this.adds=new e,this.removes=new e,this.updates=new e({allocator:e=>e||new r,deallocator:e=>(e.renderGeometry=null,e)})}clear(){this.adds.clear(),this.removes.clear(),this.updates.clear()}prune(){this.adds.prune(),this.removes.prune(),this.updates.prune()}get empty(){return 0===this.adds.length&&0===this.removes.length&&0===this.updates.length}}class r{}class t{constructor(e){this.pending=e,this.adds=new Array,this.removes=new Array,this.updates=new Array}clearAddsAndRemoves(){this.adds.forEach((e=>this.pending.adds.removeUnordered(e))),this.removes.forEach((e=>this.pending.removes.removeUnordered(e))),this.adds.length=0,this.removes.length=0}clearUpdates(){this.updates.forEach((e=>this.pending.updates.removeUnordered(e))),this.updates.length=0}clear(){this.clearUpdates(),this.clearAddsAndRemoves()}}export{s as ChangeSet,t as MaterialChangeSet,r as RenderGeometryUpdate};
|
|
@@ -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{ResourceState as s}from"./basicInterfaces.js";class t{constructor(s,t){this._material=s,this._repository=t,this._map=new Map}dispose(){this._map.forEach(((s,t)=>{null!=s&&this._repository.release(this._material,t)}))}load(t,e,r){const i=this._material.produces.get(e);if(!i?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,e,r));const a=this._map.get(r);if(
|
|
5
|
+
import{ResourceState as s}from"./basicInterfaces.js";class t{constructor(s,t){this._material=s,this._repository=t,this._map=new Map}dispose(){this._map.forEach(((s,t)=>{null!=s&&this._repository.release(this._material,t)}))}load(t,e,r){const i=this._material.produces.get(e);if(!i?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,e,r));const a=this._map.get(r);if(a){if(a.ensureResources(t)===s.LOADED)return a;this._repository.requestRender()}return null}}export{t as GLMaterials};
|
|
@@ -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
|
-
function
|
|
5
|
+
function t(t){return!!t.update}export{t as isUpdatableTexture};
|
|
@@ -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{isColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{OITPass as e}from"./OITPass.js";import{BlendFactor as n,CompareFunction as t,ColorAttachment0 as o,ColorAttachment1 as u,ColorAttachment2 as s}from"../../../webgl/enums.js";import{separateBlendingParams as c,
|
|
5
|
+
import{isColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{OITPass as e}from"./OITPass.js";import{BlendFactor as n,CompareFunction as t,ColorAttachment0 as o,ColorAttachment1 as u,ColorAttachment2 as s}from"../../../webgl/enums.js";import{separateBlendingParams as c,unpremultipliedAlphaToPremultipliedAlpha as a,defaultDepthWrite as l}from"../../../webgl/renderState.js";const f=c(n.ONE,n.ZERO,n.ONE,n.ONE_MINUS_SRC_ALPHA);function i(r){return r===e.FrontFace?null:f}function N(r){switch(r){case e.NONE:return a;case e.ColorAlpha:return f;case e.FrontFace:case e.COUNT:return null}}function p(r){if(r.draped)return null;switch(r.oitPass){case e.NONE:case e.FrontFace:return r.writeDepth?l:null;case e.ColorAlpha:case e.COUNT:return null}}const O=5e5,m={factor:-1,units:-2};function E(r){return r?m:null}function h(r,n=t.LESS){return r===e.NONE||r===e.FrontFace?n:t.LEQUAL}function F(n,t){const c=r(t);return n===e.ColorAlpha?c?{buffers:[o,u,s]}:{buffers:[o,u]}:c?{buffers:[o,u]}:null}export{m as OITPolygonOffset,O as OITPolygonOffsetLimit,N as blending,f as blendingColorAlpha,p as depthWrite,F as getDrawBuffers,E as getOITPolygonOffset,i as oitBlending,h as oitDepthTest};
|
|
@@ -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{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as i}from"../../../../geometry/support/HalfFloatArray.js";import{newIntArray as s,compactIndices as r}from"../../../../geometry/support/Indices.js";import{newShortArray as o}from"../../../../geometry/support/ShortArray.js";import{compressNormal as h}from"./Normals.js";class
|
|
5
|
+
import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as i}from"../../../../geometry/support/HalfFloatArray.js";import{newIntArray as s,compactIndices as r}from"../../../../geometry/support/Indices.js";import{newShortArray as o}from"../../../../geometry/support/ShortArray.js";import{compressNormal as h}from"./Normals.js";class a{constructor(t,r,h,a,n,p={}){this.path=t,this.profile=r,this.extruder=h,this.startCap=a,this.endCap=n,this.options=p,this._extrusionVertexCount=0;const l=this.path.vertices.length-2;this.numExtrusionProfiles=h.numProfilesPerJoin()*l+2,this.numVerticesTotal=r.vertices.length*this.numExtrusionProfiles,this.startCap.vertexBufferStart=this.numVerticesTotal;const u=this.startCap.numVertices;this.numVerticesTotal+=u,this.endCap.vertexBufferStart=this.numVerticesTotal;const x=this.endCap.numVertices;this.numVerticesTotal+=x,this.pathVertexData=s(1*this.numVerticesTotal),this.profileRightAxes=o(2*this.numVerticesTotal),this.profileUpAxes=o(2*this.numVerticesTotal),this.profileVertexAndNormals=i(4*this.numVerticesTotal),this.profileAuxData=i(3*this.numVerticesTotal),this.positions=e(t.positions,t.offset,3*t.vertices.length),this._rebuildGeometry(),this._buildTopology()}get usedMemory(){return t(this.pathVertexData,this.profileRightAxes,this.profileUpAxes,this.profileVertexAndNormals,this.profileAuxData)+this.path.usedMemory+this.profile.usedMemory}emitVertex(t,e,i,s,r){let o=4*this._extrusionVertexCount;if(this.profileVertexAndNormals[o]=i[0],this.profileVertexAndNormals[o+1]=i[1],this.profileVertexAndNormals[o+2]=s[0],this.profileVertexAndNormals[o+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,o=3*this._extrusionVertexCount,r){const e=this.path.vertices[t],i=e.maxStretchDistance;this.profileAuxData[o]=e.rotationRight[0]*i,this.profileAuxData[o+1]=e.rotationRight[1]*i}else this.profileAuxData[o]=this.profileAuxData[o+1]=0;this.profileAuxData[o+2]=0,h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){let a=4*this._extrusionVertexCount;this.profileVertexAndNormals[a]=i[0],this.profileVertexAndNormals[a+1]=i[1],this.profileVertexAndNormals[a+2]=s[0],this.profileVertexAndNormals[a+3]=s[1],a=3*this._extrusionVertexCount,this.profileAuxData[a]=r,this.profileAuxData[a+1]=o,this.profileAuxData[a+2]=1,h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),this.pathVertexData[this._extrusionVertexCount]=t,++this._extrusionVertexCount}_rebuildGeometry(){this._extrusionVertexCount=0;const{positions:t,offset:i,vertices:s}=this.path;this.positions=e(t,i,3*s.length);let r=0;const o=(t,e,i,s,o)=>this.emitCapVertex(r,t,e,i,s,o),h=(t,e,i,s)=>this.emitVertex(r,t,e,i,s);for(this.startCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=1;r<s.length-1;++r)this.extruder.extrude(s[r],this.profile,h);this.endCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=0,this.startCap.rebuildCapGeometry(s[r],o),r=s.length-1,this.endCap.rebuildCapGeometry(s[r],o)}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1;let s=3*(2*(e*i));this.startCap.indexBufferStart=s,this.startCap.firstProfileVertexIndex=0,s+=this.startCap.numIndices,this.endCap.indexBufferStart=s,this.endCap.firstProfileVertexIndex=t*(this.numExtrusionProfiles-1);const o=new Array,h=new Array,a=(t,e,i)=>{o.push(t),o.push(e),o.push(i),h.push(this.pathVertexData[t]),h.push(this.pathVertexData[e]),h.push(this.pathVertexData[i])};for(let r=0;r<e;++r){const e=this.profile.indices[2*r],s=this.profile.indices[2*r+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+s,h=r*t+s;a(i,(r+1)*t+e,o),a(i,o,h)}}this.startCap.buildTopology(this.path.vertices[0],a),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],a),this.vertexIndices=r(o),this.pathVertexIndices=r(h)}onPathChanged(){this._rebuildGeometry()}}export{a as PathBuilder};
|
|
@@ -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{copy as t,set as e,length as s,normalize as i,dot as
|
|
5
|
+
import{copy as t,set as e,length as s,normalize as i,dot as o,scale as r,add as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as h,i as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as m}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as u}from"../../../../geometry/support/Indices.js";import{Attribute as f,Vertices as d}from"./Attribute.js";import{decompressNormal as b,compressNormal as A}from"./Normals.js";import{intersectTriangles as g}from"./RayIntersections.js";import{VertexAttribute as v}from"./VertexAttribute.js";class x{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class I extends x{constructor(t){super(t),this.color=p(255,255,255,255),this._size=n(),this.positions=m(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){this.color[0]=255*t[0],this.color[1]=255*t[1],this.color[2]=255*t[2],this.color[3]=255*(t.length>3?t[3]:1)}bake(n){t(this._size,n);const{numVerticesTotal:c,pathVertexData:p,positions:m,profileRightAxes:u,profileUpAxes:f,profileVertexAndNormals:d,profileAuxData:g}=this.builder;for(let t=0;t<c;++t){let c=p[t];c*=3;const v=V;let x=0,I=0;const O=b(w,u,t),E=b(j,f,t),T=4*t,C=e(P,d[T]*n[0],d[T+1]*n[1]),N=3*t;if(1===g[N+2])h(v,E,O),x=g[N]*n[0],I=g[N+1];else{const t=D,n=R;e(t,g[N],g[N+1]);const h=s(t);i(t,t);const c=o(C,t);if(Math.abs(c)>h){e(n,-t[1],t[0]);const s=o(C,n);r(t,t,h*Math.sign(c)),r(n,n,s),a(C,t,n)}l(v,0,0,0)}const _=O[0]*C[0]+E[0]*C[1],y=O[1]*C[0]+E[1]*C[1],L=O[2]*C[0]+E[2]*C[1];this.positions[N]=m[c]+_+v[0]*x,this.positions[N+1]=m[c+1]+y+v[1]*x,this.positions[N+2]=m[c+2]+L+v[2]*x;const z=d[T+2],F=d[T+3];A(this.normals,t,O[0]*z+E[0]*F+v[0]*I,O[1]*z+E[1]*F+v[1]*I,O[2]*z+E[2]*F+v[2]*I)}}createGeometryData(){const t=this.builder.vertexIndices;return[[v.POSITION,new f(this.positions,t,3,!0)],[v.NORMALCOMPRESSED,new f(this.normals,t,2,!0)],[v.COLOR,new f(this.color,u(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,s,i){const o=this.builder.vertexIndices,r=new d(this.positions,3),a=o.length/3;g(t,e,0,a,o,r,void 0,s,((t,e,s)=>i(t,s,e,!1)))}get size(){return this._size}}class O extends x{constructor(t,e,s,i){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=s,this.opacityAttributeValue=i,this.baked=new I(t),this._vvData=m(3*this.builder.path.vertices.length);for(let o=0;o<this._vvData.length;o+=3)this._vvData[o]=e,this._vvData[o+1]=s,this._vvData[o+2]=i}createGeometryData(){const t=this.builder,{pathVertexIndices:e,vertexIndices:s}=t;return[[v.POSITION,new f(t.positions,e,3,!0)],[v.FEATUREVALUE,new f(this._vvData,e,3,!0)],[v.PROFILEVERTEXANDNORMAL,new f(t.profileVertexAndNormals,s,4,!0)],[v.PROFILEAUXDATA,new f(t.profileAuxData,s,3,!0)],[v.PROFILERIGHT,new f(t.profileRightAxes,s,2,!0)],[v.PROFILEUP,new f(t.profileUpAxes,s,2,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute(v.POSITION);e&&(e.data=this.builder.positions)}}const P=n(),D=n(),R=n(),V=c(),w=c(),j=c();export{O as FastUpdatePathGeometry,x as PathGeometryData,I as StaticPathGeometry};
|