@arcgis/core 6.0.0-next.33 → 6.0.0-next.34
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/README.md +2 -2
- package/applications/Urban/meshUtils.d.ts +1 -0
- package/applications/Urban/meshUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{f3dc0bc0e00635855a7a.js → 03daf6f235c6edef6268.js} +1 -1
- package/assets/esri/core/workers/chunks/04a1d08c3b5b1dc7628f.js +1 -0
- package/assets/esri/core/workers/chunks/{1eaf8bfdd3765a90ccc2.js → 0523f893870a1546d7d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{72d20d3957d612f86431.js → 0a508e25ec05363e1f04.js} +1 -1
- package/assets/esri/core/workers/chunks/{84038dd85005fea413eb.js → 139e753d95cfc9470e74.js} +1 -1
- package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +1 -0
- package/assets/esri/core/workers/chunks/{418addce122dbb8897b4.js → 1a614bac5db42c6263f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{58c3ae6030def2ed5f31.js → 1b17f5f720f6cf3f6d73.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9dc38761b314d33890f.js → 1f51567f47c2e2fc8a23.js} +1 -1
- package/assets/esri/core/workers/chunks/2211ff0a1f1ae8100231.js +1 -0
- package/assets/esri/core/workers/chunks/24ada9511b074dc5ae27.js +1 -0
- package/assets/esri/core/workers/chunks/29c610ce1c81ebb84a6b.js +1 -0
- package/assets/esri/core/workers/chunks/2b4dd42920d37b1ff0a9.js +2 -0
- package/assets/esri/core/workers/chunks/2c8ca43563c4f3e94535.js +1 -0
- package/assets/esri/core/workers/chunks/{55a9eaeb152a3abada67.js → 311e4969f19df63451dd.js} +1 -1
- package/assets/esri/core/workers/chunks/{8da2a10318f49d0dc73a.js → 31ef7b7074b3e3829763.js} +1 -1
- package/assets/esri/core/workers/chunks/{360c944c610efa2051fc.js → 379db67f78161ebd5468.js} +2 -2
- package/assets/esri/core/workers/chunks/{b8fd7c3b36981261378b.js → 38df7b1d58c4bcf693d0.js} +1 -1
- package/assets/esri/core/workers/chunks/{be55771758e4bcef0976.js → 3e406043a374ee17475b.js} +1 -1
- package/assets/esri/core/workers/chunks/46c290108a90518ef695.js +1 -0
- package/assets/esri/core/workers/chunks/{a596779eaeec7310671d.js → 478a89317a12e9b4d146.js} +1 -1
- package/assets/esri/core/workers/chunks/{fcc3902d6d9eda6f09f5.js → 48b8b57f559a53c6c513.js} +1 -1
- package/assets/esri/core/workers/chunks/4f3e0d583cfa9d1d6727.js +2 -0
- package/assets/esri/core/workers/chunks/507ecc3692e6d0700958.js +1 -0
- package/assets/esri/core/workers/chunks/{bd46a04a9ee4ea9e6ef1.js → 5864bce1498a13ee5b7e.js} +2 -2
- package/assets/esri/core/workers/chunks/{f4d91d470ca5fea0bd26.js → 5bd1414220e42cb8ebcf.js} +1 -1
- package/assets/esri/core/workers/chunks/5c3aa8386705c5e40358.js +1 -0
- package/assets/esri/core/workers/chunks/{176d75e76318bfc25a53.js → 60c8eedd06080edab3e3.js} +1 -1
- package/assets/esri/core/workers/chunks/661847f1b7044f21600f.js +1 -0
- package/assets/esri/core/workers/chunks/{1a8d8274df292d65f82e.js → 676c8c0329d68f9f3ac4.js} +1 -1
- package/assets/esri/core/workers/chunks/{29cc6b1705418b1be5d7.js → 687deb918eb48a963c8f.js} +1 -1
- package/assets/esri/core/workers/chunks/{0694c7bcfe71692e2ccf.js → 723df53cfa0189837d01.js} +1 -1
- package/assets/esri/core/workers/chunks/7582654a0fc70910731c.js +1 -0
- package/assets/esri/core/workers/chunks/{1ee4df0fd61440cb5f02.js → 7810586c35dfe1437516.js} +1 -1
- package/assets/esri/core/workers/chunks/8517d96fc8ba7b21d845.js +2 -0
- package/assets/esri/core/workers/chunks/90360c0bd053d3e3fd77.js +1 -0
- package/assets/esri/core/workers/chunks/9c3de54513bf8619271c.js +1 -0
- package/assets/esri/core/workers/chunks/{0e445ec3523de9f2dfa2.js → a107f16cd004626b5018.js} +1 -1
- package/assets/esri/core/workers/chunks/{e3b212f8af448ec29eef.js → a1e8209d00809c9520a0.js} +1 -1
- package/assets/esri/core/workers/chunks/{46453ebfee17b5421d9d.js → bf62be00f3040f91aaee.js} +1 -1
- package/assets/esri/core/workers/chunks/{89dc49e784f7ba3b93ea.js → c034c30e577d620b8e28.js} +1 -1
- package/assets/esri/core/workers/chunks/c5bf19da62a3d31009fe.js +2 -0
- package/assets/esri/core/workers/chunks/{2226c20c38e20713bcb5.js.LICENSE.txt → c5bf19da62a3d31009fe.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{6bb191b19ce43a27f205.js → caad4f475d6eb01c2850.js} +1 -1
- package/assets/esri/core/workers/chunks/cd55cad81accf51d2989.js +1 -0
- package/assets/esri/core/workers/chunks/db1f7b2562de495b3401.js +2 -0
- package/assets/esri/core/workers/chunks/e0a37d3bcb9a944e53dd.js +1 -0
- package/assets/esri/core/workers/chunks/{fe6dcb21570395e46ce8.js → e0a7a75709121a26f255.js} +1 -1
- package/assets/esri/core/workers/chunks/{096b2bf1c0d69d27f20c.js → e8e54faf947a582b4cf7.js} +1 -1
- package/assets/esri/core/workers/chunks/{636e9c4ac1f9ae98f9d1.js → ea81f9d71b0842a4be26.js} +1 -1
- package/assets/esri/core/workers/chunks/{164c8eeefa8232b2b191.js → eaa0e906b46ae4c84d72.js} +2 -2
- package/assets/esri/core/workers/chunks/{a504a5e06cb89a620799.js → ec8b7476eac4718eb0ac.js} +1 -1
- package/chunks/GlobalIllumination.glsl.js +55 -46
- package/chunks/GlobalIlluminationBlur.glsl.js +13 -9
- package/chunks/RibbonLine.glsl.js +90 -88
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/workers.d.ts +1 -0
- package/geometry/support/MeshLocalVertexSpace.d.ts +3 -3
- package/geometry/support/aaBoundingRect.js +1 -1
- package/geometry/support/meshUtils/convertMeshVertexSpace.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/kernel.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/WFSLayer.d.ts +8 -4
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/mixins/ArcGISMapService.d.ts +17 -0
- package/layers/mixins/ArcGISMapService.js +1 -1
- package/layers/ogc/wfsUtils.d.ts +7 -2
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/ogc/xmlUtils.js +1 -1
- package/package.json +4 -4
- package/rest/route.d.ts +1 -1
- package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
- package/rest/support/LengthsParameters.d.ts +1 -1
- package/symbols/TextSymbol.d.ts +0 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/state/ScreenSizePerspective.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/RenderCoordsHelper.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/NavigationDepthCache.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RibbonLineVertexInfo.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +1 -1
- package/assets/esri/core/workers/chunks/0cc7fba402a93e6d2455.js +0 -2
- package/assets/esri/core/workers/chunks/131185d26343a997495e.js +0 -1
- package/assets/esri/core/workers/chunks/1a3f71c4d97c36050030.js +0 -1
- package/assets/esri/core/workers/chunks/2226c20c38e20713bcb5.js +0 -2
- package/assets/esri/core/workers/chunks/2981e904ab62f3ed80d0.js +0 -2
- package/assets/esri/core/workers/chunks/32cc59e126df8c96a0cf.js +0 -2
- package/assets/esri/core/workers/chunks/5bb6c255bdc8aa9ba23e.js +0 -1
- package/assets/esri/core/workers/chunks/654f5441227579d2b6b4.js +0 -1
- package/assets/esri/core/workers/chunks/7084dd6e10c6c1393e92.js +0 -1
- package/assets/esri/core/workers/chunks/7566321c6a2913f2852b.js +0 -1
- package/assets/esri/core/workers/chunks/7b5cd150a4d0139850be.js +0 -1
- package/assets/esri/core/workers/chunks/7cc9d7a88b64e25fce14.js +0 -1
- package/assets/esri/core/workers/chunks/844eedda8f749972f707.js +0 -2
- package/assets/esri/core/workers/chunks/87177e0f82e8a6ae3189.js +0 -1
- package/assets/esri/core/workers/chunks/9976eaa81085c0d17e14.js +0 -1
- package/assets/esri/core/workers/chunks/a2196a49f89d57a0a1c7.js +0 -1
- package/assets/esri/core/workers/chunks/aba259a70bee68d2edb7.js +0 -1
- package/assets/esri/core/workers/chunks/b9cb92858a576eb6aa06.js +0 -1
- package/assets/esri/core/workers/chunks/c33a9635c294c8774977.js +0 -1
- package/assets/esri/core/workers/chunks/f39c700f3db7db52b522.js +0 -1
- /package/assets/esri/core/workers/chunks/{844eedda8f749972f707.js.LICENSE.txt → 2b4dd42920d37b1ff0a9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{32cc59e126df8c96a0cf.js.LICENSE.txt → 4f3e0d583cfa9d1d6727.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{bd46a04a9ee4ea9e6ef1.js.LICENSE.txt → 5864bce1498a13ee5b7e.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{0cc7fba402a93e6d2455.js.LICENSE.txt → 8517d96fc8ba7b21d845.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2981e904ab62f3ed80d0.js.LICENSE.txt → db1f7b2562de495b3401.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{164c8eeefa8232b2b191.js.LICENSE.txt → eaa0e906b46ae4c84d72.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import{EventEmitter as t}from"../../../../core/Evented.js";import has from"../../../../core/has.js";import{disposeMaybe as n,removeMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,onAbort as a,createAbortError as o}from"../../../../core/promiseUtils.js";import{isUint8Array as s,isArrayBuffer as c,isTypedArray as l}from"../../../../core/typedArrayUtil.js";import{generateUID as u}from"../../../../core/uid.js";import{isBlobProtocol as d,isDataProtocol as f}from"../../../../core/urlUtils.js";import{whenVideoPlayable as p}from"../../../../layers/support/videoUtils.js";import{requestImage as m}from"../../../../request/image.js";import{loadImage as h}from"../../../../request/loadImage.js";import{createTextureKTX1 as g,createTextureKTX2 as _,createTextureBasis as v,estimateMemoryKTX2 as y,estimateMemoryBasis as b}from"./BasisUtil.js";import{createDDSTexture as x}from"./DDSUtil.js";import{ensureImageMaxSize as S}from"./textureUtils.js";import{assert as C}from"./Util.js";import w from"../../../webgl/Texture.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";import{isCompressedFormat as E,isSizedPixelFormat as D,isSizedDepthFormat as O,isSizedDepthStencilFormat as k}from"../../../webgl/textureUtils.js";import{getFormatComponents as A}from"../../../webgl/Util.js";const j=!!has(`esri-tests-disable-gpu-memory-measurements`);class M{constructor(e,n){this._data=e,this.id=u(),this.events=new t,this._parameters={...F,...n},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!d(e.src)&&(e.preload!==`auto`||!e.crossOrigin)&&(e.preload=`auto`,e.crossOrigin=`anonymous`,e.src=e.src,e.paused&&e.autoplay)){let t=[];p(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){f(e.src)||d(e.src)||e.crossOrigin||(e.crossOrigin=`anonymous`,e.src=e.src)}_createDescriptor(e){let t=new T;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t.isImmutable=this._parameters.immutable===!0&&I(this._parameters.internalFormat),t}get texture(){return this._texture??this._emptyTexture}get loaded(){return this._texture!=null}get usedMemory(){return j?0:this._texture?.usedMemory??N(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;let t=this._data;return t==null?(this._texture=new w(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),typeof t==`string`?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):s(t)&&this._parameters.encoding===`image/vnd-ms.dds`?this._loadFromDDSData(e,t):c(t)&&this._parameters.encoding===`image/vnd-ms.dds`?this._loadFromDDSData(e,new Uint8Array(t)):s(t)&&this._parameters.encoding===`image/ktx`?this._loadFromKTX1(e,t):c(t)&&this._parameters.encoding===`image/ktx`?this._loadFromKTX1(e,new Uint8Array(t)):(c(t)||s(t))&&this._parameters.encoding===`image/ktx2`?this._loadFromKTX2(e,t):(c(t)||s(t))&&this._parameters.encoding===`image/x.basis`?this._loadFromBasis(e,t):c(t)?this._loadFromPixelData(e,new Uint8Array(t)):l(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return this._texture==null||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this.
|
|
2
|
+
import e from"../../../../core/Error.js";import{EventEmitter as t}from"../../../../core/Evented.js";import has from"../../../../core/has.js";import{disposeMaybe as n,removeMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,onAbort as a,createAbortError as o}from"../../../../core/promiseUtils.js";import{isUint8Array as s,isArrayBuffer as c,isTypedArray as l}from"../../../../core/typedArrayUtil.js";import{generateUID as u}from"../../../../core/uid.js";import{isBlobProtocol as d,isDataProtocol as f}from"../../../../core/urlUtils.js";import{whenVideoPlayable as p}from"../../../../layers/support/videoUtils.js";import{requestImage as m}from"../../../../request/image.js";import{loadImage as h}from"../../../../request/loadImage.js";import{createTextureKTX1 as g,createTextureKTX2 as _,createTextureBasis as v,estimateMemoryKTX2 as y,estimateMemoryBasis as b}from"./BasisUtil.js";import{createDDSTexture as x}from"./DDSUtil.js";import{ensureImageMaxSize as S}from"./textureUtils.js";import{assert as C}from"./Util.js";import w from"../../../webgl/Texture.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";import{isCompressedFormat as E,isSizedPixelFormat as D,isSizedDepthFormat as O,isSizedDepthStencilFormat as k}from"../../../webgl/textureUtils.js";import{getFormatComponents as A}from"../../../webgl/Util.js";const j=!!has(`esri-tests-disable-gpu-memory-measurements`);class M{constructor(e,n){this._data=e,this.id=u(),this.events=new t,this._parameters={...F,...n},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!d(e.src)&&(e.preload!==`auto`||!e.crossOrigin)&&(e.preload=`auto`,e.crossOrigin=`anonymous`,e.src=e.src,e.paused&&e.autoplay)){let t=[];p(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){f(e.src)||d(e.src)||e.crossOrigin||(e.crossOrigin=`anonymous`,e.src=e.src)}_createDescriptor(e){let t=new T;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t.isImmutable=this._parameters.immutable===!0&&I(this._parameters.internalFormat),t}get texture(){return this._texture??this._emptyTexture}get loaded(){return this._texture!=null}get usedMemory(){return j?0:this._texture?.usedMemory??N(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;let t=this._data;return t==null?(this._texture=new w(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),typeof t==`string`?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):s(t)&&this._parameters.encoding===`image/vnd-ms.dds`?this._loadFromDDSData(e,t):c(t)&&this._parameters.encoding===`image/vnd-ms.dds`?this._loadFromDDSData(e,new Uint8Array(t)):s(t)&&this._parameters.encoding===`image/ktx`?this._loadFromKTX1(e,t):c(t)&&this._parameters.encoding===`image/ktx`?this._loadFromKTX1(e,new Uint8Array(t)):(c(t)||s(t))&&this._parameters.encoding===`image/ktx2`?this._loadFromKTX2(e,t):(c(t)||s(t))&&this._parameters.encoding===`image/x.basis`?this._loadFromBasis(e,t):c(t)?this._loadFromPixelData(e,new Uint8Array(t)):l(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return this._texture==null||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=x(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX1(e,t){return this._texture=g(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>_(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>v(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){C(this._parameters.width>0&&this._parameters.height>0);let n=this._createDescriptor(e);return(n.pixelFormat===6407||n.pixelFormat===6408)&&(n.compress=this._parameters.compressionOptions),n.width=this._parameters.width??0,n.height=this._parameters.height??0,this._texture=new w(e,n,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async n=>{let r=await m(t,{signal:n});return i(n),this._loadFromImage(e,r)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async n=>{let r=await h(t,t.src,!1,n);return i(n),this._loadFromImage(e,r)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(t,n){return this._loadAsync(i=>new Promise((s,c)=>{let l=()=>{n.removeEventListener(`loadeddata`,u),n.removeEventListener(`error`,d),r(f)},u=()=>{n.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),s(this._loadFromImage(t,n)))},d=t=>{l(),c(t||new e(`texture:load-error`,`Failed to load video`))};n.addEventListener(`loadeddata`,u),n.addEventListener(`error`,d);let f=a(i,()=>d(o()))}))}_loadFromImage(e,t){let n=t;n instanceof HTMLVideoElement||(n=S(n,e.parameters));let r=P(n);this._parameters.width=r.width,this._parameters.height=r.height;let i=this._createDescriptor(e);return i.width=r.width,i.height=r.height,i.compress=this._parameters.compressionOptions,this._texture=new w(e,i,n),this._emptyTexture=null,this.events.emit(`loaded`),this._texture}_loadAsync(e){let t=new AbortController;this._loadingController=t;let n=e(t.signal);this._loadingPromise=n;let r=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===n&&(this._loadingPromise=null),this._emptyTexture=null};return n.then(r,r),n}unload(){if(this._texture=n(this._texture),this._emptyTexture=null,this._loadingController!=null){let e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit(`unloaded`)}get parameters(){return this._parameters}}function N(e,t){if(e==null)return 0;if(c(e)||s(e))return t.encoding===`image/ktx2`?y(e,!!t.mipmap):t.encoding===`image/x.basis`?b(e,!!t.mipmap):e.byteLength;let{width:n,height:r}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?P(e):t,i=t.pixelFormat??6408,a=A(i);return(t.mipmap?4/3:1)*n*r*a||0}function P(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const F={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1};function I(e){return e!=null&&(E(e)||D(e)||O(e)||k(e))}export{M as ManagedTexture};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import{abortMaybe as e}from"../../../../core/maybe.js";import{recordPerformance as t}from"../../../../core/performance.js";import{createAbortError as n}from"../../../../core/promiseUtils.js";import{Milliseconds as r}from"../../../../core/time.js";import i from"../../webgl/RenderCamera.js";import{NavigationDepthCacheStore as a,navigationDepthReductionFactor as o}from"./NavigationDepthCacheStore.js";import{N as s}from"../../../../chunks/NavigationDepth.glsl.js";import{NavigationDepthTechnique as c}from"../shaders/NavigationDepthTechnique.js";import{PixelType as l}from"../../../webgl/enums.js";const u=o,d=r(250);class f{constructor(e,t,n,o){this._rctx=e,this._fboCache=t,this._techniques=n,this._requestRender=o,this._store=new a,this._passParameters=new s,this._updateWaiters=[],this._readbackCamera=new i,this._destroyed=!1,this._readbackPending=!1,this._lastUpdateTime=r(-1/0),this._immediateUpdateId=0,this._abortController=new AbortController}destroy(){this._destroyed=!0,this._withUpdateWaiters(e=>e.reject(n())),this._abortController=e(this._abortController),this._releaseReadbackHandles()}update(e,n,i){let{camera:a}=e;if(this._destroyed||this._readbackPending||i-this._lastUpdateTime<d||a.fullWidth<=0||a.fullHeight<=0)return;let o=this._techniques.getCompiled(c);if(!o){this._requestRender();return}let s=performance.now();this._lastUpdateTime=i;let f=Math.ceil(a.fullWidth/u),p=Math.ceil(a.fullHeight/u),m=Math.ceil(f/u),h=Math.ceil(p/u),g=m*h,_=this._ensureReadbackBuffer(g);this._readbackCamera.copyFrom(a);let v=this._fboCache.acquire(f,p,`navigation depth`,7);this._readbackImmediateHandle=v;let y=this._fboCache.acquire(m,h,`navigation depth`,10);this._readbackHandle=y,this._passParameters.depthTexture=n,this._passParameters.depthTextureSize=[a.fullWidth,a.fullHeight],this._passParameters.cellSize=u,this._passParameters.reduced=!1,this._rctx.bindFramebuffer(v.fbo),this._rctx.setViewport(0,0,f,p),this._rctx.bindTechnique(o,e,this._passParameters),this._rctx.screen.draw(),this._passParameters.depthTexture=v.getTexture(),this._passParameters.depthTextureSize=[f,p],this._passParameters.reduced=!0,this._rctx.bindFramebuffer(y.fbo),this._rctx.setViewport(0,0,m,h),this._rctx.bindTechnique(o,e,this._passParameters),this._rctx.screen.draw(),this._readbackPending=!0;let b=this._immediateUpdateId;y.fbo.readPixelsAsync(0,0,m,h,6403,l.FLOAT,_,this._abortController?.signal).then(()=>{this._destroyed||(this._store.setDepthData(_.slice(0,g),m,h,this._readbackCamera),b===this._immediateUpdateId?this._withUpdateWaiters(e=>e.resolve()):(this._lastUpdateTime=r(-1/0),this._requestRender()))}).catch(
|
|
2
|
+
import"../../../../core/has.js";import{abortMaybe as e}from"../../../../core/maybe.js";import{recordPerformance as t}from"../../../../core/performance.js";import{createAbortError as n}from"../../../../core/promiseUtils.js";import{Milliseconds as r}from"../../../../core/time.js";import i from"../../webgl/RenderCamera.js";import{NavigationDepthCacheStore as a,navigationDepthReductionFactor as o}from"./NavigationDepthCacheStore.js";import{N as s}from"../../../../chunks/NavigationDepth.glsl.js";import{NavigationDepthTechnique as c}from"../shaders/NavigationDepthTechnique.js";import{PixelType as l}from"../../../webgl/enums.js";const u=o,d=r(250);class f{constructor(e,t,n,o){this._rctx=e,this._fboCache=t,this._techniques=n,this._requestRender=o,this._store=new a,this._passParameters=new s,this._updateWaiters=[],this._readbackCamera=new i,this._destroyed=!1,this._readbackPending=!1,this._lastUpdateTime=r(-1/0),this._immediateUpdateId=0,this._abortController=new AbortController}destroy(){this._destroyed=!0,this._withUpdateWaiters(e=>e.reject(n())),this._abortController=e(this._abortController),this._releaseReadbackHandles()}update(e,n,i){let{camera:a}=e;if(this._destroyed||this._readbackPending||i-this._lastUpdateTime<d||a.fullWidth<=0||a.fullHeight<=0)return;let o=this._techniques.getCompiled(c);if(!o){this._requestRender();return}let s=performance.now();this._lastUpdateTime=i;let f=Math.ceil(a.fullWidth/u),p=Math.ceil(a.fullHeight/u),m=Math.ceil(f/u),h=Math.ceil(p/u),g=m*h,_=this._ensureReadbackBuffer(g);this._readbackCamera.copyFrom(a);let v=this._fboCache.acquire(f,p,`navigation depth`,7);this._readbackImmediateHandle=v;let y=this._fboCache.acquire(m,h,`navigation depth`,10);this._readbackHandle=y,this._passParameters.depthTexture=n,this._passParameters.depthTextureSize=[a.fullWidth,a.fullHeight],this._passParameters.cellSize=u,this._passParameters.reduced=!1,this._rctx.bindFramebuffer(v.fbo),this._rctx.setViewport(0,0,f,p),this._rctx.bindTechnique(o,e,this._passParameters),this._rctx.screen.draw(),this._passParameters.depthTexture=v.getTexture(),this._passParameters.depthTextureSize=[f,p],this._passParameters.reduced=!0,this._rctx.bindFramebuffer(y.fbo),this._rctx.setViewport(0,0,m,h),this._rctx.bindTechnique(o,e,this._passParameters),this._rctx.screen.draw(),this._readbackPending=!0;let b=this._immediateUpdateId;y.fbo.readPixelsAsync(0,0,m,h,6403,l.FLOAT,_,this._abortController?.signal).then(()=>{this._destroyed||(this._store.setDepthData(_.slice(0,g),m,h,this._readbackCamera),b===this._immediateUpdateId?this._withUpdateWaiters(e=>e.resolve()):(this._lastUpdateTime=r(-1/0),this._requestRender()))}).catch(e=>this._withUpdateWaiters(t=>t.reject(e))).finally(()=>{this._releaseReadbackHandles(),this._readbackPending=!1,t(`NavigationDepthCache update`,s,performance.now(),`Maps SDK`,`Scheduling`)}),a.setGLViewport(this._rctx)}getMinimalDepthForArea(e,t,n,r,i=r){return this._store.getMinimalDepthForArea(e,t,n,r,i)}async whenRepresentativeDepthForArea(e,t,n,r,i,a=1){return this._store.getRepresentativeDepthForArea(e,t,n,r,i,a)??(await this._requestImmediateUpdate(),this._store.getRepresentativeDepthForArea(e,t,n,r,i,a))}_requestImmediateUpdate(){if(this._destroyed)return Promise.reject(n());let e=Promise.withResolvers();return this._updateWaiters.push(e),this._immediateUpdateId++,this._lastUpdateTime=r(-1/0),this._requestRender(),e.promise}_ensureReadbackBuffer(e){return(this._readbackBuffer==null||this._readbackBuffer.length<e)&&(this._readbackBuffer=new Float32Array(e)),this._readbackBuffer}_withUpdateWaiters(e){let t=this._updateWaiters.slice();this._updateWaiters.length=0;for(let n of t)e(n)}_releaseReadbackHandles(){this._readbackHandle?.release(),this._readbackHandle=null,this._readbackImmediateHandle?.release(),this._readbackImmediateHandle=null}get test(){return null}}export{f as NavigationDepthCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as n}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as r,abortMaybe as i,destroyMaybe as a,releaseMaybe as o,releaseReferencedMaybe as s}from"../../../../core/maybe.js";import{throwIfAborted as c}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as u,initial as d,sync as f}from"../../../../core/reactiveUtils.js";import{signal as p}from"../../../../core/signal.js";import{property as m,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{equals as g,invert as _,multiply as v,copy as y}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as x}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as ee}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as te,ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as ne}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as C,RenderNodeOutput as w,AllRenderNodeOutputs as T,AllInternalRenderNodeOutputs as E}from"../../webgl.js";import{minNearDistanceInMeters as re}from"../../state/NearFarHeuristic.js";import{debugFlags as ie}from"../../support/debugFlags.js";import{FBOCache as ae}from"../core/FBOCache.js";import{RenderPassManager as oe}from"../core/renderPasses/RenderPassManager.js";import{isColor as se}from"../core/shaderLibrary/ShaderOutput.js";import{RenderNodes as ce}from"../effects/RenderNodes.js";import{RenderPluginContext as le}from"../effects/RenderPluginContext.js";import{RenderPluginManager as D}from"../effects/RenderPluginManager.js";import{WeatherFader as O}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as ue}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as de}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as fe,renderHighlightBuffer as pe}from"../effects/highlight/Highlight.js";import{OITBlend as me}from"../effects/transparency/OITBlend.js";import{AnimationTimer as he}from"./AnimationTimer.js";import{AnimationTimeStep as ge}from"./AnimationTimeStep.js";import{BoundingInfo as _e}from"./BoundingInfo.js";import{Compositor as ve}from"./Compositor.js";import{DepthRange as k}from"./DepthRange.js";import{depthRangeFromScene as A}from"./depthRangeUtils.js";import{MainFramebuffer as ye}from"./MainFramebuffer.js";import{NavigationDepthCache as be}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as j}from"./OrderIndependentTransparency.js";import{RenderContext as M,defaultRenderOccludedMask as N}from"./RenderContext.js";import{RendererBase as xe}from"./RendererBase.js";import{setupFeatureDefaults as P}from"./RenderFeature.js";import{RenderPluginInput as F}from"./RenderPluginInput.js";import{ShadowMap as Se}from"./ShadowMap.js";import Ce from"./SliceHelper.js";import{MergedRenderer as we}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as I}from"../parts/renderUtils.js";import{RendererPerformanceInfo as Te,PerformanceCategory as L}from"../statistics/RendererPerformanceInfo.js";import{PixelType as Ee,ColorAttachment0 as R,ColorAttachment1 as z,ColorAttachment2 as B,DrawBufferNone as De}from"../../../webgl/enums.js";const Oe=has(`disable-feature:async-navigation-3d-depth-readback`);let V=class extends xe{constructor(e,t,n,r,i){super({stage:e}),this._techniques=n,this._rctx=r,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new oe,this._isRendering=!1,this._backgroundColor=te(0,0,0,1),this._sliceHelper=new Ce,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=p(k.Infinite),this._state=p(2),this._hasAnimations=!1,this._animationTimestep=new ge,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=p(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new F,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(let t of Me)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new ae(r),this._compositor=new ve(r,n),this._renderStateFeatures=p(P(e.view.qualityProfile));let a=new Se(this._fboCache,e.viewingMode);this._renderContext=new M(this._rctx,a,n),this._framebuffer=new ye(this._fboCache,this._bindParameters),this._performanceInfo=new Te(this._rctx),this._blit=new de(n),this.navigationDepthCache=new be(this._rctx,this._fboCache,n,()=>this._requestRender(0)),this._nodes=new ce(this._renderContext),this._plugins=new D(new le(this._renderContext,n,t,e,i)),this._plugins.add(this.renderPassManager),this.weatherFader=new O({view:e.view,context:this._renderContext}),this.addHandles([l(()=>e.view.state.camera,()=>i(),u),l(()=>ie.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},d),l(()=>e.view.environment.background?.color,e=>{let t=e?e.toUnitRGBA():S;ee(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},u),l(()=>e.view.environmentView.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},u),l(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},f),l(()=>this._bindParameters.clouds.data?.state,()=>i(),f),l(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},d),l(()=>e.view.environment.lighting?.type===`sun`,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},u)])}destroy(){this._gpuTimerHandle=r(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,_e.prune(),we.prune(),ne()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new me(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=P(e),this.updateGlobalIllumination(this.stage.view.environment.lighting.globalIllumination),this._requestRender()}updateGlobalIllumination(e){let t=P(this.stage.view.qualityProfile);for(let n of[0,1,2])this.setFeatureEnabled(11,n,e),this.setFeatureEnabled(10,n,e&&n===2),this.setFeatureEnabled(3,n,!e&&(t.get(n,3)??!1))}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,n){this.isFeatureEnabled(e,t)!==n&&(this._renderStateFeatures.mutate(r=>r.set(t,e,n)),this._requestRender())}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this._nodes.produces(C.AMBIENT_ILLUMINATION)}get hasGlobalIllumination(){return this.stage.renderView?.globalIllumination?.enabled??!1}get hasGlobalIlluminationHighQuality(){let e=this.stage.renderView?.globalIllumination;return this.hasGlobalIllumination&&e?.hasHighQuality===!0}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){let e=this._plugins.emissions;return this._hasTransparentGeometry?e:+(e===1||e===3)}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=o(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose();let e=this._bindParameters;e.globalIllumination=o(e.globalIllumination),e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(e.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||=n(async e=>{let{EdgeView:t}=await import(`./edgeRendering/EdgeView.js`);c(e);let n=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ne(this.stage.view.resourceController)});return this.addHandles(l(()=>n.updating,()=>this._requestRender(),f)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(n)),this._edgeViewCallbacks.length=0,n}),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),this._edgeView==null?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&g(this._bindParameters.reprojection.matrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn(`Renderer.modify called while rendering`),super.commit(e,t,this._plugins.context)?(this.updateHasFlags(),!0):!1}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(this.plugins.renderOccludedFlags&8)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){let has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...J),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new he(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);let n=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==n&&(this._gpuTimerHandle=n?r(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,n=!1){try{this._isRendering=!0,this._needsOffscreenPrepass(e.camera,t)&&this._render(e,3,n).color?.release();let r=this._render(e,t,n);return t!==0&&this._disposeOffscreenBuffers(),r}catch(e){console.error(`Exception during rendering: ${e}:\n${e.stack}`)}finally{this._isRendering=!1}return new I(this._pluginInput.get(w.FINAL),null)}_needsOffscreenPrepass(e,t){return(t===1||t===2)&&(this.hasGlobalIllumination||this.hasReflections)&&(!this._framebuffer.hasColor||!this._bindParameters.reprojection.lastFrameCamera.equals(e))}_render(e,t,n){let r=t===0;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r,this._disposeBindBuffers();let{camera:i,contentCamera:a,mode:c,alignPixelEnabled:l}=e;this._state.value=c,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=l,this._bindParameters.metersPerRenderUnit=this.stage.view.renderCoordsHelper.unitInMeters,this._bindParameters.decorations=!n,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;let u=!n||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=u?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(C.VIEWSHED),this._bindParameters.laserlinesEnabled=this._nodes.produces(C.LASERLINES),this._bindParameters.shadowAnalysisEnabled=!!this._shadowAccumulator?.active,this._bindParameters.cutFillComputationEnabled=this._nodes.produces(C.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(C.CUTFILL),this._ensureBindParameters(i,a),this._plugins.sortTestsTransparentOrderedSlots(Ae),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...U),this._renderOverlay(),i.setGLViewport(this._rctx);let d=this._framebuffer,f=d.initialize(i.fullWidth,i.fullHeight,this._backgroundColor);this.hasReflections?(f?.setName(`last frame color`),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=f):f?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!n,this._precompilePrepasses(),this.performanceInfo.advance(L.PREPARE);let p=this._computeShadowDepthRange(i);this._pluginInput.set(`normals`,this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(i,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p),d.bind(),this._bindParameters.mainDepth=d.depth.attachment,this._precompileShaders(r),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this._3dGeometryRendered(),d.update(e=>this._renderNodes(C.CUTFILL_COMPUTATION,e)),this._pluginInput.set(C.FOCUSAREA_MASK,this._renderFocusAreaMask()),d.update(e=>this._renderNodes(C.TRANSPARENT_ENVIRONMENT,e)),d.update(e=>this._renderNodes(C.VIEWSHED,e)),d.update(e=>this._renderNodes(C.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=s(this._bindParameters.depth)),d.update(e=>this._renderNodes(C.FOCUSAREA,e)),this._pluginInput.release(C.FOCUSAREA_MASK),d.update(e=>this._renderNodes(C.CUTFILL,e)),this._pluginInput.release(C.GROUND_DEPTH),d.update(e=>this._renderNodes(C.OCCLUDED,e)),this._pluginInput.set(`highlights`,this._renderHighlightPrepass());let m=t===2?this._renderObjectAndLayerIdColor():null;d.update(e=>this._renderNodes(w.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=o(this._bindParameters.shadowHighlight),d.update(e=>this._renderNodes(C.ANTIALIASING,e));let h=this._hasTransparentGeometry?2:1,g=this._bindParameters.emissions;this._bindParameters.emissions=0,this._hasHUDHighlights&&d.update(e=>this._renderHUD(h,e)),d.update(e=>this._renderNodes(C.HIGHLIGHT,e)),this._hasHUDHighlights||d.update(e=>this._renderHUD(h,e)),this._bindParameters.emissions=g,d.update(e=>this._renderNodes(C.MAGNIFIER,e)),d.update(e=>this._renderNodes(w.FINAL,e)),r&&(this._blit.toFramebuffer(d.color,this._bindParameters),Oe||c!==2&&c!==0||this.navigationDepthCache.update(this._bindParameters,d.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=s(this._bindParameters.depth)),this._releaseFBOs(),d.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd();let _;return r||(_=d.color,_.retain()),this.performanceInfo.finishFrame(),new I(_,m)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;let t=this._bindParameters;t.output=0;let n=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(C.OPAQUE_ENVIRONMENT,C.GAUSSIAN_SPLAT,C.OPAQUE_OCCLUSION_QUERY,C.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...W),t.output=0,this._plugins.precompile(...W),this._hasTransparentGeometry){let e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(C.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(C.TRANSPARENT_ENVIRONMENT,C.VIEWSHED,C.CUTFILL_COMPUTATION,C.CUTFILL,C.LASERLINES,C.FOCUSAREA,C.OCCLUDED,C.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=n,this._hasHighlights&&(t.highlights.forEach((e,n)=>{t.highlightLevel=n,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(C.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(w.COMPOSITE,C.MAGNIFIER),this._nodes.precompile(C.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaMask(){let e=this._nodes.produce(C.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(L.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(C.OBJECT_AND_LAYER_ID_COLOR))return null;let e=this._bindParameters.output;++this._techniques.precompiling;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,C.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return r=this._renderNodes(C.OBJECT_AND_LAYER_ID_COLOR,r),--this._techniques.precompiling,this._bindParameters.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();let t=this.performanceInfo.gpuSamplingEnabled,n=e===0,r=n?this.performanceInfo.elapsedTime:0;if(n||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);let i=Math.max(r,e);this._animationTimestep.frame(i,n)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){let{mainDepth:n,camera:r}=this._bindParameters;if(!n)return;let i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,`linear depth`);this._rctx.bindFramebuffer(i.fbo),r.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(S),this._compositor.blitDepthToLinearDepth(this._bindParameters,n),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,Ee.UNSIGNED_BYTE,t),i.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){let t=this._needsEdges;if(!t)return;let{width:n,height:r}=this._framebuffer.size,i=this.fboCache.acquire(n,r,`edges`);i.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(S),t.render(this._bindParameters,e),i.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===1?L.OPAQUE_EDGES:L.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(L.OVERLAY)}_renderShadowMap(e,t,n,r){if(!this.shadowsEnabled)return;let i=this._bindParameters.shadowMap;if(i.start(e,n,r,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,i),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);let n=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(C.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=n,i.disposeOutput(6),i.clear(),this._renderShadowCascades(7,i)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=s(this._bindParameters.depth)),this.performanceInfo.advance(C.SHADOWMAP)}_precompileShadowCascades(e){this._bindParameters.shadowMap.cascades.length!==0&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){let n=this._bindParameters.output,r=e!==6;t.bindFramebuffer();for(let n of t.cascades)n.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(n.camera,n.camera),this.renderAllGeometry(e),r&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=n}_renderShadowNodes(e){this._renderInternalNodeCategory(C.SHADOWMAP,e)}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){let e=this._bindParameters;e.depth=o(this._bindParameters.depth);let t=this._pluginInput.get(`normals`);if(t){let n=this._nodes.produce(C.AMBIENT_ILLUMINATION,this._pluginInput);this._pluginInput.set(C.AMBIENT_ILLUMINATION,n),this._releaseGlobalIlluminationBuffers(),e.ssao=this.hasGlobalIllumination?null:n,e.globalIllumination=this.hasGlobalIllumination?n:null,e.globalIlluminationEnabled=e.globalIllumination!=null,n&&this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?L.AMBIENT_ILLUMINATION_HIGH_QUALITY:L.AMBIENT_ILLUMINATION);let r=this._needsDepth;if(r){let n=t.obtainAttachment(R);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),e.depth=t.obtainDepthTexture(),e.depth?.retain(r-1),t.attachColor(n,R),n?.release(),this.performanceInfo.advance(L.DEPTH)}else t.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release(`normals`)}else this._releaseGlobalIlluminationBuffers(),e.ssao=null,this._pluginInput.set(C.AMBIENT_ILLUMINATION,null),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){let e=this._needsDepth;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`geometry depth`,14);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(r),this._bindParameters.depth=r.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),r.release(),this.performanceInfo.advance(L.DEPTH)}_renderGaussianSplatPrepassDepth(e){let t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;let n=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=n}_renderGaussianSplatDepthAndNormals(e){let t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return k.Zero;let t=A(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(C.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal||(this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<ue){this.sceneDepthRange.value=k.Infinite;return}let t=e.clone();t.near=re,t.far=1e10;let n=A(t,this._plugins.plugins,this.stage.layers,1);n.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(n)||(this.sceneDepthRange.value=n)}get _normalsRequired(){return this._nodes.require(`normals`,...T,C.VIEWSHED,C.LASERLINES)+ +!!this.hasAmbientIllumination}_precompilePrepasses(){let e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,G),this._needsDepth&&this._precompilePlugins(3,K)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(C.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(C.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){let t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(C.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(C.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(C.AMBIENT_ILLUMINATION)}_renderNormals(){let e=this._normalsRequired;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`normals`);r.acquireDepth(14),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(S,!0,!0),this._bindParameters.output=4,this._plugins.render(...G),this._renderGaussianSplatDepthAndNormals(r);let i=this._nodes.optional(`normals`,...T,C.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(L.NORMALS),r}_releaseGlobalIlluminationBuffers(){let e=this._bindParameters;e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(e.reprojection.lastFrameEmission),e.globalIllumination=s(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){let t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...W),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(let n of t)this._renderContext.renderOccludedMask=n,this.precompileSlots(e,...q);this._renderContext.renderOccludedMask=N}renderSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.forAll(e=>{let t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...q),this._renderContext.renderOccludedMask=N}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...je[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){let e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(C.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Y)}_precompilePlugins(e,t){let n=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=n}renderViewshedShadowMap(e,t){let{camera:n,contentCamera:r}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(n,r),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillDepth(e){let{camera:t,contentCamera:n}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Y),this._ensureBindParametersCamera(t,n),t.setGLViewport(this._rctx),this._bindParameters.output=r}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;let{width:e,height:t}=this._framebuffer.size,n=this.fboCache.acquire(e,t,C.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,n.fbo,256),this._framebuffer.bind(),n}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...K)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...H),this._nodes.precompile(`opaque-color`))}_renderOpaqueGeometry(){this._plugins.render(...H)}_renderTransparentGeometry(){this._plugins.render(...U),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...W)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;let t=this._bindParameters.output,n=this._bindParameters.hudRenderStyle,r=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...J),this._bindParameters.output=2,this._plugins.precompile(...J),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...J)),this._bindParameters.emissions=r,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=n}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;let n=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);let r=!!t.getTexture(z);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,n.getTexture(),r),n.release(),this.performanceInfo.advance(e===0?L.HUD_OCCLUDED:L.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;let{fboCache:e,_rctx:t,_bindParameters:n}=this,{width:r,height:i}=this._framebuffer.size,{highlights:a}=n,o=a.length>fe?3:1,s=e.acquire(r,i,`highlights`,o);s.acquireDepth(14);let c=this._plugins.produces(10,0);return c&&this._framebuffer.color.fbo&&s.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,1024),t.bindFramebuffer(s.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),c||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(s.fbo),pe(t,e,r,i,n,()=>this._renderHighlightGeometries()),s.detachDepth(),this.performanceInfo.advance(L.HIGHLIGHTS),s.retain(this._nodes.require(`highlights`,...E)+this._nodes.optional(`highlights`,...E)-1),s}_renderHighlightGeometries(){this._plugins.render(...ke),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){let t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);let n=t.requireGeometryDepth;this._bindParameters.output=0;let r=this._nodes.produce(C.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(L.ACCUMULATED_SHADOWS),this._pluginInput.set(C.SHADOW_ACCUMULATION,null),r?.release(),n&&(this._bindParameters.depth=s(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,n,r,i){let a=this.stage.view.qualitySettings.maximumPixelRatio;n.start(e,r,i,!0,a),this._renderShadowCascades(5,n),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}_precompileTransparentGeometry(){se(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...U),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...U),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...U)}_renderOIT(e,t=2){let n=e===1,{width:r,height:i}=this._framebuffer.size,a=n?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),s=this._bindParameters,c=s.useFloatBlend.value?8:5,l=s.output;s.output=1;let u=n?`oit hud`:`oit`,d=this.fboCache.acquire(r,i,u,c).acquireColor(z,this.hasFloatBlend?7:0,`oit alpha`),f=s.hasEmission&&(e===0||t!==1);f&&d.acquireColor(B,c,`oit emissive`),n||d.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(d.fbo),this._rctx.clearFramebuffer(j),f&&this._rctx.clearBuffer(2,j),a(),d.detachDepth(),s.output=2;let p=this.fboCache.acquire(r,i,n?`oit front hud`:`oit front`);f&&p.acquireColor(z,c,`oit front emissive`),n?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(S,n),a(),p.detachDepth();let m=this._pluginsHas.occludedHudElements&&!n,h=m&&s.emissions!==0?B:z;s.hudOcclusion=o(this._bindParameters.hudOcclusion),s.output=0;let g;return n?(g=this.fboCache.acquire(r,i,`oit composite hud`),this._rctx.bindFramebuffer(g.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(s.emissions!==0&&this._framebuffer.ensureEmissionAttachment(),m&&(this._framebuffer.color.acquireColor(h,0,`hud occlusion`),this._rctx.clearBuffer(h-R,S)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,d,p,s,m,e,this._fboCache.debugCallback),g?.detachDepth(),n||(f&&(this._bindParameters.emissions=3),m&&(s.hudOcclusion=this._framebuffer.color.obtainAttachment(h))),p.release(),d.release(),s.output=l,g}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...H)||this.plugins.produces(5,...H)||this.plugins.produces(3,3)}_renderOpaque(){let e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(C.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));let t=this._framebuffer;t.update(t=>this._renderNodes(w.OPAQUE,t,e)),this.fboCache.debugCallback?.(w.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(C.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(C.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(C.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(C.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(C.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.VOXEL,e)),this.fboCache.debugCallback?.(C.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){let e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(w.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(w.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=o(this._bindParameters.ssao),e.update(e=>this._renderNodes(C.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(C.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){let e=this._rctx.setDrawBuffers([De,z]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(L.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,n=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return n&&this.performanceInfo.advance(e),t;let r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,r.fbo),r}_renderInternalNodeCategory(e,t){if(!t)return;let n=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(n)}}_3dGeometryRendered(){let e=this._bindParameters;this.hasReflections&&(e.depth=s(e.depth),e.reprojection.lastFrameColor=s(e.reprojection.lastFrameColor)),e.shadowMap.disposeOutput(5);let t=this._framebuffer.color.getAttachment(z)?.attachment;if(this.hasGlobalIllumination&&t){let{width:n,height:r}=this._framebuffer.size,i=e.useFloatBlend.value?8:5;e.reprojection.lastFrameEmission=this.fboCache.acquire(n,r,`emissive`,i),this._blit.blitTexture(t,e,e.reprojection.lastFrameEmission.fbo)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){this.stage.viewingMode===1&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){let{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){this._ssrEnableTime??=e;let n=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=n>0?Math.min(n,e-this._ssrEnableTime)/n:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination)){this._reprojectionMatrix=b;return}let{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:n}=e,r=!n.equals(t);if(r?(_(Z,t.viewMatrix),_(X,t.projectionMatrix),v(Q,Z,X),v(Q,n.viewMatrix,Q),v(Q,n.projectionMatrix,Q),this._reprojectionMatrix=Q):this._reprojectionMatrix=b,this.hasGlobalIllumination){let{viewMatrix:t}=e;r?(v($,n.viewMatrix,Z),y(t,$)):y(t,b)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,n,r){this._bindParameters.updateLighting(e,t,n,r),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([m({readOnly:!0})],V.prototype,`highResolutionAtmosphere`,null),e([m()],V.prototype,`_edgeView`,void 0),e([m()],V.prototype,`updating`,null),V=e([h(`esri.views.3d.webgl-engine.lib.Renderer`)],V);const H=[0,1,2,3],U=[7,6,4,5],W=[7,6],G=[0,1,2,4,...W],K=[3,5],q=[2,4,8],J=[16,12,14,13],ke=[4,5,2,3,0,1,...W],Ae=[4,8,5,11],je={0:[13],1:[12],2:[13,12],3:[13,12]},Y=[0,1,...W],Me=[`normals`,`highlights`],X=x(),Z=x(),Q=x(),$=x();function Ne(e){return t=>e.immediate.schedule(t)}export{V as Renderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as n}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as r,abortMaybe as i,destroyMaybe as a,releaseMaybe as o,releaseReferencedMaybe as s}from"../../../../core/maybe.js";import{throwIfAborted as c}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as u,initial as d,sync as f}from"../../../../core/reactiveUtils.js";import{signal as p}from"../../../../core/signal.js";import{property as m,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{equals as g,invert as _,multiply as v,copy as y}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as x}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as ee}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as te,ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as ne}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as C,RenderNodeOutput as w,AllRenderNodeOutputs as T,AllInternalRenderNodeOutputs as E}from"../../webgl.js";import{minNearDistanceInMeters as re}from"../../state/NearFarHeuristic.js";import{debugFlags as ie}from"../../support/debugFlags.js";import{FBOCache as ae}from"../core/FBOCache.js";import{RenderPassManager as oe}from"../core/renderPasses/RenderPassManager.js";import{isColor as se}from"../core/shaderLibrary/ShaderOutput.js";import{RenderNodes as ce}from"../effects/RenderNodes.js";import{RenderPluginContext as le}from"../effects/RenderPluginContext.js";import{RenderPluginManager as D}from"../effects/RenderPluginManager.js";import{WeatherFader as O}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as ue}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as de}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as fe,renderHighlightBuffer as pe}from"../effects/highlight/Highlight.js";import{OITBlend as me}from"../effects/transparency/OITBlend.js";import{AnimationTimer as he}from"./AnimationTimer.js";import{AnimationTimeStep as ge}from"./AnimationTimeStep.js";import{BoundingInfo as _e}from"./BoundingInfo.js";import{Compositor as ve}from"./Compositor.js";import{DepthRange as k}from"./DepthRange.js";import{depthRangeFromScene as A}from"./depthRangeUtils.js";import{MainFramebuffer as ye}from"./MainFramebuffer.js";import{NavigationDepthCache as be}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as j}from"./OrderIndependentTransparency.js";import{RenderContext as M,defaultRenderOccludedMask as N}from"./RenderContext.js";import{RendererBase as xe}from"./RendererBase.js";import{setupFeatureDefaults as P}from"./RenderFeature.js";import{RenderPluginInput as F}from"./RenderPluginInput.js";import{ShadowMap as Se}from"./ShadowMap.js";import Ce from"./SliceHelper.js";import{MergedRenderer as we}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as I}from"../parts/renderUtils.js";import{RendererPerformanceInfo as Te,PerformanceCategory as L}from"../statistics/RendererPerformanceInfo.js";import{PixelType as Ee,ColorAttachment0 as R,ColorAttachment1 as z,ColorAttachment2 as B,DrawBufferNone as De}from"../../../webgl/enums.js";const Oe=has(`disable-feature:async-navigation-3d-depth-readback`);let V=class extends xe{constructor(e,t,n,r,i){super({stage:e}),this._techniques=n,this._rctx=r,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new oe,this._isRendering=!1,this._backgroundColor=te(0,0,0,1),this._sliceHelper=new Ce,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=p(k.Infinite),this._state=p(2),this._hasAnimations=!1,this._animationTimestep=new ge,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=p(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new F,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(let t of Me)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new ae(r),this._compositor=new ve(r,n),this._renderStateFeatures=p(P(e.view.qualityProfile));let a=new Se(this._fboCache,e.viewingMode);this._renderContext=new M(this._rctx,a,n),this._framebuffer=new ye(this._fboCache,this._bindParameters),this._performanceInfo=new Te(this._rctx),this._blit=new de(n),this.navigationDepthCache=new be(this._rctx,this._fboCache,n,()=>this._requestRender(0)),this._nodes=new ce(this._renderContext),this._plugins=new D(new le(this._renderContext,n,t,e,i)),this._plugins.add(this.renderPassManager),this.weatherFader=new O({view:e.view,context:this._renderContext}),this.addHandles([l(()=>e.view.state.camera,()=>i(),u),l(()=>ie.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},d),l(()=>e.view.environment.background?.color,e=>{let t=e?e.toUnitRGBA():S;ee(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},u),l(()=>e.view.environmentView.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},u),l(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},f),l(()=>this._bindParameters.clouds.data?.state,()=>i(),f),l(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},d),l(()=>e.view.environment.lighting?.type===`sun`,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},u)])}destroy(){this._gpuTimerHandle=r(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,_e.prune(),we.prune(),ne()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new me(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=P(e),this.updateGlobalIllumination(this.stage.view.environment.lighting.globalIllumination),this._requestRender()}updateGlobalIllumination(e){let t=P(this.stage.view.qualityProfile);for(let n of[0,1,2])this.setFeatureEnabled(11,n,e),this.setFeatureEnabled(10,n,e&&n===2),this.setFeatureEnabled(3,n,!e&&(t.get(n,3)??!1))}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,n){this.isFeatureEnabled(e,t)!==n&&(this._renderStateFeatures.mutate(r=>r.set(t,e,n)),this._requestRender())}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this._nodes.produces(C.AMBIENT_ILLUMINATION)}get hasGlobalIllumination(){return this.stage.renderView?.globalIllumination?.enabled??!1}get hasGlobalIlluminationHighQuality(){let e=this.stage.renderView?.globalIllumination;return this.hasGlobalIllumination&&e?.hasHighQuality===!0}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){let e=this._plugins.emissions;return this._hasTransparentGeometry?e:+(e===1||e===3)}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=o(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose();let e=this._bindParameters;e.globalIllumination=o(e.globalIllumination),e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(e.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||=n(async e=>{let{EdgeView:t}=await import(`./edgeRendering/EdgeView.js`);c(e);let n=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ne(this.stage.view.resourceController)});return this.addHandles(l(()=>n.updating,()=>this._requestRender(),f)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(n)),this._edgeViewCallbacks.length=0,n}),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),this._edgeView==null?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&g(this._bindParameters.reprojection.matrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn(`Renderer.modify called while rendering`),super.commit(e,t,this._plugins.context)?(this.updateHasFlags(),!0):!1}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(this.plugins.renderOccludedFlags&8)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){let has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...J),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new he(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);let n=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==n&&(this._gpuTimerHandle=n?r(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,n=!1){try{this._isRendering=!0,this._needsOffscreenPrepass(e.camera,t)&&this._render(e,3,n).color?.release();let r=this._render(e,t,n);return t!==0&&this._disposeOffscreenBuffers(),r}catch(e){console.error(`Exception during rendering: ${e}:\n${e.stack}`)}finally{this._isRendering=!1}return new I(this._pluginInput.get(w.FINAL),null)}_needsOffscreenPrepass(e,t){return(t===1||t===2)&&(this.hasGlobalIllumination||this.hasReflections)&&(!this._framebuffer.hasColor||!this._bindParameters.reprojection.lastFrameCamera.equals(e))}_render(e,t,n){let r=t===0;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r,this._disposeBindBuffers();let{camera:i,contentCamera:a,mode:c,alignPixelEnabled:l}=e;this._state.value=c,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=l,this._bindParameters.metersPerRenderUnit=this.stage.view.renderCoordsHelper.unitInMeters,this._bindParameters.decorations=!n,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;let u=!n||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=u?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(C.VIEWSHED),this._bindParameters.laserlinesEnabled=this._nodes.produces(C.LASERLINES),this._bindParameters.shadowAnalysisEnabled=!!this._shadowAccumulator?.active,this._bindParameters.cutFillComputationEnabled=this._nodes.produces(C.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(C.CUTFILL),this._ensureBindParameters(i,a),this._plugins.sortTestsTransparentOrderedSlots(Ae),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...U),this._renderOverlay(),i.setGLViewport(this._rctx);let d=this._framebuffer,f=d.initialize(i.fullWidth,i.fullHeight,this._backgroundColor);this.hasReflections?(f?.setName(`last frame color`),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=f):f?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!n,this._precompilePrepasses(),this.performanceInfo.advance(L.PREPARE);let p=this._computeShadowDepthRange(i);this._pluginInput.set(`normals`,this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(i,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p),d.bind(),this._bindParameters.mainDepth=d.depth.attachment,this._precompileShaders(r),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this._3dGeometryRendered(),d.update(e=>this._renderNodes(C.CUTFILL_COMPUTATION,e)),this._pluginInput.set(C.FOCUSAREA_MASK,this._renderFocusAreaMask()),d.update(e=>this._renderNodes(C.TRANSPARENT_ENVIRONMENT,e)),d.update(e=>this._renderNodes(C.VIEWSHED,e)),d.update(e=>this._renderNodes(C.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=s(this._bindParameters.depth)),d.update(e=>this._renderNodes(C.FOCUSAREA,e)),this._pluginInput.release(C.FOCUSAREA_MASK),d.update(e=>this._renderNodes(C.CUTFILL,e)),this._pluginInput.release(C.GROUND_DEPTH),d.update(e=>this._renderNodes(C.OCCLUDED,e)),this._pluginInput.set(`highlights`,this._renderHighlightPrepass());let m=t===2?this._renderObjectAndLayerIdColor():null;d.update(e=>this._renderNodes(w.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=o(this._bindParameters.shadowHighlight),d.update(e=>this._renderNodes(C.ANTIALIASING,e));let h=this._hasTransparentGeometry?2:1,g=this._bindParameters.emissions;this._bindParameters.emissions=0,this._hasHUDHighlights&&d.update(e=>this._renderHUD(h,e)),d.update(e=>this._renderNodes(C.HIGHLIGHT,e)),this._hasHUDHighlights||d.update(e=>this._renderHUD(h,e)),this._bindParameters.emissions=g,d.update(e=>this._renderNodes(C.MAGNIFIER,e)),d.update(e=>this._renderNodes(w.FINAL,e)),r&&(this._blit.toFramebuffer(d.color,this._bindParameters),Oe||c!==2&&c!==0||this.navigationDepthCache.update(this._bindParameters,d.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=s(this._bindParameters.depth)),this._releaseFBOs(),d.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd();let _;return r||(_=d.color,_.retain()),this.performanceInfo.finishFrame(),new I(_,m)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;let t=this._bindParameters;t.output=0;let n=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(C.OPAQUE_ENVIRONMENT,C.GAUSSIAN_SPLAT,C.OPAQUE_OCCLUSION_QUERY,C.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...W),t.output=0,this._plugins.precompile(...W),this._hasTransparentGeometry){let e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(C.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(C.TRANSPARENT_ENVIRONMENT,C.VIEWSHED,C.CUTFILL_COMPUTATION,C.CUTFILL,C.LASERLINES,C.FOCUSAREA,C.OCCLUDED,C.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=n,this._hasHighlights&&(t.highlights.forEach((e,n)=>{t.highlightLevel=n,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(C.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(w.COMPOSITE,C.MAGNIFIER),this._nodes.precompile(C.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaMask(){let e=this._nodes.produce(C.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(L.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(C.OBJECT_AND_LAYER_ID_COLOR))return null;let e=this._bindParameters.output;++this._techniques.precompiling;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,C.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return r=this._renderNodes(C.OBJECT_AND_LAYER_ID_COLOR,r),--this._techniques.precompiling,this._bindParameters.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();let t=this.performanceInfo.gpuSamplingEnabled,n=e===0,r=n?this.performanceInfo.elapsedTime:0;if(n||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);let i=Math.max(r,e);this._animationTimestep.frame(i,n)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){let{mainDepth:n,camera:r}=this._bindParameters;if(!n)return;let i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,`linear depth`);this._rctx.bindFramebuffer(i.fbo),r.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(S),this._compositor.blitDepthToLinearDepth(this._bindParameters,n),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,Ee.UNSIGNED_BYTE,t),i.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){let t=this._needsEdges;if(!t)return;let{width:n,height:r}=this._framebuffer.size,i=this.fboCache.acquire(n,r,`edges`);i.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(S),t.render(this._bindParameters,e),i.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===1?L.OPAQUE_EDGES:L.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(L.OVERLAY)}_renderShadowMap(e,t,n,r){if(!this.shadowsEnabled)return;let i=this._bindParameters.shadowMap;if(i.start(e,n,r,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,i),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);let n=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(C.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=n,i.disposeOutput(6),i.clear(),this._renderShadowCascades(7,i)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=s(this._bindParameters.depth)),this.performanceInfo.advance(C.SHADOWMAP)}_precompileShadowCascades(e){this._bindParameters.shadowMap.cascades.length!==0&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){let n=this._bindParameters.output,r=e!==6;t.bindFramebuffer();for(let n of t.cascades)n.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(n.camera,n.camera),this.renderAllGeometry(e),r&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=n}_renderShadowNodes(e){this._renderInternalNodeCategory(C.SHADOWMAP,e)}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){let e=this._bindParameters;e.depth=o(this._bindParameters.depth);let t=this._pluginInput.get(`normals`);if(t){let n=this._nodes.produce(C.AMBIENT_ILLUMINATION,this._pluginInput);this._pluginInput.set(C.AMBIENT_ILLUMINATION,n),this._releaseGlobalIlluminationBuffers(),e.ssao=this.hasGlobalIllumination?null:n,e.globalIllumination=this.hasGlobalIllumination?n:null,e.globalIlluminationEnabled=e.globalIllumination!=null,n&&this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?L.AMBIENT_ILLUMINATION_HIGH_QUALITY:L.AMBIENT_ILLUMINATION);let r=this._needsDepth;if(r){let n=t.obtainAttachment(R);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),e.depth=t.obtainDepthTexture(),e.depth?.retain(r-1),t.attachColor(n,R),n?.release(),this.performanceInfo.advance(L.DEPTH)}else t.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release(`normals`)}else this._releaseGlobalIlluminationBuffers(),e.ssao=null,this._pluginInput.set(C.AMBIENT_ILLUMINATION,null),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){let e=this._needsDepth;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`geometry depth`,14);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(r),this._bindParameters.depth=r.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),r.release(),this.performanceInfo.advance(L.DEPTH)}_renderGaussianSplatPrepassDepth(e){let t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;let n=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=n}_renderGaussianSplatDepthAndNormals(e){let t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(C.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return k.Zero;let t=A(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(C.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal||this.stage.view.renderCoordsHelper.getAltitude(e.eye)<ue){this.sceneDepthRange.value=k.Infinite;return}let t=e.clone();t.near=re,t.far=1e10;let n=A(t,this._plugins.plugins,this.stage.layers,1);n.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(n)||(this.sceneDepthRange.value=n)}get _normalsRequired(){return this._nodes.require(`normals`,...T,C.VIEWSHED,C.LASERLINES)+ +!!this.hasAmbientIllumination}_precompilePrepasses(){let e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,G),this._needsDepth&&this._precompilePlugins(3,K)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(C.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(C.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){let t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(C.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(C.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(C.AMBIENT_ILLUMINATION)}_renderNormals(){let e=this._normalsRequired;if(e===0)return;let{width:t,height:n}=this._framebuffer.size,r=this.fboCache.acquire(t,n,`normals`);r.acquireDepth(14),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(S,!0,!0),this._bindParameters.output=4,this._plugins.render(...G),this._renderGaussianSplatDepthAndNormals(r);let i=this._nodes.optional(`normals`,...T,C.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(L.NORMALS),r}_releaseGlobalIlluminationBuffers(){let e=this._bindParameters;e.reprojection.lastFrameDepth=o(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=o(e.reprojection.lastFrameEmission),e.globalIllumination=s(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){let t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...W),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(let n of t)this._renderContext.renderOccludedMask=n,this.precompileSlots(e,...q);this._renderContext.renderOccludedMask=N}renderSlots(e,...t){for(let n of t)this._bindParameters.slot=n,e.forAll(e=>{let t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...q),this._renderContext.renderOccludedMask=N}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...je[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){let e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(C.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Y)}_precompilePlugins(e,t){let n=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=n}renderViewshedShadowMap(e,t){let{camera:n,contentCamera:r}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(n,r),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillDepth(e){let{camera:t,contentCamera:n}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Y),this._ensureBindParametersCamera(t,n),t.setGLViewport(this._rctx),this._bindParameters.output=r}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;let{width:e,height:t}=this._framebuffer.size,n=this.fboCache.acquire(e,t,C.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,n.fbo,256),this._framebuffer.bind(),n}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...K)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...H),this._nodes.precompile(`opaque-color`))}_renderOpaqueGeometry(){this._plugins.render(...H)}_renderTransparentGeometry(){this._plugins.render(...U),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...W)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;let t=this._bindParameters.output,n=this._bindParameters.hudRenderStyle,r=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...J),this._bindParameters.output=2,this._plugins.precompile(...J),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...J)),this._bindParameters.emissions=r,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=n}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;let n=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);let r=!!t.getTexture(z);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,n.getTexture(),r),n.release(),this.performanceInfo.advance(e===0?L.HUD_OCCLUDED:L.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;let{fboCache:e,_rctx:t,_bindParameters:n}=this,{width:r,height:i}=this._framebuffer.size,{highlights:a}=n,o=a.length>fe?3:1,s=e.acquire(r,i,`highlights`,o);s.acquireDepth(14);let c=this._plugins.produces(10,0);return c&&this._framebuffer.color.fbo&&s.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,1024),t.bindFramebuffer(s.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),c||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(s.fbo),pe(t,e,r,i,n,()=>this._renderHighlightGeometries()),s.detachDepth(),this.performanceInfo.advance(L.HIGHLIGHTS),s.retain(this._nodes.require(`highlights`,...E)+this._nodes.optional(`highlights`,...E)-1),s}_renderHighlightGeometries(){this._plugins.render(...ke),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){let t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);let n=t.requireGeometryDepth;this._bindParameters.output=0;let r=this._nodes.produce(C.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(L.ACCUMULATED_SHADOWS),this._pluginInput.set(C.SHADOW_ACCUMULATION,null),r?.release(),n&&(this._bindParameters.depth=s(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,n,r,i){let a=this.stage.view.qualitySettings.maximumPixelRatio;n.start(e,r,i,!0,a),this._renderShadowCascades(5,n),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}_precompileTransparentGeometry(){se(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...U),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...U),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...U)}_renderOIT(e,t=2){let n=e===1,{width:r,height:i}=this._framebuffer.size,a=n?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),s=this._bindParameters,c=s.useFloatBlend.value?8:5,l=s.output;s.output=1;let u=n?`oit hud`:`oit`,d=this.fboCache.acquire(r,i,u,c).acquireColor(z,this.hasFloatBlend?7:0,`oit alpha`),f=s.hasEmission&&(e===0||t!==1);f&&d.acquireColor(B,c,`oit emissive`),n||d.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(d.fbo),this._rctx.clearFramebuffer(j),f&&this._rctx.clearBuffer(2,j),a(),d.detachDepth(),s.output=2;let p=this.fboCache.acquire(r,i,n?`oit front hud`:`oit front`);f&&p.acquireColor(z,c,`oit front emissive`),n?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(S,n),a(),p.detachDepth();let m=this._pluginsHas.occludedHudElements&&!n,h=m&&s.emissions!==0?B:z;s.hudOcclusion=o(this._bindParameters.hudOcclusion),s.output=0;let g;return n?(g=this.fboCache.acquire(r,i,`oit composite hud`),this._rctx.bindFramebuffer(g.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(s.emissions!==0&&this._framebuffer.ensureEmissionAttachment(),m&&(this._framebuffer.color.acquireColor(h,0,`hud occlusion`),this._rctx.clearBuffer(h-R,S)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,d,p,s,m,e,this._fboCache.debugCallback),g?.detachDepth(),n||(f&&(this._bindParameters.emissions=3),m&&(s.hudOcclusion=this._framebuffer.color.obtainAttachment(h))),p.release(),d.release(),s.output=l,g}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...H)||this.plugins.produces(5,...H)||this.plugins.produces(3,3)}_renderOpaque(){let e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(C.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));let t=this._framebuffer;t.update(t=>this._renderNodes(w.OPAQUE,t,e)),this.fboCache.debugCallback?.(w.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(C.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(C.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(C.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(C.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(C.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(C.VOXEL,e)),this.fboCache.debugCallback?.(C.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){let e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(w.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(w.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=o(this._bindParameters.ssao),e.update(e=>this._renderNodes(C.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(C.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){let e=this._rctx.setDrawBuffers([De,z]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(L.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,n=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return n&&this.performanceInfo.advance(e),t;let r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,r.fbo),r}_renderInternalNodeCategory(e,t){if(!t)return;let n=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(n)}}_3dGeometryRendered(){let e=this._bindParameters;this.hasReflections&&(e.depth=s(e.depth),e.reprojection.lastFrameColor=s(e.reprojection.lastFrameColor)),e.shadowMap.disposeOutput(5);let t=this._framebuffer.color.getAttachment(z)?.attachment;if(this.hasGlobalIllumination&&t){let{width:n,height:r}=this._framebuffer.size,i=e.useFloatBlend.value?8:5;e.reprojection.lastFrameEmission=this.fboCache.acquire(n,r,`emissive`,i),this._blit.blitTexture(t,e,e.reprojection.lastFrameEmission.fbo)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){this.stage.viewingMode===1&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){let{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){this._ssrEnableTime??=e;let n=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=n>0?Math.min(n,e-this._ssrEnableTime)/n:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination)){this._reprojectionMatrix=b;return}let{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:n}=e,r=!n.equals(t);if(r?(_(Z,t.viewMatrix),_(X,t.projectionMatrix),v(Q,Z,X),v(Q,n.viewMatrix,Q),v(Q,n.projectionMatrix,Q),this._reprojectionMatrix=Q):this._reprojectionMatrix=b,this.hasGlobalIllumination){let{viewMatrix:t}=e;r?(v($,n.viewMatrix,Z),y(t,$)):y(t,b)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,n,r){this._bindParameters.updateLighting(e,t,n,r),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([m({readOnly:!0})],V.prototype,`highResolutionAtmosphere`,null),e([m()],V.prototype,`_edgeView`,void 0),e([m()],V.prototype,`updating`,null),V=e([h(`esri.views.3d.webgl-engine.lib.Renderer`)],V);const H=[0,1,2,3],U=[7,6,4,5],W=[7,6],G=[0,1,2,4,...W],K=[3,5],q=[2,4,8],J=[16,12,14,13],ke=[4,5,2,3,0,1,...W],Ae=[4,8,5,11],je={0:[13],1:[12],2:[13,12],3:[13,12]},Y=[0,1,...W],Me=[`normals`,`highlights`],X=x(),Z=x(),Q=x(),$=x();function Ne(e){return t=>e.immediate.schedule(t)}export{V as Renderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{PackedUint32 as e}from"./PackedUint32.js";import{assert as t}from"./Util.js";const n=new e([
|
|
2
|
+
import{PackedUint32 as e}from"./PackedUint32.js";import{assert as t}from"./Util.js";const n=new e([1,1,1]),r=new e([26,3,3]),i=r.getField(0),a=6;function o(e,n,a){t(Number.isInteger(e)&&e>0&&e<=i.max,`Invalid ribbon texture index`);let o=a*6;return t(Number.isInteger(o)&&o>=0&&o<=6,`Unsupported ribbon-line subdivision factor`),r.encode(e,n,o)}export{o as encodeRibbonLineVertexInfo,r as ribbonLineVertexInfoPacking,n as ribbonLineVertexTypePacking,a as ribbonSubdivisionScale};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as C,closestLineSegmentPoint as w,projectPoint as T,projectPointFraction as E,create as D}from"../../../../geometry/support/lineSegment.js";import{fromPoints as O,signedDistance as k,getNormal as ee,create as A}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as te,BufferViewFloat as j,BufferViewVec4Unorm8 as ne,BufferViewVec4f16 as re,BufferViewUint32 as ie}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as ae,isColor as M,isDepth as oe,isColorHighlightOLIDOrDepth as se,is2DGeometryOutput as ce}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as le}from"../effects/geometry/olidUtils.js";import ue from"../lib/GLMaterial.js";import{LineMaterial as de}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as fe,encodeRibbonLineVertexInfo as pe}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as me,screenPolygonIntersectsBufferedSegment as he}from"../lib/screenPolygonOverlapUtils.js";import{Hit as ge,DrapedHit as _e}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as ve}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as ye,assert as N}from"../lib/Util.js";import{isImagePattern as be}from"./lineStippleUtils.js";import{VisualVariablePassParameters as xe}from"./VisualVariablePassParameters.js";import{writeColor as Se}from"./internal/bufferWriterUtils.js";import{intersectRayWithWorldSizedLineSegment as Ce,intersectScreenPolygonWithWorldSizedLineSegment as we}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{n as Te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as Ee,getTextureBufferLayout as De}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Oe}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ke}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Ae}from"../../../../webscene/support/AlphaCutoff.js";class je extends de{constructor(e,t){super(e,Ne),this.produces=new Map([[2,e=>ae(e)||M(e)&&this.parameters.renderOccluded===8],[3,e=>oe(e)],[10,e=>se(e)&&this.parameters.renderOccluded===8],[11,e=>se(e)&&this.parameters.renderOccluded===8],[4,e=>M(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>M(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>ce(e)]]),this._configuration=new ke(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=Le(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Ie(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=Ae||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>Ae}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=r[0],u=r[1],d=F(c,o,s,this.parameters.usesWorldSizedWidth()),f=Number.MAX_VALUE,p=0;for(let n of Fe(R,z,this.parameters,e)){let e=l-R[0],r=u-R[1],i=z[0]-R[0],a=z[1]-R[1],o=i*e+a*r,s=i*i+a*a,c=t(o/s,0,1),d=i*c-e,m=a*c-r,h=d*d+m*m;h<f&&(f=h,p=n)}f<d*d&&i(a.distance,a.renderDistance,a.normal,p)}intersectRay(t,n,r,i,a,o){let{options:s,camera:c}=r;if(!s.selectionMode||!t.visible||!c)return;if(!ye(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let l=this._getLineSize(t.attributes);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(t,n,r,l,o):this._intersectRayWithScreenSizedLine(t,n,r,l,o)}_intersectRayWithScreenSizedLine(e,t,n,r,i){let{camera:a}=n,s=e.attributes,c=s.get(`position`).data,_=W;o(_,n.point);let v=r*a.pixelRatio,y=$*a.pixelRatio,b=v/2+y;l(Y[0],_[0]-b,_[1]+b,0),l(Y[1],_[0]+b,_[1]+b,0),l(Y[2],_[0]+b,_[1]-b,0),l(Y[3],_[0]-b,_[1]-b,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(Y[e],X[e]))return;O(a.eye,X[0],X[1],Z),O(a.eye,X[1],X[2],qe),O(a.eye,X[2],X[3],Je),O(a.eye,X[3],X[0],Q);let x=Number.MAX_VALUE,T=0;for(let e of this._forEachTransformedLineSegment(I,L,c,t,P(this.parameters,s))){if(k(Z,I)<0&&k(Z,L)<0||k(qe,I)<0&&k(qe,L)<0||k(Je,I)<0&&k(Je,L)<0||k(Q,I)<0&&k(Q,L)<0)continue;let t=a.projectToRenderScreen(I,G),n=a.projectToRenderScreen(L,K);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(H,I,L);let e=a.frustum,n=-k(e[4],I)/d(H,ee(e[4]));if(f(H,H,n),p(I,I,H),!a.projectToRenderScreen(I,t))continue}else if(t[2]>0&&n[2]<0){u(H,L,I);let e=a.frustum,t=-k(e[4],L)/d(H,ee(e[4]));if(f(H,H,t),p(L,L,H),!a.projectToRenderScreen(L,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let i=S(t,n,Ge),o=C(i,_);if(!(o>=x)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(i,I,L,_,a,r,y);if(o>=e*e)continue}x=o,m(He,I),m(Ue,L),T=e}}if(x<b*b){let{rayBegin:e,rayEnd:t}=n,r=Number.MAX_VALUE;if(w(S(He,Ue,Ge),S(e,t,Ke),U)){u(U,U,e);let n=h(U);f(U,U,1/n),r=n/g(e,t)}i(r,r,U,T)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,c=e.attributes,l=c.get(`position`).data,u=r/(2*s),d=1/0,f=0;for(let e of this._forEachTransformedLineSegment(I,L,l,t,P(this.parameters,c))){let t=Ce(I,L,u,a,o,We);if(t!=null&&t<d&&(d=t,f=e,m(U,We),t===0))break}d<1/0&&i(d,d,U,f)}intersectScreenPolygon(t,n,r,i){let{options:a}=r;if(!a.selectionMode||!t.visible)return null;if(!ye(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let o=this._getLineSize(t.attributes);return this.parameters.worldSized?this._intersectWorldSizedPolygon(t,n,r,i,o):this._intersectScreenSizedPolygon(t,n,r,i,o)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=e.attributes,c=s.get(`position`).data,l=$,u=l*a.pixelRatio,d=new ge(4);for(let e of this._forEachTransformedLineSegment(I,L,c,t,P(this.parameters,s)))for(let[t,n]of o.processLineSegment(Xe,I,L)){if(!me(a,t,n,G,K))continue;let o=S(G,K,Ge),s=i/2+l;this.parameters.screenSizePerspective&&(_(W,G,K,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,W,a,i,u)/a.pixelRatio)),a.renderToScreen(G,Be),a.renderToScreen(K,Ve),he(r,Be,Ve,s)&&(T(S(t,n,Ke),a.eye,B),d.updateIfCloserFromValues(g(a.eye,B),e,B,null))}return d}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,{attributes:c}=e,l=c.get(`position`).data,u=i/(2*s),d=new ge(4);for(let e of this._forEachTransformedLineSegment(I,L,l,t,P(this.parameters,c)))for(let[t,n]of o.processLineSegment(Xe,I,L)){T(S(t,n,Ke),a.eye,B);let i=g(a.eye,B);d.valid&&i>=d.distance||we(t,n,u,a,r)&&d.updateIfCloserFromValues(i,e,B,null)}return d}intersectScreenPolygonDraped({attributes:e},t,n,r,i,a){if(!n.options.selectionMode)return null;let o=F(this._getLineSize(e,!0),i,a,this.parameters.usesWorldSizedWidth());for(let n of Fe(R,z,this.parameters,e,t))if(he(r,R,z,o))return new _e(n);return null}createBufferWriter(){return new Pe(Ee(this.parameters),De(this.parameters),this.parameters,this._isAssumedMetalDriver)}createGLMaterial(e){return new Me(e)}validateParameters(e){N(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=E(e,r);_(B,t,n,s),v(ze,B,i.viewMatrix);let c=h(ze),l=this.computeCameraAbsCosAngle(B,i,this._configuration.spherical);return Re.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Re.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(U,e):l(U,0,0,1),u(V,e,t.eye),y(V,V),Math.abs(d(U,V))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=e.get(`sizeFeatureAttribute`).data[0];Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else this.parameters.hasVertexSize&&e.has(`size`)&&(r*=e.get(`size`).data[0]);return r}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.length-2:n.length-5;for(let i=0;i<a;i+=3){e[0]=n[i]+r[12],e[1]=n[i+1]+r[13],e[2]=n[i+2]+r[14];let a=(i+3)%n.length;t[0]=n[a]+r[12],t[1]=n[a+1]+r[13],t[2]=n[a+2]+r[14],yield i/3}}}class Me extends ue{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Oe,e)}}class Ne extends xe{constructor(){super(...arguments),this._width=0,this.color=x,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return be(this.stipplePattern)&&this.stippleTexture!=null}}class Pe{constructor(e,t,n,r){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this._isAssumedMetalDriver=r,this.maxTextureBufferItemIndex=fe.getField(0).max,this.numJoinSubdivisions=Le(this._parameters.join,this._parameters.stipplePattern!=null)}_isClosed(e){return P(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get(`position`).data.length/3+(this._isClosed(e)?3:2)}elementCount(e){let t=e.get(`position`).indices.length/2+1,n=this._isClosed(e),r=n?2:4,i=+!n,a=n?t:t-1,o=this.numJoinSubdivisions*2+(this._isAssumedMetalDriver?8:4);return r+=(a-i)*o,r+=2,this._parameters.wireframe&&(r=2+(r-2)*4),r}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=t.get(`position`),i=r.data.length/3,a=this._isClosed(t),{buffer:o,offset:s}=n,c=o.getField(`position`,te),l=o.getField(`u0`,j),u=o.getField(`sizeFeatureAttribute`,j),d=o.getField(`size`,j),f=o.getField(`colorFeatureAttribute`,j),p=o.getField(`color`,ne),h=o.getField(`olidColor`,ne),_=o.getField(`timeStamps`,re),v=o.getField(`opacityFeatureAttribute`,j),y=t.get(`sizeFeatureAttribute`)?.data,b=t.get(`size`)?.data,x=t.get(`colorFeatureAttribute`)?.data,S=t.get(`color`)?.data,C=t.get(`opacityFeatureAttribute`)?.data,w=t.get(`distanceToStart`)?.data,T=t.get(`timeStamps`);N(c!==null,`Expected valid position field in texture buffer`);let E=0;for(let t=0;t<i;++t){this._getTransformedPosition(J,r.data,t,e),l!=null&&t>0&&(w==null?E+=g(q,J):E=w[t]??E);let n=s+t+1;if(c.setVec(n,J),l!=null&&(l.set(n,E),m(q,J)),u&&u.set(n,y?.length===1?y[0]:y?.[t]??0),d&&d.set(n,b?.length===1?b[0]:b?.[t]??1),f&&f.set(n,x?.length===1?x[0]:x?.[t]??0),p){if(S!=null){let e=Math.min(t*4,S.length-4);p.setValues(n,S[e],S[e+1],S[e+2],S[e+3])}else p.setValues(n,1,1,1,1)}v&&v.set(n,C?.length===1?C[0]:C?.[t]??0)}if(_!=null&&T!=null){N(T.size===4);let e=T.data;for(let t=0;t<i;++t){let n=t*4,r=s+t+1;_.set(r,0,e[n]),_.set(r,1,e[n+1]),_.set(r,2,e[n+2]),_.set(r,3,e[n+3])}}if(a){let e=s,t=s+1,n=s+2,r=s+i,a=r+1,u=r+2;if(o.copyItem(r,e),o.copyItem(t,a),o.copyItem(n,u),l!=null){c.getVec(r,q),c.getVec(t,J);let e=w?.[i]??E+g(q,J);l.set(a,e)}}else{let e=s,t=s+1,n=s+i,r=n+1;o.copyItem(t,e),o.copyItem(n,r)}let D=t.get(`olidColor`);le()&&D!=null&&h!=null&&Se(D,4,h,s)}_writeVertexBuffer(e,t,n){let{buffer:r,offset:i}=t,a=e.get(`position`),o=a.indices,s=a.data.length/3,c=this._isClosed(e),l=s+(c?3:2);o&&o.length!==2*(s-1)&&console.warn(`RibbonLineMaterial does not support indices`);let u=r.getField(`ribbonLineVertexInfo`,ie);N(u!=null,`Missing ribbon vertex information field`),N(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let d=n.from;N(n.numElements===l,`Expected number of elements in TextureBuffer to equal number of points`);let f=u.typedBuffer,p=i+1,m=(e,t,n,r=!1)=>{f[p++]=pe(d+n+1,t,e,r)},h=0,g=0;c?(h=0,g=s):(m(1,-3,0),m(1,3,0),h=1,g=s-1);let _=this._isAssumedMetalDriver;for(let e=h;e<g;e++){m(0,-1,e),m(0,1,e),_&&(m(0,-1,e,!0),m(0,1,e,!0));let t=this.numJoinSubdivisions;for(let n=0;n<t;++n){let r=(n+1)/(t+1);m(r,-1,e,_),m(r,1,e,_)}m(1,-2,e,_),m(1,2,e,_),_&&(m(1,-2,e),m(1,2,e))}c?(m(0,-1,g),m(0,1,g)):(m(0,-4,g),m(0,4,g)),f[i]=f[i+1],f[p]=f[p-1],p++,this._parameters.wireframe&&this._addWireframeVertices(f,i,p)}_getTransformedPosition(e,t,n,r){let i=n*3;l(e,t[i+0],t[i+1],t[i+2]),r&&v(e,e,r)}_addWireframeVertices(e,t,n){let r=n;for(let i=t;i<=n-4;i+=2)e[r++]=e[i],e[r++]=e[i+2],e[r++]=e[i+1],e[r++]=e[i+2],e[r++]=e[i+1],e[r++]=e[i+3]}}function P(e,t){return e.isClosed?t.get(`position`).indices.length>2:!1}function F(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*Fe(e,t,n,r,i){let a=r.get(`position`).data,c=P(n,r)?a.length-2:a.length-5,l=i?.[0]??0,u=i?.[1]??0;s(e,a[0]+l,a[1]+u);for(let n=3;n<c+3;n+=3){let r=n%a.length;s(t,a[r]+l,a[r+1]+u),yield n/3,o(e,t)}}function Ie(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}function Le(e,t){let n=+!!t;switch(e){case`miter`:case`bevel`:return n;case`round`:return Te+n}}const Re=new ve,I=b(),L=b(),R=c(),z=c(),B=b(),ze=b(),V=b(),H=b(),U=b(),W=b(),G=n(),K=n(),Be=r(),Ve=r(),He=b(),Ue=b(),We=b(),Ge=D(),Ke=D(),q=b(),J=b(),Y=[n(),n(),n(),n()],X=[b(),b(),b(),b()],Z=A(),qe=A(),Je=A(),Q=A(),$=4,Ye={getDrapedRibbonLineMaxDistance:F},Xe=[b(),b()];export{Ne as Parameters,je as RibbonLineMaterial,Ye as test};
|
|
2
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as i,Seconds as a}from"../../../../core/time.js";import{copy as o,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as l,subtract as u,dot as d,scale as f,add as p,copy as m,length as h,distance as g,lerp as _,transformMat4 as v,normalize as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as S,distance2 as C,closestLineSegmentPoint as w,projectPoint as T,projectPointFraction as E,create as D}from"../../../../geometry/support/lineSegment.js";import{fromPoints as O,signedDistance as k,getNormal as ee,create as A}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as te,BufferViewFloat as j,BufferViewVec4Unorm8 as ne,BufferViewVec4f16 as re,BufferViewUint32 as ie}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as ae,isColor as M,isDepth as oe,isColorHighlightOLIDOrDepth as se,is2DGeometryOutput as ce}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as le}from"../effects/geometry/olidUtils.js";import ue from"../lib/GLMaterial.js";import{LineMaterial as de}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as fe,encodeRibbonLineVertexInfo as pe}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as me,screenPolygonIntersectsBufferedSegment as he}from"../lib/screenPolygonOverlapUtils.js";import{Hit as ge,DrapedHit as _e}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as ve}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as ye,assert as N}from"../lib/Util.js";import{isImagePattern as be}from"./lineStippleUtils.js";import{VisualVariablePassParameters as xe}from"./VisualVariablePassParameters.js";import{writeColor as Se}from"./internal/bufferWriterUtils.js";import{intersectRayWithWorldSizedLineSegment as Ce,intersectScreenPolygonWithWorldSizedLineSegment as we}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{n as Te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as Ee,getTextureBufferLayout as De}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Oe}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ke}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as Ae}from"../../../../webscene/support/AlphaCutoff.js";class je extends de{constructor(e,t){super(e,Ne),this.produces=new Map([[2,e=>ae(e)||M(e)&&this.parameters.renderOccluded===8],[3,e=>oe(e)],[10,e=>se(e)&&this.parameters.renderOccluded===8],[11,e=>se(e)&&this.parameters.renderOccluded===8],[4,e=>M(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>M(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>ce(e)]]),this._configuration=new ke(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=Le(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Ie(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=Ae||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>Ae}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},n,r,i,a,o,s){if(!n.options.selectionMode)return;let c=this._getLineSize(e,!0),l=r[0],u=r[1],d=F(c,o,s,this.parameters.usesWorldSizedWidth()),f=Number.MAX_VALUE,p=0;for(let n of Fe(R,z,this.parameters,e)){let e=l-R[0],r=u-R[1],i=z[0]-R[0],a=z[1]-R[1],o=i*e+a*r,s=i*i+a*a,c=t(o/s,0,1),d=i*c-e,m=a*c-r,h=d*d+m*m;h<f&&(f=h,p=n)}f<d*d&&i(a.distance,a.renderDistance,a.normal,p)}intersectRay(t,n,r,i,a,o){let{options:s,camera:c}=r;if(!s.selectionMode||!t.visible||!c)return;if(!ye(n)){e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let l=this._getLineSize(t.attributes);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(t,n,r,l,o):this._intersectRayWithScreenSizedLine(t,n,r,l,o)}_intersectRayWithScreenSizedLine(e,t,n,r,i){let{camera:a}=n,s=e.attributes,c=s.get(`position`).data,_=W;o(_,n.point);let v=r*a.pixelRatio,y=$*a.pixelRatio,b=v/2+y;l(Y[0],_[0]-b,_[1]+b,0),l(Y[1],_[0]+b,_[1]+b,0),l(Y[2],_[0]+b,_[1]-b,0),l(Y[3],_[0]-b,_[1]-b,0);for(let e=0;e<4;e++)if(!a.unprojectFromRenderScreen(Y[e],X[e]))return;O(a.eye,X[0],X[1],Z),O(a.eye,X[1],X[2],qe),O(a.eye,X[2],X[3],Je),O(a.eye,X[3],X[0],Q);let x=Number.MAX_VALUE,T=0;for(let e of this._forEachTransformedLineSegment(I,L,c,t,P(this.parameters,s))){if(k(Z,I)<0&&k(Z,L)<0||k(qe,I)<0&&k(qe,L)<0||k(Je,I)<0&&k(Je,L)<0||k(Q,I)<0&&k(Q,L)<0)continue;let t=a.projectToRenderScreen(I,G),n=a.projectToRenderScreen(L,K);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){u(H,I,L);let e=a.frustum,n=-k(e[4],I)/d(H,ee(e[4]));if(f(H,H,n),p(I,I,H),!a.projectToRenderScreen(I,t))continue}else if(t[2]>0&&n[2]<0){u(H,L,I);let e=a.frustum,t=-k(e[4],L)/d(H,ee(e[4]));if(f(H,H,t),p(L,L,H),!a.projectToRenderScreen(L,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let i=S(t,n,Ge),o=C(i,_);if(!(o>=x)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(i,I,L,_,a,r,y);if(o>=e*e)continue}x=o,m(He,I),m(Ue,L),T=e}}if(x<b*b){let{rayBegin:e,rayEnd:t}=n,r=Number.MAX_VALUE;if(w(S(He,Ue,Ge),S(e,t,Ke),U)){u(U,U,e);let n=h(U);f(U,U,1/n),r=n/g(e,t)}i(r,r,U,T)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,c=e.attributes,l=c.get(`position`).data,u=r/(2*s),d=1/0,f=0;for(let e of this._forEachTransformedLineSegment(I,L,l,t,P(this.parameters,c))){let t=Ce(I,L,u,a,o,We);if(t!=null&&t<d&&(d=t,f=e,m(U,We),t===0))break}d<1/0&&i(d,d,U,f)}intersectScreenPolygon(t,n,r,i){let{options:a}=r;if(!a.selectionMode||!t.visible)return null;if(!ye(n))return e.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let o=this._getLineSize(t.attributes);return this.parameters.worldSized?this._intersectWorldSizedPolygon(t,n,r,i,o):this._intersectScreenSizedPolygon(t,n,r,i,o)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=e.attributes,c=s.get(`position`).data,l=$,u=l*a.pixelRatio,d=new ge(4);for(let e of this._forEachTransformedLineSegment(I,L,c,t,P(this.parameters,s)))for(let[t,n]of o.processLineSegment(Xe,I,L)){if(!me(a,t,n,G,K))continue;let o=S(G,K,Ge),s=i/2+l;this.parameters.screenSizePerspective&&(_(W,G,K,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,W,a,i,u)/a.pixelRatio)),a.renderToScreen(G,Be),a.renderToScreen(K,Ve),he(r,Be,Ve,s)&&(T(S(t,n,Ke),a.eye,B),d.updateIfCloserFromValues(g(a.eye,B),e,B,null))}return d}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,{attributes:c}=e,l=c.get(`position`).data,u=i/(2*s),d=new ge(4);for(let e of this._forEachTransformedLineSegment(I,L,l,t,P(this.parameters,c)))for(let[t,n]of o.processLineSegment(Xe,I,L)){T(S(t,n,Ke),a.eye,B);let i=g(a.eye,B);d.valid&&i>=d.distance||we(t,n,u,a,r)&&d.updateIfCloserFromValues(i,e,B,null)}return d}intersectScreenPolygonDraped({attributes:e},t,n,r,i,a){if(!n.options.selectionMode)return null;let o=F(this._getLineSize(e,!0),i,a,this.parameters.usesWorldSizedWidth());for(let n of Fe(R,z,this.parameters,e,t))if(he(r,R,z,o))return new _e(n);return null}createBufferWriter(){return new Pe(Ee(this.parameters),De(this.parameters),this.parameters)}createGLMaterial(e){return new Me(e)}validateParameters(e){N(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:i(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=E(e,r);_(B,t,n,s),v(ze,B,i.viewMatrix);let c=h(ze),l=this.computeCameraAbsCosAngle(B,i,this._configuration.spherical);return Re.update(l,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Re.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?y(U,e):l(U,0,0,1),u(V,e,t.eye),y(V,V),Math.abs(d(U,V))}_getLineSize(e,n=!1){let r=this.parameters.width;if(this.parameters.vvSize){let i=e.get(`sizeFeatureAttribute`).data[0];Number.isNaN(i)?n&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else this.parameters.hasVertexSize&&e.has(`size`)&&(r*=e.get(`size`).data[0]);return r}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.length-2:n.length-5;for(let i=0;i<a;i+=3){e[0]=n[i]+r[12],e[1]=n[i+1]+r[13],e[2]=n[i+2]+r[14];let a=(i+3)%n.length;t[0]=n[a]+r[12],t[1]=n[a+1]+r[13],t[2]=n[a+2]+r[14],yield i/3}}}class Me extends ue{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Oe,e)}}class Ne extends xe{constructor(){super(...arguments),this._width=0,this.color=x,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return be(this.stipplePattern)&&this.stippleTexture!=null}}class Pe{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.maxTextureBufferItemIndex=fe.getField(0).max,this.numJoinSubdivisions=Le(this._parameters.join,this._parameters.stipplePattern!=null)}_isClosed(e){return P(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get(`position`).data.length/3+(this._isClosed(e)?3:2)}elementCount(e){let t=e.get(`position`).indices.length/2+1,n=this._isClosed(e),r=n?2:4,i=+!n,a=n?t:t-1,o=this.numJoinSubdivisions*2+4;return r+=(a-i)*o,r+=2,this._parameters.wireframe&&(r=2+(r-2)*4),r}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=t.get(`position`),i=r.data.length/3,a=this._isClosed(t),{buffer:o,offset:s}=n,c=o.getField(`position`,te),l=o.getField(`u0`,j),u=o.getField(`sizeFeatureAttribute`,j),d=o.getField(`size`,j),f=o.getField(`colorFeatureAttribute`,j),p=o.getField(`color`,ne),h=o.getField(`olidColor`,ne),_=o.getField(`timeStamps`,re),v=o.getField(`opacityFeatureAttribute`,j),y=t.get(`sizeFeatureAttribute`)?.data,b=t.get(`size`)?.data,x=t.get(`colorFeatureAttribute`)?.data,S=t.get(`color`)?.data,C=t.get(`opacityFeatureAttribute`)?.data,w=t.get(`distanceToStart`)?.data,T=t.get(`timeStamps`);N(c!==null,`Expected valid position field in texture buffer`);let E=0;for(let t=0;t<i;++t){this._getTransformedPosition(J,r.data,t,e),l!=null&&t>0&&(w==null?E+=g(q,J):E=w[t]??E);let n=s+t+1;if(c.setVec(n,J),l!=null&&(l.set(n,E),m(q,J)),u&&u.set(n,y?.length===1?y[0]:y?.[t]??0),d&&d.set(n,b?.length===1?b[0]:b?.[t]??1),f&&f.set(n,x?.length===1?x[0]:x?.[t]??0),p){if(S!=null){let e=Math.min(t*4,S.length-4);p.setValues(n,S[e],S[e+1],S[e+2],S[e+3])}else p.setValues(n,1,1,1,1)}v&&v.set(n,C?.length===1?C[0]:C?.[t]??0)}if(_!=null&&T!=null){N(T.size===4);let e=T.data;for(let t=0;t<i;++t){let n=t*4,r=s+t+1;_.set(r,0,e[n]),_.set(r,1,e[n+1]),_.set(r,2,e[n+2]),_.set(r,3,e[n+3])}}if(a){let e=s,t=s+1,n=s+2,r=s+i,a=r+1,u=r+2;if(o.copyItem(r,e),o.copyItem(t,a),o.copyItem(n,u),l!=null){c.getVec(r,q),c.getVec(t,J);let e=w?.[i]??E+g(q,J);l.set(a,e)}}else{let e=s,t=s+1,n=s+i,r=n+1;o.copyItem(t,e),o.copyItem(n,r)}let D=t.get(`olidColor`);le()&&D!=null&&h!=null&&Se(D,4,h,s)}_writeVertexBuffer(e,t,n){let{buffer:r,offset:i}=t,a=e.get(`position`),o=a.indices,s=a.data.length/3,c=this._isClosed(e),l=s+(c?3:2);o&&o.length!==2*(s-1)&&console.warn(`RibbonLineMaterial does not support indices`);let u=r.getField(`ribbonLineVertexInfo`,ie);N(u!=null,`Missing ribbon vertex information field`),N(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let d=n.from;N(n.numElements===l,`Expected number of elements in TextureBuffer to equal number of points`);let f=u.typedBuffer,p=i+1,m=(e,t,n)=>{f[p++]=pe(d+n+1,t,e)},h=0,g=0;c?(h=0,g=s):(m(1,7,0),m(1,5,0),h=1,g=s-1);for(let e=h;e<g;e++){m(0,2,e),m(0,0,e);let t=this.numJoinSubdivisions;for(let n=0;n<t;++n){let r=(n+1)/(t+1);m(r,2,e),m(r,0,e)}m(1,6,e),m(1,4,e)}c?(m(0,2,g),m(0,0,g)):(m(0,3,g),m(0,1,g)),f[i]=f[i+1],f[p]=f[p-1],p++,this._parameters.wireframe&&this._addWireframeVertices(f,i,p)}_getTransformedPosition(e,t,n,r){let i=n*3;l(e,t[i+0],t[i+1],t[i+2]),r&&v(e,e,r)}_addWireframeVertices(e,t,n){let r=n;for(let i=t;i<=n-4;i+=2)e[r++]=e[i],e[r++]=e[i+2],e[r++]=e[i+1],e[r++]=e[i+2],e[r++]=e[i+1],e[r++]=e[i+3]}}function P(e,t){return e.isClosed?t.get(`position`).indices.length>2:!1}function F(e,t,n,r){return r?e/(2*n)+$*t:(e/2+$)*t}function*Fe(e,t,n,r,i){let a=r.get(`position`).data,c=P(n,r)?a.length-2:a.length-5,l=i?.[0]??0,u=i?.[1]??0;s(e,a[0]+l,a[1]+u);for(let n=3;n<c+3;n+=3){let r=n%a.length;s(t,a[r]+l,a[r+1]+u),yield n/3,o(e,t)}}function Ie(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}function Le(e,t){let n=+!!t;switch(e){case`miter`:case`bevel`:return n;case`round`:return Te+n}}const Re=new ve,I=b(),L=b(),R=c(),z=c(),B=b(),ze=b(),V=b(),H=b(),U=b(),W=b(),G=n(),K=n(),Be=r(),Ve=r(),He=b(),Ue=b(),We=b(),Ge=D(),Ke=D(),q=b(),J=b(),Y=[n(),n(),n(),n()],X=[b(),b(),b(),b()],Z=A(),qe=A(),Je=A(),Q=A(),$=4,Ye={getDrapedRibbonLineMaxDistance:F},Xe=[b(),b()];export{Ne as Parameters,je as RibbonLineMaterial,Ye as test};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{is3DGeometry as
|
|
2
|
+
import"../../../../core/has.js";import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewVec3f as i}from"../../../../geometry/support/buffer/BufferView.js";import{is3DGeometry as a,isColor as o,isNormals as s}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as c}from"../effects/geometry/olidUtils.js";import{createPositionReader as l}from"../lib/PositionReader.js";import{PositionUvf32OlidLayout as u,PositionUvf32Layout as d}from"./DefaultLayouts.js";import{TriangleMaterialParameters as f,TriangleMaterial as p}from"./TriangleMaterial.js";import{WaterGLMaterial as m}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as h}from"./WaterTechniqueConfiguration.js";import{hasShadowHighlights as g}from"../shaders/ReceiveShadowsConfiguration.js";class _ extends p{constructor(e,t){super(e,v),this.visible=!0,this.produces=new Map([[2,e=>a(e)&&!this.transparent],[4,e=>a(e)&&this.transparent],[18,e=>this.parameters.draped&&a(e)],[19,e=>e===4]]),this._configuration=new h(t.spherical)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.receiveShadows=o(e.output)&&e.shadowMap.enabled,this._configuration.hasShadowHighlights=g(this._configuration,e),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.screenSpaceReflections=e.hasScreenSpaceReflections,this._configuration.cloudReflections=e.clouds.data!=null,this._configuration.draped=this.parameters.draped,this._configuration.drapedNormals=s(e.output)&&e.slot===19}update(t){return this.setParameters({timeElapsed:e(t.time)*this.parameters.animationSpeed},!1),this._animationEnabled(t.camera)&&t.dt>0}_animationEnabled(e){let t=Math.min(e.relativeElevation,e.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*t<y}get transparent(){return this.parameters.transparent}createGLMaterial(e){return new m(e)}createBufferWriter(){return new x}createPrimitivePositionReader(e){let t=e.vertex.getField(`position`,i);return l(t.typedBuffer,e.index,t.typedBufferStride)}get test(){}}class v extends f{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=t(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=r(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=n(),this.modelTransformation=null}}const y=35e3;function b(){return c()?u:d}class x{constructor(){this.layout=b()}elementCount(){throw Error(`WaterMaterial only supports BufferGeometry`)}write(){throw Error(`WaterMaterial only supports BufferGeometry`)}rebaseBuffers(e,t){t?.buffer.copyFrom(e.vertex,0,t.offset)}}export{v as Parameters,_ as WaterMaterial,b as getWaterLayout};
|
package/views/SceneView.js
CHANGED
|
@@ -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"../Camera.js";import n from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as i}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{destroyHandle as s,makeHandle as c}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{mapCollectionAsync as ee}from"../core/mapCollectionUtils.js";import{destroyMaybe as u,maybeProperty as te}from"../core/maybe.js";import{throwIfDestroyed as ne,throwIfAborted as d,createAbortError as re}from"../core/promiseUtils.js";import ie from"../core/ReactiveSet.js";import{on as f,watch as p,initial as m,sync as h,whenOnce as ae,syncAndInitial as g}from"../core/reactiveUtils.js";import{setFrameDuration as oe,cleanupScheduling as se}from"../core/scheduling.js";import{createScreenPoint as ce,createScreenPointArray as le}from"../core/screenUtils.js";import{cleanupWhereClauseCache as ue}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as de,getMetersPerUnitForSR as fe}from"../core/units.js";import{property as _,cast as v,subclass as pe}from"../core/accessorSupport/decorators.js";import{ensureType as y,ensureClass as b}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as me}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as he}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ge}from"../core/accessorSupport/trackingUtils.js";import{create as _e}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ve}from"../core/libs/rbush/PooledRBush.js";import{initialize as ye}from"../core/workers/workers.js";import x from"../geometry/Extent.js";import be from"../geometry/HeightModelInfo.js";import S from"../geometry/Point.js";import{project as C,canProjectWithoutEngine as xe}from"../geometry/projectionUtils.js";import w from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Se}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Ce}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as T}from"../geometry/projection/projectPointToVector.js";import{toExtent as we,create as Te}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Ee}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as De}from"../geometry/support/scaleUtils.js";import{wgs84 as Oe,webMercator as ke}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as Ae}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as E,isTiledLayer as D,isVoxelLayer as O,isIntegratedMeshLayer as k,isGaussianSplatLayer as je}from"../layers/support/layerUtils.js";import{TilemapCache as Me}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Ne}from"../portal/portalDefault.js";import{WebSceneTag as Pe}from"../support/tagSymbols.js";import{BreakpointsOwner as Fe}from"./BreakpointsOwner.js";import{DOMContainer as Ie}from"./DOMContainer.js";import{PopupView as Le}from"./PopupView.js";import A from"./View.js";import Re from"./ViewAnimation.js";import{stringFromViewingMode as j,viewingModeFromString as M}from"./ViewingMode.js";import{GroundView3D as ze}from"./3d/GroundView3D.js";import{layerView3DImporter as N}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as Be}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Ve}from"./3d/camera/intersectionUtils.js";import P from"./3d/constraints/Constraints.js";import F from"./3d/environment/Environment.js";import{EnvironmentView as He}from"./3d/environment/EnvironmentView.js";import Ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as We}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ge}from"./3d/layers/graphics/Labeler.js";import Ke from"./3d/layers/i3s/I3SLodHandling.js";import{Navigation3D as qe}from"./3d/navigation/Navigation3D.js";import{ScreenSizePerspective as Je}from"./3d/state/ScreenSizePerspective.js";import I from"./3d/state/ViewState.js";import{ViewStateManager as Ye,cleanupViewStateManager as Xe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ze}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Qe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as $e}from"./3d/state/utils/navigationUtils.js";import et from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as tt}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as L}from"./3d/support/debugFlags.js";import{getElevationAtPoint as nt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as rt}from"./3d/support/GroundAndIMSurface.js";import{toMap as it,hitTest as at}from"./3d/support/hitTest.js";import{popupHitTest as ot}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as st,getQualityProfileSettings as R}from"./3d/support/QualityProfile.js";import z from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as ct}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as lt}from"./3d/support/ResourceController.js";import ut from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as dt}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ft}from"./3d/support/ViewSlice.js";import{PointsOfInterest as B}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import V from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as pt,getTiledLayerInfo as mt,checkIfTileInfoSupportedForView as ht}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as gt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as _t}from"./3d/terrain/TileRenderer.js";import{Stage as vt}from"./3d/webgl-engine/Stage.js";import{olidEnabled as yt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as bt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{defaultTolerance as H}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as U}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as St}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import W from"./interactive/options/ViewOptions.js";import Ct from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as wt}from"./support/drapedUtils.js";import{occludeesSupported as Tt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as G,createScreenPointFromSupportedEvent as K}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Et}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Dt,destroyTextureCompressionWorker as Ot}from"./support/TextureCompressionHelper.js";import kt from"./ui/DefaultUI.js";import At from"./ui/3d/DefaultUI3D.js";import jt from"../webscene/Environment.js";import{clearVNodeCache as Mt}from"../widgets/support/vnodeCache.js";var q;const Nt=Symbol(),J=Symbol();function Pt(e){let t=b(W,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let Y=class extends Fe(Le(Ie(A))){static{q=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new W({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=lt(this),this.deconflictor=new We({view:this}),this.attribution3D=new et({view:this}),this.labeler=new Ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new qe({view:this}),this.basemapTerrain=null,this.elevationProvider=new tt({view:this}),this._canvas=null,this.constraints=new P,this._environment=new F,this.environmentView=new He,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Ct({importAnalysisViewModule:e=>Be(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ie,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new I({view:this}),this.slice=new ft,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new At,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ye();let t=()=>this._updatingChanged();this.addHandles(s(ee(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([f(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),p(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ue({view:this}),this.stateManager=new Ye({view:this}),this.screenSizePerspective=new Je({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=Dt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ze({view:this}),this.groundAndIMSurface=new rt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>oe(e>0?1e3/Math.ceil(e):0),m),this.addHandles([p(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),p(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(Ot(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,u(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=u(this.sharedSymbolResources),this._set(`labeler`,u(this.labeler)),this._set(`deconflictor`,u(this.deconflictor)),this._resourceController=u(this._resourceController),this._set(`stateManager`,u(this.stateManager)),this._set(`inputManager`,u(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,u(this.environmentView)),this._set(`environment`,u(this.environment)),this.groundView=u(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=y(S,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||te(e,`clippingArea`);return!(this._userClippingArea||te(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof x?this.spatialReference&&(t=X(t,this.spatialReference),t==null)?(l.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?l.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===1)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:X(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||w.WGS84,n=X(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||w.WGS84,t,n=n=>{let r=X(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new x({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent==null||e.type===`graphics`&&e.internal||n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof F?e:e instanceof jt?this.environment?.cloneWithWebsceneEnvironment(e)??F.fromWebsceneEnvironment(e):y(F,e):new F}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return q._layerToLayerview}static{this._layerToLayerview=A._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=R(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new z(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||st()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?he(()=>De(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=de(this.spatialReference);if(t&&e.heightUnit!==t)return new be({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||pt(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return L.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this.groundView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return L.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedViewingMode;if(e!=null)return j(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?j(this.defaultsFromMap.viewingMode):Et(t,1)?`global`:`local`:`global`}set viewingMode(e){this.ready?l.getLogger(this).error(`#viewingMode`,`viewingMode cannot be set once view is ready`):this._overrideIfSome(`viewingMode`,e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ut(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return it(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=Ft,t.x=e.x,t.y=e.y,t.z=nt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),T(t,Z,this.renderSpatialReference),this.state.camera.projectToScreen(Z,Q),ce(Q[0],Q[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;T(e,Z,n);let r=this.state.camera.computeScreenPixelSizeAt(Z);return t&&n!==t?r*fe(n)/fe(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return at(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return ot(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new a(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!yt())throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),o=await this._completeSettings(e);return o.format=`png`,[i,t(r[1],o,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return N.importLayerView(e)}hasLayerViewModule(e){return N.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedViewingMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:M(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n?r(n):[...r(1)??[],...r(2)??[]];return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return Et(e,n)?t==null||E(t)?!0:!(D(t)&&mt(t,e,n)==null||O(t)&&n===1):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,viewingMode:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?w.WGS84:w.WebMercator:new w({...i?Oe:ke,vcsWkid:o,latestVcsWkid:s});return E(t)&&(i||a)?!(a&&r!==2)||ht(t.tileInfo,t.fullExtent,e,1)===null?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:[{spatialReference:c(),viewingMode:n}]:!D(t)&&!O(t)&&(i||a)?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:D(t)&&i&&n!==1?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:2}]:[{spatialReference:e,viewingMode:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedViewingMode;return t||(n==null?e.isGeographic&&l.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${j(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&Tt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await ae(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),c(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await It[e]();if(t&&(ne(this),d(n.signal),await t(n.signal)),this.destroyed)throw re();return d(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new V({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new B({view:this})),this.addHandles([this.updatingHandles.add(()=>L.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&L.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=u(this._featureTreeDebugger))},g),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?C(we(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},g),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=u(this._featureTiles)},h)],Nt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(J),this.removeHandles(Nt),this._featureTiles=u(this.featureTiles),this._set(`pointsOfInterest`,u(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=Ee(t,e);n!==this.renderSpatialReference&&(this._set(`renderCoordsHelper`,ct.create(this.state.viewingMode,n)),t||this.addHandles(p(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&Ce(e,this.groundView.spatialReference,$,t)&&(this.renderCoordsHelper.extent=$)},h),J),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters))}else this._set(`renderCoordsHelper`,null)}_exitCoordinateSystem(){this.removeHandles(J),this._set(`renderCoordsHelper`,null)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(p(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),h),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(){let e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},t=new Qe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,t);let n=i(this.surface);this._stage=new vt({view:this,options:e,container:n}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),o(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new a(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=u(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new dt({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>ae(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=u(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){M(this.viewingMode)===1&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(f(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?me(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(U);for(let t of this.allLayerViews)(k(t.layer)&&(!has(`enable-feature:im-as-ground`)||t.layer.isUsedAsGroundLayer)||je(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(U);for(let t of this.allLayerViews)(has(`enable-feature:im-as-ground`)?k(t.layer)&&t.layer.isUsedAsGroundLayer:k(t.layer))&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Mt(),ge(),ue(),St(),Xe(),Ve(),Se(),wt(),Ne(),_t(),xt(),Ze(),$e(),ve(),se(),bt(),gt(),Ke.cleanupI3SLodHandling(),Me.cleanupTilemapCache(),I.cleanupViewstate(),V.cleanupTerrainSurface()}};e([_({nonNullable:!0}),v(Pt)],Y.prototype,`options`,void 0),e([_()],Y.prototype,`_userClippingArea`,void 0),e([_()],Y.prototype,`_resourceController`,void 0),e([_()],Y.prototype,`stage`,null),e([_({readOnly:!0})],Y.prototype,`deconflictor`,void 0),e([_({readOnly:!0})],Y.prototype,`labeler`,void 0),e([_()],Y.prototype,`navigation`,void 0),e([_({type:Re,readOnly:!0})],Y.prototype,`animation`,null),e([_({readOnly:!0})],Y.prototype,`basemapTerrain`,void 0),e([_({readOnly:!0})],Y.prototype,`overlayManager`,null),e([_({readOnly:!0})],Y.prototype,`elevationProvider`,void 0),e([_()],Y.prototype,`camera`,null),e([_({type:t})],Y.prototype,`contentCamera`,null),e([_({readOnly:!0})],Y.prototype,`canvas`,null),e([_({type:S,useTypeForAutocast:!1})],Y.prototype,`center`,null),e([_({type:x})],Y.prototype,`clippingArea`,null),e([_({type:P,nonNullable:!0})],Y.prototype,`constraints`,void 0),e([_({type:x,readOnly:!0})],Y.prototype,`renderDataExtent`,null),e([_({readOnly:!0})],Y.prototype,`tileInfo`,null),e([_({type:x,readOnly:!0})],Y.prototype,`dataExtent`,null),e([_({type:x,readOnly:!0})],Y.prototype,`_groundAndLayersExtent`,null),e([_({type:F})],Y.prototype,`environment`,null),e([v(`environment`)],Y.prototype,`castEnvironment`,null),e([_({readOnly:!0})],Y.prototype,`environmentView`,void 0),e([_({type:x})],Y.prototype,`extent`,null),e([_({type:r})],Y.prototype,`floors`,void 0),e([_()],Y.prototype,`screenCenter`,null),e([_()],Y.prototype,`frustum`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`fullOpacity`,void 0),e([_({readOnly:!0})],Y.prototype,`graphicsView`,void 0),e([_()],Y.prototype,`analysisViewManager`,void 0),e([_()],Y.prototype,`groundView`,void 0),e([_({readOnly:!0})],Y.prototype,`layerviewCollections`,null),e([_({type:Boolean})],Y.prototype,`initialExtentRequired`,null),e([_()],Y.prototype,`defaultsFromMapSettings`,null),e([_()],Y.prototype,`interacting`,null),e([_()],Y.prototype,`stationary`,null),e([_()],Y.prototype,`navigating`,null),e([_()],Y.prototype,`map`,void 0),e([_()],Y.prototype,`padding`,null),e([_({type:B,readOnly:!0})],Y.prototype,`pointsOfInterest`,void 0),e([_()],Y.prototype,`_featureTiles`,void 0),e([_()],Y.prototype,`featureTiles`,null),e([_()],Y.prototype,`_featureTreeDebugger`,void 0),e([_({constructOnly:!0})],Y.prototype,`deactivatedWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`debugWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`renderCanvas`,void 0),e([_({constructOnly:!0})],Y.prototype,`state`,void 0),e([_()],Y.prototype,`screenSizePerspective`,void 0),e([_({readOnly:!0})],Y.prototype,`inputManager`,void 0),e([_({readOnly:!0})],Y.prototype,`stateManager`,void 0),e([_({type:[`low`,`medium`,`high`]})],Y.prototype,`qualityProfile`,null),e([_({type:z,get(){let e=this._get(`qualitySettings`);if(!e){let t=R(this.qualityProfile);e=new z(t)}return e}})],Y.prototype,`qualitySettings`,void 0),e([_()],Y.prototype,`slice`,void 0),e([_({readOnly:!0})],Y.prototype,`typeSpecificPreconditionsReady`,null),e([_({readOnly:!0})],Y.prototype,`renderCoordsHelper`,void 0),e([_({readOnly:!0})],Y.prototype,`sceneIntersectionHelper`,void 0),e([_({type:Number,readOnly:!0})],Y.prototype,`resolution`,null),e([_({type:Number})],Y.prototype,`scale`,null),e([_({readOnly:!0,type:Number})],Y.prototype,`terrainLevel`,null),e([_()],Y.prototype,`heightModelInfo`,null),e([_({type:w})],Y.prototype,`spatialReference`,void 0),e([_({type:Boolean,value:!1})],Y.prototype,`alphaCompositingEnabled`,null),e([_({constructOnly:!0})],Y.prototype,`preserveDrawingBufferEnabled`,void 0),e([_({type:Boolean})],Y.prototype,`supersampleScreenshotsEnabled`,void 0),e([_({readOnly:!0})],Y.prototype,`type`,void 0),e([_(),v(e=>e instanceof kt?e:b(At,e))],Y.prototype,`ui`,void 0),e([_({type:Boolean,readOnly:!0})],Y.prototype,`updating`,null),e([_()],Y.prototype,`_updatingObjects`,null),e([_()],Y.prototype,`_updatingObjectsWithProgress`,null),e([_()],Y.prototype,`_updatingObjectsToDebug`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`updatingProgress`,void 0),e([_({type:[`global`,`local`]})],Y.prototype,`viewingMode`,null),e([_({type:n})],Y.prototype,`viewpoint`,null),e([_({readOnly:!0})],Y.prototype,`visibleArea`,null),e([_({type:Number})],Y.prototype,`zoom`,null),e([_({readOnly:!0})],Y.prototype,`quality`,null),e([_({readOnly:!0})],Y.prototype,`resolutionScale`,null),e([_()],Y.prototype,`focusAreasView`,void 0),e([_()],Y.prototype,`_defaultToMapOptions`,null),e([_()],Y.prototype,`_defaultHitTestOptions`,null),Y=q=e([pe(`esri.views.SceneView`)],Y);function X(e,t){return e!=null&&xe(e.spatialReference,t)?C(e,t):null}const Z=_e(),Q=le(),$=Te(),Ft=Ae(0,0,0,w.WebMercator),It={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Lt=Y;export{Lt as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Camera.js";import n from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as i}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{destroyHandle as s,makeHandle as c}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{mapCollectionAsync as ee}from"../core/mapCollectionUtils.js";import{destroyMaybe as u,maybeProperty as te}from"../core/maybe.js";import{throwIfDestroyed as ne,throwIfAborted as d,createAbortError as re}from"../core/promiseUtils.js";import ie from"../core/ReactiveSet.js";import{on as f,watch as p,initial as m,sync as h,whenOnce as ae,syncAndInitial as g}from"../core/reactiveUtils.js";import{setFrameDuration as oe,cleanupScheduling as se}from"../core/scheduling.js";import{createScreenPoint as ce,createScreenPointArray as le}from"../core/screenUtils.js";import{cleanupWhereClauseCache as ue}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as de,getMetersPerUnitForSR as fe}from"../core/units.js";import{property as _,cast as v,subclass as pe}from"../core/accessorSupport/decorators.js";import{ensureType as y,ensureClass as b}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as me}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as he}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ge}from"../core/accessorSupport/trackingUtils.js";import{create as _e}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ve}from"../core/libs/rbush/PooledRBush.js";import{initialize as ye}from"../core/workers/workers.js";import x from"../geometry/Extent.js";import be from"../geometry/HeightModelInfo.js";import S from"../geometry/Point.js";import{project as C,canProjectWithoutEngine as xe}from"../geometry/projectionUtils.js";import w from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Se}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Ce}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as T}from"../geometry/projection/projectPointToVector.js";import{toExtent as we,create as Te}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Ee}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as De}from"../geometry/support/scaleUtils.js";import{wgs84 as Oe,webMercator as ke}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as Ae}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as E,isTiledLayer as D,isVoxelLayer as O,isIntegratedMeshLayer as k,isGaussianSplatLayer as je}from"../layers/support/layerUtils.js";import{TilemapCache as Me}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Ne}from"../portal/portalDefault.js";import{WebSceneTag as Pe}from"../support/tagSymbols.js";import{BreakpointsOwner as Fe}from"./BreakpointsOwner.js";import{DOMContainer as Ie}from"./DOMContainer.js";import{PopupView as Le}from"./PopupView.js";import A from"./View.js";import Re from"./ViewAnimation.js";import{stringFromViewingMode as j,viewingModeFromString as M}from"./ViewingMode.js";import{GroundView3D as ze}from"./3d/GroundView3D.js";import{layerView3DImporter as N}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as Be}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Ve}from"./3d/camera/intersectionUtils.js";import P from"./3d/constraints/Constraints.js";import F from"./3d/environment/Environment.js";import{EnvironmentView as He}from"./3d/environment/EnvironmentView.js";import Ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as We}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ge}from"./3d/layers/graphics/Labeler.js";import Ke from"./3d/layers/i3s/I3SLodHandling.js";import{Navigation3D as qe}from"./3d/navigation/Navigation3D.js";import{ScreenSizePerspective as Je}from"./3d/state/ScreenSizePerspective.js";import I from"./3d/state/ViewState.js";import{ViewStateManager as Ye,cleanupViewStateManager as Xe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ze}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Qe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as $e}from"./3d/state/utils/navigationUtils.js";import et from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as tt}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as L}from"./3d/support/debugFlags.js";import{getElevationAtPoint as nt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as rt}from"./3d/support/GroundAndIMSurface.js";import{toMap as it,hitTest as at}from"./3d/support/hitTest.js";import{popupHitTest as ot}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as st,getQualityProfileSettings as R}from"./3d/support/QualityProfile.js";import z from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as ct}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as lt}from"./3d/support/ResourceController.js";import ut from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as dt}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ft}from"./3d/support/ViewSlice.js";import{PointsOfInterest as B}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import V from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as pt,getTiledLayerInfo as mt,checkIfTileInfoSupportedForView as ht}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as gt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as _t}from"./3d/terrain/TileRenderer.js";import{Stage as vt}from"./3d/webgl-engine/Stage.js";import{olidEnabled as yt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as bt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{defaultTolerance as H}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as U}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as St}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import W from"./interactive/options/ViewOptions.js";import Ct from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as wt}from"./support/drapedUtils.js";import{occludeesSupported as Tt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as G,createScreenPointFromSupportedEvent as K}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Et}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Dt,destroyTextureCompressionWorker as Ot}from"./support/TextureCompressionHelper.js";import kt from"./ui/DefaultUI.js";import At from"./ui/3d/DefaultUI3D.js";import jt from"../webscene/Environment.js";import{clearVNodeCache as Mt}from"../widgets/support/vnodeCache.js";var q;const Nt=Symbol(),J=Symbol();function Pt(e){let t=b(W,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let Y=class extends Fe(Le(Ie(A))){static{q=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new W({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=lt(this),this.deconflictor=new We({view:this}),this.attribution3D=new et({view:this}),this.labeler=new Ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new qe({view:this}),this.basemapTerrain=null,this.elevationProvider=new tt({view:this}),this._canvas=null,this.constraints=new P,this._environment=new F,this.environmentView=new He,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Ct({importAnalysisViewModule:e=>Be(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ie,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new I({view:this}),this.slice=new ft,this.renderCoordsHelper=new ct,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new At,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ye();let t=()=>this._updatingChanged();this.addHandles(s(ee(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([f(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),p(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ue({view:this}),this.stateManager=new Ye({view:this}),this.screenSizePerspective=new Je({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=Dt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ze({view:this}),this.groundAndIMSurface=new rt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},m),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>oe(e>0?1e3/Math.ceil(e):0),m),this.addHandles([p(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),p(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(Ot(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,u(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=u(this.sharedSymbolResources),this._set(`labeler`,u(this.labeler)),this._set(`deconflictor`,u(this.deconflictor)),this._resourceController=u(this._resourceController),this._set(`stateManager`,u(this.stateManager)),this._set(`inputManager`,u(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,u(this.environmentView)),this._set(`environment`,u(this.environment)),this.groundView=u(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=y(S,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||te(e,`clippingArea`);return!(this._userClippingArea||te(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof x?this.spatialReference&&(t=X(t,this.spatialReference),t==null)?(l.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?l.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===1)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:X(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||w.WGS84,n=X(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||w.WGS84,t,n=n=>{let r=X(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new x({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent==null||e.type===`graphics`&&e.internal||n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof F?e:e instanceof jt?this.environment?.cloneWithWebsceneEnvironment(e)??F.fromWebsceneEnvironment(e):y(F,e):new F}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return q._layerToLayerview}static{this._layerToLayerview=A._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=R(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new z(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||st()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?he(()=>De(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=de(this.spatialReference);if(t&&e.heightUnit!==t)return new be({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||pt(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return L.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this.groundView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return L.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedViewingMode;if(e!=null)return j(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?j(this.defaultsFromMap.viewingMode):Et(t,1)?`global`:`local`:`global`}set viewingMode(e){this.ready?l.getLogger(this).error(`#viewingMode`,`viewingMode cannot be set once view is ready`):this._overrideIfSome(`viewingMode`,e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ut(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return it(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=Ft,t.x=e.x,t.y=e.y,t.z=nt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),T(t,Z,this.renderSpatialReference),this.state.camera.projectToScreen(Z,Q),ce(Q[0],Q[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;T(e,Z,n);let r=this.state.camera.computeScreenPixelSizeAt(Z);return t&&n!==t?r*fe(n)/fe(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=G(e)?K(this,e):e;return at(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return ot(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new a(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!yt())throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),o=await this._completeSettings(e);return o.format=`png`,[i,t(r[1],o,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new a(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return N.importLayerView(e)}hasLayerViewModule(e){return N.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedViewingMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:M(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n?r(n):[...r(1)??[],...r(2)??[]];return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return Et(e,n)?t==null||E(t)?!0:!(D(t)&&mt(t,e,n)==null||O(t)&&n===1):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,viewingMode:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?w.WGS84:w.WebMercator:new w({...i?Oe:ke,vcsWkid:o,latestVcsWkid:s});return E(t)&&(i||a)?!(a&&r!==2)||ht(t.tileInfo,t.fullExtent,e,1)===null?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:[{spatialReference:c(),viewingMode:n}]:!D(t)&&!O(t)&&(i||a)?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:D(t)&&i&&n!==1?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:2}]:[{spatialReference:e,viewingMode:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedViewingMode;return t||(n==null?e.isGeographic&&l.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${j(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&Tt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),c(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await ae(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),c(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await It[e]();if(t&&(ne(this),d(n.signal),await t(n.signal)),this.destroyed)throw re();return d(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new V({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new B({view:this})),this.addHandles([this.updatingHandles.add(()=>L.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&L.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=u(this._featureTreeDebugger))},g),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?C(we(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},g),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=u(this._featureTiles)},h)],Nt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(J),this.removeHandles(Nt),this._featureTiles=u(this.featureTiles),this._set(`pointsOfInterest`,u(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=Ee(t,e);n!==this.renderSpatialReference&&(this.renderCoordsHelper.viewingMode=this.state.viewingMode,this.renderCoordsHelper.spatialReference=n,t||this.addHandles(p(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&Ce(e,this.groundView.spatialReference,$,t)&&(this.renderCoordsHelper.extent=$)},h),J),this.sceneIntersectionHelper?.setTolerance(H/this.renderCoordsHelper.unitInMeters))}}_exitCoordinateSystem(){this.removeHandles(J)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(p(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),h),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(){let e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},t=new Qe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,t);let n=i(this.surface);this._stage=new vt({view:this,options:e,container:n}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),o(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new a(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.sceneIntersectionHelper.setTolerance(H/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=u(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new dt({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>ae(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=u(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){M(this.viewingMode)===1&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(f(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?me(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(U);for(let t of this.allLayerViews)(k(t.layer)&&(!has(`enable-feature:im-as-ground`)||t.layer.isUsedAsGroundLayer)||je(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(U);for(let t of this.allLayerViews)(has(`enable-feature:im-as-ground`)?k(t.layer)&&t.layer.isUsedAsGroundLayer:k(t.layer))&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Mt(),ge(),ue(),St(),Xe(),Ve(),Se(),wt(),Ne(),_t(),xt(),Ze(),$e(),ve(),se(),bt(),gt(),Ke.cleanupI3SLodHandling(),Me.cleanupTilemapCache(),I.cleanupViewstate(),V.cleanupTerrainSurface()}};e([_({nonNullable:!0}),v(Pt)],Y.prototype,`options`,void 0),e([_()],Y.prototype,`_userClippingArea`,void 0),e([_()],Y.prototype,`_resourceController`,void 0),e([_()],Y.prototype,`stage`,null),e([_({readOnly:!0})],Y.prototype,`deconflictor`,void 0),e([_({readOnly:!0})],Y.prototype,`labeler`,void 0),e([_()],Y.prototype,`navigation`,void 0),e([_({type:Re,readOnly:!0})],Y.prototype,`animation`,null),e([_({readOnly:!0})],Y.prototype,`basemapTerrain`,void 0),e([_({readOnly:!0})],Y.prototype,`overlayManager`,null),e([_({readOnly:!0})],Y.prototype,`elevationProvider`,void 0),e([_()],Y.prototype,`camera`,null),e([_({type:t})],Y.prototype,`contentCamera`,null),e([_({readOnly:!0})],Y.prototype,`canvas`,null),e([_({type:S,useTypeForAutocast:!1})],Y.prototype,`center`,null),e([_({type:x})],Y.prototype,`clippingArea`,null),e([_({type:P,nonNullable:!0})],Y.prototype,`constraints`,void 0),e([_({type:x,readOnly:!0})],Y.prototype,`renderDataExtent`,null),e([_({readOnly:!0})],Y.prototype,`tileInfo`,null),e([_({type:x,readOnly:!0})],Y.prototype,`dataExtent`,null),e([_({type:x,readOnly:!0})],Y.prototype,`_groundAndLayersExtent`,null),e([_({type:F})],Y.prototype,`environment`,null),e([v(`environment`)],Y.prototype,`castEnvironment`,null),e([_({readOnly:!0})],Y.prototype,`environmentView`,void 0),e([_({type:x})],Y.prototype,`extent`,null),e([_({type:r})],Y.prototype,`floors`,void 0),e([_()],Y.prototype,`screenCenter`,null),e([_()],Y.prototype,`frustum`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`fullOpacity`,void 0),e([_({readOnly:!0})],Y.prototype,`graphicsView`,void 0),e([_()],Y.prototype,`analysisViewManager`,void 0),e([_()],Y.prototype,`groundView`,void 0),e([_({readOnly:!0})],Y.prototype,`layerviewCollections`,null),e([_({type:Boolean})],Y.prototype,`initialExtentRequired`,null),e([_()],Y.prototype,`defaultsFromMapSettings`,null),e([_()],Y.prototype,`interacting`,null),e([_()],Y.prototype,`stationary`,null),e([_()],Y.prototype,`navigating`,null),e([_()],Y.prototype,`map`,void 0),e([_()],Y.prototype,`padding`,null),e([_({type:B,readOnly:!0})],Y.prototype,`pointsOfInterest`,void 0),e([_()],Y.prototype,`_featureTiles`,void 0),e([_()],Y.prototype,`featureTiles`,null),e([_()],Y.prototype,`_featureTreeDebugger`,void 0),e([_({constructOnly:!0})],Y.prototype,`deactivatedWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`debugWebGLExtensions`,void 0),e([_({constructOnly:!0})],Y.prototype,`renderCanvas`,void 0),e([_({constructOnly:!0})],Y.prototype,`state`,void 0),e([_()],Y.prototype,`screenSizePerspective`,void 0),e([_({readOnly:!0})],Y.prototype,`inputManager`,void 0),e([_({readOnly:!0})],Y.prototype,`stateManager`,void 0),e([_({type:[`low`,`medium`,`high`]})],Y.prototype,`qualityProfile`,null),e([_({type:z,get(){let e=this._get(`qualitySettings`);if(!e){let t=R(this.qualityProfile);e=new z(t)}return e}})],Y.prototype,`qualitySettings`,void 0),e([_()],Y.prototype,`slice`,void 0),e([_({readOnly:!0})],Y.prototype,`typeSpecificPreconditionsReady`,null),e([_({readOnly:!0})],Y.prototype,`sceneIntersectionHelper`,void 0),e([_({type:Number,readOnly:!0})],Y.prototype,`resolution`,null),e([_({type:Number})],Y.prototype,`scale`,null),e([_({readOnly:!0,type:Number})],Y.prototype,`terrainLevel`,null),e([_()],Y.prototype,`heightModelInfo`,null),e([_({type:w})],Y.prototype,`spatialReference`,void 0),e([_({type:Boolean,value:!1})],Y.prototype,`alphaCompositingEnabled`,null),e([_({constructOnly:!0})],Y.prototype,`preserveDrawingBufferEnabled`,void 0),e([_({type:Boolean})],Y.prototype,`supersampleScreenshotsEnabled`,void 0),e([_({readOnly:!0})],Y.prototype,`type`,void 0),e([_(),v(e=>e instanceof kt?e:b(At,e))],Y.prototype,`ui`,void 0),e([_({type:Boolean,readOnly:!0})],Y.prototype,`updating`,null),e([_()],Y.prototype,`_updatingObjects`,null),e([_()],Y.prototype,`_updatingObjectsWithProgress`,null),e([_()],Y.prototype,`_updatingObjectsToDebug`,null),e([_({type:Number,readOnly:!0})],Y.prototype,`updatingProgress`,void 0),e([_({type:[`global`,`local`]})],Y.prototype,`viewingMode`,null),e([_({type:n})],Y.prototype,`viewpoint`,null),e([_({readOnly:!0})],Y.prototype,`visibleArea`,null),e([_({type:Number})],Y.prototype,`zoom`,null),e([_({readOnly:!0})],Y.prototype,`quality`,null),e([_({readOnly:!0})],Y.prototype,`resolutionScale`,null),e([_()],Y.prototype,`focusAreasView`,void 0),e([_()],Y.prototype,`_defaultToMapOptions`,null),e([_()],Y.prototype,`_defaultHitTestOptions`,null),Y=q=e([pe(`esri.views.SceneView`)],Y);function X(e,t){return e!=null&&xe(e.spatialReference,t)?C(e,t):null}const Z=_e(),Q=le(),$=Te(),Ft=Ae(0,0,0,w.WebMercator),It={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Lt=Y;export{Lt as default};
|