@arcgis/core 4.27.0-next.20230320 → 4.27.0-next.20230321
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/29ee4f14602caf6967e4.js +1 -0
- package/assets/esri/core/workers/chunks/{c36efbdd0a84fe851bbb.js → 433686dfda9e2ff1f98b.js} +1 -1
- package/assets/esri/core/workers/chunks/70ea44365021b665c213.js +1 -0
- package/assets/esri/core/workers/chunks/{f150bd21c3b9e098da57.js → 92951b85676df776961f.js} +56 -56
- package/assets/esri/core/workers/chunks/{19355af765993931a7c0.js → 9b196a726c6d175ca60f.js} +1 -1
- package/assets/esri/core/workers/chunks/bc002e4dff8859571a7a.js +1 -0
- package/assets/esri/core/workers/chunks/c5dd23d11fa91b0f318e.js +1 -0
- package/assets/esri/core/workers/chunks/c8f019d13f6b22481f2e.js +1 -0
- package/assets/esri/core/workers/chunks/f1ab86dbbd5b04e2a96c.js +1 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +18 -0
- package/assets/esri/themes/base/widgets/_ItemList.scss +13 -33
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ar.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_bg.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_bs.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ca.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_cs.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_da.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_de.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_el.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_es.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_et.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_fi.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_fr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_he.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_hr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_hu.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_id.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_it.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ja.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ko.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_lt.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_lv.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_nb.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_nl.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_pl.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_pt-BR.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_pt-PT.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ro.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_ru.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sk.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sl.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_sv.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_th.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_tr.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_uk.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_vi.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_zh-CN.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_zh-HK.json +1 -1
- package/assets/esri/widgets/Slice/t9n/Slice_zh-TW.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ar.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bg.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bs.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ca.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_cs.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_da.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_de.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_el.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_es.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_et.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fi.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_he.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hu.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_id.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_it.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ja.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ko.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lt.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lv.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nb.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-BR.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-PT.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ro.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ru.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sk.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sv.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_th.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_tr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_uk.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_vi.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-CN.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-HK.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-TW.json +1 -1
- package/chunks/ColorMaterial.glsl.js +16 -14
- package/interfaces.d.ts +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/environment/CloudsData.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/interfaces.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/support/buffer/glUtil.js +1 -1
- package/views/3d/support/buffer/workerHelper.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/interactive/tooltip/TransformTooltipInfos.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformRotate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformScale.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/Upload.js +5 -0
- package/widgets/Editor/UploadState.js +4 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureTemplates/ItemList.js +1 -1
- package/widgets/FeatureTemplates/TemplateItem.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/1ee774c3f29d8074da12.js +0 -1
- package/assets/esri/core/workers/chunks/2883a59fc1fc9e4d71af.js +0 -1
- package/assets/esri/core/workers/chunks/4d4cbfe72835c0460b09.js +0 -1
- package/assets/esri/core/workers/chunks/5bded2588008117d0c35.js +0 -1
- package/assets/esri/core/workers/chunks/9f02a0670ad73718d8f9.js +0 -1
- package/assets/esri/core/workers/chunks/ec73d16ef169adfc34fb.js +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_ar.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_bg.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_bs.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_ca.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_cs.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_da.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_de.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_el.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_en.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_es.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_et.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_fi.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_fr.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_he.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_hr.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_hu.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_id.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_it.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_ja.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_ko.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_lt.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_lv.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_nb.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_nl.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_pl.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_pt-BR.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_pt-PT.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_ro.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_ru.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_sk.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_sl.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_sr.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_sv.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_th.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_tr.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_uk.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_vi.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_zh-CN.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_zh-HK.json +0 -1
- package/assets/esri/widgets/Directions/t9n/Printout_zh-TW.json +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../core/Accessor.js";import{difference as r}from"../../../core/arrayUtils.js";import s from"../../../core/CollectionFlattener.js";import a from"../../../core/Evented.js";import n from"../../../core/Handles.js";import l from"../../../core/Logger.js";import{clamp as o}from"../../../core/mathUtils.js";import{releaseMaybe as h,destroyMaybe as d}from"../../../core/maybe.js";import p from"../../../core/ObjectPool.js";import u from"../../../core/PooledArray.js";import{throwIfAborted as c,isAbortError as _,isAborted as g,createAbortError as m}from"../../../core/promiseUtils.js";import{watch as T,syncAndInitial as y,sync as f,initial as v}from"../../../core/reactiveUtils.js";import{property as w}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/has.js";import{subclass as E}from"../../../core/accessorSupport/decorators/subclass.js";import{m as S}from"../../../chunks/mat4.js";import{c as L}from"../../../chunks/mat4f64.js";import{c as D}from"../../../chunks/vec3.js";import{c as P}from"../../../chunks/vec3f64.js";import{c as b}from"../../../chunks/vec4f64.js";import{WatchUpdatingTracking as C}from"../../../core/support/WatchUpdatingTracking.js";import{getReferenceEllipsoid as U}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as x,projectPointToVector as R}from"../../../geometry/projection.js";import M from"../../../geometry/SpatialReference.js";import{create as j,equals as A,intersection as I,empty as O,expand as V,intersectsSphere as k}from"../../../geometry/support/aaBoundingRect.js";import{create as B,copy as N}from"../../../geometry/support/frustum.js";import{isPlateCarree as F}from"../../../geometry/support/spatialReferenceUtils.js";import{isRefreshableLayer as q}from"../../../layers/mixins/RefreshableLayer.js";import{ElevationQueryTileCache as G}from"../../../layers/support/ElevationQueryTileCache.js";import{ElevationTileData as W}from"../../../layers/support/ElevationTileData.js";import{isBaseLayer as H}from"../../../layers/support/layerUtils.js";import{acquireDecoder as Q}from"../../../layers/support/LercDecoder.js";import{printAllocations as z}from"../../2d/engine/vectorTiles/VectorTile.js";import{directionToHeadingTilt as X}from"../support/cameraUtils.js";import Y from"../support/debugFlags.js";import{toBoundingRect as $}from"../support/extentUtils.js";import{ClientType as K}from"../support/index.js";import{updatingProgress as J}from"../support/updatingProperties.js";import{ElevationBounds as Z}from"./ElevationBounds.js";import{ElevationData as ee,sampleElevation as te}from"./ElevationData.js";import{create as ie}from"./ExtentHelper.js";import{LODSnapping as re,TextureUpdate as se}from"./interfaces.js";import{LayerClass as ae,LayerClasses as ne}from"./LayerClass.js";import{OverlayManager as le}from"./OverlayManager.js";import{PlanarPatch as oe}from"./PlanarPatch.js";import{RenderOrder as he}from"./RenderOrder.js";import{ScaleRangeQueries as de}from"./ScaleRangeQueries.js";import{SphericalPatch as pe}from"./SphericalPatch.js";import{SplitLimits as ue}from"./SplitLimits.js";import{MAX_ROOT_TILES as ce,TOO_MANY_ROOT_TILES_AFTER_CHANGE_ERROR as _e,TOO_MANY_ROOT_TILES_FOR_LAYER_ERROR as ge,MAX_MEMORY_LOD_BIAS as me,ELEVATION_NODATA_VALUE as Te}from"./TerrainConst.js";import{TerrainRenderer as ye,TransparencyMode as fe}from"./TerrainRenderer.js";import ve from"./TerrainSurfacePerformanceInfo.js";import{weakAssert as we,internalAssert as Ee,oppositeEdge as Se,isSurfaceLayerView as Le,isGroupLayerView as De,isMapTileLayerView as Pe,isBlendableLayerView as be,isElevationLayerView as Ce,isVectorTileLayerView as Ue,useFetchTileForLayer as xe,isImageryTileLayerView as Re,isTileLayerView as Me,releaseTileData as je,neighborEdgeIndices as Ae,ENABLE_TERRAIN_INTERNAL_CHECKS as Ie,ENABLE_WATERPROOFNESS_TESTS as Oe,enableTerrainInternalChecks as Ve,enableTerrainWaterproofnessChecks as ke}from"./terrainUtils.js";import{Tile as Be}from"./Tile.js";import{printAllocations as Ne}from"./TilePerLayerInfo.js";import{TileUpdate as Fe}from"./TileUpdate.js";import{IteratorPreorder as qe,IteratorPostorder as Ge,compareTilesByLij as We,hasLoadableSiblings as He,sortTilesByPOI as Qe,sortTiles as ze}from"./tileUtils.js";import{TilingSchemeLogic as Xe}from"./TilingSchemeLogic.js";import{UpsampleInfo as Ye}from"./UpsampleInfo.js";import{isCompositeBlendMode as $e,blendModeFromString as Ke}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{PBRMode as Je}from"../webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{RenderRequestType as Ze}from"../webgl-engine/lib/basicInterfaces.js";import{RenderState as et}from"../../support/RenderState.js";import{ImmediateTask as tt,TaskPriority as it,noBudget as rt}from"../../support/Scheduler.js";let st=class extends(a.EventedMixin(i)){constructor(e){super(e),this._scaleRangeQueries=new de,this._iteratorPool=new p(qe,(e=>e.remove=()=>this._iteratorPool.release(e))),this._postorderIterator=new Ge,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._visibleCached=!1,this._usedMemory=null,this._performanceInfo=new ve,this._viewChanged=!1,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=P(),this._eyePosSurfaceSR=P(),this._splitLimits=new ue,this._frustum=B(),this._viewProjectionMatrix=L(),this._layerViews=[new Array,new Array],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._handles=new n,this._watchUpdatingTracking=new C,this._frameTask=tt,this._allTiles=new u,this._upsampleInfoPool=new p(Ye),this._rootTilesExtent=j(),this.updatingProgress=.5,this._maxNumUpdating=1,this.maxTextureScale=1.2,this._spatialReference=M.WebMercator,this.visibleElevationBounds=new Z(1/0,-1/0),this.rootTileElevationBounds=new Z(1/0,-1/0),this._updatingRootTiles=!1,this._pendingTilesForElevationUpdateEvent=new Set,this._pendingTilesToUpdate=new Set,this.totalGeometryUpdates=0,this.totalTileUpdates=0,this.oneBatchPerFrameTask=!0,this._layerViewsDirty=!1,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._isWebMercator=!1,this._isWebMercatorOnPlateeCarree=!1,this.overlayManager=new le({...e,surface:this}),this._isGlobal=!e.view?.state?.isLocal}initialize(){this._lercDecoder=Q(this.view.resourceController),this._tilePool=this.view.state.isLocal?new p(oe):new p(pe);const e=this.view.resourceController.memoryController;this._upsampleMapCache=e.newCache("esri.views.3d.terrain.upsample",(e=>e.unloadMapData())),this._elevationQueryCache=new G(e.newCache("elevation-query")),this._handles.add([T((()=>this.overlayManager.hasHighlights),(e=>this._renderer.setNeedsHighlight(e))),T((()=>this.overlayManager.rendersOccluded),(e=>this._renderer.setRenderOccludedOverlay(e))),T((()=>this.overlayManager.renderer.isEmpty),(()=>this._evaluateTransparency()))],"overlayManager"),this._renderer=new ye({_overlayRenderer:this.overlayManager.renderer,_ellipsoidRadius:U(this.view.spatialReference).radius,_stage:this.view._stage,_allTiles:this._allTiles}),this._handles.add([T((()=>this.baseOpacity),(()=>{this._handleLayerViewChanges(),this._updateTileTextures(this._evaluateTransparency()?se.UNFADED:se.IMMEDIATE)}),y),T((()=>this.hasCompositeBlendMode),(()=>this._updateTileTextures(this._evaluateTransparency()?se.UNFADED:se.IMMEDIATE)),y),T((()=>this.renderingDisabled),(()=>this.view?._stage?.renderer.setParameters({terrainRenderingEnabled:!this.renderingDisabled})),f),T((()=>this.backgroundColor),(e=>{this._handleLayerViewChanges(),this._renderer.updateTileBackground(e)}),y),T((()=>this.snapLevel),(()=>this._viewChanged=!0),f),T((()=>this.view.pointsOfInterest),(e=>{this._renderer.pointsOfInterest=e,this._watchUpdatingTracking.removeAll(),e&&this._watchUpdatingTracking.add((()=>e.focus.renderLocation),(()=>this._allTilesSorted=!1))})),T((()=>Y.TERRAIN_TILE_TREE_SHOW_TILES),(e=>{e&&!this._treeDebugger?import("../layers/support/TerrainTileTree3DDebugger.js").then((({TerrainTileTree3DDebugger:e})=>{!this._treeDebugger&&Y.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new e({view:this.view}))})):e||(this._treeDebugger=d(this._treeDebugger))}),v)]);const{spatialReference:t}=this.view;this._extentHelper=ie(this.viewingMode,{layers:this.view.map.allLayers,layerViews:this.view.allLayerViews,viewSpatialReference:t});const i=new s({getCollections:()=>this.view?.defaultsFromMap?.mapCollections?.map((({layers:e})=>e)),getChildrenFunction:e=>e&&"layers"in e?e.layers:null}),r=new Xe({layers:i,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:t});this._set("tilingSchemeLogic",r),this._updateTilingScheme(),this._elevationDataRequester=this.view.resourceController.createStreamDataRequester(K.ELEVATION),this._mapDataRequester=this.view.resourceController.createStreamDataRequester(K.BASEMAP);const a=this.view.resourceController.scheduler;this._frameTask=a.registerTask(it.TERRAIN_SURFACE,this),this._handles.add([T((()=>this._extentHelper.stencilEnabledExtents),(e=>this._renderer.setStencilEnabledLayerExtents(e)),v),T((()=>this.tilingSchemeLogic.tilingScheme),(()=>this._updateTilingScheme()),f),T((()=>this.extent),(()=>this._updateRootTiles()),v),this.view.on("resize",(()=>this._viewChangeUpdate())),T((()=>{const e=this.view,t=e.state;return[this._lodBias,this.lodSnapping,e.resourceController?.memoryController?.memoryFactor,t.camera,t.contentCamera,t.fixedContentCamera]}),(()=>this._viewChangeUpdate()),y),T((()=>this.view.qualitySettings?.tiledSurface?.textureFadeDuration),(e=>this._renderer.textureFadingEnabled=e>0),v),T((()=>this.view.qualitySettings?.physicallyBasedRenderingEnabled),(e=>this._renderer.pbrMode=e?Je.Terrain:Je.Disabled),v),T((()=>this._userClippingExtent),(()=>this._updateClippingExtent()),f)]),this._handles.add(this.view.allLayerViews.on("after-changes",(()=>this._layerViewsDirty=!0))),this._layerViewsDirty=!0,this._handleLayerViewChanges()}destroy(){this._frameTask.remove(),this._handles.destroy(),this._watchUpdatingTracking.destroy(),this._lercDecoder=h(this._lercDecoder),this._removeAllTiles(),this._upsampleMapCache=d(this._upsampleMapCache),this._elevationQueryCache=d(this._elevationQueryCache),this._set("tilingSchemeLogic",d(this.tilingSchemeLogic)),this._basemapLayerViewHandles.forEach(((e,t)=>this._unregisterTiledLayerView(t))),this._elevationDataRequester=null,this._mapDataRequester=null,this._set("overlayManager",d(this.overlayManager)),this._tilePool=d(this._tilePool),Be.prune(),this._treeDebugger=d(this._treeDebugger),this._renderer=d(this._renderer),this._iteratorPool=d(this._iteratorPool),this._set("view",null),this._extentHelper=d(this._extentHelper),this._upsampleInfoPool=d(this._upsampleInfoPool),z(),Ne()}get renderer(){return this._renderer}get frustum(){return this._frustum}get snapLevel(){if(this.lodSnapping===re.ON){const e=this.view,t=this.tilingScheme,i=e.pointsOfInterest?.cameraOnSurface?.scale;if(t&&i){const r=e.state.contentCamera;let s=X(e,r.eye,r.viewForward,r.up).tilt;s>90&&(s=180-s);const a=2*(s/90)**2,n=t.levelAtScale(i)-a,l=Math.min(n,this._splitLimits.maxLod||1/0);return l<=0?null:l}}return null}get lodSnapping(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences?re.ON:re.OFF}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get mapTileRequester(){return this._mapDataRequester}get _userClippingExtent(){const{spatialReference:e}=this,{clippingArea:t}=this.view;if(null==t||null==e)return null;const i=j(),r=$(t,i,e)?i:null,s=this._get("extent");return A(r,s)?s:r}get rootTilesExtent(){return this._rootTilesExtent}get extent(){const e=I(this.groundExtent,this._userClippingExtent,j()),t=this._get("extent");return A(e,t)?t:e}get groundExtent(){return null!=this._tilingSchemeExtent?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){return this.tilingSchemeLogic?.extent}get updating(){return this._hasPendingUpdates||(this._maxNumUpdating=1),!!((this.running||this._watchUpdatingTracking?.updating||this._asyncWorkItems>0)&&this.ready&&!this.suspended||this.overlayManager?.updating)}get running(){return(this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||!this._allTilesSorted||this._layerViewsDirty||this._scaleRangeQueries.updating||this._frameTask.updating)&&this.ready&&!this.suspended}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get baseOpacity(){return this.view?.map?.ground?.opacity??1}set baseOpacity(e){this.view.map.ground.opacity=e}get viewingMode(){return this.view.state.viewingMode}get ready(){return null!=this._rootTiles}set renderOrder(e){this._renderer.renderOrder=e,this._set("renderOrder",e)}get rootTiles(){return this._rootTiles}get spatialReference(){return this.tilingScheme?.spatialReference??null}get backgroundColor(){return this.view.map.ground.surfaceColor}set backgroundColor(e){this.view.map.ground.surfaceColor=e}set slicePlaneEnabled(e){this._renderer.slicePlaneEnabled=e,this._set("slicePlaneEnabled",e),this._evaluateTransparency()}get tilingSchemeLocked(){return this.tilingSchemeLogic?.tilingSchemeLocked??!1}set velvetOverground(e){this._renderer.velvetOverground=e,this._set("velvetOverground",e)}get wireframe(){return this._renderer.wireframe}set wireframe(e){e!==this._renderer.wireframe&&(this._renderer.wireframe=e,this._updateAllTileGeometries())}set _visible(e){e!==this._visibleCached&&(this._visibleCached=e,this._renderer.setVisibility(e),this.suspended=!e)}get opaque(){return this._renderer.transparency===fe.Opaque}set suspended(e){this._set("suspended",e),this._viewChangeUpdate()}get textureFadeDuration(){return this.view.qualitySettings.tiledSurface.textureFadeDuration??0}intersect(e,t,i,r){this._renderer.intersect(e,t,i,r)}getElevation(e,t,i,r){const s=this._rootTiles;if(null==s||!s.length)return null;if(0===s[0].layerInfo[ae.ELEVATION].length)return null;const a=ht;if(a[0]=e,a[1]=t,a[2]=i,!x(a,r,a,this._spatialReference))return l.getLogger(this.declaredClass).error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;return gt(s,a[0],a[1])}getElevations(e,t,i){const r=this._rootTiles,s=r?r[0].layerInfo[ae.ELEVATION].length:0;if(null!=r&&r.length&&0!==s)for(let a=0;a<t;++a){const t=3*a;i(a,gt(r,e[t],e[t+1]))}else for(let a=0;a<t;++a)i(a,null)}getScale(e){if(!this.tilingScheme)return null;if(!R(e,ht,this.spatialReference))return l.getLogger(this.declaredClass).error("TerrainSurface.getScale(): could not project given point to tiling scheme coordinate system"),null;const t=this._rootTiles;if(null!=t)for(const i of t)if(i?.containsPoint(ht)){let e=i;for(;e.children[0]&&!e.rendered;){const t=e.children[0].extent;let i=0;ht[0]>t[2]&&(i+=1),ht[1]<t[1]&&(i+=2),e=e.children[i]}return this._getLodBiasCorrectedScale(e.level)}return 1/0}getSphereElevationBounds(e,t){if(ht[0]=e[0],ht[1]=e[1],ht[2]=e[2],ht[3]=e[3],!x(ht,t,ht,this.tilingScheme?.spatialReference))return l.getLogger(this.declaredClass).error("TerrainSurface.getSphereElevationBounds(): could not project given point to tiling scheme coordinate system"),null;let i=1/0,r=-1/0;const s=e=>{if(e&&k(e.extent,ht))if(e.isLeaf||e.rendered)i=Math.min(i,e.elevationBounds[0]),r=Math.max(r,e.elevationBounds[1]);else for(const t of e.children)s(t)},a=this._rootTiles;if(null!=a)for(const n of a)s(n);return{min:i,max:r}}getSphereScale(e,t){if(!this.tilingScheme)return null;if(!R(e,ht,this.spatialReference))return l.getLogger(this.declaredClass).error("TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system"),null;ht[3]=t;let i=null;const r=e=>{if(e&&k(e.extent,ht)){const t=e.children;if(t[0]&&!e.rendered)for(const e of t)r(e);else{const t=this._getLodBiasCorrectedScale(e.level);i=null==i?t:Math.min(i,t)}}},s=this._rootTiles;if(null!=s)for(const a of s)r(a);return i}queryVisibleScaleRange(e,t,i,r){const s=t?this.tilingScheme.levelAtScale(t):0,a=i?this.tilingScheme.levelAtScale(i):1/0,n=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(e,s+n,a+n,r)}_evaluateTransparency(){const e=this.baseOpacity,t=this.overlayManager.renderer.isEmpty,i=this._renderer.transparency,r=this._allSurfaceLayersTransparent()?t?fe.Empty:fe.TransparentWithDraped:e>=1&&!this.hasCompositeBlendMode&&!this._renderer.slicePlaneEnabled?fe.Opaque:fe.Semitransparent,s=i!==r;return s&&(this._renderer.transparency=r,this.view?._stage?.renderer.setParameters({terrainTransparency:this._renderer.transparency})),s}_updateTilingScheme(){const e=this.tilingSchemeLogic.tilingScheme;if(!(e!==this.tilingScheme))return;we(!!e,"tiling scheme cannot be reset to undefined"),this._isGlobal=!this.view?.state?.isLocal,this.tilingScheme&&this._removeAllTiles();const t=e?.spatialReference??M.WebMercator;this._spatialReference=t,this._isWebMercator=!!t?.isWebMercator,this._isWebMercatorOnPlateeCarree=this._isWebMercator&&F(this.view?.renderSpatialReference),this._set("tilingScheme",e),this._updateClippingExtent(),e&&(this._updateTiledLayers(),this._renderer.setTileSize(e.pixelSize),this.overlayManager.setSpatialReference(e.spatialReference),this._updateRootTiles())}_acquireTile(e,t,i,r){const s=this._tilePool.acquire();return pt[0]=e,pt[1]=t,pt[2]=i,s.init(pt,r,this),s}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){const{extent:e,tilingScheme:t}=this;if(!t)return;const i=dt;let s=t.rootTilesInExtent(e,i,5*ce);if(null!=this._rootTiles){if(s.length>ce)return void l.getLogger(this.declaredClass).warn(_e);const e=this._rootTiles.map((e=>e.lij)),t=r(e,s,nt);if(this._updatingRootTiles=!0,t.removed.length>0||t.added.length>0){const e=this._rootTiles.filter((e=>!(t.removed.findIndex((t=>nt(t,e.lij)))>-1)||(this._purgeTile(e),!1)));t.added.forEach((t=>e.push(this._newRootTile(t)))),this._setRootTiles(e)}}else this._updatingRootTiles=!0,s.length>ce&&(l.getLogger(this.declaredClass).warn(ge),s=t.rootTilesInExtent(e,i,ce)),this._setRootTiles(s.map((e=>this._newRootTile(e))));A(i,this._rootTilesExtent)||(this._rootTilesExtent=j(i)),this._visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange("ready"),this._updateAllTileGeometries(),this._updatingRootTiles=!1,this.checkAllTilesWaterproofness()}_updateAllTileGeometries(){const e=this._allTiles.filter((e=>e.isLoaded&&e.intersectsClippingArea));e.forEach((e=>this._renderer.updateTileGeometryState(e))),e.forEach((e=>e.renderData.updateNeighborData())),this._updateTilesGeometries(e),this._pendingTilesToUpdate.clear()}_updateTilesGeometries(e){if(0===e.length)return;e.sort(We);const t=this.renderer;e.forEach((e=>t.updateGeometryIfNeeded(e))),e.forEach((e=>this._pendingTilesForElevationUpdateEvent.add(e)))}_shouldSplit(e){return e.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)===Fe.SPLIT}_newRootTile(e){const t=this._acquireTile(0,e[1],e[2],null);return this._shouldSplit(t)&&t.setPendingUpdate(Fe.SPLIT),this._loadTile(t),this._markTileToUpdate(t),this._updateRootTileElevationBounds(),t}_setRootTiles(e){if(this._rootTiles=e,this._allTiles.clear(),null!=e){const t=this._iteratorPool.acquire();for(t.reset(e);!t.done;)this._allTiles.push(t.next());t.remove()}this._renderer.setRootTiles(this._rootTiles),this._updateTilesVisibility(e)}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&&this.tilingScheme&&this._visibleCached&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)))}_updateClippingStatus(e){e.updateClippingStatus(this.extent)&&e.resetPendingUpdate(Fe.GEOMETRY)&&this._updateTileGeometryState(e)}_updateTilesVisibility(e){if(null==e)return;const t=He(e),i=this.visibleElevationBounds;let r=t?i.min:1/0,s=t?i.max:-1/0;const a=this.extent,n=this._viewProjectionMatrix;this.setTileTreeDirty();const l=this._iteratorPool.acquire();for(l.reset(e);!l.done;){const e=l.next();e.updateClippingStatus(a)&&e.resetPendingUpdate(Fe.GEOMETRY)&&this._updateTileGeometryState(e),e.setPendingUpdate(Fe.RENDERDATA),e.computeVisibility(),e.updateScreenDepth(n),e.renderData&&(r=Math.min(e.elevationBounds[0],r),s=Math.max(e.elevationBounds[1],s))}l.remove(),this._viewChanged=!0,this._allTilesDirty=!0,this._batchUpdatePendingTileGeometries(),isFinite(r)&&isFinite(s)&&(i.min!==r||i.max!==s)&&(this.visibleElevationBounds=new Z(r,s))}_updateRootTileElevationBounds(){let e=1/0,t=-1/0;const i=this._rootTiles;null!=i&&i.forEach((({elevationBounds:i})=>{e=Math.min(e,i[0]),t=Math.max(t,i[1])}));const r=this.rootTileElevationBounds;r.min===e&&r.max===t||(this.rootTileElevationBounds=new Z(e,t))}_updateViewDependentParameters(){const{camera:e,contentCamera:t}=this.view.state,i=Math.tan(.5*t.fovX),r=Math.tan(.5*t.fovY),s=this.tilingScheme.pixelSize,a=2**-this._lodBias*e.pixelRatio;this._splitLimits.aboveGround=e.aboveGround,this._splitLimits.fovX=i,this._splitLimits.fovY=r,this._splitLimits.relativeWidthLimit=s/e.width*this.maxTextureScale*a,this._splitLimits.relativeHeightLimit=s/e.height*this.maxTextureScale*a,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?(null==this._splitLimits.frustum&&(this._splitLimits.frustum=B()),N(this._splitLimits.frustum,t.frustum)):this._splitLimits.frustum=null,N(this._frustum,e.frustum),S(this._viewProjectionMatrix,t.projectionMatrix,t.viewMatrix),D(this._eyePosRenderSR,t.eye),x(e.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateRenderData(e){e.rendered&&!e.shouldLoad&&(lt(e)?this._loadChildren(e):ot(e)&&this._loadParent(e))}_updateTileGeometryState(e){e.updateVisibility();this._renderer.updateTileGeometryState(e)&&this._markTileToUpdate(e),this._usedMemory=null}_markAllTileNeighborsForGeometryUpdate(e){const t=this._pendingTilesToUpdate;e.forEachLoadedNeighbor((e=>{t.add(e)}))}_updateTileTexture(e,t){const i=e.resetPendingUpdate(Fe.TEXTURE_FADING)?Fe.TEXTURE_FADING:!!e.resetPendingUpdate(Fe.TEXTURE_NOFADING)&&Fe.TEXTURE_NOFADING;i&&(this._renderer.updateTileTexture(e,i),this._usedMemory=null,t.madeProgress())}_emitElevationUpdateEventForTiles(){const e=ct.extent;O(e),this._pendingTilesForElevationUpdateEvent.forEach((t=>V(e,t.extent,e))),this._pendingTilesForElevationUpdateEvent.clear(),ct.spatialReference=this.spatialReference,this.emit("elevation-change",ct)}runTask(e){this._handleLayerViewChanges(e),this._frameTask.processQueue(e),this.renderer.processScaleRangeQueries(this._scaleRangeQueries,e),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateAllTilesStatus(e),this._sortTiles(e);const t=!this.view.state.fixedContentCamera;this._mergeAndSplit(e,t),this._updateElevation(e),this._updateTextures(e),t||this._mergeAndSplit(e,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty(),this._batchUpdatePendingTileGeometries(),this._emitElevationUpdateEventForTiles(),e.done&&e.hasProgressed&&this.requestUpdate(),this.notifyChange("updatingProgressValue")}_updateAllTilesStatus(e){if(!this._viewChanged||!this._rootTiles||e.done)return;this._viewChanged=!1;const t=this._iteratorPool.acquire();t.reset(this._rootTiles);const i=this.snapLevel,r=this._splitLimits,s=this._eyePosRenderSR;for(;!t.done;){const e=t.next(),a=e.shouldSplit(r,s,i);if(a!==Fe.SPLIT){if(e.resetPendingUpdate(Fe.SPLIT)&&e.updateAgentSuspension(),a===Fe.ELEVATION&&e.updateAgents(ae.ELEVATION),t.skipSubtree(),!e.isLeaf){e.setPendingUpdate(Fe.MERGE),e.resetPendingUpdate(Fe.SPLIT);const t=this._iteratorPool.acquire();t.resetOne(e);const i=this._viewProjectionMatrix;for(let e=t.next();!t.done;e=t.next())this._updateClippingStatus(e),e.updateVisibility(),e.updateScreenDepth(i);t.remove()}}else e.resetPendingUpdate(Fe.MERGE),e.isLeaf&&(e.setPendingUpdate(Fe.SPLIT),t.skipSubtree()),e.rendered&&e.setPendingUpdate(Fe.RENDERDATA)}t.remove(),this.requestUpdate(),(this.shortBatches||!this.oneBatchPerFrameTask)&&this._batchUpdatePendingTileGeometries(),e.madeProgress()}_sortTiles(e){e.done||this._allTilesSorted||(Qe(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger&&this._treeDebugger.update(),e.madeProgress())}_markTileToUpdate(e){Ee(e.isLoaded),e.intersectsClippingArea&&(this._pendingTilesToUpdate.add(e),this._markAllTileNeighborsForGeometryUpdate(e))}_batchUpdatePendingTileGeometries(){const e=this._pendingTilesToUpdate;if(0===e.size)return;const t=Array.from(this._pendingTilesToUpdate.keys()).filter((e=>e.isLoaded&&e.intersectsClippingArea)),i=(i,r)=>{!r?.isLoaded||!r.intersectsClippingArea||r.level<i.level||e.has(r)||(e.add(r),t.push(r),r.renderData.updateNeighborData())};t.sort(We);const r=t.length;for(let s=0;s<r;++s){const r=t[s];Ee(r.isLoaded),Ee(r.intersectsClippingArea);const a=r.renderData;a.updateNeighborData();const n=a._dirtyEdgeResolutions,l=a.geometryState.neighborData;for(let t=0;t<4;++t)if(n&1<<t){const s=a.geometryState.neighborData.edgePeerNeighbors[t];s&&s?.level>=r.level&&s.forAllSubtreeOnSide(Se(Ae[t]),(t=>!(!t.isLoaded||!t.intersectsClippingArea)&&(Ee(e.has(t)||We(r,t)<0),i(r,t),!0))),i(r,l.cornerPeerNeighbors[t]),i(r,l.cornerPeerNeighbors[(t+1)%4])}}e.clear(),this._updateTilesGeometries(t),Ie&&Oe&&this.checkAllTilesWaterproofness()}_mergeAndSplit(e,t){if(this.suspended||e.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let i=!1;const r=this.view.state.fixedContentCamera;let s=!1;for(;!e.done;){s=!0;let a=!1;const n=!this._allTiles.some((s=>{if(!i&&!r&&!s.visible)return e.done;let n=s;if(s.resetPendingUpdate(Fe.MERGE)){if(!t)return s.setPendingUpdate(Fe.MERGE),e.done;for(;n.parent?.resetPendingUpdate(Fe.MERGE);)n=n.parent;this._mergeTile(n),a=!0,e.madeProgress()}else s.resetPendingUpdate(Fe.SPLIT)&&(this._splitTile(s),a=!0,e.madeProgress());return!e.done&&n===s&&s.resetPendingUpdate(Fe.RENDERDATA)&&(this._updateRenderData(s),e.madeProgress()),e.done}));if(a&&(this._allTilesSorted=!1,this._allTilesDirty=!0),n){if(!i){i=!0;continue}if(!a)break}else this._allTilesDirty=!0}s?e.madeProgress():this._allTilesDirty=!0,!this.oneBatchPerFrameTask&&this._batchUpdatePendingTileGeometries(),this._sortTiles(e)}_updateElevation(e){e.done||(this._allTiles.some((t=>(t.resetPendingUpdate(Fe.GEOMETRY)&&(this._updateTileGeometryState(t),this._updateTileTexture(t,e),this.shortBatches&&this._batchUpdatePendingTileGeometries(),e.madeProgress()),e.done))),!this.oneBatchPerFrameTask&&this._batchUpdatePendingTileGeometries())}_updateTextures(e){e.done||this._allTiles.some((t=>(this._updateTileTexture(t,e),e.done)))}_updateClippingExtent(){this.spatialReference&&(this.updateTileOverlayParams(Ze.UPDATE),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){const e=this.view.resourceController.memoryController.memoryFactor;return this.view.qualitySettings.tiledSurface.lodBias-(1-e)*me}_getLodBiasCorrectedScale(e){const t=this.tilingScheme.levels,i=o(e-this._lodBias,0,t.length-1),r=i-Math.floor(i);return t[Math.floor(i)].scale*(1-r)+t[Math.ceil(i)].scale*r}_removeAllTiles(){null!=this._rootTiles&&(this._rootTiles.forEach((e=>this._purgeTile(e))),this._setRootTiles(null),this.notifyChange("ready")),this._allTiles.clear(),this._visible=!1}_purgeDescendantTiles(e){if(!e.children[0])return!1;let t=!1;for(let i=0;i<4;++i)t=this._purgeTile(e.children[i])||t;return e.unsetChildren(),t}_purgeTile(e){const t=this._purgeDescendantTiles(e)||e.rendered;return this._allTiles.removeUnordered(e),this._unloadTile(e),this._tilePool.release(e),t}_unloadTile(e){this._pendingTilesToUpdate.delete(e),this._pendingTilesForElevationUpdateEvent.delete(e),e.unload(this._renderer)}_splitTile(e){we(e.isLeaf,"tile that is already split should not be split again!");const t=e.level+1,i=2*e.lij[1],r=2*e.lij[2];e.setChildren(this._createTile(t,i,r,e),this._createTile(t,i,r+1,e),this._createTile(t,i+1,r,e),this._createTile(t,i+1,r+1,e)),e.setPendingUpdate(Fe.RENDERDATA),e.updateAgentSuspension(),this._allTiles.pushArray(e.children),this._allTilesDirty=!0,++this._performanceInfo.numSplit}_emitTileScaleChange(e,t=e.level){_t.spatialReference=this.spatialReference,_t.extent=e.extent,_t.scale=this._getLodBiasCorrectedScale(t),this.emit("scale-change",_t)}_createTile(e,t,i,r){we(!!r,"_createTile sanity check");const s=this._acquireTile(e,t,i,r);return s.updateClippingStatus(this.extent),s.updateScreenDepth(this._viewProjectionMatrix),this._shouldSplit(s)&&s.setPendingUpdate(Fe.SPLIT),s}get shortBatches(){return this.view.state.mode!==et.IDLE}_mergeTile(e){we(!e.hasPendingUpdate(Fe.SPLIT),"_mergeTile sanity check"),this._purgeDescendantTiles(e)&&(we(!e.renderData,"_mergeTile sanity check"),this._loadTile(e),this._markTileToUpdate(e),this._emitTileScaleChange(e),this.shortBatches&&this._batchUpdatePendingTileGeometries()),this._allTilesDirty=!0,++this._performanceInfo.numMerged}_loadChildren(e){we(e.rendered,"parent should be rendered"),this._unloadTile(e);const t=e.children;t.forEach((e=>this._loadTile(e))),t.forEach((e=>this._pendingTilesToUpdate.add(e))),this._markAllTileNeighborsForGeometryUpdate(e),this._emitTileScaleChange(e,e.level+1),this.shortBatches&&this._batchUpdatePendingTileGeometries()}_loadParent(e){const t=e.parent;this._unloadChildren(t),this._loadTile(t),this._markTileToUpdate(t),this._emitTileScaleChange(t,t.level),this.shortBatches&&this._batchUpdatePendingTileGeometries()}_unloadChildren(e){const t=e.children;if(t[0])for(let i=0;i<4;++i){const e=t[i];this._unloadChildren(e),this._unloadTile(e)}}_loadTile(e){e.load(),e.setPendingUpdate(Fe.RENDERDATA),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager&&this.overlayManager.hasOverlays&&this.overlayManager.setTileParameters(e)}_elevationDataArrived(e,t,i){const r=new ee(e.lij,e.extent,i);e.dataArrived(t,ae.ELEVATION,r);const s=[e],a=e.level,n=this._iteratorPool.acquire();for(n.reset(s);!n.done;){const e=n.next();e.findElevationBoundsForLayer(t,a),e.computeElevationBounds()}0===a&&this._updateRootTileElevationBounds(),n.remove(),this._updateTilesVisibility(s)}_handleLayerViewChanges(e=rt){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let t=!1;const i=new Set;let r=-1;for(const s of this.view.allLayerViews.items)if(i.add(s.uid),Le(s)||De(s))if(this._basemapLayerViewHandles.has(s.uid)&&!De(s)){const e=this._layerClassFromLayerView(s),i=this._getLayerIdxByUID(e,s.uid);null!=i&&((i<r||null==r)&&(t=!0),r=i)}else this._registerTiledLayerView(s),s.layer.loaded&&(t=!0);this._basemapLayerViewHandles.forEach(((e,r)=>{i.has(r)||(this._unregisterTiledLayerView(r),t=!0)})),t&&this._updateTiledLayers(),this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._evaluateTransparency(),e.madeProgress()}_allSurfaceLayersTransparent(){let e=0===this.view.map?.ground?.opacity;for(const t of this.view.allLayerViews.items)if(Pe(t)&&!H(t.layer)&&0!==t.fullOpacity)return e=!1,e;return e}_hasCompositeBlendMode(){for(const e of this.view.allLayerViews.items)if((be(e)||De(e))&&$e(Ke[e.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(e){return Ce(e)?ae.ELEVATION:ae.MAP}_registerTiledLayerView(e){const t=[];if((be(e)||De(e))&&t.push(T((()=>e.layer.blendMode),(()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._updateTileTextures(se.UNFADED)}))),!De(e)){const i=this._layerClassFromLayerView(e);t.push(T((()=>e.suspended),(()=>this._updateTiledLayers()))),t.push(T((()=>e.fullOpacity),(()=>this._updateTileTextures(se.UNFADED)))),t.push(T((()=>"effectiveScaleRange"in e.layer?e.layer.effectiveScaleRange:null),(()=>this._restartAllAgents(i)))),t.push(e.on("data-changed",(()=>{const t=this._getLayerIdxByUID(i,e.uid);null!=t&&this._invalidateLayerData(t,i)})))}this._unregisterTiledLayerView(e.uid),this._basemapLayerViewHandles.set(e.uid,t)}_unregisterTiledLayerView(e){const t=this._basemapLayerViewHandles.get(e);if(t){for(const e of t)e.remove();this._basemapLayerViewHandles.delete(e)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;const e=this.view.allLayerViews,t=[[],[]];let i=null;e.forEach((e=>{if(!e.layer||e.suspended||!Le(e)||!e.fullExtent)return;const r=this._layerClassFromLayerView(e);if(r===ae.MAP){const t=e.displayLevelRange.maxLevel;t!==1/0&&(null===i||t>i)&&(i=t)}t[r].push(e)}));for(const r of ne){const e=this._layerViews[r],i=t[r];i.reverse();const s=i.length;let a=e.length!==s;const n=new Array(s),l=new Array(e.length);this._layerIndexByUid[r].clear();for(let t=0;t<s;t++){const s=i[t].uid;this._layerIndexByUid[r].set(s,t);const o=e.indexOf(i[t]);n[t]=o,t!==o&&(a=!0),o>-1&&(l[o]=t)}if(a){const e=this._postorderIterator;for(e.reset(this._rootTiles);!e.done;)e.next().modifyLayers(l,n,r);this._layerViews[r]=i,this._restartAllAgents(r),this._updateTilesVisibility(this._rootTiles)}}this.tilingScheme.ensureMaxLod(i)&&this._viewChangeUpdate()}_restartAllAgents(e){const t=this._postorderIterator;for(t.reset(this._rootTiles);!t.done;){const i=t.next();i.restartAgents(e),e===ae.ELEVATION&&i.computeElevationBounds()}this._updateRootTileElevationBounds()}layerViewByIndex(e,t){return this._layerViews[t][e]}numLayers(e){return this._layerViews[e].length}_updateTileTextures(e){this._allTiles.forAll((t=>{t.updateAgents(ae.MAP),e===se.IMMEDIATE?this.renderer.updateTileTexture(t,Fe.TEXTURE_NOFADING):t.updateRenderData(ae.MAP,e)})),this._evaluateTransparency()}_invalidateLayerData(e,t){this._allTiles.forAll((i=>i.removeLayerAgent(e,t))),this._allTiles.forAll((i=>i.invalidateLayerData(e,t)))}setTileTreeDirty(){this._allTilesDirty=!0}requestRender(e=Ze.UPDATE){this.renderer.setNeedsRender(e)}requestUpdate(){1==++this._pendingUpdates&&(this._hasPendingUpdates=!0)}requestTileData(e,t,i,r){const s=this.layerViewByIndex(t,i),a=s.layer;return!a.tilemapCache||Ue(s)?this._requestTileData(e,i,s,r):(++this._asyncWorkItems,a.tilemapCache.fetchAvailability(e.lij[0],e.lij[1],e.lij[2],{...r,timeout:6e3}).then((()=>--this._asyncWorkItems)).catch((t=>{throw--this._asyncWorkItems,c(r),_(t)||this._dataMissing(e,i,s,{notInTilemap:!0}),t})).then((()=>this._frameTask.schedule((()=>this._requestTileData(e,i,s,r)),r.signal))))}_requestTileData(e,t,i,r){return t===ae.ELEVATION?Ce(i)?this._requestElevationTileData(e,i,r):Promise.reject():Pe(i)?this._requestMapTileData(e,i,r):Promise.reject()}_requestElevationTileData(e,t,i){++this._asyncWorkItems;const r=r=>{if(g(i))return;const s=this._layerIndexByUid[ae.ELEVATION].get(t.uid);null!=s?(this._usedMemory=null,this.requestUpdate(),this._elevationDataArrived(e,s,r)):l.getLogger(this.declaredClass).warn("TerrainSurface: received data from unknown layer %d %s",ae.ELEVATION,e.lij.toString())},s=i=>{_(i)||(this._dataMissing(e,ae.ELEVATION,t,i),this.requestUpdate())};if(xe(t.layer))return t.layer.fetchTile(e.lij[0],e.lij[1],e.lij[2],{noDataValue:Te,signal:i.signal}).then((e=>{if(!g(i))return this._frameTask.schedule((()=>r(e)),i.signal,s);l.getLogger(this.declaredClass).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true.")}),s).finally((()=>{--this._asyncWorkItems}));const a=t.getTileUrl(e.lij[0],e.lij[1],e.lij[2]);return this._elevationDataRequester.request(a,"binary",i).then((e=>this._lercDecoder.decode(e,{noDataValue:Te},i.signal))).then((e=>{e?r(new W(e)):s(new Error("LERC decoding failed"))}),s).finally((()=>{--this._asyncWorkItems}))}_requestMapTileData(e,t,i){++this._asyncWorkItems;const r=(r,s)=>{--this._asyncWorkItems,je(s),g(i)||(this._dataMissing(e,ae.MAP,t,r),this.requestUpdate())},s=e=>t=>r(t,e),a=r=>this._frameTask.schedule((()=>{--this._asyncWorkItems,this.requestUpdate(),g(i)?je(r):this._mapTileDataArrived(e,t,r)}),i.signal,s(r)).catch(s(r)),n=(e,t=null)=>this._frameTask.schedule((()=>r(e,t)));if(Ue(t)){const r=t.schemaHelper.getLevelRowColumn(e.lij);return t.fetchTile(r[0],r[1],r[2],i).then(a,n)}if(Re(t))return t.fetchTile(e.lij[0],e.lij[1],e.lij[2],i).then(a,n);if(Me(t)&&xe(t.layer))return t.layer.fetchTile(e.lij[0],e.lij[1],e.lij[2],i).then((e=>{if(g(i))return l.getLogger(this.declaredClass).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."),void n(m());a(e)}),n);let o=t.getTileUrl(e.lij[0],e.lij[1],e.lij[2]);q(t.layer)&&t.layer.refreshTimestamp&&(o+=`${o.includes("?")?"&":"?"}_ts=${t.layer.refreshTimestamp}`);const h=t.hasMixedImageFormats?"image+type":"image";return this._mapDataRequester.request(o,h,i).then(a,n)}_mapTileDataArrived(e,t,i){const r=this._getLayerIdxByUID(ae.MAP,t.uid);null!=r?e.dataArrived(r,ae.MAP,i):(je(i),l.getLogger(this.declaredClass).warn("TerrainSurface: received data from unknown layer"))}_getLayerIdxByUID(e,t){return this._layerIndexByUid[e].get(t)}_dataMissing(e,t,i,r){const s=this._getLayerIdxByUID(t,i.uid);null!=s?e.dataMissing(s,t,r):l.getLogger(this.declaredClass).warn("TerrainSurface: received data from unknown layer")}updateTileOverlayParams(e){this._rootTiles&&this.overlayManager&&(this._allTiles.forAll((e=>{e.renderData&&this.overlayManager.setTileParameters(e)})),this._renderer.setNeedsRender(e))}get performanceInfo(){const e=this._performanceInfo;return e.numNodes=this._allTiles.length,e.numLeaves=e.numVisible=e.numRendered=e.numLoadedPerLevel.length=e.numRenderedPerLevel.length=0,this._allTiles.forAll((t=>{t.isLeaf&&e.numLeaves++;const i=t.level;t.renderData&&(e.numLoadedPerLevel[i]=(e.numLoadedPerLevel[i]||0)+1),t.visible&&(e.numVisible++,t.rendered&&(e.numRenderedPerLevel[i]=(e.numRenderedPerLevel[i]||0)+1,e.numRendered++))})),e}get usedMemory(){return this.tilingScheme?(null==this._usedMemory&&(this._usedMemory=this._recalculateUsedMemory()),null!=this._usedMemory?this._usedMemory:0):0}_recalculateUsedMemory(){return this.tilingScheme?this._allTiles.reduce(((e,t)=>e+t.usedMemory),0):null}getUsedMemoryForLayerView(e){let t=0;const i=this._layerClassFromLayerView(e),r=this._getLayerIdxByUID(i,e.uid);return null!=r&&this._allTiles.forAll((e=>t+=e.getUsedMemoryForLayer(i,r))),t}getTile(e){if(null==e||null==this._rootTiles)return null;const t=e.split("/").map((e=>+e));if(0===t[0])return this._rootTiles.find((e=>e.lij[1]===t[1]&&e.lij[2]===t[2]));const i=2**t[0],r=Math.floor(t[1]/i),s=Math.floor(t[2]/i);let a;if(this._rootTiles.some((e=>e.lij[1]===r&&e.lij[2]===s&&(a=e,!0))),a){let e=1<<t[0]-1;for(;a.lij[0]<t[0];){let i=t[1]&e?2:0;if((t[2]&e)>0&&i++,!a.children[i])return null;a=a.children[i],e>>=1}return we(a.lij[0]===t[0]&&a.lij[1]===t[1]&&a.lij[2]===t[2],"not the right tile?"),a}return null}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(e){this._renderer.renderPatchBorders=e}get visualizeNormals(){return this._renderer.visualizeNormals}set visualizeNormals(e){this._renderer.visualizeNormals=e}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(e){this._renderer.renderingDisabled=e}get test(){const e=this;return{renderer:e._renderer,lercDecoder:e._lercDecoder,forceReload:()=>{null!=e._rootTiles&&e._rootTiles.length>0&&(e._mergeTile(e._rootTiles[0]),e._viewChangeUpdate())},getTiles:()=>e._allTiles.toArray(),getRenderedTiles(){ut.clear(),e._allTiles.forAll((e=>{e.visible&&e.rendered&&ut.push(e)}));const t=ut.toArray();return ze(e.renderOrder,t),t},lockTilingScheme(t,i){e._extentHelper.defaultTiledLayersExtent=i,e.tilingSchemeLogic.test.lockTilingScheme(t)}}}checkAllTilesWaterproofness(){if(!Oe)return;const e=this._rootTiles;if(null==e)return;const t=e=>e?.renderData?.geometry?.indices?.length>0,i=(e,i)=>{t(e)&&console.error("Tile[",e.lij,"] has geometry although parent[",i.lij,"] has geom")},r=e=>{if(e.intersectsClippingArea)if(e.renderData&&!e.renderData.geometryState&&console.error("Tile[",e.lij,"] has renderData but not geometryState"),e.renderData&&!e.renderData.geometry&&console.error("Tile[",e.lij,"] has renderData but not geometryInfo"),!e.renderData?.geometry||(e.renderData.geometry.indices?.length??0)>0||console.error("Tile[",e.lij,"] has renderData but no indices - geometryInfo: ",e.renderData.geometry),t(e)){e.checkGeometryWaterproofness();for(const t of e.children)i(t,e)}else if(e.isLeaf)console.error("Tile[",e.lij,"] has no geometry and no children, from root to leaf");else for(const t of e.children)r(t)},s=e=>{const t=e.parent?.visible??!0,i=e.visible;e.computeVisibility();const r=e.visible;if(i!==r&&t&&console.error(" Tile[",e.lij,"] has out of date visibility: ",i," instead of ",r),!e.isLeaf)for(const a of e.children)s(a)};for(const a of e)r(a),s(a)}get isGlobal(){return this._isGlobal}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateeCarree(){return this._isWebMercatorOnPlateeCarree}isEastEndWrap(e){return this.isGlobal&&e[2]===this.lijEastEnd(e[0])-1}isWestEndWrap(e){return this.isGlobal&&0===e[2]}lijEastEnd(e){return 2**(e+(null!=this.spatialReference&&this.spatialReference.isGeographic?1:0))}wrapEastWest(e){const t=this.lijEastEnd(e[0]),i=e[2];if(0<=i&&i<t)return e;if(!this.isGlobal)return null;const r=(i+(i<0?t:0))%t;return[e[0],e[1],r]}enableInternalChecks(e){Ve(e)}enableWaterproofnessChecks(e){ke(e)}};e([w()],st.prototype,"_renderer",void 0),e([w({constructOnly:!0})],st.prototype,"_scaleRangeQueries",void 0),e([w({constructOnly:!0})],st.prototype,"view",void 0),e([w({constructOnly:!0})],st.prototype,"overlayManager",void 0),e([w()],st.prototype,"_hasPendingUpdates",void 0),e([w()],st.prototype,"_asyncWorkItems",void 0),e([w()],st.prototype,"_allTilesDirty",void 0),e([w()],st.prototype,"_allTilesSorted",void 0),e([w()],st.prototype,"_viewChanged",void 0),e([w()],st.prototype,"_splitLimits",void 0),e([w({readOnly:!0})],st.prototype,"_watchUpdatingTracking",void 0),e([w()],st.prototype,"_frameTask",void 0),e([w({readOnly:!0})],st.prototype,"snapLevel",null),e([w({readOnly:!0})],st.prototype,"lodSnapping",null),e([w()],st.prototype,"_userClippingExtent",null),e([w()],st.prototype,"_rootTilesExtent",void 0),e([w({readOnly:!0})],st.prototype,"extent",null),e([w({readOnly:!0})],st.prototype,"groundExtent",null),e([w({readOnly:!0})],st.prototype,"_tilingSchemeExtent",null),e([w({readOnly:!0})],st.prototype,"updating",null),e([w({readOnly:!0})],st.prototype,"running",null),e([w(J)],st.prototype,"updatingProgress",void 0),e([w({readOnly:!0})],st.prototype,"updatingProgressValue",null),e([w()],st.prototype,"_maxNumUpdating",void 0),e([w()],st.prototype,"baseOpacity",null),e([w()],st.prototype,"hasCompositeBlendMode",void 0),e([w({readOnly:!0})],st.prototype,"viewingMode",null),e([w()],st.prototype,"maxTextureScale",void 0),e([w({readOnly:!0})],st.prototype,"ready",null),e([w({value:he.FRONT_TO_BACK})],st.prototype,"renderOrder",null),e([w({readOnly:!0})],st.prototype,"rootTiles",null),e([w()],st.prototype,"_rootTiles",void 0),e([w({readOnly:!0})],st.prototype,"spatialReference",null),e([w({type:t})],st.prototype,"backgroundColor",null),e([w({value:!1})],st.prototype,"slicePlaneEnabled",null),e([w({readOnly:!0})],st.prototype,"tilingScheme",void 0),e([w({readOnly:!0})],st.prototype,"tilingSchemeLocked",null),e([w({readOnly:!0})],st.prototype,"tilingSchemeLogic",void 0),e([w({value:!0})],st.prototype,"velvetOverground",null),e([w()],st.prototype,"wireframe",null),e([w({value:!1})],st.prototype,"suspended",null),e([w()],st.prototype,"textureFadeDuration",null),e([w()],st.prototype,"visibleElevationBounds",void 0),e([w()],st.prototype,"rootTileElevationBounds",void 0),e([w()],st.prototype,"_layerViewsDirty",void 0),e([w()],st.prototype,"renderPatchBorders",null),e([w()],st.prototype,"visualizeNormals",null),e([w()],st.prototype,"renderingDisabled",null),st=e([E("esri.views.3d.terrain.TerrainSurface")],st);const at=st;function nt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function lt(e){const t=e.children;if(!t[0])return!1;for(const i of t)if(i.shouldLoad)return!0;for(const i of t)if(lt(i))return!0;return!1}function ot(e){return e.isLeaf&&(e.parent?.shouldLoad??!1)}const ht=b(),dt=j(),pt=[0,0,0],ut=new u,ct={spatialReference:null,extent:j(),context:"ground"},_t={spatialReference:null,extent:null,scale:0};function gt(e,t,i){for(const r of e){if(!r.containsPointXY(t,i))continue;let e=r;for(;e&&!e.renderData;){const r=(t>e.extentMidX?1:0)+(i<e.extentMidY?2:0);e=e.children[r]}const s=e?.renderData?.geometryState.samplerData??null;return te(t,i,s)}return null}export{at as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../core/Accessor.js";import{difference as r}from"../../../core/arrayUtils.js";import s from"../../../core/CollectionFlattener.js";import a from"../../../core/Evented.js";import n from"../../../core/Handles.js";import l from"../../../core/Logger.js";import{clamp as o}from"../../../core/mathUtils.js";import{releaseMaybe as h,destroyMaybe as d}from"../../../core/maybe.js";import p from"../../../core/ObjectPool.js";import u from"../../../core/PooledArray.js";import{throwIfAborted as c,isAbortError as _,isAborted as g,createAbortError as m}from"../../../core/promiseUtils.js";import{watch as T,syncAndInitial as y,sync as f,initial as v}from"../../../core/reactiveUtils.js";import{property as w}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/has.js";import{subclass as E}from"../../../core/accessorSupport/decorators/subclass.js";import{m as S}from"../../../chunks/mat4.js";import{c as L}from"../../../chunks/mat4f64.js";import{c as D}from"../../../chunks/vec3.js";import{c as P}from"../../../chunks/vec3f64.js";import{c as b}from"../../../chunks/vec4f64.js";import{WatchUpdatingTracking as C}from"../../../core/support/WatchUpdatingTracking.js";import{getReferenceEllipsoid as U}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as x,projectPointToVector as R}from"../../../geometry/projection.js";import M from"../../../geometry/SpatialReference.js";import{create as j,equals as A,intersection as I,empty as O,expand as V,intersectsSphere as k}from"../../../geometry/support/aaBoundingRect.js";import{create as B,copy as N}from"../../../geometry/support/frustum.js";import{isPlateCarree as F}from"../../../geometry/support/spatialReferenceUtils.js";import{isRefreshableLayer as q}from"../../../layers/mixins/RefreshableLayer.js";import{ElevationQueryTileCache as G}from"../../../layers/support/ElevationQueryTileCache.js";import{ElevationTileData as W}from"../../../layers/support/ElevationTileData.js";import{isBaseLayer as H}from"../../../layers/support/layerUtils.js";import{acquireDecoder as Q}from"../../../layers/support/LercDecoder.js";import{printAllocations as z}from"../../2d/engine/vectorTiles/VectorTile.js";import{directionToHeadingTilt as X}from"../support/cameraUtils.js";import Y from"../support/debugFlags.js";import{toBoundingRect as $}from"../support/extentUtils.js";import{ClientType as K}from"../support/index.js";import{updatingProgress as J}from"../support/updatingProperties.js";import{ElevationBounds as Z}from"./ElevationBounds.js";import{ElevationData as ee,sampleElevation as te}from"./ElevationData.js";import{create as ie}from"./ExtentHelper.js";import{LODSnapping as re,TextureUpdate as se}from"./interfaces.js";import{LayerClass as ae,LayerClasses as ne}from"./LayerClass.js";import{OverlayManager as le}from"./OverlayManager.js";import{PlanarPatch as oe}from"./PlanarPatch.js";import{RenderOrder as he}from"./RenderOrder.js";import{ScaleRangeQueries as de}from"./ScaleRangeQueries.js";import{SphericalPatch as pe}from"./SphericalPatch.js";import{SplitLimits as ue}from"./SplitLimits.js";import{MAX_ROOT_TILES as ce,TOO_MANY_ROOT_TILES_AFTER_CHANGE_ERROR as _e,TOO_MANY_ROOT_TILES_FOR_LAYER_ERROR as ge,MAX_MEMORY_LOD_BIAS as me,ELEVATION_NODATA_VALUE as Te}from"./TerrainConst.js";import{TerrainRenderer as ye,TransparencyMode as fe}from"./TerrainRenderer.js";import ve from"./TerrainSurfacePerformanceInfo.js";import{weakAssert as we,internalAssert as Ee,oppositeEdge as Se,isSurfaceLayerView as Le,isGroupLayerView as De,isMapTileLayerView as Pe,isBlendableLayerView as be,isElevationLayerView as Ce,isVectorTileLayerView as Ue,useFetchTileForLayer as xe,isImageryTileLayerView as Re,isTileLayerView as Me,releaseTileData as je,neighborEdgeIndices as Ae,ENABLE_TERRAIN_INTERNAL_CHECKS as Ie,ENABLE_WATERPROOFNESS_TESTS as Oe,enableTerrainInternalChecks as Ve,enableTerrainWaterproofnessChecks as ke}from"./terrainUtils.js";import{Tile as Be}from"./Tile.js";import{printAllocations as Ne}from"./TilePerLayerInfo.js";import{TileUpdate as Fe}from"./TileUpdate.js";import{IteratorPreorder as qe,IteratorPostorder as Ge,compareTilesByLij as We,hasLoadableSiblings as He,sortTilesByPOI as Qe,sortTiles as ze}from"./tileUtils.js";import{TilingSchemeLogic as Xe}from"./TilingSchemeLogic.js";import{UpsampleInfo as Ye}from"./UpsampleInfo.js";import{isCompositeBlendMode as $e,blendModeFromString as Ke}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{PBRMode as Je}from"../webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{RenderRequestType as Ze}from"../webgl-engine/lib/basicInterfaces.js";import{RenderState as et}from"../../support/RenderState.js";import{ImmediateTask as tt,TaskPriority as it,noBudget as rt}from"../../support/Scheduler.js";let st=class extends(a.EventedMixin(i)){constructor(e){super(e),this._scaleRangeQueries=new de,this._iteratorPool=new p(qe,(e=>e.remove=()=>this._iteratorPool.release(e))),this._postorderIterator=new Ge,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._visibleCached=!1,this._usedMemory=null,this._performanceInfo=new ve,this._viewChanged=!1,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=P(),this._eyePosSurfaceSR=P(),this._splitLimits=new ue,this._frustum=B(),this._viewProjectionMatrix=L(),this._layerViews=[new Array,new Array],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._handles=new n,this._watchUpdatingTracking=new C,this._frameTask=tt,this._allTiles=new u,this._upsampleInfoPool=new p(Ye),this._rootTilesExtent=j(),this.updatingProgress=.5,this._maxNumUpdating=1,this.maxTextureScale=1.2,this._spatialReference=M.WebMercator,this.visibleElevationBounds=new Z(1/0,-1/0),this.rootTileElevationBounds=new Z(1/0,-1/0),this._updatingRootTiles=!1,this._pendingTilesForElevationUpdateEvent=new Set,this._pendingTilesToUpdate=new Set,this.totalGeometryUpdates=0,this.totalTileUpdates=0,this.oneBatchPerFrameTask=!0,this._layerViewsDirty=!1,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._isWebMercator=!1,this._isWebMercatorOnPlateeCarree=!1,this.overlayManager=new le({...e,surface:this}),this._isGlobal=!e.view?.state?.isLocal}initialize(){this._lercDecoder=Q(this.view.resourceController),this._tilePool=this.view.state.isLocal?new p(oe):new p(pe);const e=this.view.resourceController.memoryController;this._upsampleMapCache=e.newCache("esri.views.3d.terrain.upsample",(e=>e.unloadMapData())),this._elevationQueryCache=new G(e.newCache("elevation-query")),this._handles.add([T((()=>this.overlayManager.hasHighlights),(e=>this._renderer.setNeedsHighlight(e))),T((()=>this.overlayManager.rendersOccluded),(e=>this._renderer.setRenderOccludedOverlay(e))),T((()=>this.overlayManager.renderer.isEmpty),(()=>this._evaluateTransparency()))],"overlayManager"),this._renderer=new ye({_overlayRenderer:this.overlayManager.renderer,_ellipsoidRadius:U(this.view.spatialReference).radius,_stage:this.view._stage,_allTiles:this._allTiles}),this._handles.add([T((()=>this.baseOpacity),(()=>{this._handleLayerViewChanges(),this._updateTileTextures(this._evaluateTransparency()?se.UNFADED:se.IMMEDIATE)}),y),T((()=>this.hasCompositeBlendMode),(()=>this._updateTileTextures(this._evaluateTransparency()?se.UNFADED:se.IMMEDIATE)),y),T((()=>this.renderingDisabled),(()=>this.view?._stage?.renderer.setParameters({terrainRenderingEnabled:!this.renderingDisabled})),f),T((()=>this.backgroundColor),(e=>{this._handleLayerViewChanges(),this._renderer.updateTileBackground(e)}),y),T((()=>this.snapLevel),(()=>this._viewChanged=!0),f),T((()=>this.view.pointsOfInterest),(e=>{this._renderer.pointsOfInterest=e,this._watchUpdatingTracking.removeAll(),e&&this._watchUpdatingTracking.add((()=>e.focus.renderLocation),(()=>this._allTilesSorted=!1))})),T((()=>Y.TERRAIN_TILE_TREE_SHOW_TILES),(e=>{e&&!this._treeDebugger?import("../layers/support/TerrainTileTree3DDebugger.js").then((({TerrainTileTree3DDebugger:e})=>{!this._treeDebugger&&Y.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new e({view:this.view}))})):e||(this._treeDebugger=d(this._treeDebugger))}),v)]);const{spatialReference:t}=this.view;this._extentHelper=ie(this.viewingMode,{layers:this.view.map.allLayers,layerViews:this.view.allLayerViews,viewSpatialReference:t});const i=new s({getCollections:()=>this.view?.defaultsFromMap?.mapCollections?.map((({layers:e})=>e)),getChildrenFunction:e=>e&&"layers"in e?e.layers:null}),r=new Xe({layers:i,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:t});this._set("tilingSchemeLogic",r),this._updateTilingScheme(),this._elevationDataRequester=this.view.resourceController.createStreamDataRequester(K.ELEVATION),this._mapDataRequester=this.view.resourceController.createStreamDataRequester(K.BASEMAP);const a=this.view.resourceController.scheduler;this._frameTask=a.registerTask(it.TERRAIN_SURFACE,this),this._handles.add([T((()=>this._extentHelper.stencilEnabledExtents),(e=>this._renderer.setStencilEnabledLayerExtents(e)),v),T((()=>this.tilingSchemeLogic.tilingScheme),(()=>this._updateTilingScheme()),f),T((()=>this.extent),(()=>this._updateRootTiles()),v),this.view.on("resize",(()=>this._viewChangeUpdate())),T((()=>{const e=this.view,t=e.state;return[this._lodBias,this.lodSnapping,e.resourceController?.memoryController?.memoryFactor,t.camera,t.contentCamera,t.fixedContentCamera]}),(()=>this._viewChangeUpdate()),y),T((()=>this.view.qualitySettings?.tiledSurface?.textureFadeDuration),(e=>this._renderer.textureFadingEnabled=e>0),v),T((()=>this.view.qualitySettings?.physicallyBasedRenderingEnabled),(e=>this._renderer.pbrMode=e?Je.Terrain:Je.Disabled),v),T((()=>this._userClippingExtent),(()=>this._updateClippingExtent()),f)]),this._handles.add(this.view.allLayerViews.on("after-changes",(()=>this._layerViewsDirty=!0))),this._layerViewsDirty=!0,this._handleLayerViewChanges()}destroy(){this._frameTask.remove(),this._handles.destroy(),this._watchUpdatingTracking.destroy(),this._lercDecoder=h(this._lercDecoder),this._removeAllTiles(),this._upsampleMapCache=d(this._upsampleMapCache),this._elevationQueryCache=d(this._elevationQueryCache),this._set("tilingSchemeLogic",d(this.tilingSchemeLogic)),this._basemapLayerViewHandles.forEach(((e,t)=>this._unregisterTiledLayerView(t))),this._elevationDataRequester=null,this._mapDataRequester=null,this._set("overlayManager",d(this.overlayManager)),this._tilePool=d(this._tilePool),Be.prune(),this._treeDebugger=d(this._treeDebugger),this._renderer=d(this._renderer),this._iteratorPool=d(this._iteratorPool),this._set("view",null),this._extentHelper=d(this._extentHelper),this._upsampleInfoPool=d(this._upsampleInfoPool),z(),Ne()}get renderer(){return this._renderer}get frustum(){return this._frustum}get snapLevel(){if(this.lodSnapping===re.ON){const e=this.view,t=this.tilingScheme,i=e.pointsOfInterest?.cameraOnSurface?.scale;if(t&&i){const r=e.state.contentCamera;let s=X(e,r.eye,r.viewForward,r.up).tilt;s>90&&(s=180-s);const a=2*(s/90)**2,n=t.levelAtScale(i)-a,l=Math.min(n,this._splitLimits.maxLod||1/0);return l<=0?null:l}}return null}get lodSnapping(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences?re.ON:re.OFF}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get mapTileRequester(){return this._mapDataRequester}get _userClippingExtent(){const{spatialReference:e}=this,{clippingArea:t}=this.view;if(null==t||null==e)return null;const i=j(),r=$(t,i,e)?i:null,s=this._get("extent");return A(r,s)?s:r}get rootTilesExtent(){return this._rootTilesExtent}get extent(){const e=I(this.groundExtent,this._userClippingExtent,j()),t=this._get("extent");return A(e,t)?t:e}get groundExtent(){return null!=this._tilingSchemeExtent?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){return this.tilingSchemeLogic?.extent}get updating(){return this._hasPendingUpdates||(this._maxNumUpdating=1),!!((this.running||this._watchUpdatingTracking?.updating||this._asyncWorkItems>0)&&this.ready&&!this.suspended||this.overlayManager?.updating)}get running(){return(this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||!this._allTilesSorted||this._layerViewsDirty||this._scaleRangeQueries.updating||this._frameTask.updating)&&this.ready&&!this.suspended}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get baseOpacity(){return this.view?.map?.ground?.opacity??1}set baseOpacity(e){this.view.map.ground.opacity=e}get viewingMode(){return this.view.state.viewingMode}get ready(){return null!=this._rootTiles}set renderOrder(e){this._renderer.renderOrder=e,this._set("renderOrder",e)}get rootTiles(){return this._rootTiles}get spatialReference(){return this.tilingScheme?.spatialReference??null}get backgroundColor(){return this.view.map.ground.surfaceColor}set backgroundColor(e){this.view.map.ground.surfaceColor=e}set slicePlaneEnabled(e){this._renderer.slicePlaneEnabled=e,this._set("slicePlaneEnabled",e),this._evaluateTransparency()}get tilingSchemeLocked(){return this.tilingSchemeLogic?.tilingSchemeLocked??!1}set velvetOverground(e){this._renderer.velvetOverground=e,this._set("velvetOverground",e)}get wireframe(){return this._renderer?.wireframe}set wireframe(e){e!==this._renderer.wireframe&&(this._renderer.wireframe=e,this._updateAllTileGeometries())}set _visible(e){e!==this._visibleCached&&(this._visibleCached=e,this._renderer.setVisibility(e),this.suspended=!e)}get opaque(){return this._renderer.transparency===fe.Opaque}set suspended(e){this._set("suspended",e),this._viewChangeUpdate()}get textureFadeDuration(){return this.view.qualitySettings.tiledSurface.textureFadeDuration??0}intersect(e,t,i,r){this._renderer.intersect(e,t,i,r)}getElevation(e,t,i,r){const s=this._rootTiles;if(null==s||!s.length)return null;if(0===s[0].layerInfo[ae.ELEVATION].length)return null;const a=ht;if(a[0]=e,a[1]=t,a[2]=i,!x(a,r,a,this._spatialReference))return l.getLogger(this.declaredClass).error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;return gt(s,a[0],a[1])}getElevations(e,t,i){const r=this._rootTiles,s=r?r[0].layerInfo[ae.ELEVATION].length:0;if(null!=r&&r.length&&0!==s)for(let a=0;a<t;++a){const t=3*a;i(a,gt(r,e[t],e[t+1]))}else for(let a=0;a<t;++a)i(a,null)}getScale(e){if(!this.tilingScheme)return null;if(!R(e,ht,this.spatialReference))return l.getLogger(this.declaredClass).error("TerrainSurface.getScale(): could not project given point to tiling scheme coordinate system"),null;const t=this._rootTiles;if(null!=t)for(const i of t)if(i?.containsPoint(ht)){let e=i;for(;e.children[0]&&!e.rendered;){const t=e.children[0].extent;let i=0;ht[0]>t[2]&&(i+=1),ht[1]<t[1]&&(i+=2),e=e.children[i]}return this._getLodBiasCorrectedScale(e.level)}return 1/0}getSphereElevationBounds(e,t){if(ht[0]=e[0],ht[1]=e[1],ht[2]=e[2],ht[3]=e[3],!x(ht,t,ht,this.tilingScheme?.spatialReference))return l.getLogger(this.declaredClass).error("TerrainSurface.getSphereElevationBounds(): could not project given point to tiling scheme coordinate system"),null;let i=1/0,r=-1/0;const s=e=>{if(e&&k(e.extent,ht))if(e.isLeaf||e.rendered)i=Math.min(i,e.elevationBounds[0]),r=Math.max(r,e.elevationBounds[1]);else for(const t of e.children)s(t)},a=this._rootTiles;if(null!=a)for(const n of a)s(n);return{min:i,max:r}}getSphereScale(e,t){if(!this.tilingScheme)return null;if(!R(e,ht,this.spatialReference))return l.getLogger(this.declaredClass).error("TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system"),null;ht[3]=t;let i=null;const r=e=>{if(e&&k(e.extent,ht)){const t=e.children;if(t[0]&&!e.rendered)for(const e of t)r(e);else{const t=this._getLodBiasCorrectedScale(e.level);i=null==i?t:Math.min(i,t)}}},s=this._rootTiles;if(null!=s)for(const a of s)r(a);return i}queryVisibleScaleRange(e,t,i,r){const s=t?this.tilingScheme.levelAtScale(t):0,a=i?this.tilingScheme.levelAtScale(i):1/0,n=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(e,s+n,a+n,r)}_evaluateTransparency(){const e=this.baseOpacity,t=this.overlayManager.renderer.isEmpty,i=this._renderer.transparency,r=this._allSurfaceLayersTransparent()?t?fe.Empty:fe.TransparentWithDraped:e>=1&&!this.hasCompositeBlendMode&&!this._renderer.slicePlaneEnabled?fe.Opaque:fe.Semitransparent,s=i!==r;return s&&(this._renderer.transparency=r,this.view?._stage?.renderer.setParameters({terrainTransparency:this._renderer.transparency})),s}_updateTilingScheme(){const e=this.tilingSchemeLogic.tilingScheme;if(!(e!==this.tilingScheme))return;we(!!e,"tiling scheme cannot be reset to undefined"),this._isGlobal=!this.view?.state?.isLocal,this.tilingScheme&&this._removeAllTiles();const t=e?.spatialReference??M.WebMercator;this._spatialReference=t,this._isWebMercator=!!t?.isWebMercator,this._isWebMercatorOnPlateeCarree=this._isWebMercator&&F(this.view?.renderSpatialReference),this._set("tilingScheme",e),this._updateClippingExtent(),e&&(this._updateTiledLayers(),this._renderer.setTileSize(e.pixelSize),this.overlayManager.setSpatialReference(e.spatialReference),this._updateRootTiles())}_acquireTile(e,t,i,r){const s=this._tilePool.acquire();return pt[0]=e,pt[1]=t,pt[2]=i,s.init(pt,r,this),s}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){const{extent:e,tilingScheme:t}=this;if(!t)return;const i=dt;let s=t.rootTilesInExtent(e,i,5*ce);if(null!=this._rootTiles){if(s.length>ce)return void l.getLogger(this.declaredClass).warn(_e);const e=this._rootTiles.map((e=>e.lij)),t=r(e,s,nt);if(this._updatingRootTiles=!0,t.removed.length>0||t.added.length>0){const e=this._rootTiles.filter((e=>!(t.removed.findIndex((t=>nt(t,e.lij)))>-1)||(this._purgeTile(e),!1)));t.added.forEach((t=>e.push(this._newRootTile(t)))),this._setRootTiles(e)}}else this._updatingRootTiles=!0,s.length>ce&&(l.getLogger(this.declaredClass).warn(ge),s=t.rootTilesInExtent(e,i,ce)),this._setRootTiles(s.map((e=>this._newRootTile(e))));A(i,this._rootTilesExtent)||(this._rootTilesExtent=j(i)),this._visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange("ready"),this._updateAllTileGeometries(),this._updatingRootTiles=!1,this.checkAllTilesWaterproofness()}_updateAllTileGeometries(){const e=this._allTiles.filter((e=>e.isLoaded&&e.intersectsClippingArea));e.forEach((e=>this._renderer.updateTileGeometryState(e))),e.forEach((e=>e.renderData.updateNeighborData())),this._updateTilesGeometries(e),this._pendingTilesToUpdate.clear()}_updateTilesGeometries(e){if(0===e.length)return;e.sort(We);const t=this.renderer;e.forEach((e=>t.updateGeometryIfNeeded(e))),e.forEach((e=>this._pendingTilesForElevationUpdateEvent.add(e)))}_shouldSplit(e){return e.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)===Fe.SPLIT}_newRootTile(e){const t=this._acquireTile(0,e[1],e[2],null);return this._shouldSplit(t)&&t.setPendingUpdate(Fe.SPLIT),this._loadTile(t),this._markTileToUpdate(t),this._updateRootTileElevationBounds(),t}_setRootTiles(e){if(this._rootTiles=e,this._allTiles.clear(),null!=e){const t=this._iteratorPool.acquire();for(t.reset(e);!t.done;)this._allTiles.push(t.next());t.remove()}this._renderer.setRootTiles(this._rootTiles),this._updateTilesVisibility(e)}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&&this.tilingScheme&&this._visibleCached&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)))}_updateClippingStatus(e){e.updateClippingStatus(this.extent)&&e.resetPendingUpdate(Fe.GEOMETRY)&&this._updateTileGeometryState(e)}_updateTilesVisibility(e){if(null==e)return;const t=He(e),i=this.visibleElevationBounds;let r=t?i.min:1/0,s=t?i.max:-1/0;const a=this.extent,n=this._viewProjectionMatrix;this.setTileTreeDirty();const l=this._iteratorPool.acquire();for(l.reset(e);!l.done;){const e=l.next();e.updateClippingStatus(a)&&e.resetPendingUpdate(Fe.GEOMETRY)&&this._updateTileGeometryState(e),e.setPendingUpdate(Fe.RENDERDATA),e.computeVisibility(),e.updateScreenDepth(n),e.renderData&&(r=Math.min(e.elevationBounds[0],r),s=Math.max(e.elevationBounds[1],s))}l.remove(),this._viewChanged=!0,this._allTilesDirty=!0,this._batchUpdatePendingTileGeometries(),isFinite(r)&&isFinite(s)&&(i.min!==r||i.max!==s)&&(this.visibleElevationBounds=new Z(r,s))}_updateRootTileElevationBounds(){let e=1/0,t=-1/0;const i=this._rootTiles;null!=i&&i.forEach((({elevationBounds:i})=>{e=Math.min(e,i[0]),t=Math.max(t,i[1])}));const r=this.rootTileElevationBounds;r.min===e&&r.max===t||(this.rootTileElevationBounds=new Z(e,t))}_updateViewDependentParameters(){const{camera:e,contentCamera:t}=this.view.state,i=Math.tan(.5*t.fovX),r=Math.tan(.5*t.fovY),s=this.tilingScheme.pixelSize,a=2**-this._lodBias*e.pixelRatio;this._splitLimits.aboveGround=e.aboveGround,this._splitLimits.fovX=i,this._splitLimits.fovY=r,this._splitLimits.relativeWidthLimit=s/e.width*this.maxTextureScale*a,this._splitLimits.relativeHeightLimit=s/e.height*this.maxTextureScale*a,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?(null==this._splitLimits.frustum&&(this._splitLimits.frustum=B()),N(this._splitLimits.frustum,t.frustum)):this._splitLimits.frustum=null,N(this._frustum,e.frustum),S(this._viewProjectionMatrix,t.projectionMatrix,t.viewMatrix),D(this._eyePosRenderSR,t.eye),x(e.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateRenderData(e){e.rendered&&!e.shouldLoad&&(lt(e)?this._loadChildren(e):ot(e)&&this._loadParent(e))}_updateTileGeometryState(e){e.updateVisibility();this._renderer.updateTileGeometryState(e)&&this._markTileToUpdate(e),this._usedMemory=null}_markAllTileNeighborsForGeometryUpdate(e){const t=this._pendingTilesToUpdate;e.forEachLoadedNeighbor((e=>{t.add(e)}))}_updateTileTexture(e,t){const i=e.resetPendingUpdate(Fe.TEXTURE_FADING)?Fe.TEXTURE_FADING:!!e.resetPendingUpdate(Fe.TEXTURE_NOFADING)&&Fe.TEXTURE_NOFADING;i&&(this._renderer.updateTileTexture(e,i),this._usedMemory=null,t.madeProgress())}_emitElevationUpdateEventForTiles(){const e=ct.extent;O(e),this._pendingTilesForElevationUpdateEvent.forEach((t=>V(e,t.extent,e))),this._pendingTilesForElevationUpdateEvent.clear(),ct.spatialReference=this.spatialReference,this.emit("elevation-change",ct)}runTask(e){this._handleLayerViewChanges(e),this._frameTask.processQueue(e),this.renderer.processScaleRangeQueries(this._scaleRangeQueries,e),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateAllTilesStatus(e),this._sortTiles(e);const t=!this.view.state.fixedContentCamera;this._mergeAndSplit(e,t),this._updateElevation(e),this._updateTextures(e),t||this._mergeAndSplit(e,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty(),this._batchUpdatePendingTileGeometries(),this._emitElevationUpdateEventForTiles(),e.done&&e.hasProgressed&&this.requestUpdate(),this.notifyChange("updatingProgressValue")}_updateAllTilesStatus(e){if(!this._viewChanged||!this._rootTiles||e.done)return;this._viewChanged=!1;const t=this._iteratorPool.acquire();t.reset(this._rootTiles);const i=this.snapLevel,r=this._splitLimits,s=this._eyePosRenderSR;for(;!t.done;){const e=t.next(),a=e.shouldSplit(r,s,i);if(a!==Fe.SPLIT){if(e.resetPendingUpdate(Fe.SPLIT)&&e.updateAgentSuspension(),a===Fe.ELEVATION&&e.updateAgents(ae.ELEVATION),t.skipSubtree(),!e.isLeaf){e.setPendingUpdate(Fe.MERGE),e.resetPendingUpdate(Fe.SPLIT);const t=this._iteratorPool.acquire();t.resetOne(e);const i=this._viewProjectionMatrix;for(let e=t.next();!t.done;e=t.next())this._updateClippingStatus(e),e.updateVisibility(),e.updateScreenDepth(i);t.remove()}}else e.resetPendingUpdate(Fe.MERGE),e.isLeaf&&(e.setPendingUpdate(Fe.SPLIT),t.skipSubtree()),e.rendered&&e.setPendingUpdate(Fe.RENDERDATA)}t.remove(),this.requestUpdate(),(this.shortBatches||!this.oneBatchPerFrameTask)&&this._batchUpdatePendingTileGeometries(),e.madeProgress()}_sortTiles(e){e.done||this._allTilesSorted||(Qe(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger&&this._treeDebugger.update(),e.madeProgress())}_markTileToUpdate(e){Ee(e.isLoaded),e.intersectsClippingArea&&(this._pendingTilesToUpdate.add(e),this._markAllTileNeighborsForGeometryUpdate(e))}_batchUpdatePendingTileGeometries(){const e=this._pendingTilesToUpdate;if(0===e.size)return;const t=Array.from(this._pendingTilesToUpdate.keys()).filter((e=>e.isLoaded&&e.intersectsClippingArea)),i=(i,r)=>{!r?.isLoaded||!r.intersectsClippingArea||r.level<i.level||e.has(r)||(e.add(r),t.push(r),r.renderData.updateNeighborData())};t.sort(We);const r=t.length;for(let s=0;s<r;++s){const r=t[s];Ee(r.isLoaded),Ee(r.intersectsClippingArea);const a=r.renderData;a.updateNeighborData();const n=a._dirtyEdgeResolutions,l=a.geometryState.neighborData;for(let t=0;t<4;++t)if(n&1<<t){const s=a.geometryState.neighborData.edgePeerNeighbors[t];s&&s?.level>=r.level&&s.forAllSubtreeOnSide(Se(Ae[t]),(t=>!(!t.isLoaded||!t.intersectsClippingArea)&&(Ee(e.has(t)||We(r,t)<0),i(r,t),!0))),i(r,l.cornerPeerNeighbors[t]),i(r,l.cornerPeerNeighbors[(t+1)%4])}}e.clear(),this._updateTilesGeometries(t),Ie&&Oe&&this.checkAllTilesWaterproofness()}_mergeAndSplit(e,t){if(this.suspended||e.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let i=!1;const r=this.view.state.fixedContentCamera;let s=!1;for(;!e.done;){s=!0;let a=!1;const n=!this._allTiles.some((s=>{if(!i&&!r&&!s.visible)return e.done;let n=s;if(s.resetPendingUpdate(Fe.MERGE)){if(!t)return s.setPendingUpdate(Fe.MERGE),e.done;for(;n.parent?.resetPendingUpdate(Fe.MERGE);)n=n.parent;this._mergeTile(n),a=!0,e.madeProgress()}else s.resetPendingUpdate(Fe.SPLIT)&&(this._splitTile(s),a=!0,e.madeProgress());return!e.done&&n===s&&s.resetPendingUpdate(Fe.RENDERDATA)&&(this._updateRenderData(s),e.madeProgress()),e.done}));if(a&&(this._allTilesSorted=!1,this._allTilesDirty=!0),n){if(!i){i=!0;continue}if(!a)break}else this._allTilesDirty=!0}s?e.madeProgress():this._allTilesDirty=!0,!this.oneBatchPerFrameTask&&this._batchUpdatePendingTileGeometries(),this._sortTiles(e)}_updateElevation(e){e.done||(this._allTiles.some((t=>(t.resetPendingUpdate(Fe.GEOMETRY)&&(this._updateTileGeometryState(t),this._updateTileTexture(t,e),this.shortBatches&&this._batchUpdatePendingTileGeometries(),e.madeProgress()),e.done))),!this.oneBatchPerFrameTask&&this._batchUpdatePendingTileGeometries())}_updateTextures(e){e.done||this._allTiles.some((t=>(this._updateTileTexture(t,e),e.done)))}_updateClippingExtent(){this.spatialReference&&(this.updateTileOverlayParams(Ze.UPDATE),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){const e=this.view.resourceController.memoryController.memoryFactor;return this.view.qualitySettings.tiledSurface.lodBias-(1-e)*me}_getLodBiasCorrectedScale(e){const t=this.tilingScheme.levels,i=o(e-this._lodBias,0,t.length-1),r=i-Math.floor(i);return t[Math.floor(i)].scale*(1-r)+t[Math.ceil(i)].scale*r}_removeAllTiles(){null!=this._rootTiles&&(this._rootTiles.forEach((e=>this._purgeTile(e))),this._setRootTiles(null),this.notifyChange("ready")),this._allTiles.clear(),this._visible=!1}_purgeDescendantTiles(e){if(!e.children[0])return!1;let t=!1;for(let i=0;i<4;++i)t=this._purgeTile(e.children[i])||t;return e.unsetChildren(),t}_purgeTile(e){const t=this._purgeDescendantTiles(e)||e.rendered;return this._allTiles.removeUnordered(e),this._unloadTile(e),this._tilePool.release(e),t}_unloadTile(e){this._pendingTilesToUpdate.delete(e),this._pendingTilesForElevationUpdateEvent.delete(e),e.unload(this._renderer)}_splitTile(e){we(e.isLeaf,"tile that is already split should not be split again!");const t=e.level+1,i=2*e.lij[1],r=2*e.lij[2];e.setChildren(this._createTile(t,i,r,e),this._createTile(t,i,r+1,e),this._createTile(t,i+1,r,e),this._createTile(t,i+1,r+1,e)),e.setPendingUpdate(Fe.RENDERDATA),e.updateAgentSuspension(),this._allTiles.pushArray(e.children),this._allTilesDirty=!0,++this._performanceInfo.numSplit}_emitTileScaleChange(e,t=e.level){_t.spatialReference=this.spatialReference,_t.extent=e.extent,_t.scale=this._getLodBiasCorrectedScale(t),this.emit("scale-change",_t)}_createTile(e,t,i,r){we(!!r,"_createTile sanity check");const s=this._acquireTile(e,t,i,r);return s.updateClippingStatus(this.extent),s.updateScreenDepth(this._viewProjectionMatrix),this._shouldSplit(s)&&s.setPendingUpdate(Fe.SPLIT),s}get shortBatches(){return this.view.state.mode!==et.IDLE}_mergeTile(e){we(!e.hasPendingUpdate(Fe.SPLIT),"_mergeTile sanity check"),this._purgeDescendantTiles(e)&&(we(!e.renderData,"_mergeTile sanity check"),this._loadTile(e),this._markTileToUpdate(e),this._emitTileScaleChange(e),this.shortBatches&&this._batchUpdatePendingTileGeometries()),this._allTilesDirty=!0,++this._performanceInfo.numMerged}_loadChildren(e){we(e.rendered,"parent should be rendered"),this._unloadTile(e);const t=e.children;t.forEach((e=>this._loadTile(e))),t.forEach((e=>this._pendingTilesToUpdate.add(e))),this._markAllTileNeighborsForGeometryUpdate(e),this._emitTileScaleChange(e,e.level+1),this.shortBatches&&this._batchUpdatePendingTileGeometries()}_loadParent(e){const t=e.parent;this._unloadChildren(t),this._loadTile(t),this._markTileToUpdate(t),this._emitTileScaleChange(t,t.level),this.shortBatches&&this._batchUpdatePendingTileGeometries()}_unloadChildren(e){const t=e.children;if(t[0])for(let i=0;i<4;++i){const e=t[i];this._unloadChildren(e),this._unloadTile(e)}}_loadTile(e){e.load(),e.setPendingUpdate(Fe.RENDERDATA),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager&&this.overlayManager.hasOverlays&&this.overlayManager.setTileParameters(e)}_elevationDataArrived(e,t,i){const r=new ee(e.lij,e.extent,i);e.dataArrived(t,ae.ELEVATION,r);const s=[e],a=e.level,n=this._iteratorPool.acquire();for(n.reset(s);!n.done;){const e=n.next();e.findElevationBoundsForLayer(t,a),e.computeElevationBounds()}0===a&&this._updateRootTileElevationBounds(),n.remove(),this._updateTilesVisibility(s)}_handleLayerViewChanges(e=rt){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let t=!1;const i=new Set;let r=-1;for(const s of this.view.allLayerViews.items)if(i.add(s.uid),Le(s)||De(s))if(this._basemapLayerViewHandles.has(s.uid)&&!De(s)){const e=this._layerClassFromLayerView(s),i=this._getLayerIdxByUID(e,s.uid);null!=i&&((i<r||null==r)&&(t=!0),r=i)}else this._registerTiledLayerView(s),s.layer.loaded&&(t=!0);this._basemapLayerViewHandles.forEach(((e,r)=>{i.has(r)||(this._unregisterTiledLayerView(r),t=!0)})),t&&this._updateTiledLayers(),this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._evaluateTransparency(),e.madeProgress()}_allSurfaceLayersTransparent(){let e=0===this.view.map?.ground?.opacity;for(const t of this.view.allLayerViews.items)if(Pe(t)&&!H(t.layer)&&0!==t.fullOpacity)return e=!1,e;return e}_hasCompositeBlendMode(){for(const e of this.view.allLayerViews.items)if((be(e)||De(e))&&$e(Ke[e.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(e){return Ce(e)?ae.ELEVATION:ae.MAP}_registerTiledLayerView(e){const t=[];if((be(e)||De(e))&&t.push(T((()=>e.layer.blendMode),(()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._updateTileTextures(se.UNFADED)}))),!De(e)){const i=this._layerClassFromLayerView(e);t.push(T((()=>e.suspended),(()=>this._updateTiledLayers()))),t.push(T((()=>e.fullOpacity),(()=>this._updateTileTextures(se.UNFADED)))),t.push(T((()=>"effectiveScaleRange"in e.layer?e.layer.effectiveScaleRange:null),(()=>this._restartAllAgents(i)))),t.push(e.on("data-changed",(()=>{const t=this._getLayerIdxByUID(i,e.uid);null!=t&&this._invalidateLayerData(t,i)})))}this._unregisterTiledLayerView(e.uid),this._basemapLayerViewHandles.set(e.uid,t)}_unregisterTiledLayerView(e){const t=this._basemapLayerViewHandles.get(e);if(t){for(const e of t)e.remove();this._basemapLayerViewHandles.delete(e)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;const e=this.view.allLayerViews,t=[[],[]];let i=null;e.forEach((e=>{if(!e.layer||e.suspended||!Le(e)||!e.fullExtent)return;const r=this._layerClassFromLayerView(e);if(r===ae.MAP){const t=e.displayLevelRange.maxLevel;t!==1/0&&(null===i||t>i)&&(i=t)}t[r].push(e)}));for(const r of ne){const e=this._layerViews[r],i=t[r];i.reverse();const s=i.length;let a=e.length!==s;const n=new Array(s),l=new Array(e.length);this._layerIndexByUid[r].clear();for(let t=0;t<s;t++){const s=i[t].uid;this._layerIndexByUid[r].set(s,t);const o=e.indexOf(i[t]);n[t]=o,t!==o&&(a=!0),o>-1&&(l[o]=t)}if(a){const e=this._postorderIterator;for(e.reset(this._rootTiles);!e.done;)e.next().modifyLayers(l,n,r);this._layerViews[r]=i,this._restartAllAgents(r),this._updateTilesVisibility(this._rootTiles)}}this.tilingScheme.ensureMaxLod(i)&&this._viewChangeUpdate()}_restartAllAgents(e){const t=this._postorderIterator;for(t.reset(this._rootTiles);!t.done;){const i=t.next();i.restartAgents(e),e===ae.ELEVATION&&i.computeElevationBounds()}this._updateRootTileElevationBounds()}layerViewByIndex(e,t){return this._layerViews[t][e]}numLayers(e){return this._layerViews[e].length}_updateTileTextures(e){this._allTiles.forAll((t=>{t.updateAgents(ae.MAP),e===se.IMMEDIATE?this.renderer.updateTileTexture(t,Fe.TEXTURE_NOFADING):t.updateRenderData(ae.MAP,e)})),this._evaluateTransparency()}_invalidateLayerData(e,t){this._allTiles.forAll((i=>i.removeLayerAgent(e,t))),this._allTiles.forAll((i=>i.invalidateLayerData(e,t)))}setTileTreeDirty(){this._allTilesDirty=!0}requestRender(e=Ze.UPDATE){this.renderer.setNeedsRender(e)}requestUpdate(){1==++this._pendingUpdates&&(this._hasPendingUpdates=!0)}requestTileData(e,t,i,r){const s=this.layerViewByIndex(t,i),a=s.layer;return!a.tilemapCache||Ue(s)?this._requestTileData(e,i,s,r):(++this._asyncWorkItems,a.tilemapCache.fetchAvailability(e.lij[0],e.lij[1],e.lij[2],{...r,timeout:6e3}).then((()=>--this._asyncWorkItems)).catch((t=>{throw--this._asyncWorkItems,c(r),_(t)||this._dataMissing(e,i,s,{notInTilemap:!0}),t})).then((()=>this._frameTask.schedule((()=>this._requestTileData(e,i,s,r)),r.signal))))}_requestTileData(e,t,i,r){return t===ae.ELEVATION?Ce(i)?this._requestElevationTileData(e,i,r):Promise.reject():Pe(i)?this._requestMapTileData(e,i,r):Promise.reject()}_requestElevationTileData(e,t,i){++this._asyncWorkItems;const r=r=>{if(g(i))return;const s=this._layerIndexByUid[ae.ELEVATION].get(t.uid);null!=s?(this._usedMemory=null,this.requestUpdate(),this._elevationDataArrived(e,s,r)):l.getLogger(this.declaredClass).warn("TerrainSurface: received data from unknown layer %d %s",ae.ELEVATION,e.lij.toString())},s=i=>{_(i)||(this._dataMissing(e,ae.ELEVATION,t,i),this.requestUpdate())};if(xe(t.layer))return t.layer.fetchTile(e.lij[0],e.lij[1],e.lij[2],{noDataValue:Te,signal:i.signal}).then((e=>{if(!g(i))return this._frameTask.schedule((()=>r(e)),i.signal,s);l.getLogger(this.declaredClass).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true.")}),s).finally((()=>{--this._asyncWorkItems}));const a=t.getTileUrl(e.lij[0],e.lij[1],e.lij[2]);return this._elevationDataRequester.request(a,"binary",i).then((e=>this._lercDecoder.decode(e,{noDataValue:Te},i.signal))).then((e=>{e?r(new W(e)):s(new Error("LERC decoding failed"))}),s).finally((()=>{--this._asyncWorkItems}))}_requestMapTileData(e,t,i){++this._asyncWorkItems;const r=(r,s)=>{--this._asyncWorkItems,je(s),g(i)||(this._dataMissing(e,ae.MAP,t,r),this.requestUpdate())},s=e=>t=>r(t,e),a=r=>this._frameTask.schedule((()=>{--this._asyncWorkItems,this.requestUpdate(),g(i)?je(r):this._mapTileDataArrived(e,t,r)}),i.signal,s(r)).catch(s(r)),n=(e,t=null)=>this._frameTask.schedule((()=>r(e,t)));if(Ue(t)){const r=t.schemaHelper.getLevelRowColumn(e.lij);return t.fetchTile(r[0],r[1],r[2],i).then(a,n)}if(Re(t))return t.fetchTile(e.lij[0],e.lij[1],e.lij[2],i).then(a,n);if(Me(t)&&xe(t.layer))return t.layer.fetchTile(e.lij[0],e.lij[1],e.lij[2],i).then((e=>{if(g(i))return l.getLogger(this.declaredClass).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."),void n(m());a(e)}),n);let o=t.getTileUrl(e.lij[0],e.lij[1],e.lij[2]);q(t.layer)&&t.layer.refreshTimestamp&&(o+=`${o.includes("?")?"&":"?"}_ts=${t.layer.refreshTimestamp}`);const h=t.hasMixedImageFormats?"image+type":"image";return this._mapDataRequester.request(o,h,i).then(a,n)}_mapTileDataArrived(e,t,i){const r=this._getLayerIdxByUID(ae.MAP,t.uid);null!=r?e.dataArrived(r,ae.MAP,i):(je(i),l.getLogger(this.declaredClass).warn("TerrainSurface: received data from unknown layer"))}_getLayerIdxByUID(e,t){return this._layerIndexByUid[e].get(t)}_dataMissing(e,t,i,r){const s=this._getLayerIdxByUID(t,i.uid);null!=s?e.dataMissing(s,t,r):l.getLogger(this.declaredClass).warn("TerrainSurface: received data from unknown layer")}updateTileOverlayParams(e){this._rootTiles&&this.overlayManager&&(this._allTiles.forAll((e=>{e.renderData&&this.overlayManager.setTileParameters(e)})),this._renderer.setNeedsRender(e))}get performanceInfo(){const e=this._performanceInfo;return e.numNodes=this._allTiles.length,e.numLeaves=e.numVisible=e.numRendered=e.numLoadedPerLevel.length=e.numRenderedPerLevel.length=0,this._allTiles.forAll((t=>{t.isLeaf&&e.numLeaves++;const i=t.level;t.renderData&&(e.numLoadedPerLevel[i]=(e.numLoadedPerLevel[i]||0)+1),t.visible&&(e.numVisible++,t.rendered&&(e.numRenderedPerLevel[i]=(e.numRenderedPerLevel[i]||0)+1,e.numRendered++))})),e}get usedMemory(){return this.tilingScheme?(null==this._usedMemory&&(this._usedMemory=this._recalculateUsedMemory()),null!=this._usedMemory?this._usedMemory:0):0}_recalculateUsedMemory(){return this.tilingScheme?this._allTiles.reduce(((e,t)=>e+t.usedMemory),0):null}getUsedMemoryForLayerView(e){let t=0;const i=this._layerClassFromLayerView(e),r=this._getLayerIdxByUID(i,e.uid);return null!=r&&this._allTiles.forAll((e=>t+=e.getUsedMemoryForLayer(i,r))),t}getTile(e){if(null==e||null==this._rootTiles)return null;const t=e.split("/").map((e=>+e));if(0===t[0])return this._rootTiles.find((e=>e.lij[1]===t[1]&&e.lij[2]===t[2]));const i=2**t[0],r=Math.floor(t[1]/i),s=Math.floor(t[2]/i);let a;if(this._rootTiles.some((e=>e.lij[1]===r&&e.lij[2]===s&&(a=e,!0))),a){let e=1<<t[0]-1;for(;a.lij[0]<t[0];){let i=t[1]&e?2:0;if((t[2]&e)>0&&i++,!a.children[i])return null;a=a.children[i],e>>=1}return we(a.lij[0]===t[0]&&a.lij[1]===t[1]&&a.lij[2]===t[2],"not the right tile?"),a}return null}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(e){this._renderer.renderPatchBorders=e}get visualizeNormals(){return this._renderer.visualizeNormals}set visualizeNormals(e){this._renderer.visualizeNormals=e}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(e){this._renderer.renderingDisabled=e}get test(){const e=this;return{renderer:e._renderer,lercDecoder:e._lercDecoder,forceReload:()=>{null!=e._rootTiles&&e._rootTiles.length>0&&(e._mergeTile(e._rootTiles[0]),e._viewChangeUpdate())},getTiles:()=>e._allTiles.toArray(),getRenderedTiles(){ut.clear(),e._allTiles.forAll((e=>{e.visible&&e.rendered&&ut.push(e)}));const t=ut.toArray();return ze(e.renderOrder,t),t},lockTilingScheme(t,i){e._extentHelper.defaultTiledLayersExtent=i,e.tilingSchemeLogic.test.lockTilingScheme(t)}}}checkAllTilesWaterproofness(){if(!Oe)return;const e=this._rootTiles;if(null==e)return;const t=e=>e?.renderData?.geometry?.indices?.length>0,i=(e,i)=>{t(e)&&console.error("Tile[",e.lij,"] has geometry although parent[",i.lij,"] has geom")},r=e=>{if(e.intersectsClippingArea)if(e.renderData&&!e.renderData.geometryState&&console.error("Tile[",e.lij,"] has renderData but not geometryState"),e.renderData&&!e.renderData.geometry&&console.error("Tile[",e.lij,"] has renderData but not geometryInfo"),!e.renderData?.geometry||(e.renderData.geometry.indices?.length??0)>0||console.error("Tile[",e.lij,"] has renderData but no indices - geometryInfo: ",e.renderData.geometry),t(e)){e.checkGeometryWaterproofness();for(const t of e.children)i(t,e)}else if(e.isLeaf)console.error("Tile[",e.lij,"] has no geometry and no children, from root to leaf");else for(const t of e.children)r(t)},s=e=>{const t=e.parent?.visible??!0,i=e.visible;e.computeVisibility();const r=e.visible;if(i!==r&&t&&console.error(" Tile[",e.lij,"] has out of date visibility: ",i," instead of ",r),!e.isLeaf)for(const a of e.children)s(a)};for(const a of e)r(a),s(a)}get isGlobal(){return this._isGlobal}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateeCarree(){return this._isWebMercatorOnPlateeCarree}isEastEndWrap(e){return this.isGlobal&&e[2]===this.lijEastEnd(e[0])-1}isWestEndWrap(e){return this.isGlobal&&0===e[2]}lijEastEnd(e){return 2**(e+(null!=this.spatialReference&&this.spatialReference.isGeographic?1:0))}wrapEastWest(e){const t=this.lijEastEnd(e[0]),i=e[2];if(0<=i&&i<t)return e;if(!this.isGlobal)return null;const r=(i+(i<0?t:0))%t;return[e[0],e[1],r]}enableInternalChecks(e){Ve(e)}enableWaterproofnessChecks(e){ke(e)}};e([w()],st.prototype,"_renderer",void 0),e([w({constructOnly:!0})],st.prototype,"_scaleRangeQueries",void 0),e([w({constructOnly:!0})],st.prototype,"view",void 0),e([w({constructOnly:!0})],st.prototype,"overlayManager",void 0),e([w()],st.prototype,"_hasPendingUpdates",void 0),e([w()],st.prototype,"_asyncWorkItems",void 0),e([w()],st.prototype,"_allTilesDirty",void 0),e([w()],st.prototype,"_allTilesSorted",void 0),e([w()],st.prototype,"_viewChanged",void 0),e([w()],st.prototype,"_splitLimits",void 0),e([w({readOnly:!0})],st.prototype,"_watchUpdatingTracking",void 0),e([w()],st.prototype,"_frameTask",void 0),e([w({readOnly:!0})],st.prototype,"snapLevel",null),e([w({readOnly:!0})],st.prototype,"lodSnapping",null),e([w()],st.prototype,"_userClippingExtent",null),e([w()],st.prototype,"_rootTilesExtent",void 0),e([w({readOnly:!0})],st.prototype,"extent",null),e([w({readOnly:!0})],st.prototype,"groundExtent",null),e([w({readOnly:!0})],st.prototype,"_tilingSchemeExtent",null),e([w({readOnly:!0})],st.prototype,"updating",null),e([w({readOnly:!0})],st.prototype,"running",null),e([w(J)],st.prototype,"updatingProgress",void 0),e([w({readOnly:!0})],st.prototype,"updatingProgressValue",null),e([w()],st.prototype,"_maxNumUpdating",void 0),e([w()],st.prototype,"baseOpacity",null),e([w()],st.prototype,"hasCompositeBlendMode",void 0),e([w({readOnly:!0})],st.prototype,"viewingMode",null),e([w()],st.prototype,"maxTextureScale",void 0),e([w({readOnly:!0})],st.prototype,"ready",null),e([w({value:he.FRONT_TO_BACK})],st.prototype,"renderOrder",null),e([w({readOnly:!0})],st.prototype,"rootTiles",null),e([w()],st.prototype,"_rootTiles",void 0),e([w({readOnly:!0})],st.prototype,"spatialReference",null),e([w({type:t})],st.prototype,"backgroundColor",null),e([w({value:!1})],st.prototype,"slicePlaneEnabled",null),e([w({readOnly:!0})],st.prototype,"tilingScheme",void 0),e([w({readOnly:!0})],st.prototype,"tilingSchemeLocked",null),e([w({readOnly:!0})],st.prototype,"tilingSchemeLogic",void 0),e([w({value:!0})],st.prototype,"velvetOverground",null),e([w()],st.prototype,"wireframe",null),e([w({value:!1})],st.prototype,"suspended",null),e([w()],st.prototype,"textureFadeDuration",null),e([w()],st.prototype,"visibleElevationBounds",void 0),e([w()],st.prototype,"rootTileElevationBounds",void 0),e([w()],st.prototype,"_layerViewsDirty",void 0),e([w()],st.prototype,"renderPatchBorders",null),e([w()],st.prototype,"visualizeNormals",null),e([w()],st.prototype,"renderingDisabled",null),st=e([E("esri.views.3d.terrain.TerrainSurface")],st);const at=st;function nt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function lt(e){const t=e.children;if(!t[0])return!1;for(const i of t)if(i.shouldLoad)return!0;for(const i of t)if(lt(i))return!0;return!1}function ot(e){return e.isLeaf&&(e.parent?.shouldLoad??!1)}const ht=b(),dt=j(),pt=[0,0,0],ut=new u,ct={spatialReference:null,extent:j(),context:"ground"},_t={spatialReference:null,extent:null,scale:0};function gt(e,t,i){for(const r of e){if(!r.containsPointXY(t,i))continue;let e=r;for(;e&&!e.renderData;){const r=(t>e.extentMidX?1:0)+(i<e.extentMidY?2:0);e=e.children[r]}const s=e?.renderData?.geometryState.samplerData??null;return te(t,i,s)}return null}export{at as default};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as o}from"../../../../../../core/mathUtils.js";import{earth as a}from"../../../../../../geometry/support/Ellipsoid.js";import{FadeInOutStages as t}from"../../../../environment/CloudsCompositionParameters.js";import{CloudsTextureChannels as e,CloudsRenderingStages as r}from"../../../../environment/CloudsData.js";import{addMainLightDirection as d,addMainLightIntensity as
|
|
5
|
+
import{clamp as o}from"../../../../../../core/mathUtils.js";import{earth as a}from"../../../../../../geometry/support/Ellipsoid.js";import{FadeInOutStages as t}from"../../../../environment/CloudsCompositionParameters.js";import{CloudsTextureChannels as e,CloudsRenderingStages as r}from"../../../../environment/CloudsData.js";import{addMainLightDirection as d,addMainLightIntensity as i}from"../shading/MainLighting.glsl.js";import{BooleanPassUniform as n}from"../../shaderModules/BooleanPassUniform.js";import{Float3PassUniform as c}from"../../shaderModules/Float3PassUniform.js";import{FloatPassUniform as l}from"../../shaderModules/FloatPassUniform.js";import{glsl as s}from"../../shaderModules/interfaces.js";import{Matrix4PassUniform as u}from"../../shaderModules/Matrix4PassUniform.js";import{TextureCubePassUniform as C}from"../../shaderModules/TextureCubePassUniform.js";function m(m){const v=m.fragment;v.uniforms.add([new u("rotationMatrixClouds",((o,a)=>a.cloudsFade.parallax.transform)),new u("rotationMatrixCloudsCrossFade",((o,a)=>a.cloudsFade.parallaxNew.transform)),new c("anchorPosition",((o,a)=>a.cloudsFade.parallax.anchorPointClouds)),new c("anchorPositionCrossFade",((o,a)=>a.cloudsFade.parallaxNew.anchorPointClouds)),new l("cloudsHeight",((o,a)=>a.cloudsFade.parallax.cloudsHeight)),new l("radiusCurvatureCorrectionFactor",((o,a)=>a.cloudsFade.parallax.radiusCurvatureCorrectionFactor)),new l("totalFadeInOut",((o,a)=>a.cloudsFade.fadeInOut.stage===t.FINISHED?a.cloudsFade.fadeInOutHeight.factor+1-a.cloudsFade.fadeIn.factor:a.cloudsFade.fadeInOutHeight.factor+1-a.cloudsFade.fadeInOut.factor)),new l("crossFadeAnchorFactor",((a,t)=>o(t.cloudsFade.crossFade.factor,0,1))),new C("cubeMap",((o,a)=>a.cloudsFade.data?.cubeMap?a.cloudsFade.data.cubeMap.colorTexture:null)),new n("crossFade",((o,a)=>a.cloudsFade.crossFade.enabled)),new n("readChannelsRG",((o,a)=>a.cloudsFade.readChannels===e.RG)),new n("fadeTextureChannels",((o,a)=>a.cloudsFade.renderingStage===r.FADING_TEXTURE_CHANNELS))]),v.constants.add("planetRadius","float",a.radius),v.code.add(s`vec3 intersectWithCloudLayer(vec3 dir, vec3 cameraPosition, vec3 spherePos)
|
|
6
6
|
{
|
|
7
7
|
float radiusClouds = planetRadius + cloudsHeight;
|
|
8
8
|
float B = 2.0 * dot(cameraPosition, dir);
|
|
@@ -19,7 +19,7 @@ return dir;
|
|
|
19
19
|
}`),v.code.add(s`vec3 rotateDirectionToAnchorPoint(mat4 rotMat, vec3 inVec)
|
|
20
20
|
{
|
|
21
21
|
return (rotMat * vec4(inVec, 0.0)).xyz;
|
|
22
|
-
}`),d(v),
|
|
22
|
+
}`),d(v),i(v),v.code.add(s`const float SUNSET_TRANSITION_FACTOR = 0.3;
|
|
23
23
|
const vec3 RIM_COLOR = vec3(0.28, 0.175, 0.035);
|
|
24
24
|
const float RIM_SCATTERING_FACTOR = 140.0;
|
|
25
25
|
const float BACKLIGHT_FACTOR = 0.2;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../core/Error.js";import r from"../../../../../core/Logger.js";const
|
|
5
|
+
import e from"../../../../../core/Error.js";import r from"../../../../../core/Logger.js";import{assert as t}from"../../lib/Util.js";const n=r.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,r){if(this._includedModules.has(e)){const t=this._includedModules.get(e);if(t!==r){n.error("Trying to include shader module multiple times with different sets of options.");const r=new Set;for(const n of Object.keys(t))t[n]!==e[n]&&r.add(n);for(const n of Object.keys(e))t[n]!==e[n]&&r.add(n);r.forEach((r=>console.error(` ${r}: current ${t[r]} new ${e[r]}`)))}}else this._includedModules.set(e,r),e(this.builder,r)}}class i extends s{constructor(){super(...arguments),this.vertex=new c,this.fragment=new c,this.attributes=new u,this.varyings=new l,this.extensions=new m,this.constants=new h}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const r=this.extensions.generateSource(e),t=this.attributes.generateSource(e),n=this.varyings.generateSource(e),s="vertex"===e?this.vertex:this.fragment,i=s.uniforms.generateSource(),o=s.code.generateSource(),a="vertex"===e?_:d,c=this.constants.generateSource().concat(s.constants.generateSource());return`#version 300 es\n${r.join("\n")}\n\n${a}\n\n${c.join("\n")}\n\n${i.join("\n")}\n\n${t.join("\n")}\n\n${n.join("\n")}\n\n${o.join("\n")}`}generateBind(e,r){const t=new Map;this.vertex.uniforms.entries.forEach((r=>{const n=r.bind[e];null!=n&&t.set(r.name,n)})),this.fragment.uniforms.entries.forEach((r=>{const n=r.bind[e];null!=n&&t.set(r.name,n)}));const n=Array.from(t.values()),s=n.length;return(e,t,i)=>{for(let o=0;o<s;++o)n[o](r,e,t,i)}}}class o{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const r of e)this._add(r)}get(e){return this._entries.get(e)}_add(r){if(null!=r){if(this._entries.has(r.name)&&!this._entries.get(r.name).equals(r))throw new e(`Duplicate uniform name ${r.name} for different uniform type`);this._entries.set(r.name,r)}else n.error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class a{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class c extends s{constructor(){super(...arguments),this.uniforms=new o,this.code=new a,this.constants=new h}get builder(){return this}}class u{constructor(){this._entries=new Array}add(e,r){this._entries.push([e,r])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class l{constructor(){this._entries=new Map}add(e,r){this._entries.has(e)&&t(this._entries.get(e)===r),this._entries.set(e,r)}generateSource(e){const r=new Array;return this._entries.forEach(((t,n)=>r.push("vertex"===e?`out ${t} ${n};`:`in ${t} ${n};`))),r}}class m{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const r="vertex"===e?m.ALLOWLIST_VERTEX:m.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>r.includes(e))).map((e=>`#extension ${e} : enable`))}}m.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],m.ALLOWLIST_VERTEX=[];class h{constructor(){this._entries=new Set}add(e,r,t){let n="ERROR_CONSTRUCTOR_STRING";switch(r){case"float":n=h._numberToFloatStr(t);break;case"int":n=h._numberToIntStr(t);break;case"bool":n=t.toString();break;case"vec2":n=`vec2(${h._numberToFloatStr(t[0])}, ${h._numberToFloatStr(t[1])})`;break;case"vec3":n=`vec3(${h._numberToFloatStr(t[0])}, ${h._numberToFloatStr(t[1])}, ${h._numberToFloatStr(t[2])})`;break;case"vec4":n=`vec4(${h._numberToFloatStr(t[0])}, ${h._numberToFloatStr(t[1])}, ${h._numberToFloatStr(t[2])}, ${h._numberToFloatStr(t[3])})`;break;case"ivec2":n=`ivec2(${h._numberToIntStr(t[0])}, ${h._numberToIntStr(t[1])})`;break;case"ivec3":n=`ivec3(${h._numberToIntStr(t[0])}, ${h._numberToIntStr(t[1])}, ${h._numberToIntStr(t[2])})`;break;case"ivec4":n=`ivec4(${h._numberToIntStr(t[0])}, ${h._numberToIntStr(t[1])}, ${h._numberToIntStr(t[2])}, ${h._numberToIntStr(t[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${r}(${Array.prototype.map.call(t,(e=>h._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${r} ${e} = ${n};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const d="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif\n\nout vec4 fragColor;",_="precision highp float;\nprecision highp sampler2D;";export{a as Code,s as Includes,i as ShaderBuilder,c as Stage,o as Uniforms};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{VertexAttribute as O}from"./VertexAttribute.js";const E=new Map([[O.POSITION,0],[O.NORMAL,1],[O.UV0,2],[O.COLOR,3],[O.SIZE,4],[O.TANGENT,4],[O.AUXPOS1,5],[O.SYMBOLCOLOR,5],[O.AUXPOS2,6],[O.FEATUREATTRIBUTE,6],[O.INSTANCEFEATUREATTRIBUTE,6],[O.INSTANCECOLOR,7],[O.OBJECTANDLAYERIDCOLOR,7],[O.OBJECTANDLAYERIDCOLOR_INSTANCED,7],[O.MODEL,8],[O.MODELNORMAL,12],[O.MODELORIGINHI,11],[O.MODELORIGINLO,15]]);export{E as Default3D};
|
|
5
|
+
import{VertexAttribute as O}from"./VertexAttribute.js";const E=new Map([[O.POSITION,0],[O.NORMAL,1],[O.UV0,2],[O.COLOR,3],[O.COLORFEATUREATTRIBUTE,3],[O.SIZE,4],[O.TANGENT,4],[O.AUXPOS1,5],[O.SYMBOLCOLOR,5],[O.AUXPOS2,6],[O.FEATUREATTRIBUTE,6],[O.INSTANCEFEATUREATTRIBUTE,6],[O.INSTANCECOLOR,7],[O.OBJECTANDLAYERIDCOLOR,7],[O.OBJECTANDLAYERIDCOLOR_INSTANCED,7],[O.MODEL,8],[O.MODELNORMAL,12],[O.MODELORIGINHI,11],[O.MODELORIGINLO,15]]);export{E as Default3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{Z as e}from"../../../../chunks/vec4f64.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as
|
|
5
|
+
import has from"../../../../core/has.js";import{Z as e}from"../../../../chunks/vec4f64.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as s}from"../lib/basicInterfaces.js";import a from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as i}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{VertexAttribute as n}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{TriangleMaterial as l}from"./TriangleMaterial.js";import{VisualVariablePassParameters as u}from"./VisualVariablePassParameters.js";import{ColorMaterialTechnique as c}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as p}from"../shaders/ColorMaterialTechniqueConfiguration.js";class f extends l{constructor(e){super(e,new d),this.supportsEdges=!0,this._configuration=new p}getConfiguration(e,r){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.enableOffset=r.camera.relativeElevation<i,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration}requiresSlot(e,r){if(r===t.Color||r===t.Alpha||r===t.Highlight||r===t.Depth&&this.parameters.writeLinearDepth||r===t.ObjectAndLayerIdColor){if(e===o.DRAPED_MATERIAL)return!0;if(r===t.Highlight)return e===o.OPAQUE_MATERIAL;return e===(this.parameters.transparent?this.parameters.writeDepth?o.TRANSPARENT_MATERIAL:o.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:o.OPAQUE_MATERIAL)}return!1}createGLMaterial(e){return new m(e)}createBufferWriter(){const e=r().vec3f(n.POSITION);return has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(n.OBJECTANDLAYERIDCOLOR),this.parameters.vvColor?e.f32(n.COLORFEATUREATTRIBUTE):e.vec4u8(n.COLOR),new h(e)}}class m extends a{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==t.Color&&this._output!==t.Alpha||this._updateOccludeeState(e),this.ensureTechnique(c,e)}}class d extends u{constructor(){super(...arguments),this.color=e,this.transparent=!1,this.writeDepth=!0,this.writeLinearDepth=!1,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=s.None,this.hasOccludees=!1}}export{f as ColorMaterial,d as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{f as
|
|
5
|
+
import{f as e}from"../../../../chunks/vec4f64.js";import{BufferViewMat3f as t,BufferViewVec4f as r,BufferViewVec4u8 as i,BufferViewVec3f as s}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as n}from"../lib/basicInterfaces.js";import c from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{assert as l}from"../lib/Util.js";import{VertexAttribute as p}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as f}from"./DefaultBufferWriter.js";import{Style as m}from"./PatternStyle.js";import{TriangleMaterial as d}from"./TriangleMaterial.js";import{VisualVariablePassParameters as g}from"./VisualVariablePassParameters.js";import{writeBufferVec4 as _,writeColor as A,writePosition as b}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocations as O,PatternTechniqueConfiguration as P,PatternTechnique as T}from"../shaders/PatternTechnique.js";class S extends d{constructor(e){super(e,new R),this.supportsEdges=!0,this._vertexAttributeLocations=O,this._configuration=new P}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.style=this.parameters.style,this._configuration.patternSpacing=this.parameters.patternSpacing,this._configuration.lineWidth=this.parameters.lineWidth,this._configuration.draped=this.parameters.draped,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<u,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}requiresSlot(e,t){if(t===o.Color||t===o.Alpha||t===o.Highlight||t===o.Depth&&this.parameters.writeLinearDepth){if(e===h.DRAPED_MATERIAL)return!0;if(t===o.Highlight)return e===h.OPAQUE_MATERIAL;return e===(this.parameters.writeDepth?h.TRANSPARENT_MATERIAL:h.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return!1}createGLMaterial(e){return new y(e)}createBufferWriter(){const e=a().vec3f(p.POSITION).vec4u8(p.COLOR).vec4f(p.UVMAPSPACE);return this.parameters.draped||e.mat3f(p.BOUNDINGRECT),new E(e)}}class y extends c{_updateParameters(e){return this.ensureTechnique(T,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==o.Color&&this._output!==o.Alpha||this._updateOccludeeState(e),this._updateParameters(e)}}class E extends f{write(e,a,o,n,c){for(const u of this.vertexBufferLayout.fields.keys()){const a=o.vertexAttributes.get(u),h=o.indices.get(u);if(a&&h)switch(u){case p.POSITION:{l(3===a.size);const t=n.getField(u,s);t&&b(h,a.data,e,t,c);break}case p.COLOR:{l(3===a.size||4===a.size);const e=n.getField(u,i);e&&A(h,a.data,a.size,e,c);break}case p.UVMAPSPACE:{l(4===a.size);const e=n.getField(u,r);e&&_(h,a.data,e,c);break}case p.BOUNDINGRECT:{l(9===a.size);const r=n.getField(u,t);r&&this.writeBoundingRect(h,a.data,e,r,c);break}}}}writeBoundingRect(e,t,r,i,s){const a=r,o=i.typedBuffer,n=i.typedBufferStride,c=e.length;s*=n;for(let u=0;u<c;++u){const r=9*e[u],i=t[r],c=t[r+1],h=t[r+2];o[s]=a[0]*i+a[4]*c+a[8]*h+a[12],o[s+1]=a[1]*i+a[5]*c+a[9]*h+a[13],o[s+2]=a[2]*i+a[6]*c+a[10]*h+a[14];for(let e=3;e<9;++e)o[s+e]=t[r+e];s+=n}}}class R extends g{constructor(){super(...arguments),this.color=e(1,1,1,1),this.writeDepth=!0,this.writeLinearDepth=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=n.None,this.hasOccludees=!1,this.style=m.Cross,this.patternSpacing=10,this.lineWidth=1,this.draped=!0}}export{R as Parameters,S as PatternMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{c as i}from"../../../../chunks/vec2.js";import{s,b as a,e as n,g as o,a as l,c,l as h,i as u,m as p}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{O as f}from"../../../../chunks/vec4f64.js";import{PlaneIndex as T}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as d,fromPoints as A,closestLineSegmentPoint as E}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as R,signedDistance as S,normal as I}from"../../../../geometry/support/plane.js";import{newLayout as g}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as O}from"../core/shaderLibrary/ShaderOutput.js";import b from"../lib/GLMaterial.js";import{Material as L,RenderOccludedFlag as P}from"../lib/Material.js";import{RenderSlot as N}from"../lib/RenderSlot.js";import{isTranslationMatrix as C}from"../lib/Util.js";import{VertexAttribute as y}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as j}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as D}from"../shaders/LineMarkerTechniqueConfiguration.js";import{R as U}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as x,RibbonLineTechnique as F}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as w,CapType as M}from"../shaders/RibbonLineTechniqueConfiguration.js";var J;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(J||(J={}));class B extends L{constructor(e){super(e,new G),this._configuration=new w,this._vertexAttributeLocations=x,this._layout=this.createLayout()}isClosed(e,t){return V(this.parameters,e,t)}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===N.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==O.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stippleScaleWithLineWidth=r&&this.parameters.stippleScaleWithLineWidth,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&Z(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===P.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,r,i,s,a,n){if(!i.options.selectionMode)return;const o=e.vertexAttributes.get(y.POSITION).data,l=e.vertexAttributes.get(y.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0];c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const h=s[0],u=s[1],p=(c/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,f=0;for(let T=0;T<o.length-5;T+=3){const e=o[T],r=o[T+1],i=h-e,s=u-r,a=o[T+3]-e,n=o[T+4]-r,l=t((a*i+n*s)/(a*a+n*n),0,1),c=a*l-i,p=n*l-s,_=c*c+p*p;_<m&&(m=_,f=T/3)}m<p*p&&a(n.dist,n.normal,f,!1)}intersect(r,p,m,f,_,v){if(!m.options.selectionMode||!r.visible)return;if(!C(p))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const g=r.vertexAttributes,O=g.get(y.POSITION).data;let b=this.parameters.width;if(this.parameters.vvSize){const e=g.get(y.SIZEFEATUREATTRIBUTE).data[0];b*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else g.has(y.SIZE)&&(b*=g.get(y.SIZE).data[0]);const L=m.camera,P=K;i(P,m.point);const N=b*L.pixelRatio/2+4*L.pixelRatio;s(le[0],P[0]-N,P[1]+N,0),s(le[1],P[0]+N,P[1]+N,0),s(le[2],P[0]+N,P[1]-N,0),s(le[3],P[0]-N,P[1]-N,0);for(let e=0;e<4;e++)if(!L.unprojectFromRenderScreen(le[e],ce[e]))return;R(L.eye,ce[0],ce[1],he),R(L.eye,ce[1],ce[2],ue),R(L.eye,ce[2],ce[3],pe),R(L.eye,ce[3],ce[0],me);let j=Number.MAX_VALUE,D=0;const U=W(this.parameters,g,r.indices)?O.length-2:O.length-5;for(let e=0;e<U;e+=3){q[0]=O[e]+p[12],q[1]=O[e+1]+p[13],q[2]=O[e+2]+p[14];const t=(e+3)%O.length;if(X[0]=O[t]+p[12],X[1]=O[t+1]+p[13],X[2]=O[t+2]+p[14],S(he,q)<0&&S(he,X)<0||S(ue,q)<0&&S(ue,X)<0||S(pe,q)<0&&S(pe,X)<0||S(me,q)<0&&S(me,X)<0)continue;if(L.projectToRenderScreen(q,$),L.projectToRenderScreen(X,ee),$[2]<0&&ee[2]>0){a(Y,q,X);const e=L.frustum,t=-S(e[T.NEAR],q)/n(Y,I(e[T.NEAR]));o(Y,Y,t),l(q,q,Y),L.projectToRenderScreen(q,$)}else if($[2]>0&&ee[2]<0){a(Y,X,q);const e=L.frustum,t=-S(e[T.NEAR],X)/n(Y,I(e[T.NEAR]));o(Y,Y,t),l(X,X,Y),L.projectToRenderScreen(X,ee)}else if($[2]<0&&ee[2]<0)continue;$[2]=0,ee[2]=0;const r=d(A($,ee,ie),P);r<j&&(j=r,c(te,q),c(re,X),D=e/3)}const x=m.rayBegin,F=m.rayEnd;if(j<N*N){let e=Number.MAX_VALUE;if(E(A(te,re,ie),A(x,F,se),Q)){a(Q,Q,x);const t=h(Q);o(Q,Q,1/t),e=t/u(x,F)}v(e,Q,D,!1)}}createLayout(){const e=g().vec3f(y.POSITION).f32(y.SUBDIVISIONFACTOR).vec2f(y.UV0).vec3f(y.AUXPOS1).vec3f(y.AUXPOS2);return this.parameters.vvSize?e.f32(y.SIZEFEATUREATTRIBUTE):e.f32(y.SIZE),this.parameters.vvColor?e.f32(y.COLORFEATUREATTRIBUTE):e.vec4f(y.COLOR),this.parameters.vvOpacity&&e.f32(y.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(y.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new H(this._layout,this.parameters)}requiresSlot(e,t){if(t===O.Color||t===O.Alpha||t===O.Highlight||t===O.Depth||t===O.ObjectAndLayerIdColor){if(e===N.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===P.OccludeAndTransparentStencil)return e===N.OPAQUE_MATERIAL||e===N.OCCLUDER_MATERIAL||e===N.TRANSPARENT_OCCLUDER_MATERIAL;if(t===O.Color||t===O.Alpha){return e===(this.parameters.writeDepth?N.TRANSPARENT_MATERIAL:N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===N.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new z(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class z extends b{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==O.Color&&this._output!==O.Alpha||this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters(this._stippleTextureRepository.swap(this._stipplePattern,t)),this._stipplePattern=t),this.ensureTechnique(F,e)}}class G extends j{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=M.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stippleScaleWithLineWidth=!1,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}}class H{constructor(e,t){this._parameters=t,this.numJoinSubdivisions=0,this.vertexBufferLayout=e;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=U+r}}_isClosed(e){return W(this._parameters,e.vertexAttributes,e.indices)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.indices.get(y.POSITION).length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a){const n=ae,o=ne,l=oe,h=r.vertexAttributes.get(y.POSITION).data,m=r.indices&&r.indices.get(y.POSITION),f=r.vertexAttributes.get(y.DISTANCETOSTART)?.data;m&&m.length!==2*(h.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let T=1,_=0;this._parameters.vvSize?_=r.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.SIZE)&&(T=r.vertexAttributes.get(y.SIZE).data[0]);let d=[1,1,1,1],A=0;this._parameters.vvColor?A=r.vertexAttributes.get(y.COLORFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.COLOR)&&(d=r.vertexAttributes.get(y.COLOR).data);const E=has("enable-feature:objectAndLayerId-rendering")?r.objectAndLayerIdColor:null;let v=0;this._parameters.vvOpacity&&(v=r.vertexAttributes.get(y.OPACITYFEATUREATTRIBUTE).data[0]);const R=h.length/3,S=new Float32Array(i.buffer),I=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(i.buffer):null,g=this.vertexBufferLayout.stride/4;let O=a*g;const b=O;let L=0;const P=f?(e,t,r)=>L=f[r]:(e,t,r)=>L+=u(e,t),N=has("enable-feature:objectAndLayerId-rendering"),C=(e,t,r,i,s,a,n)=>{if(S[O++]=t[0],S[O++]=t[1],S[O++]=t[2],S[O++]=i,S[O++]=n,S[O++]=s,S[O++]=e[0],S[O++]=e[1],S[O++]=e[2],S[O++]=r[0],S[O++]=r[1],S[O++]=r[2],S[O++]=this._parameters.vvSize?_:T,this._parameters.vvColor)S[O++]=A;else{const e=Math.min(4*a,d.length-4);S[O++]=d[e],S[O++]=d[e+1],S[O++]=d[e+2],S[O++]=d[e+3]}this._parameters.vvOpacity&&(S[O++]=v),N&&(null!=E&&(I[4*O]=E[0],I[4*O+1]=E[1],I[4*O+2]=E[2],I[4*O+3]=E[3]),O++)};O+=g,s(o,h[0],h[1],h[2]),e&&p(o,o,e);const j=this._isClosed(r);if(j){const t=h.length-3;s(n,h[t],h[t+1],h[t+2]),e&&p(n,n,e)}else s(l,h[3],h[4],h[5]),e&&p(l,l,e),C(o,o,l,1,J.LEFT_CAP_START,0,0),C(o,o,l,1,J.RIGHT_CAP_START,0,0),c(n,o),c(o,l);const D=j?0:1,U=j?R:R-1;for(let u=D;u<U;u++){const t=(u+1)%R*3;s(l,h[t],h[t+1],h[t+2]),e&&p(l,l,e),P(n,o,u),C(n,o,l,0,J.LEFT_JOIN_END,u,L),C(n,o,l,0,J.RIGHT_JOIN_END,u,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);C(n,o,l,t,J.LEFT_JOIN_END,u,L),C(n,o,l,t,J.RIGHT_JOIN_END,u,L)}C(n,o,l,1,J.LEFT_JOIN_START,u,L),C(n,o,l,1,J.RIGHT_JOIN_START,u,L),c(n,o),c(o,l)}j?(s(l,h[3],h[4],h[5]),e&&p(l,l,e),L=P(n,o,U),C(n,o,l,0,J.LEFT_JOIN_END,D,L),C(n,o,l,0,J.RIGHT_JOIN_END,D,L)):(L=P(n,o,U),C(n,o,o,0,J.LEFT_CAP_END,U,L),C(n,o,o,0,J.RIGHT_CAP_END,U,L)),k(S,b+g,S,b,g);O=k(S,O-g,S,O,g),this._parameters.wireframe&&this._addWireframeVertices(i,b,O,g)}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=k(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function k(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function W(e,t,r){return V(e,t.get(y.POSITION).data,r?r.get(y.POSITION):null)}function V(e,t,r){return!!e.isClosed&&(r?r.length>2:t.length>6)}function Z(e){return e.anchor===D.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const q=m(),X=m(),Y=m(),Q=m(),K=m(),$=r(),ee=r(),te=m(),re=m(),ie=_(),se=_(),ae=m(),ne=m(),oe=m(),le=[r(),r(),r(),r()],ce=[m(),m(),m(),m()],he=v(),ue=v(),pe=v(),me=v();export{G as Parameters,B as RibbonLineMaterial};
|
|
5
|
+
import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{c as i}from"../../../../chunks/vec2.js";import{s,b as a,e as n,g as o,a as l,c,l as h,i as u,m as p}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{O as f}from"../../../../chunks/vec4f64.js";import{PlaneIndex as T}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as d,fromPoints as A,closestLineSegmentPoint as E}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as R,signedDistance as S,normal as g}from"../../../../geometry/support/plane.js";import{newLayout as I}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as O}from"../core/shaderLibrary/ShaderOutput.js";import b from"../lib/GLMaterial.js";import{Material as P,RenderOccludedFlag as L}from"../lib/Material.js";import{RenderSlot as N}from"../lib/RenderSlot.js";import{isTranslationMatrix as C}from"../lib/Util.js";import{VertexAttribute as y}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as j}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as D}from"../shaders/LineMarkerTechniqueConfiguration.js";import{R as U}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as x,RibbonLineTechnique as F}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as w,CapType as M}from"../shaders/RibbonLineTechniqueConfiguration.js";var J;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(J||(J={}));class B extends P{constructor(e){super(e,new G),this._configuration=new w,this._vertexAttributeLocations=x}isClosed(e,t){return V(this.parameters,e,t)}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===N.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==O.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stippleScaleWithLineWidth=r&&this.parameters.stippleScaleWithLineWidth,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&Z(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===L.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,r,i,s,a,n){if(!i.options.selectionMode)return;const o=e.vertexAttributes.get(y.POSITION).data,l=e.vertexAttributes.get(y.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0];c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const h=s[0],u=s[1],p=(c/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,f=0;for(let T=0;T<o.length-5;T+=3){const e=o[T],r=o[T+1],i=h-e,s=u-r,a=o[T+3]-e,n=o[T+4]-r,l=t((a*i+n*s)/(a*a+n*n),0,1),c=a*l-i,p=n*l-s,_=c*c+p*p;_<m&&(m=_,f=T/3)}m<p*p&&a(n.dist,n.normal,f,!1)}intersect(r,p,m,f,_,v){if(!m.options.selectionMode||!r.visible)return;if(!C(p))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const I=r.vertexAttributes,O=I.get(y.POSITION).data;let b=this.parameters.width;if(this.parameters.vvSize){const e=I.get(y.SIZEFEATUREATTRIBUTE).data[0];b*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else I.has(y.SIZE)&&(b*=I.get(y.SIZE).data[0]);const P=m.camera,L=K;i(L,m.point);const N=b*P.pixelRatio/2+4*P.pixelRatio;s(le[0],L[0]-N,L[1]+N,0),s(le[1],L[0]+N,L[1]+N,0),s(le[2],L[0]+N,L[1]-N,0),s(le[3],L[0]-N,L[1]-N,0);for(let e=0;e<4;e++)if(!P.unprojectFromRenderScreen(le[e],ce[e]))return;R(P.eye,ce[0],ce[1],he),R(P.eye,ce[1],ce[2],ue),R(P.eye,ce[2],ce[3],pe),R(P.eye,ce[3],ce[0],me);let j=Number.MAX_VALUE,D=0;const U=W(this.parameters,I,r.indices)?O.length-2:O.length-5;for(let e=0;e<U;e+=3){q[0]=O[e]+p[12],q[1]=O[e+1]+p[13],q[2]=O[e+2]+p[14];const t=(e+3)%O.length;if(X[0]=O[t]+p[12],X[1]=O[t+1]+p[13],X[2]=O[t+2]+p[14],S(he,q)<0&&S(he,X)<0||S(ue,q)<0&&S(ue,X)<0||S(pe,q)<0&&S(pe,X)<0||S(me,q)<0&&S(me,X)<0)continue;if(P.projectToRenderScreen(q,$),P.projectToRenderScreen(X,ee),$[2]<0&&ee[2]>0){a(Y,q,X);const e=P.frustum,t=-S(e[T.NEAR],q)/n(Y,g(e[T.NEAR]));o(Y,Y,t),l(q,q,Y),P.projectToRenderScreen(q,$)}else if($[2]>0&&ee[2]<0){a(Y,X,q);const e=P.frustum,t=-S(e[T.NEAR],X)/n(Y,g(e[T.NEAR]));o(Y,Y,t),l(X,X,Y),P.projectToRenderScreen(X,ee)}else if($[2]<0&&ee[2]<0)continue;$[2]=0,ee[2]=0;const r=d(A($,ee,ie),L);r<j&&(j=r,c(te,q),c(re,X),D=e/3)}const x=m.rayBegin,F=m.rayEnd;if(j<N*N){let e=Number.MAX_VALUE;if(E(A(te,re,ie),A(x,F,se),Q)){a(Q,Q,x);const t=h(Q);o(Q,Q,1/t),e=t/u(x,F)}v(e,Q,D,!1)}}get _layout(){const e=I().vec3f(y.POSITION).f32(y.SUBDIVISIONFACTOR).vec2f(y.UV0).vec3f(y.AUXPOS1).vec3f(y.AUXPOS2);return this.parameters.vvSize?e.f32(y.SIZEFEATUREATTRIBUTE):e.f32(y.SIZE),this.parameters.vvColor?e.f32(y.COLORFEATUREATTRIBUTE):e.vec4f(y.COLOR),this.parameters.vvOpacity&&e.f32(y.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(y.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new H(this._layout,this.parameters)}requiresSlot(e,t){if(t===O.Color||t===O.Alpha||t===O.Highlight||t===O.Depth||t===O.ObjectAndLayerIdColor){if(e===N.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===L.OccludeAndTransparentStencil)return e===N.OPAQUE_MATERIAL||e===N.OCCLUDER_MATERIAL||e===N.TRANSPARENT_OCCLUDER_MATERIAL;if(t===O.Color||t===O.Alpha){return e===(this.parameters.writeDepth?N.TRANSPARENT_MATERIAL:N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===N.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new z(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class z extends b{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==O.Color&&this._output!==O.Alpha||this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters(this._stippleTextureRepository.swap(this._stipplePattern,t)),this._stipplePattern=t),this.ensureTechnique(F,e)}}class G extends j{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=M.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stippleScaleWithLineWidth=!1,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}}class H{constructor(e,t){this._parameters=t,this.numJoinSubdivisions=0,this.vertexBufferLayout=e;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=U+r}}_isClosed(e){return W(this._parameters,e.vertexAttributes,e.indices)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.indices.get(y.POSITION).length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a){const n=ae,o=ne,l=oe,h=r.vertexAttributes.get(y.POSITION).data,m=r.indices&&r.indices.get(y.POSITION),f=r.vertexAttributes.get(y.DISTANCETOSTART)?.data;m&&m.length!==2*(h.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let T=1,_=0;this._parameters.vvSize?_=r.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.SIZE)&&(T=r.vertexAttributes.get(y.SIZE).data[0]);let d=[1,1,1,1],A=0;this._parameters.vvColor?A=r.vertexAttributes.get(y.COLORFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.COLOR)&&(d=r.vertexAttributes.get(y.COLOR).data);const E=has("enable-feature:objectAndLayerId-rendering")?r.objectAndLayerIdColor:null;let v=0;this._parameters.vvOpacity&&(v=r.vertexAttributes.get(y.OPACITYFEATUREATTRIBUTE).data[0]);const R=h.length/3,S=new Float32Array(i.buffer),g=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(i.buffer):null,I=this.vertexBufferLayout.stride/4;let O=a*I;const b=O;let P=0;const L=f?(e,t,r)=>P=f[r]:(e,t,r)=>P+=u(e,t),N=has("enable-feature:objectAndLayerId-rendering"),C=(e,t,r,i,s,a,n)=>{if(S[O++]=t[0],S[O++]=t[1],S[O++]=t[2],S[O++]=i,S[O++]=n,S[O++]=s,S[O++]=e[0],S[O++]=e[1],S[O++]=e[2],S[O++]=r[0],S[O++]=r[1],S[O++]=r[2],S[O++]=this._parameters.vvSize?_:T,this._parameters.vvColor)S[O++]=A;else{const e=Math.min(4*a,d.length-4);S[O++]=d[e],S[O++]=d[e+1],S[O++]=d[e+2],S[O++]=d[e+3]}this._parameters.vvOpacity&&(S[O++]=v),N&&(null!=E&&(g[4*O]=E[0],g[4*O+1]=E[1],g[4*O+2]=E[2],g[4*O+3]=E[3]),O++)};O+=I,s(o,h[0],h[1],h[2]),e&&p(o,o,e);const j=this._isClosed(r);if(j){const t=h.length-3;s(n,h[t],h[t+1],h[t+2]),e&&p(n,n,e)}else s(l,h[3],h[4],h[5]),e&&p(l,l,e),C(o,o,l,1,J.LEFT_CAP_START,0,0),C(o,o,l,1,J.RIGHT_CAP_START,0,0),c(n,o),c(o,l);const D=j?0:1,U=j?R:R-1;for(let u=D;u<U;u++){const t=(u+1)%R*3;s(l,h[t],h[t+1],h[t+2]),e&&p(l,l,e),L(n,o,u),C(n,o,l,0,J.LEFT_JOIN_END,u,P),C(n,o,l,0,J.RIGHT_JOIN_END,u,P);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);C(n,o,l,t,J.LEFT_JOIN_END,u,P),C(n,o,l,t,J.RIGHT_JOIN_END,u,P)}C(n,o,l,1,J.LEFT_JOIN_START,u,P),C(n,o,l,1,J.RIGHT_JOIN_START,u,P),c(n,o),c(o,l)}j?(s(l,h[3],h[4],h[5]),e&&p(l,l,e),P=L(n,o,U),C(n,o,l,0,J.LEFT_JOIN_END,D,P),C(n,o,l,0,J.RIGHT_JOIN_END,D,P)):(P=L(n,o,U),C(n,o,o,0,J.LEFT_CAP_END,U,P),C(n,o,o,0,J.RIGHT_CAP_END,U,P)),k(S,b+I,S,b,I);O=k(S,O-I,S,O,I),this._parameters.wireframe&&this._addWireframeVertices(i,b,O,I)}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=k(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function k(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function W(e,t,r){return V(e,t.get(y.POSITION).data,r?r.get(y.POSITION):null)}function V(e,t,r){return!!e.isClosed&&(r?r.length>2:t.length>6)}function Z(e){return e.anchor===D.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const q=m(),X=m(),Y=m(),Q=m(),K=m(),$=r(),ee=r(),te=m(),re=m(),ie=_(),se=_(),ae=m(),ne=m(),oe=m(),le=[r(),r(),r(),r()],ce=[m(),m(),m(),m()],he=v(),ue=v(),pe=v(),me=v();export{G as Parameters,B as RibbonLineMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{y as e,z as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4f as f,
|
|
5
|
+
import{y as e,z as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4f as f,BufferViewFloat as o,BufferViewVec4u8 as r,BufferViewVec2f as s,BufferViewVec3f as n}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as i}from"../../lib/Util.js";import{VertexAttribute as l}from"../../lib/VertexAttribute.js";function c(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let l=0;l<i;++l)s[o]=t[e[l]],o+=n;else for(let l=0;l<i;++l){const f=t[e[l]];for(let e=0;e<r;e++)s[o]=f,o+=n}}function d(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=2*e[i];r[o]=t[f],r[o+1]=t[f+1],o+=s}}function u(e,t,f,o,r){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,null==r||1===r)for(let l=0;l<i;++l){const f=3*e[l];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}else for(let l=0;l<i;++l){const f=3*e[l];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}}function a(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let l=0;l<i;++l){const f=4*e[l];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}else for(let l=0;l<i;++l){const f=4*e[l];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}}function p(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride;t*=r;for(let s=0;s<f;++s)o[t]=0,o[t+1]=0,o[t+2]=0,o[t+3]=0,t+=r}function y(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=9*e[i];for(let e=0;e<9;++e)r[o+e]=t[f+e];o+=s}}function B(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=16*e[i];for(let e=0;e<16;++e)r[o+e]=t[f+e];o+=s}}function g(t,f,o,r,s,n=1){if(!o)return void u(t,f,r,s,n);const i=r.typedBuffer,l=r.typedBufferStride,c=t.length,d=o[0],a=o[1],p=o[2],y=o[4],B=o[5],g=o[6],b=o[8],h=o[9],O=o[10],N=o[12],S=o[13],A=o[14];s*=l;let R=0,E=0,L=0;const z=e(o)?e=>{R=f[e]+N,E=f[e+1]+S,L=f[e+2]+A}:e=>{const t=f[e],o=f[e+1],r=f[e+2];R=d*t+y*o+b*r+N,E=a*t+B*o+h*r+S,L=p*t+g*o+O*r+A};if(1===n)for(let e=0;e<c;++e)z(3*t[e]),i[s]=R,i[s+1]=E,i[s+2]=L,s+=l;else for(let e=0;e<c;++e){z(3*t[e]);for(let e=0;e<n;++e)i[s]=R,i[s+1]=E,i[s+2]=L,s+=l}}function b(f,o,r,s,n,i=1){if(!r)return void u(f,o,s,n,i);const l=r,c=s.typedBuffer,d=s.typedBufferStride,a=f.length,p=l[0],y=l[1],B=l[2],g=l[4],b=l[5],h=l[6],O=l[8],N=l[9],S=l[10],A=!t(l),R=1e-6,E=1-R;n*=d;let L=0,z=0,F=0;const v=e(l)?e=>{L=o[e],z=o[e+1],F=o[e+2]}:e=>{const t=o[e],f=o[e+1],r=o[e+2];L=p*t+g*f+O*r,z=y*t+b*f+N*r,F=B*t+h*f+S*r};if(1===i)if(A)for(let e=0;e<a;++e){v(3*f[e]);const t=L*L+z*z+F*F;if(t<E&&t>R){const e=1/Math.sqrt(t);c[n]=L*e,c[n+1]=z*e,c[n+2]=F*e}else c[n]=L,c[n+1]=z,c[n+2]=F;n+=d}else for(let e=0;e<a;++e)v(3*f[e]),c[n]=L,c[n+1]=z,c[n+2]=F,n+=d;else for(let e=0;e<a;++e){if(v(3*f[e]),A){const e=L*L+z*z+F*F;if(e<E&&e>R){const t=1/Math.sqrt(e);L*=t,z*=t,F*=t}}for(let e=0;e<i;++e)c[n]=L,c[n+1]=z,c[n+2]=F,n+=d}}function h(e,f,o,r,s,n=1){if(!o)return void a(e,f,r,s,n);const i=o,l=r.typedBuffer,c=r.typedBufferStride,d=e.length,u=i[0],p=i[1],y=i[2],B=i[4],g=i[5],b=i[6],h=i[8],O=i[9],N=i[10],S=!t(i),A=1e-6,R=1-A;if(s*=c,1===n)for(let t=0;t<d;++t){const o=4*e[t],r=f[o],n=f[o+1],i=f[o+2],d=f[o+3];let a=u*r+B*n+h*i,E=p*r+g*n+O*i,L=y*r+b*n+N*i;if(S){const e=a*a+E*E+L*L;if(e<R&&e>A){const t=1/Math.sqrt(e);a*=t,E*=t,L*=t}}l[s]=a,l[s+1]=E,l[s+2]=L,l[s+3]=d,s+=c}else for(let t=0;t<d;++t){const o=4*e[t],r=f[o],i=f[o+1],d=f[o+2],a=f[o+3];let E=u*r+B*i+h*d,L=p*r+g*i+O*d,z=y*r+b*i+N*d;if(S){const e=E*E+L*L+z*z;if(e<R&&e>A){const t=1/Math.sqrt(e);E*=t,L*=t,z*=t}}for(let e=0;e<n;++e)l[s]=E,l[s+1]=L,l[s+2]=z,l[s+3]=a,s+=c}}function O(e,t,f,o,r,s=1){const n=o.typedBuffer,i=o.typedBufferStride,l=e.length;if(r*=i,f!==t.length||4!==f)if(1!==s)if(4!==f)for(let c=0;c<l;++c){const f=3*e[c];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=255,r+=i}else for(let c=0;c<l;++c){const f=4*e[c];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=t[f+3],r+=i}else{if(4===f){for(let f=0;f<l;++f){const o=4*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=t[o+3],r+=i}return}for(let f=0;f<l;++f){const o=3*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=255,r+=i}}else{n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3];const e=new Uint32Array(o.typedBuffer.buffer,o.start),f=i/4,c=e[r/=4];r+=f;const d=l*s;for(let t=1;t<d;++t)e[r]=c,r+=f}}function N(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length,i=t[0];o*=s;for(let l=0;l<n;++l)r[o]=i,o+=s}function S(e,t,f,o,r=1){const s=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===r)for(let i=0;i<f;++i)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n;else for(let i=0;i<f;++i)for(let t=0;t<r;++t)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n}function A(e,t,c,u,p,y){for(const B of t.fields.keys()){const t=e.vertexAttributes.get(B),A=e.indices.get(B);if(t&&A)switch(B){case l.POSITION:{i(3===t.size);const e=p.getField(B,n);i(!!e,`No buffer view for ${B}`),e&&g(A,t.data,c,e,y);break}case l.NORMAL:{i(3===t.size);const e=p.getField(B,n);i(!!e,`No buffer view for ${B}`),e&&b(A,t.data,u,e,y);break}case l.UV0:{i(2===t.size);const e=p.getField(B,s);i(!!e,`No buffer view for ${B}`),e&&d(A,t.data,e,y);break}case l.COLOR:case l.SYMBOLCOLOR:{const e=p.getField(B,r);i(!!e,`No buffer view for ${B}`),i(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||O(A,t.data,t.size,e,y);break}case l.COLORFEATUREATTRIBUTE:{const e=p.getField(B,o);i(!!e,`No buffer view for ${B}`),i(1===t.size),e&&1===t.size&&N(A,t.data,e,y);break}case l.TANGENT:{i(4===t.size);const e=p.getField(B,f);i(!!e,`No buffer view for ${B}`),e&&h(A,t.data,u,e,y);break}case l.PROFILERIGHT:case l.PROFILEUP:case l.PROFILEVERTEXANDNORMAL:case l.FEATUREVALUE:{i(4===t.size);const e=p.getField(B,f);i(!!e,`No buffer view for ${B}`),e&&a(A,t.data,e,y)}}else if(B===l.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(l.POSITION);if(i(!!t,`No buffer view for ${B}`),t){const f=t.length,o=p.getField(B,r);S(e.objectAndLayerIdColor,o,f,y)}}}}export{c as writeBufferFloat,y as writeBufferMat3f,B as writeBufferMat4f,d as writeBufferVec2,u as writeBufferVec3,a as writeBufferVec4,p as writeBufferVec4Zeros,O as writeColor,N as writeColorFeatureAttribute,A as writeDefaultAttributes,b as writeNormal,S as writeObjectAndLayerIdColor,g as writePosition,h as writeTangent};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/util/AlphaCutoff.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/ColorMaterial.glsl.js";
|
|
5
|
+
import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaCutoff.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/ColorMaterial.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{Z as e}from"../../../../chunks/vec4f64.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{
|
|
5
|
+
import{Z as e}from"../../../../chunks/vec4f64.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as s}from"../lib/DefaultVertexAttributeLocations.js";import{blendingDefault as o,oitBlending as n,oitDepthTest as a,getOITPolygonOffset as l}from"../lib/OrderIndependentTransparency.js";import{Program as c}from"../lib/Program.js";import{stencilWriteMaskOn as p,stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as m}from"../lib/StencilUtils.js";import{TransparencyPassType as h}from"../lib/TransparencyPassType.js";import{VisualVariablePassParameters as f}from"../materials/VisualVariablePassParameters.js";import{C as d}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as g,cullingParams as P,defaultDepthWriteParams as b,defaultColorWriteParams as j}from"../../../webgl/renderState.js";class y extends f{constructor(){super(...arguments),this.color=e}}class T extends i{initializeProgram(e){return new c(e.rctx,T.shader.get().build(this.configuration),s)}_createPipeline(e,t){const i=this.configuration,s=e===h.NONE,c=e===h.FrontFace;return g({blending:i.output!==r.Color&&i.output!==r.Alpha||!i.transparent?null:s?o:n(e),culling:P(i.cullFace),depthTest:{func:a(e)},depthWrite:(s||c)&&i.writeDepth?b:null,colorWrite:j,stencilWrite:i.hasOccludees?p:null,stencilTest:i.hasOccludees?t?u:m:null,polygonOffset:s||c?i.polygonOffset?S:null:l(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._createPipeline(this.configuration.transparencyPassType,!0),this._createPipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,r){return r?this._occludeePipelineState:super.getPipelineState(e,r)}}T.shader=new t(d,(()=>import("./ColorMaterial.glsl.js")));const S={factor:1,units:1};export{y as ColorMaterialPassParameters,T as ColorMaterialTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as r}from"../lib/basicInterfaces.js";import{TransparencyPassType as s}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as i}from"../materials/DefaultTechniqueConfiguration.js";class p extends i{constructor(){super(...arguments),this.output=t.Color,this.cullFace=r.None,this.transparencyPassType=s.NONE,this.hasSlicePlane=!1,this.hasVertexColors=!1,this.transparent=!1,this.polygonOffset=!1,this.enableOffset=!0,this.writeDepth=!0,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.objectAndLayerIdColorInstanced=!1}}o([e({count:t.COUNT})],p.prototype,"output",void 0),o([e({count:r.COUNT})],p.prototype,"cullFace",void 0),o([e({count:s.COUNT})],p.prototype,"transparencyPassType",void 0),o([e()],p.prototype,"hasSlicePlane",void 0),o([e()],p.prototype,"hasVertexColors",void 0),o([e()],p.prototype,"transparent",void 0),o([e()],p.prototype,"polygonOffset",void 0),o([e()],p.prototype,"enableOffset",void 0),o([e()],p.prototype,"writeDepth",void 0),o([e()],p.prototype,"hasOccludees",void 0),o([e()],p.prototype,"hasMultipassTerrain",void 0),o([e()],p.prototype,"cullAboveGround",void 0),o([e()],p.prototype,"objectAndLayerIdColorInstanced",void 0);export{p as ColorMaterialTechniqueConfiguration};
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as r}from"../lib/basicInterfaces.js";import{TransparencyPassType as s}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as i}from"../materials/DefaultTechniqueConfiguration.js";class p extends i{constructor(){super(...arguments),this.output=t.Color,this.cullFace=r.None,this.transparencyPassType=s.NONE,this.hasSlicePlane=!1,this.hasVertexColors=!1,this.transparent=!1,this.polygonOffset=!1,this.enableOffset=!0,this.writeDepth=!0,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.objectAndLayerIdColorInstanced=!1,this.vvColor=!1}}o([e({count:t.COUNT})],p.prototype,"output",void 0),o([e({count:r.COUNT})],p.prototype,"cullFace",void 0),o([e({count:s.COUNT})],p.prototype,"transparencyPassType",void 0),o([e()],p.prototype,"hasSlicePlane",void 0),o([e()],p.prototype,"hasVertexColors",void 0),o([e()],p.prototype,"transparent",void 0),o([e()],p.prototype,"polygonOffset",void 0),o([e()],p.prototype,"enableOffset",void 0),o([e()],p.prototype,"writeDepth",void 0),o([e()],p.prototype,"hasOccludees",void 0),o([e()],p.prototype,"hasMultipassTerrain",void 0),o([e()],p.prototype,"cullAboveGround",void 0),o([e()],p.prototype,"objectAndLayerIdColorInstanced",void 0),o([e()],p.prototype,"vvColor",void 0),o([e({constValue:!0})],p.prototype,"hasVvInstancing",void 0),o([e({constValue:!1})],p.prototype,"vvSize",void 0),o([e({constValue:!1})],p.prototype,"vvOpacity",void 0);export{p as ColorMaterialTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as e}from"./SketchTooltipInfo.js";let r=class extends e{constructor(o){super(o),this.type="transform-rotate",this.rotationType="geographic"}};o([t()],r.prototype,"type",void 0),o([t()],r.prototype,"rotation",void 0),o([t()],r.prototype,"rotationPrecision",void 0),o([t()],r.prototype,"orientation",void 0),o([t()],r.prototype,"orientationPrecision",void 0),o([t()],r.prototype,"rotationType",void 0),r=o([i("esri.views.interactive.tooltip.TransformRotateTooltipInfo")],r);let s=class extends e{constructor(o){super(o),this.type="transform-scale",this.sizeUnit=null,this.sizePrecision=null}};o([t()],s.prototype,"type",void 0),o([t()],s.prototype,"scale",void 0),o([t()],s.prototype,"size",void 0),o([t()],s.prototype,"sizeUnit",void 0),o([t()],s.prototype,"sizePrecision",void 0),s=o([i("esri.views.interactive.tooltip.TransformScaleTooltipInfo")],s);let p=class extends e{constructor(o){super(o),this.type="transform-absolute",this.orientationEnabled=!0,this.orientationPrecision=null,this.rotationType="geographic",this.
|
|
5
|
+
import{_ as o}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as e}from"./SketchTooltipInfo.js";let r=class extends e{constructor(o){super(o),this.type="transform-rotate",this.orientationEnabled=!0,this.rotationType="geographic"}};o([t()],r.prototype,"type",void 0),o([t()],r.prototype,"rotation",void 0),o([t()],r.prototype,"rotationPrecision",void 0),o([t()],r.prototype,"orientation",void 0),o([t()],r.prototype,"orientationEnabled",void 0),o([t()],r.prototype,"orientationPrecision",void 0),o([t()],r.prototype,"rotationType",void 0),r=o([i("esri.views.interactive.tooltip.TransformRotateTooltipInfo")],r);let s=class extends e{constructor(o){super(o),this.type="transform-scale",this.sizeEnabled=!0,this.sizeUnit=null,this.sizePrecision=null}};o([t()],s.prototype,"type",void 0),o([t()],s.prototype,"scale",void 0),o([t()],s.prototype,"size",void 0),o([t()],s.prototype,"sizeEnabled",void 0),o([t()],s.prototype,"sizeUnit",void 0),o([t()],s.prototype,"sizePrecision",void 0),s=o([i("esri.views.interactive.tooltip.TransformScaleTooltipInfo")],s);let p=class extends e{constructor(o){super(o),this.type="transform-absolute",this.orientationEnabled=!0,this.orientationPrecision=null,this.rotationType="geographic",this.sizeEnabled=!0,this.sizePrecision=null,this.sizeUnit=null}};o([t()],p.prototype,"type",void 0),o([t()],p.prototype,"orientation",void 0),o([t()],p.prototype,"orientationEnabled",void 0),o([t()],p.prototype,"orientationPrecision",void 0),o([t()],p.prototype,"rotationType",void 0),o([t()],p.prototype,"size",void 0),o([t()],p.prototype,"sizeEnabled",void 0),o([t()],p.prototype,"sizePrecision",void 0),o([t()],p.prototype,"sizeUnit",void 0),p=o([i("esri.views.interactive.tooltip.TransformAbsoluteTooltipInfo")],p);export{p as TransformAbsoluteTooltipInfo,r as TransformRotateTooltipInfo,s as TransformScaleTooltipInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{formatAngle as o,formatRelativeAngle as r}from"../../../../core/quantityFormatUtils.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as e}from"../css.js";import{TooltipContent as i}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{formatAngle as o,formatRelativeAngle as r}from"../../../../core/quantityFormatUtils.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as e}from"../css.js";import{TooltipContent as i}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as n}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as p}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as a}from"../../../../widgets/support/jsxFactory.js";const m={base:`${e} ${`${e}--transform-rotate`}`};let l=class extends i{render(){const{info:t}=this,{visibleElements:s}=t.tooltipOptions,e=this._messagesTooltip.sketch;return a(n,{className:m.base,helpMessage:this._getHelpMessage()},s.rotation&&a(p,{title:e.rotation,value:r(t.rotation,t.rotationType,t.rotationPrecision)}),s.orientation&&t.orientationEnabled&&a(p,{title:e.orientation,value:o(t.orientation,t.rotationType,t.orientationPrecision)}))}};l=t([s("esri.views.interactive.tooltip.content.TooltipContentTransformRotate")],l);export{l as TooltipContentTransformRotate};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as s}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as
|
|
5
|
+
import{_ as s}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as t}from"../css.js";import{TooltipContent as o}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const a={base:`${t} ${`${t}--transform-scale`}`};let l=class extends o{render(){const{info:s}=this,{visibleElements:e}=s.tooltipOptions,t=this._messagesTooltip.sketch;return p(r,{className:a.base,helpMessage:this._getHelpMessage()},e.scale&&p(i,{title:t.scale,value:this._formatPercentage(s.scale)}),e.size&&s.sizeEnabled&&p(i,{title:t.size,value:this._formatLength(s.size,s.sizeUnit,s.sizePrecision)}))}};l=s([e("esri.views.interactive.tooltip.content.TooltipContentTransformScale")],l);export{l as TooltipContentTransformScale};
|