@arcgis/core 4.33.0-next.20250423 → 4.33.0-next.20250425
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/Graphic.js +1 -1
- package/WebScene.js +1 -1
- package/analysis/Analysis.d.ts +4 -0
- package/analysis/Analysis.js +1 -1
- package/analysis/SliceAnalysis.js +1 -1
- package/analysis/SlicePlane.js +1 -1
- package/analysis/support/AnalysisOriginWebScene.d.ts +4 -0
- package/analysis/support/AnalysisOriginWebScene.js +5 -0
- package/analysis/support/SliceAnalysisExcludedLayer.js +5 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d4d011eea16a89a5aad9.js → 0219c3f9408d3fa3c9a0.js} +1 -1
- package/assets/esri/core/workers/chunks/070839cb71c8e764b8d7.js +1 -0
- package/assets/esri/core/workers/chunks/19084a293694c5a00cae.js +1 -0
- package/assets/esri/core/workers/chunks/{8ba7d44eff348004f084.js → 1a6d2d090b643a87408a.js} +1 -1
- package/assets/esri/core/workers/chunks/1b8cc83aa1179245b2dc.js +1 -0
- package/assets/esri/core/workers/chunks/{5e5225623977e61fd0ef.js → 213adc87c843d627c5d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa8a3c75f9b41d31559b.js → 265f69d153b7b6f07e42.js} +1 -1
- package/assets/esri/core/workers/chunks/{769b66cca8347f0f84db.js → 279bbd61b32577693a4a.js} +1 -1
- package/assets/esri/core/workers/chunks/290b065b377f9d2ee058.js +1 -0
- package/assets/esri/core/workers/chunks/29d3245261a7223124ed.js +1 -0
- package/assets/esri/core/workers/chunks/2bed8a5ed9ae3760fa2f.js +1 -0
- package/assets/esri/core/workers/chunks/2e3019ce49e972a815ca.js +1 -0
- package/assets/esri/core/workers/chunks/335b539893569e3d7b82.js +1 -0
- package/assets/esri/core/workers/chunks/38f5e6a202ce292edd9f.js +1 -0
- package/assets/esri/core/workers/chunks/415903f481392c72870f.js +1 -0
- package/assets/esri/core/workers/chunks/4351b3e54b309935faed.js +1 -0
- package/assets/esri/core/workers/chunks/4da99f058cca83937e9b.js +1 -0
- package/assets/esri/core/workers/chunks/5acdd49c5f1a49fdc6e7.js +1 -0
- package/assets/esri/core/workers/chunks/60f7cd05e88701f43d3f.js +1 -0
- package/assets/esri/core/workers/chunks/{26e0a0a13060cd3e4291.js → 626ba3a7dee952308566.js} +1 -1
- package/assets/esri/core/workers/chunks/7cd32b10ed0e18e44ef2.js +1 -0
- package/assets/esri/core/workers/chunks/9661ee8569ee208e6237.js +1 -0
- package/assets/esri/core/workers/chunks/968f2f841c011095a6d2.js +1 -0
- package/assets/esri/core/workers/chunks/974742af7beb000c4b4a.js +1 -0
- package/assets/esri/core/workers/chunks/{e27fa1e84f16b7f19a90.js → 9850ff14bd9c7da81c65.js} +1 -1
- package/assets/esri/core/workers/chunks/a0c51c4c30a5f749dfc6.js +1 -0
- package/assets/esri/core/workers/chunks/a2676f3f135ad5fdf872.js +1 -0
- package/assets/esri/core/workers/chunks/a8430e1e2142f1ce9b92.js +1 -0
- package/assets/esri/core/workers/chunks/{fdcbd28f38bc485ac5e3.js → ab6ecd8eeec5ff761b34.js} +1 -1
- package/assets/esri/core/workers/chunks/b53300b46646cfad2526.js +319 -0
- package/assets/esri/core/workers/chunks/bf543bdec3da0fe278fb.js +1 -0
- package/assets/esri/core/workers/chunks/{5bdd5ae2d2f23ef6b331.js → c87e2a63b96e0da77dfe.js} +1 -1
- package/assets/esri/core/workers/chunks/cc4dd739c4c7e3ccea3f.js +1 -0
- package/assets/esri/core/workers/chunks/d3a74087e076a3ae76ca.js +1 -0
- package/assets/esri/core/workers/chunks/{7c42281188b874ffcdad.js → db5913824d5e5a2a8365.js} +1 -1
- package/assets/esri/core/workers/chunks/{48a1bb1e171dd06a7c6e.js → dd94585508f49863dc15.js} +1 -1
- package/assets/esri/core/workers/chunks/{9408a72968cbd985dd24.js → f2cef954b58c6604642c.js} +34 -34
- package/assets/esri/core/workers/chunks/f52e597dca4b32a81881.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/chunks/BloomBlur.glsl.js +7 -7
- package/chunks/BloomComposition.glsl.js +24 -25
- package/chunks/ShadowCastAccumulate.glsl.js +13 -9
- package/chunks/ShadowCastVisualize.glsl.js +24 -9
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/chunks/sphere.js +1 -1
- package/core/Collection.js +1 -1
- package/core/JSONSupport.js +1 -1
- package/core/SetUtils.js +1 -1
- package/{views/webgl/GLObjectType.js → core/support/jsonUtils.js} +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/support/normalizeUtilsSync.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +544 -116
- package/layers/DimensionLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/ViewshedLayer.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/FieldsIndex.js +1 -1
- package/layers/support/ParquetEncodingLocation.d.ts +4 -0
- package/layers/support/ParquetEncodingLocation.js +1 -1
- package/layers/support/ParquetEncodingWkb.d.ts +4 -0
- package/layers/support/ParquetEncodingWkb.js +1 -1
- package/layers/support/RasterStorageInfo.js +1 -1
- package/layers/support/VideoElement.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/parquetUtils.d.ts +3 -0
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/layers/support/rasterDatasets/RawBlockCache.js +1 -1
- package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
- package/layers/support/rasterFormats/{TiffTags.js → tiffTag.js} +1 -1
- package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
- package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
- package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
- package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
- package/layers/support/rasterFunctions/RemapFunction.js +1 -1
- package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
- package/layers/support/videoUtils.js +5 -0
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/integratedMesh3DTilesLayerItem.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
- package/views/2d/engine/webgl/textureUtils.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/2d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
- package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/atmosphereUtils.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/interactive/visualElements/EngineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWorker.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/pipeline/PipelineCommand.js +1 -1
- package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/Factory.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/SimpleFeatureRenderer.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/cameraUtilsSpherical.js +1 -1
- package/views/3d/support/geometryUtils/sphere.js +1 -1
- package/views/3d/terrain/OverlayRenderTargets.js +1 -1
- package/views/3d/webgl/ManagedDepthTexture.js +1 -1
- package/views/3d/webgl/ManagedFBO.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +12 -20
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendColorsPremultiplied.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechniqueConfiguration.js +5 -0
- package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/analysis/analysisViewUtils.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/input/ViewEvents.js +1 -1
- package/views/support/selectionUtils.js +1 -1
- package/views/webgl/FBOAttachmentType.js +5 -0
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Renderbuffer.js +1 -1
- package/views/webgl/RenderbufferDescriptor.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/TextureDescriptor.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/webscene/InitialViewProperties.js +1 -1
- package/webscene/Presentation.js +1 -1
- package/webscene/Slide.js +1 -1
- package/webscene/SlideLegendInfo.js +1 -1
- package/webscene/background/ColorBackground.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/webscene/spec-certification/compare.js +1 -1
- package/webscene/spec-certification/index.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/webscene/spec-certification/utils.js +1 -1
- package/webscene/support/Description.js +1 -1
- package/webscene/support/SlideElements.js +1 -1
- package/webscene/support/SlideEnvironment.js +1 -1
- package/webscene/support/SlideGround.js +1 -1
- package/webscene/support/SlideVisibleLayer.js +1 -1
- package/webscene/support/Title.js +1 -1
- package/webscene/support/analysisUtils.js +5 -0
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/support/SketchController.js +5 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileInteraction.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/ShadowCast/ThresholdOptions.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/support/AnalysisViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/assets/esri/core/workers/chunks/184d7c8ea818bec5c462.js +0 -1
- package/assets/esri/core/workers/chunks/22f604726529ee6f8c25.js +0 -1
- package/assets/esri/core/workers/chunks/244d2196bac5ef279436.js +0 -1
- package/assets/esri/core/workers/chunks/26fcbe053194bd78fcc3.js +0 -1
- package/assets/esri/core/workers/chunks/32f2e0c88046b39916cc.js +0 -1
- package/assets/esri/core/workers/chunks/388a763da712ca71ccf4.js +0 -1
- package/assets/esri/core/workers/chunks/4f8782b3b6ad414409e8.js +0 -1
- package/assets/esri/core/workers/chunks/5ffc3ca6c6a4d32e1282.js +0 -1
- package/assets/esri/core/workers/chunks/642a595353a86f3717e3.js +0 -1
- package/assets/esri/core/workers/chunks/8dd26b12c625d20196ed.js +0 -319
- package/assets/esri/core/workers/chunks/931275cfa2c55eb0f504.js +0 -1
- package/assets/esri/core/workers/chunks/93e9dfd1ba8f393c6c47.js +0 -1
- package/assets/esri/core/workers/chunks/95379fdd6917c8a84c71.js +0 -1
- package/assets/esri/core/workers/chunks/9b21dc4659922cc577cb.js +0 -1
- package/assets/esri/core/workers/chunks/a197c86d42cc9ce21924.js +0 -1
- package/assets/esri/core/workers/chunks/a276980c06d5d311a37e.js +0 -1
- package/assets/esri/core/workers/chunks/b42ecc7c3eb2fd8d1308.js +0 -1
- package/assets/esri/core/workers/chunks/ccc50f28f217e50cc2c3.js +0 -1
- package/assets/esri/core/workers/chunks/d04efa51da9b4eb3a8a7.js +0 -1
- package/assets/esri/core/workers/chunks/d81bebbb6fe000200d35.js +0 -1
- package/assets/esri/core/workers/chunks/dd8e72d6784a8ebc115d.js +0 -1
- package/assets/esri/core/workers/chunks/e9fba86036b8fe700a41.js +0 -1
- package/assets/esri/core/workers/chunks/ed3d1d0465f4a4d8df4a.js +0 -1
- package/views/webgl/formats.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createTask as o}from"../../core/asyncUtils.js";import{handlesGroup as t}from"../../core/handleUtils.js";import{removeMaybe as i}from"../../core/maybe.js";import{onAbort as
|
|
5
|
+
import{createTask as o}from"../../core/asyncUtils.js";import{handlesGroup as t}from"../../core/handleUtils.js";import{removeMaybe as i}from"../../core/maybe.js";import{onAbort as e,ignoreAbortErrors as n,throwIfAborted as r,isAbortError as a}from"../../core/promiseUtils.js";import{whenOnce as l,watch as s,syncAndInitial as c,on as m}from"../../core/reactiveUtils.js";function u(t,n){t.interactive=!0;const{tool:r,view:a}=t;a.activeTool=r;let s=e(n,(()=>{a.activeTool===r&&(a.activeTool=null)}));return o((async o=>{await l((()=>null==r||!r.active),o),s=i(s)}),n)}function v(o,t){return s((()=>o.interactive),(()=>f(o,t)),c)}function f(o,t){o.interactive?p(o,t):w(o)}function p(o,t){w(o);const{view:i,analysis:e}=o,n=new t({view:i,analysis:e,analysisViewData:o});return o.tool=n,i.tools.add(n),n}function w(o){const{view:t,tool:i}=o;null!=i&&(t.tools.remove(i),o.tool=null)}function y(i,e){const{userOperation:l}=i;return o((async o=>{if(l){const t=n(l.promise);l?.abort(),await t,r(o)}const e=u(i,{signal:o}),{analysis:s}=i,c=()=>!s.valid,v=t([m((()=>i.tool),"cancel",(()=>{c()&&e.abort()}))]);try{i.tool?.resetCreated(),await e.promise}catch(f){if(!a(f)||c())throw f}finally{v?.remove()}}),e)}export{u as activateAnalysisViewTool,v as connectAnalysisViewToTool,w as removeAnalysisViewTool,y as startExclusiveInteractiveOperation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import"../../core/has.js";import i from"../../core/Logger.js";import r from"../../core/Queue.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{primaryKey as o,isSystemModifier as a}from"./keys.js";import{LatestPointer as l}from"./handlers/LatestPointer.js";import{MultiTouch as h}from"./handlers/MultiTouch.js";import{PropertiesPool as p}from"../support/PropertiesPool.js";let d=class extends t{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=o,this._latestPointerType="mouse",this._propertiesPool=new p({latestPointerLocation:P},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some((e=>e.handler.hasPendingInputs))}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,t,i=_.INTERNAL){if(this._nameToGroup[e])return;if(0===t.length)return;const r={name:e,handlers:t.map((e=>({handler:e,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null})))};this._nameToGroup[e]=r;for(let n=r.handlers.length-1;n>=0;n--){const e=r.handlers[n];this._handlers.push(e),e.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(t,i,r,n,s)=>{this._emitInputEvent(e.priorityIndex+1,t,i,r,s,n)},setPointerCapture:(t,i)=>{this._setPointerCapture(r,e,t,i)},setEventCallback:t=>{e.eventCallback=t},setUninstallCallback:t=>{e.uninstallCallback=t},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach((e=>{e.removed=!0,e.uninstallCallback?.()})),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):i.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return void 0!==this._nameToGroup[e]}isModifierKeyDown(e){return this._activeKeyModifiers.has(e)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,t=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const e=this._handlers[i];e.priorityIndex=i,this._handlersPriority.push(e)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const r=this._handlersPriority[i];r.priorityIndex=i;let n=r.handler.hasSideEffects;if(!n)for(const t of r.handler.outgoingEventTypes)if(e.has(t)){n=!0;break}if(n)for(const i of r.handler.incomingEventMatches){e.add(i.eventType);for(const e of i.keyModifiers)a(e)||t.add(e)}r.active=n}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,t,i){this._latestPointerType=e;const r=this._get("latestPointerLocation");if(null==r||r.x!==t||r.y!==i){const e=this._propertiesPool.get("latestPointerLocation");e.x=t,e.y=i,this._set("latestPointerLocation",e)}}_onEventReceived(e,t){if("pointer-capture-lost"===e){const e=t;this._pointerCaptures.delete(e.native.pointerId)}this._updateKeyModifiers(e,t);const i=null!=this.test.timestamp?this.test.timestamp:t.native?t.native.timestamp:void 0,r=t.native?t.native.cancelable:void 0;this._emitInputEventFromSource(e,t,i,r)}_updateKeyModifiers(e,t){if(!t)return;let i=!1;const r=()=>{i||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),i=!0)},n=(e,t)=>{t&&!this._activeKeyModifiers.has(e)?(r(),this._activeKeyModifiers.add(e)):!t&&this._activeKeyModifiers.has(e)&&(r(),this._activeKeyModifiers.delete(e))};if("key-down"===e||"key-up"===e){const i=t.key;this._keyModifiers.has(i)&&n(i,"key-down"===e)}const s=t.native;n("Alt",!!s?.altKey),n("Control",!!s?.ctrlKey),n("Ctrl",!!s?.ctrlKey),n("Shift",!!s?.shiftKey),n("Meta",!!s?.metaKey),n("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new l(((e,t,i)=>this._setLatestPointer(e,t,i))),this._multiTouchHandler=new h,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],_.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,_.INTERNAL)}_setPointerCapture(e,t,i,r){const n=e.name+"-"+t.priorityIndex,s=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,s),r?(s.add(n),1===s.size&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):s.has(n)&&(s.delete(n),0===s.size&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter((e=>!e.removed)),this.updateDependencies()}_emitInputEventFromSource(e,t,i,r){this._emitInputEvent(0,e,t,i,r)}_emitInputEvent(e,t,i,r,n,s){const o=void 0!==r?r:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),a=void 0!==n&&n,l={event:new u(t,i,o,s||this._activeKeyModifiers,a),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(l):this._doNewPropagation(l)}_doNewPropagation(e){this._currentPropagation={events:new r,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){this._paused=!1;const e=this._currentPropagation;if(e){for(;e.events.length>0;){const{event:t,priorityIndex:i}=e.events.pop(),r=t.data?.eventId;if(!(null!=r&&this._stoppedPropagationEventIds.has(r)))for(e.currentHandler=this._handlersPriority[i];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback?.(t),t.shouldStopPropagation()){null!=r&&this._stoppedPropagationEventIds.add(r);break}if(t.shouldPausePropagation((()=>this._continuePropagation())))return void this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){const t=new r;t.push(e);const i=this._currentPropagation;if(i){for(;i.events.length;)t.push(i.events.pop());i.events=t,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const i of e.handler.incomingEventMatches)for(const e of t.handler.incomingEventMatches){if(i.eventType!==e.eventType)continue;const t=i.keyModifiers.filter((t=>e.keyModifiers.includes(t)));if(t.length===i.keyModifiers.length!==(t.length===e.keyModifiers.length))return i.keyModifiers.length>e.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const i of e){let e=0;for(;e<t.length&&this._compareHandlerPriority(i,t[e])>=0;)e++;t.splice(e,0,i)}return t}get debug(){const e=e=>{const t=this._setPointerCapture;this._setPointerCapture=()=>{},e(),this._setPointerCapture=t};return{injectEvent:(t,i)=>{e((()=>this._onEventReceived(t,i)))},disablePointerCapture:e}}};e([n({readOnly:!0})],d.prototype,"hasPendingInputs",null),e([n({constructOnly:!0})],d.prototype,"eventSource",void 0),e([n({constructOnly:!0})],d.prototype,"recognizers",void 0),e([n()],d.prototype,"_latestPointerType",void 0),e([n()],d.prototype,"latestPointerType",null),e([n()],d.prototype,"multiTouchActive",null),e([n({readOnly:!0})],d.prototype,"latestPointerLocation",void 0),e([n()],d.prototype,"_paused",void 0),e([n({readOnly:!0})],d.prototype,"updating",null),d=e([s("esri.views.input.InputManager")],d);class u{constructor(e,t,i,r,n){this.type=e,this.data=t,this.timestamp=i,this.modifiers=r,this.cancelable=n,this._propagationState=c.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=c.STOPPED}shouldStopPropagation(){return!!(this._propagationState&c.STOPPED)}
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import"../../core/has.js";import i from"../../core/Logger.js";import r from"../../core/Queue.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{primaryKey as o,isSystemModifier as a}from"./keys.js";import{LatestPointer as l}from"./handlers/LatestPointer.js";import{MultiTouch as h}from"./handlers/MultiTouch.js";import{PropertiesPool as p}from"../support/PropertiesPool.js";let d=class extends t{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=o,this._latestPointerType="mouse",this._propertiesPool=new p({latestPointerLocation:P},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some((e=>e.handler.hasPendingInputs))}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,t,i=_.INTERNAL){if(this._nameToGroup[e])return;if(0===t.length)return;const r={name:e,handlers:t.map((e=>({handler:e,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null})))};this._nameToGroup[e]=r;for(let n=r.handlers.length-1;n>=0;n--){const e=r.handlers[n];this._handlers.push(e),e.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(t,i,r,n,s)=>{this._emitInputEvent(e.priorityIndex+1,t,i,r,s,n)},setPointerCapture:(t,i)=>{this._setPointerCapture(r,e,t,i)},setEventCallback:t=>{e.eventCallback=t},setUninstallCallback:t=>{e.uninstallCallback=t},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach((e=>{e.removed=!0,e.uninstallCallback?.()})),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):i.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return void 0!==this._nameToGroup[e]}isModifierKeyDown(e){return this._activeKeyModifiers.has(e)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,t=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const e=this._handlers[i];e.priorityIndex=i,this._handlersPriority.push(e)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const r=this._handlersPriority[i];r.priorityIndex=i;let n=r.handler.hasSideEffects;if(!n)for(const t of r.handler.outgoingEventTypes)if(e.has(t)){n=!0;break}if(n)for(const i of r.handler.incomingEventMatches){e.add(i.eventType);for(const e of i.keyModifiers)a(e)||t.add(e)}r.active=n}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,t,i){this._latestPointerType=e;const r=this._get("latestPointerLocation");if(null==r||r.x!==t||r.y!==i){const e=this._propertiesPool.get("latestPointerLocation");e.x=t,e.y=i,this._set("latestPointerLocation",e)}}_onEventReceived(e,t){if("pointer-capture-lost"===e){const e=t;this._pointerCaptures.delete(e.native.pointerId)}this._updateKeyModifiers(e,t);const i=null!=this.test.timestamp?this.test.timestamp:t.native?t.native.timestamp:void 0,r=t.native?t.native.cancelable:void 0;this._emitInputEventFromSource(e,t,i,r)}_updateKeyModifiers(e,t){if(!t)return;let i=!1;const r=()=>{i||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),i=!0)},n=(e,t)=>{t&&!this._activeKeyModifiers.has(e)?(r(),this._activeKeyModifiers.add(e)):!t&&this._activeKeyModifiers.has(e)&&(r(),this._activeKeyModifiers.delete(e))};if("key-down"===e||"key-up"===e){const i=t.key;this._keyModifiers.has(i)&&n(i,"key-down"===e)}const s=t.native;n("Alt",!!s?.altKey),n("Control",!!s?.ctrlKey),n("Ctrl",!!s?.ctrlKey),n("Shift",!!s?.shiftKey),n("Meta",!!s?.metaKey),n("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new l(((e,t,i)=>this._setLatestPointer(e,t,i))),this._multiTouchHandler=new h,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],_.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,_.INTERNAL)}_setPointerCapture(e,t,i,r){const n=e.name+"-"+t.priorityIndex,s=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,s),r?(s.add(n),1===s.size&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):s.has(n)&&(s.delete(n),0===s.size&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter((e=>!e.removed)),this.updateDependencies()}_emitInputEventFromSource(e,t,i,r){this._emitInputEvent(0,e,t,i,r)}_emitInputEvent(e,t,i,r,n,s){const o=void 0!==r?r:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),a=void 0!==n&&n,l={event:new u(t,i,o,s||this._activeKeyModifiers,a),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(l):this._doNewPropagation(l)}_doNewPropagation(e){this._currentPropagation={events:new r,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){this._paused=!1;const e=this._currentPropagation;if(e){for(;e.events.length>0;){const{event:t,priorityIndex:i}=e.events.pop(),r=t.data?.eventId;if(!(null!=r&&this._stoppedPropagationEventIds.has(r)))for(e.currentHandler=this._handlersPriority[i];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback?.(t),t.shouldStopPropagation()){null!=r&&this._stoppedPropagationEventIds.add(r);break}if(t.shouldPausePropagation((()=>this._continuePropagation())))return void this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){const t=new r;t.push(e);const i=this._currentPropagation;if(i){for(;i.events.length;)t.push(i.events.pop());i.events=t,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const i of e.handler.incomingEventMatches)for(const e of t.handler.incomingEventMatches){if(i.eventType!==e.eventType)continue;const t=i.keyModifiers.filter((t=>e.keyModifiers.includes(t)));if(t.length===i.keyModifiers.length!==(t.length===e.keyModifiers.length))return i.keyModifiers.length>e.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const i of e){let e=0;for(;e<t.length&&this._compareHandlerPriority(i,t[e])>=0;)e++;t.splice(e,0,i)}return t}get debug(){const e=e=>{const t=this._setPointerCapture;this._setPointerCapture=()=>{},e(),this._setPointerCapture=t};return{injectEvent:(t,i)=>{e((()=>this._onEventReceived(t,i)))},disablePointerCapture:e}}};e([n({readOnly:!0})],d.prototype,"hasPendingInputs",null),e([n({constructOnly:!0})],d.prototype,"eventSource",void 0),e([n({constructOnly:!0})],d.prototype,"recognizers",void 0),e([n()],d.prototype,"_latestPointerType",void 0),e([n()],d.prototype,"latestPointerType",null),e([n()],d.prototype,"multiTouchActive",null),e([n({readOnly:!0})],d.prototype,"latestPointerLocation",void 0),e([n()],d.prototype,"_paused",void 0),e([n({readOnly:!0})],d.prototype,"updating",null),d=e([s("esri.views.input.InputManager")],d);class u{constructor(e,t,i,r,n){this.type=e,this.data=t,this.timestamp=i,this.modifiers=r,this.cancelable=n,this._propagationState=c.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=c.STOPPED}shouldStopPropagation(){return!!(this._propagationState&c.STOPPED)}defer(e){this._propagationState|=c.PAUSED;const t=(e,t)=>{this._propagationState&=~c.PAUSED;const i=this._resumeCallback;if(this._resumeCallback=null,i&&i(),t)throw e;return e};return("function"==typeof e?e():e).then((e=>t(e,!1)),(e=>t(e,!0)))}shouldPausePropagation(e){return!!(this._propagationState&c.PAUSED)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}}var c;!function(e){e[e.NONE=0]="NONE",e[e.STOPPED=1]="STOPPED",e[e.PAUSED=2]="PAUSED"}(c||(c={}));const _={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};class g{}const P=g;export{d as InputManager,_ as ViewEventPriorities};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../core/has.js";import{makeHandle as
|
|
5
|
+
import"../../core/has.js";import{makeHandle as e}from"../../core/handleUtils.js";import{rad2deg as t}from"../../core/mathUtils.js";import{createScreenPoint as n}from"../../core/screenUtils.js";import{InputHandler as a}from"./InputHandler.js";import{ViewEventPriorities as r}from"./InputManager.js";export{MouseButton}from"./IViewEvents.js";const i=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],o={};function s(e){return!!o[e]}function p(e){for(const t of e)if(!s(t))return!1;return!0}i.forEach((e=>{o[e]=!0}));class c{constructor(e){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=e,this.inputManager=null}connect(e){e&&this.disconnect(),this.inputManager=e,this._handlers.forEach((({handler:e,priority:t},n)=>this.inputManager?.installHandlers(n,[e],t)))}disconnect(){this.inputManager&&this._handlers.forEach(((e,t)=>this.inputManager?.uninstallHandlers(t))),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(t,n,a,i){const o=Array.isArray(t)?t:t.split(",");if(!p(o))return o.some(s)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let c,u;Array.isArray(n)?u=n:(c=n,u=[]),"function"==typeof a?c=a:i=a,i=null!=i?i:r.DEFAULT;const d=this._createUniqueGroupName(),m=new l(this.view,o,u,c);this._handlers.set(d,{handler:m,priority:i});for(const e of o){const t=this._handlerCounts.get(e)||0;this._handlerCounts.set(e,t+1)}return this.inputManager&&this.inputManager.installHandlers(d,[m],i),e((()=>this._removeHandler(d,o)))}hasHandler(e){return!!this._handlerCounts.get(e)}_removeHandler(e,t){if(this._handlers.has(e)){this._handlers.delete(e);for(const e of t){const t=this._handlerCounts.get(e);void 0===t||(1===t?this._handlerCounts.delete(e):this._handlerCounts.set(e,t-1))}}this.inputManager&&this.inputManager.uninstallHandlers(e)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}}class l extends a{constructor(e,t,n,a){super(!0),this._latestDragStart=void 0,this.view=e;for(const r of t)switch(r){case"click":this.registerIncoming("click",n,(t=>a(m(e,t))));break;case"double-click":this.registerIncoming("double-click",n,(t=>a(g(e,t))));break;case"immediate-click":this.registerIncoming("immediate-click",n,(t=>a(f(e,t))));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",n,(t=>a(v(e,t))));break;case"hold":this.registerIncoming("hold",n,(t=>a(h(e,t))));break;case"drag":this.registerIncoming("drag",n,(e=>{const t=this._wrapDrag(e);t&&a(t)}));break;case"key-down":this.registerIncoming("key-down",n,(e=>a(y(e))));break;case"key-up":this.registerIncoming("key-up",n,(e=>a(k(e))));break;case"pointer-down":this.registerIncoming("pointer-down",n,(e=>a(I(e,"pointer-down"))));break;case"pointer-move":this.registerIncoming("pointer-move",n,(e=>a(I(e,"pointer-move"))));break;case"pointer-up":this.registerIncoming("pointer-up",n,(e=>a(I(e,"pointer-up"))));break;case"pointer-drag":this.registerIncoming("pointer-drag",n,(e=>a(D(e))));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",n,(e=>a(P(e))));break;case"pointer-enter":this.registerIncoming("pointer-enter",n,(e=>a(I(e,"pointer-enter"))));break;case"pointer-leave":this.registerIncoming("pointer-leave",n,(e=>a(I(e,"pointer-leave"))));break;case"gamepad":this.registerIncoming("gamepad",n,(e=>{a(_(e))}));break;case"focus":this.registerIncoming("focus",n,(e=>{a(u(e))}));break;case"blur":this.registerIncoming("blur",n,(e=>{a(d(e))}))}}_wrapDrag(e){const n=e.data,{x:a,y:r}=n.center,{action:i,pointerType:o,button:s}=n;if("start"===i&&(this._latestDragStart=n),!this._latestDragStart)return;const p=n.pointer.native,c=n.buttons,{cancelable:l,timestamp:u}=e,d={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return"end"===i&&(this._latestDragStart=void 0),{type:"drag",action:i,x:a,y:r,origin:d,pointerType:o,button:s,buttons:c,radius:n.radius,angle:t(n.angle),native:p,timestamp:u,cancelable:l,stopPropagation:()=>e.stopPropagation(),defer:t=>e.defer(t),preventDefault:()=>e.preventDefault()}}}function u(e){return{type:"focus",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),defer:t=>e.defer(t),preventDefault:()=>e.preventDefault()}}function d(e){return{type:"blur",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),defer:t=>e.defer(t),preventDefault:()=>e.preventDefault()}}function m(e,t){const{pointerType:a,button:r,buttons:i,x:o,y:s,native:p,eventId:c}=t.data,{cancelable:l,timestamp:u}=t;return{type:"click",pointerType:a,button:r,buttons:i,x:o,y:s,native:p,timestamp:u,screenPoint:n(o,s),mapPoint:b(e,o,s),eventId:c,cancelable:l,stopPropagation:()=>t.stopPropagation(),defer:e=>t.defer(e),preventDefault:()=>t.preventDefault()}}function g(e,t){const{pointerType:n,button:a,buttons:r,x:i,y:o,native:s,eventId:p}=t.data,{cancelable:c,timestamp:l}=t;return{type:"double-click",pointerType:n,button:a,buttons:r,x:i,y:o,native:s,timestamp:l,mapPoint:b(e,i,o),eventId:p,cancelable:c,stopPropagation:()=>t.stopPropagation(),defer:e=>t.defer(e),preventDefault:()=>t.preventDefault()}}function f(e,t){const{pointerType:n,button:a,buttons:r,x:i,y:o,native:s,eventId:p}=t.data,c=s.pointerId,{cancelable:l,timestamp:u}=t;return{type:"immediate-click",pointerId:c,pointerType:n,button:a,buttons:r,x:i,y:o,native:s,timestamp:u,mapPoint:b(e,i,o),eventId:p,cancelable:l,stopPropagation:()=>t.stopPropagation(),defer:e=>t.defer(e),preventDefault:()=>t.preventDefault()}}function v(e,t){const{pointerType:n,button:a,buttons:r,x:i,y:o,native:s,eventId:p}=t.data,c=s.pointerId,{cancelable:l,timestamp:u}=t;return{type:"immediate-double-click",pointerId:c,pointerType:n,button:a,buttons:r,x:i,y:o,native:s,timestamp:u,mapPoint:b(e,i,o),eventId:p,cancelable:l,stopPropagation:()=>t.stopPropagation(),defer:e=>t.defer(e),preventDefault:()=>t.preventDefault()}}function h(e,t){const{pointerType:n,button:a,buttons:r,x:i,y:o,native:s}=t.data,{cancelable:p,timestamp:c}=t;return{type:"hold",pointerType:n,button:a,buttons:r,x:i,y:o,native:s,timestamp:c,mapPoint:b(e,i,o),cancelable:p,stopPropagation:()=>t.stopPropagation(),defer:e=>t.defer(e),preventDefault:()=>t.preventDefault()}}function b(e,t,a){return e.toMap(n(t,a),{exclude:[]})}function y(e){const{key:t,repeat:n,native:a}=e.data,{cancelable:r,timestamp:i}=e;return{type:"key-down",key:t,repeat:n,native:a,timestamp:i,cancelable:r,stopPropagation:()=>e.stopPropagation(),defer:t=>e.defer(t),preventDefault:()=>e.preventDefault()}}function k(e){const{key:t,native:n}=e.data,{cancelable:a,timestamp:r}=e;return{type:"key-up",key:t,native:n,timestamp:r,cancelable:a,stopPropagation:()=>e.stopPropagation(),defer:t=>e.defer(t),preventDefault:()=>e.preventDefault()}}function I(e,t){const{x:n,y:a,button:r,buttons:i,native:o,eventId:s}=e.data,p=o.pointerId,c=o.pointerType,{cancelable:l,timestamp:u}=e;return{type:t,x:n,y:a,pointerId:p,pointerType:c,button:r,buttons:i,native:o,timestamp:u,eventId:s,cancelable:l,stopPropagation:()=>e.stopPropagation(),defer:t=>e.defer(t),preventDefault:()=>e.preventDefault()}}function D(e){const{x:t,y:n,buttons:a,native:r,eventId:i}=e.data.currentEvent,{button:o}=e.data.startEvent,s=e.data.startEvent.native.pointerId,p=e.data.startEvent.native.pointerType,c=e.data.action,l={x:e.data.startEvent.x,y:e.data.startEvent.y},{cancelable:u,timestamp:d}=e;return{type:"pointer-drag",x:t,y:n,pointerId:s,pointerType:p,button:o,buttons:a,action:c,origin:l,native:r,timestamp:d,eventId:i,cancelable:u,stopPropagation:()=>e.stopPropagation(),defer:t=>e.defer(t),preventDefault:()=>e.preventDefault()}}function P(e){const{cancelable:t,data:n,timestamp:a}=e,{x:r,y:i,deltaY:o,native:s}=n;return{type:"mouse-wheel",x:r,y:i,deltaY:o,native:s,timestamp:a,cancelable:t,stopPropagation:()=>e.stopPropagation(),defer:t=>e.defer(t),preventDefault:()=>e.preventDefault()}}function _(e){const{action:t,state:n,device:a}=e.data,{cancelable:r,timestamp:i}=e,{buttons:o,axes:s}=n;return{type:"gamepad",device:a,timestamp:i,action:t,buttons:o,axes:s,cancelable:r,stopPropagation:()=>e.stopPropagation(),defer:t=>e.defer(t),preventDefault:()=>e.preventDefault()}}export{c as ViewEvents,i as eventTypes};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function e(e){return
|
|
5
|
+
function e(e){return!(null==e||"object"!=typeof e||!("createQuery"in e)||!e.createQuery)}export{e as isSelectableLayer};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
var e;!function(e){e[e.TextureDescriptor=0]="TextureDescriptor",e[e.Texture=1]="Texture",e[e.Renderbuffer=2]="Renderbuffer"}(e||(e={}));export{e as FBOAttachmentType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../core/has.js";import t from"../../core/Logger.js";import{disposeMaybe as e}from"../../core/maybe.js";import{BufferObject as r}from"./BufferObject.js";import{webglDebugEnabled as i}from"./checkWebGLError.js";import{ResourceType as s,ColorAttachment0 as n,TextureType as h,FramebufferTarget as o,UnsizedDepthFormat as c,PixelType as a,Usage as u,BufferType as f,SizedStencilFormat as l,StencilAttachment as _,SizedDepthStencilFormat as d,DepthStencilAttachment as m,SizedDepthFormat as T,DepthAttachment as p}from"./enums.js";import{GLObjectType as E}from"./GLObjectType.js";import{Renderbuffer as x}from"./Renderbuffer.js";import{Texture as b}from"./Texture.js";const g=()=>t.getLogger("esri.views.webgl.FramebufferObject");class R{constructor(t,e,r){if(this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(s.FramebufferObject,this),null!=e){const r=F(e)?e:new b(t,e);this._colorAttachments.set(n,r),this._validateTextureDescriptor(r.descriptor),this._validateColorAttachmentPoint(n)}if(null!=r)if(S(r))this._depthStencilTexture=F(r)?r:new b(t,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=A(r)?r:new x(t,r);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}dispose(){const{_colorAttachments:t,_glName:e}=this;if(0===t.size&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!e)return;const{_context:r}=this;r.temporaryBindFramebufferObject(null,(()=>{this._colorAttachments.forEach(((t,e)=>this.detachColorTexture(e)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),e&&(r.gl.deleteFramebuffer(e),this._glName=null)})),r.instanceCounter.decrement(s.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(n)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(n);return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(n);return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce(((t,[e,r])=>t+r.usedMemory),this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&F(e)?e:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(t,e=n){if(!t)return;this._validateColorAttachmentPoint(e);const r=t.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(e)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=n){const e=this._colorAttachments.get(t);if(e)return this._initialized&&this._context.temporaryBindFramebufferObject(this,(()=>{this._framebufferTexture2D(null,t)})),this._colorAttachments.delete(t),e}setColorTextureTarget(t,e=n,r=0){const i=this._colorAttachments.get(e);i&&(t===h.TEXTURE_2D_ARRAY?this._framebufferTextureLayer(i.glName,e,o.FRAMEBUFFER,0,r):this._framebufferTexture2D(i.glName,e,t,o.FRAMEBUFFER,0))}attachDepthStencil(t){if(t)switch(t.type){case E.Texture:return this._attachDepthStencilTexture(t);case E.Renderbuffer:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:r,dataType:i}=e;r===c.DEPTH_STENCIL||r===c.DEPTH_COMPONENT?r!==c.DEPTH_STENCIL||i===a.UNSIGNED_INT_24_8?r!==c.DEPTH_COMPONENT||i===a.UNSIGNED_INT||i===a.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,U(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&this._context.temporaryBindFramebufferObject(this,(()=>{this._framebufferTexture2D(null,U(t.descriptor.pixelFormat))})),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(e);r.framebufferRenderbuffer(o.FRAMEBUFFER,i,r.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){const{_context:e}=this,r=e.getBoundFramebufferObject();e.bindFramebuffer(this);const{gl:i}=e,s=this._getGLAttachmentPoint(t.descriptor);i.framebufferRenderbuffer(o.FRAMEBUFFER,s,i.RENDERBUFFER,null),e.bindFramebuffer(r)}return this._depthStencilBuffer=null,t}invalidateAttachments(t,e=!1){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this,e),this._context.gl.invalidateFramebuffer(o.FRAMEBUFFER,t),this._context.bindFramebuffer(r)}copyToTexture(t,e,r,i,s,n,o){(t<0||e<0||s<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const c=o.descriptor;o.descriptor.target!==h.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==c?.width||null==c?.height||t+r>this.width||e+i>this.height||s+r>c.width||n+i>c.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const a=this._context,u=a.bindTexture(o,b.TEXTURE_UNIT_FOR_UPDATES);a.setActiveTexture(b.TEXTURE_UNIT_FOR_UPDATES),a.bindFramebuffer(this),a.gl.copyTexSubImage2D(h.TEXTURE_2D,0,s,n,t,e,r,i),a.bindTexture(u,b.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,r,i,s,n,h){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,r,i,s,n,h)}async readPixelsAsync(t,e,i,s,n,h,o){const{gl:c}=this._context,a=r.createPixelPack(this._context,u.STREAM_READ,o.byteLength);this._context.bindBuffer(a);const l=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),c.readPixels(t,e,i,s,n,h,0),this._context.unbindBuffer(f.PIXEL_PACK_BUFFER),this._context.bindFramebuffer(l),await a.getSubDataAsync(o),a.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const r={width:t,height:e};N(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((t=>t.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(N(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(t=o.FRAMEBUFFER){const{gl:e}=this._context;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const r=e.createFramebuffer();if(e.bindFramebuffer(t,r),this._colorAttachments.forEach(((e,r)=>{const i=B(e);i===h.TEXTURE_2D_ARRAY?this._framebufferTextureLayer(e.glName,r,t,0,0):this._framebufferTexture2D(e.glName,r,i,t)})),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,r,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=U(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,B(this._depthStencilTexture),t)}if(i()){e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}this._glName=r,this._initialized=!0}_framebufferTexture2D(t,e=n,r=h.TEXTURE_2D,i=o.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(i,e,r,t,s)}_framebufferTextureLayer(t,e=n,r=o.FRAMEBUFFER,i=0,s=0){this._context.gl.framebufferTextureLayer(r,e,t,i,s)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(o.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=e(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,U(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=e(this._depthStencilTexture))}_validateTextureDescriptor(t){t.target!==h.TEXTURE_2D&&t.target!==h.TEXTURE_CUBE_MAP&&t.target!==h.TEXTURE_2D_ARRAY&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),N(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){N(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case T.DEPTH_COMPONENT16:case T.DEPTH_COMPONENT24:case T.DEPTH_COMPONENT32F:return p;case d.DEPTH24_STENCIL8:case d.DEPTH32F_STENCIL8:return m;case l.STENCIL_INDEX8:return _}}_validateColorAttachmentPoint(e){if(-1===R._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;R._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const r=e-n;r+1>R._MAX_COLOR_ATTACHMENTS&&t.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${r+1}. Implementation supports up to ${R._MAX_COLOR_ATTACHMENTS} color attachments`)}}function F(t){return null!=t&&"type"in t&&t.type===E.Texture}function A(t){return null!=t&&"type"in t&&t.type===E.Renderbuffer}function S(t){return F(t)||D(t)}function D(t){return null!=t&&"objectType"in t&&t.objectType===E.Texture}function N(t,e){const r=Math.max(t.width,t.height);if(r>e){g().warn(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const i=e/r;return t.width=Math.round(t.width*i),t.height=Math.round(t.height*i),!1}return!0}function B(t){return t.descriptor.target===h.TEXTURE_CUBE_MAP?h.TEXTURE_CUBE_MAP_POSITIVE_X:t.descriptor.target===h.TEXTURE_2D_ARRAY?h.TEXTURE_2D_ARRAY:h.TEXTURE_2D}function U(t){return t===c.DEPTH_COMPONENT?p:m}export{R as FramebufferObject,N as ensureAttachmentMaxSize};
|
|
5
|
+
import"../../core/has.js";import t from"../../core/Logger.js";import{disposeMaybe as e}from"../../core/maybe.js";import{BufferObject as r}from"./BufferObject.js";import{webglDebugEnabled as i}from"./checkWebGLError.js";import{ResourceType as s,ColorAttachment0 as n,TextureType as h,FramebufferTarget as o,UnsizedDepthFormat as c,PixelType as a,Usage as u,BufferType as f,SizedStencilFormat as l,StencilAttachment as _,SizedDepthStencilFormat as d,DepthStencilAttachment as m,SizedDepthFormat as T,DepthAttachment as p}from"./enums.js";import{FBOAttachmentType as E}from"./FBOAttachmentType.js";import{Renderbuffer as x}from"./Renderbuffer.js";import{Texture as b}from"./Texture.js";const g=()=>t.getLogger("esri.views.webgl.FramebufferObject");class R{constructor(t,e,r){if(this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(s.FramebufferObject,this),null!=e){const r=F(e)?e:new b(t,e);this._colorAttachments.set(n,r),this._validateTextureDescriptor(r.descriptor),this._validateColorAttachmentPoint(n)}if(null!=r)if(S(r))this._depthStencilTexture=F(r)?r:new b(t,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=A(r)?r:new x(t,r);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}dispose(){const{_colorAttachments:t,_glName:e}=this;if(0===t.size&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!e)return;const{_context:r}=this;r.temporaryBindFramebufferObject(null,(()=>{this._colorAttachments.forEach(((t,e)=>this.detachColorTexture(e)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),e&&(r.gl.deleteFramebuffer(e),this._glName=null)})),r.instanceCounter.decrement(s.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(n)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(n);return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(n);return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce(((t,[e,r])=>t+r.usedMemory),this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&F(e)?e:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(t,e=n){if(!t)return;this._validateColorAttachmentPoint(e);const r=t.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(e)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=n){const e=this._colorAttachments.get(t);if(e)return this._initialized&&this._context.temporaryBindFramebufferObject(this,(()=>{this._framebufferTexture2D(null,t)})),this._colorAttachments.delete(t),e}setColorTextureTarget(t,e=n,r=0){const i=this._colorAttachments.get(e);i&&(t===h.TEXTURE_2D_ARRAY?this._framebufferTextureLayer(i.glName,e,o.FRAMEBUFFER,0,r):this._framebufferTexture2D(i.glName,e,t,o.FRAMEBUFFER,0))}attachDepthStencil(t){if(t)switch(t.type){case E.Texture:return this._attachDepthStencilTexture(t);case E.Renderbuffer:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:r,dataType:i}=e;r===c.DEPTH_STENCIL||r===c.DEPTH_COMPONENT?r!==c.DEPTH_STENCIL||i===a.UNSIGNED_INT_24_8?r!==c.DEPTH_COMPONENT||i===a.UNSIGNED_INT||i===a.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,O(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&this._context.temporaryBindFramebufferObject(this,(()=>{this._framebufferTexture2D(null,O(t.descriptor.pixelFormat))})),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(e);r.framebufferRenderbuffer(o.FRAMEBUFFER,i,r.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){const{_context:e}=this,r=e.getBoundFramebufferObject();e.bindFramebuffer(this);const{gl:i}=e,s=this._getGLAttachmentPoint(t.descriptor);i.framebufferRenderbuffer(o.FRAMEBUFFER,s,i.RENDERBUFFER,null),e.bindFramebuffer(r)}return this._depthStencilBuffer=null,t}invalidateAttachments(t,e=!1){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this,e),this._context.gl.invalidateFramebuffer(o.FRAMEBUFFER,t),this._context.bindFramebuffer(r)}copyToTexture(t,e,r,i,s,n,o){(t<0||e<0||s<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const c=o.descriptor;o.descriptor.target!==h.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==c?.width||null==c?.height||t+r>this.width||e+i>this.height||s+r>c.width||n+i>c.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const a=this._context,u=a.bindTexture(o,b.TEXTURE_UNIT_FOR_UPDATES);a.setActiveTexture(b.TEXTURE_UNIT_FOR_UPDATES),a.bindFramebuffer(this),a.gl.copyTexSubImage2D(h.TEXTURE_2D,0,s,n,t,e,r,i),a.bindTexture(u,b.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,r,i,s,n,h){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,r,i,s,n,h)}async readPixelsAsync(t,e,i,s,n,h,o){const{gl:c}=this._context,a=r.createPixelPack(this._context,u.STREAM_READ,o.byteLength);this._context.bindBuffer(a);const l=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),c.readPixels(t,e,i,s,n,h,0),this._context.unbindBuffer(f.PIXEL_PACK_BUFFER),this._context.bindFramebuffer(l),await a.getSubDataAsync(o),a.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const r={width:t,height:e};B(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((t=>t.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(B(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(t=o.FRAMEBUFFER){const{gl:e}=this._context;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const r=e.createFramebuffer();if(e.bindFramebuffer(t,r),this._colorAttachments.forEach(((e,r)=>{const i=U(e);i===h.TEXTURE_2D_ARRAY?this._framebufferTextureLayer(e.glName,r,t,0,0):this._framebufferTexture2D(e.glName,r,i,t)})),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,r,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=O(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,U(this._depthStencilTexture),t)}if(i()){e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}this._glName=r,this._initialized=!0}_framebufferTexture2D(t,e=n,r=h.TEXTURE_2D,i=o.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(i,e,r,t,s)}_framebufferTextureLayer(t,e=n,r=o.FRAMEBUFFER,i=0,s=0){this._context.gl.framebufferTextureLayer(r,e,t,i,s)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(o.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=e(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,O(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=e(this._depthStencilTexture))}_validateTextureDescriptor(t){t.target!==h.TEXTURE_2D&&t.target!==h.TEXTURE_CUBE_MAP&&t.target!==h.TEXTURE_2D_ARRAY&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),B(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){B(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case T.DEPTH_COMPONENT16:case T.DEPTH_COMPONENT24:case T.DEPTH_COMPONENT32F:return p;case d.DEPTH24_STENCIL8:case d.DEPTH32F_STENCIL8:return m;case l.STENCIL_INDEX8:return _}}_validateColorAttachmentPoint(e){if(-1===R._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;R._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const r=e-n;r+1>R._MAX_COLOR_ATTACHMENTS&&t.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${r+1}. Implementation supports up to ${R._MAX_COLOR_ATTACHMENTS} color attachments`)}}function F(t){return N(t)===E.Texture}function A(t){return N(t)===E.Renderbuffer}function S(t){return F(t)||D(t)}function D(t){return N(t)===E.TextureDescriptor}function N(t){return null!=t&&"type"in t?t.type:null}function B(t,e){const r=Math.max(t.width,t.height);if(r>e){g().warn(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const i=e/r;return t.width=Math.round(t.width*i),t.height=Math.round(t.height*i),!1}return!0}function U(t){return t.descriptor.target===h.TEXTURE_CUBE_MAP?h.TEXTURE_CUBE_MAP_POSITIVE_X:t.descriptor.target===h.TEXTURE_2D_ARRAY?h.TEXTURE_2D_ARRAY:h.TEXTURE_2D}function O(t){return t===c.DEPTH_COMPONENT?p:m}export{R as FramebufferObject,B as ensureAttachmentMaxSize};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ResourceType as e}from"./enums.js";import{
|
|
5
|
+
import{ResourceType as e}from"./enums.js";import{FBOAttachmentType as t}from"./FBOAttachmentType.js";import{estimateMemory as r}from"./RenderbufferDescriptor.js";class s{constructor(r,s){this._context=r,this._descriptor=s,this.type=t.Renderbuffer,this._context.instanceCounter.increment(e.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:n,height:o,internalFormat:h,multisampled:d}=s;d?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,h,n,o):i.renderbufferStorage(i.RENDERBUFFER,h,n,o),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return r(this._descriptor)}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const s=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?s.renderbufferStorageMultisample(s.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):s.renderbufferStorage(s.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(e.Renderbuffer,this),this._context=null)}}export{s as Renderbuffer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{getBytesPerElementFormat as t}from"./Util.js";class i{constructor(t,i=0,h=i){this.internalFormat=t,this.width=i,this.height=h,this.multisampled=!1,this.samples=1}}function h(i){return i.width<=0||i.height<=0||null==i.internalFormat?0:i.width*i.height*t(i.internalFormat)}export{i as RenderbufferDescriptor,h as estimateMemory};
|
package/views/webgl/Texture.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../core/Error.js";import"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{checkWebGLError as s}from"./checkWebGLError.js";import{TextureType as o,ResourceType as a,CompressedTextureFormat as n,TextureSamplingMode as p,TextureConstants as l}from"./enums.js";import{GLObjectType as m}from"./GLObjectType.js";import{estimateMemory as h}from"./TextureDescriptor.js";import{isCompressedData as d,deriveInternalFormat as c,isTexImageSource as _,is3DTarget as u,validateTexture as g,isCompressedFormat as x,getDimensions as T,calcMipmapLevels as E,isSizedPixelFormat as M,isSizedDepthFormat as A,isSizedDepthStencilFormat as f}from"./textureUtils.js";import{ValidatedTextureDescriptor as I}from"./ValidatedTextureDescriptor.js";const b=null,w=()=>e.getLogger("esri/views/webgl/Texture");let D=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=m.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const r=I.validate(e,i);if(!r)throw new t("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return h(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController}dispose(){this.abortCompression(),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.instanceCounter.decrement(a.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t,e){this._descriptor.compressionHandle=t,this._descriptor.compressionCallback=e}disableCompression(){this._descriptor.compressionHandle=null,this._descriptor.compressionCallback=null}setData(t){this.abortCompression(),!d(t)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in n&&(this._descriptor.internalFormat=void 0),this._setData(t),!d(t)&&this._descriptor.compressionHandle&&this._compressOnWorker(t)}updateData(i,r,s,o,a,n,p=0){n||w().error("An attempt to use uninitialized data!"),this._glName||w().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=c(l);const{context:m,pixelFormat:h,dataType:u,target:g,isImmutable:x}=l;if(x&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");const T=m.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||s<0||r+o>l.width||s+a>l.height)&&w().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:E}=m;p&&(o&&a||w().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),E.pixelStorei(E.UNPACK_SKIP_ROWS,p)),_(n)?E.texSubImage2D(g,i,r,s,o,a,h,u,n):d(n)?E.compressedTexSubImage2D(g,i,r,s,o,a,l.internalFormat,n.levels[i]):E.texSubImage2D(g,i,r,s,o,a,h,u,n),p&&E.pixelStorei(E.UNPACK_SKIP_ROWS,0),m.bindTexture(T,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(i,r,s,o,a,n,p,l){l||w().error("An attempt to use uninitialized data!"),this._glName||w().error("An attempt to update an uninitialized texture!");const m=this._descriptor;m.internalFormat=c(m);const{context:h,pixelFormat:_,dataType:g,isImmutable:x,target:T}=m;if(x&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");u(T)||w().warn("Attempting to set 3D texture data on a non-3D texture");const E=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||s<0||o<0||r+a>m.width||s+n>m.height||o+p>m.depth)&&w().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=h;if(d(l))l=l.levels[i],M.compressedTexSubImage3D(T,i,r,s,o,a,n,p,m.internalFormat,l);else{const t=l;M.texSubImage3D(T,i,r,s,o,a,n,p,_,g,t)}h.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const i=this._descriptor;if(0===i.width||0===i.height)return;if(!i.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");i.hasMipmap=!0,this._samplingModeDirty=!0,g(i)}i.samplingMode===p.LINEAR?(this._samplingModeDirty=!0,i.samplingMode=p.LINEAR_MIPMAP_NEAREST):i.samplingMode===p.NEAREST&&(this._samplingModeDirty=!0,i.samplingMode=p.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(i.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,g(e)}e.samplingMode===p.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=p.LINEAR):e.samplingMode===p.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=p.NEAREST)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,g(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController=i(this._compressionAbortController))}_setData(i,r){const o=this._descriptor,n=o.context?.gl;if(!n)return;s(n),this._glName||(this._glName=n.createTexture(),o.context.instanceCounter.increment(a.Texture,this)),g(o);const p=o.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);o.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),s(n);const l=r??o.target,m=u(l);if(_(i))this._setDataFromTexImageSource(i,l);else{const{width:e,height:r,depth:a}=o;if(null==e||null==r)throw new t("texture:missing-size","Width and height must be specified!");if(m&&null==a)throw new t("texture:missing-depth","Depth must be specified!");if(o.internalFormat=c(o),o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,o.internalFormat,o.hasMipmap,e,r,a),d(i)){if(!x(o.internalFormat))throw new t("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(i,o.internalFormat,l)}else this._texImage(l,0,o.internalFormat,e,r,a,i),s(n),o.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),s(n),o.context.bindTexture(p,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=o.TEXTURE_CUBE_MAP_POSITIVE_X;e<=o.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=c(r);const o=u(e),{width:a,height:n,depth:p}=T(t);r.width&&r.height,r.width||(r.width=a),r.height||(r.height=n),o&&r.depth,o&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,a,n,p),this._texImage(e,0,r.internalFormat,a,n,p,t),s(i),r.hasMipmap&&(this.generateMipmap(),s(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=E(i,s,o,a),m=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,l.MAX_LEVEL,m),this._forEachMipmapLevel(((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)}),m)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!M(i)&&!A(i)&&!f(i))throw new t("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?E(e,s,o,a):1;if(u(e)){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=u(e),{isImmutable:m,pixelFormat:h,dataType:d}=this._descriptor;if(m){if(null!=n){const r=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,h,d,r)}else p.texSubImage2D(e,i,0,0,s,o,h,d,r)}}else{const m=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,h,d,m)}else p.texImage2D(e,i,r,s,o,0,h,d,m)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=u(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){if(!e.compressionWorkerHandle||!e.compressionWorkerHandle.isCompressible(t))return;const i=!!this._descriptor.context.capabilities.compressedTextureETC,s=!!this._descriptor.context.capabilities.compressedTextureS3TC;if(i||s){const o=new AbortController;this._compressionAbortController=o;const a=this._descriptor.compressionHandle;a.increment();const n=this._descriptor.compressionCallback,p={data:await createImageBitmap(t,{imageOrientation:this.descriptor.flipped?"flipY":"none"}),width:t.width,height:t.height,premultiplyAlpha:this._descriptor.preMultiplyAlpha,hasMipmap:this._descriptor.hasMipmap,hasETC:!!i,hasS3TC:!!s};e.compressionWorkerHandle.invoke(p,this._compressionAbortController.signal).then((t=>{t&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=t.internalFormat,this._setData(t.compressedTexture),n?.()),o===this._compressionAbortController&&(this._compressionAbortController=null),a.decrement()})).catch((t=>{r(t)||o!==this._compressionAbortController||(this._compressionAbortController=null),a.decrement()}))}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:a,hasMipmap:n,target:p}=this._descriptor;const l=p===o.TEXTURE_3D;if(null==r||null==s||l&&null==a)throw new t("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,a),n&&(1!==r||1!==s||l&&1!==a)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),l&&(a=Math.max(1,a>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;i===p.LINEAR_MIPMAP_NEAREST||i===p.LINEAR_MIPMAP_LINEAR?(i=p.LINEAR,t.hasMipmap||(r=p.LINEAR)):i!==p.NEAREST_MIPMAP_NEAREST&&i!==p.NEAREST_MIPMAP_LINEAR||(i=p.NEAREST,t.hasMipmap||(r=p.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};export{D as Texture,b as tracer};
|
|
5
|
+
import t from"../../core/Error.js";import"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{checkWebGLError as s}from"./checkWebGLError.js";import{TextureType as o,ResourceType as a,CompressedTextureFormat as n,TextureSamplingMode as p,TextureConstants as l}from"./enums.js";import{FBOAttachmentType as m}from"./FBOAttachmentType.js";import{estimateMemory as h}from"./TextureDescriptor.js";import{isCompressedData as d,deriveInternalFormat as c,isTexImageSource as _,is3DTarget as u,validateTexture as g,isCompressedFormat as x,getDimensions as T,calcMipmapLevels as E,isSizedPixelFormat as M,isSizedDepthFormat as A,isSizedDepthStencilFormat as f}from"./textureUtils.js";import{ValidatedTextureDescriptor as I}from"./ValidatedTextureDescriptor.js";const b=null,w=()=>e.getLogger("esri/views/webgl/Texture");let D=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=m.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const r=I.validate(e,i);if(!r)throw new t("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return h(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController}dispose(){this.abortCompression(),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.instanceCounter.decrement(a.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t,e){this._descriptor.compressionHandle=t,this._descriptor.compressionCallback=e}disableCompression(){this._descriptor.compressionHandle=null,this._descriptor.compressionCallback=null}setData(t){this.abortCompression(),!d(t)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in n&&(this._descriptor.internalFormat=void 0),this._setData(t),!d(t)&&this._descriptor.compressionHandle&&this._compressOnWorker(t)}updateData(i,r,s,o,a,n,p=0){n||w().error("An attempt to use uninitialized data!"),this._glName||w().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=c(l);const{context:m,pixelFormat:h,dataType:u,target:g,isImmutable:x}=l;if(x&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");const T=m.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||s<0||r+o>l.width||s+a>l.height)&&w().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:E}=m;p&&(o&&a||w().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),E.pixelStorei(E.UNPACK_SKIP_ROWS,p)),_(n)?E.texSubImage2D(g,i,r,s,o,a,h,u,n):d(n)?E.compressedTexSubImage2D(g,i,r,s,o,a,l.internalFormat,n.levels[i]):E.texSubImage2D(g,i,r,s,o,a,h,u,n),p&&E.pixelStorei(E.UNPACK_SKIP_ROWS,0),m.bindTexture(T,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(i,r,s,o,a,n,p,l){l||w().error("An attempt to use uninitialized data!"),this._glName||w().error("An attempt to update an uninitialized texture!");const m=this._descriptor;m.internalFormat=c(m);const{context:h,pixelFormat:_,dataType:g,isImmutable:x,target:T}=m;if(x&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");u(T)||w().warn("Attempting to set 3D texture data on a non-3D texture");const E=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||s<0||o<0||r+a>m.width||s+n>m.height||o+p>m.depth)&&w().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=h;if(d(l))l=l.levels[i],M.compressedTexSubImage3D(T,i,r,s,o,a,n,p,m.internalFormat,l);else{const t=l;M.texSubImage3D(T,i,r,s,o,a,n,p,_,g,t)}h.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const i=this._descriptor;if(0===i.width||0===i.height)return;if(!i.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");i.hasMipmap=!0,this._samplingModeDirty=!0,g(i)}i.samplingMode===p.LINEAR?(this._samplingModeDirty=!0,i.samplingMode=p.LINEAR_MIPMAP_NEAREST):i.samplingMode===p.NEAREST&&(this._samplingModeDirty=!0,i.samplingMode=p.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(i.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,g(e)}e.samplingMode===p.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=p.LINEAR):e.samplingMode===p.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=p.NEAREST)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,g(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController=i(this._compressionAbortController))}_setData(i,r){const o=this._descriptor,n=o.context?.gl;if(!n)return;s(n),this._glName||(this._glName=n.createTexture(),o.context.instanceCounter.increment(a.Texture,this)),g(o);const p=o.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);o.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),s(n);const l=r??o.target,m=u(l);if(_(i))this._setDataFromTexImageSource(i,l);else{const{width:e,height:r,depth:a}=o;if(null==e||null==r)throw new t("texture:missing-size","Width and height must be specified!");if(m&&null==a)throw new t("texture:missing-depth","Depth must be specified!");if(o.internalFormat=c(o),o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,o.internalFormat,o.hasMipmap,e,r,a),d(i)){if(!x(o.internalFormat))throw new t("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(i,o.internalFormat,l)}else this._texImage(l,0,o.internalFormat,e,r,a,i),s(n),o.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),s(n),o.context.bindTexture(p,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=o.TEXTURE_CUBE_MAP_POSITIVE_X;e<=o.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=c(r);const o=u(e),{width:a,height:n,depth:p}=T(t);r.width&&r.height,r.width||(r.width=a),r.height||(r.height=n),o&&r.depth,o&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,a,n,p),this._texImage(e,0,r.internalFormat,a,n,p,t),s(i),r.hasMipmap&&(this.generateMipmap(),s(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=E(i,s,o,a),m=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,l.MAX_LEVEL,m),this._forEachMipmapLevel(((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)}),m)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!M(i)&&!A(i)&&!f(i))throw new t("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?E(e,s,o,a):1;if(u(e)){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=u(e),{isImmutable:m,pixelFormat:h,dataType:d}=this._descriptor;if(m){if(null!=n){const r=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,h,d,r)}else p.texSubImage2D(e,i,0,0,s,o,h,d,r)}}else{const m=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,h,d,m)}else p.texImage2D(e,i,r,s,o,0,h,d,m)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=u(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){if(!e.compressionWorkerHandle||!e.compressionWorkerHandle.isCompressible(t))return;const i=!!this._descriptor.context.capabilities.compressedTextureETC,s=!!this._descriptor.context.capabilities.compressedTextureS3TC;if(i||s){const o=new AbortController;this._compressionAbortController=o;const a=this._descriptor.compressionHandle;a.increment();const n=this._descriptor.compressionCallback,p={data:await createImageBitmap(t,{imageOrientation:this.descriptor.flipped?"flipY":"none"}),width:t.width,height:t.height,premultiplyAlpha:this._descriptor.preMultiplyAlpha,hasMipmap:this._descriptor.hasMipmap,hasETC:!!i,hasS3TC:!!s};e.compressionWorkerHandle.invoke(p,this._compressionAbortController.signal).then((t=>{t&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=t.internalFormat,this._setData(t.compressedTexture),n?.()),o===this._compressionAbortController&&(this._compressionAbortController=null),a.decrement()})).catch((t=>{r(t)||o!==this._compressionAbortController||(this._compressionAbortController=null),a.decrement()}))}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:a,hasMipmap:n,target:p}=this._descriptor;const l=p===o.TEXTURE_3D;if(null==r||null==s||l&&null==a)throw new t("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,a),n&&(1!==r||1!==s||l&&1!==a)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),l&&(a=Math.max(1,a>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;i===p.LINEAR_MIPMAP_NEAREST||i===p.LINEAR_MIPMAP_LINEAR?(i=p.LINEAR,t.hasMipmap||(r=p.LINEAR)):i!==p.NEAREST_MIPMAP_NEAREST&&i!==p.NEAREST_MIPMAP_LINEAR||(i=p.NEAREST,t.hasMipmap||(r=p.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};export{D as Texture,b as tracer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{TextureType as t,PixelFormat as i,PixelType as h,TextureSamplingMode as s,TextureWrapMode as e}from"./enums.js";import{
|
|
5
|
+
import{TextureType as t,PixelFormat as i,PixelType as h,TextureSamplingMode as s,TextureWrapMode as e}from"./enums.js";import{FBOAttachmentType as p}from"./FBOAttachmentType.js";import{getBytesPerElementFormat as r}from"./Util.js";class a{constructor(r=0,a=r){this.width=r,this.height=a,this.type=p.TextureDescriptor,this.target=t.TEXTURE_2D,this.pixelFormat=i.RGBA,this.dataType=h.UNSIGNED_BYTE,this.samplingMode=s.LINEAR,this.wrapMode=e.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function o(i){return i.width<=0||i.height<=0||i.depth<=0?0:Math.round(i.width*i.height*i.depth*(i.hasMipmap?4/3:1)*(null==i.internalFormat?4:r(i.internalFormat))*(i.target===t.TEXTURE_CUBE_MAP?6:1))}export{a as TextureDescriptor,o as estimateMemory};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../core/Error.js";import
|
|
5
|
+
import t from"../../core/Error.js";import e from"../../core/Logger.js";import{SizedPixelFormat as n,SizedDepthFormat as r,SizedDepthStencilFormat as i,CompressedTextureFormat as o,TextureType as u,PixelType as a,PixelFormat as l,UnsizedDepthFormat as c}from"./enums.js";const h=()=>e.getLogger("esri/views/webgl/textureUtils");function s(t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&h().error("Negative dimension parameters are not allowed!")}function d(t){return t in n}function m(t){return t in r}function f(t){return t in i}function E(t){return null!=t&&t in o}function T(t){return null!=t&&"type"in t&&"compressed"===t.type}function g(t){return E(t.descriptor.internalFormat)}function p(t){return null!=t&&"byteLength"in t}function w(t){return null!=t&&!T(t)&&!p(t)}function R(t){return t===u.TEXTURE_3D||t===u.TEXTURE_2D_ARRAY}function F(t,e,n,r=1){let i=Math.max(e,n);return t===u.TEXTURE_3D&&(i=Math.max(i,r)),Math.floor(Math.log2(i))+1}function B(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case a.FLOAT:switch(e.pixelFormat){case l.RGBA:return n.RGBA32F;case l.RGB:return n.RGB32F;default:throw new t("texture:unknown-format","Unable to derive format")}case a.UNSIGNED_BYTE:switch(e.pixelFormat){case l.RGBA:return n.RGBA8;case l.RGB:return n.RGB8}}const{pixelFormat:o}=e;return e.internalFormat=o===c.DEPTH_STENCIL?i.DEPTH24_STENCIL8:o===c.DEPTH_COMPONENT?r.DEPTH_COMPONENT24:o,e.internalFormat}function G(t){let e="width"in t?t.width:t.codedWidth,n="height"in t?t.height:t.codedHeight;const r=1;return t instanceof HTMLVideoElement&&(e=t.videoWidth,n=t.videoHeight),{width:e,height:n,depth:r}}export{F as calcMipmapLevels,B as deriveInternalFormat,G as getDimensions,R as is3DTarget,p as isArrayBufferView,T as isCompressedData,E as isCompressedFormat,g as isCompressedTexture,m as isSizedDepthFormat,f as isSizedDepthStencilFormat,d as isSizedPixelFormat,w as isTexImageSource,s as validateTexture};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import o from"../Viewpoint.js";import t from"../core/Clonable.js";import r from"../core/JSONSupport.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import p from"../geometry/SpatialReference.js";import{timeExtent as n}from"../webdoc/support/timeProperties.js";import a from"./Environment.js";import{WebSceneAnalysesCollection as l,webSceneAnalysisCollectionProperty as m}from"./support/analysisUtils.js";let c=class extends(t.ClonableMixin(r)){constructor(e){super(e),this.analyses=new l,this.environment=new a,this.spatialReference=null,this.viewpoint=null,this.timeExtent=null}set viewingMode(e){this._set("viewingMode",e)}};e([s(m("analyses"))],c.prototype,"analyses",void 0),e([s({type:a,json:{write:{isRequired:!0}}})],c.prototype,"environment",void 0),e([s({type:p,json:{default:()=>p.WebMercator}})],c.prototype,"spatialReference",void 0),e([s({type:["local","global"],json:{default:"global"}})],c.prototype,"viewingMode",null),e([s({type:o,json:{write:{isRequired:!0}}})],c.prototype,"viewpoint",void 0),e([s(n)],c.prototype,"timeExtent",void 0),c=e([i("esri.webscene.InitialViewProperties")],c);const d=c;export{d as default};
|
package/webscene/Presentation.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as o}from"../chunks/tslib.es6.js";import s from"../core/Clonable.js";import r from"../core/Collection.js";import{referenceSetter as e,castForReferenceSetter as t}from"../core/collectionUtils.js";import i from"../core/JSONSupport.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{cast as l}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import m from"./Slide.js";const n=r.ofType(m);let a=class extends(s.ClonableMixin(i)){constructor(o){super(o),this.slides=new n}destroy(){this.slides.forEach((o=>o.destroy())),this.slides.removeAll()}set slides(o){o&&(o=o.filter((o=>!!o.viewpoint))),this._set("slides",e(o,this._get("slides"),n))}};o([c({type:n,nonNullable:!0,json:{write:!0}}),l(t)],a.prototype,"slides",null),a=o([p("esri.webscene.Presentation")],a);const d=a;export{d as default};
|
package/webscene/Slide.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Clonable.js";import o from"../core/Collection.js";import{referenceSetter as s}from"../core/collectionUtils.js";import a from"../core/JSONSupport.js";import l from"../core/Logger.js";import{moduloPositive as p}from"../core/mathUtils.js";import{destroyMaybe as m,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as h,createAbortError as d,isAbortError as u}from"../core/promiseUtils.js";import{whenOnce as y,when as g}from"../core/reactiveUtils.js";import{property as v}from"../core/accessorSupport/decorators/property.js";import{cast as b}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as w}from"../core/accessorSupport/ensureType.js";import{s as T}from"../chunks/vec32.js";import{create as j}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../layers/Layer.js";import{basemapEnsureType as L,clonePreservingTiledLayers as C}from"../support/basemapEnsureType.js";import{TaskPriority as E}from"../views/support/Scheduler.js";import{SlideThumbnail as S}from"../webdoc/support/SlideThumbnail.js";import{timeExtent as k}from"../webdoc/support/timeProperties.js";import A from"./SunLighting.js";import V from"./VirtualLighting.js";import U from"./support/Description.js";import x from"./support/SlideElements.js";import{SlideEnvironment as I}from"./support/SlideEnvironment.js";import D from"./support/SlideGround.js";import{SlideVisibleLayer as F}from"./support/SlideVisibleLayer.js";import R from"./support/Title.js";let M=0;const P=o.ofType(F),q=["caption","cover","none"];let B=class extends(r.ClonableMixin(a)){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+M++,this.title=new R,this.description=new U,this.hidden=!1,this.thumbnail=new S,this.viewpoint=null,this.basemap=null,this.ground=null,this.layout="caption",this.environment=new I,this.timeExtent=null,this.elements=null,this.visibleLayers=new P}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail=m(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements=null}castTitle(e){return"string"==typeof e?new R({text:e}):w(R,e)}castDescription(e){return"string"==typeof e?new U({text:e}):w(U,e)}castThumbnail(e){return"string"==typeof e?new S({url:e}):w(S,e)}castBasemap(e){return L(e)}set visibleLayers(e){this._set("visibleLayers",s(e,this._get("visibleLayers"),P))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof _){const t=N(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(l.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}async _updateVisibleLayersFrom(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=N(i);t.push(new F({id:e.layer.id,sublayerIds:n}))}})))).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}_updateFocusAreaIDs(e){if(e){this.enabledFocusAreas=[];for(const t of e)t.enabled&&this.enabledFocusAreas.push(t.id)}}updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};return e.when((()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?V.prototype.clone.apply(e.environment.lighting):A.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this._updateFocusAreaIDs(e.focusAreas?.areas),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?D.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this._updateVisibleLayersFrom(e)))).then((()=>e.takeScreenshot(i))).then((e=>(this.thumbnail=new S({url:e.dataUrl}),this)))}async applyTo(e,t){null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=h(t,(()=>i?.abort())),o=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await y((()=>e.ready),i.signal)}catch(c){throw o(),c}if(i.signal.aborted)throw o(),d();const s=e.resourceController.scheduler.registerTask(E.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([s.schedule((async()=>a=await this._setViewpointOfInterest(e,l))),s.schedule((()=>this._applyBasemap(e,l)),l.signal),s.schedule((()=>this._loadLayersWithSublayerVisibility(e)))]),await Promise.all([s.schedule((()=>this._applyLayerVisibility(e)),l.signal),s.schedule((()=>this._applyGround(e)),l.signal),s.schedule((()=>this._applyViewpoint(e,l)),l.signal),s.schedule((()=>e.timeExtent=this.timeExtent?.clone()??null),l.signal),s.schedule((()=>e.environment.weather=this.environment.weather.clone())),s.schedule((()=>this._applyFocusAreaIDs(e.focusAreas?.areas)))])},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),s.remove(),o(),!1===m.ok)throw m.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(u(i))throw i}e.map.basemap=C(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaIDs(e){if(e)for(const t of e)t.enabled=this.enabledFocusAreas?.includes(t.id)??!1}_getLayers(e){const t=new o;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{e.persistenceEnabled&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map((e=>{const t=this.visibleLayers.find((t=>t.id===e.id))?.sublayerIds;return t?e.load():null})))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t?.sublayerIds,n=G(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then((()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())})).catch((t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t})).finally((()=>{c(i)}))}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,o]=this._getTime(n),[s,a]=this._getTime(i.date),l=J(o,a),p=e.renderCoordsHelper,m=j();p.toRenderCoords(e.camera.position,m);const c=j(),h=j();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,c);const d=new Date;return g((()=>e.camera),(e=>{p.toRenderCoords(e.position,h);const i=T(m,h),n=T(c,h);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(s-r)*a,y=z(o,l*a);t.date=this._setTime(d,u,y)}))}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([v({type:String,json:{write:{isRequired:!0}}})],B.prototype,"id",void 0),e([v({type:R,json:{default:()=>new R({text:""}),write:{isRequired:!0}}})],B.prototype,"title",void 0),e([b("title")],B.prototype,"castTitle",null),e([v({type:U,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],B.prototype,"description",void 0),e([b("description")],B.prototype,"castDescription",null),e([v({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],B.prototype,"hidden",void 0),e([v({type:S,json:{default:()=>new S({url:""}),write:{isRequired:!0}}})],B.prototype,"thumbnail",void 0),e([b("thumbnail")],B.prototype,"castThumbnail",null),e([v({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],B.prototype,"viewpoint",void 0),e([v({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],B.prototype,"basemap",void 0),e([b("basemap")],B.prototype,"castBasemap",null),e([v({type:D,json:{write:!0}})],B.prototype,"ground",void 0),e([v({type:q,json:{write:!0,default:"caption"},nonNullable:!0})],B.prototype,"layout",void 0),e([v({type:P,json:{write:{isRequired:!0}}})],B.prototype,"visibleLayers",null),e([b("visibleLayers")],B.prototype,"castVisibleLayers",null),e([v({type:I,json:{write:!0}})],B.prototype,"environment",void 0),e([v({type:[String],json:{write:!1}})],B.prototype,"enabledFocusAreas",void 0),e([v(k)],B.prototype,"timeExtent",void 0),e([v({type:x,json:{write:!0}})],B.prototype,"elements",void 0),B=e([f("esri.webscene.Slide")],B);const O=B;function G(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function N(e){const t=G(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}const W=86400,H=43200;function J(e,t){let i=t-e;return i>H&&(i-=W),i<-43200&&(i+=W),i}function z(e,t){return p(e+t,W)}export{O as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Clonable.js";import s from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import a from"../core/JSONSupport.js";import l from"../core/Logger.js";import{moduloPositive as p}from"../core/mathUtils.js";import{destroyMaybe as m,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as h,createAbortError as d,isAbortError as u}from"../core/promiseUtils.js";import{whenOnce as y,when as g}from"../core/reactiveUtils.js";import{property as b}from"../core/accessorSupport/decorators/property.js";import{cast as v}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as w}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as f}from"../core/accessorSupport/ensureType.js";import{s as T}from"../chunks/vec32.js";import{create as j}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../layers/Layer.js";import{basemapEnsureType as L,clonePreservingTiledLayers as C}from"../support/basemapEnsureType.js";import{TaskPriority as E}from"../views/support/Scheduler.js";import{SlideThumbnail as S}from"../webdoc/support/SlideThumbnail.js";import{timeExtent as k}from"../webdoc/support/timeProperties.js";import A from"./SunLighting.js";import V from"./VirtualLighting.js";import U from"./support/Description.js";import x from"./support/SlideElements.js";import{SlideEnvironment as I}from"./support/SlideEnvironment.js";import F from"./support/SlideGround.js";import{SlideVisibleLayer as D}from"./support/SlideVisibleLayer.js";import R from"./support/Title.js";let M=0;const O=s.ofType(D),P=["caption","cover","none"];let q=class extends(r.ClonableMixin(a)){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+M++,this.title=new R,this.description=new U,this.hidden=!1,this.thumbnail=new S,this.viewpoint=null,this.basemap=null,this.ground=null,this.layout="caption",this.environment=new I,this.timeExtent=null,this.elements=new x,this.visibleLayers=new O}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail=m(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements=null}castTitle(e){return"string"==typeof e?new R({text:e}):f(R,e)}castDescription(e){return"string"==typeof e?new U({text:e}):f(U,e)}castThumbnail(e){return"string"==typeof e?new S({url:e}):f(S,e)}castBasemap(e){return L(e)}set visibleLayers(e){this._set("visibleLayers",o(e,this._get("visibleLayers"),O))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof _){const t=N(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(l.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}async _updateVisibleLayersFrom(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=N(i);t.push(new D({id:e.layer.id,sublayerIds:n}))}})))).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}_updateFocusAreaIDs(e){if(e){this.enabledFocusAreas=[];for(const t of e)t.enabled&&this.enabledFocusAreas.push(t.id)}}async updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};await e.when(),this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?V.prototype.clone.apply(e.environment.lighting):A.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this._updateFocusAreaIDs(e.focusAreas?.areas),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?F.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this.elements.analyses.updateFrom(e),await this._updateVisibleLayersFrom(e);const n=await e.takeScreenshot(i);return this.thumbnail=new S({url:n.dataUrl}),this}async applyTo(e,t){null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=h(t,(()=>i?.abort())),s=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await y((()=>e.ready),i.signal)}catch(c){throw s(),c}if(i.signal.aborted)throw s(),d();const o=e.resourceController.scheduler.registerTask(E.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([o.schedule((async()=>a=await this._setViewpointOfInterest(e,l))),o.schedule((()=>this._applyBasemap(e,l)),l.signal),o.schedule((()=>this._loadLayersWithSublayerVisibility(e)))]),await Promise.all([o.schedule((()=>this._applyLayerVisibility(e)),l.signal),o.schedule((()=>this._applyGround(e)),l.signal),o.schedule((()=>this.elements.analyses.applyTo(e)),l.signal),o.schedule((()=>this._applyViewpoint(e,l)),l.signal),o.schedule((()=>e.timeExtent=this.timeExtent?.clone()??null),l.signal),o.schedule((()=>e.environment.weather=this.environment.weather.clone())),o.schedule((()=>this._applyFocusAreaIDs(e.focusAreas?.areas)))])},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),o.remove(),s(),!1===m.ok)throw m.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(u(i))throw i}e.map.basemap=C(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaIDs(e){if(e)for(const t of e)t.enabled=this.enabledFocusAreas?.includes(t.id)??!1}_getLayers(e){const t=new s;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{e.persistenceEnabled&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map((e=>{const t=this.visibleLayers.find((t=>t.id===e.id))?.sublayerIds;return t?e.load():null})))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t?.sublayerIds,n=G(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then((()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())})).catch((t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t})).finally((()=>{c(i)}))}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,s]=this._getTime(n),[o,a]=this._getTime(i.date),l=J(s,a),p=e.renderCoordsHelper,m=j();p.toRenderCoords(e.camera.position,m);const c=j(),h=j();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,c);const d=new Date;return g((()=>e.camera),(e=>{p.toRenderCoords(e.position,h);const i=T(m,h),n=T(c,h);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(o-r)*a,y=z(s,l*a);t.date=this._setTime(d,u,y)}))}write(e,t){const i=super.write(e,t);return i?.elements&&0===Object.keys(i.elements).length&&delete i.elements,i}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([b({type:String,json:{write:{isRequired:!0}}})],q.prototype,"id",void 0),e([b({type:R,json:{default:()=>new R({text:""}),write:{isRequired:!0}}})],q.prototype,"title",void 0),e([v("title")],q.prototype,"castTitle",null),e([b({type:U,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],q.prototype,"description",void 0),e([v("description")],q.prototype,"castDescription",null),e([b({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],q.prototype,"hidden",void 0),e([b({type:S,json:{default:()=>new S({url:""}),write:{isRequired:!0}}})],q.prototype,"thumbnail",void 0),e([v("thumbnail")],q.prototype,"castThumbnail",null),e([b({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],q.prototype,"viewpoint",void 0),e([b({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],q.prototype,"basemap",void 0),e([v("basemap")],q.prototype,"castBasemap",null),e([b({type:F,json:{write:!0}})],q.prototype,"ground",void 0),e([b({type:P,json:{write:!0,default:"caption"},nonNullable:!0})],q.prototype,"layout",void 0),e([b({type:O,json:{write:{isRequired:!0}}})],q.prototype,"visibleLayers",null),e([v("visibleLayers")],q.prototype,"castVisibleLayers",null),e([b({type:I,json:{write:!0}})],q.prototype,"environment",void 0),e([b({type:[String],json:{write:!1}})],q.prototype,"enabledFocusAreas",void 0),e([b(k)],q.prototype,"timeExtent",void 0),e([b({type:x,nonNullable:!0,json:{write:!0}})],q.prototype,"elements",void 0),q=e([w("esri.webscene.Slide")],q);const B=q;function G(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function N(e){const t=G(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}const W=86400,H=43200;function J(e,t){let i=t-e;return i>H&&(i-=W),i<-43200&&(i+=W),i}function z(e,t){return p(e+t,W)}export{B as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as o}from"../chunks/tslib.es6.js";import e from"../core/Clonable.js";import r from"../core/JSONSupport.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{subclass as t}from"../core/accessorSupport/decorators/subclass.js";let p=class extends(e.ClonableMixin(r)){constructor(o){super(o),this.visible=!1}};o([s({type:Boolean,json:{default:!1,write:!0}})],p.prototype,"visible",void 0),p=o([t("esri.webscene.SlideLegendInfo")],p);const c=p;export{c as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../Color.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as s}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import{colorAndTransparencyProperty as c}from"../../symbols/support/materialUtils.js";import p from"./Background.js";var
|
|
5
|
+
import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../Color.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as s}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import{colorAndTransparencyProperty as c}from"../../symbols/support/materialUtils.js";import p from"./Background.js";var i;let l=i=class extends p{constructor(o){super(o),this.type="color",this.color=new r([0,0,0,1])}clone(){return new i(this.cloneProperties())}cloneProperties(){return{color:this.color.clone()}}};o([s({color:"color"},{readOnly:!0}),e({json:{write:{isRequired:!0}}})],l.prototype,"type",void 0),o([e(c({nonNullable:!0,colorRequiredOnWrite:!0}))],l.prototype,"color",void 0),l=i=o([t("esri.webscene.background.ColorBackground")],l);const n=l;export{n as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../Basemap.js";import
|
|
5
|
+
import{b as e,c as t}from"../../chunks/tslib.es6.js";import r from"../../Basemap.js";import n from"../../Ground.js";import a from"../../WebScene.js";import"../../core/has.js";import{isLongFormType as s,Integer as y,Null as o}from"../../core/accessorSupport/ensureType.js";import{isCollection as i}from"../../core/accessorSupport/extensions/serializableProperty/type.js";import p from"../../layers/GroupLayer.js";import u from"../../layers/KMLLayer.js";import{typeModuleMap as l}from"../../layers/mixins/operationalLayerModuleMap.js";import{supportedTypes as c}from"../../layers/mixins/operationalLayers.js";import m from"../../layers/support/Sublayer.js";import{JoinTableDataSource as f,DataLayerSource as d}from"../../layers/support/source/DataLayerSource.js";import{MapLayerSource as b}from"../../layers/support/source/MapLayerSource.js";import w from"../InitialViewProperties.js";import{ScanContext as j}from"./utils.js";import{webSceneAnalysisRegistry as N}from"../support/analysisUtils.js";import v from"../support/SlideElements.js";async function g(r){const n={stack:[],error:void 0,hasError:!1};try{const t=e(n,new j,!1);return await L(null,{typeName:"json",type:r},t)}catch(a){n.error=a,n.hasError=!0}finally{t(n)}}async function T(e,t,r){switch(t.typeName){case"array":await R(e,t,r);break;case"union":await M(e,t,r);break;case"json":await L(e,t,r);break;case"native":await h(e,t,r);break;case"enum":await q(e,t,r)}}async function h(e,t,r){r.addProperty({name:e,type:O(r,t),default:t.default,required:t.isRequired})}function k(e){const t=e.slice();return t.sort(),t}async function q(e,t,r){const n=t.values.slice();t.nullable&&n.push(null),r.currentClass?.typeValue&&"type"===e?r.addProperty({name:e,type:"string",enum:`"${r.currentClass.typeValue}"`,required:t.isRequired}):r.addProperty({name:e,type:O(r,t),enum:k(n).map((e=>"string"==typeof e?`"${e}"`:`${e}`)).join("|"),default:t.default,required:t.isRequired})}async function R(e,t,r){t.elementType.isRequired=t.isRequired,await T(`${e}[]`,t.elementType,r)}function S(e,t){if("json"===e.typeName){const t=e.type.__accessorMetadata__,r=t?.type,n=r&&F(r),a=n?.type,s=a||r?.type;if(s&&Array.isArray(s)&&1===s.length&&"string"==typeof s[0])return a?s[0]:G(r,s[0])}return t}async function M(e,t,r){const n=[];for(const a of t.types)if("native"!==a.type.typeName&&t.key){const t=`${e}<${S(a.type,a.value)}>`;await T(t,a.type,r)}else n.push(a.type);if(n.length){const a=n.map((e=>O(r,e)));t.nullable&&a.push("null"),a.sort(),r.addProperty({type:a.join("|"),name:e,default:t.default,required:t.isRequired})}}async function C(e,t){return e.type===a&&"layers"===t?_("web-scene/operational-layers","operational-layers"):e.type===a&&"tables"===t?_("web-scene/tables","tables"):e.type!==r||"baseLayers"!==t&&"baseMapLayers"!==t?e.type===r&&"elevationLayers"===t||e.type===n&&"layers"===t?_("web-scene/ground","ground"):e.type===p&&"layers"===t?_("web-scene/operational-layers","operational-layers",(e=>e!==p)):e.type!==v&&e.type!==w||"analyses"!==t?e.type!==f||"leftTableSource"!==t&&"rightTableSource"!==t?null:B({key:"type",base:null,typeMap:{"data-layer":d,"map-layer":b}}):{typeName:"array",elementType:{typeName:"union",key:"type",types:await Promise.all(Object.entries(N).map((async([e,t])=>({type:{typeName:"json",type:await t()},value:e}))))}}:_("web-scene/basemap","basemap")}async function P(e,t,r){const n=I(r),a=await C(e,t);return a?(a.isRequired=n.isRequired,a):n}async function L(e,t,r){const n=t.type.__accessorMetadata__,a=r.getDeclaredClass(t.type);if(!n)return e&&r.addProperty({name:e,type:"unknown"}),null;let s=a,y=null;t.layerContainerType&&(s+=`--${t.layerContainerType}`);const o=e?.match(/<([^>]+)>$/);o&&(s+=`--${o[1]}`,y=o[1]),t.type===m&&(s+=`--${r.currentClass?.name}`,y=r.currentClass?.name);const i=r.seen.get(s);if(i&&e)return r.addProperty({name:e,type:i,required:t.isRequired}),i;const p={type:t.type,name:a,id:s,properties:[]};e&&(r.addProperty({name:e,type:p,required:t.isRequired}),p.typeValue=y),r.push(e,p);for(const u in n){const e=n[u],a=H(e);if(!a?.enabled)continue;if(a.layerContainerTypes&&t.layerContainerType&&!a.layerContainerTypes.includes(t.layerContainerType))continue;if(t.type===m){const e="esri/layers/TileLayer"===r.stack[r.stack.length-2].klass.name;if(e&&m.test.isMapImageLayerOverridePolicy(a.overridePolicy)||!e&&m.test.isTileImageLayerOverridePolicy(a.overridePolicy))continue}const s=a.target;if("string"==typeof s||null==s){const n=await P(t,u,e);if(!n)continue;await T("string"==typeof s?s:u,n,r)}else await $(t,s,r)}return r.pop()}async function $(e,t,r){for(const n in t){let a=await C(e,n);if(!a){const e=t[n];a=e.types?B(e.types):W(e.type),a.default=e.default,a.isRequired=e.isRequired,a=E(a)}await T(n,a,r)}}async function _(e,t,r){const n={typeName:"union",key:"layerType",types:[]};for(const a in c[e]){if("web-scene/operational-layers"===e&&"ArcGISTiledElevationServiceLayer"===a)continue;const s=await l[a]();s&&(r&&!r(s)||s!==u&&n.types.push({type:{typeName:"json",layerContainerType:t,type:s},value:a}))}if(0===n.types.length)return null;return{typeName:"array",elementType:1===n.types.length?n.types[0].type:n}}function O(e,t){switch(t.typeName){case"array":return`${O(e,t.elementType)}[]`;case"union":{const r=t.types.map((t=>O(e,t.type)));return t.nullable&&r.push("null"),r.sort(),`${r.join(" | ")}`}case"native":switch(t.type){case Number:return"number";case y:return"integer";case String:return"string";case Boolean:return"boolean";case Object:return"object";case o:return"null";default:return"unknown"}case"json":return e.getDeclaredClass(t.type);case"enum":return"string"}}function A(e){const t=e.prototype.itemType?.Type;if(!t)return{typeName:"array",elementType:{typeName:"native",type:null}};if("function"==typeof t)return{typeName:"array",elementType:W(t)};if(t.typeMap){const e=[];for(const r in t.typeMap){const n=t.typeMap[r];e.push({type:W(n),value:U(n)?null:r})}return{typeName:"array",elementType:{typeName:"union",key:"string"==typeof t.key?t.key:"type",types:e}}}}function x(e){if("json"!==e.typeName)return null;const t=e.type.__accessorMetadata__,r=t?.type,n=r&&F(r),a=n?.type,s=a||r?.type;return s&&Array.isArray(s)&&"string"==typeof s[0]?a||r.type.map((e=>G(r,e))):null}function E(e){if("array"===e.typeName)return e.elementType=E(e.elementType),e;const t=x(e);return t?{typeName:"union",key:"type",nullable:e.nullable,isRequired:e.isRequired,types:t.map((t=>({value:t,type:e})))}:e}function I(e){const t=F(e);return t?.types?B(t.types):!t?.type&&e.types?B(e.types):V(E(J(e)))}function V(e){return e.nullable&&"native"===e.typeName?{typeName:"union",key:null,isRequired:e.isRequired,types:[{value:null,type:e}],nullable:!0}:e}function B(e){if(Array.isArray(e))return{typeName:"array",elementType:B(e[0])};const t=[];for(const r in e.typeMap){const n=e.typeMap[r];t.push({type:W(n),value:U(n)?null:r})}return{typeName:"union",key:"string"==typeof e.key?e.key:"type",types:t}}function D(e){return null!=e&&e.isJSONMapWriter}function G(e,t){const r=H(e);if(r&&D(r.writer)){const e={value:""};return r.writer?.(t,e,"value"),e.value}return t}function J(e){const t=F(e),r=H(e),n=t?.type,a=W(n||e.type);return t&&void 0!==t.default&&"function"!=typeof t.default&&(a.default=G(e,t.default)),r?.allowNull&&(a.nullable=!0),r?.isRequired&&(a.isRequired=!0),a}function W(e){return e?s(e)?z(e):Array.isArray(e)?"string"==typeof e[0]||"number"==typeof e[0]?{typeName:"enum",values:e}:e.length>1?{typeName:"union",key:null,types:e.map((e=>({type:W(e),value:null})))}:{typeName:"array",elementType:W(e[0])}:i(e)?A(e):U(e)?{typeName:"native",type:e}:K(e)?{typeName:"json",type:e}:{typeName:"native",type:null}:{typeName:"native",type:null}}function z(e){switch(e.type){case"native":return{typeName:"native",type:e.value};case"array":return{typeName:"array",elementType:W(e.value)};case"one-of":return{typeName:"union",key:null,types:e.values.map((e=>({type:z(e),value:null})))}}}function K(e){let t=e;for(;t;){if(t.prototype&&("esri.core.JSONSupport"===t.prototype.declaredClass||"esri.core.MultiOriginJSONSupport"===t.prototype.declaredClass))return!0;t=Object.getPrototypeOf(t)}return!1}function U(e){return e===String||e===Boolean||e===Number||e===y||e===Object||e===o}function F(e){if(!e.json)return null;const t=e.json.origins,r=e.json,n=t?.["web-scene"],a=t?.["web-document"];return n||a||r||null}function H(e){if(!e.json)return null;const t=e.json.origins,r=e.json.write,n=t?.["web-scene"]?.write,a=t?.["web-document"]?.write;return n||a||r||null}export{g as scan};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{collectClassPaths as e}from"./utils.js";function
|
|
5
|
+
import{collectClassPaths as e}from"./utils.js";function t(e){const t=s(e),n=[],r=a(t),i=new Map;p("api","",e.api,t,r.api,i);const c=new Map;p("spec","",e.spec,t,r.spec,c);const u=o(t);for(const[p,a]of i){const e=c.get(p),t=u.get(a.container.id),o=`${a.container.name} (${e.container.name})${a.container.typeValue?` <${a.container.typeValue}>`:""}`;n.push({name:o,api:a,spec:e,indent:t})}return n}function n(e,t,a,o,s,i,c,u,f){if(c.has(o))return f;for(const d of o.properties){const l=t?`${t}.${d.name}`:d.name,m=a?`${a}.${d.name}`:d.name,y=s.get(m);if(y){const t=i.get(y[e].id);f.push({name:l,type:"ref",ref:y,refName:t,required:d.required}),p(e,m,y[e],s,i,u)}else"string"==typeof d.type?f.push(r(l,d)):(c.add(o),n(e,l,m,d.type,s,i,c,u,f))}return c.delete(o),f}function p(e,t,p,a,o,s){if(s.has(p.id))return s;const r={container:p,text:null,props:[]};return o.get(p.id).forEach((e=>s.set(e,r))),n(e,"",t,p,a,o,new Set,s,r.props),r.props.sort(i),s}function a(e){const t={api:new Map,spec:new Map};for(const n of e.values()){const e=`${n.api.name} (${n.spec.name})${n.api.typeValue?` <${n.api.typeValue}>`:""}`;let p=t.api.get(n.api.id);p||(p=new Set,t.api.set(n.api.id,p)),p.add(e);let a=t.spec.get(n.spec.id);a||(a=new Set,t.spec.set(n.spec.id,a)),a.add(e)}return t}function o(e){const t=new Map;for(const n of e.keys()){const p=n?n.split(".").length:0,a=e.get(n).api.id;t.has("id")?t.set(a,Math.min(p,t.get(a))):t.set(a,p)}return t}function s(t){const n=e(t.api),p=e(t.spec),a=new Map;a.set("",{api:t.api,spec:t.spec});for(const[e,o]of n){const t=p.get(e);t&&a.set(e,{api:o,spec:t})}return a}function r(e,t){return{name:e,type:t.enum||("string"==typeof t.type?t.type:""),default:JSON.stringify(t.default),required:t.required}}function i(e,t){const n=e.name.localeCompare(t.name);if(0!==n)return n;const p=(e.type||"").localeCompare(t.type||"");return 0!==p?p:(e.default||"").localeCompare(t.default||"")}export{t as collect};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
export{scan as scanSpec}from"./spec.js";export{scan as scanAPI}from"./api.js";export{collectClassPaths,flatten}from"./utils.js";const e={applicationProperties:"esri/webscene/ApplicationProperties",authoringInfo:"esri/renderers/support/AuthoringInfo",authoringInfo_visualVariable:"esri/renderers/support/AuthoringInfoVisualVariable",baseMap:"esri/Basemap",border:"esri/symbols/callouts/LineCallout3DBorder",buildingSceneLayer:"esri/layers/BuildingSceneLayer",buildingSceneLayer_filter:"esri/layers/support/BuildingFilter",buildingSceneLayer_filterAuthoringInfo_filterBlock:"esri/layers/support/BuildingFilterAuthoringInfoBlock",buildingSceneLayer_filterAuthoringInfo_filterType:"esri/layers/support/BuildingFilterAuthoringInfoType",buildingSceneLayer_filterAuthoringInfoCheckbox:"esri/layers/support/BuildingFilterAuthoringInfoCheckbox",buildingSceneLayer_filterBlock:"esri/layers/support/BuildingFilterBlock",buildingSceneLayer_filterModeSolid:"esri/layers/support/BuildingFilterModeSolid",buildingSceneLayer_filterModeWireFrame:"esri/layers/support/BuildingFilterModeWireFrame",buildingSceneLayer_filterModeXray:"esri/layers/support/BuildingFilterModeXRay",buildingSceneLayer_sublayer:"esri/layers/buildingSublayers/BuildingComponentSublayer",callout:"esri/symbols/callouts/LineCallout3D",camera:"esri/Camera",cimSymbolReference:"esri/symbols/CIMSymbol",classBreakInfo:"esri/renderers/support/ClassBreakInfo",classBreakInfo_authoringInfo:"esri/renderer/support/AuthoringInfoClassBreakInfo",classBreaksRenderer:"esri/renderers/ClassBreaksRenderer",codedValue:"esri/layers/support/CodedValue",codedValue_domain:"esri/layers/support/CodedValueDomain",colorClassBreakInfo:"esri/renderers/support/pointCloud/ColorClassBreakInfo",colorInfo_visualVariable:"esri/renderers/visualVariables/ColorVariable",colormapInfo:"esri/renderers/support/ColormapInfo",colorModulationInfo:"esri/renderers/support/pointCloud/ColorModulation",colorRamp_algorithmic:"esri/rest/support/AlgorithmicColorRamp",colorRamp_multipart:"esri/rest/support/MultipartColorRamp",colorStop:"esri/renderers/visualVariables/support/ColorStop",colorUniqueValueInfo:"esri/renderers/support/pointCloud/ColorUniqueValueInfo",csvLayer:"esri/layers/CSVLayer",description:"esri/webscene/support/Description",dynamicDataLayer_source:"esri/layers/support/source/DataLayerSource",dynamicMapLayer_source:"esri/layers/support/source/MapLayerSource",elevationInfo:"esri/symbols/support/ElevationInfo",environment_background_color:"esri/webscene/background/ColorBackground",environment:"esri/webscene/Environment",extent:"esri/geometry/Extent",extrudeSymbol3DLayer:"esri/symbols/ExtrudeSymbol3DLayer",facilityLayerInfo:"esri/layers/support/FacilityLayerInfo",featureExpressionInfo:"esri/layers/support/FeatureExpressionInfo",featureLayer:"esri/layers/FeatureLayer",featureReduction_select:"esri/layers/support/FeatureReductionSelection",field:"esri/layers/support/Field",field_authoringInfo:"esri/renderers/support/AuthoringInfoFieldInfo",fieldInfo:"esri/popup/FieldInfo",fillSymbol3DLayer:"esri/symbols/FillSymbol3DLayer",font:"esri/symbols/Font",format:"esri/popup/support/FieldInfoFormat",ground:"esri/Ground",groupLayer:"esri/layers/GroupLayer",halo:"esri/symbols/support/Symbol3DHalo",heightModelInfo:"esri/geometry/HeightModelInfo",iconSymbol3DLayer:"esri/symbols/IconSymbol3DLayer",iconSymbol3DLayer_resource:"esri/symbols/support/IconSymbol3DLayerResource",imageServiceLayer:"esri/layers/ImageryLayer",inherited_domain:"esri/layers/support/InheritedDomain",initialState:"esri/webscene/InitialViewProperties",integratedMeshLayer:"esri/layers/IntegratedMeshLayer",joinTableDataSource:"esri/layers/support/source/JoinTableDataSource",labelExpressionInfo:"esri/layers/support/LabelExpressionInfo",labelingInfo:"esri/layers/support/LabelClass",labelSymbol3D:"esri/symbols/LabelSymbol3D",layer:"esri/layers/support/Sublayer",layerFloorInfo:"esri/layers/support/LayerFloorInfo",levelLayerInfo:"esri/layers/support/LevelLayerInfo",lighting:"esri/webscene/Lighting",lineSymbol3D:"esri/symbols/LineSymbol3D",lineSymbol3DLayer:"esri/symbols/LineSymbol3DLayer",lineOfSightLayer:"esri/layers/LineOfSightLayer",lineOfSightObserver:"esri/analysis/LineOfSightAnalysisObserver",lineOfSightTarget:"esri/analysis/LineOfSightAnalysisTarget",lod:"esri/layers/support/LOD",mapFloorInfo:"esri/support/MapFloorInfo",mapServiceLayer:"esri/layers/MapImageLayer",material:"esri/symbols/support/Symbol3DMaterial",materialColorMixMode:"esri/symbols/support/Symbol3DFillMaterial",mediaInfo_chart:"esri/popup/content/BarChartMediaInfo",mediaInfo_chart_value:"esri/popup/content/support/ChartMediaInfoValue",mediaInfo_image:"esri/popup/content/ImageMediaInfo",mediaInfo_image_value:"esri/popup/content/support/ImageMediaInfoValue",meshSymbol3D:"esri/symbols/MeshSymbol3D",mosaicRule:"esri/layers/support/MosaicRule",multidimensionalDefinition:"esri/layers/support/DimensionalDefinition",multipoint_geometry:"esri/geometry/Multipoint",navigationConstraint:"esri/ground/NavigationConstraint",objectSymbol3DLayer:"esri/symbols/ObjectSymbol3DLayer",objectSymbol3DLayer_resource:"esri/symbols/support/ObjectSymbol3DLayerResource",ogcFeatureLayer:"esri/layers/OGCFeatureLayer",openStreetMapLayer:"esri/layers/OpenStreetMapLayer",relatedRecordsInfoFieldOrder:"esri/popup/support/RelatedRecordsInfoFieldOrder",attachmentsOrderByInfo:"esri/popup/support/AttachmentsOrderByInfo",outline:"esri/symbols/support/Symbol3DOutline",pathSymbol3DLayer:"esri/symbols/PathSymbol3DLayer",point_geometry:"esri/geometry/Point",pointCloudBitfieldFilter:"esri/layers/pointCloudFilters/PointCloudBitfieldFilter",pointCloudClassBreaksRenderer:"esri/renderers/PointCloudClassBreaksRenderer",pointCloudFixedSizeAlgorithm:"esri/renderers/support/pointCloud/PointSizeFixedSizeAlgorithm",pointCloudLayer:"esri/layers/PointCloudLayer",pointCloudReturnFilter:"esri/layers/pointCloudFilters/PointCloudReturnFilter",pointCloudRGBRenderer:"esri/renderers/PointCloudRGBRenderer",pointCloudSplatAlgorithm:"esri/renderers/support/pointCloud/PointSizeSplatAlgorithm",pointCloudStretchRenderer:"esri/renderers/PointCloudStretchRenderer",pointCloudUniqueValueRenderer:"esri/renderers/PointCloudUniqueValueRenderer",pointCloudValueFilter:"esri/layers/pointCloudFilters/PointCloudValueFilter",pointSymbol3D:"esri/symbols/PointSymbol3D",polygon_geometry:"esri/geometry/Polygon",polygonPattern:"esri/symbols/patterns/StylePattern3D",polygonSymbol3D:"esri/symbols/PolygonSymbol3D",polyline_geometry:"esri/geometry/Polyline",popupElement_attachments:"esri/popup/content/AttachmentsContent",popupElement_fields:"esri/popup/content/FieldsContent",popupElement_media:"esri/popup/content/MediaContent",popupElement_text:"esri/popup/content/TextContent",popupExpressionInfo:"esri/popup/ExpressionInfo",popupInfo:"esri/PopupTemplate",popupLayerOptions:"esri/popup/LayerOptions",presentation:"esri/webscene/Presentation",queryTableDataSource:"esri/layers/support/source/QueryTableDataSource",range_domain:"esri/layers/support/RangeDomain",rangeInfo:"esri/layers/support/RangeInfo",rasterColormapRenderer:"esri/renderers/RasterColormapRenderer",rasterDataSource:"esri/layers/support/source/RasterDataSource",rasterShadedReliefRenderer:"esri/renderers/RasterShadedReliefRenderer",rasterStretchRenderer:"esri/renderers/RasterStretchRenderer",relatedRecordsInfo:"esri/popup/RelatedRecordsInfo",rendererLegendOptions:"esri/renderers/support/RendererLegendOptions",renderingRule:"esri/layers/support/RasterFunction",rotationInfo_visualVariable:"esri/renderers/visualVariables/RotationVariable",sceneLayer:"esri/layers/SceneLayer",search:"esri/webdoc/applicationProperties/Search",search_layer:"esri/webdoc/applicationProperties/SearchLayer",search_layer_field:"esri/webdoc/applicationProperties/SearchLayerField",simpleRenderer:"esri/renderers/SimpleRenderer",siteLayerInfo:"esri/layers/support/SiteLayerInfo",sizeInfo_visualVariable:"esri/renderers/visualVariables/SizeVariable",sizeStop:"esri/renderers/visualVariables/support/SizeStop",sketchEdges:"esri/symbols/edges/SketchEdges3D",slide:"esri/webscene/Slide",slide_ground:"esri/webscene/support/SlideGround",solidEdges:"esri/symbols/support/SolidEdges3D",spatialReference:"esri/geometry/SpatialReference",styleSymbolReference:"esri/symbols/WebStyleSymbol",tableDataSource:"esri/layers/support/source/TableDataSource",textSymbol3DLayer:"esri/symbols/TextSymbol3DLayer",thumbnail:"esri/webdoc/support/Thumbnail",tiledElevationLayer:"esri/layers/ElevationLayer",tiledImageServiceLayer:"esri/layers/ImageryTileLayer",tiledMapServiceLayer:"esri/layers/TileLayer",tileInfo:"esri/layers/support/TileInfo",title:"esri/webscene/support/Title",transparencyInfo_visualVariable:"esri/renderers/visualVariables/OpacityVariable",transparencyStop:"esri/renderers/visualVariables/support/OpacityStop",transportationNetwork:"esri/webscene/TransportationNetwork",uniqueValueInfo:"esri/renderers/support/UniqueValueInfo",uniqueValueRenderer:"esri/renderers/UniqueValueRenderer",vectorTileLayer:"esri/layers/VectorTileLayer",verticalOffset:"esri/symbols/support/Symbol3DVerticalOffset",viewing:"esri/webdoc/applicationProperties/Viewing",viewpoint:"esri/Viewpoint",visibleLayer:"esri/webscene/support/SlideVisibleLayer",visualVariableLegendOptions:"esri/renderers/visualVariables/support/VisualVariableLegendOptions",voxelOpacityStop:"esri/layers/voxel/VoxelOpacityStop",voxelColorStop:"esri/layers/voxel/VoxelColorStop",voxelDynamicSection:"esri/layers/voxel/VoxelDynamicSection",voxelIsosurfaceStyle:"esri/layers/voxel/VoxelIsosurface",voxelLayer:"esri/layers/VoxelLayer",voxelRangeFilter:"esri/layers/voxel/VoxelRangeFilter",voxelSection:"esri/layers/voxel/VoxelSection",voxelShading:"esri/layers/voxel/VoxelSimpleShading",voxelSlice:"esri/layers/voxel/VoxelSlice",voxelStyle:"esri/layers/voxel/VoxelStyle",voxelTransferFunctionStyle:"esri/layers/voxel/VoxelTransferFunctionStyle",voxelUniqueValue:"esri/layers/voxel/VoxelUniqueValue",voxelVariableStyle:"esri/layers/voxel/VoxelVariableStyle",voxelVolumeStyle:"esri/layers/voxel/VoxelVolumeStyle",waterSymbol3DLayer:"esri/symbols/WaterSymbol3DLayer",webTiledLayer:"esri/layers/WebTileLayer",wfsLayer:"esri/layers/WFSLayer",wmsLayer:"esri/layers/WMSLayer",wmsLayer_layer:"esri/layers/support/WMSSublayer",wmtsInfo:"esri/layers/support/WMTSLayerInfo"},r=["baseMapLayer","buildingSceneLayer_filterMode","buildingSceneLayer_sublayer","classBreakInfo_authoringInfo","clippingArea","codedValue_domain","codedValue","color","colorRamp","customParameters","dataSource","definitionEditor","domain","drawingInfo","edges","elevationLayers","environment_background_color","feature","featureSet","field_authoringInfo","fieldInfo","floorFilter","format","geometry","inherited_domain","initialState","input","joinTableDataSource","kmlLayer","layerDefinition","locationInfo","mapRangeInfo","mediaInfo_chart_value","mediaInfo_chart","mediaInfo_image_value","mediaInfo","multidimensionalDefinition","navigationConstraint","operationalLayers","orderByFields","parameter","pointCloudFilter","pointCloudRenderers","pointSizeAlgorithm","popupElement","popupExpressionInfo","queryTableDataSource","range_domain","range","rasterClassBreaksRenderer","rasterDataElevationLayer","rasterDataLayer","rasterDataSource","rasterRenderers","rasterStretchRenderer","rasterUniqueValueRenderer","relatedRecordsInfo","renderer","source","styleOrigin","symbol3D","table","tableDataSource","template","transportationNetwork","type","uniqueValueFromStyleRenderer","value","version","visibleLayer","visualVariable","visualVariableLegendOptions","voxelLayerDefinition","wfsInfo","widgets"];export{r as ignoredSchemaDefinitions,e as schemaToClassModule};
|
|
5
|
+
export{scan as scanSpec}from"./spec.js";export{scan as scanAPI}from"./api.js";export{collectClassPaths,flatten}from"./utils.js";
|