@arcgis/core 4.34.0-next.75 → 4.34.0-next.76
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/applications/Components/arcadeEditorUtils.d.ts +4 -0
- package/applications/Components/arcadeEditorUtils.js +5 -0
- package/applications/Components/featureUtils.d.ts +1 -0
- package/applications/Components/featureUtils.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/Pixel.js +1 -1
- package/arcade/Voxel.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/13de06e614adf92239fe.js +1 -0
- package/assets/esri/core/workers/chunks/14a22d1a0eefa970efa1.js +1 -0
- package/assets/esri/core/workers/chunks/16d66770ef841564ee3f.js +1 -0
- package/assets/esri/core/workers/chunks/17103e6542aae53c7301.js +1 -0
- package/assets/esri/core/workers/chunks/{5c30252c1bb8350cae5f.js → 1c52999a6392370844a6.js} +1 -1
- package/assets/esri/core/workers/chunks/21bfad7283620766d9cd.js +1 -0
- package/assets/esri/core/workers/chunks/3064320d54a9b48bd697.js +1 -0
- package/assets/esri/core/workers/chunks/3a5f0c759dd2f4638343.js +1 -0
- package/assets/esri/core/workers/chunks/4832faefd3b7edc17c84.js +1 -0
- package/assets/esri/core/workers/chunks/4d47187bc0821413492d.js +1 -0
- package/assets/esri/core/workers/chunks/5102c20645d9708c34b4.js +1 -0
- package/assets/esri/core/workers/chunks/58cc06ed86301f4cee75.js +1 -0
- package/assets/esri/core/workers/chunks/{e12e8d69c05c182b6a69.js → 61bb39597ccf89f99a72.js} +1 -1
- package/assets/esri/core/workers/chunks/{a25b75de1bca1dd21941.js → 70367da4ba916376f40c.js} +1 -1
- package/assets/esri/core/workers/chunks/7b73a808922b52755abd.js +1 -0
- package/assets/esri/core/workers/chunks/a0edff37fd4a3f2cb2eb.js +1 -0
- package/assets/esri/core/workers/chunks/a9f6054d86982b9e5a7c.js +1 -0
- package/assets/esri/core/workers/chunks/{10ec10ca361842efce92.js → ab005fe84952f0676020.js} +1 -1
- package/assets/esri/core/workers/chunks/b70d71144a060f7eeeeb.js +1 -0
- package/assets/esri/core/workers/chunks/b8d02f1b73c374767a5f.js +1 -0
- package/assets/esri/core/workers/chunks/ba6452acee3d6defb37e.js +1 -0
- package/assets/esri/core/workers/chunks/bfbbf180c2c8fdbb6731.js +1 -0
- package/assets/esri/core/workers/chunks/{356c96fad88558be9054.js → c6fecf2bbd2a711f15d3.js} +1 -1
- package/assets/esri/core/workers/chunks/c86f5bb199cf046b8952.js +1 -0
- package/assets/esri/core/workers/chunks/{b5f197e24982f6e14468.js → d1f181f91b36351f1d3b.js} +2 -2
- package/assets/esri/core/workers/chunks/{8e428b0f33ef4688415e.js → d95554f43694b4769675.js} +1 -1
- package/assets/esri/core/workers/chunks/dd587d51dad2d82708d1.js +1 -0
- package/assets/esri/core/workers/chunks/ecac5ca00c742bfb5898.js +1 -0
- package/assets/esri/core/workers/chunks/{0d946a226b846b3c0849.js → fc06014fb484fc8c697e.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/chunks/Compositing.glsl.js +4 -3
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/config.js +1 -1
- package/core/sql.d.ts +1 -0
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/normalizeUtils.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/interfaces.d.ts +45 -0
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/Lyr3DWorkerHandle.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/networks/CircuitManager.js +1 -1
- package/networks/support/Circuit.js +1 -1
- package/networks/support/CircuitSection.js +1 -1
- package/networks/support/Subcircuit.js +1 -1
- package/package.json +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/modeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWorker.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/cameraUtilsSpherical.js +1 -1
- package/{layers/support/GaussianSplatAtlasPageAllocator.js → views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js} +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianTile.js +5 -0
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +12 -13
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
- package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +10 -11
- package/views/VideoView.js +1 -1
- package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/assets/esri/core/workers/chunks/06bd58c219678315cf5c.js +0 -1
- package/assets/esri/core/workers/chunks/0751f539db31bdb5caec.js +0 -1
- package/assets/esri/core/workers/chunks/19228ab0fe7944c554e5.js +0 -1
- package/assets/esri/core/workers/chunks/2a19a4d7d1c580121065.js +0 -1
- package/assets/esri/core/workers/chunks/37ff19a9c5c99bd4e7c7.js +0 -1
- package/assets/esri/core/workers/chunks/3d2629357242492afcfa.js +0 -1
- package/assets/esri/core/workers/chunks/5c4ba165816809e06340.js +0 -1
- package/assets/esri/core/workers/chunks/5f239972cb95afdfa77a.js +0 -1
- package/assets/esri/core/workers/chunks/6963ded8428cc8d51d85.js +0 -1
- package/assets/esri/core/workers/chunks/6c3ae96c6ef764fb9552.js +0 -1
- package/assets/esri/core/workers/chunks/76ec3d2646ba64e3442f.js +0 -1
- package/assets/esri/core/workers/chunks/925ad2665c2fe0f47cc3.js +0 -1
- package/assets/esri/core/workers/chunks/93b2e0a300b2758a1ca4.js +0 -1
- package/assets/esri/core/workers/chunks/b03dcbc31bccb9fdf9fe.js +0 -1
- package/assets/esri/core/workers/chunks/b0de01f8c9b1c3182e0c.js +0 -1
- package/assets/esri/core/workers/chunks/c7ba8f2aca0fbd6ceded.js +0 -1
- package/assets/esri/core/workers/chunks/c908184d747d33366881.js +0 -1
- package/assets/esri/core/workers/chunks/d1711256493d55eca523.js +0 -1
- package/assets/esri/core/workers/chunks/e6e4e2fb9568319c6207.js +0 -1
- package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +0 -1
- package/assets/esri/core/workers/chunks/f060a52a9b69eb250d63.js +0 -1
- package/layers/support/gaussianSplatUtils.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import
|
|
5
|
+
import{__decorate as e}from"tslib";import s from"../../../core/Logger.js";import{removeMaybe as t}from"../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{fromValues as o}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{isCompatible as l}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as h,isWebMercator as d,equals as u}from"../../../geometry/support/spatialReferenceUtils.js";import{getHeightModelInfoFromVCS as c}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as m}from"../../../support/elevationInfoUtils.js";import{LayerView3D as p}from"./LayerView3D.js";import{addLayerViewToWasm as f,getLyr3DWasm as y,removeLayerViewFromWasm as _}from"./Lyr3DWasm.js";import{Obb as g}from"../support/orientedBoundingBox.js";import{splatPageSizeInU32 as w,elementsPerSplatPage as b,packedGaussianSizeInU32 as M,splatPageSizeInU32WithoutHeader as v,gaussiansPerSplatPage as j,splatAtlasTextureWidth as C}from"../support/gaussianSplatting/GaussianSplatAtlasPages.js";import{GaussianTile as S}from"../support/gaussianSplatting/GaussianTile.js";import{GaussianSplatRenderNode as x}from"../webgl-engine/lib/GaussianSplatRenderNode.js";import U from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as A}from"../../support/layerViewUtils.js";const H=()=>s.getLogger("esri.views.3d.layers.GaussianSPlatLayerView3D");let R=class extends(p(U)){constructor(e){super(e),this.type="gaussian-splat-3d",this._gaussianTileHandles=new Map,this._pageBuffer=new Uint32Array(w),this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this._useEsriCrs=!1,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer),this._memCache=e.view.resourceController.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._renderNode=new x(e)}initialize(){if(!this._canProjectWithoutEngine())throw A("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=f(this).then(e=>{this._wasmLayerId=e,this.addHandles([r(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e))]),this._suspendedHandle=r(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),i)});this.addResolvingPromise(e)}get wasmLayerId(){return this._wasmLayerId}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get _wasm(){return y(this.view)}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._useEsriCrs}async createRenderable(e){const s=e.meshData;if(null==s.data)throw new Error("meshData.data undefined");if(s.desc=JSON.parse(s.desc),null==s.desc)throw new Error("meshData.desc undefined");const t=s.desc.prims[0],r=t.vertexCount,i=t.atrbs[0].view,a=t.atrbs[0].view.byteCount,n=t.atrbs[0].view.byteOffset;let l=null;if("U32"!==i.type)return H().warnOnce("unexpected meshData.data format"),{memUsageBytes:0};l=new Uint32Array(s.data.buffer,n,a/4);const h=this.extractHeader(l),d=Math.ceil(r/j),u=new Uint32Array(r),c=[];for(let o=0;o<d;o++){const e=this._data.textureAtlas.requestPage();if(null===e)return H().warnOnce("ran out of available gaussian splat memory (all pages are occupied)"),{memUsageBytes:0};{c.push(e);const s=r-o*j,t=Math.min(s,j),i=o*j;for(let r=0;r<t;r++)u[r+i]=r+b*e;const a=o*v;this._pageBuffer.set(l.subarray(a,a+t*M)),this._pageBuffer.set(h.packedHeader,v);const n=e*b,d=n%C,m=Math.floor(n/C);this._data.textureAtlas.update(d,m,this._pageBuffer)}}const m=new Float64Array(3*r),p=new Float64Array(r),f=2.048,y=h.tileOrigin.x*f,_=h.tileOrigin.y*f,w=h.tileOrigin.z*f,x=h.invPosScale;let U=0,A=0;for(let o=0;o<r;o++){const e=o*M,{rawX:s,rawY:t,rawZ:r}=this._extractGaussianPosition(l,e),i=this._extractGaussianSphericalScale(l,e);m[U]=s*x+y,m[U+1]=t*x+_,m[U+2]=r*x+w,p[o]=i*i,A=Math.max(A,i),U+=3}let R=null;if(s.desc.obb){const e=s.desc.obb.quaternion;R=new g(s.desc.obb.center,s.desc.obb.halfSize,o(...e))}R||(H().warnOnce("encountered tile without a bounding box"),R=new g);const V=new S(e.handle,R,u,c,m,p,A);return this._memCache.put(`${V.handle}`,V),this._gaussianTileHandles.set(e.handle,V),this._cacheMemory+=V.usedMemory,{memUsageBytes:V.usedMemory}}_extractGaussianPosition(e,s){const t=e[s+1];return{rawX:16383&t,rawY:t>>>14&16383,rawZ:t>>>28&15|(1023&e[s+2])<<4}}_extractGaussianSphericalScale(e,s){const t=e[s+2],r=t>>>10&255,i=t>>>18&255,a=t>>>26&63|(3&e[s+3])<<6,n=Math.exp(r/16-10),o=Math.exp(i/16-10),l=Math.exp(a/16-10);return Math.max(n,o,l)}freeRenderable(e){const s=this._gaussianTileHandles.get(e);s&&(s.isVisible?this._usedMemory-=s.usedMemory:this._cacheMemory-=s.usedMemory,s.pageIds.forEach(e=>this._data.textureAtlas.freePage(e)),this.freeObject(s),this._gaussianTileHandles.delete(e)),this._updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}setRenderableVisibility(e,s,t){for(let r=0;r<t;r++){if(!s[r])continue;const t=e[r],i=this._gaussianTileHandles.get(t);if(i){if(i.isVisible)continue;i.isVisible=!0,this._usedMemory+=i.usedMemory,this._cacheMemory-=i.usedMemory,this._memCache.pop(`${t}`)}}for(let r=0;r<t;r++){if(s[r])continue;const t=e[r],i=this._gaussianTileHandles.get(t);if(i){if(!i.isVisible)continue;i.isVisible=!1,this._usedMemory-=i.usedMemory,this._cacheMemory+=i.usedMemory,this._memCache.put(`${t}`,i)}}this._updateGaussians()}destroy(){_(this),this._suspendedHandle&&(this._suspendedHandle=t(this._suspendedHandle)),this._renderNode.destroy(),this._memCache.destroy()}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if(h(this.view.renderSpatialReference)||d(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&u(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){const e=c(this.layer.esriCrsSpatialReference),s=this.view.heightModelInfo;return this._useEsriCrs=0===l(e,s,!1),this._useEsriCrs}return!1}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,m(e))}_updateGaussians(){const e=new Array;for(const s of this._gaussianTileHandles.values())s.isVisible&&e.push(s);this._data.updateGaussianVisibility(e)}get _data(){return this._renderNode.data}extractHeader(e){const s=e.length-4,t=this.reinterpretU32AsFloat(e[s]),r=this.reinterpretU32AsFloat(e[s+1]),i=this.reinterpretU32AsFloat(e[s+2]),a=1/(1<<(255&e[s+3]));return{packedHeader:e.subarray(s,s+4),tileOrigin:{x:t,y:r,z:i},invPosScale:a}}_deleteTile(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}};e([a()],R.prototype,"layer",void 0),R=e([n("esri.views.3d.layers.GaussianSplatLayerView3D")],R);const V=R;export{V as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{loadLyr3DWorkerWASM as s}from"../../../libs/lyr3d/Lyr3DModule.js";let t,
|
|
5
|
+
import{loadLyr3DWorkerWASM as s}from"../../../libs/lyr3d/Lyr3DModule.js";let t,e;async function n(s){await o();const t={status:1,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]};if(s.inputs.length<1)return{result:t,transferList:[]};const n={ptrs:[],sizes:[]};for(const o of s.inputs){const s=e._malloc(o.byteLength);new Uint8Array(e.HEAPU8.buffer,s,o.byteLength).set(new Uint8Array(o)),n.ptrs.push(s),n.sizes.push(o.byteLength)}const r=e.process(s.jobDescJson,s.id,n,s.isMissingResourceCase);t.status=r.status,t.missingInputUrls=r.missingInputUrls.slice();const i=0===r.status&&r.data,a=2===t.status&&t.missingInputUrls.length>0;t.jobDescJson=r.jobDescJson.slice(),t.error=r.error.slice(),i?t.data=r.data.slice():a&&(t.originalInputs=s.inputs.slice());for(let o=0;o<n.ptrs.length;++o)e._free(n.ptrs[o]);const u=[];if(i)u.push(t.data.buffer);else if(a)for(const e of s.inputs)u.push(e);return{result:t,transferList:u}}async function r(s){await o(),e.add_spatial_reference_info(s.sr,s.isGCS,s.toMetersXY,s.toMetersZ)}function i(){e&&(e.uninitialize_lyr3d_worker_wasm(),e=null)}function o(){return e?Promise.resolve():(t||(t=s().then(s=>{e=s,e.initialize_lyr3d_worker_wasm(),t=null})),t)}export{r as addSpatialReferenceInfo,i as destroyWasm,o as initialize,n as process};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{disposeMaybe as
|
|
5
|
+
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../core/maybe.js";import s from"../../../../core/PooledArray.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as n,l as o,g as a,u as h,e as l,k as c}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as u}from"../../../../chunks/vec42.js";import{create as p,offset as m,contains as g,containsPoint as _,set as f,positiveInfinity as P,equals as x}from"../../../../geometry/support/aaBoundingBox.js";import{create as b}from"../../../../geometry/support/plane.js";import{fromPoints as S}from"../../../../geometry/support/ray.js";import{j as w,i as z}from"../../../../chunks/sphere.js";import{PclTarget as R}from"./Intersector.js";import{PointCloudHighlights as y}from"./PointCloudHighlights.js";import{isDepth as j,isColorOrColorEmission as v}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as q}from"../../webgl-engine/effects/RenderPlugin.js";import{IntersectorResult as F}from"../../webgl-engine/lib/IntersectorResult.js";import{VertexArrayObject as A}from"../../webgl-engine/lib/VertexArrayObject.js";import{P as E,g as B}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as H,positionsLayout as M,colorsLayout as O}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as I}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{PrimitiveType as N}from"../../../webgl/enums.js";import{VertexBuffer as V}from"../../../webgl/VertexBuffer.js";let T=class extends q{constructor(e){super(e),this.type=6,this.isGround=!1,this._passParameters=new E,this._highlights=new y({forEachNode:e=>this.forEachNode(e),addHighlight:(e,t,s)=>this._addHighlight(e,t,s),removeHighlight:(e,t)=>this._removeHighlight(e,t)}),this.produces=new Map([[2,e=>!(j(e)||9===e&&this._highlights.empty)],[3,e=>j(e)]]),this.point=d(),this.intersectionRayDir=d(),this.intersectionPlane=b(),this.nodeOriginOffset=d(),this.nodeBoundingBox=p(),this.layerViewUid="",this._slicePlaneEnabled=!1,this._configuration=new I,this._nodes=new s}destroy(){this._nodes.prune()}hasHighlight(e){return this._highlights.has(e)}initializeRenderContext(e){this._context=e,e.requestRender()}uninitializeRenderContext(){}intersect(e,t,s,i){const{point:r,intersectionRayDir:f,nodeOriginOffset:P,intersectionPlane:x,layerViewUid:b,nodeBoundingBox:y}=this,j=S(s,i),v=e.camera.perScreenPixelRatio/2,q=e.camera.near;n(f,i,s);const A=1/o(f);a(f,f,A);const E=d();h(E,f),u(x,f[0],f[1],f[2],-l(f,s));const B=new D,H=new D,M=new Array,O=p(this._passParameters.clipBox);m(O,-s[0],-s[1],-s[2],O),this._nodes.forAll(o=>{const{isLeaf:a,coordinates:h}=o,d=o.splatSize*this._passParameters.scaleFactor;let u=o.obb.minimumDistancePlane(x),p=o.obb.maximumDistancePlane(x);u-=k(d,u+q,this._passParameters,v,a),p-=k(d,p+q,this._passParameters,v,a);const S=p<0,R=null!=B.dist&&null!=H.dist&&B.dist<u*A&&H.dist>p*A;if(S||R)return;const F=C(d,p+q,this._passParameters,v,a),I=w(o.obb.center,o.obb.radius+F);if(!z(I,j,null))return;if(!o.obb.intersectRay(s,f,F))return;const N=F*F;o.obb.toAaBoundingBox(y),m(y,-s[0],-s[1],-s[2],y);const V=!g(O,y);n(P,o.origin,s);const T=h.length/3;for(let n=0;n<T;n++){const u=3*n;if(r[0]=P[0]+h[u],r[1]=P[1]+h[u+1],r[2]=P[2]+h[u+2],V&&!_(O,r))continue;const p=l(r,f),m=p*p,g=c(r)-m;if(g>N)continue;let x=p+q;const S=k(d,x,this._passParameters,v,a);if(p-S<0)continue;x-=S;const w=C(d,x,this._passParameters,v,a);if(g>w*w)continue;const z=(p-S)*A,R=e=>(e.point=e.point?L(o,n,e.point):L(o,n),e.dist=z,e.normal=E,e.node=o,e.pointId=n,e.layerViewUid=b,e);if((null==B.dist||z<B.dist)&&(null==t||t(s,i,z))&&R(B),0!==e.options.store&&(null==H.dist||z>H.dist)&&(null==t||t(s,i,z))&&R(H),2===e.options.store&&(null==t||t(s,i,z))){const e=new D;M.push(R(e))}}});const I=e=>{const{layerViewUid:t,node:s,pointId:i}=e;return new R(e.point,t,i,()=>this.createGraphic(s,i,e.point))},N=(e,t)=>{const s=I(t);e.set(this.type,s,t.dist,t.normal)};if(U(B)){const t=e.results.min;(null==t.distance||B.dist<t.distance)&&N(t,B)}if(U(H)&&0!==e.options.store){const t=e.results.max;(null==t.distance||H.dist>t.distance)&&N(t,H)}if(2===e.options.store)for(const n of M){const t=new F(j);N(t,n),e.results.all.push(t)}}acquireTechniques(e){const t=9===e.output;return 0!==this._nodes.length&&(v(e.output)||j(e.output)&&3===e.bind.slot||t)?(this._nodes.forAll(t=>this._initNode(e,t)),this._configuration.drawScreenSize=this._passParameters.drawScreenSpace,this._configuration.useFixedSizes=this._passParameters.useFixedSizes,this._configuration.hasSlicePlane=this._slicePlaneEnabled,this._configuration.hasOccludees=e.bind.hasOccludees,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasHighlightMixTexture=t&&null!=e.bind.highlightMixTexture,this._configuration.output=e.output,this._context.techniques.get(H,this._configuration)):null}render(e,t){const{rctx:s,bind:i,output:r}=e,n=s.bindTechnique(t,i,this._passParameters),o=9===r,a=i.highlight?.name??null;o&&!a||this._nodes.forAll(t=>{0===t.coordinates.length||null==t.vao||o&&!t.highlightMap.has(a)||(n.assertCompatibleVertexAttributeLocations(t.vao),n.bindDraw(i,this._passParameters,t),s.bindVAO(t.vao),o?this._renderHighlightFragments(e,t):s.drawArrays(N.POINTS,0,t.coordinates.length/3))})}_renderHighlightFragments(e,t){const{highlightMap:s}=t,{rctx:i,bind:r}=e,{highlight:n}=r;if(!n)return;const o=n.name,a=s.get(o);if(!a||0===a.length)return;const{highlightOrderMap:h,highlightLevel:l}=r;if(null==l)return;for(const g of s.keys())if(g!==o){const e=h.get(g);if(void 0!==e&&e>l)return}let c=0,d=a[0].componentIndex,u=d+1;const p=()=>{for(;c<a.length&&a[c].id.highlightName!==o;)d=a[c].componentIndex,++c;u=d+1};p();const m=(e,t)=>{const s=t-e;s>0&&i.drawArrays(N.POINTS,e,s)};for(;c<a.length;){const e=a[c];if(e.id.highlightName!==o){m(d,u),++c,p();continue}const t=e.componentIndex;t!==u&&(m(d,u),d=t),u=t+1,++c}m(d,u)}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){f(this._passParameters.clipBox,e||P)}get _clippingEnabled(){return!x(this._passParameters.clipBox,P,(e,t)=>e===t)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let s=null;return this._nodes.filterInPlace(i=>i.id!==e||(s=i,i.vao=t(i.vao),this._highlights.nodeRemoved(i),!1)),this._requestRender(),s}forEachNode(e){this._nodes.forEach(e)}removeAll(){this._nodes.forAll(e=>e.vao=t(e.vao)),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e,t){return this._highlights.add(e,t)}_addHighlight(e,t,s){e.addHighlight(t,s),this._requestRender()}_removeHighlight(e,t){e.removeHighlight(t),this._requestRender()}_initNode(e,t){t.vao??=new A(e.rctx,new Map([["positions",new V(e.rctx,M,t.coordinates)],["colors",new V(e.rctx,O,t.rgb)]]))}_requestRender(){this._context&&this._context.requestRender()}};function C(e,t,s,i,r){if(s.drawScreenSpace)return s.fixedSize*t*i;const n=B(r)*t*i;return s.useFixedSizes?Math.min(s.fixedSize/2,n):s.screenMinSize>0?Math.min(Math.max(s.screenMinSize*t*i,e/2),n):Math.min(e/2,n)}function k(e,t,s,i,r){return s.drawScreenSpace?0:C(e,t,s,i,r)}function L(e,t,s=d()){return s[0]=e.origin[0]+e.coordinates[3*t],s[1]=e.origin[1]+e.coordinates[3*t+1],s[2]=e.origin[2]+e.coordinates[3*t+2],s}e([i({constructOnly:!0})],T.prototype,"createGraphic",void 0),T=e([r("esri.views.3d.layers.i3s.PointCloudRenderer")],T);class D{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}function U(e){return null!=e.dist&&null!=e.point&&null!=e.pointId&&null!=e.node}export{T as PointCloudRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../Camera.js";import
|
|
5
|
+
import e from"../../../Camera.js";import t from"../../../core/Logger.js";import{deg2rad as n,rad2deg as r,asinClamped as i}from"../../../core/mathUtils.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{c as o,j as c,F as s,l}from"../../../chunks/vec32.js";import{create as u,clone as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectWithZConversion as d,project as h}from"../../../geometry/projectionUtils.js";import g from"../../../geometry/SpatialReference.js";import{projectPointToVectorAsync as y,projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as R,projectVectorToPoint as w}from"../../../geometry/projection/projectVectorToPoint.js";import{gcsCyclical as x,webMercatorCyclical as M}from"../../../geometry/support/normalizeUtils.js";import{toRenderCamera as j}from"../webgl.js";import{getGreatCircleSpanAt as T}from"./earthUtils.js";import{getElevationAtPoint as z}from"./ElevationProvider.js";import{viewModeDependentUtil as S,directionToHeadingTilt as C}from"./viewingModeUtils.js";import{isSpatialReferenceSupported as b}from"../../support/spatialReferenceSupport.js";const P=()=>t.getLogger("esri.views.3d.support.cameraUtils"),A=96*39.37,L=1,U=8,H=5,q=1,F=u();function I(e){return e.spatialReference??g.WGS84}function E(e,t,n,r,i){return S(e).headingTiltToDirectionUp(t,n,r,i)}function G(e,t){const{camera:n}=e.state,{unitInMeters:r}=e.renderCoordsHelper;t/=r;return n.width/2/n.pixelRatio/(A/t)/Math.tan(n.fovX/2)}function O(e,t){const{camera:n}=e.state,{unitInMeters:r}=e.renderCoordsHelper,i=t*Math.tan(n.fovX/2),a=n.width/2/n.pixelRatio;return A/(a/i)*r}function X(e,t,n,r){const i=r.levelAtScale(t),a=D(C(e,n.eye,n.viewForward,n.up).tilt),o=Math.max(i-a,0);return r.scaleAtLevel(o)}function k(e,t,n){const r=n.levelAtScale(e),i=D(t);return n.scaleAtLevel(r+i)}function D(e){return 2*((e>90?180-e:e)/90)**2}function V(e,t,n=0){const r=e.basemapTerrain?.tilingScheme;if(!r)return 0;const i=m(e.spatialReference).radius,a=2===e.state.viewingMode?t.eye[2]:l(t.eye)-i;return X(e,O(e,Math.abs(a-n)),t,r)}function W(e,t,n=0){const r=j(e,t);return r?V(e,r,n):0}const Y=1,N=100;function Z(e,t,a,o){if(0===t)return 0;const s=e.state.contentCamera,u=c(s.eye,a),f=e.basemapTerrain?.tilingScheme;if(!f)return P().error("#scaleToTargetDistance()","Cannot compute distance from scale without a tiling scheme"),u;let p=u;const d=C(e,s.eye,s.viewForward,s.up),h=d.tilt>90;if(e.state.isLocal){const r=(G(e,k(t,d.tilt,f))-Math.abs(s.eye[2]-o[2]))/Math.cos(n(d.tilt));return p=h?p-r:p+r,p}let g=1/0,y=0,v=te(e,d.heading,d.tilt,a,u,1);if(!v)return p;const R=l(o);for(;g>Y&&y<N;){const o=l(v.eye),u=h?180-v.tilt:v.tilt,w=n(u),x=Math.sin(w)*o,M=Math.cos(w)*o,j=G(e,k(t,v.tilt,f)),T=h?R-j:R+j,z=i(x/T),S=Math.cos(z)*T-M,C=c(v.eye,a);p=h?C-S:C+S,v=te(e,d.heading,d.tilt,a,p,1);const b=Me(e,v,r(s.fov));if(!v||!b)return p;const P=W(e,b,R-m(e.spatialReference).radius);g=Math.abs(t-P),++y}return p}async function B(e,t,n,r,i,a){return K(e,t,G(e,n),r,i,a)}function J(e,t,n,r,i,a){return Me(e,te(e,r.heading,r.tilt,t,n,i),r.fov,a)}async function K(e,t,n,r,i,o){const c=await ne(e,r.heading,r.tilt,t,n,i,o);return a(o),je(e,c,r.fov,o)}function Q(e,t){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(t,F,e.spatialReference)&&e.elevationProvider&&(z(e.elevationProvider,F)??0)>F[2]-q)}async function $(e,t,n){if(Q(e,t))return!0;const{elevationProvider:r,spatialReference:i,renderCoordsHelper:o}=e;if(null==r||!o.fromRenderCoords(t,F,i))return!1;const[c,s,l]=F,u=await r.queryElevation(c,s,l,i,"ground",n)??0;return a(n),u>l-q}async function _(e,t,n){const r=u();if(null==t)return o(r,e.state.camera.center);if(t instanceof p){const{renderSpatialReference:i,basemapTerrain:o,elevationProvider:c}=e,s=t.spatialReference;if(await y(t,r,i,0,{signal:n}),a(n),null==t.z&&null!=o&&null!=c){const i=await c.queryElevation(t.x,t.y,t.z??0,s,"ground",n);a(n),null!=i&&e.renderCoordsHelper.setAltitude(r,i)}return r}return o(r,t)}function ee(e,t){const n=u();if(null==t)return o(n,e.state.camera.center);if(t instanceof p){if(!v(t,n,e.renderSpatialReference))return null;const{basemapTerrain:r,elevationProvider:i}=e;if(null==t.z&&null!=r&&null!=i){const r=z(i,t);null!=r&&e.renderCoordsHelper.setAltitude(n,r)}return n}return o(n,t)}function te(e,t,n,r,i,a){return re(e,t,n,r instanceof p?r:null,ee(e,r),i,a)}async function ne(e,t,n,r,i,o,c){const s=r instanceof p?r:null,l=await _(e,r,c);return a(c),ie(e,t,n,s,l,i,o,c)}function re(e,t,n,r,i,a,o){if(null==i)return null;if(!r&&(r=new p({spatialReference:I(e)}),!w(i,e.renderSpatialReference,r)))return null;const c=ae(e,t,n,i,a,o);if(oe(e,n,o)&&Q(e,c.eye)){const{tilt:o,mode:c}=ce(e,n,i,a);return re(e,t,o,r,i,a,c)}return se(c,i)}async function ie(e,t,n,r,i,o,c,s){r||(r=new p({spatialReference:I(e)}),await R(i,e.renderSpatialReference,r,{signal:s})||(r=null)),a(s);const l=ae(e,t,n,i,o,c);if(oe(e,n,c)&&await $(e,l.eye,s)){a(s);const{tilt:c,mode:l}=ce(e,n,i,o);return ie(e,t,c,r,i,o,l,s)}return se(l,i)}function ae(e,t,n,r,i,a){const o=ge(e,t,n,r,i=Math.max(i,e.state.constraints.minimumPoiDistance),a);return(0,S(e).eyeForCenterWithHeadingTilt)(r,i,o.heading,o.tilt)}function oe(e,t,n){const r=e.map.ground.navigationConstraint;return 1===n&&e.state.isGlobal&&t>0&&(null==r||"stay-above"===r.type)}function ce(e,t,n,r){const i=we(e,n,r,Re(e,r,t,n));return{tilt:i,mode:t-i<1?0:1}}function se(e,t){return{...e,center:f(t)}}function le(e,t){const{state:n,spatialReference:r}=e,i=t.spatialReference;return n.isGlobal&&b(i,1)||n.isLocal&&r.equals(i)}function ue(e,t){let n,r,i;if(e.state.isGlobal){const e=new p(t.xmin,t.ymin,t.spatialReference),a=new p(t.xmax,t.ymax,t.spatialReference),o=t.spatialReference.isGeographic?x:M;n=new p({x:o.center(e.x,a.x),y:(a.y+e.y)/2,z:null!=t.zmax&&null!=t.zmin?(t.zmax+t.zmin)/2:void 0,spatialReference:t.spatialReference});const c=m(t.spatialReference),s=T(n,e,a);r=s.lon,i=s.lat,o.diff(e.x,a.x)>o.range/2&&(r+=c.halfCircumference),r=Math.min(r,c.halfCircumference),i=Math.min(i,c.halfCircumference)}else{const a=e.renderSpatialReference??t.spatialReference;a.equals(t.spatialReference)||(t=h(t,a)),r=t.xmax-t.xmin,i=t.ymax-t.ymin;const o=null!=t.zmax&&null!=t.zmin?(t.zmax+t.zmin)/2:void 0;n=new p({x:t.xmin+.5*r,y:t.ymin+.5*i,z:o,spatialReference:a})}const a=null!=t.zmax&&null!=t.zmin?t.zmax-t.zmin:0,o=e.state.camera,c=1/Math.tan(o.fovX/2),s=1/Math.tan(o.fovY/2),l=1/Math.tan(o.fov/2);return{center:n,distance:Math.max(.5*r*c,.5*i*s,.5*a*l)/L}}async function fe(e,t,n,r,i,o){const c=le(e,t)?t:await d(t,e.spatialReference,{signal:o});a(o);const{center:s,distance:l}=ue(e,c),u=await ne(e,n,r,s,l,i,o);return a(o),je(e,u,e.camera.fov,o)}function me(e,t,n,r,i,a){let o;try{o=le(e,t)?t:h(t,e.spatialReference)}catch(u){return null}const{center:c,distance:s}=ue(e,o),l=te(e,n,r,c,s,i);return null==l?null:Me(e,l,e.camera.fov,a)}function pe(e,t,n){const r=e.renderSpatialReference,i=new p({spatialReference:I(e)});if(!w(n,r,i))return null;const a=Math.tan(t.fovX/2),o=Math.tan(t.fovY/2),c=s(t.eye,n),l=2*c*a*L,u=2*c*o*L;return S(e).toExtent(e,i,l,u)}function de(e,t){return S(e).toArea(e,t)}function he(e,t,n){const r=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(n/r)/Math.LN2>U)return!0;const i=t,a=e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;return c(i,a)/(Math.tan(.5*e.state.camera.fov)*r)>H}function ge(e,t,n,r,i,a){let o=0;return 1===a&&he(e,r,i)?(t=0,o=ve(e,i,n,r)):o=xe(e,r,i,n),o=e.state.constraints.clampTilt(i,o),{heading:t,tilt:n=we(e,r,i,o)}}const ye=.7;function ve(e,t,n,r){const i=xe(e,r,t,n);if(!e.state.constraints.tilt)return i;const a=e.state.constraints.tilt(t);a.max=Math.min(a.max,.5*Math.PI);const o=a.min*(1-ye)+a.max*ye;return Math.min(i,o)}function Re(e,t,n,r){let i=xe(e,r,t,n);if(!e.state.constraints.tilt)return i;const a=e.state.constraints.tilt(t);return i=Math.min(i,.5*Math.PI),a.min*(1-ye)+i*ye}function we(e,t,n,r){return S(e).lookAtTiltToEyeTilt(r,t,n)}function xe(e,t,n,r){return S(e).eyeTiltToLookAtTilt(r,t,n)}function Me(t,n,r,i){if(null==n)return null;const a=t.renderSpatialReference,o=new p({spatialReference:I(t)});return w(n.eye,a,o)?(i??=new e,i.position=o,i.heading=n.heading,i.tilt=n.tilt,i.fov=r,i):null}async function je(t,n,r,i){const o=t.renderSpatialReference,c=new p({spatialReference:I(t)});return await R(n.eye,o,c,{signal:i}),a(i),new e(c,n.heading,n.tilt,r)}function Te(e,t){const n=e.basemapTerrain?.tilingScheme;if(n)return n.levelAtScale(t);P().error("#scaleToZoom()","Cannot compute zoom from scale without a tiling scheme")}function ze(e,t){const n=e.basemapTerrain?.tilingScheme;if(n)return n.scaleAtLevel(t);P().error("#zoomToScale()","Cannot compute scale from zoom without a tiling scheme")}export{X as applyTiltAdjustToScale,O as distanceToScale,K as fromCenterDistanceAsync,J as fromCenterDistanceSync,B as fromCenterScale,fe as fromExtentAsync,me as fromExtentSync,ne as getObserverForPointAtDistanceAsync,te as getObserverForPointAtDistanceSync,I as getViewSR,E as headingTiltToDirectionUp,k as removeTiltAdjustFromScale,Y as scaleErrorThreshold,G as scaleToDistance,Te as scaleToZoom,de as toArea,pe as toExtent,Z as viewScaleToCameraDistance,ze as zoomToScale};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../core/Cyclical.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../chunks/vec32.js";import"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../chunks/vec42.js";import"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../../core/libs/gl-matrix-2/math/common.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/Extent.js";import"../../../geometry/Polygon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/coordsUtils.js";import"../../../geometry/support/lineSegment.js";import"../../../geometry/support/plane.js";import"../../../geometry/support/ray.js";import"../../../chunks/sphere.js";import"../../../geometry/support/webMercatorUtils.js";import"../state/Frustum.js";import"../state/NearFarHeuristic.js";import"../state/utils/viewUtils.js";import"./cameraUtilsInternal.js";import"./earthUtils.js";import"./mathUtils.js";export{d as directionToHeadingTilt,e as eyeForCenterWithHeadingTilt,a as eyeTiltToLookAtTilt,h as headingTiltToDirectionUp,l as lookAtTiltToEyeTilt,b as toArea,t as toExtent}from"../../../chunks/cameraUtilsSpherical.js";
|
|
5
|
+
import"../../../core/Cyclical.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../chunks/vec32.js";import"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../chunks/vec42.js";import"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../../core/libs/gl-matrix-2/math/common.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/Extent.js";import"../../../geometry/Polygon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/coordsUtils.js";import"../../../geometry/support/lineSegment.js";import"../../../geometry/support/normalizeUtils.js";import"../../../geometry/support/plane.js";import"../../../geometry/support/ray.js";import"../../../chunks/sphere.js";import"../../../geometry/support/webMercatorUtils.js";import"../state/Frustum.js";import"../state/NearFarHeuristic.js";import"../state/utils/viewUtils.js";import"./cameraUtilsInternal.js";import"./earthUtils.js";import"./mathUtils.js";export{d as directionToHeadingTilt,e as eyeForCenterWithHeadingTilt,a as eyeTiltToLookAtTilt,h as headingTiltToDirectionUp,l as lookAtTiltToEyeTilt,b as toArea,t as toExtent}from"../../../chunks/cameraUtilsSpherical.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const t=4096,s=16,e=1023,i=e+1,n=t*s/i,r=4,o=i*r,h=e*r;class a{constructor(t=n){this._pageCount=t;const s=Math.ceil(t/32);this._bitset=new Uint32Array(s)}get pageCount(){return this._pageCount}isAllocated(t){const s=t/32|0,e=t%32;return!!(this._bitset[s]&1<<e)}allocate(t){const s=t/32|0,e=t%32;this._bitset[s]|=1<<e}free(t){const s=t/32|0,e=t%32;this._bitset[s]&=~(1<<e)}findFirstFreePage(){for(let t=0;t<this._bitset.length;t++)if(4294967295!==this._bitset[t])for(let s=0;s<32;s++){const e=32*t+s;if(e>=this._pageCount)break;if(!(this._bitset[t]&1<<s))return e}return null}resize(t){this._pageCount=t;const s=Math.ceil(t/32),e=this._bitset.length;if(s!==e){const t=new Uint32Array(s),i=Math.min(e,s);t.set(this._bitset.subarray(0,i)),this._bitset=t}this._clearExcessBits(this._bitset,t)}_clearExcessBits(t,s){const e=Math.floor((s-1)/32),i=(s-1)%32;if(s>0&&i<31){const s=(1<<i+1)-1;t[e]&=s}e+1<t.length&&t.fill(0,e+1)}}export{a as
|
|
5
|
+
const t=4096,s=16,e=1023,i=e+1,n=t*s/i,r=4,o=i*r,h=e*r;class a{constructor(t=n){this._pageCount=t;const s=Math.ceil(t/32);this._bitset=new Uint32Array(s)}get pageCount(){return this._pageCount}isAllocated(t){const s=t/32|0,e=t%32;return!!(this._bitset[s]&1<<e)}allocate(t){const s=t/32|0,e=t%32;this._bitset[s]|=1<<e}free(t){const s=t/32|0,e=t%32;this._bitset[s]&=~(1<<e)}findFirstFreePage(){for(let t=0;t<this._bitset.length;t++)if(4294967295!==this._bitset[t])for(let s=0;s<32;s++){const e=32*t+s;if(e>=this._pageCount)break;if(!(this._bitset[t]&1<<s))return e}return null}resize(t){this._pageCount=t;const s=Math.ceil(t/32),e=this._bitset.length;if(s!==e){const t=new Uint32Array(s),i=Math.min(e,s);t.set(this._bitset.subarray(0,i)),this._bitset=t}this._clearExcessBits(this._bitset,t)}_clearExcessBits(t,s){const e=Math.floor((s-1)/32),i=(s-1)%32;if(s>0&&i<31){const s=(1<<i+1)-1;t[e]&=s}e+1<t.length&&t.fill(0,e+1)}}export{a as GaussianSplatAtlasPages,i as elementsPerSplatPage,e as gaussiansPerSplatPage,s as initialSplatAtlasTextureHeight,n as initialSplatAtlasTexturePages,r as packedGaussianSizeInU32,t as splatAtlasTextureWidth,o as splatPageSizeInU32,h as splatPageSizeInU32WithoutHeader};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{makeScheduleFunction as s}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as r}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatOrderTexture as t}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as i}from"./GaussianSplatTextureAtlas.js";class a{constructor(e){this.visibleGaussians=0,this._visibleGaussianTiles=new Array,this._workerHandle=null,this._isSorting=!1,this._pendingSortTask=!1,this._bufferCapacity=0,this._renderer=e,this._orderTexture=new t(this._renderer.renderingContext),this._textureAtlas=new i(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:a}=this._renderer.view;this._workerHandle=new r(s(a))}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get visibleGaussianTiles(){return this._visibleGaussianTiles}updateGaussianVisibility(e){this._visibleGaussianTiles=e,this.requestSort()}requestSort(){this._isSorting?this._pendingSortTask=!0:(this._isSorting=!0,this._pendingSortTask=!1,this._sortOnWorker().then(()=>{this._isSorting=!1,this._pendingSortTask&&this.requestSort()}).catch(()=>{this._isSorting=!1,this._pendingSortTask&&this.requestSort()}))}destroy(){this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy()}_clearBuffersAndTextures(){this._bufferCapacity=0,this._orderTexture.clear(),this._textureAtlas.clear()}_ensureBufferCapacity(s){if(this._bufferCapacity<s){const r=Math.ceil(s*e);this._atlasIndicesBuffer=new Uint32Array(r),this._sortedAtlasIndicesBuffer=new Uint32Array(r),this._bufferCapacity=r}}async _sortOnWorker(){let e=0;if(this._visibleGaussianTiles.forEach(s=>e+=s.gaussianAtlasIndices.length),0===e||e>a.maxAllowedVisibleGaussians)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);this._ensureBufferCapacity(e),this._textureAtlas.ensureTextureAtlas();const s=this._renderer.camera.ray.direction,r=s[0],t=s[1],i=s[2],n=1/Math.sqrt(r*r+t*t+i*i),o=r*n,l=t*n,u=i*n,h=this._atlasIndicesBuffer.subarray(0,e),d=new Float64Array(e);let _=0;this._visibleGaussianTiles.forEach(e=>{const s=e.gaussianAtlasIndices,r=e.positions;for(let t=0;t<s.length;t++){h[_]=s[t];const e=3*t,i=r[e],a=r[e+1],n=r[e+2];d[_]=i*o+a*l+n*u,_++}});const c=new Uint32Array(e);for(let a=0;a<e;a++)c[a]=a;const f={distances:d,sortOrderIndices:c};await(this._workerHandle?.sort(f).then(s=>{const r=this._sortedAtlasIndicesBuffer.subarray(0,e);for(let t=0;t<e;t++)r[t]=h[s.sortedOrderIndices[t]];this._orderTexture.setData(r,e),this.visibleGaussians=e,this._renderer.requestRender(1)}))}static{this.maxAllowedVisibleGaussians=4194304}}export{a as GaussianSplatDataStore};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import{Texture as r}from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import{PixelType as s,SizedPixelFormat as i}from"../../../webgl/enums.js";import"../../../webgl/checkWebGLError.js";import{TextureDescriptor as o}from"../../../webgl/TextureDescriptor.js";class a{constructor(e){this.texture=null,this._orderTextureCapacity=0,this._rctx=e}ensureCapacity(t){if(this._orderTextureCapacity<t){this.texture?.dispose();const a=Math.ceil(t*e),c=this._evalTextureSize(a),u=c[0]*c[1];this._orderBuffer=new Uint32Array(u);const h=new o;h.height=c[0],h.width=c[1],h.pixelFormat=36244,h.dataType=s.UNSIGNED_INT,h.internalFormat=i.R32UI,h.wrapMode=33071,h.samplingMode=9728,this.texture=new r(this._rctx,h),this._orderTextureCapacity=u}}setData(e,t){this.ensureCapacity(t),this._orderBuffer?.set(e),this.texture?.setData(this._orderBuffer)}clear(){this._orderTextureCapacity=0,this.texture?.dispose(),this.texture=null}destroy(){this.texture?.dispose()}_evalTextureSize(e){const r=Math.ceil(Math.sqrt(e)),s=Math.ceil(e/r);return t(r,s)}}export{a as GaussianSplatOrderTexture};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import"../../../webgl/BufferObject.js";import{FramebufferObject as e}from"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import{Texture as r}from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import{PixelType as s,SizedPixelFormat as a}from"../../../webgl/enums.js";import"../../../webgl/checkWebGLError.js";import{initialSplatAtlasTextureHeight as i,GaussianSplatAtlasPages as o,splatAtlasTextureWidth as l,elementsPerSplatPage as h}from"./GaussianSplatAtlasPages.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class p{constructor(t,e,r){this._splatAtlasTextureHeight=i,this.texture=null,this._rctx=t,this._fboCache=r,this.pageAllocator=new o,this._cache=e.newCache("gaussian texture cache",t=>t.dispose())}ensureTextureAtlas(){if(this.texture)return;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new u;e.height=this._splatAtlasTextureHeight,e.width=l,e.pixelFormat=36249,e.dataType=s.UNSIGNED_INT,e.internalFormat=a.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,this.texture=new r(this._rctx,e),this._updatePageAllocator()}growTextureAtlas(){if(!this.texture)return void this.ensureTextureAtlas();const r=Math.floor(this._splatAtlasTextureHeight*t),s=new e(this._rctx,this.texture),a=this._fboCache.acquire(l,r,"gaussian splat atlas resize",11);this._rctx.blitFramebuffer(s,a.fbo,16384,9728,0,0,l,this._splatAtlasTextureHeight,0,0,l,this._splatAtlasTextureHeight),this.texture?.dispose(),this.texture=a.fbo?.detachColorTexture(),a.dispose(),this._splatAtlasTextureHeight=r,this._updatePageAllocator()}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&(this.growTextureAtlas(),t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,r){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,h,1,r)}_updatePageAllocator(){const t=l*this._splatAtlasTextureHeight/h;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this.texture?.dispose()}}export{p as GaussianSplatTextureAtlas};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{estimateNumberArrayMemory as s}from"../../../../core/memoryEstimations.js";import{splatPageSizeInU32 as i}from"./GaussianSplatAtlasPages.js";class t{constructor(t,a,e,o,h,r,l){this.handle=t,this.obb=a,this.gaussianAtlasIndices=e,this.pageIds=o,this.positions=h,this.squaredScales=r,this.maxScale=l,this.isVisible=!1,this.usedMemory=s(this.gaussianAtlasIndices,this.positions,this.squaredScales)+this.pageIds.length*i*4}}export{t as GaussianTile};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{Cyclical as r,cyclicalPI as s}from"../../../core/Cyclical.js";import"../../../core/has.js";import{clamp as i,deg2rad as a}from"../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as o,sync as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{subtract as d}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{f as u,d as p,c as m,j as y}from"../../../chunks/vec32.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as _,c as f,h as v}from"../../../chunks/vec42.js";import{fromValues as x,create as S}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as R}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as w}from"../../../geometry/projection/projectVectorToVector.js";import{create as O,width as P,center as T,height as D,copy as M,intersection as b,contains as j,intersects as I,offset as C}from"../../../geometry/support/aaBoundingRect.js";import{create as E,wrap as U}from"../../../geometry/support/ray.js";import{l as A,b as q,t as V}from"../../../chunks/sphere.js";import{angleAroundAxis as F}from"../../../geometry/support/vector.js";import{y2lat as G}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as H}from"../state/utils/viewUtils.js";import{debugFlags as L}from"../support/debugFlags.js";import{DebugPoint as z}from"../support/debugUtils.js";import{OverlayRenderer as k}from"./OverlayRenderer.js";import{Intersector as B}from"../webgl-engine/lib/Intersector.js";import{fromValues as W}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as Y}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as N,ensureTextureSize as X}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as Z}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as J,noBudget as K}from"../../support/Scheduler.js";import{Yield as Q}from"../../support/Yield.js";const $=1.3,ee=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let te,re=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0}initialize(){const e=this.view;this.renderer=new k({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=new B(this.view.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([o(()=>this.renderer.hasHighlights,t),this.renderer.events.on("has-water",()=>e.stage?.renderer.updateHasFlags()),this.renderer.events.on("content-changed",t),o(()=>e.state.camera.pixelRatio,t),o(()=>e.state.alignPixelEnabled,t),this.renderer.events.on("textures-disposed",()=>this.terrainSurface.requestRender()),o(()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),o(()=>[e.state?.pixelRatio,e.state?.contentPixelRatio],()=>this.setPlacementDirty(),l),this.terrainSurface.on("elevation-change",()=>this.setPlacementDirty()),e.on("resize",()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(J.OVERLAY,this)]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null,n(this.renderer)),te&&(te.hide(),te=null),this.renderer=null}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=e.isWebMercator?new r(-20037508.342787,20037508.342787):new r(-180,180))):this.renderer.disposeOverlays()}get readyToRun(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||L.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&(this.terrainSurface.ready||!this.terrainSurface.enabled)}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?R(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return $/this.view.resolutionScale}get _longitudeCyclical(){return this.renderer.longitudeCyclical}get suspended(){return this.terrainSurface.enabled&&this.terrainSurface.suspended}get updating(){return this.readyToRun||!!this.renderer?.updating||this._contentUpdated}render(){return this._contentUpdated=!1,this.renderer.processSyncDrapeSources(),this.renderer.precompileShaders(this.view.state)?this._drawOverlays():null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("readyToRun")}registerGeometryDrapeSource(e){const t=new Y({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("readyToRun"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this.updateOverlays(e,this.view.state.contentCamera,1)}updateOverlays(e,t,r){if(!this._spatialReference)return Q;const s=this._computeOverlayHeight(t);this._computeOverlayExtents(t,s,oe),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,oe.stretch);const i=this._updateOverlay(0,oe.inner,s,1*oe.pixelRatioAdjustment,oe.mapUnitsPerPixel),a=P(oe.inner)/P(oe.outer),n=this._updateOverlay(1,oe.outer,s,a*oe.pixelRatioAdjustment,oe.mapUnitsPerPixel);1!==i&&1!==n||(this._drapeSources.forEach(e=>this._updateDrapeSourceExtent(e)),this.updateOverlayParameters(r)),0===i&&0===n||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayHeight(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,s=e.fullHeight/e.pixelRatio*t,i=Math.ceil(1.5*Math.max(r,s)),{maxPreferredTexturePixels:a,maxTextureSize:n}=this.view.stage.renderView.renderingContext.parameters,o=.5*n;return N(X({width:i,height:i},{maxPreferredTexturePixels:2*a,maxTextureSize:o})[1],o)}_updateOverlay(e,t,r,s,i){if(0===this.renderer.overlays.length)return 0;const a=this.renderer.overlays[e],n=a.mapUnitsPerPixel;if(a.mapUnitsPerPixel=i,a.pixelRatio=s,se(t,a.extent)&&r===a.resolution)return n===i?0:2;a.setExtent(t),a.resolution=r;const o=T(a.extent);return a.renderLocalOrigin=W(o[0],o[1],0,"OV_"+this._latestOriginId++),1}updateOverlayParameters(e){this.terrainSurface.allTiles.forAll(e=>this.updateTileOverlayParameters(e)),this.terrainSurface.requestRender(e)}updateTileOverlayParameters(e){if(!e.renderData)return;const t=e.renderData.overlay;if(0===this.renderer.overlays.length)this._clearTileOverlayData(0,t),this._clearTileOverlayData(1,t);else{const[r,s]=this.renderer.overlays,i=e.extent;this._rectInsideRect(r.extent,i)||this._rectanglesOverlap(i,r.extent)||this._rectanglesOverlap(i,s.extent)?(this._setTileOverlayData(i,0,t),this._setTileOverlayData(i,1,t)):(this._clearTileOverlayData(0,t),this._clearTileOverlayData(1,t))}}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[0],s=this.renderer.overlays[1],i=this._pointIsInExtent(e,r.extent)?r:s;return(i.extent[2]-i.extent[0])/i.resolution}_setTileOverlayData(e,t,r){if(0===this.renderer.overlays.length)return;const s=this.renderer.overlays[t].extent,i=P(s),a=D(s);let n=e[0];if(this._longitudeCyclical){n=this._longitudeCyclical.minimalMonotonic(s[0],n);const t=this._longitudeCyclical.minimalMonotonic(s[0],e[2]);n>t&&(n=t-(e[2]-e[0]))}r.setScale(t,P(e)/i,D(e)/a),r.setOffset(t,(n-s[0])/i,(e[1]-s[1])/a)}_clearTileOverlayData(e,t){t.setScale(e,-1,-1),t.setOffset(e,-1,-1)}reloadShaders(){Z(),this.requestRender(),this.runTask(K)}requestRender(e=1){this.renderer.hasOverlays?(1===e?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,s,i){const a=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,ce,t,r);if(null==a)return!1;const n=a.origin,o=u(ne,a.origin,a.direction);this._groundIntersector.reset(n,o,e),this._groundIntersector.intersect([]),this.view.basemapTerrain.intersect(this._groundIntersector,null,n,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(i)&&l.withinDistance(s)}_findHorizonBasedPointOfInterest(e,t){let r=.5;const a=.55,n=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=i(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:n+l,e.aboveGround?n-l:1/0),c=e.aboveGround;if("global"===this.view.viewingMode){const t=ne;A(q(V,R(this.view.spatialReference).radius+h),U(e.eye,e.viewForward),t),p(t,t,e.eye);const i=s.normalize(F(e.viewForward,t,e.viewRight))/e.fovY+.5,n=i<=0||i>=1?.5:a;r=c?n*i:i+n*(1-i)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),s=Math.tan(t),n=x(0,s,1,0),o=_(n,n,e.projectionMatrix)[1],l=i(.5+.5*o,0,1);r=1===l||0===l?.5:c?l*a:1-(1-l)*a}return this._intersectGroundFromView(e,.5,r,o.distance,t)}_computeOverlayExtents(e,t,r){const s=this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,i=g();this._findHorizonBasedPointOfInterest(e,i)||m(i,s),L.OVERLAY_SHOW_CENTER?(null==te&&(te=new z(this.view.graphics,"red")),te.show(i,this._renderSR)):null!=te&&te.hide();const n=Math.max(.1,y(e.eye,i)),o=H(this.view.renderCoordsHelper,s,e.eye);this._overlaySREqualsRenderSR||w(i,this._renderSR,i,this._spatialReference);const l=this.terrainSurface.extent,h=!this._isSpherical&&this._spatialReference?.isGeographic,c=h&&this._spatialReference?1/R(this._spatialReference).metersPerDegree:1,u=this.view.state.contentPixelRatio,p=e.perScreenPixelRatio/u*n*c;r.mapUnitsPerPixel=p/this.worldToPCSRatio,r.stretch=this._overlayStretch;let _=t*p/2*r.stretch,x=!1,S=h?90:1/0;this._isSpherical&&l&&this._spatialReference&&(this._spatialReference.isWebMercator?(_/=Math.cos(G(i[1])),S=l[3]):(x=!0,_/=R(this._spatialReference).metersPerDegree,S=90),_>=S&&(_=S,i[1]=0,this._spatialReference.isWebMercator&&(i[0]=0)));let O=1;x&&(O=1/Math.max(.2,Math.cos(Math.abs(a(i[1])))),_*O>180&&(O=180/_),r.mapUnitsPerPixel*=O);const T=Math.log(2)/12;_=Math.exp(Math.round(Math.log(_)/T)*T);const D=_*O,I=32,C=.5*t/(I*D),E=.5*t/(I*_);i[0]=Math.round(i[0]*C)/C,i[1]=Math.round(i[1]*E)/E;const U=r.inner;U[0]=i[0]-D,U[1]=i[1]-_,U[2]=i[0]+D,U[3]=i[1]+_,this._isSpherical&&this._shiftExtentToFitBounds(U,1/0,S);const A=r.outer;if(6*D>P(l))M(A,l);else{if(Math.PI/2-Math.abs(o-Math.PI/2)<=.25*Math.PI)A[0]=U[0]-D,A[1]=U[1]-_,A[2]=U[2]+D,A[3]=U[3]+_;else{w(e.eye,this._renderSR,ne,this._spatialReference),d(ae,i,ne);let t=-Math.atan2(ae[1],ae[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));f(ae,ee[r],2*_),ae[0]*=O,ae[2]*=O,v(A,U,ae)}}if(this._isSpherical)A[0]=this._longitudeCyclical.clamp(A[0]),A[2]=this._longitudeCyclical.clamp(A[2]),A[1]=Math.max(A[1],-S),A[3]=Math.min(A[3],S);else{const e=b(U,l,le),t=b(A,l,he);j(e,t)&&(A[2]=A[0],A[3]=A[1])}const q=Math.abs(U[2]-U[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,q),r.pixelRatioAdjustment=r.mapUnitsPerPixel/q}_drawOverlays(e=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const t=!this._drawTexturesDirty&&this._drawTexturesAnimateDirty?0:1;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const r=this.renderer.computeValidity();this.renderer.releaseRenderTargets(t),this.renderer.drawOverlays(e,t);return r!==this.renderer.computeValidity()&&this.updateOverlayParameters(1),this.terrainSurface.requestRender(t),1===t&&this.terrainSurface.requestUpdate(),this.renderer}_rectanglesOverlap(e,t){return null!=e&&(this._longitudeCyclical?(this._longitudeCyclical.contains(t[0],t[2],e[0])||this._longitudeCyclical.contains(t[0],t[2],e[2])||this._longitudeCyclical.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):I(e,t))}_rectInsideRect(e,t){return null!=t&&(this._longitudeCyclical?this._longitudeCyclical.contains(e[0],e[2],t[0])&&this._longitudeCyclical.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:j(e,t))}_pointIsInExtent(e,t){if(this._longitudeCyclical)return this._longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,s=e.y;return r>t[0]&&r<t[2]&&s>t[1]&&s<t[3]}_shiftExtentToFitBounds(e,t,r){let s=0,i=0;e[0]<-t?s=e[0]+t:e[2]>t&&(s=t-e[2]),e[1]<-r?i=e[1]+r:e[3]>r&&(i=r-e[3]),C(e,s,i)}get test(){}};function se(e,t){const r=1e-5,s=L.TESTS_DISABLE_OPTIMIZATIONS?0:r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]);return Math.abs(t[0]-e[0])<=s&&Math.abs(t[1]-e[1])<=s&&Math.abs(t[2]-e[2])<=s&&Math.abs(t[3]-e[3])<=s}e([h()],re.prototype,"_spatialReference",void 0),e([h({readOnly:!0})],re.prototype,"readyToRun",null),e([h()],re.prototype,"_placementDirty",void 0),e([h()],re.prototype,"_contentUpdated",void 0),e([h()],re.prototype,"_isSpherical",null),e([h()],re.prototype,"worldToPCSRatio",null),e([h()],re.prototype,"renderer",void 0),e([h({constructOnly:!0})],re.prototype,"view",void 0),e([h({constructOnly:!0})],re.prototype,"terrainSurface",void 0),e([h()],re.prototype,"suspended",null),e([h()],re.prototype,"updating",null),re=e([c("esri.views.3d.terrain.OverlayManager")],re);class ie{constructor(){this.inner=O(),this.outer=O(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=$}}const ae=S(),ne=g(),oe=new ie,le=O(),he=O(),ce=E();export{re as OverlayManager};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{cyclicalPI as r}from"../../../core/Cyclical.js";import"../../../core/has.js";import{clamp as s,deg2rad as i}from"../../../core/mathUtils.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{watch as n,sync as o}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{subtract as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{f as d,d as u,c as p,j as m}from"../../../chunks/vec32.js";import{create as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as g,c as _,h as f}from"../../../chunks/vec42.js";import{fromValues as v,create as x}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as S}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as R}from"../../../geometry/projection/projectVectorToVector.js";import{create as w,width as O,center as P,height as T,copy as D,intersection as M,contains as j,intersects as b,offset as I}from"../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as C}from"../../../geometry/support/normalizeUtils.js";import{create as U,wrap as E}from"../../../geometry/support/ray.js";import{l as A,b as q,t as V}from"../../../chunks/sphere.js";import{angleAroundAxis as F}from"../../../geometry/support/vector.js";import{y2lat as G}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as H}from"../state/utils/viewUtils.js";import{debugFlags as z}from"../support/debugFlags.js";import{DebugPoint as L}from"../support/debugUtils.js";import{OverlayRenderer as k}from"./OverlayRenderer.js";import{Intersector as B}from"../webgl-engine/lib/Intersector.js";import{fromValues as W}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as Y}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as N,ensureTextureSize as X}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as Z}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as J,noBudget as K}from"../../support/Scheduler.js";import{Yield as Q}from"../../support/Yield.js";const $=1.3,ee=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let te,re=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0}initialize(){const e=this.view;this.renderer=new k({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=new B(this.view.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([n(()=>this.renderer.hasHighlights,t),this.renderer.events.on("has-water",()=>e.stage?.renderer.updateHasFlags()),this.renderer.events.on("content-changed",t),n(()=>e.state.camera.pixelRatio,t),n(()=>e.state.alignPixelEnabled,t),this.renderer.events.on("textures-disposed",()=>this.terrainSurface.requestRender()),n(()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),n(()=>[e.state?.pixelRatio,e.state?.contentPixelRatio],()=>this.setPlacementDirty(),o),this.terrainSurface.on("elevation-change",()=>this.setPlacementDirty()),e.on("resize",()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(J.OVERLAY,this)]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null,a(this.renderer)),te&&(te.hide(),te=null),this.renderer=null}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=C(e))):this.renderer.disposeOverlays()}get readyToRun(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||z.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&(this.terrainSurface.ready||!this.terrainSurface.enabled)}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?S(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return $/this.view.resolutionScale}get _longitudeCyclical(){return this.renderer.longitudeCyclical}get suspended(){return this.terrainSurface.enabled&&this.terrainSurface.suspended}get updating(){return this.readyToRun||!!this.renderer?.updating||this._contentUpdated}render(){return this._contentUpdated=!1,this.renderer.processSyncDrapeSources(),this.renderer.precompileShaders(this.view.state)?this._drawOverlays():null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("readyToRun")}registerGeometryDrapeSource(e){const t=new Y({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("readyToRun"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this.updateOverlays(e,this.view.state.contentCamera,1)}updateOverlays(e,t,r){if(!this._spatialReference)return Q;const s=this._computeOverlayHeight(t);this._computeOverlayExtents(t,s,oe),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,oe.stretch);const i=this._updateOverlay(0,oe.inner,s,1*oe.pixelRatioAdjustment,oe.mapUnitsPerPixel),a=O(oe.inner)/O(oe.outer),n=this._updateOverlay(1,oe.outer,s,a*oe.pixelRatioAdjustment,oe.mapUnitsPerPixel);1!==i&&1!==n||(this._drapeSources.forEach(e=>this._updateDrapeSourceExtent(e)),this.updateOverlayParameters(r)),0===i&&0===n||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayHeight(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,s=e.fullHeight/e.pixelRatio*t,i=Math.ceil(1.5*Math.max(r,s)),{maxPreferredTexturePixels:a,maxTextureSize:n}=this.view.stage.renderView.renderingContext.parameters,o=.5*n;return N(X({width:i,height:i},{maxPreferredTexturePixels:2*a,maxTextureSize:o})[1],o)}_updateOverlay(e,t,r,s,i){if(0===this.renderer.overlays.length)return 0;const a=this.renderer.overlays[e],n=a.mapUnitsPerPixel;if(a.mapUnitsPerPixel=i,a.pixelRatio=s,se(t,a.extent)&&r===a.resolution)return n===i?0:2;a.setExtent(t),a.resolution=r;const o=P(a.extent);return a.renderLocalOrigin=W(o[0],o[1],0,"OV_"+this._latestOriginId++),1}updateOverlayParameters(e){this.terrainSurface.allTiles.forAll(e=>this.updateTileOverlayParameters(e)),this.terrainSurface.requestRender(e)}updateTileOverlayParameters(e){if(!e.renderData)return;const t=e.renderData.overlay;if(0===this.renderer.overlays.length)this._clearTileOverlayData(0,t),this._clearTileOverlayData(1,t);else{const[r,s]=this.renderer.overlays,i=e.extent;this._rectInsideRect(r.extent,i)||this._rectanglesOverlap(i,r.extent)||this._rectanglesOverlap(i,s.extent)?(this._setTileOverlayData(i,0,t),this._setTileOverlayData(i,1,t)):(this._clearTileOverlayData(0,t),this._clearTileOverlayData(1,t))}}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[0],s=this.renderer.overlays[1],i=this._pointIsInExtent(e,r.extent)?r:s;return(i.extent[2]-i.extent[0])/i.resolution}_setTileOverlayData(e,t,r){if(0===this.renderer.overlays.length)return;const s=this.renderer.overlays[t].extent,i=O(s),a=T(s);let n=e[0];if(this._longitudeCyclical){n=this._longitudeCyclical.minimalMonotonic(s[0],n);const t=this._longitudeCyclical.minimalMonotonic(s[0],e[2]);n>t&&(n=t-(e[2]-e[0]))}r.setScale(t,O(e)/i,T(e)/a),r.setOffset(t,(n-s[0])/i,(e[1]-s[1])/a)}_clearTileOverlayData(e,t){t.setScale(e,-1,-1),t.setOffset(e,-1,-1)}reloadShaders(){Z(),this.requestRender(),this.runTask(K)}requestRender(e=1){this.renderer.hasOverlays?(1===e?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,s,i){const a=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,ce,t,r);if(null==a)return!1;const n=a.origin,o=d(ne,a.origin,a.direction);this._groundIntersector.reset(n,o,e),this._groundIntersector.intersect([]),this.view.basemapTerrain.intersect(this._groundIntersector,null,n,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(i)&&l.withinDistance(s)}_findHorizonBasedPointOfInterest(e,t){let i=.5;const a=.55,n=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=s(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:n+l,e.aboveGround?n-l:1/0),c=e.aboveGround;if("global"===this.view.viewingMode){const t=ne;A(q(V,S(this.view.spatialReference).radius+h),E(e.eye,e.viewForward),t),u(t,t,e.eye);const s=r.normalize(F(e.viewForward,t,e.viewRight))/e.fovY+.5,n=s<=0||s>=1?.5:a;i=c?n*s:s+n*(1-s)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),r=Math.tan(t),n=v(0,r,1,0),o=g(n,n,e.projectionMatrix)[1],l=s(.5+.5*o,0,1);i=1===l||0===l?.5:c?l*a:1-(1-l)*a}return this._intersectGroundFromView(e,.5,i,o.distance,t)}_computeOverlayExtents(e,t,r){const s=this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,a=y();this._findHorizonBasedPointOfInterest(e,a)||p(a,s),z.OVERLAY_SHOW_CENTER?(null==te&&(te=new L(this.view.graphics,"red")),te.show(a,this._renderSR)):null!=te&&te.hide();const n=Math.max(.1,m(e.eye,a)),o=H(this.view.renderCoordsHelper,s,e.eye);this._overlaySREqualsRenderSR||R(a,this._renderSR,a,this._spatialReference);const l=this.terrainSurface.extent,h=!this._isSpherical&&this._spatialReference?.isGeographic,d=h&&this._spatialReference?1/S(this._spatialReference).metersPerDegree:1,u=this.view.state.contentPixelRatio,g=e.perScreenPixelRatio/u*n*d;r.mapUnitsPerPixel=g/this.worldToPCSRatio,r.stretch=this._overlayStretch;let v=t*g/2*r.stretch,x=!1,w=h?90:1/0;this._isSpherical&&l&&this._spatialReference&&(this._spatialReference.isWebMercator?(v/=Math.cos(G(a[1])),w=l[3]):(x=!0,v/=S(this._spatialReference).metersPerDegree,w=90),v>=w&&(v=w,a[1]=0,this._spatialReference.isWebMercator&&(a[0]=0)));let P=1;x&&(P=1/Math.max(.2,Math.cos(Math.abs(i(a[1])))),v*P>180&&(P=180/v),r.mapUnitsPerPixel*=P);const T=Math.log(2)/12;v=Math.exp(Math.round(Math.log(v)/T)*T);const b=v*P,I=32,C=.5*t/(I*b),U=.5*t/(I*v);a[0]=Math.round(a[0]*C)/C,a[1]=Math.round(a[1]*U)/U;const E=r.inner;E[0]=a[0]-b,E[1]=a[1]-v,E[2]=a[0]+b,E[3]=a[1]+v,this._isSpherical&&this._shiftExtentToFitBounds(E,1/0,w);const A=r.outer;if(6*b>O(l))D(A,l);else{if(Math.PI/2-Math.abs(o-Math.PI/2)<=.25*Math.PI)A[0]=E[0]-b,A[1]=E[1]-v,A[2]=E[2]+b,A[3]=E[3]+v;else{R(e.eye,this._renderSR,ne,this._spatialReference),c(ae,a,ne);let t=-Math.atan2(ae[1],ae[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));_(ae,ee[r],2*v),ae[0]*=P,ae[2]*=P,f(A,E,ae)}}if(this._isSpherical)A[0]=this._longitudeCyclical.clamp(A[0]),A[2]=this._longitudeCyclical.clamp(A[2]),A[1]=Math.max(A[1],-w),A[3]=Math.min(A[3],w);else{const e=M(E,l,le),t=M(A,l,he);j(e,t)&&(A[2]=A[0],A[3]=A[1])}const q=Math.abs(E[2]-E[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,q),r.pixelRatioAdjustment=r.mapUnitsPerPixel/q}_drawOverlays(e=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const t=!this._drawTexturesDirty&&this._drawTexturesAnimateDirty?0:1;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const r=this.renderer.computeValidity();this.renderer.releaseRenderTargets(t),this.renderer.drawOverlays(e,t);return r!==this.renderer.computeValidity()&&this.updateOverlayParameters(1),this.terrainSurface.requestRender(t),1===t&&this.terrainSurface.requestUpdate(),this.renderer}_rectanglesOverlap(e,t){return null!=e&&(this._longitudeCyclical?(this._longitudeCyclical.contains(t[0],t[2],e[0])||this._longitudeCyclical.contains(t[0],t[2],e[2])||this._longitudeCyclical.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):b(e,t))}_rectInsideRect(e,t){return null!=t&&(this._longitudeCyclical?this._longitudeCyclical.contains(e[0],e[2],t[0])&&this._longitudeCyclical.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:j(e,t))}_pointIsInExtent(e,t){if(this._longitudeCyclical)return this._longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,s=e.y;return r>t[0]&&r<t[2]&&s>t[1]&&s<t[3]}_shiftExtentToFitBounds(e,t,r){let s=0,i=0;e[0]<-t?s=e[0]+t:e[2]>t&&(s=t-e[2]),e[1]<-r?i=e[1]+r:e[3]>r&&(i=r-e[3]),I(e,s,i)}get test(){}};function se(e,t){const r=1e-5,s=z.TESTS_DISABLE_OPTIMIZATIONS?0:r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]);return Math.abs(t[0]-e[0])<=s&&Math.abs(t[1]-e[1])<=s&&Math.abs(t[2]-e[2])<=s&&Math.abs(t[3]-e[3])<=s}e([l()],re.prototype,"_spatialReference",void 0),e([l({readOnly:!0})],re.prototype,"readyToRun",null),e([l()],re.prototype,"_placementDirty",void 0),e([l()],re.prototype,"_contentUpdated",void 0),e([l()],re.prototype,"_isSpherical",null),e([l()],re.prototype,"worldToPCSRatio",null),e([l()],re.prototype,"renderer",void 0),e([l({constructOnly:!0})],re.prototype,"view",void 0),e([l({constructOnly:!0})],re.prototype,"terrainSurface",void 0),e([l()],re.prototype,"suspended",null),e([l()],re.prototype,"updating",null),re=e([h("esri.views.3d.terrain.OverlayManager")],re);class ie{constructor(){this.inner=w(),this.outer=w(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=$}}const ae=x(),ne=y(),oe=new ie,le=w(),he=w(),ce=U();export{re as OverlayManager};
|