@arcgis/core 5.2.0-next.42 → 5.2.0-next.44
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/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0115681a3de6df0aebdf.js +1 -0
- package/assets/esri/core/workers/chunks/025caafc70ac26f0a4ed.js +1 -0
- package/assets/esri/core/workers/chunks/{d66d58ed5d66520ab1bf.js → 04a167c110fb7811169d.js} +1 -1
- package/assets/esri/core/workers/chunks/{72fe7fb03c156f26a589.js → 08e18fb12533fc76e49c.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e79fb1b8445b2091cdb.js → 0a0732ba8271d7dc985c.js} +1 -1
- package/assets/esri/core/workers/chunks/{e6b5c015205d38abe037.js → 127b111ee53e4b9184f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d7cfc68a38dabd8898a.js → 176c5eaaa23a479c88e0.js} +1 -1
- package/assets/esri/core/workers/chunks/1d1f5578c7d8619f7a46.js +1 -0
- package/assets/esri/core/workers/chunks/268637fd6c50264acfc3.js +1 -0
- package/assets/esri/core/workers/chunks/296fa9fb80e521c30cb1.js +1 -0
- package/assets/esri/core/workers/chunks/{c50e4e8c6188e64e7d45.js → 2974cddb0b0f67df7d2d.js} +1 -1
- package/assets/esri/core/workers/chunks/{e9511627418c6864148a.js → 305ee2dd597c48a38e64.js} +1 -1
- package/assets/esri/core/workers/chunks/3252da57b800356116af.js +1 -0
- package/assets/esri/core/workers/chunks/{fd47ee8598e37fea03fe.js → 384b619854ef8a3f6e94.js} +1 -1
- package/assets/esri/core/workers/chunks/3af923abeb6e65c4468f.js +1 -0
- package/assets/esri/core/workers/chunks/3f4f1595c8a77d072b04.js +1 -0
- package/assets/esri/core/workers/chunks/4f09f208ece2ec1db727.js +1 -0
- package/assets/esri/core/workers/chunks/{67468c50ecb1fbedda87.js → 549295a5db9bf1536491.js} +1 -1
- package/assets/esri/core/workers/chunks/{284e88805184334396fe.js → 57374213084bef59b776.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a8d791aef3123e6a3c4.js → 57970d43cdcc5cf57a30.js} +1 -1
- package/assets/esri/core/workers/chunks/{dedf678490572c500a19.js → 5b937c405788fd14be8b.js} +2 -2
- package/assets/esri/core/workers/chunks/5f9c4dad6952c4c58ebf.js +1 -0
- package/assets/esri/core/workers/chunks/706230b70a36d2e038f7.js +1 -0
- package/assets/esri/core/workers/chunks/76713b700e053f8bad29.js +1 -0
- package/assets/esri/core/workers/chunks/{90ace5f9b4af1beea6bf.js → 7b6b8d0673976c6c26de.js} +1 -1
- package/assets/esri/core/workers/chunks/{321dbc60f44819c2b4de.js → 81d55594cee124040565.js} +1 -1
- package/assets/esri/core/workers/chunks/8a01fe8d78ca85ea4784.js +1 -0
- package/assets/esri/core/workers/chunks/9114a575b78a7ea18d0f.js +1 -0
- package/assets/esri/core/workers/chunks/93e705c1147cc8ceca02.js +1 -0
- package/assets/esri/core/workers/chunks/{d082de5dd83bd73d209b.js → 94cebc34e49da1e295ed.js} +1 -1
- package/assets/esri/core/workers/chunks/{34fcb776e4de1d870bbd.js → a38a7e3a5aa9294ab918.js} +2 -2
- package/assets/esri/core/workers/chunks/a8033e606b2db1ee332d.js +1 -0
- package/assets/esri/core/workers/chunks/{6f408397e2c8a2ea9805.js → aea247138617e12b699b.js} +1 -1
- package/assets/esri/core/workers/chunks/{26e7884d8639df4d994b.js → b03dcf3d55266745f3d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{f1d3cf674b6bea89e122.js → b3cefc1895bfd62fc440.js} +1 -1
- package/assets/esri/core/workers/chunks/{ec1a2e68957fae48e60b.js → b75db3b1becf8265ec59.js} +3 -3
- package/assets/esri/core/workers/chunks/{82f4aa0533db009b11d8.js → bac4d4a9f3a9b7f6864d.js} +2 -2
- package/assets/esri/core/workers/chunks/{2f29f08cddd5add9388e.js → c01a121ebe571a848452.js} +1 -1
- package/assets/esri/core/workers/chunks/{c1845682cc9a5aac8703.js → c316234837b7ca406b1c.js} +3 -3
- package/assets/esri/core/workers/chunks/c3cd38ca8690286d40d7.js +1 -0
- package/assets/esri/core/workers/chunks/c6042825f61cd70d54d8.js +1 -0
- package/assets/esri/core/workers/chunks/{0646524250bb9fe82935.js → d8b67ca02cdc1e8191e3.js} +1 -1
- package/assets/esri/core/workers/chunks/db416ba3132034e20642.js +1 -0
- package/assets/esri/core/workers/chunks/{590e977f8eeb379b86c8.js → e5c19e9b6fa53abdca8c.js} +21 -27
- package/assets/esri/core/workers/chunks/f9b2727b41943d83d4ca.js +1 -0
- package/assets/esri/core/workers/chunks/{934044f2ef6ce199b399.js → fc880b275f5eaf42171e.js} +1 -1
- package/assets/esri/libs/basisu/basis_encoder.wasm +0 -0
- package/assets/esri/libs/dxtEncoder/dxt_encoder.wasm +0 -0
- package/chunks/Component.glsl.js +2 -2
- package/chunks/CutFillTargetDepth.glsl.js +1 -2
- package/chunks/Fog.glsl.js +3 -3
- package/chunks/GlobalIllumination.glsl.js +21 -21
- package/chunks/GlobalIlluminationBlur.glsl.js +1 -1
- package/chunks/GlowComposition.glsl.js +3 -3
- package/chunks/OITAddEmission.glsl.js +1 -1
- package/chunks/Path.glsl.js +4 -4
- package/chunks/Terrain.glsl.js +2 -2
- package/chunks/basis_encoder.js +1 -1
- package/chunks/dxt_encoder.js +1 -1
- package/config.js +1 -1
- package/geometry/support/aaBoundingBox.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/third-party-notices.txt +156 -0
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/RenderingDevice.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimationUniformInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/utility/BitBlitTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/utility/HighlightTechnique.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +1 -1
- package/views/2d/webglDeps.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightAggregateManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightConfiguration.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/terrain/GeometryState.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TileAgent.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Transform.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +4 -10
- package/views/3d/webgl-engine/effects/WeatherFader.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/fog/FogTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowBlurTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITAddEmission.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendFragmentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/oitBlendFragment.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillComputation.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
- package/views/3d/webgl-engine/shaders/CutFillTargetDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +2 -2
- package/views/3d/webgl-engine/shaders/{oitResolution.glsl.js → floatBlendScale.glsl.js} +1 -1
- package/views/GroundView.js +1 -1
- package/views/input/BrowserEventSource.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/support/imageReprojection.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/support/dateUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0d6afba80d2f8dcb5cf7.js +0 -1
- package/assets/esri/core/workers/chunks/1276df03201c1b855fee.js +0 -1
- package/assets/esri/core/workers/chunks/18d874739ee9ffad7480.js +0 -1
- package/assets/esri/core/workers/chunks/23570397304969f724b3.js +0 -1
- package/assets/esri/core/workers/chunks/474ea8c97d101e41b3f5.js +0 -1
- package/assets/esri/core/workers/chunks/551d0c5432f7a08dea77.js +0 -1
- package/assets/esri/core/workers/chunks/5923ebadd4f75be2c9cc.js +0 -1
- package/assets/esri/core/workers/chunks/7cb0681cc6a5e956cb15.js +0 -1
- package/assets/esri/core/workers/chunks/8b73694d5a97638a3a61.js +0 -1
- package/assets/esri/core/workers/chunks/8dee03779b569f233daf.js +0 -1
- package/assets/esri/core/workers/chunks/9ebc98746b1f085b82b7.js +0 -1
- package/assets/esri/core/workers/chunks/9ee3741eef73f3edb18b.js +0 -1
- package/assets/esri/core/workers/chunks/af97e19516dbbcfb5286.js +0 -1
- package/assets/esri/core/workers/chunks/b4047333265a2665aef9.js +0 -1
- package/assets/esri/core/workers/chunks/c3fae4f4522604a9c17e.js +0 -1
- package/assets/esri/core/workers/chunks/cce83896093279c70449.js +0 -1
- package/assets/esri/core/workers/chunks/d5561dff043789494845.js +0 -1
- package/assets/esri/core/workers/chunks/e2c9393bec747f7876bb.js +0 -1
- package/assets/esri/core/workers/chunks/e94f2d6037fba042dc6e.js +0 -1
- package/assets/esri/core/workers/chunks/f5d7f69047e1b1116202.js +0 -1
- package/views/2d/engine/webgl/MaterialManager.js +0 -2
- package/views/2d/engine/webgl/shaders/MaterialPrograms.js +0 -2
- package/views/2d/engine/webgl/shaders/sources/resolver.js +0 -2
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +0 -2
- package/views/webgl/ShaderCompiler.js +0 -2
- /package/assets/esri/core/workers/chunks/{82f4aa0533db009b11d8.js.LICENSE.txt → bac4d4a9f3a9b7f6864d.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import
|
|
2
|
+
import"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{RenderingDevice as t}from"./RenderingDevice.js";import s from"./TextureManager.js";import{TextureUploadManager as i}from"./TextureUploadManager.js";import{BlendEffect as r}from"./effects/BlendEffect.js";import{FeatureEffect as n}from"./effects/FeatureEffect.js";import o from"./effects/HighlightEffect.js";import{HittestEffect as h}from"./effects/HittestEffect.js";import{EffectManager as f}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as a}from"./meshing/SimpleMesh.js";import{BitBlitTechnique as l}from"./shaderGraph/techniques/utility/BitBlitTechnique.js";import{WorldExtentClipTechnique as c}from"./shaderGraph/techniques/utility/WorldExtentClipTechnique.js";import{SizedDepthStencilFormat as d}from"../../../webgl/enums.js";import{DisposableFramebufferObject as u}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as p}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as b}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as g}from"../../../webgl/TextureDescriptor.js";class _{constructor(e,d){this.context=e,this._blitTechnique=new l,this._worldExtentClipTechnique=new c,this._lastWidth=null,this._lastHeight=null,this._blendEffect=new r,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new o,hittest:new h,insideEffect:new n("inside"),outsideEffect:new n("outside")},this.textureManager=new s(d),this.textureUploadManager=new i(d),this._effectsManager=new f,this._quadMesh=a.fromVertexStream(e,[0,0,1,0,0,1,1,1]),this._renderingDevice=new t}dispose(){if(this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitTechnique.shutdown(),this._worldExtentClipTechnique.shutdown(),this._quadMesh=e(this._quadMesh),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._renderingDevice.dispose()}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const i=new g(e,t);i.samplingMode=9728,i.wrapMode=33071,s=new u(this.context,i,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:i}=e;this._worldExtentClipTechnique.render(e,{backgroundColor:t,padding:s});const{width:r,height:n}=i.getViewport();if(this.updateFBOs(r,n),this._prevFBO=i.boundFramebuffer,i.bindFramebuffer(this.getFbos().output),i.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:r,a:n}=t;i.setClearColor(n*e/255,n*s/255,n*r/255,n)}else i.setClearColor(0,0,0,0);i.setDepthWriteEnabled(!0),i.setClearDepth(1),i.clear(16640),i.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),this._blitTechnique.render(e,{texture:this.getFbos().output.colorTexture,samplingMode:9728,opacity:1,clipToVisibleRegion:!0}),this._renderingDevice.setPipelineStateNeedsUpdate(!0)}beforeRenderLayer(e,t,s){const{context:i,blendMode:r,effects:n,drawPhase:o,requireFBO:h}=e;if(i.setClearColor(0,0,0,0),h||m(o,r,n,s)){const e=i.boundFramebuffer;this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=i.getViewport(),r=this.acquireFbo(t,s);i.bindFramebuffer(r),i.setColorMask(!0,!0,!0,!0),i.setClearColor(0,0,0,0),i.setDepthWriteEnabled(!0),i.setClearDepth(1),i.clear(16640),i.setDepthWriteEnabled(!1)}i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setStencilTestEnabled(!0),i.setClearStencil(t),i.setStencilWriteMask(255),i.clear(1024)}afterRenderLayer(e,t){const{context:s,blendMode:i,effects:r,requireFBO:n,drawPhase:o}=e;if(n||m(o,i,r,t)){const n=s.boundFramebuffer;if(null==n)return;null!=r&&r.length>0&&1===o&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,r,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(1,771,1,771),s.setColorMask(!0,!0,!0,!0);const h=null==i||16===o||2===o||128===o?"normal":i;this._blendEffect.draw(e,n.colorTexture,9728,h,t),this.releaseFbo(n)}}blitTexture(e,t,s,i=1){this._blitTechnique.render(e,{texture:t,samplingMode:s,opacity:i}),this._renderingDevice.setPipelineStateNeedsUpdate(!0)}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new g(e,t);s.samplingMode=9728,s.wrapMode=33071;const i=new b(d.DEPTH24_STENCIL8,e,t);this._stencilBuf=new p(this.context,i),this._fbos={output:new u(this.context,s,this._stencilBuf),effect0:new u(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:i}=e,r=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingTechnique:n,effect:o}of r)i.bindFramebuffer(s),n.render(e,{layerFBO:s,effect:o});this._renderingDevice.setPipelineStateNeedsUpdate(!0)}setShader(e){return this._renderingDevice.setShader(e)}clearShaderCache(){this._renderingDevice.clearShaderCache()}getProgramCache(){return this._renderingDevice.getProgramCache()}setPipelineState(e){return this._renderingDevice.setPipelineState(e)}getPipelineState(){return this._renderingDevice.getPipelineState()}submitDraw(e,t,s){return this._renderingDevice.submitDraw(e,t,s)}submitDrawMesh(e,t,s,i){this._renderingDevice.submitDrawMesh(e,t,s,i)}submitDrawMeshUntyped(e,t,s,i){this._renderingDevice.submitDrawMeshUntyped(e,t,s,i)}updatePipelineState(e){return this._renderingDevice.updatePipelineState(e)}setStencilRef(e,t){return this._renderingDevice.setStencilRef(e,t)}}function m(e,t,s,i){return 4!==e&&2!==e&&16!==e&&128!==e&&(1!==i||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{_ as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import"../../../../core/Logger.js";import{TechniqueProgramCache as e}from"./shaderGraph/techniques/TechniqueProgramCache.js";class t{constructor(){this._currentPipelineStateNeedsUpdate=!1,this._programCache=new e}dispose(){this._programCache.destroy()}clearShaderCache(){this._programCache.destroy(),this._programCache=new e}setShader(e){return this._shaderState={shader:e.shader,uniforms:e.uniforms,textures:e.textures,defines:e.defines,optionalAttributes:e.optionalAttributes,useComputeBuffer:e.useComputeBuffer??!1},this._shaderState}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}getPipelineState(){return this._currentPipelineState}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i}=r;if(null==t)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(1032,s,t,i)}}}setPipelineStateNeedsUpdate(e){this._currentPipelineStateNeedsUpdate=e}getShaderState(){return this._shaderState}getProgramCache(){return this._programCache}submitDraw(e,t,s){let r=s?.stencilRef;if(!this._shaderState)return null;const{shader:i,uniforms:n,textures:a,defines:l,optionalAttributes:o}=this._shaderState,c=e.context,d=t.getAttributePrecisionPackFactors(),p=this._programCache.getProgram(i,d,n,a??{},l??{},o??{});if(p.setUniforms(n),p.setTextures(a),p.bind(c),this.updatePipelineState(c),null==r){const e=t.getStencilReference();null!=e&&(r=e)}return null!=r&&this.setStencilRef(c,r),t.draw(e,i.locationInfo),p.cleanupTemporaryTextures(),{vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){const i=r?.parts,n=r?.stencilRef,{precisionFactors:a,materialKey:l}=t,{shader:o,uniforms:c,textures:d,defines:p,optionalAttributes:h}=this.setShader(t),u=this._programCache.getProgram(o,a||{},c,d??{},p??{},h??{},l);if(u.setUniforms(c),u.setTextures(d),u.bind(e),this.updatePipelineState(e),this.setStencilRef(e,n),i)for(const S of i)s.bind(e,t.shader.locationInfo,S),s.draw(e);else for(let S=0;S<s.parts.length;S++)s.bind(e,t.shader.locationInfo,S),s.draw(e);s.unbind(e),u.cleanupTemporaryTextures()}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled("none"!==s),e.setBlendEquation(32774),s){case"composite":e.setBlendFunctionSeparate(1,771,1,771);break;case"additive":e.setBlendFunctionSeparate(1,1,1,1);break;case"custom":{const{blendParameters:s,blendEquation:r}=t,{dstAlpha:i,dstRGB:n,srcAlpha:a,srcRGB:l}=s;
|
|
2
|
+
import"../../../../core/has.js";import"../../../../core/Logger.js";import{TechniqueProgramCache as e}from"./shaderGraph/techniques/TechniqueProgramCache.js";class t{constructor(){this._currentPipelineStateNeedsUpdate=!1,this._programCache=new e}dispose(){this._programCache.destroy()}clearShaderCache(){this._programCache.destroy(),this._programCache=new e}setShader(e){return this._shaderState={shader:e.shader,uniforms:e.uniforms,textures:e.textures,defines:e.defines,optionalAttributes:e.optionalAttributes,useComputeBuffer:e.useComputeBuffer??!1},this._shaderState}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}getPipelineState(){return this._currentPipelineState}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i}=r;if(null==t)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(1032,s,t,i)}}}setPipelineStateNeedsUpdate(e){this._currentPipelineStateNeedsUpdate=e}getShaderState(){return this._shaderState}getProgramCache(){return this._programCache}submitDraw(e,t,s){let r=s?.stencilRef;if(!this._shaderState)return null;const{shader:i,uniforms:n,textures:a,defines:l,optionalAttributes:o}=this._shaderState,c=e.context,d=t.getAttributePrecisionPackFactors(),p=this._programCache.getProgram(i,d,n,a??{},l??{},o??{});if(p.setUniforms(n),p.setTextures(a),p.bind(c),this.updatePipelineState(c),null==r){const e=t.getStencilReference();null!=e&&(r=e)}return null!=r&&this.setStencilRef(c,r),t.draw(e,i.locationInfo),p.cleanupTemporaryTextures(),{vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){const i=r?.parts,n=r?.stencilRef,{precisionFactors:a,materialKey:l}=t,{shader:o,uniforms:c,textures:d,defines:p,optionalAttributes:h}=this.setShader(t),u=this._programCache.getProgram(o,a||{},c,d??{},p??{},h??{},l);if(u.setUniforms(c),u.setTextures(d),u.bind(e),this.updatePipelineState(e),this.setStencilRef(e,n),i)for(const S of i)s.bind(e,t.shader.locationInfo,S),s.draw(e);else for(let S=0;S<s.parts.length;S++)s.bind(e,t.shader.locationInfo,S),s.draw(e);s.unbind(e),u.cleanupTemporaryTextures()}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled("none"!==s),e.setBlendEquation(32774),s){case"composite":e.setBlendFunctionSeparate(1,771,1,771);break;case"additive":e.setBlendFunctionSeparate(1,1,1,1);break;case"custom":{const{blendParameters:s,blendEquation:r}=t,{dstAlpha:i,dstRGB:n,srcAlpha:a,srcRGB:l}=s;e.setBlendEquation(r),e.setBlendFunctionSeparate(l,n,a,i);break}case"delete":e.setBlendEquation(32779),e.setBlendFunctionSeparate(1,771,1,771);break;case"none":e.setBlendingEnabled(!1)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{op:s}=t;e.setStencilTestEnabled(!0),e.setStencilOpSeparate(1032,s.fail,s.zFail,s.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}}export{t as RenderingDevice};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as i}from"tslib";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as e}from"../../../animations/instructions.js";import{location as o,uniform as a,texture as
|
|
2
|
+
import{__decorate as i}from"tslib";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as e}from"../../../animations/instructions.js";import{location as o,uniform as a,texture as s,option as r}from"../../GraphShaderModule.js";import{Vec2 as l,Vec4 as n,Float as m,Sampler2D as p,step as u,negate as d,cond as c,equal as y,Mat2 as f,cos as v,sin as b,Mat3 as h,Vec3 as S,lessThanEqual as w,ifElse as g,texture2D as x,clamp as V,abs as z,block as T}from"../../graph/glsl.js";import{AnimationUniformInfo as P}from"./AnimationUniformInfo.js";import{MarkerConstants as j}from"../markers/markerConstants.js";import{FeatureVertexInput as _,AFeatureShader as I,FeatureFragmentInput as O}from"../shaders/AFeatureShader.js";import{softEdgeRatio as C}from"../shaders/constants.js";import{LocalTileOffset as M}from"../shaders/LocalTileOffset.js";import{MosaicInfo as A}from"../shaders/MosaicInfo.js";import{getBit as D,rgba2float as F}from"../shaders/utils.js";import{VisualVariableColor as L}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as R}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as k}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as U}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as E}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as B}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as G}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as N,getVisualVariableAngle as q}from"../shaders/vvUtils.js";class W extends _{}i([o(3,l)],W.prototype,"offset",void 0),i([o(4,n)],W.prototype,"sizing",void 0),i([o(5,n)],W.prototype,"value1Position2Value2",void 0),i([o(6,n)],W.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),i([o(7,l)],W.prototype,"zoomRange",void 0),i([o(8,m)],W.prototype,"lineLength",void 0);class H extends O{}class J extends I{_vertexPreamble(i,t,e){const{id:o,offset:a,animationPointerAndBaseSizeAndReferenceSize:s,sizing:r}=i,l=s.xy,n=s.z,p=s.w,h=r.xy,S=this._getEvalParams(i,h,e);let w,g;if(i.value1Position2Value2){let t;t=this.hittestRequest?new m(0):K(l,6,S).a.multiply(this.animationInfo.scaleAdjustment);const e=i.pos,o=i.value1Position2Value2.yz,a=i.value1Position2Value2.x,s=i.value1Position2Value2.w,r=t.subtract(a).divide(s.subtract(a));g=e.add(o.subtract(e).multiply(r)),w=u(new m(1),r).add(u(new m(0),d(r)))}else g=i.pos,w=new m(0);const x=r.z,V=D(i.bitset,j.bitset.isStroke),z=r.w,T=D(i.bitset,j.bitset.scaleSymbolsProportionally),P=K(l,0,S),_=c([y(D(i.bitset,j.bitset.isMapAligned),new m(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new m(0)]),I=new f(v(_),b(_.multiply(-1)),b(_),v(_)).multiply(P.xy),O=P.z.subtract(_).subtract(t),C=P.w,M=D(i.bitset,j.bitset.isSDF),A=N(this,o,new m(p)).divide(new m(p));return{baseSize:n,animationPointer:l,strokeWidth:x,isOutline:V,unscaledDistanceToPx:z,scaleSymbolsProportionally:T,isSDF:M,position:this._getScreenPosition({id:o,pos:g,offset:a,referenceSize:p,translation:I,rotation:O,scale:C,vvScale:A}),evalParams:S,vvScale:A,scale:C,clip:w}}_getScreenPosition(i){const{pos:t,translation:e,rotation:o,scale:a,offset:s,id:r,vvScale:l}=i,n=q(this,r).multiply(Math.PI/180),p=e.x.multiply(4/3),u=e.y.multiply(-1).multiply(4/3),c=b(n),y=v(n),f=y.multiply(p).add(d(c).multiply(u)),w=c.multiply(p).add(y.multiply(u)),g=b(o.subtract(n)),x=v(o.subtract(n)),V=new m(0),z=new m(1),{pixelRatio:T}=this.animationInfo,P=new h(z,V,V,V,z,V,f.multiply(T),w.multiply(T),z),j=new h(x,g.multiply(-1),V,g,x,V,0,0,z),_=a.multiply(l).multiply(T).multiply(4/3),I=j.multiply(_),O=this.animationInfo.toScreen.multiply(new S(t,1)),C=P.multiply(O).xy,M=I.multiply(new S(s,0)).xy;return C.add(M)}_clip(i,e){let o=super.clip(i,e);const a=w(this._getLocalTimeOrigin(i),new m(0));return t.forceGlobalTimeOrigin||(o=o.add(c([a,()=>new m(2)],[!0,()=>new m(0)]))),o}_getLocalTimeOrigin(i){return this.getLocalTimeOrigin(i)}_toNdc(i){return this.animationInfo.toNdc.multiply(new S(i,1)).xy}_getEvalParams(i,t,e){const{globalTime:o,animationTextureSize:a}=this.animationInfo;return{globalTime:o,localTimeOrigin:this._getLocalTimeOrigin(i.id),animationTextureSize:a,animationTexture:this.animationTexture,pixelDimensions:t,lineLength:e}}_getColor(i,t){return g(y(t.isSDF,new m(1)),this._getSDFColor(i,t),this._getSpriteColor(i,t))}_getSpriteColor(i,t){return x(this.mosaicTexture,i).multiply(t.color)}_getSDFColor(i,t){const e=x(this.mosaicTexture,i),o=new m(.5).subtract(F(e)).multiply(t.distanceToPx).multiply(C),a=V(new m(.5).subtract(o),new m(0),new m(1)),s=t.color.multiply(a),r=t.outlineSize.multiply(.5),l=z(o).subtract(r),n=V(new m(.5).subtract(l),new m(0),new m(1)),p=t.outlineColor.multiply(n);return new m(1).subtract(p.a).multiply(s).add(p)}}function K(i,t,o){const a=i.add(new l(t,0)),s=x(o.animationTexture,a.add(.5).divide(o.animationTextureSize)).xy;return i=i.add(s),T({animationPointer:i,...o},n,null,i=>{const{out:t}=i;if(!t)throw new Error("out is null");return e({...i,out:t})})}i([a(A)],J.prototype,"mosaicInfo",void 0),i([a(P)],J.prototype,"animationInfo",void 0),i([a(M)],J.prototype,"localTileOffset",void 0),i([s(p)],J.prototype,"mosaicTexture",void 0),i([r(L)],J.prototype,"visualVariableColor",void 0),i([r(R)],J.prototype,"visualVariableOpacity",void 0),i([r(U)],J.prototype,"visualVariableSizeMinMaxValue",void 0),i([r(E)],J.prototype,"visualVariableSizeScaleStops",void 0),i([r(B)],J.prototype,"visualVariableSizeStops",void 0),i([r(G)],J.prototype,"visualVariableSizeUnitValue",void 0),i([r(k)],J.prototype,"visualVariableRotation",void 0),i([s(p)],J.prototype,"animationTexture",void 0);export{H as AAnimatedFragmentInput,J as AAnimatedShader,W as AAnimatedVertexInput,K as getValue};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t,__param as i}from"tslib";import{location as e,uniform as s,input as o}from"../../GraphShaderModule.js";import{Float as l,Vec2 as
|
|
2
|
+
import{__decorate as t,__param as i}from"tslib";import{location as e,uniform as s,input as o}from"../../GraphShaderModule.js";import{Float as l,Vec2 as n,dot as a,max as r,Vec4 as d,mix as m,length as p,clamp as u,step as c,min as h,ifElse as y,greaterThan as f}from"../../graph/glsl.js";import{PolyHittestVertexInput as v,PolyVertexInput as b,AAnimatedPolyShader as g,PolyFragmentInput as x}from"./AAnimatedPolyShader.js";import{getValue as S}from"./AAnimatedShader.js";import{noHit as w,trueHit as P}from"../shaders/constants.js";import{isRectHittest as j,distPointSegment as A,hittestScreenRect as z}from"../shaders/hittestUtils.js";import{AntialiasingControls as D,getLineAntialiasing as R,getLineThinFactor as C}from"../shaders/LineShader.js";class F extends b{}t([e(10,l)],F.prototype,"accumulatedDistance",void 0),t([e(11,n)],F.prototype,"normal",void 0),t([e(12,n)],F.prototype,"segmentDirection",void 0);class T extends x{}class W extends g{constructor(){super(...arguments),this.type="AnimatedLineShader"}vertex(t,i){const{animationPointerAndBaseSizeAndReferenceSize:e}=t,s=e.xy,{distanceToPx:o,ndc:p,z:u,color:c,isOutline:h,strokeWidth:y,isSDF:f,baseSize:v,scale:b,scaleSymbolsProportionally:g,evalParams:x}=this._vertexPoly(t),w=t.sizing.xy,P=w.x.multiply(v).divide(w.y),j=S(s,6,x).a.multiply(this.animationInfo.scaleAdjustment),A=t.accumulatedDistance.subtract(j),{normal:z}=t,D=t.normal.y,R=A.divide(this.view.displayZoomFactor).add(a(t.segmentDirection,t.offset)).divide(P),C=D.add(1).divide(2),F=new n(R,C),T=t.tlbr.divide(this.mosaicInfo.size.xyxy),W=v.divide(2),q=new l(.5).multiply(this.antialiasingControls.antialiasing),O=r(W.add(q),new l(.45)).add(new l(.1).multiply(q));return{glPosition:new d(p,u,1),tlbr:T,uv:F,color:c.multiply(new l(1).subtract(h)),outlineColor:c.multiply(h),distanceToPx:o,strokeWidth:y.multiply(m(new l(1),b,g)),isOutline:h,isSDF:f,halfWidth:O,normal:z,...this.maybeRunHittest(t,i,O)}}fragment(t){const i=this._fragmentPoly(t),e=R(t,this.antialiasingControls.blur),{halfWidth:s,normal:o}=t,n=C(s),a=p(o).multiply(s),r=u(n.multiply(s.subtract(a)).divide(n.subtract(new l(1))),new l(0),new l(1));return this.getFragmentOutput(i.multiply(r).multiply(e),t)}hittest(t,i,e){const{pos0:s,pos1:o,pos2:n}=this.computeHittestTriangle(t,i,null),a=j(this.hittestRequest),{distance:r,smallSymbolDistance:d,smallSymbolSizeThreshold:m,tlbr:p}=this.hittestRequest,u=c(e,m.multiply(.5)).multiply(r.subtract(d)),v=this.hittestRequest.position,b=h(A(v,s,o),A(v,s,n)).subtract(e).add(u);return y(a,z(s,o,n,p),y(f(b,r),new l(w),new l(P)))}}t([s(D)],W.prototype,"antialiasingControls",void 0),t([i(0,o(F)),i(1,o(v))],W.prototype,"vertex",null),t([i(0,o(T))],W.prototype,"fragment",null);export{W as AnimatedLineShader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as
|
|
2
|
+
import{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{animationDebugFlags as i}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{FeatureTechnique as r}from"../FeatureTechnique.js";import{isHittest as o,getSelectionDefines as n,getFeatureTextures as s,getLocalTileOffset as m,getFeatureUniforms as l,resolveDynamicUniforms as u,getFeaturePipelineState as c}from"../featureTechniqueUtils.js";import{getAntialiasingControls as g}from"../line/utils.js";class f extends r{render(r,f){const{context:p,painter:x,pixelRatio:d}=r,{target:b}=f,{freezeGlobalTime:h}=i,T=0,y=x.textureManager.animationStore.getTexture(p,T),D=[2/r.state.size[0],0,0,0,-2/r.state.size[1],0,-1,1,1],j=Array.from(e(a(),D)),R=Array.from(t(a(),j,b.transforms.displayViewScreenMat3)),z=f.instance.getInput(),M=x.textureManager.getMosaicInfo(r,f.textureKey,!1),{optionalAttributes:S}=z,A=S.zoomRange,v=S.value1Position2Value2,I="accumulatedDistance"in S&&!!S.accumulatedDistance,q="segmentDirection"in S&&!!S.segmentDirection,w="normal"in S&&!!S.normal,P=2**(f.target.key.level-r.displayLevel);x.setShader({shader:this.shaders.geometry,uniforms:{...u(r,f.target,z.uniforms),...l(r,f.target),antialiasingControls:g(d),mosaicInfo:M,animationInfo:{globalTime:r.animationsEnabled?!1===h?r.time/1e3:h:0,scaleAdjustment:P,animationTextureSize:[y.descriptor.width,y.descriptor.height],toScreen:R,toNdc:D,mapRotation:r.state.rotation,pixelRatio:r.state.pixelRatio},localTileOffset:m(f.target)},textures:{...s(r),mosaicTexture:x.textureManager.getMosaicTexture(r,f.textureKey,!1),animationTexture:{unit:6,texture:y}},defines:{...n(r)},optionalAttributes:{zoomRange:A,value1Position2Value2:v,accumulatedDistance:I,segmentDirection:q,normal:w},useComputeBuffer:o(r)}),x.setPipelineState({...c(r)}),x.submitDraw(r,f),!1===h&&r.animationsEnabled&&b.requestRender()}}export{f as AnimatedTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as o}from"tslib";import{uniform as t,UniformGroup as p}from"../../GraphShaderModule.js";import{Float as e,Vec2 as r,Mat3 as i}from"../../graph/glsl.js";class
|
|
2
|
+
import{__decorate as o}from"tslib";import{uniform as t,UniformGroup as p}from"../../GraphShaderModule.js";import{Float as e,Vec2 as r,Mat3 as i}from"../../graph/glsl.js";class d extends p{}o([t(e)],d.prototype,"globalTime",void 0),o([t(r)],d.prototype,"animationTextureSize",void 0),o([t(i)],d.prototype,"toScreen",void 0),o([t(i)],d.prototype,"toNdc",void 0),o([t(e)],d.prototype,"mapRotation",void 0),o([t(e)],d.prototype,"pixelRatio",void 0),o([t(e)],d.prototype,"scaleAdjustment",void 0);export{d as AnimationUniformInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{simplePipelineState as e}from"../../utils.js";import{Technique as t}from"../Technique.js";import{BlendShader as r}from"../shaders/BlendShader.js";import{OpacityShader as s}from"../shaders/OpacityShader.js";import u from"../../../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../../../webgl/TextureDescriptor.js";class o extends t{constructor(){super(...arguments),this.type=5,this._backBufferTexture=null,this.shaders={blend:new r,opacity:new s}}shutdown(){super.shutdown(),null!==this._backBufferTexture&&(this._backBufferTexture.dispose(),this._backBufferTexture=null)}render(t,r){const{context:s,state:u,pixelRatio:i,inFadeTransition:o,painter:n}=t,{size:a}=u,c=s.boundFramebuffer;let f,l;null!=c?(f=c.width,l=c.height):(f=Math.round(i*a[0]),l=Math.round(i*a[1]));const{blendMode:h}=r;if("normal"===h){const t={shader:this.shaders.opacity,uniforms:{config:{opacity:r.config.opacity}},textures:{layerTexture:{texture:r.colorTexture,unit:0}},defines:null,optionalAttributes:null,useComputeBuffer:!1};return n.setPipelineState(e),void n.submitDrawMesh(s,t,n.quadMesh)}const d=this._createOrResizeTexture(t,f,l);c?.copyToTexture(0,0,f,l,0,0,d);const p={color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0}},depth:!1,stencil:!1};n.setPipelineState(p);const x={inFadeOpacity:o?1:0,...r.config},b={shader:this.shaders.blend,uniforms:{config:x},textures:{backbufferTexture:{texture:d,unit:0},layerTexture:{texture:r.colorTexture,unit:1}},defines:{blendMode:h},optionalAttributes:null,useComputeBuffer:!1};n.submitDrawMesh(s,b,n.quadMesh)}_createOrResizeTexture(e,t,r){const{context:s}=e;if(null!==this._backBufferTexture&&this._backBufferTexture.descriptor?.width===t&&this._backBufferTexture.descriptor?.height===r)return this._backBufferTexture;if(null===this._backBufferTexture){const e=new i(t,r);e.internalFormat=6408,e.wrapMode=33071,this._backBufferTexture=new u(s,e)}else this._backBufferTexture.resize(t,r);return this._backBufferTexture}}export{o as BlendTechnique};
|
|
2
|
+
import{simplePipelineState as e}from"../../utils.js";import{Technique as t}from"../Technique.js";import{BlendShader as r}from"../shaders/BlendShader.js";import{OpacityShader as s}from"../shaders/OpacityShader.js";import u from"../../../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../../../webgl/TextureDescriptor.js";class o extends t{constructor(){super(...arguments),this.type=5,this._backBufferTexture=null,this.shaders={blend:new r,opacity:new s}}shutdown(){super.shutdown(),null!==this._backBufferTexture&&(this._backBufferTexture.dispose(),this._backBufferTexture=null)}render(t,r){const{context:s,state:u,pixelRatio:i,inFadeTransition:o,painter:n}=t,{size:a}=u,c=s.boundFramebuffer;let f,l;null!=c?(f=c.width,l=c.height):(f=Math.round(i*a[0]),l=Math.round(i*a[1]));const{blendMode:h}=r;if("normal"===h){const t={shader:this.shaders.opacity,uniforms:{config:{opacity:r.config.opacity}},textures:{layerTexture:{texture:r.colorTexture,unit:0}},defines:null,optionalAttributes:null,useComputeBuffer:!1};return n.setPipelineState(e),void n.submitDrawMesh(s,t,n.quadMesh)}const d=this._createOrResizeTexture(t,f,l);c?.copyToTexture(0,0,f,l,0,0,d);const p={...e,color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0},blendEquation:32774},depth:!1,stencil:!1};n.setPipelineState(p);const x={inFadeOpacity:o?1:0,...r.config},b={shader:this.shaders.blend,uniforms:{config:x},textures:{backbufferTexture:{texture:d,unit:0},layerTexture:{texture:r.colorTexture,unit:1}},defines:{blendMode:h},optionalAttributes:null,useComputeBuffer:!1};n.submitDrawMesh(s,b,n.quadMesh)}_createOrResizeTexture(e,t,r){const{context:s}=e;if(null!==this._backBufferTexture&&this._backBufferTexture.descriptor?.width===t&&this._backBufferTexture.descriptor?.height===r)return this._backBufferTexture;if(null===this._backBufferTexture){const e=new i(t,r);e.internalFormat=6408,e.wrapMode=33071,this._backBufferTexture=new u(s,e)}else this._backBufferTexture.resize(t,r);return this._backBufferTexture}}export{o as BlendTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{simplePipelineState as t}from"../../utils.js";import{Technique as s}from"../Technique.js";import{BlitShader as i}from"../shaders/BlitShader.js";import{BloomCompositeShader as r,LuminosityHighPassShader as o}from"../shaders/BloomShader.js";import{GaussianBlurShader as n}from"../shaders/BlurShader.js";import{DisposableFramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{TextureDescriptor as h}from"../../../../../../webgl/TextureDescriptor.js";const a=5,l=[1,0],m=[0,1],d=[1,.8,.6,.4,.2],
|
|
2
|
+
import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{simplePipelineState as t}from"../../utils.js";import{Technique as s}from"../Technique.js";import{BlitShader as i}from"../shaders/BlitShader.js";import{BloomCompositeShader as r,LuminosityHighPassShader as o}from"../shaders/BloomShader.js";import{GaussianBlurShader as n}from"../shaders/BlurShader.js";import{DisposableFramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{TextureDescriptor as h}from"../../../../../../webgl/TextureDescriptor.js";const a=5,l=[1,0],m=[0,1],d=[1,.8,.6,.4,.2],p=[1,1,1];class c extends s{constructor(){super(...arguments),this.type=6,this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(a),this._nMips=a,this._kernelSizeArray=[3,5,7,9,11],this._size=[0,0],this.shaders={luminosityPass:new o,gaussianBlur:new n,composite:new r,blit:new i}}shutdown(){if(super.shutdown(),this._intensityFBO=e(this._intensityFBO),this._compositeFBO=e(this._compositeFBO),this._mipsFBOs){for(let e=0;e<this._nMips;e++)this._mipsFBOs[e]&&(this._mipsFBOs[e].horizontal.dispose(),this._mipsFBOs[e].vertical.dispose());this._mipsFBOs=null}}render(e,t){const{layerFBO:s}=t,{width:i,height:r}=s,{strength:o,radius:n,threshold:u}=t.effect;this._createOrResizeResources(e,i,r),this._renderLuminosityHighPass(e,s,u),this._renderGaussianBlur(e,s),this._renderComposite(e,s,o,n),this._renderBlit(e,s)}_renderLuminosityHighPass(e,s,i){const{context:r,painter:o}=e,{width:n,height:u}=s,h={...t,color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:{write:{mask:0},test:!1}};o.setPipelineState(h),r.bindFramebuffer(this._intensityFBO);const a=[Math.round(n/2),Math.round(u/2)];r.setViewport(0,0,a[0],a[1]),r.setClearColor(0,0,0,0),r.clear(16384),o.submitDrawMesh(r,{shader:this.shaders.luminosityPass,uniforms:{luminosityHighPassConfig:{defaultColor:[0,0,0],defaultOpacity:0,luminosityThreshold:i,smoothWidth:.01}},textures:{luminosityHighPassTexture:{texture:s.colorTexture,unit:0}},defines:null,optionalAttributes:null,useComputeBuffer:!1},o.quadMesh)}_renderGaussianBlur(e,s){const{context:i,painter:r}=e,{width:o,height:n}=s,u={...t,color:{write:[!0,!0,!0,!0],blendMode:"none"}};r.setPipelineState(u);let h=this._intensityFBO.colorTexture;const a=[Math.round(o/2),Math.round(n/2)];for(let t=0;t<this._nMips;t++){i.setViewport(0,0,a[0],a[1]);const e=this._mipsFBOs[t];i.bindFramebuffer(e.horizontal),r.submitDrawMesh(i,{shader:this.shaders.gaussianBlur,uniforms:{gaussianBlurConfig:{texSize:a,direction:l,sigma:this._kernelSizeArray[t]}},textures:{texture:{texture:h,unit:t+1}},defines:{kernelRadius:this._kernelSizeArray[t]},optionalAttributes:null,useComputeBuffer:!1},r.quadMesh),h=e.horizontal.colorTexture,i.bindFramebuffer(e.vertical),r.submitDrawMesh(i,{shader:this.shaders.gaussianBlur,uniforms:{gaussianBlurConfig:{texSize:a,direction:m,sigma:this._kernelSizeArray[t]}},textures:{texture:{texture:h,unit:t+1}},defines:{kernelRadius:this._kernelSizeArray[t]},optionalAttributes:null,useComputeBuffer:!1},r.quadMesh),h=e.vertical.colorTexture,a[0]=Math.round(a[0]/2),a[1]=Math.round(a[1]/2)}}_renderComposite(e,t,s,i){const{context:r,painter:o}=e,{width:n,height:u}=t;r.setViewport(0,0,n,u),r.bindFramebuffer(this._compositeFBO),o.submitDrawMesh(r,{shader:this.shaders.composite,uniforms:{compositeConfig:{bloomStrength:s,bloomRadius:i,bloomFactors:d,bloomTintColor:p}},textures:{compositeTextures:{blurTexture1:{texture:this._mipsFBOs[0].vertical.colorTexture,unit:1},blurTexture2:{texture:this._mipsFBOs[1].vertical.colorTexture,unit:2},blurTexture3:{texture:this._mipsFBOs[2].vertical.colorTexture,unit:3},blurTexture4:{texture:this._mipsFBOs[3].vertical.colorTexture,unit:4},blurTexture5:{texture:this._mipsFBOs[4].vertical.colorTexture,unit:5}}},defines:{numMips:this._nMips},optionalAttributes:null,useComputeBuffer:!1},o.quadMesh)}_renderBlit(e,s){const{context:i,painter:r}=e;i.bindFramebuffer(s);const o={...t,color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:1,srcAlpha:1,dstAlpha:1},blendEquation:32774}};r.setPipelineState(o),r.submitDrawMesh(i,{shader:this.shaders.blit,uniforms:{},textures:{blitTexture:{texture:this._compositeFBO.colorTexture,unit:6}},defines:null,optionalAttributes:null,useComputeBuffer:!1},r.quadMesh)}_createOrResizeResources(e,t,s){const{context:i}=e;if(this._compositeFBO&&this._size[0]===t&&this._size[1]===s)return;this._size[0]=t,this._size[1]=s;const r=[Math.round(t/2),Math.round(s/2)];if(this._compositeFBO)this._compositeFBO.resize(t,s);else{const e=new h(t,s);e.internalFormat=6408,e.wrapMode=33071,this._compositeFBO=new u(i,e)}if(this._intensityFBO)this._intensityFBO.resize(r[0],r[1]);else{const e=new h(r[0],r[1]);e.internalFormat=6408,e.wrapMode=33071,this._intensityFBO=new u(i,e)}for(let o=0;o<this._nMips;o++){if(this._mipsFBOs[o])this._mipsFBOs[o].horizontal.resize(r[0],r[1]),this._mipsFBOs[o].vertical.resize(r[0],r[1]);else{const e=new h(r[0],r[1]);e.internalFormat=6408,e.wrapMode=33071,this._mipsFBOs[o]={horizontal:new u(i,e),vertical:new u(i,e)}}r[0]=Math.round(r[0]/2),r[1]=Math.round(r[1]/2)}}}export{c as BloomTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{simplePipelineState as t}from"../../utils.js";import{Technique as s}from"../Technique.js";import{BlitShader as r}from"../shaders/BlitShader.js";import{RadialBlurShader as i,GaussianBlurShader as u}from"../shaders/BlurShader.js";import{DisposableFramebufferObject as
|
|
2
|
+
import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{simplePipelineState as t}from"../../utils.js";import{Technique as s}from"../Technique.js";import{BlitShader as r}from"../shaders/BlitShader.js";import{RadialBlurShader as i,GaussianBlurShader as u}from"../shaders/BlurShader.js";import{DisposableFramebufferObject as o}from"../../../../../../webgl/FramebufferObject.js";import{TextureDescriptor as a}from"../../../../../../webgl/TextureDescriptor.js";const n=[1,0],l=[0,1];class d extends s{constructor(){super(...arguments),this.type=7,this._blurFBO=null,this._size=[0,0],this.shaders={gaussianBlur:new u,radialBlur:new i,blit:new r}}shutdown(){super.shutdown(),this._blurFBO=e(this._blurFBO)}render(e,t){const{type:s,radius:r}=t.effect,{layerFBO:i}=t;0!==r&&(this._createOrResizeResources(e),"blur"===s?this._gaussianBlur(e,i,t.effect.radius):this._radialBlur(e,i))}_gaussianBlur(e,s,r){const{context:i,state:u,painter:o,pixelRatio:a}=e,{size:d}=u,h=[Math.round(a*d[0]),Math.round(a*d[1])],f=this._blurFBO,c={...t,color:{write:[!0,!0,!0,!0],blendMode:"none"}};o.setPipelineState(c),i.bindFramebuffer(f),o.submitDrawMesh(i,{shader:this.shaders.gaussianBlur,uniforms:{gaussianBlurConfig:{texSize:h,direction:n,sigma:r}},textures:{texture:{texture:s.colorTexture,unit:4}},defines:{kernelRadius:Math.ceil(r)},optionalAttributes:null,useComputeBuffer:!1},o.quadMesh),i.bindFramebuffer(s);const b={color:{write:[!0,!0,!0,!0],blendMode:"none"},depth:{write:!1,test:!1},stencil:{write:{mask:0},test:!1}};o.setPipelineState(b),o.submitDrawMesh(i,{shader:this.shaders.gaussianBlur,uniforms:{gaussianBlurConfig:{texSize:h,direction:l,sigma:r}},textures:{texture:{texture:f?.colorTexture,unit:5}},defines:{kernelRadius:Math.ceil(r)},optionalAttributes:null,useComputeBuffer:!1},o.quadMesh),o.setPipelineState({...t,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"additive"}})}_radialBlur(e,s){const{context:r,painter:i}=e,u=this._blurFBO;r.bindFramebuffer(u);const o={...t,color:{write:[!0,!0,!0,!0],blendMode:"none"}};i.setPipelineState(o),i.submitDrawMeshUntyped(r,{shader:this.shaders.radialBlur,uniforms:{},textures:{texture:{texture:s.colorTexture,unit:4}},defines:null,optionalAttributes:null,useComputeBuffer:!1},i.quadMesh),r.bindFramebuffer(s),i.setPipelineState({...t,color:{write:[!0,!0,!0,!0],blendMode:"composite"}}),i.submitDrawMeshUntyped(r,{shader:this.shaders.blit,uniforms:{},textures:{blitTexture:{texture:u?.colorTexture,unit:5}},defines:null,optionalAttributes:null,useComputeBuffer:!1},i.quadMesh)}_createOrResizeResources(e){const{context:t,state:s,pixelRatio:r}=e,{size:i}=s,u=Math.round(r*i[0]),n=Math.round(r*i[1]);if(!this._blurFBO||this._size[0]!==u||this._size[1]!==n)if(this._size[0]=u,this._size[1]=n,this._blurFBO)this._blurFBO.resize(u,n);else{const e=new a(u,n);e.internalFormat=6408,e.wrapMode=33071,this._blurFBO=new o(t,e)}}}export{d as BlurTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{Technique as t}from"../Technique.js";import{OpacityShader as r}from"../shaders/OpacityShader.js";import s from"../../../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../../../webgl/TextureDescriptor.js";class o extends t{constructor(){super(...arguments),this.type=25,this._layerFBOTexture=null,this._size=[0,0],this.shaders={opacity:new r}}shutdown(){super.shutdown(),this._layerFBOTexture=e(this._layerFBOTexture)}render(e,t){const{layerFBO:r}=t,{width:s,height:i}=r;this._createOrResizeResources(e,s,i);const{context:o,painter:a}=e,{amount:u}=t.effect,
|
|
2
|
+
import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{Technique as t}from"../Technique.js";import{OpacityShader as r}from"../shaders/OpacityShader.js";import s from"../../../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../../../webgl/TextureDescriptor.js";class o extends t{constructor(){super(...arguments),this.type=25,this._layerFBOTexture=null,this._size=[0,0],this.shaders={opacity:new r}}shutdown(){super.shutdown(),this._layerFBOTexture=e(this._layerFBOTexture)}render(e,t){const{layerFBO:r}=t,{width:s,height:i}=r;this._createOrResizeResources(e,s,i);const{context:o,painter:a}=e,{amount:u}=t.effect,n=this._layerFBOTexture;o.bindFramebuffer(r),t.layerFBO.copyToTexture(0,0,s,i,0,0,n);const l={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1},h={opacity:u};n.setSamplingMode(9728),o.setClearColor(0,0,0,0),o.clear(16384),a.setPipelineState(l),a.submitDrawMesh(o,{shader:this.shaders.opacity,uniforms:{config:h},textures:{layerTexture:{texture:n,unit:0}},defines:null,optionalAttributes:null,useComputeBuffer:!1},a.quadMesh)}_createOrResizeResources(e,t,r){const{context:o}=e;if(!this._layerFBOTexture||this._size[0]!==t||this._size[1]!==r)if(this._size[0]=t,this._size[1]=r,this._layerFBOTexture)this._layerFBOTexture.resize(t,r);else{const e=new i(t,r);e.internalFormat=6408,e.wrapMode=33071,e.samplingMode=9728,this._layerFBOTexture=new s(o,e)}}}export{o as OpacityTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{tileSize as e}from"../../../definitions.js";import{Technique as t}from"../Technique.js";import{getInterpolationDefines as i}from"./processor/textureUtils.js";import{RasterRangeHighlightShader as
|
|
2
|
+
import{tileSize as e}from"../../../definitions.js";import{Technique as t}from"../Technique.js";import{getInterpolationDefines as i}from"./processor/textureUtils.js";import{RasterRangeHighlightShader as n}from"../shaders/raster/RasterRangeHighlightShader.js";import{RasterXYBandHighlightShader as r}from"../shaders/raster/RasterXYBandHighlightShader.js";import{SizedPixelFormat as o,PixelType as s}from"../../../../../../webgl/enums.js";import{DisposableFramebufferObject as a}from"../../../../../../webgl/FramebufferObject.js";import g from"../../../../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../../../../webgl/TextureDescriptor.js";class u extends t{constructor(){super(...arguments),this.name="BrushRasterHighlight",this.type=2,this.shaders={range:new n,xyBand:new r}}shutdown(e){super.shutdown(e),this._fbo?.dispose(),this._fbo=void 0}_getBandIds(e,t){const{type:i}=e,n="xy-band"===i?e.bandIds:[e.bandId];return t?.length?n.map(e=>t.indexOf(e)):"xy-band"===i?[0,1]:[0]}_getSingleBandShaderOptions(e,t,n,r){const{config:o,projectionConfig:s,projectionTextures:a,textures:g,projectionDefines:h}=this._getCommonConfig(t),u=i(t,r),d={bandSwap:n,ranges:e.ranges,color:e.color};return{shader:this.shaders.range,uniforms:{projectionConfig:s,config:o,rangeHighlightConfig:d},textures:{...g,projectionTextures:a},defines:{...h,...u,applyPixelMask:!1,applyPixelHighlights:!1,hasExistingHighlights:!!g.highlightTexture},optionalAttributes:null,useComputeBuffer:!1}}_getXYBandShaderOptions(e,t,n,r,o){const{config:s,projectionConfig:a,projectionTextures:g,textures:h,projectionDefines:u}=this._getCommonConfig(t),d=i(t,r),p={bandSwap:n,xRange:e.xRange,yRange:e.yRange,color:e.color},c=o?{texture:o,unit:4}:void 0;return{shader:this.shaders.xyBand,uniforms:{projectionConfig:a,config:s,xyRangeHighlightConfig:p},textures:{...h,projectionTextures:g,xyMaskHighlightTexture:c},defines:{...u,...d,applyPixelMask:!1,applyPixelHighlights:!1,hasExistingHighlights:!!h.highlightTexture,useMask:!!c},optionalAttributes:null,useComputeBuffer:!1}}render(t,i){const{pixelHighlightOptions:n}=t;if(!n)return;const{context:r}=t;if(!this._fbo){const i=d(t.context,e,e);this._fbo=new a(r,i)}const{type:o}=n,s="xy-band"===o?p(t.context,n):void 0,g=r.boundFramebuffer,h=r.getViewport();for(const a of i.bitmaps){if(!a.source||a.highlighted||a.suspended||a.isRenderedSource)continue;const i=this._getBandIds(n,a.bandIds);if(i.some(e=>e<0||e>2))continue;t.timeline.begin(this.name);const{painter:g}=t;g.setPipelineState({depth:!1,stencil:{test:!1,write:!1},color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0},blendEquation:32774}}),a.updateTexture(t),a.updateProcessedTexture(!1);const h=new Float32Array(9);h[3*i[0]]=1,h[3*i[1]+1]="xy-band"===o?1:0;const u="single-band"===o?this._getSingleBandShaderOptions(n,a,h,r):this._getXYBandShaderOptions(n,a,h,r,s);r.bindFramebuffer(this._fbo),r.setViewport(0,0,e,e),g.submitDrawMesh(t.context,u,g.quadMesh);const p=d(t.context,e,e);this._fbo.copyToTexture(0,0,e,e,0,0,p),a.highlightTexture=p,t.timeline.end(this.name)}s?.dispose(),r.bindFramebuffer(g),r.setViewport(h.x,h.y,h.width,h.height)}_getCommonConfig(e){const{names:t,textures:i}=e.getTextures({forProcessing:!0,useProcessedTexture:e.processed}),n=i[t.indexOf("u_image")],r=e.getRasterTextureSize(),o={dvsMat3:new Float32Array([2,0,0,0,2,0,-1,-1,0]),coordScale:[1,1],srcImageSize:r,opacity:1},s={texture:{texture:n,unit:0},pixelMaskTexture:null,highlightTexture:null},a=i[t.indexOf("u_transformGrid")],{transformGrid:g}=e,h=!(!a||!g),u=h?{targetImageSize:[e.width,e.height],transformSpacing:g.spacing,transformGridSize:g.size}:void 0,d=h?{transformTexture:{texture:a,unit:1}}:void 0,{highlightTexture:p}=e;p&&(s.highlightTexture={texture:p,unit:2});return{config:o,projectionConfig:u,projectionTextures:d,textures:s,projectionDefines:{applyProjection:h,lookupProjection:h&&1===g.spacing[0]}}}}function d(e,t,i){const n=new h(t,i);return n.internalFormat=o.RGBA8,n.samplingMode=9728,n.dataType=s.UNSIGNED_BYTE,n.isImmutable=!0,n.wrapMode=33071,new g(e,n)}function p(e,t){const{mask:i,maskSize:n}=t;if(!i?.length||!n?.length)return;const r=new h(n[0],n[1]);return r.internalFormat=o.R8,r.samplingMode=9728,r.dataType=s.UNSIGNED_BYTE,r.isImmutable=!0,r.wrapMode=33071,new g(e,r,i)}export{u as RasterHighlightTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{disposeMaybe as e}from"../../../../../../../../core/maybe.js";import{tileSize as t}from"../../../../definitions.js";import{Technique as r}from"../../Technique.js";import{createNewFBO as n,createProcessedTexture as s}from"./textureUtils.js";import{createColormapTexture as o}from"../../../../../../../webgl/rasterUtils.js";class i extends r{shutdown(e){super.shutdown(e),this._fbo?.dispose(),this._fbo=void 0}render(r,i){const{rasterFunction:a}=r;if(!a)return;const{context:u}=r,c="indexedColormap"in a.parameters?o(u,a.parameters.indexedColormap):void 0,
|
|
2
|
+
import{disposeMaybe as e}from"../../../../../../../../core/maybe.js";import{tileSize as t}from"../../../../definitions.js";import{Technique as r}from"../../Technique.js";import{createNewFBO as n,createProcessedTexture as s}from"./textureUtils.js";import{createColormapTexture as o}from"../../../../../../../webgl/rasterUtils.js";class i extends r{shutdown(e){super.shutdown(e),this._fbo?.dispose(),this._fbo=void 0}render(r,i){const{rasterFunction:a}=r;if(!a)return;const{context:u}=r,c="indexedColormap"in a.parameters?o(u,a.parameters.indexedColormap):void 0,d="Reproject"===a.name,m=u.boundFramebuffer,p=u.getViewport();for(const o of i.bitmaps){const m=d?!(o.rasterTexture&&o.projected):!o.processed;if(!o.source||!m||o.suspended)continue;r.timeline.begin(this.name);const{painter:p}=r;p.setPipelineState({depth:!1,stencil:{test:!1,write:!1},color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0},blendEquation:32774}}),d||(o.processedTexture=e(o.processedTexture)),o.updateTexture(r);const[f,l]=o.getRasterTextureSize(d),g=f===t&&l===t,x=g?i.processorFbo:n(u,f,l);u.bindFramebuffer(x),u.setViewport(0,0,x.width,x.height),this._process(r,o,c);const h=s(r.context,f,l);if(x.copyToTexture(0,0,f,l,0,0,h),d)o.rasterTexture=h;else{const e=r.hasBranches?a.id:0;o.functionTextures[e]?.dispose(),o.functionTextures[e]=h}g||x.dispose(),r.timeline.end(this.name)}c?.dispose(),u.bindFramebuffer(m),u.setViewport(p.x,p.y,p.width,p.height)}_getCommonConfig(e,t){const{rasterFunction:r,hasBranches:n}=e,{raster:s,rasters:o}=r.parameters,i=n?s?.id??o?.find(e=>"Constant"!==e.name)?.id??-1:0,a=t.functionTextures[i]??t.rasterTexture,u="Reproject"===r.name;return{config:{srcImageSize:t.getRasterTextureSize(u)},textures:{texture:{texture:a,unit:0}}}}_getMultipleInputConfig(e,t){if(!t?.length)return{};if(2===t.length){const{config:r,textures:n}=this._getTwoInputConfig(t,e);return{twoRasterConfig:r,twoRasterTextures:n}}if(3===t.length){const{config:r,textures:n}=this._getThreeInputConfig(t,e);return{threeRasterConfig:r,threeRasterTextures:n}}return{}}_getConstantCount(e){return e?.filter(e=>"Constant"===e.name).length??0}_getTextures(e,t){return e.filter(e=>"Constant"!==e.name).map(e=>null!=e.id&&"Identity"!==e.name?t.functionTextures[e.id]:t.rasterTexture)}_getTwoInputConfig(e,t){const r=this._getTextures(e,t),n=r[1]?{texture:r[1],unit:1}:void 0,s=e.findIndex(e=>"Constant"===e.name),o=0===s?new Float32Array([0,1,0,1,0,0,0,0,0]):new Float32Array([1,0,0,0,1,0,0,0,0]);return{config:{image1Const:s>-1?e[s].parameters.value:0,imageSwap:o},textures:n?{image1:n}:void 0}}_getThreeInputConfig(e,t){const r=this._getTextures(e,t);let n=0,s=0,o=new Float32Array([1,0,0,0,1,0,0,0,1]);const i=r[1]?{texture:r[1],unit:1}:void 0,a=r[2]?{texture:r[2],unit:2}:void 0,u=[];if(e.forEach((e,t)=>"Constant"===e.name&&u.push(t)),1===u.length)n=e[u[0]].parameters.value,o=0===u[0]?new Float32Array([0,1,0,0,0,1,1,0,0]):1===u[0]?new Float32Array([1,0,0,0,0,1,0,1,0]):new Float32Array([1,0,0,0,1,0,0,0,1]);else if(2===u.length){n=e[u[0]].parameters.value,s=e[u[1]].parameters.value;const t=e.findIndex(e=>"Constant"!==e.name);o=0===t?new Float32Array([1,0,0,0,1,0,0,0,1]):1===t?new Float32Array([0,1,0,1,0,0,0,0,1]):new Float32Array([0,0,1,1,0,0,0,1,0])}return{config:{image1Const:n,image2Const:s,imageSwap:o},textures:i?{image1:i,image2:a??null}:void 0}}}export{i as BaseRasterProcessorTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{backbufferStencilVisible as t}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{Technique as i}from"../Technique.js";import{BitBlitShader as
|
|
2
|
+
import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{backbufferStencilVisible as t}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{Technique as i}from"../Technique.js";import{BitBlitShader as o}from"../shaders/BitBlitShader.js";import{DataType as r,PrimitiveType as n}from"../../../../../../webgl/enums.js";const m={write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7680},mask:255}};class h extends i{constructor(){super(...arguments),this.type=5,this.shaders={bitBlit:new o},this._mesh=null}shutdown(){this._mesh=e(this._mesh)}render(e,s){const{context:i,painter:o}=e,r=s.opacity??1,n=!0===s.clipToVisibleRegion;s.texture.setSamplingMode(s.samplingMode);const h={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!!n&&m};o.setPipelineState(h);const p=n?{stencilRef:t}:void 0;o.submitDrawMesh(i,{shader:this.shaders.bitBlit,uniforms:{config:{opacity:r}},textures:{texture:{texture:s.texture,unit:0}},defines:null,optionalAttributes:null,useComputeBuffer:!1},this._getMesh(e),p)}_getMesh(e){return this._mesh??=s.createForShader(e.context,{primitive:n.TRIANGLE_STRIP,vertex:new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),layout:{pos:{type:r.BYTE,count:2},tex:{type:r.BYTE,count:2}}}),this._mesh}}export{h as BitBlitTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../../../core/has.js";import{textureBindingHighlight0 as e,textureBindingHighlight1 as t}from"../../../definitions.js";import{alphaToRgbaChannelSelectorMatrix as r,rgbaToRgbaChannelSelectorMatrix as i,sigma as s}from"../../../effects/highlight/parameters.js";import{Technique as o}from"../Technique.js";import{HighlightShadeShader as n,HighlightBlurShader as a}from"../shaders/HighlightShader.js";import{BitBlitTechnique as h}from"./BitBlitTechnique.js";const u=[!1,!1,!1,!0];class l extends o{constructor(){super(...arguments),this.type=7,this.shaders={blur:new a,shade:new n},this._bitBlitTechnique=new h}shutdown(){this._bitBlitTechnique.shutdown()}render(e,t){this._prepareTarget(e,{target:t.maskFbo,viewport:t.highlightViewport}),this._bitBlitTechnique.render(e,{texture:t.sourceTexture,samplingMode:9728}),this._preBlur(e,{texture:t.maskTexture,size:t.highlightWidth,target:t.partialMapFbo,viewport:t.highlightViewport}),this._finalBlur(e,{texture:t.partialMapTexture,size:t.highlightHeight,target:t.maskFbo,viewport:t.highlightViewport}),this._shade(e,{texture:t.maskTexture,gradient:t.gradient,target:t.outputTarget,viewport:t.outputViewport})}_preBlur(e,t){this._renderBlur(e,{...t,direction:[1,0,1/t.size,0],channelSelector:r,colorWrite:t.colorWrite??u})}_finalBlur(e,t){this._renderBlur(e,{...t,direction:[0,1,0,1/t.size],channelSelector:i,colorWrite:t.colorWrite??u})}_shade(e,t){this._renderShade(e,t)}_renderBlur(t,r){const{context:i,painter:o}=t,n={color:{write:r.colorWrite,blendMode:"none"},depth:!1,stencil:!1};o.setPipelineState(n),this._prepareTarget(t,r),o.submitDrawMesh(i,{shader:this.shaders.blur,uniforms:{config:{direction:r.direction,channelSelector:r.channelSelector,sigma:s}},textures:{texture:{unit:e,texture:r.texture}},defines:null,optionalAttributes:null,useComputeBuffer:!1},o.quadMesh)}_renderShade(r,i){const{context:o,painter:n}=r,a=i.gradient.getProgramState(o),h={color:{write:[!0,!0,!0,!0],blendMode:"
|
|
2
|
+
import"../../../../../../../core/has.js";import{textureBindingHighlight0 as e,textureBindingHighlight1 as t}from"../../../definitions.js";import{alphaToRgbaChannelSelectorMatrix as r,rgbaToRgbaChannelSelectorMatrix as i,sigma as s}from"../../../effects/highlight/parameters.js";import{Technique as o}from"../Technique.js";import{HighlightShadeShader as n,HighlightBlurShader as a}from"../shaders/HighlightShader.js";import{BitBlitTechnique as h}from"./BitBlitTechnique.js";const u=[!1,!1,!1,!0];class l extends o{constructor(){super(...arguments),this.type=7,this.shaders={blur:new a,shade:new n},this._bitBlitTechnique=new h}shutdown(){this._bitBlitTechnique.shutdown()}render(e,t){this._prepareTarget(e,{target:t.maskFbo,viewport:t.highlightViewport}),this._bitBlitTechnique.render(e,{texture:t.sourceTexture,samplingMode:9728}),this._preBlur(e,{texture:t.maskTexture,size:t.highlightWidth,target:t.partialMapFbo,viewport:t.highlightViewport}),this._finalBlur(e,{texture:t.partialMapTexture,size:t.highlightHeight,target:t.maskFbo,viewport:t.highlightViewport}),this._shade(e,{texture:t.maskTexture,gradient:t.gradient,target:t.outputTarget,viewport:t.outputViewport})}_preBlur(e,t){this._renderBlur(e,{...t,direction:[1,0,1/t.size,0],channelSelector:r,colorWrite:t.colorWrite??u})}_finalBlur(e,t){this._renderBlur(e,{...t,direction:[0,1,0,1/t.size],channelSelector:i,colorWrite:t.colorWrite??u})}_shade(e,t){this._renderShade(e,t)}_renderBlur(t,r){const{context:i,painter:o}=t,n={color:{write:r.colorWrite,blendMode:"none"},depth:!1,stencil:!1};o.setPipelineState(n),this._prepareTarget(t,r),o.submitDrawMesh(i,{shader:this.shaders.blur,uniforms:{config:{direction:r.direction,channelSelector:r.channelSelector,sigma:s}},textures:{texture:{unit:e,texture:r.texture}},defines:null,optionalAttributes:null,useComputeBuffer:!1},o.quadMesh)}_renderShade(r,i){const{context:o,painter:n}=r,a=i.gradient.getProgramState(o),h={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};n.setPipelineState(h),this._prepareTarget(r,i),n.submitDrawMesh(o,{shader:this.shaders.shade,uniforms:{config:{sigma:s,minMaxDistance:a.minMaxDistance}},textures:{texture:{unit:e,texture:i.texture},shade:{unit:t,texture:a.shadeTexture}},defines:null,optionalAttributes:null,useComputeBuffer:!1},n.quadMesh)}_prepareTarget(e,t){const{context:r}=e;null!=t.viewport&&r.setViewport(...t.viewport),r.bindFramebuffer(t.target)}}export{l as HighlightTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../../../../core/has.js";import{sqlAnd as e}from"../../../../../core/sql.js";import t from"../../../../../geometry/SpatialReference.js";import{getClauseForScaleRange as r}from"../../../../../layers/support/displayFilterUtils.js";import a from"../../../../../rest/support/Query.js";import i from"../../../../../time/TimeExtent.js";const s=4;function o(e){switch(e.type){case"object-id":case"unique-id-simple":return`${e.fieldName} ASC`;case"unique-id-composite":return`${e.fieldNames.join(",")} ASC`}}function n(e,r,a){const s=o(a.featureIdInfo);return{returnCentroid:"esriGeometryPolygon"===a.serviceGeometryType&&!e.queryMetadata.supportsCentroidOnDegeneratedQuantizedGeometry&&!e.queryMetadata.supportsDegeneratedQuantizedGeometry,returnGeometry:!0,returnZ:r.returnZ,returnM:r.returnM,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[s],where:r.definitionExpression??"1=1",outFields:r.availableFields,multipatchOption:"esriGeometryMultiPatch"===a.serviceGeometryType?"xyFootprint":null,gdbVersion:r.gdbVersion,historicMoment:r.historicMoment?new Date(r.historicMoment):null,timeExtent:r.timeExtent?i.fromJSON(r.timeExtent):null}}class u{static create(e,t,r){const a=t.queryScaleRanges,i=t.displayFilterInfo;return new u(n(e,t,r),i,a,r.subtypeField,t.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,s,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=r,this._subtypeField=a,this._customParameters=i,this._geometryType=s,this._queryMetadata=o}getPageSize(e){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const t=this._queryMetadata.supportsMaxRecordCountFactor?s:null,r=((e?this._queryMetadata.tileMaxRecordCount:this._queryMetadata.maxRecordCount)??this._queryMetadata.maxRecordCount??2e3)*(t??1),a=has("featurelayer-query-max-page-size")??8e3;return Math.min(a,r)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,r){if(!t.getSize())return null;const a=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(a.outFields??[])[0])return null;a.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),r=[];for(const a of e)t.hasField(a)||r.push(a);if(0===r.length)return null;a.outFields=r}a.returnGeometry=!1,a.returnCentroid=!1,a.quantizationParameters=null,a.cacheHint=!0;const i={inner:a,customParameters:this._customParameters};if(has("esri-tiles-debug")&&null!=r){const e=r.chunkId.toString().replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,chunkId:e}:{chunkId:e}}return i}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new a({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(t,a){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const i=this.createQuery(a),o=i.inner;if(this._queryScaleRanges?.length){const r=this._queryScaleRanges.filter(e=>(!e.minScale||e.minScale>=t.maxScale)&&(!e.maxScale||e.maxScale<=t.minScale)).map(e=>e.subtypeCode);if(r.length)
|
|
2
|
+
import has from"../../../../../core/has.js";import{sqlAnd as e}from"../../../../../core/sql.js";import t from"../../../../../geometry/SpatialReference.js";import{getClauseForScaleRange as r}from"../../../../../layers/support/displayFilterUtils.js";import a from"../../../../../rest/support/Query.js";import i from"../../../../../time/TimeExtent.js";const s=4;function o(e){switch(e.type){case"object-id":case"unique-id-simple":return`${e.fieldName} ASC`;case"unique-id-composite":return`${e.fieldNames.join(",")} ASC`}}function n(e,r,a){const s=o(a.featureIdInfo);return{returnCentroid:"esriGeometryPolygon"===a.serviceGeometryType&&!e.queryMetadata.supportsCentroidOnDegeneratedQuantizedGeometry&&!e.queryMetadata.supportsDegeneratedQuantizedGeometry,returnGeometry:!0,returnZ:r.returnZ,returnM:r.returnM,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[s],where:r.definitionExpression??"1=1",outFields:r.availableFields,multipatchOption:"esriGeometryMultiPatch"===a.serviceGeometryType?"xyFootprint":null,gdbVersion:r.gdbVersion,historicMoment:r.historicMoment?new Date(r.historicMoment):null,timeExtent:r.timeExtent?i.fromJSON(r.timeExtent):null}}class u{static create(e,t,r){const a=t.queryScaleRanges,i=t.displayFilterInfo;return new u(n(e,t,r),i,a,r.subtypeField,t.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,s,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=r,this._subtypeField=a,this._customParameters=i,this._geometryType=s,this._queryMetadata=o}getPageSize(e){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const t=this._queryMetadata.supportsMaxRecordCountFactor?s:null,r=((e?this._queryMetadata.tileMaxRecordCount:this._queryMetadata.maxRecordCount)??this._queryMetadata.maxRecordCount??2e3)*(t??1),a=has("featurelayer-query-max-page-size")??8e3;return Math.min(a,r)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,r){if(!t.getSize())return null;const a=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(a.outFields??[])[0])return null;a.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),r=[];for(const a of e)t.hasField(a)||r.push(a);if(0===r.length)return null;a.outFields=r}a.returnGeometry=!1,a.returnCentroid=!1,a.quantizationParameters=null,a.cacheHint=!0;const i={inner:a,customParameters:this._customParameters};if(has("esri-tiles-debug")&&null!=r){const e=r.chunkId.toString().replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,chunkId:e}:{chunkId:e}}return i}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new a({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(t,a){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const i=this.createQuery(a),o=i.inner;if(this._queryScaleRanges?.length){const r=this._queryScaleRanges.filter(e=>(!e.minScale||e.minScale>=t.maxScale)&&(!e.maxScale||e.maxScale<=t.minScale)).map(e=>e.subtypeCode);if(!r.length)return null;const a=`${this._subtypeField} IN (${r})`;o.where=e(o.where,a)}if(this._displayFilter&&(o.where=e(o.where,r(this._displayFilter,t.minScale,t.maxScale))),o.quantizationParameters=a.quantizationParameters??t.getQuantizationParameters(),o.resultType="tile",o.geometry=t.hydratedExtent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset=t.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(o.maxAllowableOffset=t.resolution,"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),o.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,o.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(o.maxRecordCountFactor=s),has("esri-tiles-debug")){const e=t.id.replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,tileId:e}:{tileId:e}}return i}createPagedTileQuery(e,t){const r=this.getPageSize(!0);return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e,t){const r=this.getPageSize(!1);return this.createQuery({start:r*e,num:r,returnExceededLimitFeatures:!0,maxRecordCountFactor:s,quantizationParameters:t,cacheHint:!0})}createObjectIdsQuery(e){return this.createQuery({objectIds:e,outFields:["*"]})}}export{u as FeatureSourceQueryInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{handlesGroup as
|
|
2
|
+
import{handlesGroup as e}from"../../../../../../core/handleUtils.js";import has from"../../../../../../core/has.js";import{throwIfAborted as t,onAbort as s}from"../../../../../../core/promiseUtils.js";import{AFeatureTileLoadStrategy as r}from"./AFeatureTileLoadStrategy.js";import{DrillDownTileSourceChunk as o}from"./chunks/DrillDownTileSourceChunk.js";import{FeatureSetReaderJSON as i}from"../../support/FeatureSetReaderJSON.js";const l=has("featurelayer-query-max-depth");class a{constructor(t,r){this.subscription=t,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=e([s(t.signal,()=>this._controller.abort()),s(r,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(e){return this._tileIdToResult.get(e)}set(e,t){this._tileIdToResult.set(e,t)}get options(){return{signal:this._controller.signal}}}class n extends r{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new a(e,this._options));const s=this._loadStates.get(e.key.id);let r;try{for await(const r of this._fetchChunkInfos(s,e.tile,0)){const{queryJSON:e,reader:i,sourceTile:l,sourceTileDepth:a,tile:n}=r,u=new o(i,e,n,l,a,!1);t(s.options),this._addChunk(u)}}catch(n){r=n}t(s.options);const l=new o(i.empty(this.metadata),null,e.tile,null,-1,!0);if(this._addChunk(l),r)throw r}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}async*_fetchChunkInfos(e,t,s){let r=e.get(t.id);const o=!!r;if(r||(r=await this._fetchChunkInfo(e,t,s),e.set(t.id,r)),r.reader.exceededTransferLimit&&s<has("featurelayer-query-max-depth"))for(const i of t.createChildTiles())yield*this._fetchChunkInfos(e,i,s+1);else o||(yield r)}async _fetchChunkInfo(e,t,s){const r=e.subscription.tile.getQuantizationParameters(),o=this._queryInfo.createTileQuery(t,{returnExceededLimitFeatures:s===l,quantizationParameters:r});if(!o)return{reader:i.empty(this.metadata),queryJSON:null,tile:e.subscription.tile,sourceTile:t,sourceTileDepth:s};return{reader:await this._fetch(o,e.options,{chunkId:t.id}),queryJSON:o.inner.toJSON(),tile:e.subscription.tile,sourceTile:t,sourceTileDepth:s}}}export{n as FeatureDrillDownTileLoadStrategy};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{handlesGroup as e}from"../../../../../../core/handleUtils.js";import has from"../../../../../../core/has.js";import{getOrCreateMapValue as t}from"../../../../../../core/MapUtils.js";import{throwIfAborted as r,isAbortError as o,onAbort as s}from"../../../../../../core/promiseUtils.js";import n from"../../../../../../rest/support/QuantizationParameters.js";import{AFeatureTileLoadStrategy as i}from"./AFeatureTileLoadStrategy.js";import{ByReferenceTileSourceChunk as a}from"./chunks/ByReferenceTileSourceChunk.js";import{PagedTileSourceChunk as l}from"./chunks/PagedTileSourceChunk.js";import{FeatureSetReaderJSON as c}from"../../support/FeatureSetReaderJSON.js";import{RefCounted as u}from"../../support/RefCounted.js";class d{constructor(t,r){this.subscription=t,this._pages=new Set,this._controller=new AbortController,this._done=!1,this._handles=e([s(t.signal,()=>this._controller.abort()),s(r,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let e=-1;for(const t of this._pages.values())e=Math.max(e,t);return e+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(e,t){this._pages.add(e),this._done=this._done||t}}class h extends i{constructor(){super(...arguments),this._loadStates=new Map,this._levels=new Map}destroy(){super.destroy();for(const e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){const r=t(this._loadStates,e.key.id,()=>new d(e,this._options));for await(const t of this._fetchPages(r))this._addChunk(t)}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}_onRemoveTileChunk(e){if(e instanceof a){const t=e.reader.getCursor(),r=e.tile.resolution;for(;t.next();)this._removeReferenceFeature(t.getObjectId(),r)}}async*_fetchPages(e){let t;try{for await(const t of this._concurrentPageStream(e)){r(e.options);for(const e of t)0!==e.size()&&(yield e)}}catch(s){t=s}if(t&&o(t)||(yield new l(c.empty(this.metadata),null,e.subscription.tile,-1,!0)),t)throw t}async*_concurrentPageStream(e){const t=has("featurelayer-query-tile-concurrency"),r=this._pageStreamAll(e),o=[];let s=!1,n=1;for(;!s;){const e=[];for(;!s&&o.length<n;){const t=r.next();if(!t.value){s=!0;break}const n=t.value;n.then(e=>{e.some(e=>e.reader.exceededTransferLimit)||(s=!0)}).catch(e=>{s=!0}).finally(()=>{o.splice(o.indexOf(n),1)}),o.push(n),e.push(n)}for(const t of e)yield t;o.length&&await Promise.race(o),n<t&&(n+=1)}}*_pageStreamAll(e){const t=Math.ceil(has("featurelayer-query-tile-max-features")/this._queryInfo.getPageSize(!0));for(let r=0;r<t;r++)yield this._downloadPage(r,e)}async _downloadPage(e,t){r(t.options);const o=t.subscription.tile,s=this._queryInfo.createPagedTileQuery(o,e);s.inner.returnExceededLimitGeometries=!1;const n=await this._fetch(s,t.options,{chunkId:`${o.id}-${e}`}),i=[],a=n.getCursor();for(;a.next();){const e=a.getByReferenceVertexCount();e&&(i.push({vertexCount:e,objectId:a.getObjectId()}),a.delete())}const
|
|
2
|
+
import{handlesGroup as e}from"../../../../../../core/handleUtils.js";import has from"../../../../../../core/has.js";import{getOrCreateMapValue as t}from"../../../../../../core/MapUtils.js";import{throwIfAborted as r,isAbortError as o,onAbort as s}from"../../../../../../core/promiseUtils.js";import n from"../../../../../../rest/support/QuantizationParameters.js";import{AFeatureTileLoadStrategy as i}from"./AFeatureTileLoadStrategy.js";import{ByReferenceTileSourceChunk as a}from"./chunks/ByReferenceTileSourceChunk.js";import{PagedTileSourceChunk as l}from"./chunks/PagedTileSourceChunk.js";import{FeatureSetReaderJSON as c}from"../../support/FeatureSetReaderJSON.js";import{RefCounted as u}from"../../support/RefCounted.js";class d{constructor(t,r){this.subscription=t,this._pages=new Set,this._controller=new AbortController,this._done=!1,this._handles=e([s(t.signal,()=>this._controller.abort()),s(r,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let e=-1;for(const t of this._pages.values())e=Math.max(e,t);return e+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(e,t){this._pages.add(e),this._done=this._done||t}}class h extends i{constructor(){super(...arguments),this._loadStates=new Map,this._levels=new Map}destroy(){super.destroy();for(const e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){const r=t(this._loadStates,e.key.id,()=>new d(e,this._options));for await(const t of this._fetchPages(r))this._addChunk(t)}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}_onRemoveTileChunk(e){if(e instanceof a){const t=e.reader.getCursor(),r=e.tile.resolution;for(;t.next();)this._removeReferenceFeature(t.getObjectId(),r)}}async*_fetchPages(e){let t;try{for await(const t of this._concurrentPageStream(e)){r(e.options);for(const e of t)0!==e.size()&&(yield e)}}catch(s){t=s}if(t&&o(t)||(yield new l(c.empty(this.metadata),null,e.subscription.tile,-1,!0)),t)throw t}async*_concurrentPageStream(e){const t=has("featurelayer-query-tile-concurrency"),r=this._pageStreamAll(e),o=[];let s=!1,n=1;for(;!s;){const e=[];for(;!s&&o.length<n;){const t=r.next();if(!t.value){s=!0;break}const n=t.value;n.then(e=>{e.some(e=>e.reader.exceededTransferLimit)||(s=!0)}).catch(e=>{s=!0}).finally(()=>{o.splice(o.indexOf(n),1)}),o.push(n),e.push(n)}for(const t of e)yield t;o.length&&await Promise.race(o),n<t&&(n+=1)}}*_pageStreamAll(e){const t=Math.ceil(has("featurelayer-query-tile-max-features")/this._queryInfo.getPageSize(!0));for(let r=0;r<t;r++)yield this._downloadPage(r,e)}async _downloadPage(e,t){r(t.options);const o=t.subscription.tile,s=this._queryInfo.createPagedTileQuery(o,e);if(!s){const e=c.empty(this.metadata);return[new l(e,null,o,0,!1)]}s.inner.returnExceededLimitGeometries=!1;const n=await this._fetch(s,t.options,{chunkId:`${o.id}-${e}`}),i=[],a=n.getCursor();for(;a.next();){const e=a.getByReferenceVertexCount();e&&(i.push({vertexCount:e,objectId:a.getObjectId()}),a.delete())}const u=new l(n,s.inner.toJSON(),o,e,!1),d=await this._ensureReferenceFeatures(i,o);return r(t.options),[u,...d]}async _ensureReferenceFeatures(e,t){let r=this._levels.get(t.resolution);null==r&&(r=new Map,this._levels.set(t.resolution,r));return(await Promise.all(this._ensureReferenceLevelFeatures(r,e,t.resolution))).map(e=>new a(e,t))}_removeReferenceFeature(e,t){const r=this._levels.get(t);if(null==r)throw new Error("Expected to find reference feature.");this._removeReferenceLevelFeature(r,e)}_ensureReferenceLevelFeatures(e,t,r){const o=[],s=new n({mode:"view",originPosition:"upper-left",tolerance:r});for(const n of t){let t=e.get(n.objectId);null==t&&(t=new u(this._queryFeature(n.objectId,s)),e.set(n.objectId,t)),t.increment(),o.push(t.data)}return o}_removeReferenceLevelFeature(e,t){const r=e.get(t);if(null==r)throw new Error("Expected to find reference feature.");r.decrement(),r.empty&&e.delete(t)}async _queryFeature(e,t){const r=this._queryInfo.createQuery({objectIds:[e]});return r.inner.quantizationParameters=t,this._fetch(r,null,null)}}export{h as FeatureHybridTileLoadStrategy};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{handlesGroup as
|
|
2
|
+
import{handlesGroup as t}from"../../../../../../core/handleUtils.js";import has from"../../../../../../core/has.js";import{getOrCreateMapValue as e}from"../../../../../../core/MapUtils.js";import{throwIfAborted as o,isAbortError as s,onAbort as r}from"../../../../../../core/promiseUtils.js";import{AFeatureTileLoadStrategy as a}from"./AFeatureTileLoadStrategy.js";import{PagedTileSourceChunk as i}from"./chunks/PagedTileSourceChunk.js";import{FeatureSetReaderJSON as n}from"../../support/FeatureSetReaderJSON.js";class l{constructor(e,o){this.subscription=e,this._pages=new Set,this._controller=new AbortController,this._done=!1,this._handles=t([r(e.signal,()=>this._controller.abort()),r(o,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let t=-1;for(const e of this._pages.values())t=Math.max(t,e);return t+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(t,e){this._pages.add(t),this._done=this._done||e}}class c extends a{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const t of this._loadStates.values())t.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(t){const o=e(this._loadStates,t.key.id,()=>new l(t,this._options));for await(const e of this._fetchPages(o))this._addChunk(e)}unload(t){super.unload(t),this._loadStates.get(t.key.id)?.destroy(),this._loadStates.delete(t.key.id)}async*_fetchPages(t){let e;try{for await(const e of this._concurrentPageStream(t))o(t.options),0!==e.size()&&(yield e)}catch(r){e=r}if(e&&s(e)||(yield new i(n.empty(this.metadata),null,t.subscription.tile,-1,!0)),e)throw e}async*_concurrentPageStream(t){const e=has("featurelayer-query-tile-concurrency"),o=this._pageStreamAll(t),s=[];let r=!1,a=1;for(;!r;){const t=[];for(;!r&&s.length<a;){const e=o.next();if(!e.value){r=!0;break}const a=e.value;a.then(t=>{t.reader.exceededTransferLimit||(r=!0)}).catch(t=>{r=!0}).finally(()=>{s.splice(s.indexOf(a),1)}),s.push(a),t.push(a)}for(const e of t)yield e;s.length&&await Promise.race(s),a<e&&(a+=1)}}*_pageStreamAll(t){const e=Math.ceil(has("featurelayer-query-tile-max-features")/this._queryInfo.getPageSize(!0));for(let o=0;o<e;o++)yield this._downloadPage(o,t)}async _downloadPage(t,e){o(e.options);const s=e.subscription.tile,r=this._queryInfo.createPagedTileQuery(s,t);if(!r){const e=n.empty(this.metadata);return new i(e,null,s,t,!1)}const a=await this._fetch(r,e.options,{chunkId:`${s.id}-${t}`});return o(e.options),new i(a,r.inner.toJSON(),s,t,!1)}}export{c as FeaturePagedTileLoadStrategy};
|
package/views/2d/webglDeps.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
export{BufferObject}from"../webgl/BufferObject.js";export{FramebufferObject}from"../webgl/FramebufferObject.js";export{DisposableProgram}from"../webgl/Program.js";export{ProgramCache}from"../webgl/ProgramCache.js";export{Renderbuffer}from"../webgl/Renderbuffer.js";export{
|
|
2
|
+
export{BufferObject}from"../webgl/BufferObject.js";export{FramebufferObject}from"../webgl/FramebufferObject.js";export{DisposableProgram}from"../webgl/Program.js";export{ProgramCache}from"../webgl/ProgramCache.js";export{Renderbuffer}from"../webgl/Renderbuffer.js";export{default as Texture}from"../webgl/Texture.js";export{VertexArrayObject}from"../webgl/VertexArrayObject.js";export{glslifyDefineMap}from"../webgl/programUtils.js";export{createProgram}from"../webgl/ProgramTemplate.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{equals as e}from"../../../../core/arrayUtils.js";import{EventedAccessor as s}from"../../../../core/Evented.js";import{destroyMaybe as r,removeMaybe as i}from"../../../../core/maybe.js";import{watch as a,initial as n,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{schedule as l}from"../../../../core/scheduling.js";import{property as u,subclass as h}from"../../../../core/accessorSupport/decorators.js";import p from"../../../../geometry/Multipoint.js";import{absoluteHeightElevationInfo as g,getConvertedElevation as c}from"../../../../support/elevationInfoUtils.js";import{restoreLineOfSightObserverState as d,restoreLineOfSightTargetState as y,snapshotLineOfSightTargetState as _,snapshotLineOfSightObserverState as m,updateLineOfSightItemFromAuthoredPoint as v}from"./LineOfSightAuthoringUtils.js";import{LineOfSightObserverManipulator as f,LineOfSightTargetManipulator as M,LineOfSightTargetManipulatorState as b}from"./LineOfSightManipulators.js";import{EditGeometryOperations as x}from"../../../interactive/editGeometry/EditGeometryOperations.js";const I=Symbol("line-of-sight-aggregate-operations");let w=class extends s{constructor(){super(...arguments),this._operations=null,this._externalGeometryStagingArea=new C(t=>this._syncOperationsFromAnalysisGeometry(t),()=>null==this._operations),this._observerManipulator=null,this._targetByPart=new Map,this._targetManipulators=new Map,this._dragIntersectionContext=null}initialize(){this.addHandles([a(()=>({observer:A(this.analysis.observer),targets:this.analysis.targets.toArray().map(t=>A(t))}),()=>this._analysisItemsChanged(),n),a(()=>this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),()=>this._updateTargetManipulatorStates(),o)])}destroy(){this._externalGeometryStagingArea.destroy(),this._replaceOperations(null),this._observerManipulator=null,this._targetManipulators.clear()}get operations(){return this._operations}get elevationInfo(){return g}get visible(){return this.analysisViewData.visible&&null!=this.origin}get isDraped(){return!1}get origin(){const t=this.analysis.observer,e=this.analysis.targets.at(0);return S(this.view,t?.position,t?.elevationInfo)??S(this.view,e?.position,e?.elevationInfo)}get updating(){return!1}createManipulator(t){return null}_createObserverReshapeManipulator(t){this._clearManipulatorDragTracking(this._observerManipulator);const e=new f(this.view,{deleting:!1,intersection:null,type:"observer"});return e.selected=t.selected,this._observerManipulator=e,this._trackManipulatorDrag(e,this.analysis.observer),e}_createTargetReshapeManipulator(t){const{part:e}=t.vertex,s=this._targetByPart.get(e);if(null==s)return t.defaultCreate();this._clearManipulatorDragTracking(this._targetManipulators.get(s));const r=new M(this.view,{deleting:!1,target:s,type:"target"});return r.selected=t.selected,this._targetManipulators.set(s,r),this._updateTargetManipulatorState(r,this._getTargetComputation(s)),this._trackManipulatorDrag(r,s),r}createReshapeManipulator(t){const{part:e}=t.vertex;return 0===e.index?this._createObserverReshapeManipulator(t):this._createTargetReshapeManipulator(t)}getReshapeMoveConfig(t){return 1===t.numSelected&&null!=this._targetByPart.get(t.vertex.part)?{xyAxisMode:"all"}:null}getTargetManipulator(t){const e=this._targetManipulators.get(t);return e?.view?e:null}getObserverManipulator(){const t=this._observerManipulator;return t?.view?t:null}toMap(t){return this.intersector.getScreenPointIntersection(t)?.mapPoint}createUndoRecord(){let t=this._snapshotState(),e=null;return{undo:()=>{e=this._snapshotState(),this._restoreSnapshot(t)},redo:()=>{null!=e&&(t=this._snapshotState(),this._restoreSnapshot(e))}}}_restoreSnapshot(t){const{observer:e}=this.analysis;null!=e&&null!=t.observer&&d(t.observer,e),this.analysis.targets.forEach((e,s)=>{const r=t.targets[s];null!=r&&y(r,e)}),this._queueAnalysisGeometryResync(),this.emit("committed")}_snapshotState(){return{observer:m(this.analysis.observer),targets:this.analysis.targets.toArray().map(t=>_(t))}}_replaceOperations(t){this.removeHandles(I),this._operations=r(this._operations),this._operations=t,this._targetByPart=null==t?new Map:T(t.data.parts,this.analysis.targets.toArray(),this._targetByPart),null==t&&(this._observerManipulator=null),null!=t&&this.addHandles(t.data.on("change",()=>this._operationsGeometryChanged()),I)}_analysisItemsChanged(){null==this.analysis.observer&&(this._clearManipulatorDragTracking(this._observerManipulator),this._observerManipulator=null),this._pruneTargetManipulators(),this._updateTargetManipulatorStates(),this._queueAnalysisGeometryResync()}_queueAnalysisGeometryResync(){this._externalGeometryStagingArea.stage(G(this.view,this.analysis))}_updateTargetManipulatorStates(){this._pruneTargetManipulators();for(const t of this.analysis.targets){const e=this._targetManipulators.get(t);null!=e&&this._updateTargetManipulatorState(e,this._getTargetComputation(t))}}_pruneTargetManipulators(){const t=new Set(this.analysis.targets.toArray());for(const[e,s]of this._targetManipulators)t.has(e)&&null!=s.view||(this._clearManipulatorDragTracking(s),this._targetManipulators.delete(e))}_getTargetComputation(t){return this.analysisViewData.computations.find(e=>e.target===t)}_updateTargetManipulatorState(t,e){null!=e&&e.computationResult.isValid?t.state=e.computationResult.isTargetVisible?b.visible:b.occluded:t.state=b.undefined}_syncOperationsFromAnalysisGeometry(t){if(null==t)return void(null!=this._operations&&(this._replaceOperations(null),this.emit("modified-externally")));const e=this._operations;if(null!=e&&e.data.geometry?.equals(t))this._syncTargetPartMapFromOperations(e);else{if(e?.trySetGeometry(t))return this._syncTargetPartMapFromOperations(e),this.emit("committed"),void this.emit("modified-externally");this._replaceOperations(x.fromGeometry(t,this.view.state.viewingMode)),this.emit("committed"),this.emit("modified-externally")}}_syncTargetPartMapFromOperations(t){this._targetByPart=T(t.data.parts,this.analysis.targets.toArray(),this._targetByPart)}_operationsGeometryChanged(){const t=this._operations,s=this.analysis.observer;if(this._externalGeometryStagingArea.inProgress||null==t||null==s)return;const{coordinateHelper:r,parts:i}=t.data,a=O(i,this._targetByPart);e(this.analysis.targets.toArray(),a)||this.analysis.targets.splice(0,this.analysis.targets.length,...a);const n=r.vectorToPoint(i[0]?.getFirstVertex()?.pos);null==n||P(this.view,s,n)||this._updateAnalysisItemFromAbsolutePoint(s,n);for(const e of i){if(0===e.index)continue;const t=this._targetByPart.get(e),s=r.vectorToPoint(e.getFirstVertex()?.pos);null!=t&&null!=s&&this.analysis.targets.includes(t)&&(P(this.view,t,s)||this._updateAnalysisItemFromAbsolutePoint(t,s))}null==this._dragIntersectionContext||this._dragIntersectionContext.dragging||(this._dragIntersectionContext=null),this.emit("committed")}_updateAnalysisItemFromAbsolutePoint(t,e){const s=this._dragIntersectionContext?.item===t?this._dragIntersectionContext.intersection:null;v(this.view,t,this.intersector,e,{sourceElevationInfo:g,preservedIntersection:s})}_trackManipulatorDrag(t,e){null!=e&&(this.removeHandles(t),this.addHandles(t.events.on("drag",t=>this._updateDragIntersectionContext(e,t)),t))}_clearManipulatorDragTracking(t){null!=t&&this.removeHandles(t)}_updateDragIntersectionContext(t,e){"cancel"!==e.action?this._dragIntersectionContext={dragging:"end"!==e.action,intersection:this.intersector.getScreenPointIntersection(e.screenPoint),item:t}:this._dragIntersectionContext=null}};function A(t){return t?[t,t.position,t.elevationInfo,t.feature]:null}function P(t,e,s){const r=S(t,e.position,e.elevationInfo);return r?.equals(s)??!1}function S(t,e,s){if(null==e)return null;const r=e.clone();return r.z=c(t,e,s??g,g),r}function T(t,e,s){const r=new Map;if(null!=s)for(const o of t){if(0===o.index||null!=o.getFirstVertex())continue;const t=s.get(o);null!=t&&r.set(o,t)}const i=new Set(r.values()),a=e.filter(t=>!i.has(t));let n=0;for(const o of t){if(0===o.index||null==o.getFirstVertex())continue;if(r.has(o))continue;const t=a[n++];if(null==t)break;r.set(o,t)}return r}function O(t,e){const s=[];for(const r of t){if(0===r.index||null==r.getFirstVertex())continue;const t=e.get(r);null!=t&&s.push(t)}return s}function G(t,e){const s=[S(t,e.observer?.position,e.observer?.elevationInfo),...e.targets.toArray().map(e=>S(t,e.position,e.elevationInfo))].filter(t=>null!=t);return 0===s.length?null:new p({hasZ:!0,points:s.map(t=>t.toArray()),spatialReference:s[0].spatialReference})}t([u({constructOnly:!0})],w.prototype,"analysisViewData",void 0),t([u({constructOnly:!0})],w.prototype,"analysis",void 0),t([u({constructOnly:!0})],w.prototype,"intersector",void 0),t([u({constructOnly:!0})],w.prototype,"view",void 0),t([u()],w.prototype,"_operations",void 0),t([u()],w.prototype,"operations",null),t([u()],w.prototype,"elevationInfo",null),t([u()],w.prototype,"visible",null),t([u()],w.prototype,"isDraped",null),t([u()],w.prototype,"origin",null),t([u()],w.prototype,"updating",null),w=t([h("esri.views.3d.analysis.LineOfSight.LineOfSightAggregateManipulatedObject3D")],w);class C{constructor(t,e){this._geometry=void 0,this._inProgressGeometry=void 0,this._scheduledHandle=null,this._apply=t,this._shouldApplyImmediately=e}destroy(){this._scheduledHandle=i(this._scheduledHandle),this._geometry=void 0,this._inProgressGeometry=void 0}get inProgress(){return null!=this._inProgressGeometry}stage(t){if(this._geometry=t,!this.inProgress&&this._shouldApplyImmediately())return this._scheduledHandle=i(this._scheduledHandle),void this._flush();this._scheduledHandle??=l(()=>{this._scheduledHandle=null,this._flush()})}_flush(){const t=this._geometry;if(void 0!==t){this._geometry=void 0,this._inProgressGeometry=t;try{this._apply(t)}finally{this._inProgressGeometry=void 0}}}}export{w as LineOfSightAggregateManipulatedObject3D};
|
|
2
|
+
import{__decorate as t}from"tslib";import{isSome as e,equals as r}from"../../../../core/arrayUtils.js";import{EventedAccessor as i}from"../../../../core/Evented.js";import{destroyMaybe as s,removeMaybe as a}from"../../../../core/maybe.js";import n from"../../../../core/ReactiveMap.js";import{watch as o,initial as l}from"../../../../core/reactiveUtils.js";import{schedule as u}from"../../../../core/scheduling.js";import{property as p,subclass as h}from"../../../../core/accessorSupport/decorators.js";import g from"../../../../geometry/Multipoint.js";import{absoluteHeightElevationInfo as c,getConvertedElevation as d}from"../../../../support/elevationInfoUtils.js";import{restoreLineOfSightObserverState as y,restoreLineOfSightTargetState as _,snapshotLineOfSightTargetState as m,snapshotLineOfSightObserverState as v,updateLineOfSightItemFromAuthoredPoint as f}from"./LineOfSightAuthoringUtils.js";import{LineOfSightObserverManipulator as M,LineOfSightTargetManipulator as b,LineOfSightTargetManipulatorState as x,getInteractiveLineOfSightTargetManipulatorState as S}from"./LineOfSightManipulators.js";import{EditGeometryOperations as P}from"../../../interactive/editGeometry/EditGeometryOperations.js";const A=Symbol("line-of-sight-aggregate-operations");let w=class extends i{constructor(){super(...arguments),this._operations=null,this.interacting=!1,this._externalGeometryStagingArea=new D(t=>this._syncOperationsFromAnalysisGeometry(t),()=>null==this._operations),this._observerManipulator=null,this._targetByPart=new Map,this._targetManipulators=new n,this._dragIntersectionContext=null}initialize(){this.addHandles([this._connectAnalysisItemLifecycle(),this._connectTargetPartMap(),this._connectStagedMultipointGeometry(),this._connectTargetManipulatorStates()])}destroy(){this._externalGeometryStagingArea.destroy(),this._replaceOperations(null),this._observerManipulator=null,this._targetManipulators.clear()}get operations(){return this._operations}get elevationInfo(){return c}get visible(){return this.analysisViewData.visible&&null!=this.origin}get isDraped(){return!1}get origin(){const t=this.analysis.observer,e=this.analysis.targets.at(0);return T(this.view,t?.position,t?.elevationInfo)??T(this.view,e?.position,e?.elevationInfo)}get _stagedMultipointGeometry(){const t=this.analysis.observer,r=this.analysis.targets.toArray(),i=t?.position?.spatialReference,s=[T(this.view,t?.position,t?.elevationInfo),...r.map(t=>T(this.view,t.position,t.elevationInfo))].filter(e).map(t=>t.toArray());return 0===s.length||null==i?null:new g({hasZ:!0,points:s,spatialReference:i})}get updating(){return!1}createManipulator(t){return null}_createObserverReshapeManipulator(t){this._clearManipulatorDragTracking(this._observerManipulator);const e=new M(this.view,{deleting:!1,intersection:null,type:"observer"});return e.selected=t.selected,this._observerManipulator=e,this._trackManipulatorDrag(e,this.analysis.observer),e}_createTargetReshapeManipulator(t){const{part:e}=t.vertex,r=this._targetByPart.get(e);if(null==r)return t.defaultCreate();this._clearManipulatorDragTracking(this._targetManipulators.get(r));const i=new b(this.view,{deleting:!1,target:r,type:"target"});return i.selected=t.selected,this._targetManipulators.set(r,i),this._updateTargetManipulatorState(i,this._getTargetComputation(r)),this._trackManipulatorDrag(i,r),i}createReshapeManipulator(t){const{part:e}=t.vertex;return 0===e.index?this._createObserverReshapeManipulator(t):this._createTargetReshapeManipulator(t)}getReshapeMoveConfig(t){return 1===t.numSelected&&null!=this._targetByPart.get(t.vertex.part)?{xyAxisMode:"all"}:null}getTargetManipulator(t){const e=this._targetManipulators.get(t);return e?.view?e:null}get observerManipulator(){return this._observerManipulator}get targetManipulators(){return[...this._targetManipulators.values()]}get lineOfSightManipulators(){return[this._observerManipulator,...this._targetManipulators.values()].filter(t=>null!=t&&!t.metadata.deleting)}toMap(t){return this.intersector.getScreenPointIntersection(t)?.mapPoint}createUndoRecord(){let t=this._snapshotState(),e=null;return{undo:()=>{e=this._snapshotState(),this._restoreSnapshot(t)},redo:()=>{null!=e&&(t=this._snapshotState(),this._restoreSnapshot(e))}}}_restoreSnapshot(t){const{observer:e}=this.analysis;null!=e&&null!=t.observer&&y(t.observer,e),this.analysis.targets.forEach((e,r)=>{const i=t.targets[r];null!=i&&_(i,e)}),this._queueAnalysisGeometryResync(),this.emit("committed")}_snapshotState(){return{observer:v(this.analysis.observer),targets:this.analysis.targets.toArray().map(t=>m(t))}}_replaceOperations(t){this.removeHandles(A),this._operations=s(this._operations),this._operations=t,this._targetByPart=null==t?new Map:G(t.data.parts,this.analysis.targets.toArray(),this._targetByPart),null==t&&(this._observerManipulator=null),null!=t&&this.addHandles(t.data.on("change",()=>this._operationsGeometryChanged()),A)}_connectAnalysisItemLifecycle(){return o(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>{null==t&&(this._clearManipulatorDragTracking(this._observerManipulator),this._observerManipulator=null);const r=new Set(e);for(const[i,s]of this._targetManipulators)r.has(i)&&null!=s.view||(this._clearManipulatorDragTracking(s),this._targetManipulators.delete(i))},l)}_connectTargetPartMap(){return o(()=>({operations:this._operations,targets:this.analysis.targets.toArray()}),({operations:t,targets:e})=>{null!=t&&(this._targetByPart=G(t.data.parts,e,this._targetByPart))},l)}_connectStagedMultipointGeometry(){return o(()=>this._stagedMultipointGeometry,t=>{this._externalGeometryStagingArea.stage(t)},l)}_connectTargetManipulatorStates(){return o(()=>({computations:this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),interacting:this.interacting,targets:this.analysis.targets.toArray()}),({computations:t,interacting:e,targets:r})=>{for(const i of r){const r=this._targetManipulators.get(i);if(null==r)continue;const s=t.find(t=>t.target===i),a=null!=s&&s.isValid?s.isTargetVisible?x.visible:x.occluded:x.undefined;r.state=e?S(a):a}},l)}_queueAnalysisGeometryResync(){this._externalGeometryStagingArea.stage(this._stagedMultipointGeometry)}_getTargetComputation(t){return this.analysisViewData.computations.find(e=>e.target===t)}_updateTargetManipulatorState(t,e){null!=e&&e.computationResult.isValid?t.state=this._getTargetManipulatorState(e.computationResult.isTargetVisible?x.visible:x.occluded):t.state=this._getTargetManipulatorState(x.undefined)}_getTargetManipulatorState(t){return this.interacting?S(t):t}_syncOperationsFromAnalysisGeometry(t){if(null==t)return void(null!=this._operations&&(this._replaceOperations(null),this.emit("modified-externally")));const e=this._operations;if(null!=e&&e.data.geometry?.equals(t))this._syncTargetPartMapFromOperations(e);else{if(e?.trySetGeometry(t))return this._syncTargetPartMapFromOperations(e),this.emit("committed"),void this.emit("modified-externally");this._replaceOperations(P.fromGeometry(t,this.view.state.viewingMode)),this.emit("committed"),this.emit("modified-externally")}}_syncTargetPartMapFromOperations(t){this._targetByPart=G(t.data.parts,this.analysis.targets.toArray(),this._targetByPart)}_operationsGeometryChanged(){const t=this._operations,e=this.analysis.observer;if(this._externalGeometryStagingArea.inProgress||null==t||null==e)return;const{coordinateHelper:i,parts:s}=t.data,a=O(s,this._targetByPart);r(this.analysis.targets.toArray(),a)||this.analysis.targets.splice(0,this.analysis.targets.length,...a);const n=i.vectorToPoint(s[0]?.getFirstVertex()?.pos);null==n||I(this.view,e,n)||this._updateAnalysisItemFromAbsolutePoint(e,n);for(const r of s){if(0===r.index)continue;const t=this._targetByPart.get(r),e=i.vectorToPoint(r.getFirstVertex()?.pos);null!=t&&null!=e&&this.analysis.targets.includes(t)&&(I(this.view,t,e)||this._updateAnalysisItemFromAbsolutePoint(t,e))}null==this._dragIntersectionContext||this._dragIntersectionContext.dragging||(this._dragIntersectionContext=null),this.emit("committed")}_updateAnalysisItemFromAbsolutePoint(t,e){const r=this._dragIntersectionContext?.item===t?this._dragIntersectionContext.intersection:null;f(this.view,t,this.intersector,e,{sourceElevationInfo:c,preservedIntersection:r})}_trackManipulatorDrag(t,e){null!=e&&(this.removeHandles(t),this.addHandles(t.events.on("drag",t=>this._updateDragIntersectionContext(e,t)),t))}_clearManipulatorDragTracking(t){null!=t&&this.removeHandles(t)}_updateDragIntersectionContext(t,e){"cancel"!==e.action?this._dragIntersectionContext={dragging:"end"!==e.action,intersection:this.intersector.getScreenPointIntersection(e.screenPoint),item:t}:this._dragIntersectionContext=null}};function I(t,e,r){const i=T(t,e.position,e.elevationInfo);return i?.equals(r)??!1}function T(t,e,r){if(null==e)return null;const i=e.clone();return i.z=d(t,e,r??c,c),i}function G(t,e,r){const i=new Map;if(null!=r)for(const o of t){if(0===o.index||null!=o.getFirstVertex())continue;const t=r.get(o);null!=t&&i.set(o,t)}const s=new Set(i.values()),a=e.filter(t=>!s.has(t));let n=0;for(const o of t){if(0===o.index||null==o.getFirstVertex())continue;if(i.has(o))continue;const t=a[n++];if(null==t)break;i.set(o,t)}return i}function O(t,e){const r=[];for(const i of t){if(0===i.index||null==i.getFirstVertex())continue;const t=e.get(i);null!=t&&r.push(t)}return r}t([p({constructOnly:!0})],w.prototype,"analysisViewData",void 0),t([p({constructOnly:!0})],w.prototype,"analysis",void 0),t([p({constructOnly:!0})],w.prototype,"intersector",void 0),t([p({constructOnly:!0})],w.prototype,"view",void 0),t([p()],w.prototype,"_operations",void 0),t([p()],w.prototype,"interacting",void 0),t([p()],w.prototype,"_observerManipulator",void 0),t([p()],w.prototype,"operations",null),t([p()],w.prototype,"elevationInfo",null),t([p()],w.prototype,"visible",null),t([p()],w.prototype,"isDraped",null),t([p()],w.prototype,"origin",null),t([p()],w.prototype,"_stagedMultipointGeometry",null),t([p()],w.prototype,"updating",null),t([p()],w.prototype,"observerManipulator",null),t([p()],w.prototype,"targetManipulators",null),t([p()],w.prototype,"lineOfSightManipulators",null),w=t([h("esri.views.3d.analysis.LineOfSight.LineOfSightAggregateManipulatedObject3D")],w);class D{constructor(t,e){this._geometry=void 0,this._inProgressGeometry=void 0,this._scheduledHandle=null,this._apply=t,this._shouldApplyImmediately=e}destroy(){this._scheduledHandle=a(this._scheduledHandle),this._geometry=void 0,this._inProgressGeometry=void 0}get inProgress(){return null!=this._inProgressGeometry}stage(t){if(this._geometry=t,!this.inProgress&&this._shouldApplyImmediately())return this._scheduledHandle=a(this._scheduledHandle),void this._flush();this._scheduledHandle??=u(()=>{this._scheduledHandle=null,this._flush()})}_flush(){const t=this._geometry;if(void 0!==t){this._geometry=void 0,this._inProgressGeometry=t;try{this._apply(t)}finally{this._inProgressGeometry=void 0}}}}export{w as LineOfSightAggregateManipulatedObject3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import o from"../../../../Color.js";import{multiplyOpacityToUnitRGBA as n,getContrast as t}from"../../../../core/colorUtils.js";class
|
|
2
|
+
import o from"../../../../Color.js";import{multiplyOpacityToUnitRGBA as n,getContrast as t}from"../../../../core/colorUtils.js";class r{constructor(){this.glowWidth=8,this.innerWidth=.75}}const e=new r;function s(o){const n=o.accentColor;return{glowColor:n,innerColor:t(n),globalAlpha:.75*n.a}}class i{constructor(){this.size=.5}}const c=new i;function l(o){return n(o.accentColor,.75)}function h(o){return n(o.accentColor,.75)}class u{constructor(){this.size=.5,this.visibleColor=new o([3,252,111,.75]),this.occludedColor=new o([252,3,69,.75]),this.undefinedColor=new o([127,127,127,.75])}}const d=new u;class w{constructor(){this.innerWidth=2,this.outerWidth=8,this.visibleInnerColor=new o([3,252,111,1]),this.visibleOuterColor=new o([3,252,111,.15]),this.occludedInnerColor=new o([252,3,69,1]),this.occludedOuterColor=new o([252,3,69,.1]),this.undefinedInnerColor=new o([255,255,255,1]),this.undefinedOuterColor=new o([127,127,127,.2])}}const C=new w;export{h as getInteractiveTargetRGBA,s as getLaserLineColors,l as getObserverRGBA,e as laserLineConfiguration,C as lineOfSightConfiguration,c as observerConfiguration,d as targetConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/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"../../../../core/has.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as s,initial as r,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as n,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{create as a,fromValues as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as u,fromPoints as h}from"../../../../geometry/support/lineSegment.js";import{absoluteHeightElevationInfo as d,getConvertedElevation as p}from"../../../../support/elevationInfoUtils.js";import{LineOfSightInteractionVisuals as v}from"./LineOfSightInteractionVisuals.js";import{Settings as m}from"../../interactive/editingTools/settings.js";import{VerticesVisualElement as f}from"../../interactive/visualElements/VerticesVisualElement.js";let V=class extends t{constructor(e){super(e),this.elevationInfo=null,this.analysisVisible=!0,this._active=!1,this._rendererVisuals=new Map,this._observerRenderLocation=a(),this._targetRenderLocation=a(),this._laserLineSegment=u(),this._interactionVisuals=null,this._settings=new m({getTheme:()=>this.view.effectiveTheme})}initialize(){this._interactionVisuals=new v({view:this.view});const e=this._settings;this.addHandles([this._connectInteractionVisuals(),s(()=>({selectedColor:e.colors.selected.toUnitRGBA(),outlineColor:e.manipulators.vertex.outlineColor.toUnitRGBA()}),({selectedColor:e,outlineColor:t})=>{for(const{element:i}of this._rendererVisuals.values())i.color=e,i.outlineColor=t},r)])}destroy(){for(const e of this._rendererVisuals.keys())this.removeVisual(e);this._interactionVisuals=i(this._interactionVisuals)}activate(){this._active=!0,this._refreshVisuals(),this._refreshInteractionVisuals()}refresh(){this._refreshVisuals(),this._refreshInteractionVisuals()}deactivate(){this._active=!1;for(const{element:e}of this._rendererVisuals.values())e.attached=!1;this._interactionVisuals?.hide()}addOrUpdateGraphic(e,t){}addOrUpdateVisual(e,t){const i=this._rendererVisuals.get(e),s=C(t,i?.props);if(!_(s))return void this.removeVisual(e);if(i)return i.props=s,void this._applyVisual(i.element,s);const r=this._settings,o=r.manipulators.vertex,n=new f({view:this.view,isDecoration:!0,spatialReference:this.view.renderCoordsHelper.spatialReference,elevationInfo:d,size:o.size,outlineSize:o.outlineSize,renderOccluded:o.renderOccluded,color:r.colors.selected.toUnitRGBA(),outlineColor:o.outlineColor.toUnitRGBA()});this._rendererVisuals.set(e,{element:n,props:s}),this._applyVisual(n,s)}removeGraphic(e){}removeVisual(e){const t=this._rendererVisuals.get(e);t&&(t.element.destroy(),this._rendererVisuals.delete(e))}hitTestVisualDistance(e,t){return null}_connectInteractionVisuals(){return s(()=>({active:this._active,analysisVisible:this.analysisVisible,cursorTargetPosition:this.analysisViewData.cursorTarget?.position,observerPosition:this.analysis.observer?.position}),({active:e,analysisVisible:t,cursorTargetPosition:i,observerPosition:s})=>{const{_observerRenderLocation:r,_targetRenderLocation:o,_laserLineSegment:n}=this;e&&t&&null!=s&&null!=i&&this.view.renderCoordsHelper.toRenderCoords(s,r)&&this.view.renderCoordsHelper.toRenderCoords(i,o)?this._interactionVisuals?.update({target:o,lineVerticalPlaneSegment:h(r,o,n),visible:!0}):this._interactionVisuals?.hide()},o)}_refreshVisuals(){for(const{element:e,props:t}of this._rendererVisuals.values())this._applyVisual(e,t)}_refreshInteractionVisuals(){const{_observerRenderLocation:e,_targetRenderLocation:t,_laserLineSegment:i}=this,s=this.analysis.observer?.position,r=this.analysisViewData.cursorTarget?.position;this._active&&this.analysisVisible&&null!=s&&null!=r&&this.view.renderCoordsHelper.toRenderCoords(s,e)&&this.view.renderCoordsHelper.toRenderCoords(r,t)?this._interactionVisuals?.update({target:t,lineVerticalPlaneSegment:h(e,t,i),visible:!0}):this._interactionVisuals?.hide()}_applyVisual(e,t){const i=y(t.geometry);if(!i)return e.vertices=[],void(e.attached=!1);const s=w(this.view,i,this.elevationInfo);if(!s)return e.vertices=[],void(e.attached=!1);this._applyVisualStyle(e),e.vertices=[s],e.attached=this._active&&this.analysisVisible}_applyVisualStyle(e){const t=this._settings,i=t.manipulators.vertex;e.color=t.colors.selected.toUnitRGBA(),e.outlineColor=i.outlineColor.toUnitRGBA()}get test(){}};function _(e){return null!=y(e.geometry)&&("cursor"===e.role||"controlPoint"===e.role)}function y(e){if(!e)return null;switch(e.type){case"point":return e;case"multipoint":return g(e);default:return null}}function g(e){return 0===e.points.length?null:e.getPoint(e.points.length-1)}function w(e,t,i){const s=p(e,t,i??d,d),r=c(t.x,t.y,s??0);return e.renderCoordsHelper.toRenderCoords(r,t.spatialReference,r)?r:null}function C(e,t={geometry:null,role:"outputGeometry",state:"idle"}){return{...t,...e}}e([n({constructOnly:!0})],V.prototype,"analysis",void 0),e([n({constructOnly:!0})],V.prototype,"analysisViewData",void 0),e([n({constructOnly:!0})],V.prototype,"view",void 0),e([n()],V.prototype,"elevationInfo",void 0),e([n()],V.prototype,"analysisVisible",void 0),e([n()],V.prototype,"_active",void 0),V=e([l("esri.views.3d.analysis.LineOfSight.LineOfSightDrawToolRenderer")],V);export{V as LineOfSightDrawToolRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{watch as e}from"../../../../core/reactiveUtils.js";import{getObserverRGBA as t,observerConfiguration as o,targetConfiguration as i}from"./LineOfSightConfiguration.js";import{Manipulator3D as
|
|
2
|
+
import{watch as e}from"../../../../core/reactiveUtils.js";import{getObserverRGBA as t,observerConfiguration as o,targetConfiguration as i,getInteractiveTargetRGBA as r}from"./LineOfSightConfiguration.js";import{Manipulator3D as s}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as n}from"../../interactive/manipulatorUtils.js";import{RenderObject as m}from"../../interactive/RenderObject.js";import{disableDisplayOnGrab as a}from"../../interactive/editingTools/manipulatorUtils.js";import{createSphereGeometry as c}from"../../webgl-engine/lib/GeometryUtil.js";const l=128,f=256,d=512,u=1024,h=2048;class v extends s{constructor(i,r){const s=n(t(i.effectiveTheme)),l=c(s,o.size,32,32),f=new m(l);super({view:i,renderObjects:[f],metadata:r,elevationInfo:{mode:"absolute-height",offset:0}}),a(this),this.themeHandle=e(()=>({color:t(i.effectiveTheme)}),e=>{s.setParameters(e)})}destroy(){this.themeHandle.remove(),super.destroy()}}class p extends s{constructor(t,o){const{size:s,visibleColor:v,occludedColor:p,undefinedColor:j}=i,b=n(r(t.effectiveTheme)),w=[new m(c(b,s,32,32),u),g(s,v,h|l),g(s,p,h|f),g(s,j,h|d)];super({view:t,renderObjects:w,metadata:o,elevationInfo:{mode:"absolute-height",offset:0}}),a(this),this.themeHandle=e(()=>({color:r(t.effectiveTheme)}),e=>{b.setParameters(e)})}destroy(){this.themeHandle.remove(),super.destroy()}}const j={visible:h|l,occluded:h|f,undefined:h|d};function b(e){return e&~h|u}function g(e,t,o){return new m(c(n(t.toUnitRGBA()),e,32,32),o)}export{v as LineOfSightObserverManipulator,p as LineOfSightTargetManipulator,j as LineOfSightTargetManipulatorState,b as getInteractiveLineOfSightTargetManipulatorState};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import{handlesGroup as i}from"../../../../core/handleUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import a from"../../../../core/ReactiveSet.js";import{watch as s,initial as o,when as r}from"../../../../core/reactiveUtils.js";import{property as l,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{create as h,fromPoints as p}from"../../../../geometry/support/lineSegment.js";import{LineOfSightAggregateManipulatedObject3D as u}from"./LineOfSightAggregateManipulatedObject3D.js";import{LineOfSightInteractionVisuals as d}from"./LineOfSightInteractionVisuals.js";import{ReshapeTool3D as g}from"../../interactive/editingTools/reshape/ReshapeTool3D.js";import _ from"../../../interactive/sketch/SketchOptions.js";import{acquire as v}from"../../../interactive/snapping/SnappingManagerPool.js";const b=Symbol("line-of-sight-reshape-line-of-sight-manipulators"),M=Symbol("line-of-sight-reshape-tool-operations"),f=h();let m=class extends t{constructor(e){super(e),this.visible=!0,this.isParentToolInteracting=!1,this._selectedManipulators=new a,this._grabbedManipulator=null,this._interactionVisuals=null,this._snappingManagerResult=v(e.view),this._object=new u({analysis:e.analysis,analysisViewData:e.analysisViewData,intersector:e.intersector,view:e.view}),this._reshapeTool=new g({autoHideManipulators:!1,enableDeleteVertices:!0,enableEdgeOffset:!1,enableMidpoints:!1,enableMoveObject:!1,object:this._object,snapToScene:!0,sketchOptions:new _({tooltips:{enabled:!0}}),snappingManager:this._snappingManagerResult.snappingManager,view:e.view})}initialize(){this.view.tools.add(this._reshapeTool),this._interactionVisuals=new d({view:this.view}),this.addHandles([this._snappingManagerResult,this._connectReshapeEvents(),this._connectActiveState(),this._connectManipulators(),this._connectGrabbedManipulator(),this._connectObjectInteracting(),this._connectOperations()])}destroy(){this.stop(),this.removeHandles(b),this.view.tools.remove(this._reshapeTool),this._reshapeTool.destroy(),this._object.destroy(),this._interactionVisuals=n(this._interactionVisuals),this._selectedManipulators.clear()}get active(){return this._reshapeTool.active}get canRedo(){return this._reshapeTool.canRedo}get canUndo(){return this._reshapeTool.canUndo}get updating(){return this._reshapeTool.updating}get snappingManager(){return this.active?this._reshapeTool.snappingManager:null}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}activate(){this._reshapeTool.visible=this.visible,this.view.activeTool!==this._reshapeTool&&(this.view.activeTool=this._reshapeTool),this._reshapeTool.activate()}getTargetManipulator(e){return this._object.getTargetManipulator(e)}getObserverManipulator(){return this._object.observerManipulator}hasManipulatorAt(e,t){for(const i of this._object.lineOfSightManipulators)if(y(i,e,t))return!0;return!1}redo(){this._reshapeTool.redo()}clearSelection(){this._reshapeTool.clearSelection(),this._selectedManipulators.clear(),this._grabbedManipulator=null}get hasSelection(){return this._selectedManipulators.size>0}get _objectInteracting(){return this.analysisViewData.visible&&(this.isParentToolInteracting||this.hasSelection)}applySelection(e){const t="observer"===e.type?this._object.observerManipulator:this._object.getTargetManipulator(e.target);return null!=t&&this._reshapeTool.selectManipulator(t)}setEditableFlag(e,t){this._reshapeTool.setEditableFlag(e,t)}stop(){this.view.activeTool===this._reshapeTool&&(this.view.activeTool=null),this.snappingManager?.doneSnapping(),this.clearSelection()}undo(){this._reshapeTool.undo()}_connectReshapeEvents(){return i([this._reshapeTool.events.on("reshape",e=>{if(1===this._selectedManipulators.size){if("reshape-start"===e.type){const e=this._selectedManipulators.values().next().value;this._grabbedManipulator??=e}"reshape-stop"===e.type&&(this._grabbedManipulator=null)}}),this._reshapeTool.on("cancel",()=>this.clearSelection()),this._reshapeTool.events.on("before-vertex-remove",e=>{let t=this.analysis.targets.length;for(const i of e.vertices){if(0===i.componentIndex)return void e.preventDefault();if(t-=1,0===t)return void e.preventDefault()}})])}_connectActiveState(){return s(()=>this.active,e=>{e||this._reshapeTool.snappingManager?.doneSnapping()},o)}_connectManipulators(){return s(()=>this._object.lineOfSightManipulators,e=>{this.removeHandles(b),this._selectedManipulators.batch(()=>{this._selectedManipulators.clear();for(const t of e)t.selected&&this._selectedManipulators.add(t)}),this.addHandles(e.map(e=>this._connectManipulator(e)),b)},o)}_connectManipulator(e){return i([e.events.on("grab-changed",t=>{if("start"===t.action){this._selectedManipulators.add(e),this._grabbedManipulator??=e;const t=this.active,i=this.analysisViewData.visible,n=this._object.observerManipulator,a=this.visible,s=this._grabbedManipulator;if(s!==e)return;if(null==this._interactionVisuals||!t||!a||!i||null==n)return void this._hideLaserLine();this._interactionVisuals.update({target:s.renderLocation,lineVerticalPlaneSegment:s===n?null:p(n.renderLocation,s.renderLocation,f),visible:!0})}"end"===t.action&&(this._grabbedManipulator=null)}),e.events.on("select-changed",({action:t})=>{"select"===t?this._selectedManipulators.add(e):this._selectedManipulators.delete(e)}),e.events.on("location-update",()=>{const t=this.active,i=this.analysisViewData.visible,n=this._object.observerManipulator,a=this.visible,s=this._grabbedManipulator;s===e&&(null!=this._interactionVisuals&&t&&a&&i&&null!=n?this._interactionVisuals.update({target:s.renderLocation,lineVerticalPlaneSegment:s===n?null:p(n.renderLocation,s.renderLocation,f),visible:!0}):this._hideLaserLine())})])}_connectGrabbedManipulator(){return r(()=>null==this._grabbedManipulator,()=>{this._hideLaserLine()})}_connectObjectInteracting(){return s(()=>this._objectInteracting,e=>{this._object.interacting=e},o)}_connectOperations(){return s(()=>this._object.operations,e=>{this.removeHandles(M),null!=e&&this.addHandles([e.on("can-redo-change",()=>this.notifyChange("canRedo")),e.on("can-undo-change",()=>this.notifyChange("canUndo"))],M),this.notifyChange("canUndo"),this.notifyChange("canRedo")},o)}_hideLaserLine(){this._interactionVisuals?.hide()}};function y(e,t,i){return!0===e?.interactive&&e.consumesClicks&&null!=e.intersectionDistance(t,i)}e([l({constructOnly:!0})],m.prototype,"analysisViewData",void 0),e([l({constructOnly:!0})],m.prototype,"analysis",void 0),e([l({constructOnly:!0})],m.prototype,"intersector",void 0),e([l({constructOnly:!0})],m.prototype,"view",void 0),e([l()],m.prototype,"visible",void 0),e([l()],m.prototype,"isParentToolInteracting",void 0),e([l()],m.prototype,"_grabbedManipulator",void 0),e([l()],m.prototype,"active",null),e([l()],m.prototype,"canRedo",null),e([l()],m.prototype,"canUndo",null),e([l()],m.prototype,"updating",null),e([l()],m.prototype,"hasSelection",null),e([l()],m.prototype,"_objectInteracting",null),m=e([c("esri.views.3d.analysis.LineOfSight.LineOfSightReshapeTool3D")],m);export{m as LineOfSightReshapeTool3D};
|