@arcgis/core 5.1.0-next.56 → 5.1.0-next.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/applications/Components/SelectionOperation.d.ts +2 -2
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{278eecd729bed2832702.js → 45b7266580f9ce4fab6c.js} +1 -1
- package/assets/esri/core/workers/chunks/{992e74570b76f3f9e52e.js → 666e1e79fcb309b0b9b1.js} +1 -1
- package/assets/esri/core/workers/chunks/{4afddb66242438b38df0.js → 6c571008bee8376ea50a.js} +1 -1
- package/assets/esri/core/workers/chunks/{ea068f75397c3b3337ec.js → 92fb6519b01d110ee947.js} +136 -129
- package/chunks/ScreenSpaceShadowHighlight.glsl.js +6 -0
- package/chunks/ShadowCastAccumulate.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +15 -8
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/networks/support/jsonTypes.d.ts +6 -0
- package/package.json +1 -1
- package/rest/networks/support/FunctionResult.d.ts +6 -0
- package/rest/networks/support/FunctionResult.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +28 -50
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +46 -22
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +18 -13
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlight.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlightRenderNode.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlightTechnique.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ReceiveShadowsConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/selection/types.d.ts +9 -0
- package/widgets/support/Selector2D/SelectionOperation.d.ts +191 -0
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/Selector2D/types.d.ts +139 -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 t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as s}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as d,syncAndInitial as c}from"../../../../core/reactiveUtils.js";import{addFrameTask as l}from"../../../../core/scheduling.js";import{Milliseconds as p}from"../../../../core/time.js";import{property as m,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{isMoon as f,isMars as g}from"../../../../geometry/ellipsoidUtils.js";import{ComponentObjectCollection as w}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as _}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as x}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as v}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as y}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as j}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as R}from"../effects/clouds/CloudsComposition.js";import{Fog as b}from"../effects/fog/Fog.js";import{ObjectAndLayerIDRenderNode as A}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as C}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as S}from"../effects/geometry/RenderOccludedRenderNode.js";import{GlowRenderNode as O}from"../effects/glow/GlowRenderNode.js";import{Haze as T}from"../effects/haze/Haze.js";import{Highlight as U}from"../effects/highlight/Highlight.js";import{ShadowHighlight as q}from"../effects/highlight/ShadowHighlight.js";import{Magnifier as M}from"../effects/magnifier/Magnifier.js";import{SMAA as L}from"../effects/smaa/SMAA.js";import{SSAO as D}from"../effects/ssao/SSAO.js";import{Stars as k}from"../effects/stars/Stars.js";import{GLMaterialRepository as F}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as W}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as B}from"../lib/Renderer.js";import{RenderingContext as E}from"../lib/RenderingContext.js";import{RenderingContextOptions as H}from"../lib/RenderingContextOptions.js";import{TextureRepository as N}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as G}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as P}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as z}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as I}from"./contextCache.js";import{removeLoadedShaderModules as V}from"./renderUtils.js";import{ScreenshotManager as X,ScreenshotContext as Q}from"./ScreenshotManager.js";import{contextCache as J}from"./testUtils.js";import{noBudget as K}from"../../../support/Scheduler.js";import{checkWebGLError as Y}from"../../../webgl/checkWebGLError.js";let Z=class extends t{constructor(e,t){super(e),this.olidRenderHelper=C()?new W:null,this.waterTextures=new z,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this.fog=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=P(this._rctx,r),this.markerTextures=G(this._rctx,r),this.techniques=new x(new _(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new N(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const s=new F(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new B(t,s,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),d(()=>this.waterTextures.updating,()=>this.requestRender(),h),d(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),c)]);const i={renderScene:(e,t,r,s)=>this.renderer.render(e,t,r,s),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,s)=>t.options.screenshot.renderOverlay(e,r,s)};this._screenshotManager=new X(this._rctx,i,e=>t.view.overlayManager.updateOverlays(K,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new k({view:e}),f(e.spatialReference)||(this.glow=new O({view:e}),2===t?new y({view:e}):g(e.spatialReference)?new j({view:e}):(new v({view:e}),new R({view:e}),new T({view:e}),this.fog=new b({view:e}))),new D({view:e,isEnabled:()=>this.renderer.hasSSAO}),new L({view:e,isEnabled:()=>this.renderer.hasSMAA}),new M({view:e}),new U({view:e}),new q({view:e,viewingMode:t}),new S({view:e}),C()&&new A({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0;case 0:this._needsRender=!0}}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,n,o=n){const a=i.constrainWindowSize(t,r,n*i.pixelRatio,o*i.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const d=(e,t,r)=>s(t,e)*(r[1]-r[0])+r[0];let c=Number.MAX_VALUE;for(let s=0;s<a[2]*a[3];s++){const e=d(4*s,h,i.nearFar);c>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(c=e)}if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&c>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(c=s)}return c===Number.MAX_VALUE?void 0:c}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){V(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,s=0,i=!1;const n={preRender:({time:i})=>{r=this.updating,s=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;const n=p(i-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e,0),i=!0,r&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new Q(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{i&&(this.renderer.finish(2===t.mode?s:1),i=!1)}};this._frameTask=l(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const s={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",s);if(null==n)return void i.getLogger(this).error("A WebGL2 context could not be created.");Y(n,!0),this._rctx=$(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new w(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=p(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}};function $(e,t){const r=new H(t);if(J.enabled){let t=ee.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new E(e,r),ee.set(e,t),t.ref(),t)}return new E(e,r)}e([m({type:Boolean,readOnly:!0})],Z.prototype,"updating",null),e([m({constructOnly:!0})],Z.prototype,"view",void 0),e([m({readOnly:!0})],Z.prototype,"componentObjectCollection",null),e([m()],Z.prototype,"_componentObjectCollection",void 0),e([m()],Z.prototype,"_needsUpdate",void 0),e([m()],Z.prototype,"_needsWaterReflectionUpdate",void 0),Z=e([u("esri.views.3d.webgl-engine.parts.RenderView")],Z);const ee=I();export{Z as RenderView};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as s}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as d,syncAndInitial as c}from"../../../../core/reactiveUtils.js";import{addFrameTask as l}from"../../../../core/scheduling.js";import{Milliseconds as p}from"../../../../core/time.js";import{property as m,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{isMoon as f,isMars as g}from"../../../../geometry/ellipsoidUtils.js";import{ComponentObjectCollection as w}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as _}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as x}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as v}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as j}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as y}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as R}from"../effects/clouds/CloudsComposition.js";import{Fog as b}from"../effects/fog/Fog.js";import{ObjectAndLayerIDRenderNode as A}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as S}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as C}from"../effects/geometry/RenderOccludedRenderNode.js";import{GlowRenderNode as O}from"../effects/glow/GlowRenderNode.js";import{Haze as T}from"../effects/haze/Haze.js";import{Highlight as U}from"../effects/highlight/Highlight.js";import{ScreenSpaceShadowHighlightRenderNode as q}from"../effects/highlight/ScreenSpaceShadowHighlightRenderNode.js";import{ShadowHighlight as M}from"../effects/highlight/ShadowHighlight.js";import{Magnifier as L}from"../effects/magnifier/Magnifier.js";import{SMAA as D}from"../effects/smaa/SMAA.js";import{SSAO as k}from"../effects/ssao/SSAO.js";import{Stars as F}from"../effects/stars/Stars.js";import{GLMaterialRepository as W}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as B}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as E}from"../lib/Renderer.js";import{RenderingContext as H}from"../lib/RenderingContext.js";import{RenderingContextOptions as N}from"../lib/RenderingContextOptions.js";import{TextureRepository as G}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as P}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as z}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as I}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as V}from"./contextCache.js";import{removeLoadedShaderModules as X}from"./renderUtils.js";import{ScreenshotManager as Q,ScreenshotContext as J}from"./ScreenshotManager.js";import{contextCache as K}from"./testUtils.js";import{noBudget as Y}from"../../../support/Scheduler.js";import{checkWebGLError as Z}from"../../../webgl/checkWebGLError.js";let $=class extends t{constructor(e,t){super(e),this.olidRenderHelper=S()?new B:null,this.waterTextures=new I,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this.fog=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=z(this._rctx,r),this.markerTextures=P(this._rctx,r),this.techniques=new x(new _(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new G(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const s=new W(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new E(t,s,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),d(()=>this.waterTextures.updating,()=>this.requestRender(),h),d(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),c)]);const i={renderScene:(e,t,r,s)=>this.renderer.render(e,t,r,s),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,s)=>t.options.screenshot.renderOverlay(e,r,s)};this._screenshotManager=new Q(this._rctx,i,e=>t.view.overlayManager.updateOverlays(Y,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new F({view:e}),f(e.spatialReference)||(this.glow=new O({view:e}),2===t?new j({view:e}):g(e.spatialReference)?new y({view:e}):(new v({view:e}),new R({view:e}),new T({view:e}),this.fog=new b({view:e}))),new k({view:e,isEnabled:()=>this.renderer.hasSSAO}),new D({view:e,isEnabled:()=>this.renderer.hasSMAA}),new L({view:e}),new U({view:e}),new q({view:e}),new M({view:e,viewingMode:t}),new C({view:e}),S()&&new A({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0;case 0:this._needsRender=!0}}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,n,o=n){const a=i.constrainWindowSize(t,r,n*i.pixelRatio,o*i.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const d=(e,t,r)=>s(t,e)*(r[1]-r[0])+r[0];let c=Number.MAX_VALUE;for(let s=0;s<a[2]*a[3];s++){const e=d(4*s,h,i.nearFar);c>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(c=e)}if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&c>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(c=s)}return c===Number.MAX_VALUE?void 0:c}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){X(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,s=0,i=!1;const n={preRender:({time:i})=>{r=this.updating,s=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;const n=p(i-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e,0),i=!0,r&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new J(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{i&&(this.renderer.finish(2===t.mode?s:1),i=!1)}};this._frameTask=l(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const s={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",s);if(null==n)return void i.getLogger(this).error("A WebGL2 context could not be created.");Z(n,!0),this._rctx=ee(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new w(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=p(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}};function ee(e,t){const r=new N(t);if(K.enabled){let t=te.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new H(e,r),te.set(e,t),t.ref(),t)}return new H(e,r)}e([m({type:Boolean,readOnly:!0})],$.prototype,"updating",null),e([m({constructOnly:!0})],$.prototype,"view",void 0),e([m({readOnly:!0})],$.prototype,"componentObjectCollection",null),e([m()],$.prototype,"_componentObjectCollection",void 0),e([m()],$.prototype,"_needsUpdate",void 0),e([m()],$.prototype,"_needsWaterReflectionUpdate",void 0),$=e([u("esri.views.3d.webgl-engine.parts.RenderView")],$);const te=V();export{$ as RenderView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as o}from"../materials/TriangleTechniqueConfiguration.js";class s extends o{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}e([t({count:4})],s.prototype,"alphaDiscardMode",void 0),e([t({count:3})],s.prototype,"doubleSidedMode",void 0),e([t({count:7})],s.prototype,"pbrMode",void 0),e([t({count:3})],s.prototype,"cullFace",void 0),e([t({count:3})],s.prototype,"normalType",void 0),e([t({count:3})],s.prototype,"customDepthTest",void 0),e([t({count:8})],s.prototype,"emissionSource",void 0),e([t()],s.prototype,"hasVertexColors",void 0),e([t()],s.prototype,"hasSymbolColors",void 0),e([t()],s.prototype,"hasVerticalOffset",void 0),e([t()],s.prototype,"hasColorTexture",void 0),e([t()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([t()],s.prototype,"hasOcclusionTexture",void 0),e([t()],s.prototype,"hasNormalTexture",void 0),e([t()],s.prototype,"hasScreenSizePerspective",void 0),e([t()],s.prototype,"hasVertexTangents",void 0),e([t()],s.prototype,"hasOccludees",void 0),e([t()],s.prototype,"instanced",void 0),e([t()],s.prototype,"instancedDoublePrecision",void 0),e([t()],s.prototype,"hasModelTransformation",void 0),e([t()],s.prototype,"offsetBackfaces",void 0),e([t()],s.prototype,"hasVVSize",void 0),e([t()],s.prototype,"hasVVColor",void 0),e([t()],s.prototype,"receiveShadows",void 0),e([t()],s.prototype,"receiveAmbientOcclusion",void 0),e([t()],s.prototype,"textureAlphaPremultiplied",void 0),e([t()],s.prototype,"instancedFeatureAttribute",void 0),e([t()],s.prototype,"instancedColor",void 0),e([t()],s.prototype,"writeDepth",void 0),e([t()],s.prototype,"terrainDepthTest",void 0),e([t()],s.prototype,"cullAboveTerrain",void 0),e([t()],s.prototype,"snowCover",void 0),e([t()],s.prototype,"hasColorTextureTransform",void 0),e([t()],s.prototype,"hasEmissionTextureTransform",void 0),e([t()],s.prototype,"hasNormalTextureTransform",void 0),e([t()],s.prototype,"hasOcclusionTextureTransform",void 0),e([t()],s.prototype,"hasMetallicRoughnessTextureTransform",void 0);export{s as DefaultMaterialTechniqueConfiguration};
|
|
2
|
+
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as o}from"../materials/TriangleTechniqueConfiguration.js";class s extends o{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}e([t({count:4})],s.prototype,"alphaDiscardMode",void 0),e([t({count:3})],s.prototype,"doubleSidedMode",void 0),e([t({count:7})],s.prototype,"pbrMode",void 0),e([t({count:3})],s.prototype,"cullFace",void 0),e([t({count:3})],s.prototype,"normalType",void 0),e([t({count:3})],s.prototype,"customDepthTest",void 0),e([t({count:8})],s.prototype,"emissionSource",void 0),e([t()],s.prototype,"hasVertexColors",void 0),e([t()],s.prototype,"hasSymbolColors",void 0),e([t()],s.prototype,"hasVerticalOffset",void 0),e([t()],s.prototype,"hasColorTexture",void 0),e([t()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([t()],s.prototype,"hasOcclusionTexture",void 0),e([t()],s.prototype,"hasNormalTexture",void 0),e([t()],s.prototype,"hasScreenSizePerspective",void 0),e([t()],s.prototype,"hasVertexTangents",void 0),e([t()],s.prototype,"hasOccludees",void 0),e([t()],s.prototype,"instanced",void 0),e([t()],s.prototype,"instancedDoublePrecision",void 0),e([t()],s.prototype,"hasModelTransformation",void 0),e([t()],s.prototype,"offsetBackfaces",void 0),e([t()],s.prototype,"hasVVSize",void 0),e([t()],s.prototype,"hasVVColor",void 0),e([t()],s.prototype,"receiveShadows",void 0),e([t()],s.prototype,"hasShadowHighlights",void 0),e([t()],s.prototype,"receiveAmbientOcclusion",void 0),e([t()],s.prototype,"textureAlphaPremultiplied",void 0),e([t()],s.prototype,"instancedFeatureAttribute",void 0),e([t()],s.prototype,"instancedColor",void 0),e([t()],s.prototype,"writeDepth",void 0),e([t()],s.prototype,"terrainDepthTest",void 0),e([t()],s.prototype,"cullAboveTerrain",void 0),e([t()],s.prototype,"snowCover",void 0),e([t()],s.prototype,"hasColorTextureTransform",void 0),e([t()],s.prototype,"hasEmissionTextureTransform",void 0),e([t()],s.prototype,"hasNormalTextureTransform",void 0),e([t()],s.prototype,"hasOcclusionTextureTransform",void 0),e([t()],s.prototype,"hasMetallicRoughnessTextureTransform",void 0);export{s as DefaultMaterialTechniqueConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{parameter as
|
|
2
|
+
import{__decorate as e}from"tslib";import{parameter as r,ShaderTechniqueConfiguration as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class t extends o{constructor(){super(...arguments),this.receiveShadows=!0}}function i(e,r){return e.receiveShadows&&null!=r.screenSpaceShadowHighlightFbo?.getTexture()}e([r()],t.prototype,"receiveShadows",void 0);export{t as ReceiveShadowsConfiguration,i as hasShadowHighlights};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class i extends o{constructor(e){super(),this.spherical=e,this.overlayMode=0,this.tileBlendInput=0,this.transparencyMode=0,this.pbrMode=5,this.receiveShadows=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.receiveAmbientOcclusion=!1,this.tileBorders=!1,this.normalType=1,this.textureCoordinateType=1,this.emissionSource=0,this.highStepCount=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.draped=!1,this.discardInvisibleFragments=!0,this.oitPremultipliedAlpha=!0,this.snowCover=!1}get overlayEnabled(){return 0!==this.overlayMode}get hasWater(){return 11!==this.output}}e([t({count:3})],i.prototype,"overlayMode",void 0),e([t({count:3})],i.prototype,"tileBlendInput",void 0),e([t({count:4})],i.prototype,"transparencyMode",void 0),e([t({count:7})],i.prototype,"pbrMode",void 0),e([t()],i.prototype,"receiveShadows",void 0),e([t()],i.prototype,"textureFadingEnabled",void 0),e([t()],i.prototype,"renderOccluded",void 0),e([t()],i.prototype,"screenSpaceReflections",void 0),e([t()],i.prototype,"cloudReflections",void 0),e([t()],i.prototype,"receiveAmbientOcclusion",void 0),e([t()],i.prototype,"tileBorders",void 0);export{i as TerrainTechniqueConfiguration};
|
|
2
|
+
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class i extends o{constructor(e){super(),this.spherical=e,this.overlayMode=0,this.tileBlendInput=0,this.transparencyMode=0,this.pbrMode=5,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.receiveAmbientOcclusion=!1,this.tileBorders=!1,this.normalType=1,this.textureCoordinateType=1,this.emissionSource=0,this.highStepCount=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.draped=!1,this.discardInvisibleFragments=!0,this.oitPremultipliedAlpha=!0,this.snowCover=!1}get overlayEnabled(){return 0!==this.overlayMode}get hasWater(){return 11!==this.output}}e([t({count:3})],i.prototype,"overlayMode",void 0),e([t({count:3})],i.prototype,"tileBlendInput",void 0),e([t({count:4})],i.prototype,"transparencyMode",void 0),e([t({count:7})],i.prototype,"pbrMode",void 0),e([t()],i.prototype,"receiveShadows",void 0),e([t()],i.prototype,"hasShadowHighlights",void 0),e([t()],i.prototype,"textureFadingEnabled",void 0),e([t()],i.prototype,"renderOccluded",void 0),e([t()],i.prototype,"screenSpaceReflections",void 0),e([t()],i.prototype,"cloudReflections",void 0),e([t()],i.prototype,"receiveAmbientOcclusion",void 0),e([t()],i.prototype,"tileBorders",void 0);export{i as TerrainTechniqueConfiguration};
|
package/views/3d/webgl.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import o from"../../Camera.js";import{rad2deg as e,deg2rad as r}from"../../core/mathUtils.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as i,add as n}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../geometry/Point.js";import l from"../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as s}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as m}from"../../geometry/projection/projectBuffer.js";import{projectPointToVector as p}from"../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as u}from"../../geometry/projection/projectVectorToVector.js";import{cameraOnContentAlongViewDirection as f}from"./camera/intersectionUtils.js";import{directionToHeadingTilt as R,viewModeDependentUtil as d}from"./support/viewingModeUtils.js";const A={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},T=[A.FINAL,A.COMPOSITE,A.OPAQUE,A.TRANSPARENT],
|
|
2
|
+
import o from"../../Camera.js";import{rad2deg as e,deg2rad as r}from"../../core/mathUtils.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as i,add as n}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../geometry/Point.js";import l from"../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as s}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as m}from"../../geometry/projection/projectBuffer.js";import{projectPointToVector as p}from"../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as u}from"../../geometry/projection/projectVectorToVector.js";import{cameraOnContentAlongViewDirection as f}from"./camera/intersectionUtils.js";import{directionToHeadingTilt as R,viewModeDependentUtil as d}from"./support/viewingModeUtils.js";const A={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},T=[A.FINAL,A.COMPOSITE,A.OPAQUE,A.TRANSPARENT],E={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GROUND_DEPTH:"ground-depth",PRE_TRANSPARENT:"pre-transparent",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SCREEN_SPACE_SHADOW_HIGHLIGHT:"screen-space-shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VIEWSHED:"viewshed"},N=Array.from(Object.values(E)).concat(T);function O(o,e,r,t,i,n,a){return t=t||o.spatialReference,m(e,t,r,i,o.renderCoordsHelper.spatialReference,n,a)?i:null}function I(o,e,r,t,i,n,a){return n=n||o.spatialReference,m(e,o.renderCoordsHelper.spatialReference,r,t,n,i,a)?t:null}function g(o,e,r,i){return i||(i=t()),r=r||o.spatialReference,s(r,e,i,o.renderCoordsHelper.spatialReference)?i:null}function j(r,t,i){const n=r.renderSpatialReference,a=R(r,t.eye,t.viewForward,t.up,C);let s=r.spatialReference;return u(t.eye,n,S,s)||(s=l.WGS84,u(t.eye,n,S,s)),null==i?i=new o(new c(S,s),a.heading,a.tilt,e(t.fov)):(i.position.x=S[0],i.position.y=S[1],i.position.z=S[2],i.position.spatialReference=s,i.heading=a.heading,i.tilt=a.tilt,i.fov=e(t.fov)),i.layout.row=t.row,i.layout.rows=t.rows,i.layout.column=t.column,i.layout.columns=t.columns,i}function y(o,e){if(!e)return null;const t=o.renderSpatialReference,c=d(o).headingTiltToDirectionUp,l=a();if(!p(e.position,l,t))return null;const s=c(l,e.heading,e.tilt);i(s.direction,s.direction,o.state.camera.distance),n(s.direction,s.direction,l);const m=f(o,l,s.direction,s.up);return m.fov=r(e.fov),m.row=e.layout.row,m.rows=e.layout.rows,m.column=e.layout.column,m.columns=e.layout.columns,m}const S=a(),C={heading:0,tilt:0};export{N as AllInternalRenderNodeOutputs,T as AllRenderNodeOutputs,E as InternalRenderCategory,A as RenderNodeOutput,j as fromRenderCamera,I as fromRenderCoordinates,g as renderCoordinateTransformAt,y as toRenderCamera,O as toRenderCoordinates};
|
|
@@ -12,12 +12,21 @@ import type FieldsIndex from "../../layers/support/FieldsIndex.js";
|
|
|
12
12
|
import type FeatureSet from "../../rest/support/FeatureSet.js";
|
|
13
13
|
import type Query from "../../rest/support/Query.js";
|
|
14
14
|
import type View from "../View.js";
|
|
15
|
+
import type LinkChartView from "../LinkChartView.js";
|
|
15
16
|
import type { LoadableMixin } from "../../core/Loadable.js";
|
|
16
17
|
import type { FeatureTitleOptions } from "../../layers/types.js";
|
|
17
18
|
import type { RendererUnion } from "../../renderers/types.js";
|
|
18
19
|
import type { RequestOptions } from "../../request/types.js";
|
|
20
|
+
import type { MapViewOrSceneView } from "../MapViewOrSceneView.js";
|
|
19
21
|
import type { ObjectId } from "../types.js";
|
|
20
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Types of views supported by a selection operation.
|
|
25
|
+
*
|
|
26
|
+
* @since 5.1
|
|
27
|
+
*/
|
|
28
|
+
export type SelectableView = MapViewOrSceneView | LinkChartView;
|
|
29
|
+
|
|
21
30
|
/**
|
|
22
31
|
* An identifier used to represent a selected feature in a layer. This can either be a [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) (for layers with graphics) or an object ID (for layers with object IDs).
|
|
23
32
|
*
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import type Graphic from "../../../Graphic.js";
|
|
2
|
+
import type Collection from "../../../core/Collection.js";
|
|
3
|
+
import type SelectionManager from "../../../views/SelectionManager.js";
|
|
4
|
+
import type { EventedAccessor } from "../../../core/Evented.js";
|
|
5
|
+
import type { DrawingMode } from "../../../views/draw/types.js";
|
|
6
|
+
import type { SelectableView } from "../../../views/selection/types.js";
|
|
7
|
+
import type { SelectionOperationCreateTool, SelectionOperationType, SelectionSource, ToolName } from "./types.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Construction properties for a selection operation.
|
|
11
|
+
*
|
|
12
|
+
* @since 5.1
|
|
13
|
+
*/
|
|
14
|
+
export interface SelectionOperationProperties extends Partial<Pick<SelectionOperation, "persistSelection" | "returnFeatureTitleFields" | "returnGeometry" | "sources" | "type">> {
|
|
15
|
+
/**
|
|
16
|
+
* The type of drawing tool being used by this selection operation.
|
|
17
|
+
*
|
|
18
|
+
* @default "rectangle"
|
|
19
|
+
* @since 5.1
|
|
20
|
+
*/
|
|
21
|
+
createTool?: SelectionOperationCreateTool;
|
|
22
|
+
/**
|
|
23
|
+
* Indicates the draw mode being used by this selection operation.
|
|
24
|
+
*
|
|
25
|
+
* @since 5.1
|
|
26
|
+
*/
|
|
27
|
+
mode?: DrawingMode | null;
|
|
28
|
+
/**
|
|
29
|
+
* A reference to a custom [selection manager](https://developers.arcgis.com/javascript/latest/references/core/views/SelectionManager/). Otherwise, the selection operation
|
|
30
|
+
* uses the selection manager on the provided view.
|
|
31
|
+
*
|
|
32
|
+
* @since 5.1
|
|
33
|
+
*/
|
|
34
|
+
selectionManager?: SelectionManager | null;
|
|
35
|
+
/**
|
|
36
|
+
* Indicates whether the selection operation should only update the selection when the operation
|
|
37
|
+
* successfully completes, rather than while actively drawing.
|
|
38
|
+
*
|
|
39
|
+
* @default true
|
|
40
|
+
* @since 5.1
|
|
41
|
+
*/
|
|
42
|
+
selectOnComplete?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Reference to the current drawing tool being used by the selection operation.
|
|
45
|
+
*
|
|
46
|
+
* @default ""
|
|
47
|
+
* @since 5.1
|
|
48
|
+
*/
|
|
49
|
+
toolName?: ToolName;
|
|
50
|
+
/**
|
|
51
|
+
* Reference to the view being used by the selection operation.
|
|
52
|
+
*
|
|
53
|
+
* @since 5.1
|
|
54
|
+
*/
|
|
55
|
+
view?: SelectableView;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The selection operation is responsible for creating and using an interactive drawing tool to maintain
|
|
60
|
+
* an interactively updated graphics selection set while a selection area is being drawn. The interactive
|
|
61
|
+
* tool is active on the view when the operation is created. After the operation is completed (selection area
|
|
62
|
+
* is finalized or cancelled), the interactive tool is removed. Each operation can only be used once and
|
|
63
|
+
* a new selection operation should be created each time a new selection is required.
|
|
64
|
+
*
|
|
65
|
+
* @since 5.1
|
|
66
|
+
*/
|
|
67
|
+
export default class SelectionOperation extends EventedAccessor {
|
|
68
|
+
/** @since 5.1 */
|
|
69
|
+
constructor(properties: SelectionOperationProperties);
|
|
70
|
+
/**
|
|
71
|
+
* Indicates whether the selection operation has been completed or cancelled.
|
|
72
|
+
*
|
|
73
|
+
* @since 5.1
|
|
74
|
+
*/
|
|
75
|
+
get completed(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* The type of drawing tool being used by this selection operation.
|
|
78
|
+
*
|
|
79
|
+
* @default "rectangle"
|
|
80
|
+
* @since 5.1
|
|
81
|
+
*/
|
|
82
|
+
get createTool(): SelectionOperationCreateTool;
|
|
83
|
+
/**
|
|
84
|
+
* The selection manager being used by this selection operation.
|
|
85
|
+
*
|
|
86
|
+
* @since 5.1
|
|
87
|
+
*/
|
|
88
|
+
get effectiveSelectionManager(): SelectionManager;
|
|
89
|
+
/**
|
|
90
|
+
* The current effective type of the selection operation. Accounts for modifications
|
|
91
|
+
* to the active type when holding a constraint key (Control or Meta).
|
|
92
|
+
*
|
|
93
|
+
* @since 5.1
|
|
94
|
+
*/
|
|
95
|
+
get effectiveType(): SelectionOperationType;
|
|
96
|
+
/**
|
|
97
|
+
* Indicates the draw mode being used by this selection operation.
|
|
98
|
+
*
|
|
99
|
+
* @since 5.1
|
|
100
|
+
*/
|
|
101
|
+
get mode(): DrawingMode | null | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Indicates whether the selection operation will persist the determined selection via the
|
|
104
|
+
* current effective selection manager.
|
|
105
|
+
*
|
|
106
|
+
* @default true
|
|
107
|
+
* @since 5.1
|
|
108
|
+
*/
|
|
109
|
+
accessor persistSelection: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Indicates whether the selection operation is determining the final selection set.
|
|
112
|
+
*
|
|
113
|
+
* @since 5.1
|
|
114
|
+
*/
|
|
115
|
+
get processingFinalSelection(): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Indicates whether the selection operation should return [graphics](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) with attributes
|
|
118
|
+
* required to determine a title for individual selected features.
|
|
119
|
+
*
|
|
120
|
+
* @default false
|
|
121
|
+
* @since 5.1
|
|
122
|
+
*/
|
|
123
|
+
accessor returnFeatureTitleFields: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Indicates whether the selection operation should return [graphics](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) with
|
|
126
|
+
* geometries when determining the selection.
|
|
127
|
+
*
|
|
128
|
+
* @default true
|
|
129
|
+
* @since 5.1
|
|
130
|
+
*/
|
|
131
|
+
accessor returnGeometry: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* A reference to the current working selection while actively drawing.
|
|
134
|
+
*
|
|
135
|
+
* @since 5.1
|
|
136
|
+
*/
|
|
137
|
+
get selection(): Collection<Graphic>;
|
|
138
|
+
/**
|
|
139
|
+
* A reference to a custom [selection manager](https://developers.arcgis.com/javascript/latest/references/core/views/SelectionManager/). Otherwise, the selection operation
|
|
140
|
+
* uses the selection manager on the provided view.
|
|
141
|
+
*
|
|
142
|
+
* @since 5.1
|
|
143
|
+
*/
|
|
144
|
+
get selectionManager(): SelectionManager | null | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Indicates whether the selection operation should only update the selection when the operation
|
|
147
|
+
* successfully completes, rather than while actively drawing.
|
|
148
|
+
*
|
|
149
|
+
* @default true
|
|
150
|
+
* @since 5.1
|
|
151
|
+
*/
|
|
152
|
+
get selectOnComplete(): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* A reference to sources that should be used to determine selections.
|
|
155
|
+
*
|
|
156
|
+
* @since 5.1
|
|
157
|
+
*/
|
|
158
|
+
accessor sources: SelectionSource[] | null | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Reference to the current drawing tool being used by the selection operation.
|
|
161
|
+
*
|
|
162
|
+
* @default ""
|
|
163
|
+
* @since 5.1
|
|
164
|
+
*/
|
|
165
|
+
get toolName(): ToolName;
|
|
166
|
+
/**
|
|
167
|
+
* Reference to the current type of selection operation.
|
|
168
|
+
*
|
|
169
|
+
* @default "add"
|
|
170
|
+
* @since 5.1
|
|
171
|
+
*/
|
|
172
|
+
accessor type: SelectionOperationType;
|
|
173
|
+
/**
|
|
174
|
+
* Reference to the view being used by the selection operation.
|
|
175
|
+
*
|
|
176
|
+
* @since 5.1
|
|
177
|
+
*/
|
|
178
|
+
get view(): SelectableView;
|
|
179
|
+
/**
|
|
180
|
+
* Cancels the selection operation. Any existing selection identified by the operation is cleared.
|
|
181
|
+
*
|
|
182
|
+
* @since 5.1
|
|
183
|
+
*/
|
|
184
|
+
cancel(): void;
|
|
185
|
+
/**
|
|
186
|
+
* Destroys the selection operation.
|
|
187
|
+
*
|
|
188
|
+
* @since 5.1
|
|
189
|
+
*/
|
|
190
|
+
destroy(): void;
|
|
191
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{createTask as t}from"../../../core/asyncUtils.js";import o from"../../../core/Collection.js";import{EventedAccessor as r}from"../../../core/Evented.js";import{makeHandle as s}from"../../../core/handleUtils.js";import i from"../../../core/Logger.js";import{abortMaybe as n}from"../../../core/maybe.js";import{debounce as l,onAbort as c,ignoreAbortErrors as a}from"../../../core/promiseUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{createTask as t}from"../../../core/asyncUtils.js";import o from"../../../core/Collection.js";import{EventedAccessor as r}from"../../../core/Evented.js";import{makeHandle as s}from"../../../core/handleUtils.js";import i from"../../../core/Logger.js";import{abortMaybe as n}from"../../../core/maybe.js";import{debounce as l,onAbort as c,ignoreAbortErrors as a}from"../../../core/promiseUtils.js";import{on as p}from"../../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../../core/screenUtils.js";import{property as h,subclass as m}from"../../../core/accessorSupport/decorators.js";import y from"../../../geometry/Point.js";import u from"../../../geometry/Polygon.js";import{isClockwise as v}from"../../../geometry/support/coordsUtils.js";import{sketchKeys as f,selectionKeys as _}from"../../../views/interactive/keybindings.js";import{getSelectionFromGeometry as g}from"./selectorUtils.js";const w=100;let T=class extends r{constructor(e){super(e),this._completed=!1,this._isConstraintKeyDown=!1,this._processTask=null,this.createTool="rectangle",this.mode=null,this.persistSelection=!0,this.returnFeatureTitleFields=!1,this.returnGeometry=!0,this.selection=new o,this.selectionManager=null,this.selectOnComplete=!0,this.sources=null,this.toolName="",this.type="add",this._process=l(async(e,o)=>{const{callback:r,selector:s,completed:i}=e,n=t(async e=>{const{effectiveSelectionManager:t,returnFeatureTitleFields:o,returnGeometry:n,selection:l,sources:c,view:a}=this;if(!(!c?.length&&!t.sources.length)&&a){if(s&&null!=c){const r=await g({returnFeatureTitleFields:o,returnGeometry:n,selector:s,signal:e,sources:c,view:a});if(l.removeAll(),l.addMany(r),i&&this.persistSelection)switch(this.effectiveType){case"remove":t.updateSelection({current:[],added:[],removed:r});break;case"replace":t.clear(),t.updateSelection({current:r,added:[],removed:[]});break;default:t.updateSelection({current:r,added:[],removed:[]})}}r&&r()}else l.removeAll()});return c(o,()=>n.abort()),this._processTask=n,n.promise},w),this._onOperationFinish=this._onOperationFinish.bind(this)}initialize(){this._setup()}get _defaultMode(){return"polygon"===this.createTool?"click":"hybrid"}get _selectionArea(){const e=this._tool.coordinates;if(0===e.length)return;const t=d(),o=this.view.spatialReference,r=e=>{t.x=e[0],t.y=e[1];const o=this.view.toMap(t);return[o?.x??0,o?.y??0]};if(1===e.length||e.every(([t,o])=>t===e[0][0]&&o===e[0][1])){const[t,s]=r(e[0]);return new y({x:t,y:s,spatialReference:o})}const s=e.map(r);if(0===s.length)return;v(s)||s.reverse();return new u({spatialReference:o,rings:[s]})}get completed(){return this._completed}get effectiveSelectionManager(){return this.selectionManager??this.view.selectionManager}get effectiveType(){const e=this.type??"add";if(this._isConstraintKeyDown)switch(e){case"add":return"remove";case"remove":case"replace":return"add";default:return e}return e}get processingFinalSelection(){return!(!this._processTask||!this._tool?.drawOperation?.isCompleted)}cancel(){this.selection.removeAll(),this._onOperationFinish(!0)}destroy(){this._toolImportController=n(this._toolImportController)}async _setup(){const{createTool:e,view:t}=this;if(await t.whenReady(),this.destroyed||this._toolImportController)return;const o=new AbortController;this._toolImportController=o;const r=await import("../../../views/draw/DrawScreenTool.js");if(o.signal.aborted)return;const n=Symbol();try{this._tool=new r.DrawScreenTool({view:t,mode:this.mode??this._defaultMode,geometryType:e,cursor:"point"===e?"default":"crosshair"})}finally{this._toolImportController=null}this._tool?(this.selectOnComplete||this.addHandles(this._tool.on(["cursor-update","vertex-add","vertex-remove"],()=>{this._syncConstraintKeyDown(),a(this._process({selector:this._selectionArea}))}),n),this._syncConstraintKeyDown(),this.addHandles([p(()=>t,"key-down",e=>{if(!e.repeat)switch(this._syncConstraintKeyDown(),e.key){case f.constraint:this._tool.uniformSizeToggled=!0,e.stopPropagation();break;case f.center:this._tool.centeredToggled=!0,e.stopPropagation()}}),p(()=>t,"key-up",e=>{switch(this._syncConstraintKeyDown(),e.key){case f.constraint:this._tool.uniformSizeToggled=!1,e.stopPropagation();break;case f.center:this._tool.centeredToggled=!1,e.stopPropagation()}}),this.selection.on("change",({added:e,removed:t})=>this.emit("selection-change",{operationType:this.effectiveType,added:e,removed:t})),this._tool.on("complete",async e=>{this._syncConstraintKeyDown(),this.removeHandles(n),e.aborted?this.cancel():(this._tool.cursor="progress",await this._process({selector:this._selectionArea,callback:this._onOperationFinish,completed:!0}))})],n),this.addHandles(s(()=>t.tools.remove(this._tool))),t.addAndActivateTool(this._tool)):i.getLogger(this).warn("Unable to import Draw module. SelectionOperation failed to load.")}_syncConstraintKeyDown(){const{inputManager:e}=this.view;this._isConstraintKeyDown=_.invertType.some(t=>e.isModifierKeyDown(t))}_onOperationFinish(e=!1){this.removeAllHandles(),this._processTask?.abort(),this._completed=!0,this.emit("complete",{aborted:e,operationType:this.effectiveType,selection:this.selection.toArray(),toolName:this.toolName})}};e([h()],T.prototype,"_completed",void 0),e([h()],T.prototype,"_defaultMode",null),e([h()],T.prototype,"_isConstraintKeyDown",void 0),e([h()],T.prototype,"_processTask",void 0),e([h()],T.prototype,"_selectionArea",null),e([h()],T.prototype,"completed",null),e([h({constructOnly:!0})],T.prototype,"createTool",void 0),e([h()],T.prototype,"effectiveSelectionManager",null),e([h()],T.prototype,"effectiveType",null),e([h({constructOnly:!0})],T.prototype,"mode",void 0),e([h()],T.prototype,"persistSelection",void 0),e([h()],T.prototype,"processingFinalSelection",null),e([h()],T.prototype,"returnFeatureTitleFields",void 0),e([h()],T.prototype,"returnGeometry",void 0),e([h({readOnly:!0})],T.prototype,"selection",void 0),e([h({constructOnly:!0})],T.prototype,"selectionManager",void 0),e([h({constructOnly:!0})],T.prototype,"selectOnComplete",void 0),e([h()],T.prototype,"sources",void 0),e([h({constructOnly:!0})],T.prototype,"toolName",void 0),e([h()],T.prototype,"type",void 0),e([h({constructOnly:!0})],T.prototype,"view",void 0),T=e([m("esri.widgets.support.Selector2D.SelectionOperation")],T);const C=T;export{C as default};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type Graphic from "../../../Graphic.js";
|
|
2
|
+
import type Extent from "../../../geometry/Extent.js";
|
|
3
|
+
import type Multipoint from "../../../geometry/Multipoint.js";
|
|
4
|
+
import type Point from "../../../geometry/Point.js";
|
|
5
|
+
import type Polygon from "../../../geometry/Polygon.js";
|
|
6
|
+
import type Polyline from "../../../geometry/Polyline.js";
|
|
7
|
+
import type GraphicsLayer from "../../../layers/GraphicsLayer.js";
|
|
8
|
+
import type KnowledgeGraphLayer from "../../../layers/KnowledgeGraphLayer.js";
|
|
9
|
+
import type LinkChartLayer from "../../../layers/LinkChartLayer.js";
|
|
10
|
+
import type MapNotesLayer from "../../../layers/MapNotesLayer.js";
|
|
11
|
+
import type SubtypeGroupLayer from "../../../layers/SubtypeGroupLayer.js";
|
|
12
|
+
import type SubtypeSublayer from "../../../layers/support/SubtypeSublayer.js";
|
|
13
|
+
import type FeatureLikeLayerView from "../../../views/layers/FeatureLikeLayerView.js";
|
|
14
|
+
import type { SelectableLayer, SelectableLayerView } from "../../../views/selection/types.js";
|
|
15
|
+
import type { CreateTool } from "../../Sketch/types.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Types of parent layers that include potential sources from which selections may be determined.
|
|
19
|
+
* Sublayers are typically included in SelectableLayer or SelectionSource.
|
|
20
|
+
*
|
|
21
|
+
* @since 5.1
|
|
22
|
+
*/
|
|
23
|
+
export type SelectableParentLayer = MapNotesLayer | KnowledgeGraphLayer | LinkChartLayer | SubtypeGroupLayer;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Layer source types from which selections can be determined.
|
|
27
|
+
*
|
|
28
|
+
* @since 5.1
|
|
29
|
+
*/
|
|
30
|
+
export type SelectionLayerSource = SelectableLayer | SubtypeSublayer | SelectableParentLayer;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Types of sources from which selections can be determined.
|
|
34
|
+
*
|
|
35
|
+
* @since 5.1
|
|
36
|
+
*/
|
|
37
|
+
export type SelectionSource = SelectionLayerSource | SelectableLayerView | FeatureLikeLayerView | GraphicsLayer;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Types of geometries that can be used to determine selections.
|
|
41
|
+
*
|
|
42
|
+
* @since 5.1
|
|
43
|
+
*/
|
|
44
|
+
export type SelectorGeometry = Extent | Multipoint | Point | Polygon | Polyline;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Types of selection operations.
|
|
48
|
+
*
|
|
49
|
+
* @since 5.1
|
|
50
|
+
*/
|
|
51
|
+
export type SelectionOperationType = "add" | "remove" | "replace";
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Information shared by selection operation events.
|
|
55
|
+
*
|
|
56
|
+
* @since 5.1
|
|
57
|
+
*/
|
|
58
|
+
export interface SelectionChangeEventInfo {
|
|
59
|
+
/**
|
|
60
|
+
* Reference to [graphics](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) which were added to the current selection set.
|
|
61
|
+
*
|
|
62
|
+
* @since 5.1
|
|
63
|
+
*/
|
|
64
|
+
added: Graphic[];
|
|
65
|
+
/**
|
|
66
|
+
* Reference to [graphics](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) which were removed from the current selection set.
|
|
67
|
+
*
|
|
68
|
+
* @since 5.1
|
|
69
|
+
*/
|
|
70
|
+
removed: Graphic[];
|
|
71
|
+
/**
|
|
72
|
+
* Indicates the current type of selection operation.
|
|
73
|
+
*
|
|
74
|
+
* @since 5.1
|
|
75
|
+
*/
|
|
76
|
+
operationType: SelectionOperationType;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Types of events emitted by a selection operation.
|
|
81
|
+
*
|
|
82
|
+
* @since 5.1
|
|
83
|
+
*/
|
|
84
|
+
export interface SelectionOperationEvents {
|
|
85
|
+
/**
|
|
86
|
+
* Fires when a selection operation is completed or cancelled.
|
|
87
|
+
*
|
|
88
|
+
* @since 5.1
|
|
89
|
+
*/
|
|
90
|
+
complete: SelectionCompleteEventInfo;
|
|
91
|
+
/**
|
|
92
|
+
* Fires when a selection change is determined by the selection operation.
|
|
93
|
+
*
|
|
94
|
+
* @since 5.1
|
|
95
|
+
*/
|
|
96
|
+
"selection-change": SelectionChangeEventInfo;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** @since 5.1 */
|
|
100
|
+
export interface SelectionCompleteEventInfo {
|
|
101
|
+
/**
|
|
102
|
+
* Indicates the selection operation was cancelled.
|
|
103
|
+
*
|
|
104
|
+
* @since 5.1
|
|
105
|
+
*/
|
|
106
|
+
aborted: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Indicates the current type of selection operation.
|
|
109
|
+
*
|
|
110
|
+
* @since 5.1
|
|
111
|
+
*/
|
|
112
|
+
operationType: SelectionOperationType;
|
|
113
|
+
/**
|
|
114
|
+
* Reference to the current working selection set.
|
|
115
|
+
*
|
|
116
|
+
* @since 5.1
|
|
117
|
+
*/
|
|
118
|
+
selection: Graphic[];
|
|
119
|
+
/**
|
|
120
|
+
* Indicates the selection tool used by the selection operation.
|
|
121
|
+
*
|
|
122
|
+
* @since 5.1
|
|
123
|
+
*/
|
|
124
|
+
toolName: ToolName;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Reference to the type of sketch creation tool used by the selection operation.
|
|
129
|
+
*
|
|
130
|
+
* @since 5.1
|
|
131
|
+
*/
|
|
132
|
+
export type SelectionOperationCreateTool = Extract<CreateTool, "point" | "polygon" | "circle" | "rectangle">;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Reference to a type of selection tool used by the selection operation.
|
|
136
|
+
*
|
|
137
|
+
* @since 5.1
|
|
138
|
+
*/
|
|
139
|
+
export type ToolName = "lasso" | "rectangle" | "point" | string;
|