@arcgis/core 5.1.0-next.10 → 5.1.0-next.12
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/WebScene.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/008887a8014b61f837ae.js +1 -0
- package/assets/esri/core/workers/chunks/04f82b740325e3388d23.js +1 -0
- package/assets/esri/core/workers/chunks/09cf8aed89a1ea1f8b28.js +1 -0
- package/assets/esri/core/workers/chunks/{ff2412c5be1ad4edb458.js → 0b59e5be22139387bd84.js} +1 -1
- package/assets/esri/core/workers/chunks/0bf742d48f434c4c575f.js +1 -0
- package/assets/esri/core/workers/chunks/0c8a676599821b9871c2.js +1 -0
- package/assets/esri/core/workers/chunks/11882cbb28710e5f9fc5.js +1 -0
- package/assets/esri/core/workers/chunks/{f0e7207fd2c899b9fe9f.js → 12fd2e26e949d90abfbd.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c5e834c2d243fc369fe.js → 18b0776aef1536867ab8.js} +1 -1
- package/assets/esri/core/workers/chunks/{72ab3ed37ac4da355710.js → 1aa2187597f7c4adb67f.js} +1 -1
- package/assets/esri/core/workers/chunks/2216264b22a605a0f1ce.js +1 -0
- package/assets/esri/core/workers/chunks/22d12c309af9c19a1a48.js +1 -0
- package/assets/esri/core/workers/chunks/{aefc089928ada18bc4d4.js → 2762149a922275136171.js} +2 -2
- package/assets/esri/core/workers/chunks/27aa21da934ecaca381a.js +1 -0
- package/assets/esri/core/workers/chunks/27d60fd727e9a68973f6.js +1 -0
- package/assets/esri/core/workers/chunks/{8fbfdd154413a2140180.js → 2a3e82a230b7ee4dfd55.js} +1 -1
- package/assets/esri/core/workers/chunks/{5aab1db039b2b61c6c6b.js → 2bb7bb7901bd343201fc.js} +1 -1
- package/assets/esri/core/workers/chunks/2d1a772abd730b61854f.js +1 -0
- package/assets/esri/core/workers/chunks/{ee2ae61fc747b5f9827b.js → 2e7d4a437717606bc39c.js} +1 -1
- package/assets/esri/core/workers/chunks/{02f03297491eef26f113.js → 34207774bc371e95ba3c.js} +1 -1
- package/assets/esri/core/workers/chunks/360b3499e2a671c309ce.js +1 -0
- package/assets/esri/core/workers/chunks/3b0cfe3db8d90e02d6c6.js +1 -0
- package/assets/esri/core/workers/chunks/3d78e9b3c97c0ce21d16.js +1 -0
- package/assets/esri/core/workers/chunks/4550b7620932cd6de20e.js +1 -0
- package/assets/esri/core/workers/chunks/{f3022255054e8d09c38b.js → 455fbddd814e4681f0c0.js} +1 -1
- package/assets/esri/core/workers/chunks/{3db4938b3f89b9b8234e.js → 4742a8c19b86a5f859f0.js} +1 -1
- package/assets/esri/core/workers/chunks/58cf3d35771b87bd74e5.js +1 -0
- package/assets/esri/core/workers/chunks/{d84af069f1057044c879.js → 5c12a9b0db317620dce2.js} +1 -1
- package/assets/esri/core/workers/chunks/65ad8838911a6d71816b.js +1 -0
- package/assets/esri/core/workers/chunks/{7a85e08cb968586f8d74.js → 72acfb74fd9ab9bae923.js} +2 -2
- package/assets/esri/core/workers/chunks/79ee97609f72e4cf989c.js +1 -0
- package/assets/esri/core/workers/chunks/{fba30f2e1d6b364aae79.js → 7b1964255722e756eba3.js} +1 -1
- package/assets/esri/core/workers/chunks/7e6309bfed6692e8d2d7.js +2 -0
- package/assets/esri/core/workers/chunks/{dc65843654dc25bd8f97.js → 8177e95596b71bf020aa.js} +1 -1
- package/assets/esri/core/workers/chunks/{afffb40cce91e135f092.js → 8374658d17f69bde6b08.js} +1 -1
- package/assets/esri/core/workers/chunks/879e8439a513cb333b61.js +1 -0
- package/assets/esri/core/workers/chunks/{ca767f0e3aa559b13699.js → 90aeef17af12cfbecb36.js} +1 -1
- package/assets/esri/core/workers/chunks/{4bd98d025bcd713eddca.js → 91858b02da40ff251ab2.js} +2 -2
- package/assets/esri/core/workers/chunks/{3114cbf7298239e1269d.js → 956237a2baa30760c256.js} +1 -1
- package/assets/esri/core/workers/chunks/98c3b7d8db53f0b12642.js +1 -0
- package/assets/esri/core/workers/chunks/a027da22acdaa6d6baa3.js +1 -0
- package/assets/esri/core/workers/chunks/{c064025d0dc69bb44f0d.js → a115984b794a7f90b2c0.js} +1 -1
- package/assets/esri/core/workers/chunks/a3e8b7185d63a0f85931.js +1 -0
- package/assets/esri/core/workers/chunks/{6be2dc8331ecf944efdc.js → a5af20f3d484d2d3bafe.js} +1 -1
- package/assets/esri/core/workers/chunks/aa748cdeab2db5eb9d45.js +1 -0
- package/assets/esri/core/workers/chunks/b0b24fb60a21b995b348.js +1 -0
- package/assets/esri/core/workers/chunks/b6e155b42a4a423139e7.js +1 -0
- package/assets/esri/core/workers/chunks/{fb57a07b76580dcdde46.js → bc9997d15ec0a86793c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4a571a1e897c8ad359c4.js → bf2bfc0d78be8c185d58.js} +1 -1
- package/assets/esri/core/workers/chunks/bf9b2aa2e67ca746ec7c.js +1 -0
- package/assets/esri/core/workers/chunks/c9babe86c00ae69e63ee.js +2 -0
- package/assets/esri/core/workers/chunks/{da40c63408affee86ac4.js → d0d1378e714ff0e43e26.js} +1 -1
- package/assets/esri/core/workers/chunks/{940185f10c2b16612b66.js → d3416e6da0c1cbb53b3a.js} +1 -1
- package/assets/esri/core/workers/chunks/d9c1e1ec5c56f09fb82f.js +1 -0
- package/assets/esri/core/workers/chunks/{4ee618a256b06221ea8f.js → da5deed75e1a170a49b3.js} +8 -8
- package/assets/esri/core/workers/chunks/{bb75ec3727b7ecabca6f.js → e4eb14952b7660feecc7.js} +1 -1
- package/assets/esri/core/workers/chunks/eaf5d55060ffc55aac39.js +1 -0
- package/assets/esri/core/workers/chunks/{9bcf8241c6b4aa42b1c5.js → ed78e19b1e400c0db309.js} +1 -1
- package/assets/esri/core/workers/chunks/f0b8de5b3cfbe9223df6.js +1 -0
- package/assets/esri/core/workers/chunks/fcf6a47f44c917490deb.js +1 -0
- package/config.js +1 -1
- package/core/Version.js +1 -1
- package/core/has.js +1 -1
- package/core/iteratorUtils.js +1 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/sql/WhereGrammar.js +1 -1
- package/core/sql/sqlVisitor.js +2 -0
- package/core/sql/writeUtils.js +2 -0
- package/core/sql.d.ts +2 -3
- package/core/sql.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/arcgisLayerUrl.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/relativeTimeQueryUtils.js +2 -0
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/networks/support/jsonTypes.d.ts +2 -2
- package/package.json +2 -2
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/rest/print.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/SourceSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/webgl/ManagedFBOResource.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/3d/webgl-engine/parts/renderUtils.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/plugins/BezierSegmentPlugin.js +1 -1
- package/views/draw/plugins/CircularArcSegmentPlugin.js +2 -0
- package/views/draw/support/EditSession.js +1 -1
- package/views/draw/support/PluginContext.js +1 -1
- package/views/draw/support/managers/TooltipManager.js +1 -1
- package/webscene/support/schemaValidator.js +1 -1
- package/webscene/support/versionUtils.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +48 -0
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor.d.ts +35 -0
- package/widgets/Editor.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +14 -15
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/OperationHandle.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/Sketch/support/sketchUtils.js +1 -1
- package/widgets/Sketch.d.ts +37 -0
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/012992dc3910466ed207.js +0 -1
- package/assets/esri/core/workers/chunks/0994c12d01fe6f74350e.js +0 -1
- package/assets/esri/core/workers/chunks/13b104cc7925d4423aad.js +0 -1
- package/assets/esri/core/workers/chunks/147d0f7a2e471442c95c.js +0 -2
- package/assets/esri/core/workers/chunks/1a11ac1a34614132fabc.js +0 -1
- package/assets/esri/core/workers/chunks/1f613c599eff3b16c1d2.js +0 -1
- package/assets/esri/core/workers/chunks/2431a5480f0d22f00e00.js +0 -1
- package/assets/esri/core/workers/chunks/319226db47849acbe321.js +0 -1
- package/assets/esri/core/workers/chunks/360dd5cd63d132b5c7d5.js +0 -2
- package/assets/esri/core/workers/chunks/3e4c5cc24bdc1c807125.js +0 -1
- package/assets/esri/core/workers/chunks/504e6868445419b7680e.js +0 -1
- package/assets/esri/core/workers/chunks/545d801c4ba6f49df726.js +0 -1
- package/assets/esri/core/workers/chunks/71879de16a936a079362.js +0 -1
- package/assets/esri/core/workers/chunks/733d4ddb937c51ef3aed.js +0 -1
- package/assets/esri/core/workers/chunks/7352b4129f4875a053b0.js +0 -1
- package/assets/esri/core/workers/chunks/768ee8d940b5eb353ec3.js +0 -1
- package/assets/esri/core/workers/chunks/8556d06f522914e71bb8.js +0 -1
- package/assets/esri/core/workers/chunks/863873ffbed0cbbdfb9b.js +0 -1
- package/assets/esri/core/workers/chunks/88fe7d75dc3b619b8543.js +0 -1
- package/assets/esri/core/workers/chunks/8ac7a552189143ab4f91.js +0 -1
- package/assets/esri/core/workers/chunks/8ba1c7919e898ef4557f.js +0 -1
- package/assets/esri/core/workers/chunks/944b6d230a93add78c0d.js +0 -1
- package/assets/esri/core/workers/chunks/a37a003da59bdaf7ec0e.js +0 -1
- package/assets/esri/core/workers/chunks/ad688eee6a9f2be6df4a.js +0 -1
- package/assets/esri/core/workers/chunks/c0ae85f9c2dbe8611499.js +0 -1
- package/assets/esri/core/workers/chunks/c0cb0c22ee7fd91855cb.js +0 -1
- package/assets/esri/core/workers/chunks/cb1b16f8bf7c135e14f7.js +0 -1
- package/assets/esri/core/workers/chunks/cc245eb1c5aaaac5916e.js +0 -1
- package/assets/esri/core/workers/chunks/e03bf0ca545dce221ea0.js +0 -1
- package/assets/esri/core/workers/chunks/e880d7738155a4de4b0e.js +0 -1
- package/assets/esri/core/workers/chunks/fb4bcf366ba1b51668f6.js +0 -1
- package/assets/esri/core/workers/chunks/fb58f3ea98bf5e8cf8dd.js +0 -1
- package/views/3d/webgl/utils.js +0 -2
- /package/assets/esri/core/workers/chunks/{aefc089928ada18bc4d4.js.LICENSE.txt → 2762149a922275136171.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7a85e08cb968586f8d74.js.LICENSE.txt → 72acfb74fd9ab9bae923.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{360dd5cd63d132b5c7d5.js.LICENSE.txt → 7e6309bfed6692e8d2d7.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4bd98d025bcd713eddca.js.LICENSE.txt → 91858b02da40ff251ab2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{147d0f7a2e471442c95c.js.LICENSE.txt → c9babe86c00ae69e63ee.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{removeMaybe as s,abortMaybe as i,destroyMaybe as n,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAborted as h}from"../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as d,initial as _,sync as l}from"../../../../core/reactiveUtils.js";import{signal as u}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as m,invert as f,multiply as g}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as C}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as P}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,ZEROS as T}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as E}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as A,InternalRenderCategory as x,AllRenderNodeOutputs as S,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{innerAtmosphereFadeStart as I}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as R}from"../../state/NearFarHeuristic.js";import{debugFlags as y}from"../../support/debugFlags.js";import{FBOCache as H,defaultWebGLFBO as O}from"../core/FBOCache.js";import{RenderPassManager as v}from"../core/renderPasses/RenderPassManager.js";import{isColor as F}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as M}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as N}from"../effects/RenderNodes.js";import{RenderPluginManager as G}from"../effects/RenderPluginManager.js";import{Blit as q}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as L,renderHighlightBuffer as U}from"../effects/highlight/Highlight.js";import{OITBlend as V}from"../effects/transparency/OITBlend.js";import{AnimationTimer as j}from"./AnimationTimer.js";import{AnimationTimeStep as B}from"./AnimationTimeStep.js";import{BoundingInfo as k}from"./BoundingInfo.js";import{DepthRange as z}from"./DepthRange.js";import{depthRangeFromScene as W}from"./depthRangeUtils.js";import{MainFramebuffer as Q}from"./MainFramebuffer.js";import{RenderContext as Y,defaultRenderOccludedMask as J}from"./RenderContext.js";import{RendererBase as K}from"./RendererBase.js";import{setupFeatureDefaults as X}from"./RenderFeature.js";import{RenderPluginInput as Z}from"./RenderPluginInput.js";import{ShadowAccumulator as $}from"./ShadowAccumulator.js";import{ShadowMap as ee}from"./ShadowMap.js";import te from"./SliceHelper.js";import{MergedRenderer as re}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as se}from"../parts/renderUtils.js";import{RendererPerformanceInfo as ie,PerformanceCategory as ne}from"../statistics/RendererPerformanceInfo.js";import{PixelType as ae,ColorAttachment1 as he,ColorAttachment2 as oe,ColorAttachment0 as de}from"../../../webgl/enums.js";let _e=class extends K{constructor(e,t,r,s,i,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=i,this._requestRender=n,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new v,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new te,this.sceneDepthRange=u(z.Infinite),this._state=u(2),this._hasAnimations=!1,this._animationTimestep=new B,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=u(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new Z,this._oitCallouts=!1,this._releaseNodeInputs=e=>{for(const t of we)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._debugNeedsDepth=!1,this._fboCache=new H(s),this._renderStateFeatures=u(X(e.view.qualityProfile)),this._framebuffer=new Q(this.fboCache),this._performanceInfo=new ie(this._rctx),this._shadowMap=new ee(this.fboCache,e.viewingMode),this._blit=new q(r),this._shadowAccumulator=new $(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t},(t,r,s)=>{const i=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,s,!0,i),this._renderShadowCascades(3,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},n),this._renderContext=new Y(this._rctx,this._shadowMap,r),this._nodes=new N(this._renderContext),this._plugins=new G({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([o(()=>e.view.state.camera,()=>n(),d),o(()=>y.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},n()},_),o(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():T;P(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()},d),o(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=M,d),o(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},l),o(()=>this._bindParameters.clouds.data?.state,()=>n(),l),o(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,n()},_)])}destroy(){this._gpuTimerHandle=s(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=n(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._oitBlend=null,this._compositingHelper=null,this._nodes=null,this._framebuffer=null,this._shadowMap=null,this._renderContext=null,this._performanceInfo=null,k.prune(),re.prune(),E()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=X(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(s=>s.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(6)}get _hasHighlights(){return this._plugins.produces(8,2,4,20,14,15,16)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(8,14,15,16)}get hasSSAO(){return this.isFeatureEnabled(5)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get hasEmitters(){return this._plugins.hasEmitters&&this._hasFloatBufferBlendSupport}get highResolutionAtmosphere(){return this.isFeatureEnabled(4)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=a(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=a(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=a(this._bindParameters.geometryDepth),this._bindParameters.hudOcclusion=a(this._bindParameters.hudOcclusion)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeBuffers(),this._bindParameters.depth=a(this._bindParameters.depth),this._bindParameters.hudVisibility=a(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");h(e);const r=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:xe(this.stage.view.resourceController)});return this.addHandles(o(()=>r.updating,()=>this._requestRender(),l)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&m(this._bindParameters.ssr.reprojectionMatrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),e.environment){void 0!==e.environment.weather&&(this._bindParameters.weather=e.environment.weather);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasFloatBufferBlendSupport(){return this._rctx.driverTest.floatBufferBlend.result}get oitEnabled(){return this.isFeatureEnabled(2)&&this._hasFloatBufferBlendSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,10)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,15),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...ge),has.water=this._plugins.produces(2,21),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new j(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?s(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,r,s=!1){try{return this._isRendering=!0,this._render(e,t,r,s)}catch(i){console.error(`Exception during rendering: ${i}`)}finally{this._isRendering=!1}return new se(this._pluginInput.get(A.FINAL),null)}_render(e,t,r,s){const i=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:n,contentCamera:a,mode:h,alignPixelEnabled:o}=e;this._state.value=h;const d=this._nodes.produces("magnifier-color"),_=this._nodes.produces(A.FINAL);this._renderContext.time=t,this._renderContext.output=0,this._bindParameters.hasEmission=this.hasEmitters,this._bindParameters.oitPass=0,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(x.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(x.CUTFILL_DEPTH),this._renderOverlay(),n.setGLViewport(this._rctx);const u=this._framebuffer,p=u.initialize(n.fullWidth,n.fullHeight,this._backgroundColor,this._bindParameters.hasEmission);this.hasReflections?(p?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=p):p?.release(),this._ensureBindParametersCamera(n,a),this._plugins.sortTestsTransparentOrderedSlots(Ce),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!s;const c=this._plugins.produces(0,...ue);this._precompilePrepasses(),this.performanceInfo.advance(ne.PREPARE);const m=this._computeShadowDepthRange(n);this._renderShadowMap(n,this._bindParameters.lighting.mainLight.direction,m),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(m,n,a,!i),this._oitCallouts=c&&this.oitEnabled,this._ensureBindParametersSSR(t),this._precompileShaders(c),this._renderContext.output=0,u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._renderOpaque(),this._renderTransparent(c),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(x.FOCUSAREA,this._renderFocusAreaGeometry()),this._pluginInput.set(x.CUTFILL_DEPTH,this._renderCutFillDepth()),u.update(e=>this._renderNodes(x.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(x.VIEWSHED,e)),u.update(e=>this._renderNodes(x.LASERLINES,e)),u.update(e=>this._renderNodes(x.FOCUSAREA_COLOR,e)),this._pluginInput.release(x.FOCUSAREA),this._pluginInput.release(x.CUTFILL_DEPTH),u.update(e=>this._renderNodes(x.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(n,this._bindParameters.lighting.mainLight.direction,m);const f=2===r?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(A.COMPOSITE,e)),this._shadowMap.disposeBuffers();const g=i&&!_&&!(d&&!s),b=this._pluginInput.get(A.COMPOSITE),C=g?O:this.fboCache.acquire(b.fbo.width,b.fbo.height,x.ANTIALIASING),P=this._nodes.produces(x.ANTIALIASING)?this._renderNodes(x.ANTIALIASING,C):this.blitFBO(b,C,!1);let w;this._pluginInput.set(x.ANTIALIASING,P);const T=this._hasPhotoshopTerrain||!c?1:2;this._bindParameters.hasEmission=!1,this._hasHUDHighlights?(this._renderHUD(T,P),w=this._renderNodes(x.HIGHLIGHT_COLOR,P)):(w=this._renderNodes(x.HIGHLIGHT_COLOR,P),this._renderHUD(T,w)),this._bindParameters.hasEmission=this.hasEmitters;const E=this._renderNodes(x.MAGNIFIER,w);return i&&d&&!s&&!_&&this.blitFBO(E),_?(E.attachDepth(u.depth),this.blitFBO(this._renderNodes(A.FINAL,E)),E.detachDepth()):this._pluginInput.set(A.FINAL,E),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),u.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new se(this._pluginInput.get(A.FINAL),f)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._renderContext.output=0,this._precompileOpaqueGeometry(),this._nodes.precompile(x.OPAQUE_ENVIRONMENT),this._nodes.precompile(x.GAUSSIAN_SPLAT);const t=this._bindParameters;t.terrainDepthTest=t.cullAboveTerrain=this._needsTerrainDepth,this._renderContext.output=1,this._plugins.precompile(...pe),this._needsTerrainDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=0,this._plugins.precompile(...pe),e&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(t.cullAboveTerrain=!1,this._precompileTransparentGeometry(),t.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(x.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(13),this._oitCallouts||this._plugins.precompile(17),this._precompileHUD(0),t.terrainDepthTest=t.cullAboveTerrain=!1,this._nodes.precompile(x.VIEWSHED,x.CUTFILL_DEPTH,x.CUTFILL_COLOR,x.LASERLINES,x.FOCUSAREA_COLOR,x.OCCLUDED,x.ANTIALIASING,x.HIGHLIGHT_COLOR),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,t.hasEmission=!1,this._precompileHUD(1),this.oitEnabled&&this._precompileHUD(0),t.hasEmission=this.hasEmitters,this._hasHighlights&&(t.highlights.forEach((e,r)=>{t.highlightLevel=r,this._precompileAllGeometry(8)}),t.highlightLevel=null),t.highlightMixTexture=null,this._nodes.precompile(A.COMPOSITE,x.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(x.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(ne.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const{width:t,height:r}=this._framebuffer.size;let s=this.fboCache.acquire(t,r,"olid");return s.acquireDepth(14),s=this._nodes.render(s,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(ne.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,s}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let s=0;t?s=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const i=Math.max(e,s);this._animationTimestep.frame(i,r)}}readMainDepth(e,t){const{mainDepth:r,camera:s}=this._bindParameters;if(!r)return;const i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(i.fbo),s.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(T),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),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,ae.UNSIGNED_BYTE,t),i.release()}readHUDVisibility(e,t,r,s,i){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,s,6408,ae.UNSIGNED_BYTE,i)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquire(r,s,"edges"),n=this._bindParameters.geometryDepth,a=()=>t.render(this._bindParameters,e);this._renderToTargets(a,i,n??this._framebuffer.depth,T),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?ne.OPAQUE_EDGES:ne.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(ne.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(7),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(5,this._shadowMap),s.copySnapshot(1),this._renderShadowCascades(4,this._shadowMap)):this._renderShadowCascades(3),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(ne.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(7),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(4,this._shadowMap),s.moveSnapshot(0),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(ne.SHADOW_MAP)}_renderCutFillDepth(){return this._nodes.produce(x.CUTFILL_DEPTH,this._pluginInput)}_precompileShadowCascades(e){0!==this._shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(1)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(x.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(1),this._bindParameters.depth?.release(),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(ne.DEPTH)):(e.detachDepth(),this._bindParameters.depth=a(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(this._bindParameters.depth=a(this._bindParameters.depth),!this._needsDepth)return;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"geometry depth",14);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(1),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(ne.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=a(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._renderContext.output;this._renderContext.output=1;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"terrain depth",14);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=s.obtainDepthTexture(),s.release(),this._renderContext.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=a(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._renderContext.output,{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"geometry depth",14);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(1),this._renderContext.output=e,this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return z.Zero;const t=W(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(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)return void(this.sceneDepthRange.value=z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<I)return void(this.sceneDepthRange.value=z.Infinite);const t=e.clone();t.near=R,t.far=1e10;const r=W(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",...S,x.VIEWSHED,x.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(2),this._needsDepth&&this._precompileAllGeometry(1),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(4),this._precompileShadowCascades(5)):this._precompileShadowCascades(3)),this._shadowAccumulator.active&&this._precompileAllGeometry(3)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"normals",5);s.acquireDepth(14),this._rctx.bindFramebuffer(s.fbo),this._rctx.clearFramebuffer(T,!0,!0),this._renderContext.output=2,this._plugins.render(...ce);const i=this._nodes.optional("normals",...S,x.VIEWSHED);return s.retain(e+i-1),this.performanceInfo.advance(ne.NORMALS),s}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasSSAO&&e)return this._bindParameters.ssao=this._nodes.produce(x.SSAO,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(ne.SSAO),this._bindParameters.ssao}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...pe),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...fe);this._renderContext.renderOccludedMask=J}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const 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(10),this.renderSlots(e,...fe),this._renderContext.renderOccludedMask=J}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Pe[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(18),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(16)}precompileViewshedShadowMap(){this._precompileAllGeometry(6)}precompileCutFill(){const e=7,t=this._renderContext.output;this._renderContext.output=e,this._plugins.precompile(0,1,...pe),this._renderContext.output=t}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(6),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=s}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._renderContext.output=7,this._plugins.render(0,1,...pe),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._renderContext.output=s}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...me)}_precompileOpaqueGeometry(){this._plugins.precompile(...le),this._nodes.precompile("opaque-color")}_renderOpaqueGeometry(){this._plugins.render(...le)}_renderTransparentGeometry(){this._plugins.render(...ue),this._oitCallouts&&this._plugins.render(17)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"transparent terrain"),s=()=>this._plugins.render(6);return this._renderToTargets(s,r,this._framebuffer.depth,T),this.performanceInfo.advance(ne.TRANSPARENT_TERRAIN),r}_renderTransparentGround(){this._plugins.render(...pe)}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,13)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=a(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebuffer.size;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",4),this._bindParameters.hudVisibility=r);const s=this._bindParameters.geometryDepth;r.attachDepth(s||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(13),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(ne.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(17),{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquireDepth(13,t,r,"line callouts");this._renderToTargets(e,this._framebuffer.color,s,void 0,!0,!0),s.release()}else this._plugins.render(17)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=8,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this.oitEnabled&&F(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...ge),this._bindParameters.oitPass=2,this._plugins.precompile(...ge),this._bindParameters.oitPass=0):this._plugins.precompile(...ge),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t){if(this._pluginsHas.hudElements){if(this.oitEnabled){const r=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,r.getTexture(),!1),r.release()}else if(this._renderContext.output=0,0===e){const t=()=>this._renderHUDElements(e),{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquireDepth(13,r,s,"hud");this._renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(13),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(0===e?ne.HUD_OCCLUDED:ne.HUD)}}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(4,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,{width:s,height:i}=this._framebuffer.size,{highlights:n}=r,a=n.length>L?3:1,h=e.acquire(s,i,"highlights",a);h.acquireDepth(14);const o=this._plugins.produces(8,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._renderContext.output=8,t.bindFramebuffer(h.fbo),U(t,e,s,i,r,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(ne.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...be),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t,r,s){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r,s)&&this.performanceInfo.advance(ne.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this.oitEnabled&&F(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...ue),this._oitCallouts&&this._plugins.precompile(17),this._bindParameters.oitPass=2,this._plugins.precompile(...ue),this._oitCallouts&&this._plugins.precompile(17),this._bindParameters.oitPass=0):this._plugins.precompile(...ue)}_renderOIT(e,t=2){const r=1===e,{width:s,height:i}=this._framebuffer.size,n=r?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=0,h.oitPass=1;const d=r?"oit hud":"oit",_=this.fboCache.acquire(s,i,d,8),l=this._bindParameters.hasEmission&&(0===e||1!==t);l&&_.acquireColor(he,8,"oit emissive");const u=l?oe:he;_.acquireColor(u,7,"oit alpha"),r||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),l&&this._rctx.clearBuffer(1,T),n(),_.detachDepth(),h.oitPass=2;const p=this.fboCache.acquire(s,i,r?"oit hud front":"oit front");l&&p.acquireColor(he,8,"oit emissive front"),r?p.acquireDepth(13):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(T,r),n(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!r;let m;return this._bindParameters.hudOcclusion=a(this._bindParameters.hudOcclusion),h.oitPass=0,r?(m=this.fboCache.acquire(s,i,"oit hud composite"),this._rctx.bindFramebuffer(m.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(u,0,"hud occlusion"),this._rctx.clearBuffer(u-de,T)),this._framebuffer.bind()),this._oitBlend??=new V(this._techniques),this._oitBlend.blend(this._rctx,_,p,h,l,c,e),m?.detachDepth(),r||(this._rctx.bindFramebuffer(p.fbo),this._framebuffer.bind(),c&&(this._bindParameters.hudOcclusion=this._framebuffer.color.obtainAttachment(u))),p.release(),_.release(),this._renderContext.output=o,m}_renderOpaque(){const e=this.plugins.produces(0,...le);if(e){this._plugins.render(0,1);const e=this._framebuffer;e.update(e=>this._renderNodes(x.CUTFILL_COLOR,e)),e.update(e=>this._renderNodes(x.OPAQUE_TERRAIN,e)),e.bind(),this._plugins.render(2,3)}const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(A.OPAQUE,t,e)),this.fboCache.debugCallback?.(A.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(x.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(x.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(e){const t=this._framebuffer;t.bind(),this._renderPlugins(22,ne.VOXEL),t.update(e=>this._renderNodes(x.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(x.GAUSSIAN_SPLAT,t.color.fbo),this._renderHiddenTransparentEdges(),e&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),t.update(t=>this._renderNodes(A.TRANSPARENT,t,e)),this.fboCache.debugCallback?.(A.TRANSPARENT,t.color.fbo),this._renderGeometryDepth(),this._renderHUDVisibility(),this._needsTerrainDepth||this._oitCallouts||this._plugins.render(17),this._renderEdges(0);const r=this._renderPhotoshopTerrain(),s=r?.getTexture();s&&(this._bindParameters.hudVisibility&&(this._needsTerrainDepth?this._renderLineCallouts(0):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,s))),this._renderHUD(0,t.color)),this._bindParameters.cullAboveTerrain=!1,s&&(t.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,s),r?.release(),this._needsTerrainDepth&&(this._renderEdges(1),e&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(ne.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=a(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(ne.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(ne.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){const s=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(s,t.fbo);const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),i}blitFBO(e,t=O,r=!0){return this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=b:(f(Ee,this._bindParameters.camera.viewMatrix),f(Te,this._bindParameters.camera.projectionMatrix),g(Ae,Ee,Te),g(Ae,this._renderContext.lastFrameCamera.viewMatrix,Ae),g(Ae,this._renderContext.lastFrameCamera.projectionMatrix,Ae),this._reprojectionMatrix=Ae);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=b,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,s){this._bindParameters.updateLighting(e,t,r,s),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}_renderToTargets(e,t,r,s,i=!1,n=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(s,i,n),e(),t.detachDepth()}get test(){}};e([p({readOnly:!0})],_e.prototype,"highResolutionAtmosphere",null),e([p()],_e.prototype,"_edgeView",void 0),e([p()],_e.prototype,"updating",null),_e=e([c("esri.views.3d.webgl-engine.lib.Renderer")],_e);const le=[0,1,2,3],ue=[7,8,4,5],pe=[6,7,8],ce=[0,1,2,4,...pe],me=[3,5],fe=[2,4,9],ge=[18,14,16,15],be=[4,5,2,3,0,1,...pe],Ce=[4,9,5,12],Pe={0:[15],1:[14],2:[15,14],3:[15,14]},we=["normals","highlights"],Te=C(),Ee=C(),Ae=C();function xe(e){return t=>e.immediate.schedule(t)}export{_e as Renderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{removeMaybe as s,abortMaybe as i,destroyMaybe as n,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAborted as h}from"../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as d,initial as _,sync as l}from"../../../../core/reactiveUtils.js";import{signal as u}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as m,invert as f,multiply as g}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as C}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,ZEROS as T}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as E}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as x,InternalRenderCategory as S,AllRenderNodeOutputs as A,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{innerAtmosphereFadeStart as R}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as I}from"../../state/NearFarHeuristic.js";import{debugFlags as y}from"../../support/debugFlags.js";import{FBOCache as H}from"../core/FBOCache.js";import{RenderPassManager as O}from"../core/renderPasses/RenderPassManager.js";import{isColor as v}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as F}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as M}from"../effects/RenderNodes.js";import{RenderPluginManager as q}from"../effects/RenderPluginManager.js";import{Blit as N}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as G,renderHighlightBuffer as L}from"../effects/highlight/Highlight.js";import{OITBlend as U}from"../effects/transparency/OITBlend.js";import{AnimationTimer as V}from"./AnimationTimer.js";import{AnimationTimeStep as j}from"./AnimationTimeStep.js";import{BoundingInfo as B}from"./BoundingInfo.js";import{DepthRange as k}from"./DepthRange.js";import{depthRangeFromScene as z}from"./depthRangeUtils.js";import{MainFramebuffer as W}from"./MainFramebuffer.js";import{RenderContext as Q,defaultRenderOccludedMask as Y}from"./RenderContext.js";import{RendererBase as J}from"./RendererBase.js";import{setupFeatureDefaults as K}from"./RenderFeature.js";import{RenderPluginInput as X}from"./RenderPluginInput.js";import{ShadowAccumulator as Z}from"./ShadowAccumulator.js";import{ShadowMap as $}from"./ShadowMap.js";import ee from"./SliceHelper.js";import{MergedRenderer as te}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as re}from"../parts/renderUtils.js";import{RendererPerformanceInfo as se,PerformanceCategory as ie}from"../statistics/RendererPerformanceInfo.js";import{PixelType as ne,ColorAttachment1 as ae,ColorAttachment2 as he,ColorAttachment0 as oe}from"../../../webgl/enums.js";let de=class extends J{constructor(e,t,r,s,i,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=i,this._requestRender=n,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new O,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new ee,this.sceneDepthRange=u(k.Infinite),this._state=u(2),this._hasAnimations=!1,this._animationTimestep=new j,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=u(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new X,this._oitCallouts=!1,this._releaseNodeInputs=e=>{for(const t of Ce)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._debugNeedsDepth=!1,this._fboCache=new H(s),this._renderStateFeatures=u(K(e.view.qualityProfile)),this._framebuffer=new W(this.fboCache),this._performanceInfo=new se(this._rctx),this._shadowMap=new $(this.fboCache,e.viewingMode),this._blit=new N(r),this._shadowAccumulator=new Z(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t},(t,r,s)=>{const i=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,s,!0,i),this._renderShadowCascades(3,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},n),this._renderContext=new Q(this._rctx,this._shadowMap,r),this._nodes=new M(this._renderContext),this._plugins=new q({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([o(()=>e.view.state.camera,()=>n(),d),o(()=>y.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},n()},_),o(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():T;C(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()},d),o(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=F,d),o(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},l),o(()=>this._bindParameters.clouds.data?.state,()=>n(),l),o(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,n()},_)])}destroy(){this._gpuTimerHandle=s(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=n(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._oitBlend=null,this._compositingHelper=null,this._nodes=null,this._framebuffer=null,this._shadowMap=null,this._renderContext=null,this._performanceInfo=null,B.prune(),te.prune(),E()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=K(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(s=>s.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(6)}get _hasHighlights(){return this._plugins.produces(8,2,4,20,14,15,16)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(8,14,15,16)}get hasSSAO(){return this.isFeatureEnabled(5)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get hasEmitters(){return this._plugins.hasEmitters&&this._hasFloatBufferBlendSupport}get highResolutionAtmosphere(){return this.isFeatureEnabled(4)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=a(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=a(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=a(this._bindParameters.geometryDepth),this._bindParameters.hudOcclusion=a(this._bindParameters.hudOcclusion)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeBuffers(),this._bindParameters.depth=a(this._bindParameters.depth),this._bindParameters.hudVisibility=a(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");h(e);const r=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:xe(this.stage.view.resourceController)});return this.addHandles(o(()=>r.updating,()=>this._requestRender(),l)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&m(this._bindParameters.ssr.reprojectionMatrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),e.environment){void 0!==e.environment.weather&&(this._bindParameters.weather=e.environment.weather);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasFloatBufferBlendSupport(){return this._rctx.driverTest.floatBufferBlend.result}get oitEnabled(){return this.isFeatureEnabled(2)&&this._hasFloatBufferBlendSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,10)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,15),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...fe),has.water=this._plugins.produces(2,21),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new V(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?s(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,r,s=!1){try{return this._isRendering=!0,this._render(e,t,r,s)}catch(i){console.error(`Exception during rendering: ${i}`)}finally{this._isRendering=!1}return new re(this._pluginInput.get(x.FINAL),null)}_render(e,t,r,s){const i=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:n,contentCamera:a,mode:h,alignPixelEnabled:o}=e;this._state.value=h,this._renderContext.time=t,this._renderContext.output=0,this._bindParameters.hasEmission=this.hasEmitters,this._bindParameters.oitPass=0,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null;const d=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=d?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(S.CUTFILL_DEPTH),this._renderOverlay(),n.setGLViewport(this._rctx);const _=this._framebuffer,l=_.initialize(n.fullWidth,n.fullHeight,this._backgroundColor,this._bindParameters.hasEmission);this.hasReflections?(l?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=l):l?.release(),this._ensureBindParametersCamera(n,a),this._plugins.sortTestsTransparentOrderedSlots(be),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!s;const u=this._plugins.produces(0,...le);this._precompilePrepasses(),this.performanceInfo.advance(ie.PREPARE);const p=this._computeShadowDepthRange(n);this._renderShadowMap(n,this._bindParameters.lighting.mainLight.direction,p),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(p,n,a,!i),this._oitCallouts=u&&this.oitEnabled,this._ensureBindParametersSSR(t),this._precompileShaders(u),this._renderContext.output=0,_.bind(),this._bindParameters.mainDepth=_.depth.attachment,this._renderOpaque(),this._renderTransparent(u),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(S.FOCUSAREA,this._renderFocusAreaGeometry()),this._pluginInput.set(S.CUTFILL_DEPTH,this._renderCutFillDepth()),_.update(e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e)),_.update(e=>this._renderNodes(S.VIEWSHED,e)),_.update(e=>this._renderNodes(S.LASERLINES,e)),_.update(e=>this._renderNodes(S.FOCUSAREA_COLOR,e)),this._pluginInput.release(S.FOCUSAREA),this._pluginInput.release(S.CUTFILL_DEPTH),_.update(e=>this._renderNodes(S.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(n,this._bindParameters.lighting.mainLight.direction,p);const c=2===r?this._renderObjectAndLayerIdColor():null;_.update(e=>this._renderNodes(x.COMPOSITE,e)),this._shadowMap.disposeBuffers(),_.update(e=>this._renderNodes(S.ANTIALIASING,e));const m=this._hasPhotoshopTerrain||!u?1:2;let f;return this._bindParameters.hasEmission=!1,this._hasHUDHighlights&&_.update(e=>this._renderHUD(m,e)),_.update(e=>this._renderNodes(S.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||_.update(e=>this._renderHUD(m,e)),this._bindParameters.hasEmission=this.hasEmitters,_.update(e=>this._renderNodes(S.MAGNIFIER,e)),_.update(e=>this._renderNodes(x.FINAL,e)),i&&this._blit.toFramebuffer(this._rctx,_.color,this._bindParameters),this.onPostRender?.(),this._releaseFBOs(),_.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=_.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new re(f,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._renderContext.output=0,this._precompileOpaqueGeometry(),this._nodes.precompile(S.OPAQUE_ENVIRONMENT),this._nodes.precompile(S.GAUSSIAN_SPLAT);const t=this._bindParameters;t.terrainDepthTest=t.cullAboveTerrain=this._needsTerrainDepth,this._renderContext.output=1,this._plugins.precompile(...ue),this._needsTerrainDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=0,this._plugins.precompile(...ue),e&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(t.cullAboveTerrain=!1,this._precompileTransparentGeometry(),t.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(S.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(13),this._oitCallouts||this._plugins.precompile(17),this._precompileHUD(0),t.terrainDepthTest=t.cullAboveTerrain=!1,this._nodes.precompile(S.VIEWSHED,S.CUTFILL_DEPTH,S.CUTFILL_COLOR,S.LASERLINES,S.FOCUSAREA_COLOR,S.OCCLUDED,S.ANTIALIASING,S.HIGHLIGHT_COLOR),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,t.hasEmission=!1,this._precompileHUD(1),this.oitEnabled&&this._precompileHUD(0),t.hasEmission=this.hasEmitters,this._hasHighlights&&(t.highlights.forEach((e,r)=>{t.highlightLevel=r,this._precompileAllGeometry(8)}),t.highlightLevel=null),t.highlightMixTexture=null,this._nodes.precompile(x.COMPOSITE,S.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(S.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(ie.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const{width:t,height:r}=this._framebuffer.size;let s=this.fboCache.acquire(t,r,"olid");return s.acquireDepth(14),s=this._nodes.render(s,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(ie.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,s}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let s=0;t?s=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const i=Math.max(e,s);this._animationTimestep.frame(i,r)}}readMainDepth(e,t){const{mainDepth:r,camera:s}=this._bindParameters;if(!r)return;const i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(i.fbo),s.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(T),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),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,ne.UNSIGNED_BYTE,t),i.release()}readHUDVisibility(e,t,r,s,i){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,s,6408,ne.UNSIGNED_BYTE,i)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquire(r,s,"edges"),n=this._bindParameters.geometryDepth,a=()=>t.render(this._bindParameters,e);this._renderToTargets(a,i,n??this._framebuffer.depth,T),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?ie.OPAQUE_EDGES:ie.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(ie.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(7),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(5,this._shadowMap),s.copySnapshot(1),this._renderShadowCascades(4,this._shadowMap)):this._renderShadowCascades(3),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(ie.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(7),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(4,this._shadowMap),s.moveSnapshot(0),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(ie.SHADOW_MAP)}_renderCutFillDepth(){return this._nodes.produce(S.CUTFILL_DEPTH,this._pluginInput)}_precompileShadowCascades(e){0!==this._shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(1)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(S.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(1),this._bindParameters.depth?.release(),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(ie.DEPTH)):(e.detachDepth(),this._bindParameters.depth=a(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(this._bindParameters.depth=a(this._bindParameters.depth),!this._needsDepth)return;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"geometry depth",14);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(1),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(ie.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=a(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._renderContext.output;this._renderContext.output=1;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"terrain depth",14);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=s.obtainDepthTexture(),s.release(),this._renderContext.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=a(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._renderContext.output,{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"geometry depth",14);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(1),this._renderContext.output=e,this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return k.Zero;const t=z(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(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)return void(this.sceneDepthRange.value=k.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<R)return void(this.sceneDepthRange.value=k.Infinite);const t=e.clone();t.near=I,t.far=1e10;const r=z(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",...A,S.VIEWSHED,S.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(2),this._needsDepth&&this._precompileAllGeometry(1),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(4),this._precompileShadowCascades(5)):this._precompileShadowCascades(3)),this._shadowAccumulator.active&&this._precompileAllGeometry(3)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"normals",5);s.acquireDepth(14),this._rctx.bindFramebuffer(s.fbo),this._rctx.clearFramebuffer(T,!0,!0),this._renderContext.output=2,this._plugins.render(...pe);const i=this._nodes.optional("normals",...A,S.VIEWSHED);return s.retain(e+i-1),this.performanceInfo.advance(ie.NORMALS),s}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasSSAO&&e)return this._bindParameters.ssao=this._nodes.produce(S.SSAO,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(ie.SSAO),this._bindParameters.ssao}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...ue),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...me);this._renderContext.renderOccludedMask=Y}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const 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(10),this.renderSlots(e,...me),this._renderContext.renderOccludedMask=Y}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Pe[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(18),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(16)}precompileViewshedShadowMap(){this._precompileAllGeometry(6)}precompileCutFill(){const e=7,t=this._renderContext.output;this._renderContext.output=e,this._plugins.precompile(0,1,...ue),this._renderContext.output=t}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(6),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=s}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._renderContext.output=7,this._plugins.render(0,1,...ue),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._renderContext.output=s}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...ce)}_precompileOpaqueGeometry(){this._plugins.precompile(..._e),this._nodes.precompile("opaque-color")}_renderOpaqueGeometry(){this._plugins.render(..._e)}_renderTransparentGeometry(){this._plugins.render(...le),this._oitCallouts&&this._plugins.render(17)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"transparent terrain"),s=()=>this._plugins.render(6);return this._renderToTargets(s,r,this._framebuffer.depth,T),this.performanceInfo.advance(ie.TRANSPARENT_TERRAIN),r}_renderTransparentGround(){this._plugins.render(...ue)}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,13)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=a(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebuffer.size;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",4),this._bindParameters.hudVisibility=r);const s=this._bindParameters.geometryDepth;r.attachDepth(s||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(13),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(ie.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(17),{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquireDepth(13,t,r,"line callouts");this._renderToTargets(e,this._framebuffer.color,s,void 0,!0,!0),s.release()}else this._plugins.render(17)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=8,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this.oitEnabled&&v(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...fe),this._bindParameters.oitPass=2,this._plugins.precompile(...fe),this._bindParameters.oitPass=0):this._plugins.precompile(...fe),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;if(this.oitEnabled){const r=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,r.getTexture(),!1),r.release()}else if(this._renderContext.output=0,0===e){const t=()=>this._renderHUDElements(e),{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquireDepth(13,r,s,"hud");this._renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(13),this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(256),this._renderHUDElements(e),t.detachDepth();return this.performanceInfo.advance(0===e?ie.HUD_OCCLUDED:ie.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(4,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,{width:s,height:i}=this._framebuffer.size,{highlights:n}=r,a=n.length>G?3:1,h=e.acquire(s,i,"highlights",a);h.acquireDepth(14);const o=this._plugins.produces(8,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._renderContext.output=8,t.bindFramebuffer(h.fbo),L(t,e,s,i,r,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(ie.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...ge),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t,r,s){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r,s)&&this.performanceInfo.advance(ie.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this.oitEnabled&&v(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...le),this._oitCallouts&&this._plugins.precompile(17),this._bindParameters.oitPass=2,this._plugins.precompile(...le),this._oitCallouts&&this._plugins.precompile(17),this._bindParameters.oitPass=0):this._plugins.precompile(...le)}_renderOIT(e,t=2){const r=1===e,{width:s,height:i}=this._framebuffer.size,n=r?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=0,h.oitPass=1;const d=r?"oit hud":"oit",_=this.fboCache.acquire(s,i,d,8),l=this._bindParameters.hasEmission&&(0===e||1!==t);l&&_.acquireColor(ae,8,"oit emissive");const u=l?he:ae;_.acquireColor(u,7,"oit alpha"),r||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),l&&this._rctx.clearBuffer(1,T),n(),_.detachDepth(),h.oitPass=2;const p=this.fboCache.acquire(s,i,r?"oit hud front":"oit front");l&&p.acquireColor(ae,8,"oit emissive front"),r?p.acquireDepth(13):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(T,r),n(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!r;let m;return this._bindParameters.hudOcclusion=a(this._bindParameters.hudOcclusion),h.oitPass=0,r?(m=this.fboCache.acquire(s,i,"oit hud composite"),this._rctx.bindFramebuffer(m.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(u,0,"hud occlusion"),this._rctx.clearBuffer(u-oe,T)),this._framebuffer.bind()),this._oitBlend??=new U(this._techniques),this._oitBlend.blend(this._rctx,_,p,h,l,c,e),m?.detachDepth(),r||(this._rctx.bindFramebuffer(p.fbo),this._framebuffer.bind(),c&&(this._bindParameters.hudOcclusion=this._framebuffer.color.obtainAttachment(u))),p.release(),_.release(),this._renderContext.output=o,m}_renderOpaque(){const e=this.plugins.produces(0,..._e);if(e){this._plugins.render(0,1);const e=this._framebuffer;e.update(e=>this._renderNodes(S.CUTFILL_COLOR,e)),e.update(e=>this._renderNodes(S.OPAQUE_TERRAIN,e)),e.bind(),this._plugins.render(2,3)}const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(x.OPAQUE,t,e)),this.fboCache.debugCallback?.(x.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(e){const t=this._framebuffer;t.bind(),this._renderPlugins(22,ie.VOXEL),t.update(e=>this._renderNodes(S.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(S.GAUSSIAN_SPLAT,t.color.fbo),this._renderHiddenTransparentEdges(),e&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),t.update(t=>this._renderNodes(x.TRANSPARENT,t,e)),this.fboCache.debugCallback?.(x.TRANSPARENT,t.color.fbo),this._renderGeometryDepth(),this._renderHUDVisibility(),this._needsTerrainDepth||this._oitCallouts||this._plugins.render(17),this._renderEdges(0);const r=this._renderPhotoshopTerrain(),s=r?.getTexture();s&&(this._bindParameters.hudVisibility&&(this._needsTerrainDepth?this._renderLineCallouts(0):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,s))),this._renderHUD(0,t.color)),this._bindParameters.cullAboveTerrain=!1,s&&(t.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,s),r?.release(),this._needsTerrainDepth&&(this._renderEdges(1),e&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(ie.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=a(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(ie.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(ie.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){const s=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(s,t.fbo);const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),i}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=b:(f(Te,this._bindParameters.camera.viewMatrix),f(we,this._bindParameters.camera.projectionMatrix),g(Ee,Te,we),g(Ee,this._renderContext.lastFrameCamera.viewMatrix,Ee),g(Ee,this._renderContext.lastFrameCamera.projectionMatrix,Ee),this._reprojectionMatrix=Ee);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=b,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,s){this._bindParameters.updateLighting(e,t,r,s),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}_renderToTargets(e,t,r,s,i=!1,n=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(s,i,n),e(),t.detachDepth()}get test(){}};e([p({readOnly:!0})],de.prototype,"highResolutionAtmosphere",null),e([p()],de.prototype,"_edgeView",void 0),e([p()],de.prototype,"updating",null),de=e([c("esri.views.3d.webgl-engine.lib.Renderer")],de);const _e=[0,1,2,3],le=[7,8,4,5],ue=[6,7,8],pe=[0,1,2,4,...ue],ce=[3,5],me=[2,4,9],fe=[18,14,16,15],ge=[4,5,2,3,0,1,...ue],be=[4,9,5,12],Pe={0:[15],1:[14],2:[15,14],3:[15,14]},Ce=["normals","highlights"],we=P(),Te=P(),Ee=P();function xe(e){return t=>e.immediate.schedule(t)}export{de as Renderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{createResolver as e}from"../../../../core/promiseUtils.js";import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{resampleHermite as r}from"../../../support/screenshotUtils.js";import{DataType as s}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as i}from"../../../webgl/FramebufferObject.js";import{createEmptyImageData as n}from"../../../../core/imageUtils.js";class o{constructor(e,t){this.parameters=e,this.fbos=t}}class a{constructor(e,t,r){this._rctx=e,this._renderFunctions=t,this._forceCameraHook=r,this.supersample=!0,this._screenshotQueue=new Array}destroy(){this._rctx=null}async takeScreenshot(t){await this._renderFunctions.prepareOverlay(),this._renderFunctions.requestRenderScene(0);const r=e();return this._screenshotQueue.push({settings:t,resolver:r}),r.promise}update(e,t){for(const r of this._screenshotQueue){if(null==this._rctx){r.resolver.reject();continue}const s={...r.settings,pixelRatio:r.settings.pixelRatio*e.parameters.camera.pixelRatio},i=this._renderScreenshot(e,s,t);r.resolver(i)}this._screenshotQueue.length=0}_renderScreenshotOverlay(e,t,r){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0}),i=r.pixelRatio;return s.save(),s.translate(0,t.height),s.scale(1,-1),r.region&&s.translate(-r.region.x,-r.region.y),s.scale(i,i),t=this._renderFunctions.renderOverlay(e,r.disableDecorations,t),s.restore(),t}_readbackScreenshot(e,t){return e.resample?this._readbackScreenshotResampled({...e,resample:e.resample},t):this._readbackScreenshotImmediate(e,t)}_readbackScreenshotResampled(e,t){const{framebufferWidth:i,framebufferHeight:o,region:a,resample:h}=e,c=this._ensureScreenshotEncodeCanvas();let l=n(i,o,c);this._rctx.gl.readPixels(0,0,i,o,6408,s.UNSIGNED_BYTE,new Uint8Array(l.data.buffer)),t(),l=this._renderScreenshotOverlay(c,l,{...e,region:void 0});const d=n(a.width,a.height,c);return r(l,d,!0,h.region.x,o-(h.region.y+h.region.height),h.region.width,h.region.height)}_readbackScreenshotImmediate(e,t){const{framebufferHeight:r,region:i}=e,o=this._ensureScreenshotEncodeCanvas(),a=n(i.width,i.height,o);return this._rctx.gl.readPixels(i.x,r-(i.y+i.height),i.width,i.height,6408,s.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),t(),this._renderScreenshotOverlay(o,a,e)}_renderScreenshot(e,r,s){const n=e.parameters.camera,{framebufferWidth:o,framebufferHeight:a,ignorePadding:h,pixelRatio:c,disableDecorations:l,olidColor:d}=r,f={width:o,height:a};i(f,Math.min(this._rctx.parameters.maxTextureSize,this._rctx.parameters.maxRenderbufferSize));let u=!1;const m=f.width!==n.fullWidth||f.height!==n.fullHeight,g=h&&n.pixelRatio!==c,_=m||l||g||d;let p=null,b=null;if(_){const e=n.clone();if(h){const r=t(e.padding);for(let t=0;t<4;t++)r[t]=Math.round(r[t]/e.pixelRatio*c);e.padding=r}e.fullWidth=f.width,e.fullHeight=f.height,e.pixelRatio=c;const r=n.fovX-e.fovX,i=n.fovY-e.fovY;r<0&&r<i?e.fovX=n.fovX:i<0&&i<r&&(e.fovY=n.fovY);const o={camera:e,contentCamera:e,mode:2,alignPixelEnabled:!0,contentPixelRatio:e.pixelRatio};this._forceCameraHook(o),u=!0;const a=this._renderFunctions.renderScene(o,s,d?2:1,l);b=a.
|
|
2
|
+
import{createResolver as e}from"../../../../core/promiseUtils.js";import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{resampleHermite as r}from"../../../support/screenshotUtils.js";import{DataType as s}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as i}from"../../../webgl/FramebufferObject.js";import{createEmptyImageData as n}from"../../../../core/imageUtils.js";class o{constructor(e,t){this.parameters=e,this.fbos=t}}class a{constructor(e,t,r){this._rctx=e,this._renderFunctions=t,this._forceCameraHook=r,this.supersample=!0,this._screenshotQueue=new Array}destroy(){this._rctx=null}async takeScreenshot(t){await this._renderFunctions.prepareOverlay(),this._renderFunctions.requestRenderScene(0);const r=e();return this._screenshotQueue.push({settings:t,resolver:r}),r.promise}update(e,t){for(const r of this._screenshotQueue){if(null==this._rctx){r.resolver.reject();continue}const s={...r.settings,pixelRatio:r.settings.pixelRatio*e.parameters.camera.pixelRatio},i=this._renderScreenshot(e,s,t);r.resolver(i)}this._screenshotQueue.length=0}_renderScreenshotOverlay(e,t,r){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0}),i=r.pixelRatio;return s.save(),s.translate(0,t.height),s.scale(1,-1),r.region&&s.translate(-r.region.x,-r.region.y),s.scale(i,i),t=this._renderFunctions.renderOverlay(e,r.disableDecorations,t),s.restore(),t}_readbackScreenshot(e,t){return e.resample?this._readbackScreenshotResampled({...e,resample:e.resample},t):this._readbackScreenshotImmediate(e,t)}_readbackScreenshotResampled(e,t){const{framebufferWidth:i,framebufferHeight:o,region:a,resample:h}=e,c=this._ensureScreenshotEncodeCanvas();let l=n(i,o,c);this._rctx.gl.readPixels(0,0,i,o,6408,s.UNSIGNED_BYTE,new Uint8Array(l.data.buffer)),t(),l=this._renderScreenshotOverlay(c,l,{...e,region:void 0});const d=n(a.width,a.height,c);return r(l,d,!0,h.region.x,o-(h.region.y+h.region.height),h.region.width,h.region.height)}_readbackScreenshotImmediate(e,t){const{framebufferHeight:r,region:i}=e,o=this._ensureScreenshotEncodeCanvas(),a=n(i.width,i.height,o);return this._rctx.gl.readPixels(i.x,r-(i.y+i.height),i.width,i.height,6408,s.UNSIGNED_BYTE,new Uint8Array(a.data.buffer)),t(),this._renderScreenshotOverlay(o,a,e)}_renderScreenshot(e,r,s){const n=e.parameters.camera,{framebufferWidth:o,framebufferHeight:a,ignorePadding:h,pixelRatio:c,disableDecorations:l,olidColor:d}=r,f={width:o,height:a};i(f,Math.min(this._rctx.parameters.maxTextureSize,this._rctx.parameters.maxRenderbufferSize));let u=!1;const m=f.width!==n.fullWidth||f.height!==n.fullHeight,g=h&&n.pixelRatio!==c,_=m||l||g||d;let p=null,b=null;if(_){const e=n.clone();if(h){const r=t(e.padding);for(let t=0;t<4;t++)r[t]=Math.round(r[t]/e.pixelRatio*c);e.padding=r}e.fullWidth=f.width,e.fullHeight=f.height,e.pixelRatio=c;const r=n.fovX-e.fovX,i=n.fovY-e.fovY;r<0&&r<i?e.fovX=n.fovX:i<0&&i<r&&(e.fovY=n.fovY);const o={camera:e,contentCamera:e,mode:2,alignPixelEnabled:!0,contentPixelRatio:e.pixelRatio};this._forceCameraHook(o),u=!0;const a=this._renderFunctions.renderScene(o,s,d?2:1,l);b=a.color,p=a.olid}const x=()=>{this._rctx.bindFramebuffer(null),b?.release()};this._rctx.bindFramebuffer(b?.fbo);const v=this._readbackScreenshot(r,x);let S=null;if(d){const e=()=>{this._rctx.bindFramebuffer(null),p?.release()};this._rctx.bindFramebuffer(p?.fbo),S=this._readbackScreenshot(r,e),this._rctx.bindFramebuffer(null)}if(_&&!this._rctx.contextAttributes.alpha)for(let t=3;t<v.data.length;t+=4)v.data[t]=255;if(S&&!this._rctx.contextAttributes.alpha)for(let t=3;t<S.data.length;t+=4)S.data[t]=255;return u&&this._forceCameraHook(e.parameters),[v,S]}_ensureScreenshotEncodeCanvas(){return this._screenshotEncodeCanvas??=document.createElement("canvas"),this._screenshotEncodeCanvas}}export{o as ScreenshotContext,a as ScreenshotManager};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
function
|
|
2
|
+
function o(){const o=globalThis.require?.modules;if(o){const s=Object.keys(o);for(const t of s)t.includes(".glsl")&&delete o[t]}}class s{constructor(o,s){this.color=o,this.olid=s}}export{s as RenderSceneResult,o as removeLoadedShaderModules};
|
package/views/draw/DrawTool.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e,__addDisposableResource as t,__disposeResources as a}from"tslib";import{disposable as n}from"../../core/handleUtils.js";import i from"../../core/Logger.js";import{getOrCreateMapValue as r}from"../../core/MapUtils.js";import{destroyMaybe as o}from"../../core/maybe.js";import{when as s,initial as d,on as l,sync as p,watch as c}from"../../core/reactiveUtils.js";import{screenPointEqual as g,createScreenPoint as u}from"../../core/screenUtils.js";import{diff as h}from"../../core/accessorSupport/diffUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as M}from"../../core/support/UpdatingHandles.js";import{createSnappingVisualizer as y}from"./support/createSnappingVisualizer.js";import{multipointFromGeometry as f,markHandled as _,getPointerType as w}from"./support/drawToolUtils.js";import{PluginContext as C}from"./support/PluginContext.js";import{viewEventToCommand as H}from"./support/input/drawToolInput.js";import{EditSessionManager as x}from"./support/managers/EditSessionManager.js";import{GlobalStateManager as S}from"./support/managers/GlobalStateManager.js";import{InteractiveHandleManager as b}from"./support/managers/InteractiveHandleManager.js";import{MeasurementManager as P}from"./support/managers/MeasurementManager.js";import{PluginLifecycleManager as k}from"./support/managers/PluginLifecycleManager.js";import{SurfaceManager as T}from"./support/managers/SurfaceManager.js";import{TooltipManager as O}from"./support/managers/TooltipManager.js";import{ViewEventPriorities as j}from"../input/InputManager.js";import{createCoordinateHelper as I}from"../interactive/coordinateHelper.js";import{InteractiveToolBase as A}from"../interactive/InteractiveToolBase.js";import{KeyBindings as V,mediaKeys as E,sketchKeys as U,advancedSketchKeys as D,tooltipKeys as L}from"../interactive/keybindings.js";import{isInputModeAvailable as R}from"../interactive/tooltip/tooltipCommonUtils.js";const G=Symbol();let Z=class extends A{constructor(e){super(e),this._shapeVisualId=Symbol(),this._vertexVisualId=Symbol(),this._pluginContexts=new Map,this._snappingVisualizer=null,this._updatingHandles=new M,this._keybindings=this._makeKeyBindings(),this._pendingBeginRequest=null,this.type="draw-2.0",this.automaticManipulatorSelection=!0,this.snappingManager=null,this.sketchOptions=null,this.elevationInfo=null,this.hasZ=!1,this.defaultZ=0,this.lastScreenPosition=null,this.measurementManager=new P,this.globalStateManager=new S({getPluginStack:()=>this.pluginStack}),this.editSessionManager=new x({getContext:()=>this._editSessionManagerContext}),this.lifecycleManager=new k({getContext:this._getContextForPlugin.bind(this),editSessionManager:this.editSessionManager,afterAttach:this._afterAttach.bind(this),afterDetach:this._afterDetach.bind(this),beforeResume:this._beforeResume.bind(this)}),this.surfaceManager=null,this.interactiveHandleManager=null,this.renderer=null}initialize(){const{view:e}=this;this.interactiveHandleManager=new b({view:e,renderer:this.renderer}),this._override("manipulators",this.interactiveHandleManager.manipulators),this.tooltipManager=new O({getDependencies:()=>this._tooltipDependencies,getLastScreenPosition:()=>this.lastScreenPosition}),this.addHandles(s(()=>this.renderer,t=>{t.addOrUpdateVisual(this._shapeVisualId,{role:"outputGeometry"}),t.addOrUpdateVisual(this._vertexVisualId,{role:"vertex"}),this._updatingHandles.addPromise(y(e,t).then(e=>this._snappingVisualizer=e))},d)),this.addHandles([s(()=>this.view,e=>{this.surfaceManager?.destroy(),this.surfaceManager=new T({spatialReference:this.coordinateHelper.spatialReference,excludedGraphicsLayer:null,defaultZ:this.defaultZ,hasZ:this.hasZ,view:e,elevationInfo:this.elevationInfo,getContext:()=>({drawAtFixedElevation:this.globalStateManager.drawAtFixedElevation,elevationConstraint:this.tooltipManager?.elevationConstraint,constraintsEnabled:this.tooltipManager?.constraintsEnabled??!1})})},d),s(()=>this.sketchOptions?.tooltips.effectiveEnabled,()=>this.measurementManager.preloadMeasurementUtils(),{once:!0,initial:!0}),l(()=>this.editSessionManager,"cancelPlugin",({plugin:e})=>{this._suspendPlugin(e)},p),l(()=>this.editSessionManager,"restartPlugin",({restartInfo:e})=>{this._resumePlugin(e)},p),l(()=>this.editGeometryOperations,["vertex-add","vertex-update","vertex-remove"],e=>{const t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),a=t.map(e=>e.coordinates);switch(e.type){case"vertex-add":this.emit(e.type,{...e,added:a,vertices:t});break;case"vertex-update":this.emit(e.type,{...e,updated:a,vertices:t});break;case"vertex-remove":this.emit(e.type,{...e,removed:a,vertices:t})}})])}destroy(){this.active&&this.onDeactivate(),this.editSessionManager.destroy(),this.lifecycleManager.destroy(),this.measurementManager.destroy(),this.globalStateManager.destroy();for(const e of this._pluginContexts.values())e.destroy();this._pluginContexts.clear(),this.surfaceManager=o(this.surfaceManager),this.interactiveHandleManager=o(this.interactiveHandleManager),this.tooltipManager=o(this.tooltipManager)}get _tooltipDependencies(){const{defaultZ:e,editGeometryOperations:t,sketchOptions:a,directionOptions:n,view:i}=this;return t&&a&&i?{defaultZ:e,directionOptions:n,editGeometryOperations:t,sketchOptions:a,view:i,getActiveHandle:()=>this.interactiveHandleManager?.focusedHandle,notifyTooltipsChanged:()=>{const{interactiveHandleManager:e,movementCommandContext:t}=this;e&&t&&e.reapplyPositions(t)}}:null}get _editSessionManagerContext(){const{coordinateHelper:e,view:t}=this;return{coordinateHelper:e,viewingMode:"3d"===t?.type&&"global"===t.viewingMode?1:2}}get updating(){return this._updatingHandles.updating||this.lifecycleManager.updating}get coordinateHelper(){return I(this.hasZ,!1,this.view.spatialReference)}get editGeometry(){return this.editGeometryOperations?.data}get editGeometryOperations(){return this.editSessionManager.editGeometryOperations}get geometry(){return this.editSessionManager.outputGeometry}get canUndo(){return this.editSessionManager.canUndo}get canRedo(){return this.editSessionManager.canRedo}get pluginStack(){return this.lifecycleManager.pluginStack}get mostDownstreamPlugin(){return this.pluginStack.at(-1)}get mostUpstreamPlugin(){return this.pluginStack.at(0)}get positionOfLastUserInput(){return this.lastScreenPosition?this.view.toMap(this.lastScreenPosition):this.view.center}get movementCommandContext(){const{editGeometryOperations:e,tooltipManager:t,surfaceManager:a,snappingManager:n,interactiveHandleManager:i,_snappingVisualizer:r,defaultZ:o,hasZ:s,globalStateManager:{drawAtFixedElevation:d},view:l}=this;return{tooltipManager:t,editGeometryOperations:e,surfaceManager:a,interactiveHandleManager:i,snappingManager:n,snappingVisualizer:r,pointerType:"mouse",hasZ:s,defaultZ:o,view:l,drawAtFixedElevation:d}}begin(e){this.active?(this.lifecycleManager.begin(e),this._pendingBeginRequest=null):this._pendingBeginRequest=e}complete(e){const t=this.lifecycleManager;e&&t.complete(e),0===t.pluginStack.length&&(this.emit("complete"),this.view?.activeTool===this&&(this.view.activeTool=null))}cancelFirstUserLeafPlugin(){const e=this.pluginStack.toArray().findLast(e=>!0!==e.configuration?.hidden);e&&this.lifecycleManager.cancel(e)}replaceLeaf(e){const t=this.lifecycleManager;t.updating?i.getLogger(this).info("Ignoring command; arrived while updating:","replaceLeaf"):t.replaceLeaf(e)}finishPart(){const e=this.mostUpstreamPlugin,t=e?.configuration;if(this.editGeometryOperations&&t&&t.kind?.includes("multipart")){const e=this.pluginStack.at(1);e&&this.complete(e)}}undo(){return this._guardCommand({action:"undo"},()=>this.editSessionManager.undo())}redo(){return this._guardCommand({action:"redo"},()=>this.editSessionManager.redo())}executeCommand(e){return this._handleCommand(e)}addPromise(e){return this._updatingHandles.addPromise(e)}onActivate(){super.onActivate();const{view:e}=this;this.lastScreenPosition=e?.inputManager.latestPointerInfo?.location,this.renderer?.activate(),this._pendingBeginRequest&&(this.begin(this._pendingBeginRequest),this._pendingBeginRequest=null),this.addHandles([c(()=>this.geometry,e=>{this.renderer?.addOrUpdateVisual(this._shapeVisualId,{geometry:e}),this.renderer?.addOrUpdateVisual(this._vertexVisualId,{geometry:e?f(e):null})},d),c(()=>this.interactiveHandleManager?.capturingHandle?.screenPosition,e=>this.lastScreenPosition=e,{initial:!0,equals:g}),c(()=>this.interactiveHandleManager?.capturingHandle?.outputMapPosition,(e,t)=>{const a=this.interactiveHandleManager?.capturingHandle?.editSession?.endVertex;e&&t&&a&&this.emit("cursor-update",{updated:a.pos,type:"vertex-update",operation:"apply",vertices:[{componentIndex:a.part.index,vertexIndex:a.index,coordinates:a.pos}]})},p),this._keybindings.register(e,j.TOOL),c(()=>e.viewpoint,(e,t)=>{e&&t&&h(e,t)&&this._handleCommand({action:"viewpoint-moved"})})],G)}onDeactivate(){super.onDeactivate(),this.removeHandles(G),this.renderer?.deactivate(),this.snappingManager?.doneSnapping(),this.lifecycleManager.cancelAll(),this._pendingBeginRequest=null}onInputEvent(e){const t=H(e);t&&this._handleCommand(t)}async _handleCommand(e){if(this.lifecycleManager.updating)i.getLogger(this).info("Ignoring command; arrived while updating:",e.action);else switch(e.action){case"view-drag":return await this._handleViewDragCommand(e);case"vertex-add":return this._guardCommand(e,()=>(_(e),this._updatingHandles.addPromise(this._commitNext())));case"vertex-add-and-finish-part":return await this._handleVertexAddAndFinishPartCommand(e);case"cancel":return this._guardCommand(e,()=>this.cancel());case"complete":return this._guardCommand(e,()=>{this.mostUpstreamPlugin&&(_(e),this.complete(this.mostUpstreamPlugin))});case"finish-part":return this._guardCommand(e,()=>this.finishPart());case"undo":return this._guardCommand(e,()=>this.editSessionManager.undo());case"redo":return this._guardCommand(e,()=>this.editSessionManager.redo());case"next-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("forward"));case"previous-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("backward"));case"toggle-manipulator-follow":this.interactiveHandleManager?.toggleFollow()&&_(e);break;case"viewpoint-moved":return await this._handleViewpointMovedCommand(e);case"manipulator-move-to":return await this._handleManipulatorMoveToCommand(e);case"manipulator-drag-to":return await this._handleManipulatorDragToCommand(e);case"vertex-add-at-point":return await this._handleVertexAddAtPointCommand(e);case"show-tooltip":return this._guardCommand(e,async()=>{const t=this.tooltipManager?.tooltip;t&&R(t.info)&&(await t.enterInputMode(),_(e))});case"constraint-center":this.globalStateManager.setCentered(e.enabled);break;case"constraint-aspect":this.globalStateManager.setPreserveAspectRatio(e.enabled)}}async _handleViewDragCommand(e){if(!this.editable)return;const t=e.originalEvent,a=this.interactiveHandleManager?.capturingHandle;(!t||!("pointerType"in t)||"touch"!==t.pointerType||"capture-always"!==a?.captureMode&&"capture-when-engaged"!==a?.captureMode)&&"capture-when-engaged"!==this.interactiveHandleManager?.capturingHandle?.captureMode?this._before(e)&&_(e):_(e)}async _handleVertexAddAndFinishPartCommand(e){this._before(e)||(_(e),await this._updatingHandles.addPromise(this._commitNext().then(async()=>{this.finishPart()})))}async _handleViewpointMovedCommand(e){this.editable&&(await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(null,{...this.movementCommandContext,pointerType:w(e.originalEvent)})),this.interactiveHandleManager?.updateAllScreenPositions())}async _handleManipulatorMoveToCommand(e){if(!this.editable)return;const t=this._updateLastScreenPosition(e);this.interactiveHandleManager?.capturingHandle&&_(e),await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(t,{...this.movementCommandContext,pointerType:w(e.originalEvent)}))}async _handleManipulatorDragToCommand(e){if(!this.editable)return;const t=w(e.originalEvent),a=this._updateLastScreenPosition(e),n=this.interactiveHandleManager?.findHandleByManipulator(a);"touch"===t&&n&&"start"===e.state&&this.interactiveHandleManager?.releaseHandle();const i=this.interactiveHandleManager?.findHandleDragging(),r=this.interactiveHandleManager?.capturingHandle,o=i??r??n;o&&!n&&_(e),"capture-when-engaged"===o?.captureMode||"capture-always"===o?.captureMode&&"touch"===t?"end"===e.state?await this._updatingHandles.addPromise(o.noteDragEnd(a,{...this.movementCommandContext,pointerType:t}).then(()=>{o&&"touch"===w(e.originalEvent)&&"grabbable-object"!==o.captureMode&&"capture-when-engaged"!==o.defaultCaptureMode&&"primary"===o.role&&(1===this.interactiveHandleManager?.handleCount?this._handleCommand({action:"vertex-add"}):this.interactiveHandleManager?.releaseHandle())})):"start"===e.state?await this._updatingHandles.addPromise(o.noteDragStart(a,{...this.movementCommandContext,pointerType:t}).then(()=>{o&&"touch"===w(e.originalEvent)&&"grabbable-object"!==o.captureMode&&"capture-when-engaged"!==o.defaultCaptureMode&&!o.editSession?.lastPointAddedBySession&&this._handleCommand({action:"vertex-add"})})):await this._updatingHandles.addPromise(o?.moveTo(a,{...this.movementCommandContext,pointerType:w(e.originalEvent)})):"grabbable-object"===o?.captureMode&&(this.interactiveHandleManager?.releaseHandle(r),await this._updatingHandles.addPromise(o.moveTo(a,{...this.movementCommandContext,pointerType:t})))}async _handleVertexAddAtPointCommand(e){const t=this._updateLastScreenPosition(e),a=this.interactiveHandleManager?.capturingHandle??this.interactiveHandleManager?.findHandleByManipulator(t);this.editable&&a&&(this._before(e)||(_(e),await this._updatingHandles.addPromise(a.moveTo(t,{...this.movementCommandContext,skipSnapping:!0,pointerType:w(e.originalEvent)}).finally(()=>this._commitNext()))))}_makeKeyBindings(){const e=new V,t=(t,a)=>{e.addToggle(t,e=>this._handleCommand({action:a,originalEvent:e,enabled:"key-down"===e.type}))},a=(t,a)=>{e.add(t,e=>this._handleCommand({action:a,originalEvent:e}))};return t(E.preserveAspectRatio,"constraint-aspect"),t(U.center,"constraint-center"),a(D.toggleFollowManipulator,"toggle-manipulator-follow"),a(U.undo,"undo"),a(U.redo,"redo"),a(U.complete,"complete"),a(U.vertexAdd,"vertex-add"),a({key:L.enterInputMode,continuePropagation:!0,repeats:!0},"show-tooltip"),e}_afterAttach(){}_afterDetach(e){this.interactiveHandleManager?.unregisterCustomConstraint(e),this.interactiveHandleManager?.unregisterHandle(e),this.tooltipManager?.unregisterPluginFields(e),this.globalStateManager.clearPluginOverrides(e);const t=this._pluginContexts.get(e);t&&(t.destroy(),this._pluginContexts.delete(e))}_beforeResume(e,t){this.interactiveHandleManager?.replaceEditSessions(e,t)}async _commitNext(){const e={stack:[],error:void 0,hasError:!1};try{const a=this.mostDownstreamPlugin;if(!a)return;let i=!1;const r=this.editGeometryOperations;t(e,r?n(r.on("vertex-add",()=>i=!0)):null,!1);a.completeStep?a.completeStep():this.complete(a),i&&this.tooltipManager?.unlockOnVertexPlacement()}catch(i){e.error=i,e.hasError=!0}finally{a(e)}}_suspendPlugin(e){this.lifecycleManager.suspend(e),this.measurementManager.suspendPlugin(e)}_resumePlugin(e){this.lifecycleManager.resume(e)}_updateLastScreenPosition(e){const t=u(e.x,e.y);return this.lastScreenPosition=t,t}_getContextForPlugin(e,t){const a=r(this._pluginContexts,e,()=>new C({drawTool:this,plugin:e,session:t}));return a.session=t,a}_before(e){if(!this.hasEventListener(`before-${e.action}`))return!1;const t=new CustomEvent(`before-${e.action}`,{detail:e,cancelable:!0});return this.emit(`before-${e.action}`,t),t.defaultPrevented}_guardCommand(e,t,a){return this._before(e)?a?.():t()}};e([m()],Z.prototype,"_snappingVisualizer",void 0),e([m()],Z.prototype,"_tooltipDependencies",null),e([m()],Z.prototype,"_editSessionManagerContext",null),e([m({constructOnly:!0,nonNullable:!0})],Z.prototype,"view",void 0),e([m()],Z.prototype,"automaticManipulatorSelection",void 0),e([m()],Z.prototype,"updating",null),e([m()],Z.prototype,"coordinateHelper",null),e([m()],Z.prototype,"editGeometry",null),e([m()],Z.prototype,"editGeometryOperations",null),e([m()],Z.prototype,"geometry",null),e([m()],Z.prototype,"snappingManager",void 0),e([m()],Z.prototype,"sketchOptions",void 0),e([m()],Z.prototype,"elevationInfo",void 0),e([m()],Z.prototype,"hasZ",void 0),e([m()],Z.prototype,"defaultZ",void 0),e([m()],Z.prototype,"directionOptions",void 0),e([m()],Z.prototype,"canUndo",null),e([m()],Z.prototype,"canRedo",null),e([m()],Z.prototype,"pluginStack",null),e([m()],Z.prototype,"mostDownstreamPlugin",null),e([m()],Z.prototype,"mostUpstreamPlugin",null),e([m()],Z.prototype,"lastScreenPosition",void 0),e([m()],Z.prototype,"positionOfLastUserInput",null),e([m()],Z.prototype,"tooltipManager",void 0),e([m()],Z.prototype,"measurementManager",void 0),e([m()],Z.prototype,"globalStateManager",void 0),e([m()],Z.prototype,"editSessionManager",void 0),e([m()],Z.prototype,"lifecycleManager",void 0),e([m()],Z.prototype,"surfaceManager",void 0),e([m()],Z.prototype,"interactiveHandleManager",void 0),e([m()],Z.prototype,"renderer",void 0),e([m()],Z.prototype,"movementCommandContext",null),Z=e([v("esri.views.draw.DrawTool")],Z);export{Z as DrawTool};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t,__decorate as a}from"tslib";import{disposable as i}from"../../core/handleUtils.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as r}from"../../core/MapUtils.js";import{destroyMaybe as o}from"../../core/maybe.js";import{when as s,initial as d,on as l,sync as p,watch as c}from"../../core/reactiveUtils.js";import{screenPointEqual as g,createScreenPoint as u}from"../../core/screenUtils.js";import{diff as h}from"../../core/accessorSupport/diffUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as M}from"../../core/support/UpdatingHandles.js";import{createSnappingVisualizer as y}from"./support/createSnappingVisualizer.js";import{multipointFromGeometry as f,markHandled as _,getPointerType as w}from"./support/drawToolUtils.js";import{PluginContext as C}from"./support/PluginContext.js";import{viewEventToCommand as H}from"./support/input/drawToolInput.js";import{EditSessionManager as x}from"./support/managers/EditSessionManager.js";import{GlobalStateManager as S}from"./support/managers/GlobalStateManager.js";import{InteractiveHandleManager as b}from"./support/managers/InteractiveHandleManager.js";import{MeasurementManager as P}from"./support/managers/MeasurementManager.js";import{PluginLifecycleManager as T}from"./support/managers/PluginLifecycleManager.js";import{SurfaceManager as k}from"./support/managers/SurfaceManager.js";import{TooltipManager as I}from"./support/managers/TooltipManager.js";import{ViewEventPriorities as O}from"../input/InputManager.js";import{createCoordinateHelper as j}from"../interactive/coordinateHelper.js";import{InteractiveToolBase as A}from"../interactive/InteractiveToolBase.js";import{KeyBindings as V,mediaKeys as E,sketchKeys as U,advancedSketchKeys as D,tooltipKeys as L}from"../interactive/keybindings.js";import{isInputModeAvailable as R}from"../interactive/tooltip/tooltipCommonUtils.js";const G=Symbol();let Z=class extends A{constructor(e){super(e),this._shapeVisualId=Symbol(),this._vertexVisualId=Symbol(),this._pluginContexts=new Map,this._snappingVisualizer=null,this._updatingHandles=new M,this._keybindings=this._makeKeyBindings(),this._pendingBeginRequest=null,this.type="draw-2.0",this.automaticManipulatorSelection=!0,this.snappingManager=null,this.sketchOptions=null,this.elevationInfo=null,this.hasZ=!1,this.defaultZ=0,this.lastScreenPosition=null,this.measurementManager=new P,this.globalStateManager=new S({getPluginStack:()=>this.pluginStack}),this.editSessionManager=new x({getContext:()=>this._editSessionManagerContext}),this.lifecycleManager=new T({getContext:this._getContextForPlugin.bind(this),editSessionManager:this.editSessionManager,afterAttach:this._afterAttach.bind(this),afterDetach:this._afterDetach.bind(this),beforeResume:this._beforeResume.bind(this)}),this.surfaceManager=null,this.interactiveHandleManager=null,this.renderer=null}initialize(){const{view:e}=this;this.interactiveHandleManager=new b({view:e,renderer:this.renderer}),this._override("manipulators",this.interactiveHandleManager.manipulators),this.tooltipManager=new I({getDependencies:()=>this._tooltipDependencies,getLastScreenPosition:()=>this.lastScreenPosition}),this.addHandles(s(()=>this.renderer,t=>{t.addOrUpdateVisual(this._shapeVisualId,{role:"outputGeometry"}),t.addOrUpdateVisual(this._vertexVisualId,{role:"vertex"}),this._updatingHandles.addPromise(y(e,t).then(e=>this._snappingVisualizer=e))},d)),this.addHandles([s(()=>this.view,e=>{this.surfaceManager?.destroy(),this.surfaceManager=new k({spatialReference:this.coordinateHelper.spatialReference,excludedGraphicsLayer:null,defaultZ:this.defaultZ,hasZ:this.hasZ,view:e,elevationInfo:this.elevationInfo,getContext:()=>({drawAtFixedElevation:this.globalStateManager.drawAtFixedElevation,elevationConstraint:this.tooltipManager?.elevationConstraint,constraintsEnabled:this.tooltipManager?.constraintsEnabled??!1})})},d),s(()=>this.sketchOptions?.tooltips.effectiveEnabled,()=>this.measurementManager.preloadMeasurementUtils(),{once:!0,initial:!0}),l(()=>this.editSessionManager,"cancelPlugin",({plugin:e})=>{this._suspendPlugin(e)},p),l(()=>this.editSessionManager,"restartPlugin",({restartInfo:e})=>{this._resumePlugin(e)},p),l(()=>this.editGeometryOperations,["vertex-add","vertex-update","vertex-remove"],e=>{const t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),a=t.map(e=>e.coordinates);switch(e.type){case"vertex-add":this.emit(e.type,{...e,added:a,vertices:t});break;case"vertex-update":this.emit(e.type,{...e,updated:a,vertices:t});break;case"vertex-remove":this.emit(e.type,{...e,removed:a,vertices:t})}})])}destroy(){this.active&&this.onDeactivate(),this.editSessionManager.destroy(),this.lifecycleManager.destroy(),this.measurementManager.destroy(),this.globalStateManager.destroy();for(const e of this._pluginContexts.values())e.destroy();this._pluginContexts.clear(),this.surfaceManager=o(this.surfaceManager),this.interactiveHandleManager=o(this.interactiveHandleManager),this.tooltipManager=o(this.tooltipManager)}get _tooltipDependencies(){const{defaultZ:e,editGeometryOperations:t,sketchOptions:a,directionOptions:i,view:n}=this;return t&&a&&n?{defaultZ:e,directionOptions:i,editGeometryOperations:t,sketchOptions:a,view:n,getActiveHandle:()=>this.interactiveHandleManager?.focusedHandle,notifyTooltipsChanged:()=>{const{interactiveHandleManager:e,movementCommandContext:t}=this;e&&t&&e.reapplyPositions(t)}}:null}get _editSessionManagerContext(){const{coordinateHelper:e,view:t}=this;return{coordinateHelper:e,viewingMode:"3d"===t?.type&&"global"===t.viewingMode?1:2}}get updating(){return this._updatingHandles.updating||this.lifecycleManager.updating}get coordinateHelper(){return j(this.hasZ,!1,this.view.spatialReference)}get editGeometry(){return this.editGeometryOperations?.data}get editGeometryOperations(){return this.editSessionManager.editGeometryOperations}get geometry(){return this.editSessionManager.outputGeometry}get canUndo(){return this.editSessionManager.canUndo}get canRedo(){return this.editSessionManager.canRedo}get pluginStack(){return this.lifecycleManager.pluginStack}get mostDownstreamPlugin(){return this.pluginStack.at(-1)}get mostUpstreamPlugin(){return this.pluginStack.at(0)}get positionOfLastUserInput(){return this.lastScreenPosition?this.view.toMap(this.lastScreenPosition):this.view.center}get movementCommandContext(){const{editGeometryOperations:e,tooltipManager:t,surfaceManager:a,snappingManager:i,interactiveHandleManager:n,_snappingVisualizer:r,defaultZ:o,hasZ:s,globalStateManager:{drawAtFixedElevation:d},view:l}=this;return{tooltipManager:t,editGeometryOperations:e,surfaceManager:a,interactiveHandleManager:n,snappingManager:i,snappingVisualizer:r,pointerType:"mouse",hasZ:s,defaultZ:o,view:l,drawAtFixedElevation:d}}get tooltip(){return this.tooltipManager?.tooltip}get activeTooltipInfo(){return this.tooltipManager?.tooltipInfo}begin(e){this.active?(this.lifecycleManager.begin(e),this._pendingBeginRequest=null):this._pendingBeginRequest=e}complete(e){const t=this.lifecycleManager;e&&t.complete(e),0===t.pluginStack.length&&(this.emit("complete",{geometry:this.geometry,aborted:!1,type:"complete",vertices:[]}),this.view?.activeTool===this&&(this.view.activeTool=null))}cancelFirstUserLeafPlugin(){const e=this.pluginStack.toArray().findLast(e=>!0!==e.configuration?.hidden);e&&this.lifecycleManager.cancel(e)}replaceLeaf(e){const t=this.lifecycleManager;t.updating?n.getLogger(this).info("Ignoring command; arrived while updating:","replaceLeaf"):t.replaceLeaf(e)}finishPart(){const e=this.mostUpstreamPlugin,t=e?.configuration;if(this.editGeometryOperations&&t&&t.kind?.includes("multipart")){const e=this.pluginStack.at(1);e&&this.complete(e)}}undo(){this._guardCommand({action:"undo"},()=>this.editSessionManager.undo())}redo(){this._guardCommand({action:"redo"},()=>this.editSessionManager.redo())}executeCommand(e){return this._handleCommand(e)}addPromise(e){return this._updatingHandles.addPromise(e)}onActivate(){super.onActivate();const{view:e}=this;this.lastScreenPosition=e?.inputManager.latestPointerInfo?.location,this.renderer?.activate(),this._pendingBeginRequest&&(this.begin(this._pendingBeginRequest),this._pendingBeginRequest=null),this.addHandles([c(()=>this.geometry,e=>{this.renderer?.addOrUpdateVisual(this._shapeVisualId,{geometry:e}),this.renderer?.addOrUpdateVisual(this._vertexVisualId,{geometry:e?f(e):null})},d),s(()=>this.interactiveHandleManager?.capturingHandle?.screenPosition,e=>this.lastScreenPosition=e,{initial:!0,equals:g}),c(()=>this.interactiveHandleManager?.capturingHandle?.outputMapPosition,(e,t)=>{const a=this.interactiveHandleManager?.capturingHandle?.editSession?.endVertex;e&&t&&a&&this.emit("cursor-update",{updated:a.pos,type:"vertex-update",operation:"apply",vertices:[{componentIndex:a.part.index,vertexIndex:a.index,coordinates:a.pos}]})},p),this._keybindings.register(e,O.TOOL),c(()=>e.viewpoint,(e,t)=>{e&&t&&h(e,t)&&this._handleCommand({action:"viewpoint-moved"})})],G)}onDeactivate(){super.onDeactivate(),this.removeHandles(G),this.renderer?.deactivate(),this.snappingManager?.doneSnapping(),this.lifecycleManager.cancelAll(),this._pendingBeginRequest=null}onInputEvent(e){const t=H(e);t&&this._handleCommand(t)}async _handleCommand(e){if(this.lifecycleManager.updating)n.getLogger(this).info("Ignoring command; arrived while updating:",e.action);else switch(e.action){case"view-drag":return await this._handleViewDragCommand(e);case"vertex-add":return this._guardCommand(e,()=>{_(e),this._commitNext()});case"vertex-add-and-finish-part":return this._handleVertexAddAndFinishPartCommand(e);case"cancel":return this._guardCommand(e,()=>this.cancel());case"complete":return this._guardCommand(e,()=>{this.mostUpstreamPlugin&&(_(e),this.complete(this.mostUpstreamPlugin))});case"finish-part":return this._guardCommand(e,()=>this.finishPart());case"undo":return this._guardCommand(e,()=>this.editSessionManager.undo());case"redo":return this._guardCommand(e,()=>this.editSessionManager.redo());case"next-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("forward"));case"previous-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("backward"));case"toggle-manipulator-follow":this.interactiveHandleManager?.toggleFollow()&&_(e);break;case"viewpoint-moved":return await this._handleViewpointMovedCommand(e);case"manipulator-move-to":return await this._handleManipulatorMoveToCommand(e);case"manipulator-drag-to":return await this._handleManipulatorDragToCommand(e);case"vertex-add-at-point":return await this._handleVertexAddAtPointCommand(e);case"show-tooltip":return this._guardCommand(e,async()=>{const t=this.tooltipManager?.tooltip;t&&R(t.info)&&(await t.enterInputMode(),_(e))});case"constraint-center":this.globalStateManager.setCentered(e.enabled);break;case"constraint-aspect":this.globalStateManager.setPreserveAspectRatio(e.enabled)}}async _handleViewDragCommand(e){if(!this.editable)return;const t=e.originalEvent,a=this.interactiveHandleManager?.capturingHandle;(!t||!("pointerType"in t)||"touch"!==t.pointerType||"capture-always"!==a?.captureMode&&"capture-when-engaged"!==a?.captureMode)&&"capture-when-engaged"!==this.interactiveHandleManager?.capturingHandle?.captureMode?this._before(e)&&_(e):_(e)}_handleVertexAddAndFinishPartCommand(e){this._before(e)||(_(e),this._commitNext(),this.finishPart())}async _handleViewpointMovedCommand(e){this.editable&&(await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(null,{...this.movementCommandContext,pointerType:w(e.originalEvent)})),this.interactiveHandleManager?.updateAllScreenPositions())}async _handleManipulatorMoveToCommand(e){if(!this.editable)return;const t=this._updateLastScreenPosition(e);this.interactiveHandleManager?.capturingHandle&&_(e),await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(t,{...this.movementCommandContext,pointerType:w(e.originalEvent)}))}async _handleManipulatorDragToCommand(e){if(!this.editable)return;const t=w(e.originalEvent),a=this._updateLastScreenPosition(e),i=this.interactiveHandleManager?.findHandleByManipulator(a);"touch"===t&&i&&"start"===e.state&&this.interactiveHandleManager?.releaseHandle();const n=this.interactiveHandleManager?.findHandleDragging(),r=this.interactiveHandleManager?.capturingHandle,o=n??r??i;o&&!i&&_(e),"capture-when-engaged"===o?.captureMode||"capture-always"===o?.captureMode&&"touch"===t?"end"===e.state?await this._updatingHandles.addPromise(o.noteDragEnd(a,{...this.movementCommandContext,pointerType:t}).then(()=>{o&&"touch"===w(e.originalEvent)&&"grabbable-object"!==o.captureMode&&"capture-when-engaged"!==o.defaultCaptureMode&&"primary"===o.role&&(1===this.interactiveHandleManager?.handleCount?this._handleCommand({action:"vertex-add"}):this.interactiveHandleManager?.releaseHandle())})):"start"===e.state?await this._updatingHandles.addPromise(o.noteDragStart(a,{...this.movementCommandContext,pointerType:t}).then(()=>{o&&"touch"===w(e.originalEvent)&&"grabbable-object"!==o.captureMode&&"capture-when-engaged"!==o.defaultCaptureMode&&!o.editSession?.lastPointAddedBySession&&this._handleCommand({action:"vertex-add"})})):await this._updatingHandles.addPromise(o?.moveTo(a,{...this.movementCommandContext,pointerType:w(e.originalEvent)})):"grabbable-object"===o?.captureMode&&(this.interactiveHandleManager?.releaseHandle(r),await this._updatingHandles.addPromise(o.moveTo(a,{...this.movementCommandContext,pointerType:t})))}async _handleVertexAddAtPointCommand(e){const t=this._updateLastScreenPosition(e),a=this.interactiveHandleManager?.capturingHandle??this.interactiveHandleManager?.findHandleByManipulator(t);this.editable&&a&&(this._before(e)||(_(e),await this._updatingHandles.addPromise(a.moveTo(t,{...this.movementCommandContext,skipSnapping:!0,pointerType:w(e.originalEvent)}).finally(()=>this._commitNext()))))}_makeKeyBindings(){const e=new V,t=(t,a)=>{e.addToggle(t,e=>this._handleCommand({action:a,originalEvent:e,enabled:"key-down"===e.type}))},a=(t,a)=>{e.add(t,e=>this._handleCommand({action:a,originalEvent:e}))};return t(E.preserveAspectRatio,"constraint-aspect"),t(U.center,"constraint-center"),a(D.toggleFollowManipulator,"toggle-manipulator-follow"),a(U.undo,"undo"),a(U.redo,"redo"),a(U.complete,"complete"),a(U.vertexAdd,"vertex-add"),a({key:L.enterInputMode,continuePropagation:!0,repeats:!0},"show-tooltip"),e}_afterAttach(){}_afterDetach(e){this.interactiveHandleManager?.unregisterCustomConstraint(e),this.interactiveHandleManager?.unregisterHandle(e),this.tooltipManager?.unregisterPluginFields(e),this.globalStateManager.clearPluginOverrides(e);const t=this._pluginContexts.get(e);t&&(t.destroy(),this._pluginContexts.delete(e))}_beforeResume(e,t){this.interactiveHandleManager?.replaceEditSessions(e,t)}_commitNext(){const a={stack:[],error:void 0,hasError:!1};try{const t=this.mostDownstreamPlugin;if(!t)return;let n=!1;const r=this.editGeometryOperations;e(a,r?i(r.on("vertex-add",()=>n=!0)):null,!1);t.completeStep?t.completeStep():this.complete(t),n&&this.tooltipManager?.unlockOnVertexPlacement()}catch(n){a.error=n,a.hasError=!0}finally{t(a)}}_suspendPlugin(e){this.lifecycleManager.suspend(e),this.measurementManager.suspendPlugin(e)}_resumePlugin(e){this.lifecycleManager.resume(e)}_updateLastScreenPosition(e){const t=u(e.x,e.y);return this.lastScreenPosition=t,t}_getContextForPlugin(e,t){const a=r(this._pluginContexts,e,()=>new C({drawTool:this,plugin:e,session:t}));return a.session=t,a}_before(e){if(!this.hasEventListener(`before-${e.action}`))return!1;const t=new CustomEvent(`before-${e.action}`,{detail:e,cancelable:!0});return this.emit(`before-${e.action}`,t),t.defaultPrevented}_guardCommand(e,t,a){return this._before(e)?a?.():t()}};a([m()],Z.prototype,"_snappingVisualizer",void 0),a([m()],Z.prototype,"_tooltipDependencies",null),a([m()],Z.prototype,"_editSessionManagerContext",null),a([m({constructOnly:!0,nonNullable:!0})],Z.prototype,"view",void 0),a([m()],Z.prototype,"automaticManipulatorSelection",void 0),a([m()],Z.prototype,"updating",null),a([m()],Z.prototype,"coordinateHelper",null),a([m()],Z.prototype,"editGeometry",null),a([m()],Z.prototype,"editGeometryOperations",null),a([m()],Z.prototype,"geometry",null),a([m()],Z.prototype,"snappingManager",void 0),a([m()],Z.prototype,"sketchOptions",void 0),a([m()],Z.prototype,"elevationInfo",void 0),a([m()],Z.prototype,"hasZ",void 0),a([m()],Z.prototype,"defaultZ",void 0),a([m()],Z.prototype,"directionOptions",void 0),a([m()],Z.prototype,"canUndo",null),a([m()],Z.prototype,"canRedo",null),a([m()],Z.prototype,"pluginStack",null),a([m()],Z.prototype,"mostDownstreamPlugin",null),a([m()],Z.prototype,"mostUpstreamPlugin",null),a([m()],Z.prototype,"lastScreenPosition",void 0),a([m()],Z.prototype,"positionOfLastUserInput",null),a([m()],Z.prototype,"tooltipManager",void 0),a([m()],Z.prototype,"measurementManager",void 0),a([m()],Z.prototype,"globalStateManager",void 0),a([m()],Z.prototype,"editSessionManager",void 0),a([m()],Z.prototype,"lifecycleManager",void 0),a([m()],Z.prototype,"surfaceManager",void 0),a([m()],Z.prototype,"interactiveHandleManager",void 0),a([m()],Z.prototype,"renderer",void 0),a([m()],Z.prototype,"movementCommandContext",null),a([m()],Z.prototype,"tooltip",null),a([m()],Z.prototype,"activeTooltipInfo",null),Z=a([v("esri.views.draw.DrawTool")],Z);export{Z as DrawTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import o from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import{watch as i,initial as r}from"../../../core/reactiveUtils.js";import{property as s,subclass as a}from"../../../core/accessorSupport/decorators.js";import p from"../../../geometry/Point.js";import l from"../../../geometry/Polyline.js";import{isBezierCurve as c}from"../../../geometry/support/curves/curveUtils.js";import{PluginBase as h}from"./PluginBase.js";const d=Symbol("left-vertex"),u=Symbol("right-vertex"),_=Symbol("cp1"),P=Symbol("cp2"),m=Symbol("endpoint"),f=Symbol("anchor");let y=class extends h{constructor(){super(...arguments),this._controlPoint1LineId=Symbol(),this._controlPoint2LineId=Symbol(),this._mirroredCp2VisualId=Symbol(),this.enableSplineBehavior=!0,this.state="placing-anchor"}get
|
|
2
|
+
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import o from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import{watch as i,initial as r}from"../../../core/reactiveUtils.js";import{property as s,subclass as a}from"../../../core/accessorSupport/decorators.js";import p from"../../../geometry/Point.js";import l from"../../../geometry/Polyline.js";import{isBezierCurve as c}from"../../../geometry/support/curves/curveUtils.js";import{PluginBase as h}from"./PluginBase.js";const d=Symbol("left-vertex"),u=Symbol("right-vertex"),_=Symbol("cp1"),P=Symbol("cp2"),m=Symbol("endpoint"),f=Symbol("anchor");let y=class extends h{constructor(){super(...arguments),this._controlPoint1LineId=Symbol(),this._controlPoint2LineId=Symbol(),this._mirroredCp2VisualId=Symbol(),this.enableSplineBehavior=!0,this.state="placing-anchor"}get test(){return{computeCurve:this._computeCurve.bind(this),recomputeAndApply:this._recomputeAndApply.bind(this),cp1LineSymbol:this._controlPoint1LineId,cp2LineSymbol:this._controlPoint2LineId,controlPointId:this._mirroredCp2VisualId}}start(t,e){super.start(t,e);const o=t.session;o.preserveSharedRedoAfterOperation=!0,this.ownPlacedLeftAnchor=e?.ownPlacedLeftAnchor,this.leftAnchor=o.getInformationAboutPoint(-1,-1)?.point;let n=e?.state;if(!this.leftAnchor&&this.ownPlacedLeftAnchor?(this.leftAnchor=this.ownPlacedLeftAnchor,o.appendOrReplacePoint(d,this.leftAnchor),o?.groupGeometryChanges()):this.leftAnchor&&"placing-anchor"===e?.state&&(n="placing-control-point-1",this.ownPlacedLeftAnchor=null),this.state=this.leftAnchor?n??"placing-control-point-1":"placing-anchor",this.controlPoint1=e?.controlPoint1,this.endPoint=e?.endPoint,this.controlPoint2=e?.controlPoint2,this.enableSplineBehavior&&"placing-control-point-1"===this.state&&!n){const t=o.getInformationAboutPoint(-1,-1);if(t?.curveInfo&&c(t.curveInfo)){const[e,n]=t.curveInfo.b[2],{spatialReference:i}=t.point,r=new p({x:e,y:n,spatialReference:i}),s=g(t.point,r);this.controlPoint1=s,o?.pushUndoStep(this._captureState()),this.state="placing-endpoint",o?.pushUndoStep(this._captureState())}}this.addHandles([i(()=>this._anchorCursor?.outputMapPosition,t=>{t&&(this.leftAnchor=this.ownPlacedLeftAnchor=t,this._session?.appendOrReplacePoint(d,t))}),i(()=>this._cp1Cursor?.outputMapPosition,t=>{t&&(this.controlPoint1=t,this._recomputeAndApply())}),i(()=>this._endpointCursor?.outputMapPosition,t=>{t&&(this.endPoint=t,this._recomputeAndApply())}),i(()=>this._cp2Cursor?.outputMapPosition,t=>{t&&(this.controlPoint2=t,this._recomputeAndApply())})],this._ownHandlesKey),this._applyState(this.state),this._setupRendering(t)}completeStep(){if(this._isComplete)return;const t=this._session?.peekUndoStep();if(t){const e=this._captureState();t&&t.state===e?.state&&(t.controlPoint1=e.controlPoint1,t.controlPoint2=e.controlPoint2,t.endPoint=e.endPoint,t.leftAnchor=e.leftAnchor)}else this._session?.pushUndoStep(this._captureState());try{switch(this._session.preserveSharedRedoAfterOperation=!1,this.state){case"placing-anchor":this._applyState(this.state="placing-control-point-1");break;case"placing-control-point-1":this._applyState(this.state="placing-endpoint");break;case"placing-endpoint":this._applyState(this.state="placing-control-point-2");break;case"placing-control-point-2":this._context?.requestComplete()}}finally{this._session.preserveSharedRedoAfterOperation=!0}this._session?.pushUndoStep(this._captureState())}beforeAttachPlugin(t){return{useStandaloneSession:!0}}suspend(){return this._captureState()}_applyState(t){const e=this._session;if(!e)throw new o("drawTool:invalid-state","Bezier: attempted to apply state while context invalid");switch(e.automaticRestart=!1,this.removeHandles(_),this.removeHandles(m),this.removeHandles(P),this.removeHandles(f),t){case"placing-anchor":e.automaticRestart=!0,this._setupAnchorCursor();break;case"placing-control-point-1":{const{ownPlacedLeftAnchor:t}=this;e.automaticRestart=!t,t&&e.groupGeometryChanges(),this._setupCP1Cursor();break}case"placing-endpoint":this._setupCP1Cursor(),this._setupEndpointCursor();break;case"placing-control-point-2":this._setupCP1Cursor(),this._setupEndpointCursor(),this._setupCP2Cursor()}}_setupAnchorCursor(){this._anchorCursor=this._context.createInteractiveHandle({defaultCaptureMode:"capture-always",inputMapPosition:this._context.positionOfLastUserInput,role:"primary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(n(()=>{this._anchorCursor&&(this._context?.removeInteractiveHandle(this._anchorCursor),this._anchorCursor=null)}),f)}_setupCP1Cursor(){const t="placing-control-point-1"===this.state?"capture-always":"grabbable-object";this._cp1Cursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.controlPoint1,role:"secondary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(n(()=>{this._cp1Cursor&&(this._context?.removeInteractiveHandle(this._cp1Cursor),this._cp1Cursor=null)}),_)}_setupEndpointCursor(){const t="placing-endpoint"===this.state?"capture-always":"grabbable-object";this._endpointCursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.endPoint??this.controlPoint1,role:"primary",selfSnappingEnabled:!0,snappingEnabled:!0}),this.addHandles(n(()=>{this._endpointCursor&&(this._context?.removeInteractiveHandle(this._endpointCursor),this._endpointCursor=null)}),m)}_setupCP2Cursor(){const t="placing-control-point-2"===this.state?"capture-always":"grabbable-object";this._cp2Cursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.controlPoint2??this.endPoint??this._context.positionOfLastUserInput,role:"secondary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(n(()=>{this._cp2Cursor&&(this._context?.removeInteractiveHandle(this._cp2Cursor),this._cp2Cursor=null)}),P)}_computeCurve(){const{leftAnchor:t,controlPoint1:e,endPoint:o,controlPoint2:n,state:i}=this;return t?"placing-control-point-1"===i&&e?C(e,e,e):"placing-endpoint"===i&&e&&o?C(o,e,o):e&&o&&n?C(o,e,n,{flipControlPoint2:!0}):null:null}_recomputeAndApply(){const t=this._computeCurve();t&&this._session?.appendOrReplaceCurve(u,t)}_setupRendering(t){t.addOrUpdateVisual(this._controlPoint1LineId,{role:"constructionLine",state:"idle"}),t.addOrUpdateVisual(this._controlPoint2LineId,{role:"constructionLine",state:"idle"}),t.addOrUpdateVisual(this._mirroredCp2VisualId,{role:"controlPoint",state:"idle"}),this.addHandles([i(()=>[this.controlPoint1,this.controlPoint2,this.endPoint,this.leftAnchor],([e,o,n,i])=>{const{state:r}=this;if(i&&e&&"placing-control-point-1"!==r&&"placing-anchor"!==r){const o=new l({paths:[[[i.x,i.y],[e.x,e.y]]],spatialReference:i.spatialReference});t.addOrUpdateVisual(this._controlPoint1LineId,{geometry:o})}else t.addOrUpdateVisual(this._controlPoint1LineId,{geometry:null});if(o&&n&&i){const e=g(n,o),i=new l({paths:[[[o.x,o.y],[e.x,e.y]]],spatialReference:o.spatialReference});t.addOrUpdateVisual(this._controlPoint2LineId,{geometry:i}),t.addOrUpdateVisual(this._mirroredCp2VisualId,{geometry:e})}else t.addOrUpdateVisual(this._controlPoint2LineId,{geometry:null}),t.addOrUpdateVisual(this._mirroredCp2VisualId,{geometry:null})},r)],this._ownHandlesKey)}_captureState(){const{state:t,controlPoint1:e,controlPoint2:o,endPoint:n,leftAnchor:i,ownPlacedLeftAnchor:r}=this;return{state:t,controlPoint1:e,endPoint:n,controlPoint2:o,leftAnchor:i,ownPlacedLeftAnchor:r}}};function C(t,o,n,i){const r=[t.x,t.y,t.z,t.m].filter(e),s=i?.flipControlPoint2?g(t,n):n;return{b:[r,[o.x,o.y],[s.x,s.y]]}}function g(t,e){const{x:o,y:n,spatialReference:i}=t,{x:r,y:s}=e;return new p({x:o+(o-r),y:n+(n-s),spatialReference:i})}t([s()],y.prototype,"_anchorCursor",void 0),t([s()],y.prototype,"_cp1Cursor",void 0),t([s()],y.prototype,"_endpointCursor",void 0),t([s()],y.prototype,"_cp2Cursor",void 0),t([s()],y.prototype,"enableSplineBehavior",void 0),t([s()],y.prototype,"state",void 0),t([s()],y.prototype,"controlPoint1",void 0),t([s()],y.prototype,"controlPoint2",void 0),t([s()],y.prototype,"endPoint",void 0),t([s()],y.prototype,"leftAnchor",void 0),t([s()],y.prototype,"ownPlacedLeftAnchor",void 0),y=t([a("esri.views.draw.plugins.BezierSegmentPlugin")],y);export{y as BezierSegmentPlugin,C as createBezier,g as mirrorControlPoint};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{makeHandle as i}from"../../../core/handleUtils.js";import{watch as r}from"../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../core/accessorSupport/decorators.js";import{geometryToCoordinates as s}from"../../../geometry/support/coordsUtils.js";import{PluginBase as a}from"./PluginBase.js";const p=Symbol("left-anchor-vertex"),c=Symbol("right-vertex"),h=Symbol("anchor"),l=Symbol("endpoint"),d=Symbol("interior-point");let u=class extends a{constructor(){super(...arguments),this.arcDrawingMode="interior-first",this.state="placing-anchor"}get test(){return{state:this.state,captureState:()=>this._captureState()}}start(t,e){super.start(t,e);const i=t.session;i.preserveSharedRedoAfterOperation=!0,this.ownPlacedLeftAnchor=e?.ownPlacedLeftAnchor,this.leftAnchor=i.getInformationAboutPoint(-1,-1)?.point;let o=e?.state;!this.leftAnchor&&this.ownPlacedLeftAnchor?(this.leftAnchor=this.ownPlacedLeftAnchor,i.appendOrReplacePoint(p,this.leftAnchor),i?.groupGeometryChanges()):this.leftAnchor&&"placing-anchor"===e?.state&&(o=this._getNextState("placing-anchor"),this.ownPlacedLeftAnchor=null),this.state=this.leftAnchor?o??this._getNextState("placing-anchor"):"placing-anchor",this.interiorPoint=e?.interiorPoint,this.endpoint=e?.endpoint,this.addHandles([r(()=>this._anchorCursor?.outputMapPosition,t=>{t&&(this.leftAnchor=this.ownPlacedLeftAnchor=t,this._session?.appendOrReplacePoint(p,t))}),r(()=>this._interiorPointCursor?.outputMapPosition,t=>{t&&(this.interiorPoint=t,this._recomputeAndApply())}),r(()=>this._endpointCursor?.outputMapPosition,t=>{t&&(this.endpoint=t,this._recomputeAndApply())})],this._ownHandlesKey),this._applyState(this.state)}async completeStep(){if(this._isComplete)return;const t=this._session?.peekUndoStep();if(t){const e=this._captureState();t&&t.state===e.state&&(t.leftAnchor=e.leftAnchor,t.interiorPoint=e.interiorPoint,t.endpoint=e.endpoint)}else this._session?.pushUndoStep(this._captureState());"placing-anchor"===this.state&&this.ownPlacedLeftAnchor&&this._session?.groupGeometryChanges();try{this._session.preserveSharedRedoAfterOperation=!1;const t=this._getNextState(this.state);null===t?this._context?.requestComplete():this._applyState(this.state=t)}finally{this._session.preserveSharedRedoAfterOperation=!0}this._session?.pushUndoStep(this._captureState())}beforeAttachPlugin(t){return{useStandaloneSession:!0}}suspend(){return this._captureState()}_applyState(t){const i=this._session;if(!i)throw new e("drawTool:invalid-state","Circular Arc: attempted to apply state while context invalid");this.removeHandles(h),this.removeHandles(l),this.removeHandles(d),i.automaticRestart=this._computeAutomaticRestart(),"placing-anchor"!==t?("placing-interior"!==t&&"interior-first"!==this.arcDrawingMode||this._setupInteriorPointCursor(),"placing-endpoint"!==t&&"end-first"!==this.arcDrawingMode||this._setupEndpointCursor()):this._setupAnchorCursor()}_setupAnchorCursor(){this._anchorCursor=this._context.createInteractiveHandle({defaultCaptureMode:"capture-always",inputMapPosition:this._context.positionOfLastUserInput,role:"primary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(i(()=>{this._anchorCursor&&(this._context?.removeInteractiveHandle(this._anchorCursor),this._anchorCursor=null)}),h)}_setupInteriorPointCursor(){const t="placing-interior"===this.state?"capture-always":"grabbable-object";this._interiorPointCursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.interiorPoint??this.endpoint,role:"secondary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(i(()=>{this._interiorPointCursor&&(this._context?.removeInteractiveHandle(this._interiorPointCursor),this._interiorPointCursor=null)}),d)}_setupEndpointCursor(){const t="placing-endpoint"===this.state?"capture-always":"grabbable-object";this._endpointCursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.endpoint??this.interiorPoint,role:"primary",selfSnappingEnabled:!0,snappingEnabled:!0}),this.addHandles(i(()=>{this._endpointCursor&&(this._context?.removeInteractiveHandle(this._endpointCursor),this._endpointCursor=null)}),l)}_captureState(){const{state:t,endpoint:e,interiorPoint:i,leftAnchor:r,ownPlacedLeftAnchor:o}=this;return{state:t,endpoint:e,interiorPoint:i,leftAnchor:r,ownPlacedLeftAnchor:o}}_computeAutomaticRestart(){return"placing-anchor"===this.state||("placing-interior"===this.state?"interior-first"===this.arcDrawingMode&&!this.ownPlacedLeftAnchor:"end-first"===this.arcDrawingMode&&!this.ownPlacedLeftAnchor)}_makeCurve(){const{interiorPoint:t,endpoint:e}=this;if(!t&&!e)return null;const i=e??t,r=s(t??e);return{c:[s(i),_(r)]}}_recomputeAndApply(){const t=this._makeCurve();t&&this._session?.appendOrReplaceCurve(c,t)}_getNextState(t){switch(t){case"placing-anchor":return"interior-first"===this.arcDrawingMode?"placing-interior":"placing-endpoint";case"placing-interior":return"interior-first"===this.arcDrawingMode?"placing-endpoint":null;case"placing-endpoint":return"end-first"===this.arcDrawingMode?"placing-interior":null}}};function _(t){return 2===t.length?t:[t[0]??0,t[1]??0]}t([o()],u.prototype,"_anchorCursor",void 0),t([o()],u.prototype,"_endpointCursor",void 0),t([o()],u.prototype,"_interiorPointCursor",void 0),t([o()],u.prototype,"arcDrawingMode",void 0),t([o()],u.prototype,"interiorPoint",void 0),t([o()],u.prototype,"endpoint",void 0),t([o()],u.prototype,"leftAnchor",void 0),t([o()],u.prototype,"ownPlacedLeftAnchor",void 0),t([o()],u.prototype,"state",void 0),u=t([n("esri.views.draw.plugins.CircularArcSegmentPlugin")],u);export{u as CircularArcSegmentPlugin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import o from"../../../core/Collection.js";import{EventedAccessor as i}from"../../../core/Evented.js";import{disposable as s}from"../../../core/handleUtils.js";import n from"../../../core/ReactiveSet.js";import{deleteMany as a,addMany as p}from"../../../core/SetUtils.js";import{property as d,subclass as c}from"../../../core/accessorSupport/decorators.js";import{isCoordinate as h}from"../../../geometry/support/curves/curveUtils.js";import{UndoGroup as l}from"../../interactive/editGeometry/operations/UndoGroup.js";let y=class extends i{constructor(e){super(e),this._vertexRegistry=new Map,this._partRegistry=new Map,this._reverseVertexRegistry=new WeakMap,this._reversePartRegistry=new WeakMap,this.plugin=null,this.stepUndoStack=new o,this.stepRedoStack=new o,this.startingVertex=null,this.endVertex=null,this.vertices=new Set,this.operations=new n,this.undoneOperations=new Set,this.automaticRestart=!0,this.preserveSharedRedoAfterOperation=!1}get firstPointAddedBySession(){const{startingVertex:e}=this;return e?this._toVertexInfo(e):null}get lastPointAddedBySession(){const{endVertex:e}=this;return e?this._toVertexInfo(e):null}pushUndoStep(e){this.editGeometryOperations.resetRedoStack(),this.stepUndoStack.push(e??{}),this.stepRedoStack.length=0}peekUndoStep(){return this.stepUndoStack.at(-1)}restoreState(e){if(!e)return;const{undoSteps:t,redoSteps:r,automaticRestart:o}=e;void 0!==o&&(this.automaticRestart=o),t&&this.stepUndoStack.addMany(t),r&&this.stepRedoStack.addMany(r)}getInformationAboutPoint(e,t){const{parts:r,allVertices:o,coordinateHelper:i}=this.editGeometryOperations.data;if(!r.length||!o.length)return null;const s=r.at(t??-1),n=s?.vertices.at(e);if(!n)return null;const a=n.leftSegment?.toCurveOrCoordinate(),p=a&&!h(a)?a:void 0;return{point:i.vectorToPoint(n.pos),curveInfo:p,partIndex:n.part.index,pointIndex:n.index}}appendOrReplacePoint(e,t,r){const o=this.editGeometryOperations.data.coordinateHelper.pointToVector(t);this.appendOrReplaceCurve(e,o,r)}appendOrReplaceCurve(e,t,r){const o=e?this._vertexRegistry.get(e):null;if(o&&!r?.forceAppend)return this._applyInternal(()=>this.editGeometryOperations.setVertexPosition(o,t)),void this.notifyChange("endVertex");const i=this._applyInternal(()=>this.editGeometryOperations.appendVertex(t,this.editGeometryOperations.data.parts.at(-1),"polygon"===this.editGeometryOperations.data.type));if(!i)return;this.notifyChange("endVertex");const s=i.addedVertices.at(-1);s&&e&&(this._vertexRegistry.set(e,s),this._reverseVertexRegistry.set(s,e))}appendOrReplacePart(e,t,r){const o=e?this._partRegistry.get(e):null,i=o&&this.editGeometryOperations.data.parts.includes(o)?o:null,s=this._applyInternal(()=>this.editGeometryOperations.addOrUpdatePart(t,r?.forceAppend?null:i));if(!s)return;this.notifyChange("endVertex"),this.notifyChange("startingVertex");const n=s.addedVertices.at(-1)?.part;n&&e&&(this._partRegistry.set(e,n),this._reversePartRegistry.set(n,e))}groupGeometryChanges(e){const{operations:t}=this;try{this.editGeometryOperations.disableDefaultRedoBehavior=this.preserveSharedRedoAfterOperation;const r=this.editGeometryOperations.groupOperations(r=>t.has(r)&&(e||!(r instanceof l)));if(r){const{group:e,operations:o}=r;a(t,o),t.add(e)}}finally{this.editGeometryOperations.disableDefaultRedoBehavior=!1}}generatePreviewGeometry(e){const{endVertex:t,startingVertex:r,editGeometryOperations:o}=this,i=e.includeAutomaticConnection?r?.leftSegment?.leftVertex??r:r,s=this._resolveVertex(e?.firstIncludedPoint,i),n=this._resolveVertex(e?.lastIncludedPoint,t);return s||n?o?.data?.getPartialGeometry(s,n,e.geometryType):null}complete(){this.emit("completed",{})}sessionIsOperatingOnSameGeometry(e){return this.editGeometryOperations===e?.editGeometryOperations}eraseLastOperation(){const e=this.editGeometryOperations.lastOperation;if(!e||!this.operations.has(e))return;this._applyInternal(()=>this.editGeometryOperations.undo(),"undo")&&(this.notifyChange("endVertex"),this.notifyChange("startingVertex"))}syncVertices(e){const{vertices:t}=this,r=[];if(e)for(const s of e){const{addedVertices:e,removedVertices:o,addedParts:i,removedParts:n}=s;if(o){a(t,o);for(const e of o){const t=this._reverseVertexRegistry.get(e);t&&this._vertexRegistry.delete(t)}}if(e){p(t,e),r.push(...e);for(const t of e){const e=this._reverseVertexRegistry.get(t);e&&this._vertexRegistry.set(e,t)}}if(i)for(const t of i){const e=this._reversePartRegistry.get(t);e&&this._partRegistry.set(e,t)}if(n)for(const t of n){const e=this._reversePartRegistry.get(t);e&&this._partRegistry.delete(e)}}let o=null,i=null;for(const s of t)(!o||s.part.index<o.part.index||s.part.index===o.part.index&&s.index<=o.index)&&(o=s),(!i||s.part.index>i.part.index||s.part.index===i.part.index&&s.index>i.index)&&(i=s);return this.startingVertex=o,this.endVertex=i,r}mergeSession(e){this?.sessionIsOperatingOnSameGeometry(e)&&(p(this.vertices,e.vertices),p(this.operations,e.operations),p(this.undoneOperations,e.undoneOperations),this.syncVertices())}_applyInternal(e,t="apply"){let r=null;const o={session:this,blockApply:void 0};if(this.emit("before-apply-operation",o),o.blockApply)return null;const{editGeometryOperations:i}=this,s=u(i,()=>{try{i.disableDefaultRedoBehavior=this.automaticRestart||this.preserveSharedRedoAfterOperation||"undo"===t,r=e()}finally{i.disableDefaultRedoBehavior=!1}});r&&i.undoHas(r)&&"apply"===t&&this.operations.add(r);const n=this.syncVertices(s);return{operation:r,addedVertices:n}}_toVertexInfo(e){const t=e.leftSegment?.toCurveOrCoordinate(),r=!t||h(t)?void 0:t,o=e.part.index,i=e.index;return{point:this.editGeometryOperations.data.coordinateHelper.vectorToPoint(e.pos),curveInfo:r,partIndex:o,pointIndex:i}}_resolveVertex(e,t){return void 0!==e?.partIndex&&void 0!==e.pointIndex?this.editGeometryOperations.data.parts.at(e.partIndex)?.vertices.at(e.pointIndex)??null:t}};function u(r,o){const i={stack:[],error:void 0,hasError:!1};try{const t=[];e(i,s(r.data.on("change",e=>t.push(e))),!1);return o(),t}catch(n){i.error=n,i.hasError=!0}finally{t(i)}}r([d()],y.prototype,"plugin",void 0),r([d()],y.prototype,"stepUndoStack",void 0),r([d()],y.prototype,"stepRedoStack",void 0),r([d()],y.prototype,"startingVertex",void 0),r([d()],y.prototype,"endVertex",void 0),r([d({constructOnly:!0})],y.prototype,"editGeometryOperations",void 0),r([d()],y.prototype,"vertices",void 0),r([d()],y.prototype,"operations",void 0),r([d()],y.prototype,"undoneOperations",void 0),r([d()],y.prototype,"firstPointAddedBySession",null),r([d()],y.prototype,"lastPointAddedBySession",null),r([d()],y.prototype,"automaticRestart",void 0),r([d()],y.prototype,"preserveSharedRedoAfterOperation",void 0),y=r([c("esri.views.draw.support.EditSession")],y);export{y as EditSession,u as captureGeometryChangeEvents};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import{makeHandle as o}from"../../../core/handleUtils.js";import{createScalar as a,createLength as i,toUnit as s}from"../../../core/quantity.js";import{generateUUID as n}from"../../../core/uuid.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{isWebMercator as p,isGeographic as u}from"../../../geometry/support/spatialReferenceUtils.js";import{createViewAlignedCoordinateSystem as c}from"./surfaceCoordinateSystems.js";import{knownFieldDisplayOrders as m}from"./types.js";import{createGeographicCoordinate as g}from"../../interactive/tooltip/fields/parsingAndFormattingUtils.js";import{elevationFromPoint as h}from"../../support/euclideanLengthMeasurementUtils.js";const f={x:m.Coordinates+10,y:m.Coordinates+11,elevation:m.Coordinates+12};let w=class extends t{constructor(e){super(e)}normalizeCtorArgs(e){const{drawTool:t,plugin:r,...o}=e;return{_drawTool:t,_plugin:r,...o}}get positionOfLastUserInput(){return this._drawTool.positionOfLastUserInput}getSession(e){return this._drawTool.editSessionManager.getSession(e)}createInteractiveHandle(e,t){const o=this._drawTool.interactiveHandleManager,i=this._drawTool.tooltipManager,s=this._plugin,l=this.session,d=this._drawTool.coordinateHelper;if(!o||!i)throw new r("draw-tool:interactive-handle-missing-dependencies","Attempted to set up an interactive handle without required dependencies.");const c=e.name??n(),m=e.defaultCaptureMode??"capture-always",h=o.registerHandle(s,{...e,name:c,editSession:l,defaultCaptureMode:m,captureMode:m});if(this._drawTool.addPromise(o.setupManipulatorForHandle(h,this._drawTool.lastScreenPosition,this._drawTool.movementCommandContext)),!t?.disableDefaultXYFields){const e=d.spatialReference;p(e)||u(e)?(i.createMeasuredField(s,{id:Symbol(`tooltip-long-${c}`),preset:"longitude",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>g(e?.longitude),fieldProperties:{displayOrder:f.x},fieldFilters:{appliesToHandlesWithName:c}}),i.createMeasuredField(s,{id:Symbol(`tooltip-lat-${c}`),preset:"latitude",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>g(e?.latitude),fieldProperties:{displayOrder:f.y},fieldFilters:{appliesToHandlesWithName:c}})):(i.createMeasuredField(s,{id:Symbol(`tooltip-x-${c}`),preset:"x",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>e?a(e.x):null,fieldProperties:{displayOrder:f.x},fieldFilters:{appliesToHandlesWithName:c}}),i.createMeasuredField(s,{id:Symbol(`tooltip-y-${c}`),preset:"y",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>e?a(e.y):null,fieldProperties:{displayOrder:f.y},fieldFilters:{appliesToHandlesWithName:c}})),this._drawTool.hasZ&&"primary"===h.role&&i.createMeasuredField(s,{id:Symbol(`tooltip-z-${c}`),preset:"elevation",getMeasurementInput:()=>h.outputMapPosition,measure:async(e,t)=>this.measureElevation(e,t.inputUnitInfos.verticalLength.unit),fieldProperties:{displayOrder:f.elevation},fieldFilters:{appliesToHandlesWithName:c}})}return h}removeInteractiveHandle(e){const t=e;this._drawTool.interactiveHandleManager?.unregisterHandle(this._plugin,t)}createConstraint(e,t){this._drawTool.interactiveHandleManager?.registerCustomConstraint(this._plugin,e,t)}removeConstraint(e){this._drawTool.interactiveHandleManager?.unregisterCustomConstraint(this._plugin,e)}createCustomField(e){if(!this._drawTool.tooltipManager)throw new r("draw-tool:tooltip-manager-missing","Attempted to create a field without access to a tooltip manager.");return this._drawTool.tooltipManager.createCustomField(this._plugin,e)}createMeasuredField(e){if(!this._drawTool.tooltipManager)throw new r("draw-tool:tooltip-manager-missing","Attempted to create a field without access to a tooltip manager.");return this._drawTool.tooltipManager.createMeasuredField(this._plugin,e)}requestComplete(){this._drawTool.complete(this._plugin)}requestCancel(e){this._drawTool.lifecycleManager.cancel(this._plugin)}requestBeginDownstreamPlugin(e,t){this._drawTool.lifecycleManager.begin([e],this._plugin,t?.cancelExisting)}async measureLength(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureLength(i,t,e,o)}async measureArea(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureArea(i,t,e,o)}async measureDistance(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureDistance(i,t,e,o)}measureElevation(e,t){const r=this._drawTool;let o=h(e);if(!o){const e=r.surfaceManager?.metersPerVerticalUnit;e&&(o=i(r.defaultZ*e,"meters"))}return t&&o&&o.unit!==t?s(o,t):o}getGlobalState(){return this._drawTool.globalStateManager.getGlobalState()}setGlobalState(e,t){this._drawTool.globalStateManager.setGlobalState(this._plugin,e,t)}addOrUpdateGraphic(e,t){const{_plugin:r,_drawTool:a}=this,i=a.renderer;i?.addOrUpdateGraphic(e,t),r.hasHandles(e)||r.addHandles(o(()=>i?.removeGraphic(e)),e)}addOrUpdateVisual(e,t){const r=this._plugin,a=this._drawTool.renderer;a?.addOrUpdateVisual(e,t),r.hasHandles(e)||r.addHandles(o(()=>a?.removeVisual(e)),e)}removeGraphic(e){this._plugin.removeHandles(e)}removeVisual(e){this._plugin.removeHandles(e)}getViewInformation(){return this._drawTool.view}getViewAlignedSurfaceCoordinateSystem(e){const{view:t,coordinateHelper:r}=this._drawTool;return t&&r?c(t,r.pointToVector(e)):null}};e([l()],w.prototype,"_plugin",void 0),e([l()],w.prototype,"_drawTool",void 0),e([l({nonNullable:!0})],w.prototype,"session",void 0),e([l()],w.prototype,"positionOfLastUserInput",null),w=e([d("esri.views.draw.support.PluginContext")],w);export{w as PluginContext};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{createTask as o}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import{getOrCreateMapValue as n}from"../../../../core/MapUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import s from"../../../../core/ReactiveMap.js";import{watch as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{createTask as o}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import{getOrCreateMapValue as n}from"../../../../core/MapUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import s from"../../../../core/ReactiveMap.js";import{watch as l,syncAndInitial as a,initial as p}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{isLoaded as m,load as f}from"../../../../geometry/coordinateFormatter.js";import{absoluteHeightElevationInfo as h}from"../../../../support/elevationInfoUtils.js";import{ManagedTooltipField as g}from"../ManagedTooltipField.js";import{getConstraintContext as v}from"../../../interactive/sketch/constraintUtils.js";import{makeTooltip as y}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{makeScalarField as _,makeOrientationField as F,makeAreaField as H,makeLengthField as T,makeRadiusField as I,makeTotalLengthField as w,makeSizeField as k,makeScaleField as x,makeYField as j,makeXField as A,makeLongitudeField as M,makeLatitudeField as b,makeElevationField as E,makeDistanceField as C,makeDirectionField as O}from"../../../interactive/tooltip/fields/fields.js";import{TooltipField as L}from"../../../interactive/tooltip/fields/TooltipField.js";import{DynamicTooltipInfo as P}from"../../../interactive/tooltip/infos/DynamicTooltipInfo.js";let R=class extends e{constructor(t){super(t),this._pluginTooltipFieldRegistry=new s,this._updatingHandles=new u,this._coordinateFormatterLoadTask=null,this.constraintsEnabled=!0,this.keepTooltipAliveEvenWhenTooltipsAreNotEnabled=!1}initialize(){this.addHandles([l(()=>[this.effectiveEnabled,this.context?.view,this.context?.sketchOptions],([t,e,o])=>{const{context:i}=this;t&&e&&o?(this._tooltipInfo??=new P({sketchOptions:o,getAllFields:()=>this.allFields,getActiveHandle:()=>this.effectiveActiveHandle,viewType:e.type}),this._tooltip||this._setupTooltip(i)):(this._tooltip=r(this._tooltip),this._tooltipInfo=r(this._tooltipInfo),this.inputModeHandle=null)},a)])}destroy(){this._tooltip=r(this._tooltip),this._tooltipInfo=r(this._tooltipInfo)}get context(){return this.getDependencies?.()}get focusedHandle(){return this.context?.getActiveHandle?.()}get effectiveActiveHandle(){return this._tooltip?.isInInputMode?this.inputModeHandle:this.focusedHandle}get updating(){return this._updatingHandles.updating}get tooltip(){return this._tooltip}get tooltipInfo(){return this._tooltipInfo}get elevationConstraint(){return this.getConstraints(this.focusedHandle)?.elevation}get allFields(){return Array.from(this._pluginTooltipFieldRegistry.values()).flatMap(t=>Array.from(t.values()))}get effectiveEnabled(){return this.context?.sketchOptions.tooltips.effectiveEnabled||this.keepTooltipAliveEvenWhenTooltipsAreNotEnabled}getConstraints(t){const{tooltipInfo:e,context:o}=this,{view:i,editGeometryOperations:n,elevationInfo:r,sketchOptions:s}=o??{},l=this.getLastScreenPosition?.();if(!(l&&i&&e&&n&&s))return null;const{coordinateHelper:a,spatialReference:p}=n.data,d=i.toMap(l);if(!d)return null;const c=v(d,i,p,r??h,a.hasZ(),s.values.effectiveDirectionMode),u=e.getConstraintFieldsForHandle(t),m={context:c};for(const f of u)switch(f.name){case"direction":case"distance":case"elevation":m[f.name]=f.committed;break;case"x":m[f.name]=D(f.committed),m.longitude=U(f.committed);break;case"y":m[f.name]=D(f.committed),m.latitude=U(f.committed)}return m}unlockOnVertexPlacement(){this.tooltipInfo?.allFields.forEach(t=>{t.unlockOnVertexPlacement&&(t.committed=null)})}unregisterPluginFields(t){const e=this._pluginTooltipFieldRegistry.get(t);e?.forEach(t=>t.destroy()),e?.clear(),this._pluginTooltipFieldRegistry.delete(t)}createMeasuredField(t,{id:e,preset:o,getMeasurementInput:i,measure:n,fieldProperties:r,fieldFilters:s}){const a=this._getOrCreateField(t,e,o,r,s);return a.registerMeasurement(i,n,()=>this.tooltipInfo?.renderContext),a.addHandles(l(()=>this.tooltipInfo?.isEffectiveVisibleField(a.field),t=>a.enabled=!!t,p)),a}createCustomField(t,{id:e,preset:o,fieldProperties:i,fieldFilters:n}){return this._getOrCreateField(t,e,o,i,n)}_setupTooltip(t){const e=this._tooltip=y(()=>({view:t.view,options:t.sketchOptions.tooltips,info:this.tooltipInfo}));e.addHandles([l(()=>this.focusedHandle,t=>{!t||e.isInInputMode&&null!=this.inputModeHandle||(this.inputModeHandle=t)},a),l(()=>this.focusedHandle?.screenPosition,t=>{t?(e.position=t,e.hidden=!1):e.hidden=!0},a),e.on("commit",()=>{this.context?.notifyTooltipsChanged()})]),this._coordinateFormatterLoadTask||m()||(this._coordinateFormatterLoadTask=o(()=>f()),this.addHandles(this._coordinateFormatterLoadTask),this._updatingHandles.addPromise(this._coordinateFormatterLoadTask.promise))}_getOrCreateField(t,e,o,i,r){const l=n(this._pluginTooltipFieldRegistry,t,()=>new s);if(l.has(e))return l.get(e);const a=new g({field:G(o,i),displayGroup:i?.displayGroup,...r});return l.set(e,a),a}};function U(t){return null!=t&&"unit"in t&&"rotationType"in t?t:null}function D(t){return null==t||"rotationType"in t?null:t}function G(t,e){const o=e?{...e}:{};switch(delete o.displayGroup,t){case"area":return H({...o,name:"area"});case"direction":return O({...o,name:"direction"});case"distance":return C({...o,name:"distance"});case"elevation":{const t=E({...o,name:"elevation"});return t.showAsZ=!0,t}case"latitude":return b({...o,name:"y"});case"longitude":return M({...o,name:"x"});case"x":return A({...o,name:"x"});case"y":return j({...o,name:"y"});case"orientation":return F({...o,name:"orientation"});case"scale":return x({...o,name:"scale"});case"size":return k({...o,name:"size"});case"totalLength":return w({...o,name:"totalLength"});case"radius":return I({...o,name:"radius"});case"generic-length":return T({...o,name:null});case"generic-area":return H({...o,name:null});case"generic-angle":return F({...o,name:null});case"generic-scalar":return _({...o,name:null});default:if(!o)throw new i("draw-tool:tooltips:invalid-field-config","Attempted to create a tooltip without a preset definition and without tooltip configuration.");return new L(o)}}t([d()],R.prototype,"_updatingHandles",void 0),t([d()],R.prototype,"_tooltip",void 0),t([d()],R.prototype,"_tooltipInfo",void 0),t([d()],R.prototype,"_coordinateFormatterLoadTask",void 0),t([d()],R.prototype,"getDependencies",void 0),t([d()],R.prototype,"getLastScreenPosition",void 0),t([d()],R.prototype,"context",null),t([d()],R.prototype,"inputModeHandle",void 0),t([d()],R.prototype,"focusedHandle",null),t([d()],R.prototype,"effectiveActiveHandle",null),t([d()],R.prototype,"updating",null),t([d()],R.prototype,"tooltip",null),t([d()],R.prototype,"tooltipInfo",null),t([d()],R.prototype,"constraintsEnabled",void 0),t([d()],R.prototype,"elevationConstraint",null),t([d()],R.prototype,"allFields",null),t([d()],R.prototype,"keepTooltipAliveEvenWhenTooltipsAreNotEnabled",void 0),t([d()],R.prototype,"effectiveEnabled",null),R=t([c("esri.views.draw.support.managers.TooltipManager")],R);export{R as TooltipManager};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{A as
|
|
2
|
+
import e from"../../WebScene.js";import n from"../../core/Error.js";import r from"../../core/Version.js";import{A as o}from"../../chunks/ajv.bundle.js";import{json as t}from"../../portal/schemas/webScene.js";import{convertAjvErrors as s}from"../../support/validationUtilsAjv.js";let i=null;function c(e,n){d(n);const r=h();return r.validate(j(n),e)?[]:s(r.errors??[])}async function a(n){let o=r.parse(n.version||"","webscene");const t=r.parse(e.version,"webscene");if(o.major===t.major&&o.minor===t.minor)return c(n);o.lessThan(1,38)&&(o=new r(1,38,"webscene"));const i=h(),a=m(o);if(null==i.getSchema(a)){const e=await fetch(l(o));if(e.ok){const n=await e.json();i.addSchema(n,a)}}return i.validate(a,n)?[]:s(i.errors??[])}async function f(e){const n=await a(e);if(n.length)throw new p(n)}function m(e){return`webscene-schema-v${e.major}.${e.minor}.json`}function l(e){return`https://js.arcgis.com/webscene-spec/${m(e)}`}function u(e){const n=e?t.definitions[j(e)]:void 0;if(!n)throw new Error(`invalid schema name to validate against '${e}'`);const r={};for(const o in n)r[o]=n[o];return r.definitions=t.definitions,r}function d(e){const n=j(e),r=h();if(!r.getSchema(n)){const o=u(e);r.addSchema(o,n)}}function h(){return i||(i=new o({allErrors:!0,extendRefs:!0}),i.addSchema(t,j()),i)}function w(){i=null}function j(e){return e?`${e}_schema.json`:"webScene_schema.json"}class p extends n{constructor(e){super("webscene:validation-failed",`WebScene validation failed with ${e.length} ${1===e.length?"error":"errors"}.`,{errors:e})}}export{p as WebSceneValidationError,f as assertValidWebScene,w as clearValidator,l as getVersionedWebSceneSchemaCDNUrl,c as validate,a as validateWebScene};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
function n(
|
|
2
|
+
import r from"../../core/Version.js";function n(r){return!!r?.greaterEqual(1,8)}function e(r){return!!r?.lessThan(1,8)}function o(n){const e=8,o=[],t=n.major;for(let u=e;u<=n.minor;u++)o.push(new r(t,u,"webscene"));return o}export{o as generateWebSceneVersions,e as supportsVisibleElevationLayersInSlides,n as versionSupportsGround};
|