@arcgis/core 6.0.0-next.30 → 6.0.0-next.31
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/00d1c99779bd91b1d10e.js +1 -0
- package/assets/esri/core/workers/chunks/0694c7bcfe71692e2ccf.js +1 -0
- package/assets/esri/core/workers/chunks/{e2c6cd8dac01e129ccfe.js → 0e445ec3523de9f2dfa2.js} +1 -1
- package/assets/esri/core/workers/chunks/0f6c0d42100c21367e5c.js +1 -0
- package/assets/esri/core/workers/chunks/16cda273927ab0a39544.js +1 -0
- package/assets/esri/core/workers/chunks/1a3f71c4d97c36050030.js +1 -0
- package/assets/esri/core/workers/chunks/{0b4481b57a611b15f65c.js → 1eaf8bfdd3765a90ccc2.js} +1 -1
- package/assets/esri/core/workers/chunks/{8ca2bb3c0551bb1898b6.js → 3fdcc383bbd9cf0d274c.js} +1 -1
- package/assets/esri/core/workers/chunks/{fefdd10bdd5a4c8d8ed0.js → 4741fac6b6b4202a97c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad21757d78e372fa2ed6.js → 4a979fce1c971b614a18.js} +1 -1
- package/assets/esri/core/workers/chunks/4d8833f48348cbbcc947.js +1 -0
- package/assets/esri/core/workers/chunks/{865cebc5c982c040ab6f.js → 55a9eaeb152a3abada67.js} +1 -1
- package/assets/esri/core/workers/chunks/572aec57593a08b8045b.js +1 -0
- package/assets/esri/core/workers/chunks/6029773458ab98600f67.js +1 -0
- package/assets/esri/core/workers/chunks/6b5c073dddd89d06ed80.js +1 -0
- package/assets/esri/core/workers/chunks/7cc9d7a88b64e25fce14.js +1 -0
- package/assets/esri/core/workers/chunks/7e211d8a8ad6c6a7cf3e.js +1 -0
- package/assets/esri/core/workers/chunks/{64b360625c68cb863a08.js → 84940d8e14caf5a27e04.js} +1 -1
- package/assets/esri/core/workers/chunks/{c90388932a7825d9d933.js → 85de980c5b296ec69323.js} +1 -1
- package/assets/esri/core/workers/chunks/89dc49e784f7ba3b93ea.js +1 -0
- package/assets/esri/core/workers/chunks/{9d40786c5ceface786ba.js → 8a485130781b49dbf608.js} +1 -1
- package/assets/esri/core/workers/chunks/8d13f11d0bcc8d3a4bdf.js +1 -0
- package/assets/esri/core/workers/chunks/8da2a10318f49d0dc73a.js +1 -0
- package/assets/esri/core/workers/chunks/8e6276ddd8d094c61f08.js +1 -0
- package/assets/esri/core/workers/chunks/{1dc6f093028530a492e6.js → 90ba0af9690dc32b2958.js} +1 -1
- package/assets/esri/core/workers/chunks/{71f792a20077aa739f87.js → a607541959169741a943.js} +1 -1
- package/assets/esri/core/workers/chunks/b2d6b1ac9fbb50c7c8ab.js +1 -0
- package/assets/esri/core/workers/chunks/b657363113f4a37e634b.js +1 -0
- package/assets/esri/core/workers/chunks/b9cb92858a576eb6aa06.js +1 -0
- package/assets/esri/core/workers/chunks/{4419732baf3459a80e6d.js → ceb2d5b0a23f0ab81f68.js} +1 -1
- package/assets/esri/core/workers/chunks/{7030a4d0714a35995a58.js → d09d8cd43e846d467827.js} +1 -1
- package/assets/esri/core/workers/chunks/{12b84262dedc6b393136.js → d9a240a3c6bf85124474.js} +1 -1
- package/assets/esri/core/workers/chunks/{8f008eedb11685ee2048.js → e096c1d9d53af74d3207.js} +1 -1
- package/assets/esri/core/workers/chunks/e30fdde253e5521473a2.js +1 -0
- package/assets/esri/core/workers/chunks/e4e2edfdc85dd14e66d4.js +1 -0
- package/assets/esri/core/workers/chunks/{ba4520ddcb6a49988da6.js → f21edbfdcab111d8a6cd.js} +1 -1
- package/assets/esri/core/workers/chunks/f4d91d470ca5fea0bd26.js +1 -0
- package/assets/esri/core/workers/chunks/f717005e14a7e9141df7.js +1 -0
- package/assets/esri/core/workers/chunks/f75eec2cbc541eec9712.js +1 -0
- package/assets/esri/core/workers/chunks/{b5eff28cf482d920b9ea.js → f7fb6cb7f08c16384443.js} +1 -1
- package/assets/esri/core/workers/chunks/fcc3902d6d9eda6f09f5.js +1 -0
- package/assets/esri/core/workers/chunks/{28a821de9dbf10324033.js → fd031150d3a7f896e6b3.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc97e4fd0dacad970a23.js → ffaaa388773e60869df0.js} +1 -1
- package/config.js +1 -1
- package/core/scheduling.js +1 -1
- package/geometry/Mesh.d.ts +2 -125
- package/geometry/Mesh.js +1 -1
- package/geometry/support/meshErrors.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/geometry/support/polygonUtils.js +1 -1
- package/interfaces.d.ts +0 -3
- package/kernel.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/package.json +2 -2
- package/support/arcadeUtils.js +1 -1
- package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightConfiguration.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +10 -8
- package/views/3d/environment/VirtualLighting.d.ts +10 -8
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PlanarPatch.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/webgl-engine/lib/Path.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/webscene/Environment.d.ts +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/assets/esri/core/workers/chunks/02335385b1476fe322eb.js +0 -1
- package/assets/esri/core/workers/chunks/07b726a46864501b90a0.js +0 -1
- package/assets/esri/core/workers/chunks/189321d88026bd7e6d3e.js +0 -1
- package/assets/esri/core/workers/chunks/18d47ab571b613fbe719.js +0 -1
- package/assets/esri/core/workers/chunks/1967b9c96045a5802d08.js +0 -1
- package/assets/esri/core/workers/chunks/199a7f97916679e0257c.js +0 -1
- package/assets/esri/core/workers/chunks/1d96fbad881a7d14a950.js +0 -1
- package/assets/esri/core/workers/chunks/2cd60fd062d954322c1f.js +0 -1
- package/assets/esri/core/workers/chunks/2d3e0e4442dbc6ec6def.js +0 -1
- package/assets/esri/core/workers/chunks/2f5d014d6a72108b0b3a.js +0 -1
- package/assets/esri/core/workers/chunks/3105336a05f38a95ebea.js +0 -1
- package/assets/esri/core/workers/chunks/4fb2fcc95f852bf8f86c.js +0 -1
- package/assets/esri/core/workers/chunks/59bc55880e6fd8ce20c0.js +0 -1
- package/assets/esri/core/workers/chunks/5f787809b74eed7b9a91.js +0 -1
- package/assets/esri/core/workers/chunks/6a7de221cea4426cb490.js +0 -1
- package/assets/esri/core/workers/chunks/7a0b4dc0cda190367a39.js +0 -1
- package/assets/esri/core/workers/chunks/7d3f7940815fa5dc244e.js +0 -1
- package/assets/esri/core/workers/chunks/999c23da883eb11cb29e.js +0 -1
- package/assets/esri/core/workers/chunks/9bc3afe7013ef4ae737b.js +0 -1
- package/assets/esri/core/workers/chunks/bab1d010970d98c25470.js +0 -1
- package/assets/esri/core/workers/chunks/c4f78a481f43cfae7b63.js +0 -1
- package/assets/esri/core/workers/chunks/dcf6024dc19428ff2b9d.js +0 -1
- package/assets/esri/core/workers/chunks/ee0dc906cc7979080329.js +0 -1
- package/assets/esri/core/workers/chunks/f0d0ed155275c2e6d3da.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{spritePadding as t}from"./definitions.js";import{log2 as n}from"./GeometryUtils.js";import r from"./Rect.js";import i from"./RectangleBinPack.js";import a from"../../../webgl/Texture.js";import{TextureDescriptor as o}from"../../../webgl/TextureDescriptor.js";function s(e){return e&&e.type===`static`}class c{constructor(e,t,n=0){this._mosaicPages=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects=new Map,this._pageWidth=e,this._pageHeight=t,n>0&&(this._maxItemSize=n),this._binPack=new i(this._pageWidth,this._pageHeight);let r=Math.floor(this._pageWidth),a=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:`static`,data:new Uint32Array(r*a)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getSize(e){return e>=this._mosaicPages.length?[0,0]:this._mosaicPages[e].size}has(e){return this._mosaicRects.has(e)}getSpriteItem(e){return this._mosaicRects.get(e)}addSpriteItem(e,n,i,a,o,c,l=1,u=`Linear`,d=.5,f=1){if(this._mosaicRects.has(e))return this._mosaicRects.get(e);let p,m,h;if(s(i)?[p,m,h]=this._allocateImage(n[0],n[1]):(p=new r(0,0,n[0],n[1]),m=this._mosaicPages.length,this._mosaicPages.push({mosaicsData:i,size:[n[0]+2*t,n[1]+2*t],dirty:!0,texture:void 0})),p.width<=0||p.height<=0)return null;let g={type:`sprite`,rect:p,width:n[0],height:n[1],sdf:o,simplePattern:c,rasterizationScale:l,samplingMode:u,sdfPaddingRatio:d,sdfDecodeCoeff:f,page:m};return this._mosaicRects.set(e,g),s(i)&&(has(`esri-mosaic-debug`)&&this._showDebugSprite(n,i.data),this._copy({rect:p,spriteSize:n,spriteData:i.data,page:m,pageSize:h,repeat:a,sdf:o})),g}getTexture(e,t=0){let{context:n}=e,r=this._mosaicPages[t],i=r.mosaicsData,a=r.texture;if(a||(a=u(n,r.size),r.texture=a),s(i))r.dirty&&(a.setData(new Uint8Array(i.data.buffer)),a.generateMipmap(),has(`esri-mosaic-debug`)&&this._showDebugPage(t));else{let t=i.data;t.update(e),t.hasFrameData&&(t.loadFrame(a),a.generateMipmap())}return r.dirty=!1,a}dispose(){this._binPack=null;for(let e of this._mosaicPages){let t=e.texture;t&&t.dispose();let n=e.mosaicsData;s(n)||n.data.destroy()}this._mosaicPages=null,this._mosaicRects.clear()}static _copyBits(e,t,n,r,i,a,o,s,c,l,u){let d=r*t+n,f=s*a+o;if(u){f-=a;for(let o=-1;o<=l;o++,d=((o+l)%l+r)*t+n,f+=a)for(let t=-1;t<=c;t++)i[f+t]=e[d+(t+c)%c]}else for(let n=0;n<l;n++){for(let t=0;t<c;t++)i[f+t]=e[d+t];d+=t,f+=a}}_copy(n){if(n.page>=this._mosaicPages.length)return;let r=this._mosaicPages[n.page],i=r.mosaicsData;if(!s(r.mosaicsData))throw new e(`mapview-invalid-resource`,`unsuitable data type!`);let a=n.spriteData,o=i.data;c._copyBits(a,n.spriteSize[0],0,0,o,n.pageSize[0],n.rect.x+t,n.rect.y+t,n.spriteSize[0],n.spriteSize[1],n.repeat),r.dirty=!0}_allocateImage(e,a){e+=2*t,a+=2*t;let o=Math.max(e,a);if(this._maxItemSize&&this._maxItemSize<o){let t=2**Math.ceil(n(e)),i=2**Math.ceil(n(a)),o=new r(0,0,e,a);return this._mosaicPages.push({mosaicsData:{type:`static`,data:new Uint32Array(t*i)},size:[t,i],dirty:!0,texture:void 0}),[o,this._mosaicPages.length-1,[t,i]]}let c=this._binPack.allocate(e,a);if(c.width<=0){let t=this._mosaicPages[this._currentPage];return!t.dirty&&s(t.mosaicsData)&&(t.mosaicsData.data=null),this._currentPage=this._mosaicPages.length,this._mosaicPages.push({mosaicsData:{type:`static`,data:new Uint32Array(this._pageWidth*this._pageHeight)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0}),this._binPack=new i(this._pageWidth,this._pageHeight),this._allocateImage(e,a)}return[c,this._currentPage,[this._pageWidth,this._pageHeight]]}_showDebugSprite([e,t],n){let r=document.createElement(`canvas`);r.width=e,r.height=t,r.setAttribute(`style`,`position: absolute; top: ${4+204*l++}px; right: 208px; width: 200px; height: 200px; border: 1px solid black;`);let i=r.getContext(`2d`),a=new ImageData(e,t);a.data.set(new Uint8Array(n.buffer)),i.putImageData(a,0,0),document.body.appendChild(r)}_showDebugPage(e){let{size:[t,n],mosaicsData:r}=this._mosaicPages[e];if(!s(r))return;let i=`mosaicDebugPage${e}`,a=document.getElementById(i)??document.createElement(`canvas`);a.id=i,a.width=t,a.height=n,a.setAttribute(`style`,`position: absolute; top: ${4+204*e}px; right: 4px; width: 200px; height: 200px; border: 1px solid black;`);let o=a.getContext(`2d`),c=new ImageData(t,n);c.data.set(new Uint8Array(r.data.buffer)),o.putImageData(c,0,0),document.body.appendChild(a)}}let l=0;function u(e,
|
|
2
|
+
import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{spritePadding as t}from"./definitions.js";import{log2 as n}from"./GeometryUtils.js";import r from"./Rect.js";import i from"./RectangleBinPack.js";import a from"../../../webgl/Texture.js";import{TextureDescriptor as o}from"../../../webgl/TextureDescriptor.js";function s(e){return e&&e.type===`static`}class c{constructor(e,t,n=0){this._mosaicPages=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects=new Map,this._pageWidth=e,this._pageHeight=t,n>0&&(this._maxItemSize=n),this._binPack=new i(this._pageWidth,this._pageHeight);let r=Math.floor(this._pageWidth),a=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:`static`,data:new Uint32Array(r*a)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getSize(e){return e>=this._mosaicPages.length?[0,0]:this._mosaicPages[e].size}has(e){return this._mosaicRects.has(e)}getSpriteItem(e){return this._mosaicRects.get(e)}addSpriteItem(e,n,i,a,o,c,l=1,u=`Linear`,d=.5,f=1){if(this._mosaicRects.has(e))return this._mosaicRects.get(e);let p,m,h;if(s(i)?[p,m,h]=this._allocateImage(n[0],n[1]):(p=new r(0,0,n[0],n[1]),m=this._mosaicPages.length,this._mosaicPages.push({mosaicsData:i,size:[n[0]+2*t,n[1]+2*t],dirty:!0,texture:void 0})),p.width<=0||p.height<=0)return null;let g={type:`sprite`,rect:p,width:n[0],height:n[1],sdf:o,simplePattern:c,rasterizationScale:l,samplingMode:u,sdfPaddingRatio:d,sdfDecodeCoeff:f,page:m};return this._mosaicRects.set(e,g),s(i)&&(has(`esri-mosaic-debug`)&&this._showDebugSprite(n,i.data),this._copy({rect:p,spriteSize:n,spriteData:i.data,page:m,pageSize:h,repeat:a,sdf:o})),g}getTexture(e,t=0){let{context:n}=e,r=this._mosaicPages[t],i=r.mosaicsData,a=r.texture;if(a||(a=u(n,r.size),r.texture=a),s(i))r.dirty&&(a.setData(new Uint8Array(i.data.buffer)),a.generateMipmap(),has(`esri-mosaic-debug`)&&this._showDebugPage(t));else{let t=i.data;t.update(e),t.hasFrameData&&(t.loadFrame(a),a.generateMipmap())}return r.dirty=!1,a}dispose(){this._binPack=null;for(let e of this._mosaicPages){let t=e.texture;t&&t.dispose();let n=e.mosaicsData;s(n)||n.data.destroy()}this._mosaicPages=null,this._mosaicRects.clear()}static _copyBits(e,t,n,r,i,a,o,s,c,l,u){let d=r*t+n,f=s*a+o;if(u){f-=a;for(let o=-1;o<=l;o++,d=((o+l)%l+r)*t+n,f+=a)for(let t=-1;t<=c;t++)i[f+t]=e[d+(t+c)%c]}else for(let n=0;n<l;n++){for(let t=0;t<c;t++)i[f+t]=e[d+t];d+=t,f+=a}}_copy(n){if(n.page>=this._mosaicPages.length)return;let r=this._mosaicPages[n.page],i=r.mosaicsData;if(!s(r.mosaicsData))throw new e(`mapview-invalid-resource`,`unsuitable data type!`);let a=n.spriteData,o=i.data;c._copyBits(a,n.spriteSize[0],0,0,o,n.pageSize[0],n.rect.x+t,n.rect.y+t,n.spriteSize[0],n.spriteSize[1],n.repeat),r.dirty=!0}_allocateImage(e,a){e+=2*t,a+=2*t;let o=Math.max(e,a);if(this._maxItemSize&&this._maxItemSize<o){let t=2**Math.ceil(n(e)),i=2**Math.ceil(n(a)),o=new r(0,0,e,a);return this._mosaicPages.push({mosaicsData:{type:`static`,data:new Uint32Array(t*i)},size:[t,i],dirty:!0,texture:void 0}),[o,this._mosaicPages.length-1,[t,i]]}let c=this._binPack.allocate(e,a);if(c.width<=0){let t=this._mosaicPages[this._currentPage];return!t.dirty&&s(t.mosaicsData)&&(t.mosaicsData.data=null),this._currentPage=this._mosaicPages.length,this._mosaicPages.push({mosaicsData:{type:`static`,data:new Uint32Array(this._pageWidth*this._pageHeight)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0}),this._binPack=new i(this._pageWidth,this._pageHeight),this._allocateImage(e,a)}return[c,this._currentPage,[this._pageWidth,this._pageHeight]]}_showDebugSprite([e,t],n){let r=document.createElement(`canvas`);r.width=e,r.height=t,r.setAttribute(`style`,`position: absolute; top: ${4+204*l++}px; right: 208px; width: 200px; height: 200px; border: 1px solid black;`);let i=r.getContext(`2d`),a=new ImageData(e,t);a.data.set(new Uint8Array(n.buffer)),i.putImageData(a,0,0),document.body.appendChild(r)}_showDebugPage(e){let{size:[t,n],mosaicsData:r}=this._mosaicPages[e];if(!s(r))return;let i=`mosaicDebugPage${e}`,a=document.getElementById(i)??document.createElement(`canvas`);a.id=i,a.width=t,a.height=n,a.setAttribute(`style`,`position: absolute; top: ${4+204*e}px; right: 4px; width: 200px; height: 200px; border: 1px solid black;`);let o=a.getContext(`2d`),c=new ImageData(t,n);c.data.set(new Uint8Array(r.data.buffer)),o.putImageData(c,0,0),document.body.appendChild(a)}}let l=0;function u(e,n){let r=new o(n[0],n[1]);return r.wrapMode=33071,r.maxMipLevel=Math.floor(Math.log2(t/2)),new a(e,r,null)}export{c as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import{isSome as n}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import{makeHandle as i}from"../../../core/handleUtils.js";import"../../../core/has.js";import{QueueProcessor as a}from"../../../core/QueueProcessor.js";import{watch as o,sync as s}from"../../../core/reactiveUtils.js";import{isScreenRect as c}from"../../../core/screenUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{convertGeometryToMask as d}from"../../../layers/raster/functions/clipUtils.js";import f from"../../../layers/support/FeatureFilter.js";import{GraphicsCollection as p}from"../../../support/GraphicsCollection.js";import m from"../engine/flow/FlowView2D.js";import{LayerView2D as h}from"./LayerView2D.js";import g from"./graphics/GraphicsView2D.js";import _ from"./graphics/HighlightGraphicContainer.js";import v from"./imagery/ImageryView2D.js";import y from"./imagery/VectorFieldView2D.js";import b from"../../layers/ImageryLayerView.js";import{RefreshableLayerView as x}from"../../layers/RefreshableLayerView.js";import{isPixelHighlightTarget as S,isEmptyPixelRanges as C}from"../../layers/support/highlightUtils.js";import{defaultColor as w}from"../../support/HighlightDefaults.js";import{getHighlightName as T}from"../../support/highlightOptionsUtils.js";let E=class extends x(h(b)){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new p,this._highlightView=void 0,this._pixelHighlights=[],this.layer=null,this.subview=null}get pixelData(){let{subview:e}=this;return this.updating||!e?null:`getPixelData`in e?e.getPixelData():null}update(e){this.subview?.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new g({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new _(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([o(()=>this.layer.exportImageServiceParameters.version,e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())},s),o(()=>this.timeExtent,e=>{let{subview:t}=this;t&&(t.timeExtent=e,`redraw`in t?this.requestUpdate():t.redrawOrRefetch())},s),this.layer.on(`redraw`,()=>{let{subview:e}=this;e&&(`redraw`in e?e.redraw():e.redrawOrRefetch())}),o(()=>this.layer.renderer,()=>this._setSubView()),o(()=>this.view?.highlights.items.map(({name:e,color:t})=>({name:e,color:t})),()=>this._updateHighlightOptions(this.subview))])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}async hitTest(e,t){let{layer:n,subview:r}=this;if(!n.loaded||!this.attached||!r?.attached)return null;c(t)&&(e=this.view.toMap({x:t.x+t.width/2,y:t.y+t.height/2}));let i=await r.hitTest(e);return i==null?null:[{type:`raster`,layer:n,mapPoint:e,...i}]}highlight(e,a){if(S(e))return C(e)?i():this._highlightPixels(e,a);if(typeof e==`number`||typeof e==`string`)return this._highlightByImageIds([e],a);let o=Array.isArray(e)||r.isCollection(e)?e.at(0):e;if(typeof o==`number`||typeof o==`string`)return this._highlightByImageIds(e,a);if(!(o instanceof t))return i();let s=[];if(Array.isArray(e)||r.isCollection(e)?s=e.map(e=>e.clone()):e instanceof t&&(s=[e.clone()]),!s?.filter(n)?.length)return i();let c=T(a),l=this._addHighlightGraphics(s,c);return i(()=>!this.destroyed&&this._removeHighlightGraphics(s,l))}_highlightByImageIds(e,t){let n=T(t),r=new AbortController,{signal:o}=r,s=this.layer.sourceJSON.maxRecordCount??1e3,c=Math.ceil(e.length/s),l=[],u=[],d=new a({concurrency:4,process:e=>this.layer.queryFeatures({objectIds:e.ids,returnGeometry:!0,outSpatialReference:this.view.spatialReference},{signal:o}).then(e=>u.push(...e.features)).catch(()=>{})});for(let t=0;t<c;t++)l.push(d.push({ids:e.slice(t*s,(t+1)*s)}));return Promise.allSettled(l).then(()=>{if(u.length&&!o.aborted){let e=this._addHighlightGraphics(u,n);o.addEventListener(`abort`,()=>{this._removeHighlightGraphics(u,e)})}}),i(()=>r.abort())}_highlightPixels(e,t){let n={target:e,options:t};return this._pixelHighlights.push(n),this._updateHighlightOptions(this.subview),i(()=>{let e=this._pixelHighlights.indexOf(n);e>-1&&(this._pixelHighlights.splice(e,1),this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(e,t){return this._highlightGraphics.addMany(e),this._addHighlightFilter(new f({objectIds:e.map(e=>e.uid)}),t)}_removeHighlightGraphics(e,t){this._highlightGraphics.removeMany(e),this._removeHighlight(t)}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating||!!this._highlightView?.updating}_onHighlightChange(){let e=this._getHighlightFilterGroups();this._highlightView?.setHighlightFilters(e)}_setSubView(){if(!this.view)return;let e=this.layer.renderer?.type,t=`imagery`;if(e===`vector-field`?t=`imageryVF`:e===`flow`&&(t=`flow`),this.subview){let{type:e}=this.subview;if(e===t){this._attachSubview(this.subview),e===`flow`?this.subview.redrawOrRefetch():e===`imagery`&&this.layer.format===`lerc`?this.subview.redraw():this.requestUpdate();return}this._detachSubview(this.subview),this.subview?.destroy()}t===`imagery`?(this.subview=new v({layer:this.layer,view:this.view,timeExtent:this.timeExtent,updatingHandles:this._updatingHandles}),this._updateHighlightOptions(this.subview)):this.subview=t===`imageryVF`?new y({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new m({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_updateHighlightOptions(e){let t=this.view.highlights;this._pixelHighlights.sort((e,n)=>t.findIndex(({name:e})=>e===T(n.options))-t.findIndex(({name:t})=>t===T(e.options)));let r=this._pixelHighlights.map(({target:e,options:n})=>D(e,t,n)).filter(n);e?.type===`imagery`&&(e.pixelHighlights=r,e.attached&&(this.layer.format===`lerc`?e.redraw():this.requestUpdate()))}};e([l()],E.prototype,`pixelData`,null),e([l()],E.prototype,`subview`,void 0),E=e([u(`esri.views.2d.layers.ImageryLayerView2D`)],E);function D(e,t,n){let r=T(n),i=(t.find(e=>e.name===r)?.color??w).toArray(),{pixelRanges:a}=e;if(Array.isArray(a))return{ranges:a,bandId:e.bandId??0,color:i};let o=a.type===`extent`?a:a.extent;if(!o)return;let s=[o.xmin,o.xmax],c=[o.ymin,o.ymax],{xBandId:l,yBandId:u}=e,f=1024,p=1024;return{xBandId:l,yBandId:u,xBandRange:s,yBandRange:c,color:i,width:f,height:p,xyMask:a.type===`polygon`?d({srcExtent:o,geometry:a,size:[f,p]}):void 0}}const O=E;export{O as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import{isSome as n}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import{makeHandle as i}from"../../../core/handleUtils.js";import"../../../core/has.js";import{QueueProcessor as a}from"../../../core/QueueProcessor.js";import{watch as o,sync as s}from"../../../core/reactiveUtils.js";import{isScreenRect as c}from"../../../core/screenUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{convertGeometryToMask as d}from"../../../layers/raster/functions/clipUtils.js";import f from"../../../layers/support/FeatureFilter.js";import{GraphicsCollection as p}from"../../../support/GraphicsCollection.js";import m from"../engine/flow/FlowView2D.js";import{LayerView2D as h}from"./LayerView2D.js";import g from"./graphics/GraphicsView2D.js";import _ from"./graphics/HighlightGraphicContainer.js";import v from"./imagery/ImageryView2D.js";import y from"./imagery/VectorFieldView2D.js";import b from"../../layers/ImageryLayerView.js";import{RefreshableLayerView as x}from"../../layers/RefreshableLayerView.js";import{isPixelHighlightTarget as S,isEmptyPixelRanges as C}from"../../layers/support/highlightUtils.js";import{defaultColor as w}from"../../support/HighlightDefaults.js";import{getHighlightName as T}from"../../support/highlightOptionsUtils.js";let E=class extends x(h(b)){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new p,this._highlightView=void 0,this._maxPixelSizePromise=null,this._pixelHighlights=[],this.layer=null,this.subview=null}get pixelData(){let{subview:e}=this;return this.updating||!e?null:`getPixelData`in e?e.getPixelData():null}update(e){this.subview?.update(e),this._highlightView?.processUpdate(e),this._updatingHandles.consumePromise(this._updateHighlightVisibility())}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new g({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new _(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([o(()=>this.layer.exportImageServiceParameters.version,e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())},s),o(()=>this.timeExtent,e=>{let{subview:t}=this;t&&(t.timeExtent=e,`redraw`in t?this.requestUpdate():t.redrawOrRefetch())},s),this.layer.on(`redraw`,()=>{let{subview:e}=this;e&&(`redraw`in e?e.redraw():e.redrawOrRefetch())}),o(()=>this.layer.renderer,()=>this._setSubView()),o(()=>this.view?.highlights.items.map(({name:e,color:t})=>({name:e,color:t})),()=>this._updateHighlightOptions(this.subview))])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}async hitTest(e,t){let{layer:n,subview:r}=this;if(!n.loaded||!this.attached||!r?.attached)return null;c(t)&&(e=this.view.toMap({x:t.x+t.width/2,y:t.y+t.height/2}));let i=await r.hitTest(e);return i==null?null:[{type:`raster`,layer:n,mapPoint:e,...i}]}highlight(e,a){if(S(e))return C(e)?i():this._highlightPixels(e,a);if(this.layer.sourceType===`mosaic-dataset`&&(this._maxPixelSizePromise??=this.layer.fetchMaxPixelSize(this.view.spatialReference).catch(()=>null)),typeof e==`number`||typeof e==`string`)return this._highlightByImageIds([e],a);let o=Array.isArray(e)||r.isCollection(e)?e.at(0):e;if(typeof o==`number`||typeof o==`string`)return this._highlightByImageIds(e,a);if(!(o instanceof t))return i();let s=[];if(Array.isArray(e)||r.isCollection(e)?s=e.map(e=>e.clone()):e instanceof t&&(s=[e.clone()]),!s?.filter(n)?.length)return i();let c=T(a),l=this._addHighlightGraphics(s,c);return i(()=>!this.destroyed&&this._removeHighlightGraphics(s,l))}_highlightByImageIds(e,t){let n=T(t),r=new AbortController,{signal:o}=r,s=this.layer.sourceJSON.maxRecordCount??1e3,c=Math.ceil(e.length/s),l=[],u=[],d=new a({concurrency:4,process:e=>this.layer.queryFeatures({objectIds:e.ids,returnGeometry:!0,outSpatialReference:this.view.spatialReference},{signal:o}).then(e=>u.push(...e.features)).catch(()=>{})});for(let t=0;t<c;t++)l.push(d.push({ids:e.slice(t*s,(t+1)*s)}));return Promise.allSettled(l).then(()=>{if(u.length&&!o.aborted){let e=this._addHighlightGraphics(u,n);o.addEventListener(`abort`,()=>{this._removeHighlightGraphics(u,e)})}}),i(()=>r.abort())}_highlightPixels(e,t){let n={target:e,options:t};return this._pixelHighlights.push(n),this._updateHighlightOptions(this.subview),i(()=>{let e=this._pixelHighlights.indexOf(n);e>-1&&(this._pixelHighlights.splice(e,1),this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(e,t){return this._highlightGraphics.addMany(e),this._addHighlightFilter(new f({objectIds:e.map(e=>e.uid)}),t)}_removeHighlightGraphics(e,t){this._highlightGraphics.removeMany(e),this._removeHighlight(t)}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating||!!this._highlightView?.updating}_onHighlightChange(){let e=this._getHighlightFilterGroups();this._highlightView?.setHighlightFilters(e)}_setSubView(){if(!this.view)return;let e=this.layer.renderer?.type,t=`imagery`;if(e===`vector-field`?t=`imageryVF`:e===`flow`&&(t=`flow`),this.subview){let{type:e}=this.subview;if(e===t){this._attachSubview(this.subview),e===`flow`?this.subview.redrawOrRefetch():e===`imagery`&&this.layer.format===`lerc`?this.subview.redraw():this.requestUpdate();return}this._detachSubview(this.subview),this.subview?.destroy()}t===`imagery`?(this.subview=new v({layer:this.layer,view:this.view,timeExtent:this.timeExtent,updatingHandles:this._updatingHandles}),this._updateHighlightOptions(this.subview)):this.subview=t===`imageryVF`?new y({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new m({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}async _updateHighlightVisibility(){let e=this._highlightView?.container;if(!e||this.suspended)return;if(this.layer.mosaicRule?.method===`lock-raster`){e.visible=!0;return}let t=await this._maxPixelSizePromise;t!=null&&(e.visible=(t.x+t.y)/2>this.view.resolution)}_updateHighlightOptions(e){let t=this.view.highlights;this._pixelHighlights.sort((e,n)=>t.findIndex(({name:e})=>e===T(n.options))-t.findIndex(({name:t})=>t===T(e.options)));let r=this._pixelHighlights.map(({target:e,options:n})=>D(e,t,n)).filter(n);e?.type===`imagery`&&(e.pixelHighlights=r,e.attached&&(this.layer.format===`lerc`?e.redraw():this.requestUpdate()))}};e([l()],E.prototype,`pixelData`,null),e([l()],E.prototype,`subview`,void 0),E=e([u(`esri.views.2d.layers.ImageryLayerView2D`)],E);function D(e,t,n){let r=T(n),i=(t.find(e=>e.name===r)?.color??w).toArray(),{pixelRanges:a}=e;if(Array.isArray(a))return{ranges:a,bandId:e.bandId??0,color:i};let o=a.type===`extent`?a:a.extent;if(!o)return;let s=[o.xmin,o.xmax],c=[o.ymin,o.ymax],{xBandId:l,yBandId:u}=e,f=1024,p=1024;return{xBandId:l,yBandId:u,xBandRange:s,yBandRange:c,color:i,width:f,height:p,xyMask:a.type===`polygon`?d({srcExtent:o,geometry:a,size:[f,p]}):void 0}}const O=E;export{O as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../Color.js";import{getContrast as t,multiplyOpacityToUnitRGBA as n}from"../../../../core/colorUtils.js";class r{constructor(){this.glowWidth=8,this.innerWidth=.75}}const i=new r;function a(e){let n=e.accentColor;return{glowColor:n,innerColor:t(n),globalAlpha:n.a*.75}}class o{constructor(){this.
|
|
2
|
+
import e from"../../../../Color.js";import{getContrast as t,multiplyOpacityToUnitRGBA as n}from"../../../../core/colorUtils.js";class r{constructor(){this.glowWidth=8,this.innerWidth=.75}}const i=new r;function a(e){let n=e.accentColor;return{glowColor:n,innerColor:t(n),globalAlpha:n.a*.75}}class o{constructor(){this.radius=5}}const s=new o;function c(e){return n(e.accentColor,.75)}function l(e){return n(e.accentColor,.75)}const u={line:1,manipulator:2};class d{constructor(){this.radius=5,this.visibleColor=new e([3,252,111,.75]),this.occludedColor=new e([252,3,69,.75]),this.undefinedColor=new e([127,127,127,.75])}}const f=new d;class p{constructor(){this.innerWidth=2,this.outerWidth=8,this.visibleInnerColor=new e([3,252,111,1]),this.visibleOuterColor=new e([3,252,111,.15]),this.occludedInnerColor=new e([252,3,69,1]),this.occludedOuterColor=new e([252,3,69,.1]),this.undefinedInnerColor=new e([255,255,255,1]),this.undefinedOuterColor=new e([127,127,127,.2])}}const m=new p;export{l as getInteractiveTargetRGBA,a as getLaserLineColors,c as getObserverRGBA,i as laserLineConfiguration,m as lineOfSightConfiguration,u as lineOfSightTransparentRenderOrder,s as observerConfiguration,f as targetConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{snapshotLineOfSightTargetState as o,restoreLineOfSightTargetState as s}from"./LineOfSightAuthoringUtils.js";import{LineOfSightItemManipulatedObject3D as c}from"./LineOfSightItemManipulatedObject3D.js";import{LineOfSightItemTool as l}from"./LineOfSightItemTool.js";import{discRadiusSmall as u}from"../../interactive/editingTools/manipulations/config.js";import{MoveTool3D as d}from"../../interactive/editingTools/move/MoveTool3D.js";import{bindViewToolOptions as f}from"../../../interactive/options/bindViewToolOptions.js";import p from"../../../interactive/options/InteractiveToolOptions.js";import{makeTooltip as m}from"../../../interactive/tooltip/tooltipCommonUtils.js";const h=Symbol(`inactiveMoveManipulatorDisplay`);let g=class extends t{get visible(){return this._get(`visible`)??!0}set visible(e){this._set(`visible`,e),this._itemTool.visible=e,this._moveTool.visible=e}get manipulatorsInteractive(){return this._get(`manipulatorsInteractive`)??!0}set manipulatorsInteractive(e){this._set(`manipulatorsInteractive`,e),this._itemTool.manipulatorsInteractive=e}constructor(e){super(e),this._selectedItem=null,this._objectByItem=new Map,this._undoStack=[],this._redoStack=[];let t=new p;this._tooltip=m(()=>({view:e.view,options:t.tooltips})),this._moveTool=new d({enableVisualElements:!1,manipulatorRadius:u,snappingManager:e.snappingManager,toolOptions:t,tooltip:this._tooltip,view:e.view}),this._itemTool=new l({analysisViewData:e.analysisViewData,snappingManager:e.snappingManager,tooltip:this._tooltip,view:e.view})}initialize(){this.view.tools.add(this._itemTool),this.view.tools.add(this._moveTool),this._itemTool.visible=this.visible,this._moveTool.visible=this.visible,this._itemTool.manipulatorsInteractive=this.manipulatorsInteractive;let e=e=>{let t=e.at(0);t!=null&&this._itemTool.showInteractionVisuals(t)},t=()=>this._itemTool.hideInteractionVisuals();this.addHandles([f(this._moveTool.toolOptions,()=>this.view.options),n(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:e,targets:t})=>this._syncObjects(e,t),r),this._itemTool.events.on(`select-item`,({item:e})=>this._setSelectedItem(e)),this._itemTool.events.on(`
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{snapshotLineOfSightTargetState as o,restoreLineOfSightTargetState as s}from"./LineOfSightAuthoringUtils.js";import{LineOfSightItemManipulatedObject3D as c}from"./LineOfSightItemManipulatedObject3D.js";import{LineOfSightItemTool as l}from"./LineOfSightItemTool.js";import{discRadiusSmall as u}from"../../interactive/editingTools/manipulations/config.js";import{MoveTool3D as d}from"../../interactive/editingTools/move/MoveTool3D.js";import{bindViewToolOptions as f}from"../../../interactive/options/bindViewToolOptions.js";import p from"../../../interactive/options/InteractiveToolOptions.js";import{makeTooltip as m}from"../../../interactive/tooltip/tooltipCommonUtils.js";const h=Symbol(`inactiveMoveManipulatorDisplay`);let g=class extends t{get visible(){return this._get(`visible`)??!0}set visible(e){this._set(`visible`,e),this._itemTool.visible=e,this._moveTool.visible=e}get manipulatorsInteractive(){return this._get(`manipulatorsInteractive`)??!0}set manipulatorsInteractive(e){this._set(`manipulatorsInteractive`,e),this._itemTool.manipulatorsInteractive=e}constructor(e){super(e),this._selectedItem=null,this._objectByItem=new Map,this._undoStack=[],this._redoStack=[];let t=new p;this._tooltip=m(()=>({view:e.view,options:t.tooltips})),this._moveTool=new d({enableVisualElements:!1,manipulatorRadius:u,snappingManager:e.snappingManager,toolOptions:t,tooltip:this._tooltip,view:e.view}),this._itemTool=new l({analysisViewData:e.analysisViewData,moveTool:this._moveTool,snappingManager:e.snappingManager,tooltip:this._tooltip,view:e.view})}initialize(){this.view.tools.add(this._itemTool),this.view.tools.add(this._moveTool),this._itemTool.visible=this.visible,this._moveTool.visible=this.visible,this._itemTool.manipulatorsInteractive=this.manipulatorsInteractive;let e=e=>{let t=e.at(0);t!=null&&this._itemTool.showInteractionVisuals(t)},t=()=>this._itemTool.hideInteractionVisuals();this.addHandles([f(this._moveTool.toolOptions,()=>this.view.options),n(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:e,targets:t})=>this._syncObjects(e,t),r),this._itemTool.events.on(`select-item`,({item:e})=>this._setSelectedItem(e)),this._itemTool.events.on(`deselect-item`,()=>this.clearSelection()),this._itemTool.events.on(`delete-item`,({target:e})=>this._deleteTarget(e)),this._itemTool.events.on(`record-undo`,({record:e})=>this._recordHistory(_([e]))),this._moveTool.events.on(`record-undo`,({updates:e})=>this._recordHistory(_(e))),this._moveTool.events.on(`hold`,({objects:t})=>e(t)),this._moveTool.events.on(`move-start`,({objects:t})=>{this._itemTool.endDrag(),e(t)}),this._moveTool.events.on(`move-stop`,t),n(()=>({sphereGrabbed:this._itemTool.hasGrabbedManipulators,manipulators:this._moveTool.manipulators.toArray()}),({sphereGrabbed:e})=>{let t=[];e&&this._moveTool.manipulators.forEach(({manipulator:e})=>{t.push(e.disableDisplay())}),this.removeHandles(h),this.addHandles(t,h)},r),n(()=>this._moveTool.firstGrabbedManipulator,e=>{e??t()})])}destroy(){this.removeHandles(h),this.stop(),this.view.tools.remove(this._itemTool),this.view.tools.remove(this._moveTool),this._itemTool.destroy(),this._moveTool.destroy(),this._tooltip.destroy();for(let e of this._objectByItem.values())this.removeHandles(e),e.destroy();this._objectByItem.clear(),this._undoStack.length=0,this._redoStack.length=0}get active(){return this._itemTool.active||this._moveTool.active}get canRedo(){return this._redoStack.length>0}get canUndo(){return this._undoStack.length>0}get hasSelection(){return this._selectedItem!=null}get selectedItem(){return this._selectedItem}get updating(){return this._itemTool.updating||this._moveTool.updating}get laserLineVisualElement(){return this._itemTool.laserLineVisualElement}get verticalLineVisualElement(){return this._itemTool.verticalLineVisualElement}selectItem(e){return this._objectByItem.has(e)?(this._setSelectedItem(e),!0):!1}clearSelection(){return this.hasSelection?(this._setSelectedItem(null),!0):!1}deleteSelectedItem(){let e=this._selectedItem;if(e==null)return!1;let t=this.analysis.targets.find(t=>t===e);return t!=null&&this._deleteTarget(t)}getObserverManipulator(){let e=this.analysis.observer,t=e==null?null:this._itemTool.getManipulator(e);return t!=null&&v(t)?t:null}getTargetManipulator(e){let t=this._itemTool.getManipulator(e);return t!=null&&y(t)?t:null}hasManipulatorAt(e,t){return this._itemTool.hasManipulatorAt(e,t)}redo(){let e=this._redoStack.pop();e!=null&&(e.redo()?(this._undoStack.push(e),this._notifyHistoryChanged()):this._redoStack.push(e))}setEditableFlag(e,t){this._itemTool.setEditableFlag(e,t),this._moveTool.setEditableFlag(e,t)}stop(){(this.view.activeTool===this._itemTool||this.view.activeTool===this._moveTool)&&(this.view.activeTool=null),this._itemTool.hideInteractionVisuals(),this.snappingManager.doneSnapping(),this.clearSelection()}undo(){let e=this._undoStack.pop();e!=null&&(e.undo(),this._redoStack.push(e),this._notifyHistoryChanged())}_syncObjects(e,t){let n=new Set(e==null?t:[e,...t]);for(let[e,t]of this._objectByItem)n.has(e)||(this._selectedItem===e&&this._setSelectedItem(null),this.removeHandles(t),this._itemTool.removeObject(t),this._objectByItem.delete(e),t.destroy());e!=null&&this._ensureObject(e);for(let e of t)this._ensureObject(e);this._setSelectedItem(this._selectedItem)}_ensureObject(e){if(this._objectByItem.has(e))return;let t=new c({analysisViewData:this.analysisViewData,intersector:this.intersector,item:e,view:this.view});this._objectByItem.set(e,t),this._itemTool.addObject(t),this.addHandles(t.on(`modified-externally`,()=>{this._selectedItem===e&&this._setSelectedItem(e)}),t)}_setSelectedItem(e){let t=e==null?null:this._objectByItem.get(e);this._selectedItem=t==null?null:e,this._itemTool.selectObject(t),this._moveTool.objects.removeAll(),t!=null&&this._moveTool.objects.add(t),this._itemTool.interacting=this._selectedItem!=null}_deleteTarget(e){if(this.analysis.targets.length<=1)return!1;let t=this.analysis.targets.indexOf(e);if(t<0)return!1;let n=o(e),r=this._selectedItem===e;return this.analysis.targets.remove(e),this._recordHistory({undo:()=>{s(n,e),this.analysis.targets.add(e,Math.min(t,this.analysis.targets.length)),r&&this._setSelectedItem(e)},redo:()=>this.analysis.targets.includes(e)&&this.analysis.targets.length<=1?!1:(this.analysis.targets.remove(e),this._selectedItem===e&&this._setSelectedItem(null),!0)}),!0}_recordHistory(e){this._undoStack.push(e),this._redoStack.length=0,this._notifyHistoryChanged()}_notifyHistoryChanged(){this.notifyChange(`canUndo`),this.notifyChange(`canRedo`)}get testInfo(){return{moveTooltip:this._tooltip}}};e([i({constructOnly:!0})],g.prototype,`analysisViewData`,void 0),e([i({constructOnly:!0})],g.prototype,`analysis`,void 0),e([i({constructOnly:!0})],g.prototype,`intersector`,void 0),e([i({constructOnly:!0})],g.prototype,`snappingManager`,void 0),e([i({constructOnly:!0})],g.prototype,`view`,void 0),e([i()],g.prototype,`visible`,null),e([i()],g.prototype,`manipulatorsInteractive`,null),e([i()],g.prototype,`_selectedItem`,void 0),e([i()],g.prototype,`active`,null),e([i()],g.prototype,`canRedo`,null),e([i()],g.prototype,`canUndo`,null),e([i()],g.prototype,`selectedItem`,null),e([i()],g.prototype,`updating`,null),g=e([a(`esri.views.3d.analysis.LineOfSight.LineOfSightEditTool`)],g);function _(e){return{undo:()=>{for(let t=e.length-1;t>=0;t--)e[t].undo(null)},redo:()=>{for(let t of e)t.redo(null);return!0}}}function v(e){return e.metadata.type===`observer`}function y(e){return e.metadata.type===`target`}export{g as LineOfSightEditTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import i from"../../../../core/ReactiveMap.js";import{initial as a,watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{create as d,fromPoints as f}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as p}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as m,LineOfSightTargetManipulator as h,LineOfSightTargetManipulatorState as g,getInteractiveLineOfSightTargetManipulatorState as _}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as v}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{mouseButtons as b}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as S,sceneSnappingAtLocation as C,dragManipulatedObject as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import i from"../../../../core/ReactiveMap.js";import{initial as a,watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{create as d,fromPoints as f}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as p}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as m,LineOfSightTargetManipulator as h,LineOfSightTargetManipulatorState as g,getInteractiveLineOfSightTargetManipulatorState as _}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as v}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{mouseButtons as b}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as S,sceneSnappingAtLocation as C,dragManipulatedObject as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{areToolManipulatorsEditable as E}from"../../../interactive/interactiveToolUtils.js";import{SnappingContext as D}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as O}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{enterInputModeIfAvailable as k}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{createScreenPointFromEvent as A}from"../../../support/screenUtils.js";const j=d(),M=Symbol(`inactiveManipulatorDisplay`);let N=class extends T{get _manipulatorsToHide(){let e=this._manipulatorByObject.values();return this.view.tools.some(e=>e.hasGrabbedManipulators)||e.some(e=>e.grabbing)?e.filter(e=>!e.grabbing).toArray():[]}constructor(e){super(e),this.events=new t,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new i,this._updatingHandles=new u,this._interactionVisuals=null,this._selectedManipulator=null,this._grabbedManipulator=null,this._visualsManipulator=null}initialize(){let{view:e}=this;this._interactionVisuals=new p({view:e}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(e=>({isTargetVisible:e.computationResult.isTargetVisible,isValid:e.computationResult.isValid,target:e.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),o(()=>this._manipulatorsToHide,e=>{let t=e.map(e=>e.disableDisplay());this.removeHandles(M),this.addHandles(t,M)},s)]),this.finishToolCreation()}destroy(){this.removeHandles(M),this._interactionVisuals=r(this._interactionVisuals),this._updatingHandles.destroy(),this._selectedManipulator=null,this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(e){this._visualsManipulator=this._manipulatorByObject.get(e),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(e){if(this._manipulatorByObject.has(e))return;let t=e.item.type===`observer`?new m(this.view,{deleting:!1,intersection:null,type:`observer`}):new h(this.view,{deleting:!1,target:e.item,type:`target`});t.cursor=`move`,this._objectByItem.set(e.item,e),this._manipulatorByObject.set(e,t),this.manipulators.add(t),this.addHandles(this._connectManipulator(e,t),e),this._syncManipulator(e,t)}removeObject(e){let t=this._manipulatorByObject.get(e);t!=null&&(this._grabbedManipulator===t&&(this._grabbedManipulator=null),this._selectedManipulator===t&&(this._selectedManipulator=null),this._visualsManipulator===t&&this.hideInteractionVisuals(),this.removeHandles(e),this._objectByItem.delete(e.item),this._manipulatorByObject.delete(e),this.manipulators.remove(t),t.destroy())}getManipulator(e){let t=this._objectByItem.get(e);return t==null?null:this._manipulatorByObject.get(t)}hasManipulatorAt(e,t){for(let n of this._manipulatorByObject.values())if(n.consumesClicks&&n.intersectionDistance(e,t)!=null)return!0;return!1}selectObject(e){this._selectedManipulator=e==null?null:this._manipulatorByObject.get(e);for(let e of this._manipulatorByObject.values())e.selected=e===this._selectedManipulator;return this._syncManipulators(),this._selectedManipulator!=null}onInputEvent(e){if(e.type===`immediate-click`&&!e.native.shiftKey&&this._selectedManipulator!=null){let t=A(e),n=this.view.tools.find(n=>E(n)&&n.manipulators.intersect(t,e.pointerType)!=null);n!==this&&n!==this.moveTool&&this.events.emit(`deselect-item`)}e.type===`hold`&&this._grabbedManipulator!=null&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),k(e,this.tooltip)}onManipulatorSelectionChanged(){let e=this._selectedManipulator;e==null||e.selected||(this.view.activeTool==null||this.moveTool.active?(e.selected=!0,this._syncManipulators()):this.events.emit(`deselect-item`))}_connectManipulator(e,t){let r=()=>this._syncManipulator(e,t);return n([e.on(`committed`,r),e.on(`modified-externally`,r),t.events.on(`immediate-click`,n=>{this.events.emit(`select-item`,{item:e.item}),n.button===b.Right&&t.metadata.type===`target`&&this.events.emit(`delete-item`,{target:t.metadata.target}),n.stopPropagation()}),t.events.on(`grab-changed`,({action:n})=>{n===`start`?(this.events.emit(`select-item`,{item:e.item}),this._grabbedManipulator=t):this._grabbedManipulator===t&&(this._grabbedManipulator=null,this.hideInteractionVisuals()),this._manipulatorByObject.set(e,t)}),t.events.on(`drag`,t=>{e.updateDragIntersection(t),t.action===`start`&&this.showInteractionVisuals(e)}),t.events.on(`location-update`,()=>this._syncInteractionVisuals()),this._createDragHandle(e,t)])}_createDragHandle(e,t){return x(t,(n,r,i,a)=>{let o=e.operations;if(o==null)return;let s=null,{cancelSnapping:c,snappingStep:l}=O({snappingContext:new D({editGeometryOperations:o,elevationInfo:e.elevationInfo,pointer:a,visualizer:new v}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});i.next(e=>(s?.undo(null),s=null,e)).next(c);let u=o.data.allVerticesUnordered.at(0);r.next(t=>(t.action===`start`&&(s=e.createUndoRecord()),{...t,snapOrigin:u?.pos})).next(S(this.view,t.elevationAlignedLocation)).next(y(this.view,o.data.geometry,e.elevationInfo,o.data.spatialReference)).next(C(this.view,e.elevationInfo)).next(...l).next(w(e)).next(e=>(e.action===`end`&&s!=null&&(this.events.emit(`record-undo`,{record:s}),s=null),e))})}_syncManipulators(){for(let[e,t]of this._manipulatorByObject)this._syncManipulator(e,t);this._syncInteractionVisuals()}_syncManipulator(e,t){let n=e.origin;if(t.available=this.visible&&e.visible&&n!=null,t.interactive=this.manipulatorsInteractive&&(this._grabbedManipulator==null||this._grabbedManipulator===t),n!=null&&(t.elevationAlignedLocation=n),e.item.type!==`target`)return;let r=this.analysisViewData.computations.find(t=>t.target===e.item),i=r==null||!r.computationResult.isValid?g.undefined:r.computationResult.isTargetVisible?g.visible:g.occluded;t.state=this.interacting&&t.selected?_(i):i}_syncInteractionVisuals(){let e=this._interactionVisuals,t=this._visualsManipulator,n=this.visible&&this.analysisViewData.visible;if(e==null||t==null||!n){e?.hide();return}let r=[...this._manipulatorByObject.entries()].find(([e])=>e.item.type===`observer`)?.[1];if(r==null){e.hide();return}let i=t===r?null:f(r.renderLocation,t.renderLocation,j);e.update({target:t.renderLocation,lineVerticalPlaneSegment:i,visible:!0})}};e([c({constructOnly:!0})],N.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],N.prototype,`moveTool`,void 0),e([c({constructOnly:!0})],N.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],N.prototype,`view`,void 0),e([c({constructOnly:!0})],N.prototype,`tooltip`,void 0),e([c()],N.prototype,`automaticManipulatorSelection`,void 0),e([c()],N.prototype,`removeIncompleteOnCancel`,void 0),e([c()],N.prototype,`interacting`,void 0),e([c()],N.prototype,`manipulatorsInteractive`,void 0),e([c()],N.prototype,`_grabbedManipulator`,void 0),e([c()],N.prototype,`_manipulatorsToHide`,null),e([c()],N.prototype,`updating`,null),N=e([l(`esri.views.3d.analysis.LineOfSight.LineOfSightItemTool`)],N);export{N as LineOfSightItemTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{watch as e}from"../../../../core/reactiveUtils.js";import{getObserverRGBA as t,observerConfiguration as n,targetConfiguration as r,getInteractiveTargetRGBA as i,lineOfSightTransparentRenderOrder as a}from"./LineOfSightConfiguration.js";import{Manipulator3D as o}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as s}from"../../interactive/manipulatorUtils.js";import{RenderObject as c}from"../../interactive/RenderObject.js";import{createSphereGeometry as l}from"../../webgl-engine/lib/GeometryUtil.js";const u=1024;class d extends o{constructor(r,i){let a=g(t(r.effectiveTheme)),o=l(a,
|
|
2
|
+
import{watch as e}from"../../../../core/reactiveUtils.js";import{getObserverRGBA as t,observerConfiguration as n,targetConfiguration as r,getInteractiveTargetRGBA as i,lineOfSightTransparentRenderOrder as a}from"./LineOfSightConfiguration.js";import{Manipulator3D as o}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as s}from"../../interactive/manipulatorUtils.js";import{RenderObject as c}from"../../interactive/RenderObject.js";import{createSphereGeometry as l}from"../../webgl-engine/lib/GeometryUtil.js";const u=1024;class d extends o{constructor(r,i){let a=g(t(r.effectiveTheme)),o=l(a,1,32,32),s=[new c(o)];super({view:r,renderObjects:s,metadata:i,radius:n.radius,elevationInfo:{mode:`absolute-height`,offset:0}}),this.themeHandle=e(()=>({color:t(r.effectiveTheme)}),e=>{a.setParameters(e)})}destroy(){this.themeHandle.remove(),super.destroy()}}class f extends o{constructor(t,n){let{radius:a,visibleColor:o,occludedColor:s,undefinedColor:d}=r,f=g(i(t.effectiveTheme)),p=[new c(l(f,1,32,32),u),h(o,2176),h(s,2304),h(d,2560)];super({view:t,renderObjects:p,metadata:n,radius:a,elevationInfo:{mode:`absolute-height`,offset:0}}),this.themeHandle=e(()=>({color:i(t.effectiveTheme)}),e=>{f.setParameters(e)})}destroy(){this.themeHandle.remove(),super.destroy()}}const p={visible:2176,occluded:2304,undefined:2560};function m(e){return e&-2049|u}function h(e,t){return new c(l(g(e.toUnitRGBA()),1,32,32),t)}function g(e){let t=s(e);return t.setParameters({testsTransparentRenderOrder:a.manipulator}),t}export{d as LineOfSightObserverManipulator,f as LineOfSightTargetManipulator,p as LineOfSightTargetManipulatorState,m as getInteractiveLineOfSightTargetManipulatorState};
|
|
@@ -66,24 +66,26 @@ export default class SunLighting extends SunLightingSuperclass {
|
|
|
66
66
|
/**
|
|
67
67
|
* Enables global illumination for more realistic lighting in the scene through ambient occlusion and emissive lighting.
|
|
68
68
|
* * **Ambient occlusion** darkens areas where surrounding geometry blocks ambient light, adding definition to corners, crevices, and spaces between buildings.
|
|
69
|
-
* * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate.
|
|
69
|
+
* * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate. See the [Visualizations with light-emitting symbols sample](/sample-code/light-emitting-symbols/) for more details on configuring emissive symbols.
|
|
70
70
|
*
|
|
71
71
|
* <figure>
|
|
72
72
|
* <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/views/3d/gi-onoff.avif"
|
|
73
73
|
* alt="Comparison of scene lighting with global illumination enabled and disabled" />
|
|
74
|
-
* <figcaption>Global illumination, enabled on the right,
|
|
74
|
+
* <figcaption>Global illumination, enabled on the right, provides more detailed ambient occlusion shading and emissive lighting.</figcaption>
|
|
75
75
|
* </figure>
|
|
76
76
|
*
|
|
77
|
-
* Global illumination
|
|
77
|
+
* Global illumination is a camera-dependent, screen-space approximation based on visible depth, surface normals, and recent frame data. It is not a physically exact lighting simulation or a scene-wide path tracer. Off-screen or hidden geometry cannot reliably provide indirect light.
|
|
78
|
+
* It is meant to be used mainly for visual context, not illumination measurements or lighting-compliance analysis.
|
|
79
|
+
*
|
|
80
|
+
* Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. After camera or scene changes, lighting settles over successive rendered frames. During navigation, reduced resolution trades detail for rendering cost.
|
|
78
81
|
*
|
|
79
|
-
* Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. Camera movements and animated objects may cause temporary noise or other visual artifacts.
|
|
80
82
|
*
|
|
81
83
|
* **Known limitations**
|
|
82
84
|
*
|
|
83
|
-
* -
|
|
84
|
-
* -
|
|
85
|
-
* -
|
|
86
|
-
* -
|
|
85
|
+
* - Global illumination is not supported with [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/): neither ambient occlusion nor emissive lighting will be computed for this layer.
|
|
86
|
+
* - [SceneView.takeScreenshot()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#takeScreenshot) uses a dedicated accumulation path to compute global illumination. Captures with global illumination enabled can therefore take substantially longer to finish.
|
|
87
|
+
* - Small emitters, or emitters that appear small on screen due to distance may produce only weak illumination. Increasing size, [emissive strength](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/Symbol3DEmissive/#strength) and enabling [glow](https://developers.arcgis.com/javascript/latest/references/core/webscene/Glow/) can help improve visibility, but cannot guarantee a particular light footprint or replace missing screen-space samples from arbitrary distances and angles.
|
|
88
|
+
* - Global illumination is disabled at high camera altitudes.
|
|
87
89
|
*
|
|
88
90
|
* @default false
|
|
89
91
|
* @beta
|
|
@@ -44,24 +44,26 @@ export default class VirtualLighting extends VirtualLightingSuperclass {
|
|
|
44
44
|
/**
|
|
45
45
|
* Enables global illumination for more realistic lighting in the scene through ambient occlusion and emissive lighting.
|
|
46
46
|
* * **Ambient occlusion** darkens areas where surrounding geometry blocks ambient light, adding definition to corners, crevices, and spaces between buildings.
|
|
47
|
-
* * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate.
|
|
47
|
+
* * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate. See the [Visualizations with light-emitting symbols sample](/sample-code/light-emitting-symbols/) for more details on configuring emissive symbols.
|
|
48
48
|
*
|
|
49
49
|
* <figure>
|
|
50
50
|
* <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/views/3d/gi-onoff.avif"
|
|
51
51
|
* alt="Comparison of scene lighting with global illumination enabled and disabled" />
|
|
52
|
-
* <figcaption>Global illumination, enabled on the right,
|
|
52
|
+
* <figcaption>Global illumination, enabled on the right, provides more detailed ambient occlusion shading and emissive lighting.</figcaption>
|
|
53
53
|
* </figure>
|
|
54
54
|
*
|
|
55
|
-
* Global illumination
|
|
55
|
+
* Global illumination is a camera-dependent, screen-space approximation based on visible depth, surface normals, and recent frame data. It is not a physically exact lighting simulation or a scene-wide path tracer. Off-screen or hidden geometry cannot reliably provide indirect light.
|
|
56
|
+
* It is meant to be used mainly for visual context, not illumination measurements or lighting-compliance analysis.
|
|
57
|
+
*
|
|
58
|
+
* Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. After camera or scene changes, lighting settles over successive rendered frames. During navigation, reduced resolution trades detail for rendering cost.
|
|
56
59
|
*
|
|
57
|
-
* Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. Camera movements and animated objects may cause temporary noise or other visual artifacts.
|
|
58
60
|
*
|
|
59
61
|
* **Known limitations**
|
|
60
62
|
*
|
|
61
|
-
* -
|
|
62
|
-
* -
|
|
63
|
-
* -
|
|
64
|
-
* -
|
|
63
|
+
* - Global illumination is not supported with [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/): neither ambient occlusion nor emissive lighting will be computed for this layer.
|
|
64
|
+
* - [SceneView.takeScreenshot()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#takeScreenshot) uses a dedicated accumulation path to compute global illumination. Captures with global illumination enabled can therefore take substantially longer to finish.
|
|
65
|
+
* - Small emitters, or emitters that appear small on screen due to distance may produce only weak illumination. Increasing size, [emissive strength](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/Symbol3DEmissive/#strength) and enabling [glow](https://developers.arcgis.com/javascript/latest/references/core/webscene/Glow/) can help improve visibility, but cannot guarantee a particular light footprint or replace missing screen-space samples from arbitrary distances and angles.
|
|
66
|
+
* - Global illumination is disabled at high camera altitudes.
|
|
65
67
|
*
|
|
66
68
|
* @default false
|
|
67
69
|
* @beta
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import n from"../../../../core/Error.js";import{disposable as r}from"../../../../core/handleUtils.js";import{translate as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as a,create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as s,scale as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as u,fromArray as d}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as p,create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as h}from"../../../../geometry/projection/projectBuffer.js";import{create as g,fromSubBuffer as _,intersectsClippingArea as v}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as y,doubleArrayFrom as b}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as x}from"../../../../geometry/support/FloatArray.js";import{getCoordinateEquals as S}from"../../../../geometry/support/geometryUtils.js";import{isDrivenOpacityFallbackAlwaysOpaque as C}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{needsElevationUpdates3D as w,evaluateElevationAlignmentAtPoint as ee,SampleElevationInfo as T}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as E}from"./Graphics3DObject3DGraphicLayer.js";import{maxPathLength as D}from"./Graphics3DPathSymbolLayerConstants.js";import{Graphics3DSymbolLayer as O,nanFallbackColor as k}from"./Graphics3DSymbolLayer.js";import{isValidSize as A}from"./graphicUtils.js";import{ConvertOptions as te,initFastSymbolUpdatesState as ne,updateFastSymbolUpdatesState as re,getSizeAttributeValue as ie,getAttributeValue as j}from"../support/FastSymbolUpdates.js";import{SamplePosition as M}from"../../support/ElevationProvider.js";import{Object3D as N}from"../../webgl-engine/lib/Object3D.js";import{Path as P}from"../../webgl-engine/lib/Path.js";import{PathBuilder as F}from"../../webgl-engine/lib/PathBuilder.js";import{RoundCapBuilder as I,TriangulationCapBuilder as L,NoCapBuilder as R}from"../../webgl-engine/lib/PathCapBuilder.js";import{PathExtruder as z}from"../../webgl-engine/lib/PathExtruder.js";import{PathGeometry as B,isPathGeometry as V}from"../../webgl-engine/lib/PathGeometry.js";import{computeMinimumRotationTangentFrame as H}from"../../webgl-engine/lib/pathGeometryUtils.js";import{quadProfiles as U,circleProfiles as W}from"../../webgl-engine/lib/PathProfile.js";import{newPathVertex as G}from"../../webgl-engine/lib/PathVertex.js";import{PathMaterial as K}from"../../webgl-engine/materials/PathMaterial.js";const q=[`polyline`];class J extends O{constructor(e,t,n,r){super(e,t,n,r,C(t)),this._intrinsicSize=u(1,1),this._upVectorAlignment=1,this.ensureDrapedStatus(!1)}_validateGeometry(e,t,n){return!super._validateGeometry(e,t,n)||e.type!==`polyline`?!1:!e.paths.some(e=>e.length>D)||(this.logger.warn(`Geometry has a path longer than ${D} vertices and cannot be displayed by PathSymbol3DLayer`),!1)}async doLoad(){let e=this.symbolLayer,t=e.width==null?e.height:e.width,r=e.height==null?t:e.height;this._vvConvertOptions=new te({supports:{size:!0,color:!0,rotation:!1,opacity:!0},modelSize:[1,1,1],symbolSize:[t,1,r],unitInMeters:this._context.renderCoordsHelper.unitInMeters,fallbackColor:this._getFallbackOpacityAndColor(k),fallbackSize:[t,1,r]});let i=this._context.renderer?.visualVariables;this._fastUpdates=i?.length?ne(this._context.renderer,this._vvConvertOptions):null;let a=e.anchor||`center`;this._upVectorAlignment=e.profileRotation===`heading`?0:1;let o=e.profile||`circle`;switch(o){default:case`circle`:this._profile=W[a];break;case`quad`:this._profile=U[a]}switch(e.join){case`round`:this._extruder=new z(2);break;default:case`bevel`:this._extruder=new z(1);break;case`miter`:this._extruder=new z(0)}switch(this._cap){case`none`:this._capBuilder=new R;break;case`butt`:default:this._capBuilder=new L(this._profile,1);break;case`square`:this._capBuilder=new L(this._profile,2);break;case`round`:{let e=o===`quad`;this._capBuilder=new I(this._profile,e);break}}let l=this._materialColor,u=this._getCombinedOpacityAndColor(l),f=p(u),m=u[3],h=this.needsDrivenTransparentPass,g=e.material?.emissive,_={diffuse:f,ambient:f,emissiveStrength:(g?.source===`color`?g?.strength:void 0)??0,emissiveSource:1,opacity:m,drivenOpacity:h,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows};if(!this._drivenProperties.size&&(s(this._intrinsicSize,t,r),!(A(this._intrinsicSize[0])&&A(this._intrinsicSize[1]))))throw new n(`graphics3dpathsymbollayer:invalid-size`,`Symbol sizes may not be negative values`);this._fastUpdates?.visualVariables.size||c(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters);let v=this._fastUpdates!=null,y=new K({..._,...this._fastUpdates?.materialParameters,size:d(this._intrinsicSize),upVectorAlignment:this._upVectorAlignment,profile:this._profile,pathCapType:this._capBuilder.type,cutoffAngle:this._extruder.cutoffAngle,pathJoinType:this._extruder.join,hasPathColor:!v&&this._drivenProperties.color,hasPathOpacity:!v&&this._drivenProperties.opacity&&!this._drivenProperties.color,hasPathSize:!v&&this._drivenProperties.size,usePBR:this._context.physicalBasedRenderingEnabled},this._context);this._materials[0]=y,this._updateTransparentDepedentMaterialParameters()}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,q,this.symbolLayer.type))return null;let n=this.createElevationContextForGraphic(t);return this._createAs3DShape(e,n)}layerOpacityChanged(){let e=this._materialColor,t=this._getCombinedOpacity(e),n=this._materials[0];n&&(n.setParameters({opacity:t}),this._updateTransparentDepedentMaterialParameters())}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,w)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled}),!0}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:if(re(this._fastUpdates,t,this._vvConvertOptions))this._materials[0]?.setParameters(this._fastUpdates.materialParameters);else return 0;break;default:return 0}return 2}_getVertexData(n){let r=0,i=n.paths,a=[],o=n.spatialReference,s=this._context.elevationProvider.spatialReference,c=this._context.renderCoordsHelper.spatialReference,l=S(n.hasZ),u=i.map(n=>{let r={stack:[],error:void 0,hasError:!1};try{let t=$;e(r,se,!1);for(let e=1;e<n.length;++e)l(n[e],n[e-1])&&t.add(e);return t.size===0?n:n.filter((e,n)=>!t.has(n))}catch(e){r.error=e,r.hasError=!0}finally{t(r)}});for(let e of u)r+=e.length;let d=y(r*3),f=0;for(let e of u){a.push({offset:f,numVertices:e.length});for(let t of e)d[f++]=t[0],d[f++]=t[1],d[f++]=n.hasZ?t[2]:0}if(s!=null&&!o.equals(s)&&!h(d,o,0,d,s,0,r))return null;let p;return s!=null&&!s.equals(c)?(p=y(r*3),h(d,s,0,p,c,0,r)):p=b(d),{pathVertexDataInfos:a,vertexDataES:d,vertexDataRS:p}}_createAs3DShape(e,t){let{graphic:n,renderingInfo:r}=e,s=n.geometry,c=this._getVertexData(s);if(c==null)return this.logger.warn(`PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)`),null;if(c.pathVertexDataInfos.length===0)return s.paths.length!==0&&s.paths.some(e=>e.length>0)||this.logger.warn(`PathSymbol3DLayer geometry failed to be created (no paths were defined)`),null;let l=[],u=g(),d=this._context.renderCoordsHelper,p=new M(c.vertexDataES),m=n.uid,h=x(c.vertexDataRS.length);for(let e of c.pathVertexDataInfos){let n=e.numVertices;if(n<2)continue;let s=e.offset;if(this._context.clippingExtent!=null&&(_(c.vertexDataES,s,n,u),!v(u,this._context.clippingExtent)))continue;let g=[],y=s+n*3;for(let e=s;e<y;e+=3){p.offset=e;let n=ee(p,this._context.elevationProvider,t,d);f(Z,c.vertexDataRS[e],c.vertexDataRS[e+1],c.vertexDataRS[e+2]),d.setAltitude(Z,n),c.vertexDataRS[e]=Z[0],c.vertexDataRS[e+1]=Z[1],c.vertexDataRS[e+2]=Z[2],g.push(G(this._upVectorAlignment))}let b=new P(g,c.vertexDataES,c.vertexDataRS,s,h);Y(b,this._upVectorAlignment,this._context.renderCoordsHelper);let x=new F(b,this._profile,this._extruder,this._capBuilder,this._upVectorAlignment),S=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:m,layerViewUid:this._context.layerViewUid}),C=new B(this._materials[0],x,this._getVisualVariableData(r),S);C.transformation=i(o(),a,x.path.origin),l.push(C)}if(l.length===0)return null;let y=new N({geometries:l,layerViewUid:this._context.layerViewUid,graphicUid:m}),b=new E(this,y,null,(e,t,n,r,i)=>oe(e,t,r,i,this._upVectorAlignment),t,null);return b.alignedSampledElevation=0,b.needsElevationUpdates=w(t.mode),b}_getVisualVariableData(e){if(this._fastUpdates){let{size:t,color:n,opacity:r}=this._fastUpdates.visualVariables;return{sizeAttributeValue:ie(t,e.size),colorAttributeValue:j(n,e.color),opacityAttributeValue:j(r,e.opacity)}}return{size:this._getDrivenSize(e),color:this._getDrivenColor(e),opacity:this._getDrivenOpacity(e)}}_getDrivenSize(e){if(!this._drivenProperties.size)return null;let t=e.size?.output??[`symbol-value`,`symbol-value`,`symbol-value`],n=u(X(t[0],t[2]===`symbol-value`?this.symbolLayer.height||0:t[2],this.symbolLayer.width||0),X(t[2],t[0]===`symbol-value`?this.symbolLayer.width||0:t[0],this.symbolLayer.height||0));return l(n,n,this._intrinsicSize),n}_getDrivenColor(e){return this._drivenProperties.color?this._getDrivenUInt8Color(e,this._materialColor,!1):null}_getDrivenOpacity(e){return this._drivenProperties.opacity&&!this._drivenProperties.color?e.opacity?.output??this._materialColor?.a??0:null}get _materialColor(){return this.symbolLayer.material?.color}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}get _cap(){return this.symbolLayer.cap||`butt`}_updateTransparentDepedentMaterialParameters(){let e=this._materials[0];e&&e.setParameters({cullFace:e.transparent||this._cap===`none`?0:2})}}function Y(e,t,n){let{origin:r,positions:i}=e,a=e.offset;switch(t){default:case 0:for(let t of e.vertices)Z[0]=i[a++]+r[0],Z[1]=i[a++]+r[1],Z[2]=i[a++]+r[2],n.worldUpAtPosition(Z,Z),t.setFrameFromUpVector(Z);break;case 1:Z[0]=i[a]+r[0],Z[1]=i[a+1]+r[1],Z[2]=i[a+2]+r[2],n.worldUpAtPosition(Z,Z),H(e,Z)}}function X(e,t,n){switch(e){case`symbol-value`:return n;case`proportional`:return t;default:return e}}function ae(e,t,n,r){let i=0,{origin:a,vertices:o,positions:s,positionsES:c}=e,l=e.offset+o.length*3;for(let t=e.offset;t<l;t+=3)f(Z,c[t],c[t+1],c[t+2]),n(Z,Q),i+=Q.sampledElevation,Z[0]=s[t]+a[0],Z[1]=s[t+1]+a[1],Z[2]=s[t+2]+a[2],r.setAltitude(Z,Q.z),s[t]=Z[0]-a[0],s[t+1]=Z[1]-a[1],s[t+2]=Z[2]-a[2];return e.updatePathVertexInformation(),i/o.length}function oe(e,t,n,r,i){let a=e.stageObject,o=a.geometries,s=0;for(let e of o){if(!V(e))continue;let o=e.builder.path;s+=ae(o,t,n,r),i!==0&&Y(o,i,r),e.onPathChanged(),a.geometryVertexAttributeUpdated(e,`position`)}return s/o.length}const Z=m(),Q=new T,$=new Set,se=r({remove:()=>$.clear()});export{J as Graphics3DPathSymbolLayer};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import n from"../../../../core/Error.js";import{disposable as r}from"../../../../core/handleUtils.js";import{translate as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as a,create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as s,scale as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as u,fromArray as d}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as p,create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as h}from"../../../../geometry/projection/projectBuffer.js";import{create as g,fromSubBuffer as _,intersectsClippingArea as v}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as y,doubleArrayFrom as b}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as x}from"../../../../geometry/support/FloatArray.js";import{getCoordinateEquals as S}from"../../../../geometry/support/geometryUtils.js";import{isDrivenOpacityFallbackAlwaysOpaque as ee}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{needsElevationUpdates3D as C,evaluateElevationAlignmentAtPoint as w,SampleElevationInfo as T}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as E}from"./Graphics3DObject3DGraphicLayer.js";import{maxPathLength as D}from"./Graphics3DPathSymbolLayerConstants.js";import{Graphics3DSymbolLayer as O,nanFallbackColor as k}from"./Graphics3DSymbolLayer.js";import{isValidSize as A}from"./graphicUtils.js";import{ConvertOptions as j,initFastSymbolUpdatesState as te,updateFastSymbolUpdatesState as ne,getSizeAttributeValue as re,getAttributeValue as M}from"../support/FastSymbolUpdates.js";import{SamplePosition as N}from"../../support/ElevationProvider.js";import{Object3D as P}from"../../webgl-engine/lib/Object3D.js";import{Path as F}from"../../webgl-engine/lib/Path.js";import{PathBuilder as I}from"../../webgl-engine/lib/PathBuilder.js";import{RoundCapBuilder as L,TriangulationCapBuilder as R,NoCapBuilder as z}from"../../webgl-engine/lib/PathCapBuilder.js";import{PathExtruder as B}from"../../webgl-engine/lib/PathExtruder.js";import{PathGeometry as V,isPathGeometry as H}from"../../webgl-engine/lib/PathGeometry.js";import{computeMinimumRotationTangentFrame as U}from"../../webgl-engine/lib/pathGeometryUtils.js";import{quadProfiles as W,circleProfiles as G}from"../../webgl-engine/lib/PathProfile.js";import{PathMaterial as K}from"../../webgl-engine/materials/PathMaterial.js";const q=[`polyline`];class J extends O{constructor(e,t,n,r){super(e,t,n,r,ee(t)),this._intrinsicSize=u(1,1),this._upVectorAlignment=1,this.ensureDrapedStatus(!1)}_validateGeometry(e,t,n){return!super._validateGeometry(e,t,n)||e.type!==`polyline`?!1:!e.paths.some(e=>e.length>D)||(this.logger.warn(`Geometry has a path longer than ${D} vertices and cannot be displayed by PathSymbol3DLayer`),!1)}async doLoad(){let e=this.symbolLayer,t=e.width==null?e.height:e.width,r=e.height==null?t:e.height;this._vvConvertOptions=new j({supports:{size:!0,color:!0,rotation:!1,opacity:!0},modelSize:[1,1,1],symbolSize:[t,1,r],unitInMeters:this._context.renderCoordsHelper.unitInMeters,fallbackColor:this._getFallbackOpacityAndColor(k),fallbackSize:[t,1,r]});let i=this._context.renderer?.visualVariables;this._fastUpdates=i?.length?te(this._context.renderer,this._vvConvertOptions):null;let a=e.anchor||`center`;this._upVectorAlignment=e.profileRotation===`heading`?0:1;let o=e.profile||`circle`;switch(o){default:case`circle`:this._profile=G[a];break;case`quad`:this._profile=W[a]}switch(e.join){case`round`:this._extruder=new B(2);break;default:case`bevel`:this._extruder=new B(1);break;case`miter`:this._extruder=new B(0)}switch(this._cap){case`none`:this._capBuilder=new z;break;case`butt`:default:this._capBuilder=new R(this._profile,1);break;case`square`:this._capBuilder=new R(this._profile,2);break;case`round`:{let e=o===`quad`;this._capBuilder=new L(this._profile,e);break}}let l=this._materialColor,u=this._getCombinedOpacityAndColor(l),f=p(u),m=u[3],h=this.needsDrivenTransparentPass,g=e.material?.emissive,_={diffuse:f,ambient:f,emissiveStrength:(g?.source===`color`?g?.strength:void 0)??0,emissiveSource:1,opacity:m,drivenOpacity:h,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows};if(!this._drivenProperties.size&&(s(this._intrinsicSize,t,r),!(A(this._intrinsicSize[0])&&A(this._intrinsicSize[1]))))throw new n(`graphics3dpathsymbollayer:invalid-size`,`Symbol sizes may not be negative values`);this._fastUpdates?.visualVariables.size||c(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters);let v=this._fastUpdates!=null,y=new K({..._,...this._fastUpdates?.materialParameters,size:d(this._intrinsicSize),upVectorAlignment:this._upVectorAlignment,profile:this._profile,pathCapType:this._capBuilder.type,cutoffAngle:this._extruder.cutoffAngle,pathJoinType:this._extruder.join,hasPathColor:!v&&this._drivenProperties.color,hasPathOpacity:!v&&this._drivenProperties.opacity&&!this._drivenProperties.color,hasPathSize:!v&&this._drivenProperties.size,usePBR:this._context.physicalBasedRenderingEnabled},this._context);this._materials[0]=y,this._updateTransparentDepedentMaterialParameters()}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,q,this.symbolLayer.type))return null;let n=this.createElevationContextForGraphic(t);return this._createAs3DShape(e,n)}layerOpacityChanged(){let e=this._materialColor,t=this._getCombinedOpacity(e),n=this._materials[0];n&&(n.setParameters({opacity:t}),this._updateTransparentDepedentMaterialParameters())}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,C)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return this._materials[0]?.setParameters({usePBR:this._context.physicalBasedRenderingEnabled}),!0}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:if(ne(this._fastUpdates,t,this._vvConvertOptions))this._materials[0]?.setParameters(this._fastUpdates.materialParameters);else return 0;break;default:return 0}return 2}_getVertexData(n){let r=0,i=n.paths,a=[],o=n.spatialReference,s=this._context.elevationProvider.spatialReference,c=this._context.renderCoordsHelper.spatialReference,l=S(n.hasZ),u=i.map(n=>{let r={stack:[],error:void 0,hasError:!1};try{let t=$;e(r,oe,!1);for(let e=1;e<n.length;++e)l(n[e],n[e-1])&&t.add(e);return t.size===0?n:n.filter((e,n)=>!t.has(n))}catch(e){r.error=e,r.hasError=!0}finally{t(r)}});for(let e of u)r+=e.length;let d=y(r*3),f=0;for(let e of u){a.push({offset:f,numVertices:e.length});for(let t of e)d[f++]=t[0],d[f++]=t[1],d[f++]=n.hasZ?t[2]:0}if(s!=null&&!o.equals(s)&&!h(d,o,0,d,s,0,r))return null;let p;return s!=null&&!s.equals(c)?(p=y(r*3),h(d,s,0,p,c,0,r)):p=b(d),{pathVertexDataInfos:a,vertexDataES:d,vertexDataRS:p}}_createAs3DShape(e,t){let{graphic:n,renderingInfo:r}=e,s=n.geometry,c=this._getVertexData(s);if(c==null)return this.logger.warn(`PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)`),null;if(c.pathVertexDataInfos.length===0)return s.paths.length!==0&&s.paths.some(e=>e.length>0)||this.logger.warn(`PathSymbol3DLayer geometry failed to be created (no paths were defined)`),null;let l=[],u=g(),d=this._context.renderCoordsHelper,p=new N(c.vertexDataES),m=n.uid,h=x(c.vertexDataRS.length);for(let e of c.pathVertexDataInfos){let n=e.numVertices;if(n<2)continue;let s=e.offset;if(this._context.clippingExtent!=null&&(_(c.vertexDataES,s,n,u),!v(u,this._context.clippingExtent)))continue;let g=s+n*3;for(let e=s;e<g;e+=3){p.offset=e;let n=w(p,this._context.elevationProvider,t,d);f(Z,c.vertexDataRS[e],c.vertexDataRS[e+1],c.vertexDataRS[e+2]),d.setAltitude(Z,n),c.vertexDataRS[e]=Z[0],c.vertexDataRS[e+1]=Z[1],c.vertexDataRS[e+2]=Z[2]}let y=new F(n,this._upVectorAlignment,c.vertexDataES,c.vertexDataRS,s,h);Y(y,this._upVectorAlignment,this._context.renderCoordsHelper);let b=new I(y,this._profile,this._extruder,this._capBuilder,this._upVectorAlignment),x=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:m,layerViewUid:this._context.layerViewUid}),S=new V(this._materials[0],b,this._getVisualVariableData(r),x);S.transformation=i(o(),a,b.path.origin),l.push(S)}if(l.length===0)return null;let y=new P({geometries:l,layerViewUid:this._context.layerViewUid,graphicUid:m}),b=new E(this,y,null,(e,t,n,r,i)=>ae(e,t,r,i,this._upVectorAlignment),t,null);return b.alignedSampledElevation=0,b.needsElevationUpdates=C(t.mode),b}_getVisualVariableData(e){if(this._fastUpdates){let{size:t,color:n,opacity:r}=this._fastUpdates.visualVariables;return{sizeAttributeValue:re(t,e.size),colorAttributeValue:M(n,e.color),opacityAttributeValue:M(r,e.opacity)}}return{size:this._getDrivenSize(e),color:this._getDrivenColor(e),opacity:this._getDrivenOpacity(e)}}_getDrivenSize(e){if(!this._drivenProperties.size)return null;let t=e.size?.output??[`symbol-value`,`symbol-value`,`symbol-value`],n=u(X(t[0],t[2]===`symbol-value`?this.symbolLayer.height||0:t[2],this.symbolLayer.width||0),X(t[2],t[0]===`symbol-value`?this.symbolLayer.width||0:t[0],this.symbolLayer.height||0));return l(n,n,this._intrinsicSize),n}_getDrivenColor(e){return this._drivenProperties.color?this._getDrivenUInt8Color(e,this._materialColor,!1):null}_getDrivenOpacity(e){return this._drivenProperties.opacity&&!this._drivenProperties.color?e.opacity?.output??this._materialColor?.a??0:null}get _materialColor(){return this.symbolLayer.material?.color}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}get _cap(){return this.symbolLayer.cap||`butt`}_updateTransparentDepedentMaterialParameters(){let e=this._materials[0];e&&e.setParameters({cullFace:e.transparent||this._cap===`none`?0:2})}}function Y(e,t,n){let{origin:r,positions:i}=e,a=e.offset;switch(t){default:case 0:for(let t=0;t<e.numVertices;++t)Z[0]=i[a++]+r[0],Z[1]=i[a++]+r[1],Z[2]=i[a++]+r[2],n.worldUpAtPosition(Z,Z),e.setFrameFromUpVector(t,Z);break;case 1:Z[0]=i[a]+r[0],Z[1]=i[a+1]+r[1],Z[2]=i[a+2]+r[2],n.worldUpAtPosition(Z,Z),U(e,Z)}}function X(e,t,n){switch(e){case`symbol-value`:return n;case`proportional`:return t;default:return e}}function ie(e,t,n,r){let i=0,{origin:a,numVertices:o,positions:s,positionsES:c}=e,l=e.offset+o*3;for(let t=e.offset;t<l;t+=3)f(Z,c[t],c[t+1],c[t+2]),n(Z,Q),i+=Q.sampledElevation,Z[0]=s[t]+a[0],Z[1]=s[t+1]+a[1],Z[2]=s[t+2]+a[2],r.setAltitude(Z,Q.z),s[t]=Z[0]-a[0],s[t+1]=Z[1]-a[1],s[t+2]=Z[2]-a[2];return e.updatePathVertexInformation(),i/o}function ae(e,t,n,r,i){let a=e.stageObject,o=a.geometries,s=0;for(let e of o){if(!H(e))continue;let o=e.builder.path;s+=ie(o,t,n,r),i!==0&&Y(o,i,r),e.onPathChanged(),a.geometryVertexAttributeUpdated(e,`position`)}return s/o.length}const Z=m(),Q=new T,$=new Set,oe=r({remove:()=>$.clear()});export{J as Graphics3DPathSymbolLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{isPromiseLike as e}from"../../../../core/promiseUtils.js";import{projectBuffer as t}from"../../../../geometry/projection/projectBuffer.js";import{
|
|
2
|
+
import{isPromiseLike as e}from"../../../../core/promiseUtils.js";import{projectBuffer as t}from"../../../../geometry/projection/projectBuffer.js";import{newDoubleArray as n,doubleSubArray as r}from"../../../../geometry/support/DoubleArray.js";import{applyPerVertexElevationAlignment as i}from"../../layers/graphics/elevationAlignmentUtils.js";import{load as a,axisFromRings as o,ringsToOutlinedTessellationInfo as s,tessellateOrLoad as c}from"../../layers/graphics/tessellationUtils.js";import{drapedZ as l}from"../../terrain/DrapedZ.js";async function u(){return a()}class d{constructor(e,t,n,r){this.positions=e,this.polygonIndices=t,this.outline=n,this.projectionSuccess=r,this.count=e.length/3}get vertexCount(){return this.positions.length/3}get polygonIndexCount(){return this.polygonIndices.length}get outlineIndexCount(){let{outline:e}=this;if(e.output!==`tessellated-indices`)return 0;let t=0;for(let n=0;n<e.outlineIndices.length;n++)t+=w(e.outlineIndices[n]);return t}get outlineSegmentCount(){let{outline:e}=this;if(e.output!==`tessellated-indices`)return 0;let t=0;for(let n=0;n<e.outlineIndices.length;n++){let r=w(e.outlineIndices[n]);t+=r}return t}}class f extends d{}class p extends d{}class m extends d{constructor(e,t,n,r,i,a){super(e,n,r,i),this.mapPositions=t,this.sampledElevation=a}}function h(t,n){let r=v(t,n);return e(r)?null:r}function g(t,n,r,i,a){let o=b(t,n,r,i,a);return e(o)?null:o}function _(t,n){let r=y(t,n);return e(r)?null:r}function v(t,n){let{projectIfNearlyVertical:r=!1,outlineOutput:i=`none`,method:a,owner:l}=n??{},u=i===`tessellated-indices`,d=o(t.rings,!!t.hasZ,t.spatialReference),f=s(t.rings,{hasZ:!!t.hasZ,ccwRingsAsHoles:!0,spatialReference:t.spatialReference,axis:d}),m=c(f,{projectionAxis:r?d:void 0,outlines:u?f.outlines:void 0,method:a,owner:l});if(e(m))return m;if(!m.succeeded)return null;let h={output:`none`};if(i===`vertex-data`){let e=m.positions===f.positions?f.positions.slice():f.positions;h={output:`vertex-data`,outlines:x(f.outlines,e)}}else i===`tessellated-indices`&&(h=S(m));return new p(m.positions,m.indices,h,!0)}function y(n,r){let{drapedSpatialReference:i,projectIfNearlyVertical:a=!1,outlineOutput:u=`none`,method:d,owner:p}=r,m=o(n.rings,!1,n.spatialReference),h=s(n.rings,{hasZ:!1,ccwRingsAsHoles:!0,spatialReference:n.spatialReference,axis:m}),g=u!==`none`,_=t(h.positions,n.spatialReference,0,h.positions,i,0),v=c(h,{projectionAxis:a?m:void 0,outlines:g?h.outlines:void 0,method:d,owner:p});if(e(v))return v;if(!v.succeeded)return null;let{positions:y,indices:b}=v;for(let e=2;e<y.length;e+=3)y[e]=l;let C={output:`none`};if(u===`vertex-data`){if(y!==h.positions)for(let e=2;e<h.positions.length;e+=3)h.positions[e]=l;let e=y===h.positions?h.positions.slice():h.positions;C={output:`vertex-data`,outlines:x(h.outlines,e)}}else u===`tessellated-indices`&&(C=S(v));return new f(y,b,C,_)}function b(t,r,a,l,u){let{projectIfNearlyVertical:d=!1,outlineOutput:f=`none`,method:p,owner:h}=u??{},g=f!==`none`,_=!!t.hasZ&&l.mode!==`on-the-ground`,v=o(t.rings,_,t.spatialReference),y=s(t.rings,{hasZ:_,ccwRingsAsHoles:!0,spatialReference:t.spatialReference,axis:v}),b=c(y,{projectionAxis:d?v:void 0,outlines:g?y.outlines:void 0,method:p,owner:h});if(e(b))return b;if(!b.succeeded)return null;let{positions:x,vertexCount:w}=b,T=n(x.length),E=i(x,t.spatialReference,0,T,0,x,0,w,r,a,l),D={output:`none`};f===`vertex-data`?D={output:`vertex-data`,outlines:C(b,T)}:f===`tessellated-indices`&&(D=S(b));let O=E!=null;return new m(x,T,b.indices,D,O,E)}function x(e,t,n=null){return e.values().filter(({count:e})=>e>1).map(({index:e,count:i})=>{let a=e*3,o=i*3;return n==null?new T(e,i,r(t,a,o)):new E(e,i,r(t,a,o),r(n,a,o))}).toArray()}function S(e){let{outlineIndexBuffer:t,outlineRingLengths:n}=e;if(t==null||n==null)return{output:`none`};let r=Array(n.length),i=0;for(let e=0;e<n.length;e++){let a=n[e],o=t.slice(i,i+a);r[e]=o,i+=a}return{output:`tessellated-indices`,outlineIndices:r}}function C(e,t){let{outlineIndexBuffer:i,outlineRingLengths:a,positions:o}=e;if(i==null||a==null)return[];let s=0;for(let e=0;e<a.length;e++)s+=a[e]-1;let c=n(s*3),l=n(s*3),u=[],d=0,f=0;for(let e=0;e<a.length;e++){let n=a[e],s=n-1;for(let e=0;e<s;e++){let n=i[d+e]*3,r=(f+e)*3;c[r]=o[n],c[r+1]=o[n+1],c[r+2]=o[n+2],l[r]=t[n],l[r+1]=t[n+1],l[r+2]=t[n+2]}u.push(new E(f,s,r(c,f*3,s*3),r(l,f*3,s*3))),d+=n,f+=s}return u}function w(e,t=0,n=e.length){return n>1&&e[t]===e[t+n-1]?n-1:n}class T{constructor(e,t,n){this.index=e,this.count=t,this.position=n}}class E extends T{constructor(e,t,n,r){super(e,t,n),this.mapPositions=r}}export{E as OutlineVertexData,T as OutlineVertexDataDraped,d as PolygonRenderInfoBase,f as PolygonRenderInfoDraped,m as PolygonRenderInfoElevationAligned,p as PolygonRenderInfoNotElevationAligned,u as loadTessellationUtils,y as polygonToRenderInfoDraped,b as polygonToRenderInfoElevationAligned,v as polygonToRenderInfoNotElevationAligned,_ as preloadedPolygonToRenderInfoDraped,g as preloadedPolygonToRenderInfoElevationAligned,h as preloadedPolygonToRenderInfoNotElevationAligned,S as splitOutlineIndexRings,C as tessellatedOutlineIndicesToVertexData};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clamp as e,isPowerOfTwo as t}from"../../../core/mathUtils.js";import{maxUint16 as n}from"../../../core/typedArrayUtil.js";import{empty as r}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as i}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as a,sampleSingleElevation as o}from"./ElevationData.js";import{PatchGeometryLUT as s}from"./PatchGeometryLUT.js";import{zeroToFour as c,neighborTileIfLoadedOrSelf as l}from"./PatchRenderData.js";import{maxPatchTesselation as u,elevationNoDataValue as d}from"./TerrainConst.js";import{internalAssert as f,enableTerrainInternalChecks as p,neighborEdgeIndices as m,almostEquals as h}from"./terrainUtils.js";import{isCornerNeighbor as g}from"./Tile.js";import{compareTilesByLij as _}from"./tileUtils.js";import{compressNormal as v}from"../webgl-engine/lib/Normals.js";function y(e,t){let{tile:n,geometry:i,geometryState:a}=e,{extentInRadians:o,surface:s}=n,{isWebMercator:c,renderer:l}=s,{numVerticesPerSide:u,wireframe:d}=a,f=u-1,p=(u-2)**2,m=c&&(t===2||t===3),h=c&&(t===1||t===3),g=(+!!m+ +!!h)*we*u,_=xe(a),v=4*_,y=p+g+v,S=l.tileGeometryCache.acquire(y);i.numVerticesPerSide=u,i.vertexAttributes=S,i.maxEdgeVertexCount=_;let{boundingBox:C}=i;r(C);let w=P(e);$.update(f,o,w),x(e),i.poleVerticesStartIndex=p;let T=b(e,m,h);i.edgeVerticesStartIndex=p+g,X(e),O(e),W(i,T,d),e.intersectionData=null}function b(e,t,r){let{tile:i,localOrigin:a,geometry:o}=e,{extent:s,ellipsoid:c}=i,{boundingBox:l,numVerticesPerSide:u,vertexAttributes:d,poleVerticesStartIndex:f}=o,p=u-1,m=a[0],h=a[1],g=a[2],_=c.radius,y=s[1],b=s[3],x=[],S=f,C=(e,t)=>{let r=t*u;be(-m,-h,-g+e*_,l),x.push(new oe(e===1,r,e===1?0:2,S,we));let i=j(e===-1?y:b,_),a=e*Math.PI/2-i,o=(e===1?1:-1)*.99,s=_+0,{position:c,uv0:f}=d,{typedBuffer:C,typedBufferStride:w}=d.normalCompressed;for(let e=1;e<=we;++e){let t=i+e/we*a,r=Math.cos(t),u=Math.sin(t);for(let e=0;e<=p;e++){let t=e/p,i=$.sinLonLUT[e],a=$.cosLonLUT[e]*r,d=i*r,_=u,y=a*s-m,b=d*s-h,x=_*s-g;be(y,b,x,l),c.setValues(S,y,b,x),f.setValues(S,Math.round(t*n),Math.round(o*n)),v(C,S,a,d,_,w),++S}}};return t&&C(-1,0),r&&C(1,p),x}function x(e){let t=e.geometryState.samplerData,n=t?.length===1?t[0]:null;n?S(e,n):C(e)}function S(e,t){let{tile:n}=e;if(!n.intersectsClippingArea)return;let{geometry:r,geometryState:i,localOrigin:a}=e,{numVerticesPerSide:o}=i,s=o-2,c=o-1,{vertexAttributes:l,boundingBox:u}=r,{position:d,uv0:f}=l,{typedBuffer:p,typedBufferStride:m}=l.normalCompressed,{extent:h}=n,g=n.ellipsoid.radius,_=a[0],y=a[1],b=a[2],x=d.typedBuffer,S=d.typedBufferStride,C=f.typedBuffer,E=f.typedBufferStride;w(c,h,t);let D=0,O=t.data.values;if(1<=s){let e=le[1],t=$.sinLatLUT[1],n=$.cosLatLUT[1];for(let r=1;r<=s;r++){let i=$.sinLonLUT[r],a=$.cosLonLUT[r],o=g+T(r,1,O),s=-_+o*a*n,c=-y+o*i*n,l=-b+o*t;be(s,c,l,u);let d=(r-1)*S;x[d]=s,x[d+1]=c,x[d+2]=l;let f=(r-1)*E;C[f]=le[r],C[f+1]=e}}for(let e=1;e<=s;e++){let t=$.sinLatLUT[e],n=$.cosLatLUT[e],r=e+1,i=le[r],a=$.sinLatLUT[r],o=$.cosLatLUT[r],l=$.sinLonLUT[0],d=$.cosLonLUT[0],f=g+T(0,e,O),h=d*n*f-_,w=l*n*f-y,k=t*f-b,A=D*S,j=x[A],M=x[A+1],N=x[A+2];for(let l=1;l<=s;l++){let d=$.sinLonLUT[l],f=$.cosLonLUT[l],A=0,P=0,F=0;if(l<s){let e=(D+1)*S;A=x[e],P=x[e+1],F=x[e+2]}else{let r=$.sinLonLUT[c],i=$.cosLonLUT[c],a=g+T(c,e,O);A=i*n*a-_,P=r*n*a-y,F=t*a-b}let I=h,L=w,R=k;h=j,w=M,k=N,j=A,M=P,N=F;let z=A-I,B=P-L,V=F-R,H=0,U=0,ee=0;if(e>1){let e=(D-s)*S;H=x[e],U=x[e+1],ee=x[e+2]}else{let e=$.sinLatLUT[0],t=$.cosLatLUT[0],n=g+T(l,0,O);H=f*t*n-_,U=d*t*n-y,ee=e*n-b}let W=g+T(l,r,O),G=f*o*W-_,K=d*o*W-y,q=a*W-b;if(e<s){let e=D+s,t=e*S;x[t]=G,x[t+1]=K,x[t+2]=q,be(G,K,q,u);let n=e*E;C[n]=le[l],C[n+1]=i}let te=H-G,J=U-K,Y=ee-q,X=f*n,Z=d*n,ne=t;ne*ne<.999&&(X=V*J-B*Y,Z=z*Y-V*te,ne=B*te-z*J);let Q=1/Math.sqrt(X*X+Z*Z+ne*ne);v(p,D,X*Q,Z*Q,ne*Q,m),++D}}}function C(e){let{tile:t}=e;if(!t.intersectsClippingArea)return;let{geometry:r,geometryState:i,localOrigin:o}=e,{numVerticesPerSide:s,samplerData:c}=i,l=s-2,u=s-1,{vertexAttributes:d,boundingBox:f}=r,{position:p,uv0:m}=d,{typedBuffer:h,typedBufferStride:g}=d.normalCompressed,{extent:_}=t,y=_[0],b=_[2],x=_[1],S=_[3],C=t.ellipsoid.radius,w=o[0],T=o[1],E=o[2],D=p.typedBuffer,O=p.typedBufferStride,k=1/u,A=0;if(1<=l){let e=k,t=x*(1-e)+S*e,r=$.sinLatLUT[1],i=$.cosLatLUT[1];for(let o=1;o<=l;o++){let s=o*k,l=y*(1-s)+b*s,u=$.sinLonLUT[o],d=$.cosLonLUT[o],p=C+a(l,t,c),h=-w+p*d*i,g=-T+p*u*i,_=-E+p*r;be(h,g,_,f);let v=(o-1)*O;D[v]=h,D[v+1]=g,D[v+2]=_,m.setValues(o-1,Math.round(s*n),Math.round(e*n))}}for(let e=1;e<=l;e++){let t=e*k,r=x*(1-t)+S*t,i=$.sinLatLUT[e],o=$.cosLatLUT[e],s=e+1,d=s*k,p=x*(1-d)+S*d,_=$.sinLatLUT[s],j=$.cosLatLUT[s],M=$.sinLonLUT[0],N=$.cosLonLUT[0],P=C+a(y,r,c),F=N*o*P-w,I=M*o*P-T,L=i*P-E,R=A*O,z=D[R],B=D[R+1],V=D[R+2];for(let t=1;t<=l;t++){let s=t*k,S=y*(1-s)+b*s,M=$.sinLonLUT[t],N=$.cosLonLUT[t],P=0,R=0,H=0;if(t<l){let e=(A+1)*O;P=D[e],R=D[e+1],H=D[e+2]}else{let e=$.sinLonLUT[u],t=$.cosLonLUT[u],n=C+a(b,r,c);P=t*o*n-w,R=e*o*n-T,H=i*n-E}let U=F,ee=I,W=L;F=z,I=B,L=V,z=P,B=R,V=H;let G=P-U,K=R-ee,q=H-W,te=0,J=0,Y=0;if(e>1){let e=(A-l)*O;te=D[e],J=D[e+1],Y=D[e+2]}else{let e=$.sinLatLUT[0],t=$.cosLatLUT[0],n=C+a(S,x,c);te=N*t*n-w,J=M*t*n-T,Y=e*n-E}let X=C+a(S,p,c),Z=N*j*X-w,ne=M*j*X-T,Q=_*X-E;if(e<l){let e=A+l,t=e*O;D[t]=Z,D[t+1]=ne,D[t+2]=Q,be(Z,ne,Q,f),m.setValues(e,Math.round(s*n),Math.round(d*n))}let re=te-Z,ie=J-ne,ae=Y-Q,oe=N*o,se=M*o,ce=i;ce*ce<.999&&(oe=q*ie-K*ae,se=G*ae-q*re,ce=K*re-G*ie);let le=1/Math.sqrt(oe*oe+se*se+ce*ce);v(h,A,oe*le,se*le,ce*le,g),++A}}}function w(t,r,i){let a=r[0],o=r[2],s=r[1],c=r[3],l=1/t,{dx:u,dy:d,x0:f,y1:p,safeWidth:m}=i,h=i.data.width;for(let r=0;r<=t;r++){let t=r*l,i=e(u*(a*(1-t)+o*t-f),0,m),g=Math.floor(i);ue[r]=g,pe[r]=i-g;let _=e(d*(p-(s*(1-t)+c*t)),0,m),v=Math.floor(_);de[r]=v*h,fe[r]=(v+1)*h,me[r]=_-v,le[r]=Math.round(t*n)}}function T(e,t,n){let r=ue[e],i=pe[e],a=de[t],o=fe[t],s=me[t],c=a+r,l=n[c],u=n[c+1],d=n[o+r],f=n[o+r+1];if(l+d+u+f>=ce)return 0;let p=l+(u-l)*i;return p+(d+(f-d)*i-p)*s}function E(e){e.tile.intersectsClippingArea&&(O(e),ie(e),e.intersectionData=null)}function D(e){e.tile.intersectsClippingArea&&(Z(e),O(e),ie(e),ae(e),e.intersectionData=null)}function O(e){e.tile.intersectsClippingArea&&(A(e),k(e))}function k(e){let{geometry:r,geometryState:i,tile:s,localOrigin:c}=e,{level:u,extent:d,extentInRadians:g,ellipsoid:y}=s,b=y.radius,x=g[0],S=g[2],C=g[1],w=g[3],{samplerData:T}=i,E=d[0],D=d[2],O=d[1],k=d[3],A=P(e),{boundingBox:j,vertexAttributes:M}=r,N=c[0],F=c[1],I=c[2],{position:L,uv0:R}=M,z=L.typedBuffer,B=L.typedBufferStride,V=R.typedBuffer,H=R.typedBufferStride,{typedBuffer:U,typedBufferStride:ee}=M.normalCompressed,W=T?.length===1?T[0]:null,G=(e,t,n)=>W?o(e,t,W)??0:a(e,t,T)??0;for(let c=0;c<4;++c){let g=c===1||c===3,y=i.edgeResolutions[c];f(t(y));let M=y+1,P=l(s,i.edgePeerNeighbors[c]);if(_e(s,P,c)&&ne(e,c,P))continue;let L=P!=null;f(!L||P.level===s.level),f(!L||_(s,P)<=0);let R=P?.renderData?.geometryState;if(p){let e=s.surface;if(!P&&e&&!e.updatingRootTiles){let t=m[c],n=s.findNeighborTile(t,e=>e.loaded||e.leaf||e.level===s.level);n?n.intersectsClippingArea&&(f(!n.loaded),f(!n.leaf),f(n.level===u)):f(e?.rootTiles==null||!s.shouldHaveNeighbor(t))}}let K=c===1?d[2]:d[0],q=P?.extent,te=q&&g?c===1?q[0]:q[2]:K,J=c===0?d[3]:d[1],Y=+(c===1),X=+(c===0),Z=c===1?S:x,Q=c===0?w:C,re=Math.sin(Z),ie=Math.cos(Z),ae=Math.sin(Q),oe=Math.cos(Q),se=R?.samplerData,$=se?.length===1?se[0]:null,ce=(e,t,n)=>$?o(n,t,$)??0:a(n,t,se)??0,le=L?(e,t,n)=>(G(e,t)+ce(e,t,n))*.5:G,ue=r.outerEdgesOffsetAndLength[c*2+0],de=W!=null||T!=null&&T.some(e=>e!=null),fe=$!=null||se!=null&&se.some(e=>e!=null),pe=de||fe,me=1/y,he=n*me,ge=Y*n,ve=X*n,ye=ue;f(!q||h(q[2]-q[0],d[2]-d[0])),(()=>{let e=c===1?-1:+(c===3),t=c===0?-1:+(c===2),n=(d[2]-d[0])*me,r=e*n,i=t*n,s=S-x,l=g?s*me*e:0,u=g?0:t*me,f=X,p=g?Z+l:Z,m=g?Math.sin(p):re,h=g?Math.cos(p):ie,_=g?Z-l:Z,y=g?Math.sin(_):re,C=g?Math.cos(_):ie,w=f+u,P=g?Q:A(w),R=g?ae:Math.sin(P),G=g?oe:Math.cos(P),q=f-u,Y=g?Q:A(q),ne=g?ae:Math.sin(Y),ce=g?oe:Math.cos(Y),ue=0,de=0,fe=0;{let e=0*me,t=g?K:E*(1-e)+D*e,n=g?te:t,r=g?O*(1-e)+k*e:J,i=g?Z:x*(1-e)+S*e,a=g?re:Math.sin(i),o=g?ie:Math.cos(i),s=g?A(e):Q,c=g?Math.sin(s):ae,l=g?Math.cos(s):oe,u=b+le(t,r,n);ue=o*l*u,de=a*l*u,fe=c*u}let _e=0,xe=0,Se=0;{let e=1*me,t=g?K:E*(1-e)+D*e,n=g?te:t,r=g?O*(1-e)+k*e:J,i=g?Z:x*(1-e)+S*e,a=g?re:Math.sin(i),o=g?ie:Math.cos(i),s=g?A(e):Q,c=g?Math.sin(s):ae,l=g?Math.cos(s):oe,u=b+le(t,r,n);_e=o*l*u,xe=a*l*u,Se=c*u}for(let e=1;e<M-1;++e){let t=0,n=0,s=0;{let r=(e+1)*me,i=g?K:E*(1-r)+D*r,a=g?te:i,o=g?O*(1-r)+k*r:J,c=g?Z:x*(1-r)+S*r,l=g?re:Math.sin(c),u=g?ie:Math.cos(c),d=g?A(r):Q,f=g?Math.sin(d):ae,p=g?Math.cos(d):oe,m=b+le(i,o,a);t=u*p*m,n=l*p*m,s=f*m}let l=t,u=n,d=s,f=_e,p=xe,_=Se;_e=l,xe=u,Se=d;{let t=ye+e,n=t*B,r=f-N,i=p-F,a=_-I;z[n]=r,z[n+1]=i,z[n+2]=a,be(r,i,a,j);let o=Math.round(e*he),s=t*H;V[s]=g?ge:o,V[s+1]=g?o:ve}let w=ue,M=de,P=fe;ue=f,de=p,fe=_;let q=f,Y=p,X=_,Ce=1/Math.sqrt(q*q+Y*Y+X*X),we=X*Ce,Te=0,Ee=0,De=0;if(pe&&we*we<.999){let t=0,n=0,s=0;{let e=c===0?-1:1;t=e*(l-w),n=e*(u-M),s=e*(d-P)}{let l=e*me,u=g?K:E*(1-l)+D*l,d=g?te:u,f=g?O*(1-l)+k*l:J,p=g?Z:x*(1-l)+S*l,_=g?re:Math.sin(p),v=g?ie:Math.cos(p),w=g?A(l):Q,j=g?Math.sin(w):ae,M=g?Math.cos(w):oe,N=q,P=Y,F=X;if(L){let e=d-r,t=f-i,n=b+($?o(e,t,$)??0:a(e,t,se)??0),s=g?y:_,c=g?C:v,l=g?j:ne,u=g?M:ce;N=c*u*n,P=s*u*n,F=l*n}{let e=u+r,l=f+i,d=b+(W?o(e,l,W)??0:a(e,l,T)??0),p=g?m:_,y=g?h:v,x=g?j:R,S=g?M:G,C=y*S*d,w=p*S*d,E=x*d;L||(N=2*q-C,P=2*Y-w,F=2*X-E);let D=c===3?-1:1,O=D*(N-C),k=D*(P-w),A=D*(F-E);Te=s*k-n*A,Ee=t*A-s*O,De=n*O-t*k;let I=1/Math.sqrt(Te*Te+Ee*Ee+De*De);Te*=I,Ee*=I,De*=I}}}else Te=q*Ce,Ee=Y*Ce,De=X*Ce;v(U,ye+e,Te,Ee,De,ee)}})()}}function A(e){Q(e)}function j(e,t){return Math.PI/2-2*Math.atan(Math.exp(-e/t))}function M(e,t,n,r){return j(e*(1-r)+t*r,n)}function N(e,t,n){return e*(1-n)+t*n}function P(e){let{tile:t}=e;if(t.surface.isWebMercator){let e=t.extent,n=t.ellipsoid.radius;return t=>M(e[1],e[3],n,t)}let n=t.extentInRadians;return e=>N(n[1],n[3],e)}function F(e){let{tile:t,geometryState:n,geometry:i}=e,{extent:a,surface:o}=t,{wireframe:s}=n,c=a[0],l=a[1],u=a[2],d=a[3],f=u-c,p=d-l,{numVerticesPerSide:m,clippingArea:h}=n,g=h==null?0:Math.max(0,(h[0]-c)/f),_=h==null?0:Math.max(0,(h[1]-l)/p),v=h==null?1:Math.min(1,(h[2]-c)/f),y=h==null?1:Math.min(1,(h[3]-l)/p),b=(m-2)**2,x=xe(n),S=b+4*x,C=o.renderer.tileGeometryCache.acquire(S),{boundingBox:w}=i;r(w),i.numVerticesPerSide=m,i.vertexAttributes=C,i.maxEdgeVertexCount=x,i.minu=g,i.minv=_,i.maxu=v,i.maxv=y,I(e),i.edgeVerticesStartIndex=b,X(e),z(e),W(i,[],s),e.intersectionData=null}function I(t){let r=t.tile;if(!r.intersectsClippingArea)return;let{geometry:i,geometryState:s,localOrigin:c}=t,{samplerData:l,clippingArea:u,numVerticesPerSide:d}=s,{surface:f,extent:p,ellipsoid:m}=r,{isWebMercatorOnPlateCarree:h}=f,g=u??he,_=p[0],y=p[1],b=p[2],x=p[3],S=Math.max(_,g[0]),C=Math.min(b,g[2]),w=Math.max(y,g[1]),T=Math.min(x,g[3]),E=m.radius,D=r.horizontalScale,O=d-1,k=d-2,{minu:A,minv:j,maxu:M,maxv:N,boundingBox:P,vertexAttributes:F}=i,{position:I,uv0:L}=F,{typedBuffer:R,typedBufferStride:z}=F.normalCompressed,B=c[0],V=c[1],H=c[2],U=I.typedBuffer,ee=I.typedBufferStride,W=0,G=e(y,w,T),K=h?(Math.PI/2-2*Math.atan(Math.exp(-G/E)))*E:G*D,q=1/O,te=e(y*(1-q)+x*q,w,T),J=h?(Math.PI/2-2*Math.atan(Math.exp(-te/E)))*E:te*D,Y=K,X=J,Z=l?.length===1?l[0]:null,ne=Z?(e,t)=>o(e,t,Z)??0:(e,t)=>a(e,t,l)??0;for(let t=1;t<=k;t++){let r=t/O,i=e(y*(1-r)+x*r,w,T),a=e(r,j,N),o=X,s=(t-1)/O,c=e(y*(1-s)+x*s,w,T),l=Y,u=(t+1)/O,d=e(y*(1-u)+x*u,w,T),f=h?(Math.PI/2-2*Math.atan(Math.exp(-d/E)))*E:d*D,p=e(u,j,N);Y=X,X=f;let m=e(_,S,C),g=m*D,F=ne(m,i),I=1/O,G=e(I,A,M),K=e(_*(1-G)+b*G,S,C),q=G,te=K,J=K*D,Z=ne(K,i);if(t===1){let t=J-B,r=Y-V,i=Z-H,o=0*ee;U[o]=t,U[o+1]=r,U[o+2]=i,be(t,r,i,P);let s=e(I,A,M);L.setValues(W,Math.round(s*n),Math.round(a*n))}for(let r=1;r<=k;r++){let s=J,u=Z,m=(r+1)/O,h=e(m,A,M),y=e(_*(1-m)+b*m,S,C),x=te;te=y;{let e=W+1,s=e*ee;if(t===1||r===k){let c=ne(y,i),l=y*D,u=o,d=c;if(t===1&&r<k){let t=l-B,r=u-V,i=d-H;U[s]=t,U[s+1]=r,U[s+2]=i,be(t,r,i,P),L.setValues(e,Math.round(h*n),Math.round(a*n))}J=l,Z=d}else J=U[s]+B,Z=U[s+2]+H}let w=J,T=Z,E=g,j=F;g=s,F=u;let N=(W-k)*ee,I=t===1?ne(x,c):U[N+2]+H,G=ne(x,d);if(t<k){let e=W+k,t=e*ee,r=s-B,i=f-V,a=G-H;U[t]=r,U[t+1]=i,U[t+2]=a,be(r,i,a,P);let o=q;q=h,L.setValues(e,Math.round(o*n),Math.round(p*n))}{let e=w-E,t=T-j,n=l-f,r=I-G,i=n*t,a=e*r,o=-n*e,s=i*i+a*a+o*o;if(s===0)v(R,W,0,0,1,z);else{let e=1/Math.sqrt(s);v(R,W,i*e,a*e,o*e,z)}}++W}}}function L(e){e.tile.intersectsClippingArea&&(Z(e),z(e),ie(e),ae(e),e.intersectionData=null)}function R(e){e.tile.intersectsClippingArea&&(z(e),ie(e),e.intersectionData=null)}function z(e){e.tile.intersectsClippingArea&&(V(e),B(e))}function B(n){let{geometry:r,geometryState:i,localOrigin:s}=n,c=n.tile,{surface:u,extent:d}=c,{clippingArea:h,samplerData:g}=i,v=h??he,y=d[0],b=d[2],x=d[1],S=d[3],C=[S>v[3],b>v[2],x<v[1],y<v[0]],w=c.horizontalScale,T=ee(u.isWebMercatorOnPlateCarree,c.ellipsoid.radius,w),{minu:E,minv:D,maxu:O,maxv:k,boundingBox:A}=r,j=Math.max(y,v[0]),M=Math.min(b,v[2]),N=Math.max(x,v[1]),P=Math.min(S,v[3]),F=s[0],I=s[1],L=s[2],R=g?.length===1?g[0]:void 0,z=R?(e,t)=>o(e,t,R)??0:(e,t)=>a(e,t,g)??0;for(let s=0;s<4;++s){let d=s===1||s===3,h=i.edgeResolutions[s];f(t(h));let v=h+1,R=C[s],B=l(c,i.edgePeerNeighbors[s]);if(!R&&_e(c,B,s)&&ne(n,s,B))continue;let V=B!=null&&!R,H=B?.renderData?.geometryState;if(p&&(f(!V||B.level===c.level),f(!V||_(c,B)<=0),c&&!B&&!u.updatingRootTiles)){let e=m[s],t=c.findNeighborTile(e,e=>e.loaded||e.leaf||e.level===c.level);u.updatingRootTiles||(t?t.intersectsClippingArea&&(f(!t.loaded),f(!t.leaf),f(t.level===c.level)):f(u?.rootTiles==null||!c.shouldHaveNeighbor(e)))}let U=e(s===1?b:y,j,M),ee=e(s===0?S:x,N,P),W=H?.samplerData,G=e(+(s===1),E,O),K=e(+(s===0),D,k),q=W?.length===1?W[0]:null,te=(e,t)=>q?o(e,t,q)??0:a(e,t,W)??0,J=V?(e,t)=>(te(e,t)+z(e,t))*.5:z,Y=(b-y)/h,X=d?s===1?Y:-Y:0,Z=d?0:s===0?Y:-Y,Q=-X,re=-Z,ie=0,ae=0,oe=0;{let t=0/h,n=d?U:e(y*(1-t)+b*t,j,M),r=d?e(x*(1-t)+S*t,N,P):ee,i=J(n,r);ie=n*w,ae=T(r),oe=i}let se=0,$=0,ce=0;{let t=1/h,n=d?U:e(y*(1-t)+b*t,j,M),r=d?e(x*(1-t)+S*t,N,P):ee,i=J(n,r),a=n*w,o=T(r),s=i;se=a,$=o,ce=s}for(let t=1;t<v-1;++t){let n=t/h,i=se,o=$,c=ce;{let a=d?G:e(n,E,O),l=d?e(n,D,k):K,u=i-F,f=o-I,p=c-L;be(i,f,p,A),r.setEdgeVertexFromValuesRawPositionUV(s,t,u,f,p,a,l)}{let n=(t+1)/h,r=d?U:e(y*(1-n)+b*n,j,M),i=d?e(x*(1-n)+S*n,N,P):ee,a=J(r,i);se=r*w,$=T(i),ce=a}let l=se,u=$,f=ce,p=ie,m=ae,_=oe;ie=i,ae=o,oe=c;let v=0,C=0,R=0;if(d){let t=u-o,r=f-c,l=m-o,d=_-c,p=e(x*(1-n)+S*n,N,P),h=U+Q,y=p,b=h*w,T=a(h,y,g),E=b-i,D=T-c,O=s===3?-1:1;if(v=O*(-l+t)*D,C=O*E*(-d+r),R=-O*E*(-l+t),V){let e=U+X,n=p,o=e*w,s=a(e,n,W),u=o-i,f=s-c;v=(-l+t)*(D-f),C=(E-u)*(-d+r),R=-(E-u)*(-l+t)}}else{let t=l-i,r=f-c,u=p-i,d=_-c,m=e(y*(1-n)+b*n,j,M),h=m,x=ee+re,S=a(h,x,g)-c,w=T(x)-o,E=s===2?-1:1;if(v=E*w*(-d+r),C=E*(-u+t)*S,R=-E*w*(-u+t),V){let e=m,n=ee+Z,i=T(n),s=a(e,n,W)-c,l=i-o;v=(-w+l)*(-d+r),C=(-u+t)*(-S+s),R=-(-w+l)*(-u+t)}}let z=1/Math.sqrt(v*v+C*C+R*R);r.setEdgeNormalFromValues(s,t,v*z,C*z,R*z)}}}function V(e){Q(e)}function H(e,t){return(Math.PI/2-2*Math.atan(Math.exp(-e/t)))*t}function U(e,t){return e*t}function ee(e,t,n){return e?e=>H(e,t):e=>U(e,n)}function W(e,t,n){let{numVerticesPerSide:r,vertexAttributes:i,maxEdgeVertexCount:a}=e,o=r-1,s=i.count,l=r-3,u=r-3,d=2*l*u,f=4*(o+a-3),p=c.reduce((t,n)=>t+(o+e.getEdgeCount(n)-3),0),m=t.reduce((e,t)=>e+o*((t.latitudeResolution-1)*2+1),0),h=3*(n?2:1),g=(d+f+m)*h;e.indices=s>=65536?new Uint32Array(g):new Uint16Array(g),e.indexCount=(d+p+m)*h,e.poleIndicesStartIndex=d*h,e.edgeIndicesStartIndex=(d+m)*h,n?(te(e),J(e,t),Y(e)):(G(e),K(e,t),q(e))}function G(e){let{numVerticesPerSide:t,indices:n,vertexAttributes:r}=e,{position:i}=r,{typedBuffer:a,typedBufferStride:o}=i,s=t-2,c=t-3,l=t-3,u=0;for(let e=0;e<c;++e){let t=e*s;for(let e=0;e<l;++e){let r=t+e,i=r+1,c=i+s,l=c-1;Se(r,i,c,l,o,a)?(n[u]=r,n[u+1]=i,n[u+2]=c,n[u+3]=c,n[u+4]=l,n[u+5]=r):(n[u]=r,n[u+1]=i,n[u+2]=l,n[u+3]=l,n[u+4]=i,n[u+5]=c),u+=6}}}function K(e,t){let{numVerticesPerSide:n,indices:r,poleIndicesStartIndex:i}=e,a=n-1,o=i;for(let i of t){let t=i.isNorth?1:2,s=i.isNorth?2:1,c=i.isNorth?3:4,l=i.isNorth?4:3,u=e.getEdgeVertexIndex(i.connectedOuterEdgeOffset,0),d=1;for(let e=0;e<i.latitudeResolution;++e){let f=e===0?i.rowOffset:u+n;for(let n=0;n<a;n++){let a=f+n;r[o]=u,r[o+t]=u+1,r[o+s]=a,e<i.latitudeResolution-1?(r[o+c]=u+1,r[o+l]=a+1,r[o+5]=a,o+=6):o+=3,u+=d}u=f,d=1}}}function q(e){let{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:r}=e,i=n-1,a=i-2,o=r;for(let n=0;n<4;++n){let r=ye[n],s=0,c=0,l=e.getEdgeCount(n),u=r.count;f(u===i-1);let d=n===1||n===2,p=d?1:2,m=d?2:1,h=e.getEdgeFirstVertexIndex(n),g=r.vertex0Index,_=r.stride;for(;s<l-1||c<u-1;){let e=g+c*_,n=h+s*1,r=s<l-1,d=c<u-1,f=r?0+i*(s+.5)/(l-1):0,v=d?1+a*(c+.5)/(u-1):0,y=r&&(!d||f<=v);y?++s:++c;let b=y?n+1:e+_;t[o]=e,t[o+p]=n,t[o+m]=b,o+=3}}e.indexCount=o}function te(e){let{indices:t,numVerticesPerSide:n,vertexAttributes:r}=e,{position:i}=r,{typedBuffer:a,typedBufferStride:o}=i,s=n-2,c=0;for(let e=0;e<n-3;++e){let r=e*s;for(let i=0;i<n-3;++i){let n=e*s+i,l=n+1,u=l+s,d=u-1,f=r+i,p=f+1,m=p+s;Se(f,p,m,m-1,o,a)?(Ce(t,c,n,l,u),c+=6,Ce(t,c,u,d,n)):(Ce(t,c,n,l,d),c+=6,Ce(t,c,d,u,l)),c+=6}}}function J(e,t){let{indices:n,numVerticesPerSide:r,poleIndicesStartIndex:i}=e,a=r-1,o=i;for(let i of t){let t=i.connectedOuterEdgeOffset,s=e.getEdgeVertexIndex(t,0),c=1;for(let e=0;e<i.latitudeResolution;++e){let t=e===0?i.rowOffset:s+r;for(let r=0;r<a;r++)Ce(n,o,s,s+1,t+r),o+=6,e<i.latitudeResolution-1&&(Ce(n,o,s+1,t+r+1,t+r),o+=6),s+=c;s=t,c=1}}}function Y(e){let{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:r}=e,i=n-1,a=i-2,o=r;for(let n=0;n<4;++n){let r=ye[n],s=0,c=0,l=e.getEdgeCount(n),u=r.count;f(u===i-1);let d=n===1||n===2,p=d?1:3,m=d?3:1,h=e.getEdgeFirstVertexIndex(n),g=r.vertex0Index,_=r.stride;for(;s<l-1||c<u-1;){let e=g+c*_,n=h+s*1,r=s<l-1,d=c<u-1,f=r?0+i*(s+.5)/(l-1):0,v=d?1+a*(c+.5)/(u-1):0,y=r&&(!d||f<=v);y?++s:++c;let b=y?n+1:e+_;t[o]=e,t[o+p]=n,t[o+p+1]=n,t[o+m]=b,t[o+m+1]=b,t[o+5]=e,o+=6}}e.indexCount=o}function X(e){let{geometry:t,geometryState:n}=e,{edgeResolutions:r}=n,{numVerticesPerSide:i,edgeVerticesStartIndex:a}=t,o=i-2,s=a;for(let e=0;e<4;++e){{let t=e===1?o-1:0,n=e===0?o-1:0,r=e===0||e===2,i=+!!r,a=+!r,s=n*o+t,c=a*o+i,l=ye[e];l.vertex0Index=s,l.stride=c,l.count=o}{let n=r[e]+1;t.outerEdgesOffsetAndLength[e*2+0]=s,t.outerEdgesOffsetAndLength[e*2+1]=n,s+=n}}}function Z(e){X(e),e.geometryState.wireframe?Y(e.geometry):q(e.geometry)}function ne(r,i,a){let{geometryState:o,geometry:s,tile:c,localOrigin:l}=r,u=i===1||i===3,d=o.edgeResolutions[i];f(t(d));let p=d+1,{boundingBox:m,minu:h,minv:g,maxu:_,maxv:v,vertexAttributes:y}=s,b=e(+(i===1),h,_),x=e(+(i===0),g,v),S=a.renderData,C=S.geometryState;if(!C||!S.geometry.vertexAttributes)return!1;let w=S.geometry,T=(i+2)%4,E=w.getEdgeCount(T),D=c.getNeighborEdgeStartVertexIndex(i,a)*d,O=d*2**(c.level-a.level);f(C.edgeResolutions[T]===O),f(E-1===O);let k=S.localOrigin[0]-l[0],A=S.localOrigin[1]-l[1],j=S.localOrigin[2]-l[2],M=s.getEdgeFirstVertexIndex(i),{position:N,uv0:P}=y,F=N.typedBuffer,I=N.typedBufferStride,L=y.normalCompressed,R=L.typedBuffer,z=L.typedBufferStride,B=w.vertexAttributes,V=w.getEdgeFirstVertexIndex(T),H=B.position.typedBuffer,U=B.position.typedBufferStride,ee=B.normalCompressed.typedBuffer,W=B.normalCompressed.typedBufferStride;for(let t=1;t<p-1;++t){let r=D+t,i=M+t,a=V+r,o=i*I,s=a*U,c=H[s]+k,l=H[s+1]+A,f=H[s+2]+j;F[o]=c,F[o+1]=l,F[o+2]=f,be(c,l,f,m);let p=i*z,y=a*W;R[p]=ee[y],R[p+1]=ee[y+1];let S=t/d,C=u?b:e(S,h,_),w=u?e(S,g,v):x;P.setValues(i,Math.round(C*n),Math.round(w*n))}return!0}function Q(t){let{geometry:r,geometryState:i,localOrigin:o}=t,{clippingArea:s,samplerData:c}=i,{minu:l,minv:u,maxu:d,maxv:p,boundingBox:m,vertexAttributes:h}=r,g=t.tile,{surface:v,ellipsoid:y,extent:b,extentInRadians:x,horizontalScale:S}=g,C=v.view?.viewingMode===`local`,w=y.radius,T=0,E=0,D=0,O=C?(()=>{let t=s,n=t!=null&&(b[3]>t[3]||b[2]>t[2]||b[1]<t[1]||b[0]<t[0]),r=ee(v.isWebMercatorOnPlateCarree,w,S);return(i,a,o)=>{let s=i===0?b[0]:b[2],c=a===0?b[1]:b[3],l=n?e(s,t[0],t[2]):s,u=n?e(c,t[1],t[3]):c,d=o;T=l*S,E=r(u),D=d}})():(e,t,n)=>{let r=x[t===0?1:3],i=x[e===0?0:2],a=Math.cos(r),o=Math.sin(r),s=Math.sin(i),c=Math.cos(i),l=w+n;T=c*a*l,E=s*a*l,D=o*l},k=0,A=0,j=0,M=0,N=0,F=0,I=0,L=0,R=0,z=C&&v.isWebMercatorOnPlateCarree,B=(e,t,n,r,i)=>{let a=0,o=0,s=0;if(C){let e=t*S,i=z?(Math.PI/2-2*Math.atan(Math.exp(-n/w)))*w:n*S,c=r;a=e-T,o=i-E,s=c-D}else{let i=P(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]),p=u[0]*(1-d)+u[2]*d,m=i(f),h=Math.cos(m),g=Math.sin(m),_=Math.sin(p),v=Math.cos(p),y=w+r,b=v*h*y,x=_*h*y,S=g*y;a=b-T,o=x-E,s=S-D}switch(i){case 0:I+=a,L+=o,R+=s;break;case 1:M-=a,N-=o,F-=s;break;case 2:I-=a,L-=o,R-=s;break;case 3:M+=a,N+=o,F+=s}},V=s??he,H=b[0],U=b[2],W=b[1],G=b[3],K=[G>V[3],U>V[2],W<V[1],H<V[0]],q=Math.max(H,V[0]),te=Math.min(U,V[2]),J=Math.max(W,V[1]),Y=Math.min(G,V[3]),X=e=>Math.max(V[0],Math.min(V[2],e)),Z=e=>Math.max(V[1],Math.min(V[3],e)),ne=e=>{let t=i.cornerNeighborCornerTiles;k=0,A=0,j=1,M=0,N=0,F=0,I=0,L=0,R=0;let n=1/0;for(let r=0;r<4;++r){let i=t[e*4+r];n=Math.min(n,i?.level??1/0)}for(let r=0;r<4;++r){let i=t[e*4+r];ge[r]=i?.level===n?i:null}let r=1,o=0;for(let e=0;e<4;++e){let t=ge[e];t&&(r=Math.max(r,t?.renderData.geometryState.numVerticesPerSide),o=t.extent[2]-t.extent[0])}let s=o,c=r;f(c>1);let l=s/c;for(let e=0;e<4;++e){let t=ge[(e+3)%4],n=ge[e%4];if(!t&&!n)continue;let r=e===0?1:e===1?2:e===2?3:0,i=e===0?2:e===1?3:e===2?0:1;if(t&&n){let o=se[e][0]*l,s=se[e][1]*l,c=t.extent,u=X(c[r===0||r===1?2:0]+o),d=Z(c[r===0||r===3?3:1]+s),f=n.extent,p=X(f[i===0||i===1?2:0]+o),m=Z(f[i===0||i===3?3:1]+s),h=t.renderData,g=n.renderData,_=a(u,d,h.geometryState.samplerData),v=a(p,m,g.geometryState.samplerData);B(h,u,d,.5*(_+v),e)}else{let o=t??n,s=t?r:i,c=o.extent,u=se[e],d=X(c[s===0||s===1?2:0]+u[0]*l),f=Z(c[s===0||s===3?3:1]+u[1]*l),p=o.renderData,m=a(d,f,p.geometryState.samplerData);B(p,d,f,m,e)}}if(!C){let e=Math.sqrt(T*T+E*E+D*D);k=T/e,A=E/e,j=D/e}if(C||j*j<.999){let e=Math.sqrt(M*M+N*N+F*F);M/=e,N/=e,F/=e;let t=Math.sqrt(I*I+L*L+R*R);I/=t,L/=t,R/=t,k=F*L-N*R,A=M*R-F*I,j=N*I-M*L;let n=1/Math.sqrt(k*k+A*A+j*j);k*=n,A*=n,j*=n}},Q=i.cornerNeighborCornerTiles;for(let t=0;t<4;++t){let s=t,v=(t+1)%4,y=+(t===0||t===1),b=+(t===0||t===3),x=e(y,l,d),S=e(b,u,p),C=r.getEdgeFirstVertexIndex(s),w=r.getEdgeCount(s),M=t===0||t===3?w-1:0,N=r.getEdgeFirstVertexIndex(v),P=r.getEdgeCount(v),F=t===0||t===1?P-1:0,I=-1;for(let e=0;e<4;++e){let n=Q[t*4+e],r=Q[t*4+I];n&&(I===-1||_(r,n)>0)&&(I=e)}let L=I,R=Q[t*4+L];if(R!==g){let e=g.level-R.level,r=2**e,a=[R.lij[0]+e,R.lij[1]*r,R.lij[2]*r],s=[a[1]+r===g.lij[1],t===0&&(L===1||L===0&&R!==Q[t*4+3])||t===1&&(L===0||L===1&&R!==Q[t*4+2]),a[1]===g.lij[1]+1,t===2&&(L===3||L===2&&R!==Q[t*4+1])||t===3&&(L===2||L===3&&R!==Q[t*4+0])],c=s.reduce((e,t)=>e+ +!!t,0);f(c===1||c===2);let l=-1,u=-1,d=R.renderData;if(c===1){let e=s.findIndex(e=>e);f(0<=e&&e<=3),l=(e+2)%4;let n=i.edgeResolutions[e];u=g.getNeighborEdgeStartVertexIndex(e,R)*n+n*+(e===0&&t===0||e===1&&t===0||e===2&&t===1||e===3&&t===3)}else{f(s[1]||s[3]),l=s[1]?3:1;let e=d.geometryState.edgeResolutions[l];u=t===0||t===3?0:e}let p=d.geometry;{let e=C+M,t=N+F,r=p.getEdgeFirstVertexIndex(l)+u,i=p.vertexAttributes,a=d.localOrigin,s=i.position,c=s.typedBuffer,f=r*s.typedBufferStride,g=c[f]+a[0]-o[0],_=c[f+1]+a[1]-o[1],v=c[f+2]+a[2]-o[2];be(g,_,v,m);let y=h.position,b=y.typedBuffer,w=e*y.typedBufferStride;b[w]=g,b[w+1]=_,b[w+2]=v;let T=t*y.typedBufferStride;b[T]=g,b[T+1]=_,b[T+2]=v;let E=h.uv0;E.setValues(e,Math.round(x*n),Math.round(S*n)),E.setValues(t,Math.round(x*n),Math.round(S*n));{let n=i.normalCompressed.typedBuffer,a=r*i.normalCompressed.typedBufferStride,o=h.normalCompressed,s=o.typedBuffer;{let t=e*o.typedBufferStride;s[t]=n[a],s[t+1]=n[a+1]}{let e=t*o.typedBufferStride;s[e]=n[a],s[e+1]=n[a+1]}}}}else{let n=K[s],i=K[v],l;if(n||i){let t=e(H*(1-y)+U*y,q,te),n=e(W*(1-b)+G*b,J,Y);l=a(t,n,c)}else l=re(Q,t);O(y,b,l),ne(t);let u=T-o[0],d=E-o[1],f=D-o[2];be(u,d,f,m),r.setEdgeVertexFromValuesRawPositionUVNormal(s,M,u,d,f,x,S,k,A,j),r.setEdgeVertexFromValuesRawPositionUVNormal(v,F,u,d,f,x,S,k,A,j)}}for(let e=0;e<4;++e)ge[e]=null}function re(e,t){let n=t*4,r=c.reduce((t,r)=>Math.min(t,e[n+r]?.level??1/0),1/0);p&&(f(!e[n+0]||!e[n+2]||g(e[n+0],e[n+2],5)),f(!e[n+1]||!e[n+3]||g(e[n+1],e[n+3],7)));let i=0,o=0;for(let t=0;t<4;++t){let s=e[n+t];if(s?.level===r){let e=t===0||t===1,n=t===0||t===3,r=s.extent,c=r[e?0:2],l=r[n?1:3],u=s.renderData?.geometryState?.samplerData,d=a(c,l,u);o+=d,i++}}let s=i?o/i:0;return f(s!=null),s}function ie(e){let{vao:t,geometry:n}=e,{vertexAttributes:r,edgeVerticesStartIndex:i}=n,{position:a}=r,o=a.typedBuffer,s=i*a.typedBufferStride;t.buffer()?.setSubData(o,s,s,o.length)}function ae(e){let{vao:t,geometry:n}=e,{indices:r,indexCount:i,edgeIndicesStartIndex:a}=n;t.indexBuffer.setSubData(r,a,a,i)}class oe{constructor(e,t,n,r,i){this.isNorth=e,this.connectedRowOffset=t,this.connectedOuterEdgeOffset=n,this.rowOffset=r,this.latitudeResolution=i}}const se=[[0,1],[1,0],[0,-1],[-1,0]],$=new s,ce=.5*d,le=new Uint16Array(u+1),ue=new Int32Array(u+1),de=new Int32Array(u+1),fe=new Int32Array(u+1),pe=new Float64Array(u+1),me=new Float64Array(u+1),he=i(-1/0,-1/0,1/0,1/0),ge=[null,null,null,null];function _e(e,t,n){if(!t)return!1;let r=_(e,t);return r>0||r===0&&n>=2}class ve{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(e){return f(0<=e&&e<this.count),this.vertex0Index+this.stride*e}}const ye=[new ve,new ve,new ve,new ve];function be(e,t,n,r){e<r[0]?r[0]=e:e>r[3]&&(r[3]=e),t<r[1]?r[1]=t:t>r[4]&&(r[4]=t),n<r[2]?r[2]=n:n>r[5]&&(r[5]=n)}function xe(e){let{edgeResolutions:t,numVerticesPerSide:n}=e,r=1+Math.max(...t);return Math.max(n,r)}function Se(e,t,n,r,i,a){let o=e*i,s=a[o],c=a[o+1],l=a[o+2],u=t*i,d=a[u],f=a[u+1],p=a[u+2],m=n*i,h=a[m],g=a[m+1],_=a[m+2],v=r*i,y=a[v],b=a[v+1],x=a[v+2],S=(s-h)*(s-h)+(c-g)*(c-g)+(l-_)*(l-_);return(d-y)*(d-y)+(f-b)*(f-b)+(p-x)*(p-x)>S}function Ce(e,t,n,r,i){e[t]=n,e[t+1]=r,e[t+2]=r,e[t+3]=i,e[t+4]=i,e[t+5]=n}const we=6;export{F as createPlanarGlobePatch,y as createSphericalGlobePatch,L as updateEdgeElevationsAndResolutionsPlanar,D as updateEdgeElevationsAndResolutionsSpherical,R as updateEdgesAndCornersPlanar,E as updateEdgesAndCornersSpherical};
|
|
2
|
+
import{clamp as e,isPowerOfTwo as t}from"../../../core/mathUtils.js";import{maxUint16 as n}from"../../../core/typedArrayUtil.js";import{empty as r}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as i}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as a,sampleSingleElevation as o}from"./ElevationData.js";import{PatchGeometryLUT as s}from"./PatchGeometryLUT.js";import{zeroToFour as c,neighborTileIfLoadedOrSelf as l}from"./PatchRenderData.js";import{maxPatchTesselation as u,elevationNoDataValue as d}from"./TerrainConst.js";import{internalAssert as f,enableTerrainInternalChecks as p,neighborEdgeIndices as m,almostEquals as h}from"./terrainUtils.js";import{isCornerNeighbor as g}from"./Tile.js";import{compareTilesByLij as _}from"./tileUtils.js";import{compressNormal as v}from"../webgl-engine/lib/Normals.js";function y(e,t){let{tile:n,geometry:i,geometryState:a}=e,{extentInRadians:o,surface:s}=n,{isWebMercator:c,renderer:l}=s,{numVerticesPerSide:u,wireframe:d}=a,f=u-1,p=(u-2)**2,m=c&&(t===2||t===3),h=c&&(t===1||t===3),g=(+!!m+ +!!h)*Ee*u,_=xe(a),v=4*_,y=p+g+v,S=l.tileGeometryCache.acquire(y);i.numVerticesPerSide=u,i.vertexAttributes=S,i.maxEdgeVertexCount=_;let{boundingBox:C}=i;r(C);let w=P(e);$.update(f,o,w),x(e),i.poleVerticesStartIndex=p;let T=b(e,m,h);i.edgeVerticesStartIndex=p+g,J(e),O(e,we,Te),U(i,T,d),e.intersectionData=null}function b(e,t,r){let{tile:i,localOrigin:a,geometry:o}=e,{extent:s,ellipsoid:c}=i,{boundingBox:l,numVerticesPerSide:u,vertexAttributes:d,poleVerticesStartIndex:f}=o,p=u-1,m=a[0],h=a[1],g=a[2],_=c.radius,y=s[1],b=s[3],x=[],S=f,C=(e,t)=>{let r=t*u;be(-m,-h,-g+e*_,l),x.push(new oe(e===1,r,e===1?0:2,S,Ee));let i=j(e===-1?y:b,_),a=e*Math.PI/2-i,o=(e===1?1:-1)*.99,s=_+0,{position:c,uv0:f}=d,{typedBuffer:C,typedBufferStride:w}=d.normalCompressed;for(let e=1;e<=Ee;++e){let t=i+e/Ee*a,r=Math.cos(t),u=Math.sin(t);for(let e=0;e<=p;e++){let t=e/p,i=$.sinLonLUT[e],a=$.cosLonLUT[e]*r,d=i*r,_=u,y=a*s-m,b=d*s-h,x=_*s-g;be(y,b,x,l),c.setValues(S,y,b,x),f.setValues(S,Math.round(t*n),Math.round(o*n)),v(C,S,a,d,_,w),++S}}};return t&&C(-1,0),r&&C(1,p),x}function x(e){let t=e.geometryState.samplerData,n=t?.length===1?t[0]:null;n?S(e,n):C(e)}function S(e,t){let{tile:n}=e;if(!n.intersectsClippingArea)return;let{geometry:r,geometryState:i,localOrigin:a}=e,{numVerticesPerSide:o}=i,s=o-2,c=o-1,{vertexAttributes:l,boundingBox:u}=r,{position:d,uv0:f}=l,{typedBuffer:p,typedBufferStride:m}=l.normalCompressed,{extent:h}=n,g=n.ellipsoid.radius,_=a[0],y=a[1],b=a[2],x=d.typedBuffer,S=d.typedBufferStride,C=f.typedBuffer,E=f.typedBufferStride;w(c,h,t);let D=0,O=t.data.values;if(1<=s){let e=le[1],t=$.sinLatLUT[1],n=$.cosLatLUT[1];for(let r=1;r<=s;r++){let i=$.sinLonLUT[r],a=$.cosLonLUT[r],o=g+T(r,1,O),s=-_+o*a*n,c=-y+o*i*n,l=-b+o*t;be(s,c,l,u);let d=(r-1)*S;x[d]=s,x[d+1]=c,x[d+2]=l;let f=(r-1)*E;C[f]=le[r],C[f+1]=e}}for(let e=1;e<=s;e++){let t=$.sinLatLUT[e],n=$.cosLatLUT[e],r=e+1,i=le[r],a=$.sinLatLUT[r],o=$.cosLatLUT[r],l=$.sinLonLUT[0],d=$.cosLonLUT[0],f=g+T(0,e,O),h=d*n*f-_,w=l*n*f-y,k=t*f-b,A=D*S,j=x[A],M=x[A+1],N=x[A+2];for(let l=1;l<=s;l++){let d=$.sinLonLUT[l],f=$.cosLonLUT[l],A=0,P=0,F=0;if(l<s){let e=(D+1)*S;A=x[e],P=x[e+1],F=x[e+2]}else{let r=$.sinLonLUT[c],i=$.cosLonLUT[c],a=g+T(c,e,O);A=i*n*a-_,P=r*n*a-y,F=t*a-b}let I=h,L=w,R=k;h=j,w=M,k=N,j=A,M=P,N=F;let z=A-I,B=P-L,ee=F-R,V=0,H=0,te=0;if(e>1){let e=(D-s)*S;V=x[e],H=x[e+1],te=x[e+2]}else{let e=$.sinLatLUT[0],t=$.cosLatLUT[0],n=g+T(l,0,O);V=f*t*n-_,H=d*t*n-y,te=e*n-b}let U=g+T(l,r,O),W=f*o*U-_,G=d*o*U-y,K=a*U-b;if(e<s){let e=D+s,t=e*S;x[t]=W,x[t+1]=G,x[t+2]=K,be(W,G,K,u);let n=e*E;C[n]=le[l],C[n+1]=i}let q=V-W,ne=H-G,re=te-K,J=f*n,Y=d*n,X=t;X*X<.999&&(J=ee*ne-B*re,Y=z*re-ee*q,X=B*q-z*ne);let Z=1/Math.sqrt(J*J+Y*Y+X*X);v(p,D,J*Z,Y*Z,X*Z,m),++D}}}function C(e){let{tile:t}=e;if(!t.intersectsClippingArea)return;let{geometry:r,geometryState:i,localOrigin:o}=e,{numVerticesPerSide:s,samplerData:c}=i,l=s-2,u=s-1,{vertexAttributes:d,boundingBox:f}=r,{position:p,uv0:m}=d,{typedBuffer:h,typedBufferStride:g}=d.normalCompressed,{extent:_}=t,y=_[0],b=_[2],x=_[1],S=_[3],C=t.ellipsoid.radius,w=o[0],T=o[1],E=o[2],D=p.typedBuffer,O=p.typedBufferStride,k=1/u,A=0;if(1<=l){let e=k,t=x*(1-e)+S*e,r=$.sinLatLUT[1],i=$.cosLatLUT[1];for(let o=1;o<=l;o++){let s=o*k,l=y*(1-s)+b*s,u=$.sinLonLUT[o],d=$.cosLonLUT[o],p=C+a(l,t,c),h=-w+p*d*i,g=-T+p*u*i,_=-E+p*r;be(h,g,_,f);let v=(o-1)*O;D[v]=h,D[v+1]=g,D[v+2]=_,m.setValues(o-1,Math.round(s*n),Math.round(e*n))}}for(let e=1;e<=l;e++){let t=e*k,r=x*(1-t)+S*t,i=$.sinLatLUT[e],o=$.cosLatLUT[e],s=e+1,d=s*k,p=x*(1-d)+S*d,_=$.sinLatLUT[s],j=$.cosLatLUT[s],M=$.sinLonLUT[0],N=$.cosLonLUT[0],P=C+a(y,r,c),F=N*o*P-w,I=M*o*P-T,L=i*P-E,R=A*O,z=D[R],B=D[R+1],ee=D[R+2];for(let t=1;t<=l;t++){let s=t*k,S=y*(1-s)+b*s,M=$.sinLonLUT[t],N=$.cosLonLUT[t],P=0,R=0,V=0;if(t<l){let e=(A+1)*O;P=D[e],R=D[e+1],V=D[e+2]}else{let e=$.sinLonLUT[u],t=$.cosLonLUT[u],n=C+a(b,r,c);P=t*o*n-w,R=e*o*n-T,V=i*n-E}let H=F,te=I,U=L;F=z,I=B,L=ee,z=P,B=R,ee=V;let W=P-H,G=R-te,K=V-U,q=0,ne=0,re=0;if(e>1){let e=(A-l)*O;q=D[e],ne=D[e+1],re=D[e+2]}else{let e=$.sinLatLUT[0],t=$.cosLatLUT[0],n=C+a(S,x,c);q=N*t*n-w,ne=M*t*n-T,re=e*n-E}let J=C+a(S,p,c),Y=N*j*J-w,X=M*j*J-T,Z=_*J-E;if(e<l){let e=A+l,t=e*O;D[t]=Y,D[t+1]=X,D[t+2]=Z,be(Y,X,Z,f),m.setValues(e,Math.round(s*n),Math.round(d*n))}let ie=q-Y,Q=ne-X,ae=re-Z,oe=N*o,se=M*o,ce=i;ce*ce<.999&&(oe=K*Q-G*ae,se=W*ae-K*ie,ce=G*ie-W*Q);let le=1/Math.sqrt(oe*oe+se*se+ce*ce);v(h,A,oe*le,se*le,ce*le,g),++A}}}function w(t,r,i){let a=r[0],o=r[2],s=r[1],c=r[3],l=1/t,{dx:u,dy:d,x0:f,y1:p,safeWidth:m}=i,h=i.data.width;for(let r=0;r<=t;r++){let t=r*l,i=e(u*(a*(1-t)+o*t-f),0,m),g=Math.floor(i);ue[r]=g,pe[r]=i-g;let _=e(d*(p-(s*(1-t)+c*t)),0,m),v=Math.floor(_);de[r]=v*h,fe[r]=(v+1)*h,me[r]=_-v,le[r]=Math.round(t*n)}}function T(e,t,n){let r=ue[e],i=pe[e],a=de[t],o=fe[t],s=me[t],c=a+r,l=n[c],u=n[c+1],d=n[o+r],f=n[o+r+1];if(l+d+u+f>=ce)return 0;let p=l+(u-l)*i;return p+(d+(f-d)*i-p)*s}function E(e,t=!1){e.tile.intersectsClippingArea&&(O(e,t?we:e.dirtyEdges,t?Te:e.dirtyCorners),Q(e),e.intersectionData=null)}function D(e){e.tile.intersectsClippingArea&&(Y(e),O(e,we,Te),Q(e),ae(e),e.intersectionData=null)}function O(e,t,n){e.tile.intersectsClippingArea&&(n&&A(e,n),t&&k(e,t))}function k(e,r){let{geometry:i,geometryState:s,tile:c,localOrigin:u}=e,{level:d,extent:g,extentInRadians:y,ellipsoid:b}=c,x=b.radius,S=y[0],C=y[2],w=y[1],T=y[3],{samplerData:E}=s,D=g[0],O=g[2],k=g[1],A=g[3],j=P(e),{boundingBox:M,vertexAttributes:N}=i,F=u[0],I=u[1],L=u[2],{position:R,uv0:z}=N,B=R.typedBuffer,ee=R.typedBufferStride,V=z.typedBuffer,H=z.typedBufferStride,{typedBuffer:te,typedBufferStride:U}=N.normalCompressed,W=E?.length===1?E[0]:null,G=(e,t,n)=>W?o(e,t,W)??0:a(e,t,E)??0;for(let u=0;u<4;++u){if(!(r&1<<u))continue;let y=u===1||u===3,b=s.edgeResolutions[u];f(t(b));let N=b+1,P=l(c,s.edgePeerNeighbors[u]);if(_e(c,P,u)&&X(e,u,P))continue;let R=P!=null;f(!R||P.level===c.level),f(!R||_(c,P)<=0);let z=P?.renderData?.geometryState;if(p){let e=c.surface;if(!P&&e&&!e.updatingRootTiles){let t=m[u],n=c.findNeighborTile(t,e=>e.loaded||e.leaf||e.level===c.level);n?n.intersectsClippingArea&&(f(!n.loaded),f(!n.leaf),f(n.level===d)):f(e?.rootTiles==null||!c.shouldHaveNeighbor(t))}}let K=u===1?g[2]:g[0],q=P?.extent,ne=q&&y?u===1?q[0]:q[2]:K,re=u===0?g[3]:g[1],J=+(u===1),Y=+(u===0),Z=u===1?C:S,ie=u===0?T:w,Q=Math.sin(Z),ae=Math.cos(Z),oe=Math.sin(ie),se=Math.cos(ie),$=z?.samplerData,ce=$?.length===1?$[0]:null,le=(e,t,n)=>ce?o(n,t,ce)??0:a(n,t,$)??0,ue=R?(e,t,n)=>(G(e,t)+le(e,t,n))*.5:G,de=i.outerEdgesOffsetAndLength[u*2+0],fe=W!=null||E!=null&&E.some(e=>e!=null),pe=ce!=null||$!=null&&$.some(e=>e!=null),me=fe||pe,he=1/b,ge=n*he,ve=J*n,ye=Y*n,xe=de;f(!q||h(q[2]-q[0],g[2]-g[0])),(()=>{let e=u===1?-1:+(u===3),t=u===0?-1:+(u===2),n=(g[2]-g[0])*he,r=e*n,i=t*n,s=C-S,c=y?s*he*e:0,l=y?0:t*he,d=Y,f=y?Z+c:Z,p=y?Math.sin(f):Q,m=y?Math.cos(f):ae,h=y?Z-c:Z,_=y?Math.sin(h):Q,b=y?Math.cos(h):ae,w=d+l,T=y?ie:j(w),P=y?oe:Math.sin(T),z=y?se:Math.cos(T),G=d-l,q=y?ie:j(G),J=y?oe:Math.sin(q),X=y?se:Math.cos(q),le=0,de=0,fe=0;{let e=0*he,t=y?K:D*(1-e)+O*e,n=y?ne:t,r=y?k*(1-e)+A*e:re,i=y?Z:S*(1-e)+C*e,a=y?Q:Math.sin(i),o=y?ae:Math.cos(i),s=y?j(e):ie,c=y?Math.sin(s):oe,l=y?Math.cos(s):se,u=x+ue(t,r,n);le=o*l*u,de=a*l*u,fe=c*u}let pe=0,_e=0,Se=0;{let e=1*he,t=y?K:D*(1-e)+O*e,n=y?ne:t,r=y?k*(1-e)+A*e:re,i=y?Z:S*(1-e)+C*e,a=y?Q:Math.sin(i),o=y?ae:Math.cos(i),s=y?j(e):ie,c=y?Math.sin(s):oe,l=y?Math.cos(s):se,u=x+ue(t,r,n);pe=o*l*u,_e=a*l*u,Se=c*u}for(let e=1;e<N-1;++e){let t=0,n=0,s=0;{let r=(e+1)*he,i=y?K:D*(1-r)+O*r,a=y?ne:i,o=y?k*(1-r)+A*r:re,c=y?Z:S*(1-r)+C*r,l=y?Q:Math.sin(c),u=y?ae:Math.cos(c),d=y?j(r):ie,f=y?Math.sin(d):oe,p=y?Math.cos(d):se,m=x+ue(i,o,a);t=u*p*m,n=l*p*m,s=f*m}let c=t,l=n,d=s,f=pe,h=_e,g=Se;pe=c,_e=l,Se=d;{let t=xe+e,n=t*ee,r=f-F,i=h-I,a=g-L;B[n]=r,B[n+1]=i,B[n+2]=a,be(r,i,a,M);let o=Math.round(e*ge),s=t*H;V[s]=y?ve:o,V[s+1]=y?o:ye}let w=le,T=de,N=fe;le=f,de=h,fe=g;let G=f,q=h,Y=g,Ce=1/Math.sqrt(G*G+q*q+Y*Y),we=Y*Ce,Te=0,Ee=0,De=0;if(me&&we*we<.999){let t=0,n=0,s=0;{let e=u===0?-1:1;t=e*(c-w),n=e*(l-T),s=e*(d-N)}{let c=e*he,l=y?K:D*(1-c)+O*c,d=y?ne:l,f=y?k*(1-c)+A*c:re,h=y?Z:S*(1-c)+C*c,g=y?Q:Math.sin(h),v=y?ae:Math.cos(h),w=y?j(c):ie,T=y?Math.sin(w):oe,M=y?Math.cos(w):se,N=G,F=q,I=Y;if(R){let e=d-r,t=f-i,n=x+(ce?o(e,t,ce)??0:a(e,t,$)??0),s=y?_:g,c=y?b:v,l=y?T:J,u=y?M:X;N=c*u*n,F=s*u*n,I=l*n}{let e=l+r,c=f+i,d=x+(W?o(e,c,W)??0:a(e,c,E)??0),h=y?p:g,_=y?m:v,b=y?T:P,S=y?M:z,C=_*S*d,w=h*S*d,D=b*d;R||(N=2*G-C,F=2*q-w,I=2*Y-D);let O=u===3?-1:1,k=O*(N-C),A=O*(F-w),j=O*(I-D);Te=s*A-n*j,Ee=t*j-s*k,De=n*k-t*A;let L=1/Math.sqrt(Te*Te+Ee*Ee+De*De);Te*=L,Ee*=L,De*=L}}}else Te=G*Ce,Ee=q*Ce,De=Y*Ce;v(te,xe+e,Te,Ee,De,U)}})()}}function A(e,t){Z(e,t)}function j(e,t){return Math.PI/2-2*Math.atan(Math.exp(-e/t))}function M(e,t,n,r){return j(e*(1-r)+t*r,n)}function N(e,t,n){return e*(1-n)+t*n}function P(e){let{tile:t}=e;if(t.surface.isWebMercator){let e=t.extent,n=t.ellipsoid.radius;return t=>M(e[1],e[3],n,t)}let n=t.extentInRadians;return e=>N(n[1],n[3],e)}function F(e){let{tile:t,geometryState:n,geometry:i}=e,{extent:a,surface:o}=t,{wireframe:s}=n,c=a[0],l=a[1],u=a[2],d=a[3],f=u-c,p=d-l,{numVerticesPerSide:m,clippingArea:h}=n,g=h==null?0:Math.max(0,(h[0]-c)/f),_=h==null?0:Math.max(0,(h[1]-l)/p),v=h==null?1:Math.min(1,(h[2]-c)/f),y=h==null?1:Math.min(1,(h[3]-l)/p),b=(m-2)**2,x=xe(n),S=b+4*x,C=o.renderer.tileGeometryCache.acquire(S),{boundingBox:w}=i;r(w),i.numVerticesPerSide=m,i.vertexAttributes=C,i.maxEdgeVertexCount=x,i.minu=g,i.minv=_,i.maxu=v,i.maxv=y,I(e),i.edgeVerticesStartIndex=b,J(e),z(e,we,Te),U(i,[],s),e.intersectionData=null}function I(t){let r=t.tile;if(!r.intersectsClippingArea)return;let{geometry:i,geometryState:s,localOrigin:c}=t,{samplerData:l,clippingArea:u,numVerticesPerSide:d}=s,{surface:f,extent:p,ellipsoid:m}=r,{isWebMercatorOnPlateCarree:h}=f,g=u??he,_=p[0],y=p[1],b=p[2],x=p[3],S=Math.max(_,g[0]),C=Math.min(b,g[2]),w=Math.max(y,g[1]),T=Math.min(x,g[3]),E=m.radius,D=r.horizontalScale,O=d-1,k=d-2,{minu:A,minv:j,maxu:M,maxv:N,boundingBox:P,vertexAttributes:F}=i,{position:I,uv0:L}=F,{typedBuffer:R,typedBufferStride:z}=F.normalCompressed,B=c[0],ee=c[1],V=c[2],H=I.typedBuffer,te=I.typedBufferStride,U=0,W=e(y,w,T),G=h?(Math.PI/2-2*Math.atan(Math.exp(-W/E)))*E:W*D,K=1/O,q=e(y*(1-K)+x*K,w,T),ne=h?(Math.PI/2-2*Math.atan(Math.exp(-q/E)))*E:q*D,re=G,J=ne,Y=l?.length===1?l[0]:null,X=Y?(e,t)=>o(e,t,Y)??0:(e,t)=>a(e,t,l)??0;for(let t=1;t<=k;t++){let r=t/O,i=e(y*(1-r)+x*r,w,T),a=e(r,j,N),o=J,s=(t-1)/O,c=e(y*(1-s)+x*s,w,T),l=re,u=(t+1)/O,d=e(y*(1-u)+x*u,w,T),f=h?(Math.PI/2-2*Math.atan(Math.exp(-d/E)))*E:d*D,p=e(u,j,N);re=J,J=f;let m=e(_,S,C),g=m*D,F=X(m,i),I=1/O,W=e(I,A,M),G=e(_*(1-W)+b*W,S,C),K=W,q=G,ne=G*D,Y=X(G,i);if(t===1){let t=ne-B,r=re-ee,i=Y-V,o=0*te;H[o]=t,H[o+1]=r,H[o+2]=i,be(t,r,i,P);let s=e(I,A,M);L.setValues(U,Math.round(s*n),Math.round(a*n))}for(let r=1;r<=k;r++){let s=ne,u=Y,m=(r+1)/O,h=e(m,A,M),y=e(_*(1-m)+b*m,S,C),x=q;q=y;{let e=U+1,s=e*te;if(t===1||r===k){let c=X(y,i),l=y*D,u=o,d=c;if(t===1&&r<k){let t=l-B,r=u-ee,i=d-V;H[s]=t,H[s+1]=r,H[s+2]=i,be(t,r,i,P),L.setValues(e,Math.round(h*n),Math.round(a*n))}ne=l,Y=d}else ne=H[s]+B,Y=H[s+2]+V}let w=ne,T=Y,E=g,j=F;g=s,F=u;let N=(U-k)*te,I=t===1?X(x,c):H[N+2]+V,W=X(x,d);if(t<k){let e=U+k,t=e*te,r=s-B,i=f-ee,a=W-V;H[t]=r,H[t+1]=i,H[t+2]=a,be(r,i,a,P);let o=K;K=h,L.setValues(e,Math.round(o*n),Math.round(p*n))}{let e=w-E,t=T-j,n=l-f,r=I-W,i=n*t,a=e*r,o=-n*e,s=i*i+a*a+o*o;if(s===0)v(R,U,0,0,1,z);else{let e=1/Math.sqrt(s);v(R,U,i*e,a*e,o*e,z)}}++U}}}function L(e){e.tile.intersectsClippingArea&&(Y(e),z(e,we,Te),Q(e),ae(e),e.intersectionData=null)}function R(e,t=!1){e.tile.intersectsClippingArea&&(z(e,t?we:e.dirtyEdges,t?Te:e.dirtyCorners),Q(e),e.intersectionData=null)}function z(e,t,n){e.tile.intersectsClippingArea&&(n&&ee(e,n),t&&B(e,t))}function B(n,r){let{geometry:i,geometryState:s,localOrigin:c}=n,u=n.tile,{surface:d,extent:h}=u,{clippingArea:g,samplerData:v}=s,y=g??he,b=h[0],x=h[2],S=h[1],C=h[3],w=[C>y[3],x>y[2],S<y[1],b<y[0]],T=u.horizontalScale,E=te(d.isWebMercatorOnPlateCarree,u.ellipsoid.radius,T),{minu:D,minv:O,maxu:k,maxv:A,boundingBox:j}=i,M=Math.max(b,y[0]),N=Math.min(x,y[2]),P=Math.max(S,y[1]),F=Math.min(C,y[3]),I=c[0],L=c[1],R=c[2],z=v?.length===1?v[0]:void 0,B=z?(e,t)=>o(e,t,z)??0:(e,t)=>a(e,t,v)??0;for(let c=0;c<4;++c){if(!(r&1<<c))continue;let h=c===1||c===3,g=s.edgeResolutions[c];f(t(g));let y=g+1,z=w[c],ee=l(u,s.edgePeerNeighbors[c]);if(!z&&_e(u,ee,c)&&X(n,c,ee))continue;let V=ee!=null&&!z,H=ee?.renderData?.geometryState;if(p&&(f(!V||ee.level===u.level),f(!V||_(u,ee)<=0),u&&!ee&&!d.updatingRootTiles)){let e=m[c],t=u.findNeighborTile(e,e=>e.loaded||e.leaf||e.level===u.level);d.updatingRootTiles||(t?t.intersectsClippingArea&&(f(!t.loaded),f(!t.leaf),f(t.level===u.level)):f(d?.rootTiles==null||!u.shouldHaveNeighbor(e)))}let te=e(c===1?x:b,M,N),U=e(c===0?C:S,P,F),W=H?.samplerData,G=e(+(c===1),D,k),K=e(+(c===0),O,A),q=W?.length===1?W[0]:null,ne=(e,t)=>q?o(e,t,q)??0:a(e,t,W)??0,re=V?(e,t)=>(ne(e,t)+B(e,t))*.5:B,J=(x-b)/g,Y=h?c===1?J:-J:0,Z=h?0:c===0?J:-J,ie=-Y,Q=-Z,ae=0,oe=0,se=0;{let t=0/g,n=h?te:e(b*(1-t)+x*t,M,N),r=h?e(S*(1-t)+C*t,P,F):U,i=re(n,r);ae=n*T,oe=E(r),se=i}let $=0,ce=0,le=0;{let t=1/g,n=h?te:e(b*(1-t)+x*t,M,N),r=h?e(S*(1-t)+C*t,P,F):U,i=re(n,r),a=n*T,o=E(r),s=i;$=a,ce=o,le=s}for(let t=1;t<y-1;++t){let n=t/g,r=$,o=ce,s=le;{let a=h?G:e(n,D,k),l=h?e(n,O,A):K,u=r-I,d=o-L,f=s-R;be(r,d,f,j),i.setEdgeVertexFromValuesRawPositionUV(c,t,u,d,f,a,l)}{let n=(t+1)/g,r=h?te:e(b*(1-n)+x*n,M,N),i=h?e(S*(1-n)+C*n,P,F):U,a=re(r,i);$=r*T,ce=E(i),le=a}let l=$,u=ce,d=le,f=ae,p=oe,m=se;ae=r,oe=o,se=s;let _=0,y=0,w=0;if(h){let t=u-o,i=d-s,l=p-o,f=m-s,h=e(S*(1-n)+C*n,P,F),g=te+ie,b=h,x=g*T,E=a(g,b,v),D=x-r,O=E-s,k=c===3?-1:1;if(_=k*(-l+t)*O,y=k*D*(-f+i),w=-k*D*(-l+t),V){let e=te+Y,n=h,o=e*T,c=a(e,n,W),u=o-r,d=c-s;_=(-l+t)*(O-d),y=(D-u)*(-f+i),w=-(D-u)*(-l+t)}}else{let t=l-r,i=d-s,u=f-r,p=m-s,h=e(b*(1-n)+x*n,M,N),g=h,S=U+Q,C=a(g,S,v)-s,T=E(S)-o,D=c===2?-1:1;if(_=D*T*(-p+i),y=D*(-u+t)*C,w=-D*T*(-u+t),V){let e=h,n=U+Z,r=E(n),c=a(e,n,W)-s,l=r-o;_=(-T+l)*(-p+i),y=(-u+t)*(-C+c),w=-(-T+l)*(-u+t)}}let z=1/Math.sqrt(_*_+y*y+w*w);i.setEdgeNormalFromValues(c,t,_*z,y*z,w*z)}}}function ee(e,t){Z(e,t)}function V(e,t){return(Math.PI/2-2*Math.atan(Math.exp(-e/t)))*t}function H(e,t){return e*t}function te(e,t,n){return e?e=>V(e,t):e=>H(e,n)}function U(e,t,n){let{numVerticesPerSide:r,vertexAttributes:i,maxEdgeVertexCount:a}=e,o=r-1,s=i.count,l=r-3,u=r-3,d=2*l*u,f=4*(o+a-3),p=c.reduce((t,n)=>t+(o+e.getEdgeCount(n)-3),0),m=t.reduce((e,t)=>e+o*((t.latitudeResolution-1)*2+1),0),h=3*(n?2:1),g=(d+f+m)*h;e.indices=s>=65536?new Uint32Array(g):new Uint16Array(g),e.indexCount=(d+p+m)*h,e.poleIndicesStartIndex=d*h,e.edgeIndicesStartIndex=(d+m)*h,n?(q(e),ne(e,t),re(e)):(W(e),G(e,t),K(e))}function W(e){let{numVerticesPerSide:t,indices:n,vertexAttributes:r}=e,{position:i}=r,{typedBuffer:a,typedBufferStride:o}=i,s=t-2,c=t-3,l=t-3,u=0;for(let e=0;e<c;++e){let t=e*s;for(let e=0;e<l;++e){let r=t+e,i=r+1,c=i+s,l=c-1;Se(r,i,c,l,o,a)?(n[u]=r,n[u+1]=i,n[u+2]=c,n[u+3]=c,n[u+4]=l,n[u+5]=r):(n[u]=r,n[u+1]=i,n[u+2]=l,n[u+3]=l,n[u+4]=i,n[u+5]=c),u+=6}}}function G(e,t){let{numVerticesPerSide:n,indices:r,poleIndicesStartIndex:i}=e,a=n-1,o=i;for(let i of t){let t=i.isNorth?1:2,s=i.isNorth?2:1,c=i.isNorth?3:4,l=i.isNorth?4:3,u=e.getEdgeVertexIndex(i.connectedOuterEdgeOffset,0),d=1;for(let e=0;e<i.latitudeResolution;++e){let f=e===0?i.rowOffset:u+n;for(let n=0;n<a;n++){let a=f+n;r[o]=u,r[o+t]=u+1,r[o+s]=a,e<i.latitudeResolution-1?(r[o+c]=u+1,r[o+l]=a+1,r[o+5]=a,o+=6):o+=3,u+=d}u=f,d=1}}}function K(e){let{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:r}=e,i=n-1,a=i-2,o=r;for(let n=0;n<4;++n){let r=ye[n],s=0,c=0,l=e.getEdgeCount(n),u=r.count;f(u===i-1);let d=n===1||n===2,p=d?1:2,m=d?2:1,h=e.getEdgeFirstVertexIndex(n),g=r.vertex0Index,_=r.stride;for(;s<l-1||c<u-1;){let e=g+c*_,n=h+s*1,r=s<l-1,d=c<u-1,f=r?0+i*(s+.5)/(l-1):0,v=d?1+a*(c+.5)/(u-1):0,y=r&&(!d||f<=v);y?++s:++c;let b=y?n+1:e+_;t[o]=e,t[o+p]=n,t[o+m]=b,o+=3}}e.indexCount=o}function q(e){let{indices:t,numVerticesPerSide:n,vertexAttributes:r}=e,{position:i}=r,{typedBuffer:a,typedBufferStride:o}=i,s=n-2,c=0;for(let e=0;e<n-3;++e){let r=e*s;for(let i=0;i<n-3;++i){let n=e*s+i,l=n+1,u=l+s,d=u-1,f=r+i,p=f+1,m=p+s;Se(f,p,m,m-1,o,a)?(Ce(t,c,n,l,u),c+=6,Ce(t,c,u,d,n)):(Ce(t,c,n,l,d),c+=6,Ce(t,c,d,u,l)),c+=6}}}function ne(e,t){let{indices:n,numVerticesPerSide:r,poleIndicesStartIndex:i}=e,a=r-1,o=i;for(let i of t){let t=i.connectedOuterEdgeOffset,s=e.getEdgeVertexIndex(t,0),c=1;for(let e=0;e<i.latitudeResolution;++e){let t=e===0?i.rowOffset:s+r;for(let r=0;r<a;r++)Ce(n,o,s,s+1,t+r),o+=6,e<i.latitudeResolution-1&&(Ce(n,o,s+1,t+r+1,t+r),o+=6),s+=c;s=t,c=1}}}function re(e){let{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:r}=e,i=n-1,a=i-2,o=r;for(let n=0;n<4;++n){let r=ye[n],s=0,c=0,l=e.getEdgeCount(n),u=r.count;f(u===i-1);let d=n===1||n===2,p=d?1:3,m=d?3:1,h=e.getEdgeFirstVertexIndex(n),g=r.vertex0Index,_=r.stride;for(;s<l-1||c<u-1;){let e=g+c*_,n=h+s*1,r=s<l-1,d=c<u-1,f=r?0+i*(s+.5)/(l-1):0,v=d?1+a*(c+.5)/(u-1):0,y=r&&(!d||f<=v);y?++s:++c;let b=y?n+1:e+_;t[o]=e,t[o+p]=n,t[o+p+1]=n,t[o+m]=b,t[o+m+1]=b,t[o+5]=e,o+=6}}e.indexCount=o}function J(e){let{geometry:t,geometryState:n}=e,{edgeResolutions:r}=n,{numVerticesPerSide:i,edgeVerticesStartIndex:a}=t,o=i-2,s=a;for(let e=0;e<4;++e){{let t=e===1?o-1:0,n=e===0?o-1:0,r=e===0||e===2,i=+!!r,a=+!r,s=n*o+t,c=a*o+i,l=ye[e];l.vertex0Index=s,l.stride=c,l.count=o}{let n=r[e]+1;t.outerEdgesOffsetAndLength[e*2+0]=s,t.outerEdgesOffsetAndLength[e*2+1]=n,s+=n}}}function Y(e){J(e),e.geometryState.wireframe?re(e.geometry):K(e.geometry)}function X(r,i,a){let{geometryState:o,geometry:s,tile:c,localOrigin:l}=r,u=i===1||i===3,d=o.edgeResolutions[i];f(t(d));let p=d+1,{boundingBox:m,minu:h,minv:g,maxu:_,maxv:v,vertexAttributes:y}=s,b=e(+(i===1),h,_),x=e(+(i===0),g,v),S=a.renderData,C=S.geometryState;if(!C||!S.geometry.vertexAttributes)return!1;let w=S.geometry,T=(i+2)%4,E=w.getEdgeCount(T),D=c.getNeighborEdgeStartVertexIndex(i,a)*d,O=d*2**(c.level-a.level);f(C.edgeResolutions[T]===O),f(E-1===O);let k=S.localOrigin[0]-l[0],A=S.localOrigin[1]-l[1],j=S.localOrigin[2]-l[2],M=s.getEdgeFirstVertexIndex(i),{position:N,uv0:P}=y,F=N.typedBuffer,I=N.typedBufferStride,L=y.normalCompressed,R=L.typedBuffer,z=L.typedBufferStride,B=w.vertexAttributes,ee=w.getEdgeFirstVertexIndex(T),V=B.position.typedBuffer,H=B.position.typedBufferStride,te=B.normalCompressed.typedBuffer,U=B.normalCompressed.typedBufferStride;for(let t=1;t<p-1;++t){let r=D+t,i=M+t,a=ee+r,o=i*I,s=a*H,c=V[s]+k,l=V[s+1]+A,f=V[s+2]+j;F[o]=c,F[o+1]=l,F[o+2]=f,be(c,l,f,m);let p=i*z,y=a*U;R[p]=te[y],R[p+1]=te[y+1];let S=t/d,C=u?b:e(S,h,_),w=u?e(S,g,v):x;P.setValues(i,Math.round(C*n),Math.round(w*n))}return!0}function Z(t,r){let{geometry:i,geometryState:o,localOrigin:s}=t,{clippingArea:c,samplerData:l}=o,{minu:u,minv:d,maxu:p,maxv:m,boundingBox:h,vertexAttributes:g}=i,v=t.tile,{surface:y,ellipsoid:b,extent:x,extentInRadians:S,horizontalScale:C}=v,w=y.view?.viewingMode===`local`,T=b.radius,E=0,D=0,O=0,k=w?(()=>{let t=c,n=t!=null&&(x[3]>t[3]||x[2]>t[2]||x[1]<t[1]||x[0]<t[0]),r=te(y.isWebMercatorOnPlateCarree,T,C);return(i,a,o)=>{let s=i===0?x[0]:x[2],c=a===0?x[1]:x[3],l=n?e(s,t[0],t[2]):s,u=n?e(c,t[1],t[3]):c,d=o;E=l*C,D=r(u),O=d}})():(e,t,n)=>{let r=S[t===0?1:3],i=S[e===0?0:2],a=Math.cos(r),o=Math.sin(r),s=Math.sin(i),c=Math.cos(i),l=T+n;E=c*a*l,D=s*a*l,O=o*l},A=0,j=0,M=0,N=0,F=0,I=0,L=0,R=0,z=0,B=w&&y.isWebMercatorOnPlateCarree,ee=(e,t,n,r,i)=>{let a=0,o=0,s=0;if(w){let e=t*C,i=B?(Math.PI/2-2*Math.atan(Math.exp(-n/T)))*T:n*C,c=r;a=e-E,o=i-D,s=c-O}else{let i=P(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]),p=u[0]*(1-d)+u[2]*d,m=i(f),h=Math.cos(m),g=Math.sin(m),_=Math.sin(p),v=Math.cos(p),y=T+r,b=v*h*y,x=_*h*y,S=g*y;a=b-E,o=x-D,s=S-O}switch(i){case 0:L+=a,R+=o,z+=s;break;case 1:N-=a,F-=o,I-=s;break;case 2:L-=a,R-=o,z-=s;break;case 3:N+=a,F+=o,I+=s}},V=c??he,H=x[0],U=x[2],W=x[1],G=x[3],K=[G>V[3],U>V[2],W<V[1],H<V[0]],q=Math.max(H,V[0]),ne=Math.min(U,V[2]),re=Math.max(W,V[1]),J=Math.min(G,V[3]),Y=e=>Math.max(V[0],Math.min(V[2],e)),X=e=>Math.max(V[1],Math.min(V[3],e)),Z=e=>{let t=o.cornerNeighborCornerTiles;A=0,j=0,M=1,N=0,F=0,I=0,L=0,R=0,z=0;let n=1/0;for(let r=0;r<4;++r){let i=t[e*4+r];n=Math.min(n,i?.level??1/0)}for(let r=0;r<4;++r){let i=t[e*4+r];ge[r]=i?.level===n?i:null}let r=1,i=0;for(let e=0;e<4;++e){let t=ge[e];t&&(r=Math.max(r,t?.renderData.geometryState.numVerticesPerSide),i=t.extent[2]-t.extent[0])}let s=i,c=r;f(c>1);let l=s/c;for(let e=0;e<4;++e){let t=ge[(e+3)%4],n=ge[e%4];if(!t&&!n)continue;let r=e===0?1:e===1?2:e===2?3:0,i=e===0?2:e===1?3:e===2?0:1;if(t&&n){let o=se[e][0]*l,s=se[e][1]*l,c=t.extent,u=Y(c[r===0||r===1?2:0]+o),d=X(c[r===0||r===3?3:1]+s),f=n.extent,p=Y(f[i===0||i===1?2:0]+o),m=X(f[i===0||i===3?3:1]+s),h=t.renderData,g=n.renderData,_=a(u,d,h.geometryState.samplerData),v=a(p,m,g.geometryState.samplerData);ee(h,u,d,.5*(_+v),e)}else{let o=t??n,s=t?r:i,c=o.extent,u=se[e],d=Y(c[s===0||s===1?2:0]+u[0]*l),f=X(c[s===0||s===3?3:1]+u[1]*l),p=o.renderData,m=a(d,f,p.geometryState.samplerData);ee(p,d,f,m,e)}}if(!w){let e=Math.sqrt(E*E+D*D+O*O);A=E/e,j=D/e,M=O/e}if(w||M*M<.999){let e=Math.sqrt(N*N+F*F+I*I);N/=e,F/=e,I/=e;let t=Math.sqrt(L*L+R*R+z*z);L/=t,R/=t,z/=t,A=I*R-F*z,j=N*z-I*L,M=F*L-N*R;let n=1/Math.sqrt(A*A+j*j+M*M);A*=n,j*=n,M*=n}},Q=o.cornerNeighborCornerTiles;for(let t=0;t<4;++t){if(!(r&1<<t))continue;let c=t,y=(t+1)%4,b=+(t===0||t===1),x=+(t===0||t===3),S=e(b,u,p),C=e(x,d,m),w=i.getEdgeFirstVertexIndex(c),T=i.getEdgeCount(c),N=t===0||t===3?T-1:0,P=i.getEdgeFirstVertexIndex(y),F=i.getEdgeCount(y),I=t===0||t===1?F-1:0,L=-1;for(let e=0;e<4;++e){let n=Q[t*4+e],r=Q[t*4+L];n&&(L===-1||_(r,n)>0)&&(L=e)}let R=L,z=Q[t*4+R];if(z!==v){let e=v.level-z.level,r=2**e,i=[z.lij[0]+e,z.lij[1]*r,z.lij[2]*r],a=[i[1]+r===v.lij[1],t===0&&(R===1||R===0&&z!==Q[t*4+3])||t===1&&(R===0||R===1&&z!==Q[t*4+2]),i[1]===v.lij[1]+1,t===2&&(R===3||R===2&&z!==Q[t*4+1])||t===3&&(R===2||R===3&&z!==Q[t*4+0])],c=a.reduce((e,t)=>e+ +!!t,0);f(c===1||c===2);let l=-1,u=-1,d=z.renderData;if(c===1){let e=a.findIndex(e=>e);f(0<=e&&e<=3),l=(e+2)%4;let n=o.edgeResolutions[e];u=v.getNeighborEdgeStartVertexIndex(e,z)*n+n*+(e===0&&t===0||e===1&&t===0||e===2&&t===1||e===3&&t===3)}else{f(a[1]||a[3]),l=a[1]?3:1;let e=d.geometryState.edgeResolutions[l];u=t===0||t===3?0:e}let p=d.geometry;{let e=w+N,t=P+I,r=p.getEdgeFirstVertexIndex(l)+u,i=p.vertexAttributes,a=d.localOrigin,o=i.position,c=o.typedBuffer,f=r*o.typedBufferStride,m=c[f]+a[0]-s[0],_=c[f+1]+a[1]-s[1],v=c[f+2]+a[2]-s[2];be(m,_,v,h);let y=g.position,b=y.typedBuffer,x=e*y.typedBufferStride;b[x]=m,b[x+1]=_,b[x+2]=v;let T=t*y.typedBufferStride;b[T]=m,b[T+1]=_,b[T+2]=v;let E=g.uv0;E.setValues(e,Math.round(S*n),Math.round(C*n)),E.setValues(t,Math.round(S*n),Math.round(C*n));{let n=i.normalCompressed.typedBuffer,a=r*i.normalCompressed.typedBufferStride,o=g.normalCompressed,s=o.typedBuffer;{let t=e*o.typedBufferStride;s[t]=n[a],s[t+1]=n[a+1]}{let e=t*o.typedBufferStride;s[e]=n[a],s[e+1]=n[a+1]}}}}else{let n=K[c],r=K[y],o;if(n||r){let t=e(H*(1-b)+U*b,q,ne),n=e(W*(1-x)+G*x,re,J);o=a(t,n,l)}else o=ie(Q,t);k(b,x,o),Z(t);let u=E-s[0],d=D-s[1],f=O-s[2];be(u,d,f,h),i.setEdgeVertexFromValuesRawPositionUVNormal(c,N,u,d,f,S,C,A,j,M),i.setEdgeVertexFromValuesRawPositionUVNormal(y,I,u,d,f,S,C,A,j,M)}}for(let e=0;e<4;++e)ge[e]=null}function ie(e,t){let n=t*4,r=c.reduce((t,r)=>Math.min(t,e[n+r]?.level??1/0),1/0);p&&(f(!e[n+0]||!e[n+2]||g(e[n+0],e[n+2],5)),f(!e[n+1]||!e[n+3]||g(e[n+1],e[n+3],7)));let i=0,o=0;for(let t=0;t<4;++t){let s=e[n+t];if(s?.level===r){let e=t===0||t===1,n=t===0||t===3,r=s.extent,c=r[e?0:2],l=r[n?1:3],u=s.renderData?.geometryState?.samplerData,d=a(c,l,u);o+=d,i++}}let s=i?o/i:0;return f(s!=null),s}function Q(e){let{vao:t,geometry:n}=e,{vertexAttributes:r,edgeVerticesStartIndex:i}=n,{position:a}=r,o=a.typedBuffer,s=i*a.typedBufferStride;t.buffer()?.setSubData(o,s,s,o.length)}function ae(e){let{vao:t,geometry:n}=e,{indices:r,indexCount:i,edgeIndicesStartIndex:a}=n;t.indexBuffer.setSubData(r,a,a,i)}class oe{constructor(e,t,n,r,i){this.isNorth=e,this.connectedRowOffset=t,this.connectedOuterEdgeOffset=n,this.rowOffset=r,this.latitudeResolution=i}}const se=[[0,1],[1,0],[0,-1],[-1,0]],$=new s,ce=.5*d,le=new Uint16Array(u+1),ue=new Int32Array(u+1),de=new Int32Array(u+1),fe=new Int32Array(u+1),pe=new Float64Array(u+1),me=new Float64Array(u+1),he=i(-1/0,-1/0,1/0,1/0),ge=[null,null,null,null];function _e(e,t,n){if(!t)return!1;let r=_(e,t);return r>0||r===0&&n>=2}class ve{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(e){return f(0<=e&&e<this.count),this.vertex0Index+this.stride*e}}const ye=[new ve,new ve,new ve,new ve];function be(e,t,n,r){e<r[0]?r[0]=e:e>r[3]&&(r[3]=e),t<r[1]?r[1]=t:t>r[4]&&(r[4]=t),n<r[2]?r[2]=n:n>r[5]&&(r[5]=n)}function xe(e){let{edgeResolutions:t,numVerticesPerSide:n}=e,r=1+Math.max(...t);return Math.max(n,r)}function Se(e,t,n,r,i,a){let o=e*i,s=a[o],c=a[o+1],l=a[o+2],u=t*i,d=a[u],f=a[u+1],p=a[u+2],m=n*i,h=a[m],g=a[m+1],_=a[m+2],v=r*i,y=a[v],b=a[v+1],x=a[v+2],S=(s-h)*(s-h)+(c-g)*(c-g)+(l-_)*(l-_);return(d-y)*(d-y)+(f-b)*(f-b)+(p-x)*(p-x)>S}function Ce(e,t,n,r,i){e[t]=n,e[t+1]=r,e[t+2]=r,e[t+3]=i,e[t+4]=i,e[t+5]=n}const we=15,Te=15,Ee=6;export{F as createPlanarGlobePatch,y as createSphericalGlobePatch,L as updateEdgeElevationsAndResolutionsPlanar,D as updateEdgeElevationsAndResolutionsSpherical,R as updateEdgesAndCornersPlanar,E as updateEdgesAndCornersSpherical};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{fromValues as e,create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import n from"../../../geometry/SpatialReference.js";import{projectVectorToVector as r}from"../../../geometry/projection/projectVectorToVector.js";import{wrap as i}from"../../../geometry/support/aaBoundingBox.js";import{create as a}from"../../../geometry/support/aaBoundingRect.js";import{isPlateCarree as o}from"../../../geometry/support/spatialReferenceUtils.js";import{sphereIntersectsInfiniteVerticalCylinderConservative as s}from"../support/ElevationAgnosticVisibility.js";import{createPlanarGlobePatch as c,updateEdgesAndCornersPlanar as l,updateEdgeElevationsAndResolutionsPlanar as u}from"./PatchGeometryFactory.js";import{Tile as d}from"./Tile.js";import{intersectAabbInvDirBefore as f}from"../webgl-engine/lib/RayIntersections.js";class p extends d{constructor(e,t,n,r,i){super(),this._horizontalScaleFactor=1,this._extentInRenderSR=a(),this._baseRadius=0,this._baseUsedMemory=900,this._subtreeGeometryElevationBoundMin=0,this._subtreeGeometryElevationBoundMax=0,this.init(e,t,n,r,i)}init(t,i,a,s,c){super.init(t,i,a,s,c);let l=c.view.renderSpatialReference,u=c.spatialReference,d=l!=null&&o(l)&&u!=null&&u.isGeographic?this.ellipsoid.radius*Math.PI/180:1;this._horizontalScaleFactor=d;let{isWebMercatorOnPlateCarree:f}=c,p=this._extentInRenderSR,m=this.extent;if(f){let t=e(m[0],m[1],0);r(t,n.WebMercator,t,n.PlateCarree);let i=e(m[2],m[3],0);r(i,n.WebMercator,i,n.PlateCarree),p[0]=t[0],p[1]=t[1],p[2]=i[0],p[3]=i[1]}else for(let e=0;e<4;++e)p[e]=m[e]*d;this.centerAtSeaLevel[0]=(p[0]+p[2])*.5,this.centerAtSeaLevel[1]=(p[1]+p[3])*.5,this.centerAtSeaLevel[2]=0,this._edgeLen=Math.max(p[2]-p[0],p[3]-p[1]),this._edgeLen2=this._edgeLen*this._edgeLen,this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateCenter();let e=this._extentInRenderSR,t=(e[2]-e[0])*.5,n=(e[3]-e[1])*.5,r=Math.sqrt(t*t+n*n);this._baseRadius=r;let i=(this.elevationBoundsMax-this.elevationBoundsMin)*.5,a=Math.max(r,i);this._center[1].radius=a}_calculateFrustumVisibility(e,t){if(t!=null&&!s(this.centerAtSeaLevel,this._baseRadius,t.center,t.radius))return 2;let n=this._aabb(),r=e,i=n[0],a=n[1],o=n[2],c=n[3],l=n[4],u=n[5],d=!0;for(let e=0;e<6;e++){let t=r[e],n=t[0],s=t[1],f=t[2],p=t[3];if(n*(n>0?i:c)+s*(s>0?a:l)+f*(f>0?o:u)+p>=0)return 2;d&&=n*(n<0?i:c)+s*(s<0?a:l)+f*(f<0?o:u)+p<=0}return+!d}_aabb(){let e=this._extentInRenderSR;return i(e[0],e[1],Math.min(this.elevationBoundsMin,this._subtreeGeometryElevationBoundMin),e[2],e[3],Math.max(this.elevationBoundsMax,this._subtreeGeometryElevationBoundMax))}intersectsRay(e,t,n,r){return m[0]=1/t[0],m[1]=1/t[1],m[2]=1/t[2],f(this._aabb(),e,m,n,r)}createGeometry(){c(this.renderData),this._updateSubtreeGeometryElevationsBounds(),this.setMemoryDirty()}_updateSubtreeGeometryElevationsBounds(){let e=this._subtreeGeometryElevationBoundMin,t=this._subtreeGeometryElevationBoundMax,n=this.renderData,r=e,i=t;if(n){let e=n.geometry.boundingBox;r=e[2],i=e[5]}else if(!this.leaf){r=1/0,i=-1/0;for(let e of this.children){let t=e;r=Math.min(r,t._subtreeGeometryElevationBoundMin),i=Math.max(i,t._subtreeGeometryElevationBoundMax)}}(r!==this._subtreeGeometryElevationBoundMin||i!==this._subtreeGeometryElevationBoundMax)&&(this._subtreeGeometryElevationBoundMin=r,this._subtreeGeometryElevationBoundMax=i,this.updateVisibility(),this.parent?._updateSubtreeGeometryElevationsBounds())}get minimumVerticesPerSide(){return this.level<9?3:2}updateEdgeElevations(){l(this.renderData),this._updateSubtreeGeometryElevationsBounds()}updateEdgeElevationsAndResolutions(){u(this.renderData),this._updateSubtreeGeometryElevationsBounds()}get horizontalScale(){return this._horizontalScaleFactor}}const m=t();export{p as PlanarPatch};
|
|
2
|
+
import{fromValues as e,create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import n from"../../../geometry/SpatialReference.js";import{projectVectorToVector as r}from"../../../geometry/projection/projectVectorToVector.js";import{wrap as i}from"../../../geometry/support/aaBoundingBox.js";import{create as a}from"../../../geometry/support/aaBoundingRect.js";import{isPlateCarree as o}from"../../../geometry/support/spatialReferenceUtils.js";import{sphereIntersectsInfiniteVerticalCylinderConservative as s}from"../support/ElevationAgnosticVisibility.js";import{createPlanarGlobePatch as c,updateEdgesAndCornersPlanar as l,updateEdgeElevationsAndResolutionsPlanar as u}from"./PatchGeometryFactory.js";import{Tile as d}from"./Tile.js";import{intersectAabbInvDirBefore as f}from"../webgl-engine/lib/RayIntersections.js";class p extends d{constructor(e,t,n,r,i){super(),this._horizontalScaleFactor=1,this._extentInRenderSR=a(),this._baseRadius=0,this._baseUsedMemory=900,this._subtreeGeometryElevationBoundMin=0,this._subtreeGeometryElevationBoundMax=0,this.init(e,t,n,r,i)}init(t,i,a,s,c){super.init(t,i,a,s,c);let l=c.view.renderSpatialReference,u=c.spatialReference,d=l!=null&&o(l)&&u!=null&&u.isGeographic?this.ellipsoid.radius*Math.PI/180:1;this._horizontalScaleFactor=d;let{isWebMercatorOnPlateCarree:f}=c,p=this._extentInRenderSR,m=this.extent;if(f){let t=e(m[0],m[1],0);r(t,n.WebMercator,t,n.PlateCarree);let i=e(m[2],m[3],0);r(i,n.WebMercator,i,n.PlateCarree),p[0]=t[0],p[1]=t[1],p[2]=i[0],p[3]=i[1]}else for(let e=0;e<4;++e)p[e]=m[e]*d;this.centerAtSeaLevel[0]=(p[0]+p[2])*.5,this.centerAtSeaLevel[1]=(p[1]+p[3])*.5,this.centerAtSeaLevel[2]=0,this._edgeLen=Math.max(p[2]-p[0],p[3]-p[1]),this._edgeLen2=this._edgeLen*this._edgeLen,this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateCenter();let e=this._extentInRenderSR,t=(e[2]-e[0])*.5,n=(e[3]-e[1])*.5,r=Math.sqrt(t*t+n*n);this._baseRadius=r;let i=(this.elevationBoundsMax-this.elevationBoundsMin)*.5,a=Math.max(r,i);this._center[1].radius=a}_calculateFrustumVisibility(e,t){if(t!=null&&!s(this.centerAtSeaLevel,this._baseRadius,t.center,t.radius))return 2;let n=this._aabb(),r=e,i=n[0],a=n[1],o=n[2],c=n[3],l=n[4],u=n[5],d=!0;for(let e=0;e<6;e++){let t=r[e],n=t[0],s=t[1],f=t[2],p=t[3];if(n*(n>0?i:c)+s*(s>0?a:l)+f*(f>0?o:u)+p>=0)return 2;d&&=n*(n<0?i:c)+s*(s<0?a:l)+f*(f<0?o:u)+p<=0}return+!d}_aabb(){let e=this._extentInRenderSR;return i(e[0],e[1],Math.min(this.elevationBoundsMin,this._subtreeGeometryElevationBoundMin),e[2],e[3],Math.max(this.elevationBoundsMax,this._subtreeGeometryElevationBoundMax))}intersectsRay(e,t,n,r){return m[0]=1/t[0],m[1]=1/t[1],m[2]=1/t[2],f(this._aabb(),e,m,n,r)}createGeometry(){c(this.renderData),this._updateSubtreeGeometryElevationsBounds(),this.setMemoryDirty()}_updateSubtreeGeometryElevationsBounds(){let e=this._subtreeGeometryElevationBoundMin,t=this._subtreeGeometryElevationBoundMax,n=this.renderData,r=e,i=t;if(n){let e=n.geometry.boundingBox;r=e[2],i=e[5]}else if(!this.leaf){r=1/0,i=-1/0;for(let e of this.children){let t=e;r=Math.min(r,t._subtreeGeometryElevationBoundMin),i=Math.max(i,t._subtreeGeometryElevationBoundMax)}}(r!==this._subtreeGeometryElevationBoundMin||i!==this._subtreeGeometryElevationBoundMax)&&(this._subtreeGeometryElevationBoundMin=r,this._subtreeGeometryElevationBoundMax=i,this.updateVisibility(),this.parent?._updateSubtreeGeometryElevationsBounds())}get minimumVerticesPerSide(){return this.level<9?3:2}updateEdgeElevations(e=!1){l(this.renderData,e),this._updateSubtreeGeometryElevationsBounds()}updateEdgeElevationsAndResolutions(){u(this.renderData),this._updateSubtreeGeometryElevationsBounds()}get horizontalScale(){return this._horizontalScaleFactor}}const m=t();export{p as PlanarPatch};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import"../../../core/has.js";import{lerp as e}from"../../../core/mathUtils.js";import{normalize as t,set as n,add as r,scale as i,len as a,dot as o}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s,ZEROS as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lonLatToSphericalPCPF as l}from"../../../geometry/projection/lonLatToSphericalPCPF.js";import{intersectsSphere as u,numPlanes as d}from"../../../geometry/support/frustumPlanes.js";import{Sphere as f}from"../../../geometry/support/sphere.js";import{sphereIntersectsInfiniteRadialConeConservative as p}from"../support/ElevationAgnosticVisibility.js";import{correctSphericalTileCornersForLatitude as m,computeSmallestSphericalTileCone as h,getSphericalTilePole as g}from"../support/sphericalTileUtils.js";import{createSphericalGlobePatch as _,updateEdgesAndCornersSpherical as v,updateEdgeElevationsAndResolutionsSpherical as y}from"./PatchGeometryFactory.js";import"../../../core/Collection.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../kernel.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../layers/Layer.js";import"../../../geometry/Extent.js";import"./TerrainConst.js";import"./TilingScheme.js";import{Tile as b}from"./Tile.js";class x extends b{constructor(e,t,n,r,i){super(),this._convexHull=Array(24),this._boundingConeAxis=s(),this._boundingConeHalfAngleSin=1,this._boundingSphere=new f,this._baseUsedMemory=1816,this.init(e,t,n,r,i)}init(n,r,i,a,o){super.init(n,r,i,a,o);let s=this.ellipsoid.radius,c=this.extentInRadians[0],u=this.extentInRadians[1],d=this.extentInRadians[2],f=this.extentInRadians[3],p=e(u,f,.5),m=e(c,d,.5),h=n===0?0:Math.min(Math.abs(u),Math.abs(f));this._edgeLen=(d-c)*Math.cos(h)*s,this._edgeLen2=this._edgeLen*this._edgeLen,this._curvatureHeight=s-Math.sqrt(s*s-this._edgeLen2/4),l(this.centerAtSeaLevel,m,p,this.ellipsoid.radius),t(this.up,this.centerAtSeaLevel),this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateBoundingVolumes();let e=this._center;if(this.lij[0]===0)e[1].center=c,n(e[0],0,0,0),n(e[2],0,0,0),e[1].radius=this.ellipsoid.radius+this.elevationBoundsMax;else{this._updateCenter();let t=e[1],n=this.convexHull,r=0,i=t.center;for(let e=0;e<8;++e)r=Math.max(r,C(i,n,e*3));e[1].radius=Math.sqrt(r)}}_calculateFrustumVisibility(e,t){if(!u(e,this._boundingSphere))return 2;let{level:n}=this;if(n>=2&&t!=null&&this._getPatchType()===0&&!p(this._boundingConeAxis,this._boundingConeHalfAngleSin,t.center,t.radius))return 2;if(n<10)return 1;let r=this.convexHull,i=this.surface.view.state.camera.near,a=!0;for(let t=0;t<d;t++){let n=t===4,o=e[t],s=o[0],c=o[1],l=o[2],u=o[3]-(n?i:0),d=!1;for(let e=0;e<8;++e){let t=e*3;if(s*r[t]+c*r[t+1]+l*r[t+2]+u<0){if(d=!0,!a)break}else a=!1}if(!d)return 2}return+!a}createGeometry(){_(this.renderData,this._getPatchType()),this.setMemoryDirty()}_updateBoundingVolumes(){this._updateConvexHull(),this._updateBoundingSphere()}_updateBoundingSphere(){let e=this._boundingSphere,t=this.elevationBoundsMin,n=this.elevationBoundsMax,o=this.ellipsoid.radius,s=n;if(this.level===0)e.center=c,e.radius=o+s;else{let s=this.extentInRadians,c=.5*(s[0]+s[2]),l=s[1],u=s[3];T(D,c,l,o),T(O,c,u,o),r(e.center,D,O);let d=o+.5*(t+n);i(e.center,e.center,d/a(e.center));let f=this.convexHull,p=0;for(let t=0;t<8;++t)p=Math.max(p,C(e.center,f,t*3));e.radius=Math.sqrt(p)+2}}_updateConvexHull(){let e=this.extentInRadians,n=this.ellipsoid.radius;if(this.level===0)return;let i=this.elevationBoundsMin,a=this.elevationBoundsMax,s=this._getPatchType(),c=this.surface.isWebMercator,l=c&&s===1,u=c&&s===2,d=u||l,f=Math.PI/2,p=e[0],g=e[2],_=u?-f:e[1],v=l?f:e[3],y=.5*(p+g),b=i,x=n+(d?Math.min(0,b-1):b),S=(e,t,n)=>T(e,t,n,x),C=k,w=A,D=j,O=M;S(C,p,_),S(w,p,v),S(D,g,v),S(O,g,_);let I=(e,t)=>{for(let n=0;n<3;++n)this._convexHull[t*3+n]=e[n]},L=a,R=n+(d?Math.max(0,L+1):L),z=N,B=P,V=F;T(B,y,v,x),T(V,y,_,x),r(z,B,V),t(z,z);let H=E;H[0]=C,H[1]=O,H[2]=D,H[3]=w,H[4]=V,H[5]=B,m(H,x),this._boundingConeHalfAngleSin=h(C,O,D,w,this._boundingConeAxis),I(C,0),I(w,1),I(D,2),I(O,3);let U=(e,t)=>{let n=R/o(t,z);for(let r=0;r<3;++r)this._convexHull[e*3+r]=t[r]*n};U(4,C),U(5,w),U(6,D),U(7,O)}_getPatchType(){let e=g(this.lij,this.spatialReference),t=e===1||e===3,n=e===2||e===3;return t?n?3:1:n?2:0}intersectsRay(e,t,n,r){let i=this._boundingSphere,a=i.radius+n,o=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=i.center[0]-e[0],c=i.center[1]-e[1],l=i.center[2]-e[2],u=(s*t[0]+c*t[1]+l*t[2])/o,d=t[0]*u,f=t[1]*u,p=t[2]*u,m=d-s,h=f-c,g=p-l;return m*m+h*h+g*g<a*a}get minimumVerticesPerSide(){return this.level<S.length?S[this.level]+1:2}updateEdgeElevations(){v(this.renderData)}updateEdgeElevationsAndResolutions(){y(this.renderData)}_checkBVs(){}get convexHull(){return this._convexHull}}const S=[128,64,64,32,16,8,8,4];function C(e,t,n){return w(e[0],e[1],e[2],t[n],t[n+1],t[n+2])}function w(e,t,n,r,i,a){let o=r-e,s=i-t,c=a-n;return o*o+s*s+c*c}const T=(e,t,n,r)=>{let i=Math.cos(t),a=Math.sin(t),o=Math.cos(n),s=Math.sin(n);e[0]=r*o*i,e[1]=r*o*a,e[2]=r*s},E=[null,null,null,null,null,null],D=s(),O=s(),k=s(),A=s(),j=s(),M=s(),N=s(),P=s(),F=s();export{x as SphericalPatch};
|
|
2
|
+
import"../../../core/has.js";import{lerp as e}from"../../../core/mathUtils.js";import{normalize as t,set as n,add as r,scale as i,len as a,dot as o}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s,ZEROS as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lonLatToSphericalPCPF as l}from"../../../geometry/projection/lonLatToSphericalPCPF.js";import{intersectsSphere as u,numPlanes as d}from"../../../geometry/support/frustumPlanes.js";import{Sphere as f}from"../../../geometry/support/sphere.js";import{sphereIntersectsInfiniteRadialConeConservative as p}from"../support/ElevationAgnosticVisibility.js";import{correctSphericalTileCornersForLatitude as m,computeSmallestSphericalTileCone as h,getSphericalTilePole as g}from"../support/sphericalTileUtils.js";import{createSphericalGlobePatch as _,updateEdgesAndCornersSpherical as v,updateEdgeElevationsAndResolutionsSpherical as y}from"./PatchGeometryFactory.js";import"../../../core/Collection.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../kernel.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../layers/Layer.js";import"../../../geometry/Extent.js";import"./TerrainConst.js";import"./TilingScheme.js";import{Tile as b}from"./Tile.js";class x extends b{constructor(e,t,n,r,i){super(),this._convexHull=Array(24),this._boundingConeAxis=s(),this._boundingConeHalfAngleSin=1,this._boundingSphere=new f,this._baseUsedMemory=1816,this.init(e,t,n,r,i)}init(n,r,i,a,o){super.init(n,r,i,a,o);let s=this.ellipsoid.radius,c=this.extentInRadians[0],u=this.extentInRadians[1],d=this.extentInRadians[2],f=this.extentInRadians[3],p=e(u,f,.5),m=e(c,d,.5),h=n===0?0:Math.min(Math.abs(u),Math.abs(f));this._edgeLen=(d-c)*Math.cos(h)*s,this._edgeLen2=this._edgeLen*this._edgeLen,this._curvatureHeight=s-Math.sqrt(s*s-this._edgeLen2/4),l(this.centerAtSeaLevel,m,p,this.ellipsoid.radius),t(this.up,this.centerAtSeaLevel),this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateBoundingVolumes();let e=this._center;if(this.lij[0]===0)e[1].center=c,n(e[0],0,0,0),n(e[2],0,0,0),e[1].radius=this.ellipsoid.radius+this.elevationBoundsMax;else{this._updateCenter();let t=e[1],n=this.convexHull,r=0,i=t.center;for(let e=0;e<8;++e)r=Math.max(r,C(i,n,e*3));e[1].radius=Math.sqrt(r)}}_calculateFrustumVisibility(e,t){if(!u(e,this._boundingSphere))return 2;let{level:n}=this;if(n>=2&&t!=null&&this._getPatchType()===0&&!p(this._boundingConeAxis,this._boundingConeHalfAngleSin,t.center,t.radius))return 2;if(n<10)return 1;let r=this.convexHull,i=this.surface.view.state.camera.near,a=!0;for(let t=0;t<d;t++){let n=t===4,o=e[t],s=o[0],c=o[1],l=o[2],u=o[3]-(n?i:0),d=!1;for(let e=0;e<8;++e){let t=e*3;if(s*r[t]+c*r[t+1]+l*r[t+2]+u<0){if(d=!0,!a)break}else a=!1}if(!d)return 2}return+!a}createGeometry(){_(this.renderData,this._getPatchType()),this.setMemoryDirty()}_updateBoundingVolumes(){this._updateConvexHull(),this._updateBoundingSphere()}_updateBoundingSphere(){let e=this._boundingSphere,t=this.elevationBoundsMin,n=this.elevationBoundsMax,o=this.ellipsoid.radius,s=n;if(this.level===0)e.center=c,e.radius=o+s;else{let s=this.extentInRadians,c=.5*(s[0]+s[2]),l=s[1],u=s[3];T(D,c,l,o),T(O,c,u,o),r(e.center,D,O);let d=o+.5*(t+n);i(e.center,e.center,d/a(e.center));let f=this.convexHull,p=0;for(let t=0;t<8;++t)p=Math.max(p,C(e.center,f,t*3));e.radius=Math.sqrt(p)+2}}_updateConvexHull(){let e=this.extentInRadians,n=this.ellipsoid.radius;if(this.level===0)return;let i=this.elevationBoundsMin,a=this.elevationBoundsMax,s=this._getPatchType(),c=this.surface.isWebMercator,l=c&&s===1,u=c&&s===2,d=u||l,f=Math.PI/2,p=e[0],g=e[2],_=u?-f:e[1],v=l?f:e[3],y=.5*(p+g),b=i,x=n+(d?Math.min(0,b-1):b),S=(e,t,n)=>T(e,t,n,x),C=k,w=A,D=j,O=M;S(C,p,_),S(w,p,v),S(D,g,v),S(O,g,_);let I=(e,t)=>{for(let n=0;n<3;++n)this._convexHull[t*3+n]=e[n]},L=a,R=n+(d?Math.max(0,L+1):L),z=N,B=P,V=F;T(B,y,v,x),T(V,y,_,x),r(z,B,V),t(z,z);let H=E;H[0]=C,H[1]=O,H[2]=D,H[3]=w,H[4]=V,H[5]=B,m(H,x),this._boundingConeHalfAngleSin=h(C,O,D,w,this._boundingConeAxis),I(C,0),I(w,1),I(D,2),I(O,3);let U=(e,t)=>{let n=R/o(t,z);for(let r=0;r<3;++r)this._convexHull[e*3+r]=t[r]*n};U(4,C),U(5,w),U(6,D),U(7,O)}_getPatchType(){let e=g(this.lij,this.spatialReference),t=e===1||e===3,n=e===2||e===3;return t?n?3:1:n?2:0}intersectsRay(e,t,n,r){let i=this._boundingSphere,a=i.radius+n,o=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=i.center[0]-e[0],c=i.center[1]-e[1],l=i.center[2]-e[2],u=(s*t[0]+c*t[1]+l*t[2])/o,d=t[0]*u,f=t[1]*u,p=t[2]*u,m=d-s,h=f-c,g=p-l;return m*m+h*h+g*g<a*a}get minimumVerticesPerSide(){return this.level<S.length?S[this.level]+1:2}updateEdgeElevations(e=!1){v(this.renderData,e)}updateEdgeElevationsAndResolutions(){y(this.renderData)}_checkBVs(){}get convexHull(){return this._convexHull}}const S=[128,64,64,32,16,8,8,4];function C(e,t,n){return w(e[0],e[1],e[2],t[n],t[n+1],t[n+2])}function w(e,t,n,r,i,a){let o=r-e,s=i-t,c=a-n;return o*o+s*s+c*c}const T=(e,t,n,r)=>{let i=Math.cos(t),a=Math.sin(t),o=Math.cos(n),s=Math.sin(n);e[0]=r*o*i,e[1]=r*o*a,e[2]=r*s},E=[null,null,null,null,null,null],D=s(),O=s(),k=s(),A=s(),j=s(),M=s(),N=s(),P=s(),F=s();export{x as SphericalPatch};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{set as e,length as t,normalize as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newDoubleArray as i}from"../../../../geometry/support/DoubleArray.js";import{newPathVertex as a}from"./PathVertex.js";class o{constructor(e,t,n,o,s,c){this.numVertices=e,this.positionsES=n,this.offset=s,this.positions=c,this.directions=i((e-1)*3),this.frames=i(e*6),this.minSiblingLengths=i(e),this._tmpVertex=a(t);let l=e,u=Math.floor(l/2),d=this.offset+3*u,f=o[d],p=o[d+1],m=o[d+2];this.origin=r(f,p,m);let h=this.offset+l*3;for(let e=this.offset;e<h;e+=3)c[e]=o[e]-f,c[e+1]=o[e+1]-p,c[e+2]=o[e+2]-m;this.updatePathVertexInformation()}getVertex(e){let t=this._tmpVertex,n=(e-1)*3,r=Math.min(e,this.numVertices-2)*3,i=e*6;for(let a=0;a<3;++a)t.vLeft[a]=e===0?0:this.directions[n+a],t.vRight[a]=this.directions[r+a],t.frame.up[a]=this.frames[i+a],t.frame.right[a]=this.frames[i+3+a];return t.vMinSiblingLength=this.minSiblingLengths[e],t}setFrame(e,t,n){let r=e*6;for(let e=0;e<3;++e)this.frames[r+e]=t[e],this.frames[r+3+e]=n[e]}setFrameFromUpVector(e,t){let n=this.getVertex(e);n.setFrameFromUpVector(t),this.setFrame(e,n.frame.up,n.frame.right)}updatePathVertexInformation(){let{numVertices:r,positions:i,directions:a,minSiblingLengths:o}=this,s=this._tmpVertex.vRight,c=0;for(let l=0;l<r-1;++l){let r=this.offset+l*3;e(s,i[r+3]-i[r],i[r+4]-i[r+1],i[r+5]-i[r+2]);let u=t(s);o[l]=l===0?u:Math.min(c,u),c=u,n(s,s);for(let e=0;e<3;++e)a[l*3+e]=s[e]}o[r-1]=c}}export{o as Path};
|