@arcgis/core 4.28.0-next.20230720 → 4.28.0-next.20230721
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/Color.js +1 -1
- package/analysis/AreaMeasurementAnalysis.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/Top.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/arcade/functions/convertdirection.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/lib/comment-handler.js +1 -1
- package/arcade/lib/parser.js +1 -1
- package/arcade/lib/scanner.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{75c28da8d0b02d612d69.js → 040b3fc9c9c0736dd893.js} +1 -1
- package/assets/esri/core/workers/chunks/0652f6a8d5221e978033.js +1 -0
- package/assets/esri/core/workers/chunks/{c13b332afdb3f6be1ec9.js → 092fda62b6f62c2e4869.js} +1 -1
- package/assets/esri/core/workers/chunks/{57e0ad037188bd2997e7.js → 0af18a96cbd4e2d35436.js} +1 -1
- package/assets/esri/core/workers/chunks/0b5eeec0f66c87a46a0c.js +1 -0
- package/assets/esri/core/workers/chunks/{68e568b67b6fb34393db.js → 0cad2b991d0d0fd07846.js} +1 -1
- package/assets/esri/core/workers/chunks/0dccbc6c2559fdc0c2ad.js +1 -0
- package/assets/esri/core/workers/chunks/256a82f6f6e1405fbcc6.js +1 -0
- package/assets/esri/core/workers/chunks/{bb9213899049e1db90da.js → 2c57c9bd71637c5bed8a.js} +1 -1
- package/assets/esri/core/workers/chunks/2cdbabcbfe32286ec78d.js +1 -0
- package/assets/esri/core/workers/chunks/{2b1c83453a862e01954b.js → 2d9d80b2d0042a9c09fb.js} +1 -1
- package/assets/esri/core/workers/chunks/2f9aec2238ff6cb99e09.js +1 -0
- package/assets/esri/core/workers/chunks/{7dbd3e6406fb3e3a1a8f.js → 3cf748c025f3936c1cb2.js} +1 -1
- package/assets/esri/core/workers/chunks/4481d1103363434f16da.js +1 -0
- package/assets/esri/core/workers/chunks/5ae325e6a795c72eac6c.js +1 -0
- package/assets/esri/core/workers/chunks/5e4dde2886a1027b4b96.js +1 -0
- package/assets/esri/core/workers/chunks/730eb7e5f617fdab4f10.js +1 -0
- package/assets/esri/core/workers/chunks/{5a2e6bed9431cf4f42b1.js → 740dc67038f554431f1b.js} +1 -1
- package/assets/esri/core/workers/chunks/{09178454bda15bb7929a.js → 7fbdfd1527582c52f9b6.js} +1 -1
- package/assets/esri/core/workers/chunks/{1c026947505a9ff94a53.js → 807742f38885fa90b4fe.js} +1 -1
- package/assets/esri/core/workers/chunks/82dfbc175b52c7a10475.js +1 -0
- package/assets/esri/core/workers/chunks/870a05451e074b58f19a.js +1 -0
- package/assets/esri/core/workers/chunks/8c5a8c1dfb086069bb06.js +1 -0
- package/assets/esri/core/workers/chunks/99a5a434e0bad48c7a5c.js +1 -0
- package/assets/esri/core/workers/chunks/9a5916c66dad91d01d5b.js +1 -0
- package/assets/esri/core/workers/chunks/9c133fd8c1fbd0295b86.js +1 -0
- package/assets/esri/core/workers/chunks/9cddb504079d396779ea.js +1 -0
- package/assets/esri/core/workers/chunks/a3a1d4f32e518e97d071.js +1 -0
- package/assets/esri/core/workers/chunks/{9548aa449fe3a300c015.js → a4fa40dc77e116c954ac.js} +1 -1
- package/assets/esri/core/workers/chunks/a54ec9929a7db879d5db.js +1 -0
- package/assets/esri/core/workers/chunks/afc5b84693757fda2bc8.js +1 -0
- package/assets/esri/core/workers/chunks/{591b5c277cfd3a4101a4.js → b08f2a4aa94087c6c367.js} +1 -1
- package/assets/esri/core/workers/chunks/c0e12f6a7bb2360e4c21.js +1 -0
- package/assets/esri/core/workers/chunks/c8e656cd470a17f538e9.js +1 -0
- package/assets/esri/core/workers/chunks/d0e203405f95e14b1399.js +1 -0
- package/assets/esri/core/workers/chunks/{ec72f492f24e67e008ae.js → d8e58dc14d3495f0830c.js} +1 -1
- package/assets/esri/core/workers/chunks/ddc393a012588f799f42.js +1 -0
- package/assets/esri/core/workers/chunks/de3baa85b1639c25458d.js +1 -0
- package/assets/esri/core/workers/chunks/e66cea26064ba8353af0.js +1 -0
- package/assets/esri/core/workers/chunks/ea478f2f4a19463e13fd.js +1 -0
- package/assets/esri/core/workers/chunks/eba197e45507f56f3ed0.js +1 -0
- package/assets/esri/core/workers/chunks/ebd006fcd568a7731115.js +1 -0
- package/assets/esri/core/workers/chunks/ef9a9a7d66d818720e20.js +1 -0
- package/assets/esri/core/workers/chunks/f3b458f55236566c940b.js +1 -0
- package/assets/esri/core/workers/chunks/fd0a91b9e0216cc269c3.js +1 -0
- package/assets/esri/core/workers/chunks/{a4fe220a912b1f428e49.js → fdd6403a8390d629392b.js} +1 -1
- package/assets/esri/themes/base/widgets/_Directions.scss +13 -7
- 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/chunks/array.js +1 -1
- package/core/Collection.js +1 -1
- package/core/accessorSupport/decorators/subclass.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/tracking.js +1 -1
- package/core/accessorSupport/utils.js +1 -1
- package/core/libs/rbush/PooledRBush.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/GeometryCursor.js +1 -1
- package/geometry/support/TileClipper.js +1 -1
- package/geometry/support/geodesicUtils.js +1 -1
- package/interfaces.d.ts +7 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/effects/EffectView.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/mixins/ArcGISCachedService.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/MultidimensionalSubset.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/TileInfoTilemapCache.js +1 -1
- package/layers/support/TilemapCache.js +1 -1
- package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
- package/layers/support/rasterDatasets/pamParser.js +1 -1
- package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
- package/layers/support/rasterFormats/Raw.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
- package/layers/support/rasterFunctions/colormaps.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/voxel/VoxelDimension.js +1 -1
- package/layers/voxel/VoxelTransferFunctionStyle.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
- package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
- package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
- package/rest/support/generateRendererUtils.js +1 -1
- package/smartMapping/raster/renderers/classBreaks.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/smartMapping/renderers/type.js +1 -1
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/GeometryWalker.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/views/2d/constraints/ZoomConstraint.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/flow/utils.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
- package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
- package/views/2d/engine/vectorTiles/tileInfoUtils.js +1 -1
- package/views/2d/engine/webgl/TurboLine.js +1 -1
- package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
- package/views/2d/layers/BaseLayerView2D.js +1 -1
- package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
- package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/views/2d/layers/features/support/rendererUtils.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/support/vectorTileDebugUtils.js +5 -0
- package/views/2d/tiling/TileInfoView.js +1 -1
- package/views/2d/tiling/TileInfoViewPOT.js +1 -1
- package/views/2d/tiling/TileQueue.js +1 -1
- package/views/2d/tiling.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/terrain/Overlay.js +1 -1
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayRenderTarget.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/TilingScheme.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/interfaces.js +1 -1
- package/views/3d/webgl-engine/effects/ScreenSpaceGeometry.js +1 -1
- package/views/3d/webgl-engine/effects/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/requireUtils.js +1 -1
- package/views/MapView.js +1 -1
- package/views/animation/pointToPoint/Path.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
- package/views/layers/GroupLayerView.js +1 -1
- package/views/webgl/ProgramCache.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/webscene/spec-certification/utils.js +1 -1
- package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhase.js +1 -1
- package/widgets/BuildingExplorer/support/validation.js +1 -1
- package/widgets/Directions/support/resources.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/Histogram/HistogramViewModel.js +1 -1
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
- package/widgets/Legend/styles/Card.js +1 -1
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/colorRampUtils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0210f4c2e1f3ed13041b.js +0 -1
- package/assets/esri/core/workers/chunks/07bb40162d97d098bc19.js +0 -1
- package/assets/esri/core/workers/chunks/0a18317566c1fcb68422.js +0 -1
- package/assets/esri/core/workers/chunks/0de65e03db8c611af9fb.js +0 -1
- package/assets/esri/core/workers/chunks/1a60d23a92bcf91dbb22.js +0 -1
- package/assets/esri/core/workers/chunks/205a0b34b698d5329854.js +0 -1
- package/assets/esri/core/workers/chunks/25211d5904ee9d5f4a9d.js +0 -1
- package/assets/esri/core/workers/chunks/26b12d1ea713c1e07701.js +0 -1
- package/assets/esri/core/workers/chunks/2bfa7ee324c32a56b0d3.js +0 -1
- package/assets/esri/core/workers/chunks/4510a17839405146130b.js +0 -1
- package/assets/esri/core/workers/chunks/524156c3f5383c2dd0e3.js +0 -1
- package/assets/esri/core/workers/chunks/59666ecb7c2c1f5a13b2.js +0 -1
- package/assets/esri/core/workers/chunks/5c005c9514354c77ec27.js +0 -1
- package/assets/esri/core/workers/chunks/620ec5c75561183d3d73.js +0 -1
- package/assets/esri/core/workers/chunks/68512670816f59c0e6a5.js +0 -1
- package/assets/esri/core/workers/chunks/6c7374ebc18b46b3480a.js +0 -1
- package/assets/esri/core/workers/chunks/75ba2af92da232067adb.js +0 -1
- package/assets/esri/core/workers/chunks/7c1f0598a016516dcec3.js +0 -1
- package/assets/esri/core/workers/chunks/8dcec8d1b670d2b7ea2b.js +0 -1
- package/assets/esri/core/workers/chunks/8e07dfb6fc2673b640cb.js +0 -1
- package/assets/esri/core/workers/chunks/9050b167355588b7003d.js +0 -1
- package/assets/esri/core/workers/chunks/9230d68799f0b0b9ef36.js +0 -1
- package/assets/esri/core/workers/chunks/af4083f2aad5f5d49dde.js +0 -1
- package/assets/esri/core/workers/chunks/b0a57718a0765d1c8df0.js +0 -1
- package/assets/esri/core/workers/chunks/b431b81a7bf45dd527da.js +0 -1
- package/assets/esri/core/workers/chunks/bda311ad48efdb265939.js +0 -1
- package/assets/esri/core/workers/chunks/d5cce09fbe16cbb8fee4.js +0 -1
- package/assets/esri/core/workers/chunks/da547c3cabe4a89c3ce6.js +0 -1
- package/assets/esri/core/workers/chunks/dd295fa57b45b7ec4ec5.js +0 -1
- package/assets/esri/core/workers/chunks/f553b464e969d45bf451.js +0 -1
- package/assets/esri/core/workers/chunks/f5865294983eb160de8c.js +0 -1
- package/assets/esri/core/workers/chunks/fdb7b1fbdb6fe091ad83.js +0 -1
- package/views/2d/tiling/PagedTileQueue.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../Color.js";import"../../../../geometry.js";import e from"../../../../analysis/SlicePlane.js";import"../../../../core/has.js";import n from"../../../../core/Logger.js";import{rad2deg as o,deg2rad as i}from"../../../../core/mathUtils.js";import{castRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{o as s,b as a,k as c,m as l,r as u,i as d,w as m,F as p}from"../../../../chunks/mat4.js";import{c as f}from"../../../../chunks/mat4f64.js";import{r as g}from"../../../../chunks/quat.js";import{g as b,c as T,e as h,f as w,n as A,a as O,l as R,b as I,s as E,p as j,A as C}from"../../../../chunks/vec3.js";import{a as L,c as U,f as v}from"../../../../chunks/vec3f64.js";import{tryProjectWithZConversion as _}from"../../../../geometry/projection.js";import{Axis as M}from"../../../../geometry/support/Axis.js";import{r as P,f as N,i as V,a as y,n as S,u as G}from"../../../../chunks/boundedPlane.js";import{fromVectorsAndPoint as k,fromPositionAndNormal as D}from"../../../../geometry/support/plane.js";import{create as H}from"../../../../geometry/support/ray.js";import{angleAroundAxis as B}from"../../../../geometry/support/vector.js";import{sv3d as x,sm4d as F,sq4d as X}from"../../../../geometry/support/vectorStacks.js";import{CalloutStyle as Y,PlaneStyle as Z}from"./settings.js";import{VERTICAL_DOT_THRESHOLD as W,SMALL_ANGLE_DOT_THRESHOLD as q,PLANE_MIN_BASIS_SCREEN_LEN2 as z,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as $,SHIFT_RESTART_OFFSET_DISTANCE as J,RESIZE_HANDLE_EDGE_PADDING_FRAC as K,SHIFT_RESTART_TIP_RADIUS as Q,PLANE_OUTLINE_WIDTH as tt,RESIZE_HANDLE_CORNER_INPUT_RADIUS as et,RESIZE_HANDLE_EDGE_INPUT_RADIUS as nt,SHIFT_RESTART_TIP_LENGTH as ot,SHIFT_RESTART_ARROW_LENGTH as it,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as rt,RESIZE_HANDLE_CORNER_WIDTH as st,RESIZE_HANDLE_EDGE_WIDTH as at,DISPLAY_FOCUS_MULTIPLIER as ct,SHIFT_RESTART_TUBE_RADIUS as lt,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as ut,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as dt}from"./sliceToolConfig.js";import{applyProjectionAndElevationAlignment as mt}from"../support/projectionUtils.js";import{Manipulator3D as pt}from"../../interactive/Manipulator3D.js";import{calculateTranslateRotateFromBases as ft,createRotateManipulator as gt,worldScaledManipulatorSettings as bt}from"../../interactive/manipulatorUtils.js";import{RenderObject as Tt}from"../../interactive/RenderObject.js";import{LineVisualElement as ht}from"../../interactive/visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as wt}from"../../interactive/visualElements/SlicePlaneVisualElement.js";import{RenderCoordsHelper as At}from"../../support/RenderCoordsHelper.js";import{fromRender as Ot}from"../../support/geometryUtils/ray.js";import{CullFaceOptions as Rt}from"../../webgl-engine/lib/basicInterfaces.js";import{createPolylineGeometry as It,createConeGeometry as Et,createPathExtrusionGeometry as jt}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as Ct}from"../../webgl-engine/lib/Material.js";import{ColorMaterial as Lt}from"../../webgl-engine/materials/ColorMaterial.js";import{NativeLineMaterial as Ut}from"../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as vt}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateCustomFlags as _t,ManipulatorStateFlags as Mt}from"../../../interactive/interfaces.js";import Pt from"../../../../geometry/Extent.js";function Nt(t,e,n,o,i,r,s,a){return Vt(e,s.worldUpAtPosition(t,x.get()),i,r,a.basis1,a.basis2),b(a.basis1,a.basis1,n),b(a.basis2,a.basis2,o),T(a.origin,t),k(a.basis2,a.basis1,a.origin,a.plane),a}function Vt(t,e,n,o,i,r){const s=h(t,e),a=x.get(),c=x.get();switch(o===ge.HORIZONTAL_OR_VERTICAL?Math.abs(s)>W?ge.HORIZONTAL:ge.VERTICAL:o){case ge.VERTICAL:{const o=Math.abs(s)<=q?t:n.viewUp;w(a,o,e),T(c,e);break}case ge.HORIZONTAL:w(a,n.viewUp,e),w(c,e,a);break;case ge.TILTED:{const o=Math.abs(s)<=q?e:n.viewUp;w(a,o,t),w(c,t,a);break}}const l=w(x.get(),a,c);h(l,n.viewForward)>0&&b(c,c,-1),A(i,a),A(r,c)}function yt(t,e,n){const o=e.worldUpAtPosition(t.origin,x.get()),i=t.basis1,r=ce(t,o),s=Math.round(r/he)*he;return P(t,s-r,i,n)}function St(t,e,n,o,i,r){const s=T(x.get(),i.origin);O(s,s,b(x.get(),i.basis1,t.direction[0]<0?1:-1)),O(s,s,b(x.get(),i.basis2,t.direction[1]<0?1:-1));const a=R(i.basis1),c=R(i.basis2),l=I(x.get(),n,s),u=I(x.get(),e,s);let d=0,m=0;if(Jt(t)){const e=$t(i),n=$t(r);d=a-.5*t.direction[0]*h(i.basis1,u)/a,m=c-.5*t.direction[1]*h(i.basis2,u)/c;const o=n/e;d*=o,m*=o}const p=d+.5*t.direction[0]*h(i.basis1,l)/a,f=m+.5*t.direction[1]*h(i.basis2,l)/c,g=b(x.get(),i.basis1,p/a),w=b(x.get(),i.basis2,f/c);(p<=0||qt(r.origin,g,o)<=z)&&T(g,r.basis1),(f<=0||qt(r.origin,w,o)<=z)&&T(w,r.basis2);const A=T(x.get(),s);return O(A,A,b(x.get(),g,t.direction[0]<0?-1:1)),O(A,A,b(x.get(),w,t.direction[1]<0?-1:1)),N(A,g,w,r)}function Gt(t,e){return $*Math.min(e.width,e.height)*e.computeRenderPixelSizeAt(t)}function kt(t,e,n,o){const i=w(x.get(),e,n);return w(i,i,e),D(t,i,o)}function Dt(t,e){return ft(t.basis1,t.basis2,t.origin,e)}function Ht(t,e,n,o){const i=e.worldUpAtPosition(t.origin,x.get()),r=x.get();switch(n){case fe.HEADING:T(r,i);break;case fe.TILT:T(r,t.basis1)}return D(t.origin,r,o)}function Bt(t,e,n,o){const i=Wt(n,Zt.NEGATIVE_X),a=F.get();s(a,e,i.edge*Math.PI/2);const c=A(x.get(),i.basis);let l=b(x.get(),c,i.direction*o.computeScreenPixelSizeAt(i.position)*J);O(l,l,i.position);const u=o.projectToRenderScreen(l,r(x.get())),d=xt(o,u);Ot(o,u,Te),A(Te.direction,Te.direction);const m=x.get();!d&&V(n,Te,m)&&(l=m),a[12]=0,a[13]=0,a[14]=0,t.modelTransform=a,t.renderLocation=L(l),d?t.state|=be:t.state&=~be}function xt(t,e){const[n,o,i,r]=t.viewport,s=Math.min(i,r)/16;let a=!0;return e[0]<n+s?(e[0]=n+s,a=!1):e[0]>n+i-s&&(e[0]=n+i-s,a=!1),e[1]<o+s?(e[1]=o+s,a=!1):e[1]>o+r-s&&(e[1]=o+r-s,a=!1),a}function Ft(t,e,n,o){const i=R(o.basis1),r=R(o.basis2),s=zt(o),u=$t(o),d=E(x.get(),0,0,0);O(d,b(x.get(),o.basis1,e.direction[0]),b(x.get(),o.basis2,e.direction[1])),O(d,o.origin,d);let m=0,p=1;if(Jt(e))1===e.direction[0]&&-1===e.direction[1]?m=he:1===e.direction[0]&&1===e.direction[1]?m=Math.PI:-1===e.direction[0]&&1===e.direction[1]&&(m=3*Math.PI/2),p=u;else{const t=0!==e.direction[0]?1:2;m=1===t?he:0,p=(1===t?r:i)-s}const f=a(F.get(),m);c(f,f,E(x.get(),p,p,p)),l(f,n,f),f[12]=0,f[13]=0,f[14]=0,t.modelTransform=f,t.renderLocation=d}function Xt(t,e,n,o){const i=o.worldUpAtPosition(n.origin,x.get()),r=Wt(n,Zt.POSITIVE_X),s=a(F.get(),r.edge*Math.PI/2);u(s,s,-ce(n,i)),l(s,e,s),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=r.position}function Yt(t,e,n){const o=Wt(n,Zt.POSITIVE_Y),i=a(F.get(),o.edge*Math.PI/2);u(i,i,he),l(i,e,i),i[12]=0,i[13]=0,i[14]=0,t.modelTransform=i,t.renderLocation=o.position}var Zt;function Wt(t,e){switch(e){case Zt.POSITIVE_X:return{basis:t.basis1,direction:1,position:O(x.get(),t.origin,t.basis1),edge:e};case Zt.POSITIVE_Y:return{basis:t.basis2,direction:1,position:O(x.get(),t.origin,t.basis2),edge:e};case Zt.NEGATIVE_X:return{basis:t.basis1,direction:-1,position:I(x.get(),t.origin,t.basis1),edge:e};case Zt.NEGATIVE_Y:return{basis:t.basis2,direction:-1,position:I(x.get(),t.origin,t.basis2),edge:e}}}function qt(t,e,n){const o=n.projectToRenderScreen(O(x.get(),t,e),r(x.get())),i=n.projectToRenderScreen(I(x.get(),t,e),r(x.get()));return j(I(o,o,i))}function zt(t){const e=R(t.basis1),n=R(t.basis2);return K*Math.min(e,n)}function $t(t){return zt(t)}function Jt(t){return 0!==t.direction[0]&&0!==t.direction[1]}function Kt(e,n){const o=n.offsetMode===Oe.CENTER_ON_CALLOUT?J:0,i=[v(o,0,-it/2),v(o,0,it/2)],r=re(i,!0),s=(t,e)=>oe(i,t,e,n),a=s(0,!1),c=s(rt,!0),l=new Ut({color:t.toUnitRGBA(n.calloutColor),renderOccluded:Ct.OccludeAndTransparent,isDecoration:!0}),u=It(l,[[o,0,0],[o-J,0,0]]),d=It(l,[[o,0,0],[o-J,0,0]]);return new pt({view:e,renderObjects:[...a.normal.map((t=>new Tt(t,Mt.Unfocused|pe))),...c.normal.map((t=>new Tt(t,Mt.Unfocused|pe))),new Tt(u,Mt.Unfocused|pe|be),...a.focused.map((t=>new Tt(t,Mt.Focused|pe))),...c.focused.map((t=>new Tt(t,Mt.Focused|pe))),new Tt(d,Mt.Focused|pe|be)],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[r]},collisionPriority:1,radius:Q,state:pe})}function Qt(e,n){const o=new Y(e.effectiveTheme),i=gt(e,{calloutColor:t.toUnitRGBA(o.color),customStateMask:pe,texture:n});return i.state=pe,i}function te(e){const n=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]],o=new Z(e.effectiveTheme);return new ht({view:e,attached:!1,color:t.toUnitRGBA(o.outlineColor),width:tt,renderOccluded:Ct.OccludeAndTransparent,geometry:[n],isDecoration:!0})}function ee(e){const n=new Z(e.effectiveTheme);return new wt({view:e,attached:!1,backgroundColor:t.toUnitRGBA(n.color),gridColor:t.toUnitRGBA(n.gridColor),gridWidth:4,renderOccluded:Ct.OccludeAndTransparent,isDecoration:!0})}function ne(e,n,o){const i=Jt(n),r=i?[v(1,0,0),v(0,0,0),v(0,1,0)]:[v(1,0,0),v(-1,0,0)],s=t.toUnitRGBA(o.color),a=t=>new vt({color:s,width:t,renderOccluded:Ct.OccludeAndTransparent,isDecoration:!0}),c=()=>new Ut({color:s,renderOccluded:Ct.OccludeAndTransparent,isDecoration:!0}),l=i?st:at,u=l*ct,d=at,m=t=>t>1?a(t):c(),p=[new Tt(It(m(l),r),Mt.Unfocused|we),new Tt(It(m(u),r),Mt.Focused|we),new Tt(It(m(d),r),Ae)],f=new pt({view:e,renderObjects:p,collisionType:{type:"line",paths:[r]},radius:i?et:nt,...bt});return f.state=we,f}function oe(e,n,o,i){const r=t.blendColors(i.color,i.outlineColor,.4),s=t.blendColors(i.color,i.outlineColor,.14),a=new Lt({color:t.toUnitRGBA(i.color),cullFace:Rt.Back,renderOccluded:Ct.Opaque,isDecoration:!0}),u=new Lt({color:t.toUnitRGBA(r),cullFace:Rt.Back,renderOccluded:Ct.Opaque,isDecoration:!0}),T=new Lt({color:t.toUnitRGBA(s),cullFace:Rt.Back,renderOccluded:Ct.Opaque,isDecoration:!0}),h=new Lt({color:t.toUnitRGBA(i.outlineColor),transparent:!0,writeDepth:!1,cullFace:Rt.Front,renderOccluded:Ct.Transparent,isDecoration:!0}),w=t=>{const i=e.slice(0),r=I(x.get(),i[0],i[1]);A(r,r);const s=I(x.get(),i.at(-1),i.at(-2));if(A(s,s),n>0){const t=b(U(),s,-n);i[i.length-1]=O(t,t,i.at(-1));const e=b(U(),r,-n);i[0]=O(e,e,i[0])}const w=t?dt:1,R=ot*w,j=Q*w,C=d(F.get());if(n>0){const t=R/4,e=E(x.get(),0,t,0),o=1+n/t;m(C,C,e),c(C,C,E(x.get(),o,o,o)),m(C,C,b(e,e,-1/o))}const L=d(f()),_=v(0,1,0),M=p(f(),g(X.get(),_,s));M[12]=i.at(-1)[0],M[13]=i.at(-1)[1],M[14]=i.at(-1)[2],l(M,M,C);const P=ie(lt*(t?ut:1)+n,i,o?h:T);P.transformation=L;const N=[P],V=Et(o?h:a,R,j,24,!1,!1,!0);V.transformation=M,N.push(V);const y=Et(o?h:u,R,j,24,!1,!0,!1);y.transformation=M,N.push(y);const S=p(f(),g(X.get(),_,r));return S[12]=i[0][0],S[13]=i[0][1],S[14]=i[0][2],l(S,S,C),N.push(V.instantiate({transformation:S})),N.push(y.instantiate({transformation:S})),N};return{normal:w(!1),focused:w(!0)}}function ie(t,e,n){const o=[],i=12;for(let r=0;r<i;r++){const e=r/i*2*Math.PI;o.push([Math.cos(e)*t,Math.sin(e)*t])}return jt(n,o,e,[],[],!1)}function re(t,e){const n=I(U(),t.at(-1),t.at(-2));if(A(n,n),b(n,n,ot),O(n,n,t.at(-1)),e){const e=I(U(),t[0],t[1]);return A(e,e),b(e,e,ot),O(e,e,t[0]),[e,...t,n]}return[...t,n]}function se(t,n,i,r=new e){if(null==t)return null;const{renderCoordsHelper:s}=n,a=s.fromRenderCoords(t.origin,n.spatialReference);if(null==a)return null;const c=_(a,i);if(null==c)return null;r.position=c;const l=2*R(t.basis1),u=2*R(t.basis2),d=At.renderUnitScaleFactor(n.spatialReference,i);r.width=l*d,r.height=u*d;const m=s.worldUpAtPosition(t.origin,x.get());return r.tilt=o(ce(t,m)),r.heading=s.headingAtPosition(t.origin,t.basis1)-90,r}function ae(t,e,n){if(null==t)return null;const o=t.origin,i=x.get(),r=x.get(),s=x.get(),a=x.get();let c,l,u,d,m,p;O(i,o,t.basis1),O(i,i,t.basis2),O(r,o,t.basis1),C(r,r,t.basis2),C(s,o,t.basis1),C(s,s,t.basis2),C(a,o,t.basis1),O(a,a,t.basis2);for(const f of[i,r,s,a]){const t=e.fromRenderCoords(f,f,n);if(null==t)return null;c=null==c?t[0]:Math.min(c,t[0]),l=null==l?t[0]:Math.max(l,t[0]),u=null==u?t[1]:Math.min(u,t[1]),d=null==d?t[1]:Math.max(d,t[1]),m=null==m?t[2]:Math.min(m,t[2]),p=null==p?t[2]:Math.max(p,t[2])}return new Pt({xmin:c,xmax:l,ymin:u,ymax:d,zmin:m,zmax:p,spatialReference:n})}function ce(t,e){return B(e,t.basis2,t.basis1)+he}function le(t,e,o,r,s,a,c=y()){return a.toRenderCoords(t,c.origin)?(a.worldBasisAtPosition(c.origin,M.X,c.basis1),a.worldBasisAtPosition(c.origin,M.Y,c.basis2),k(c.basis2,c.basis1,c.origin,c.plane),P(c,-i(e),S(c),c),P(c,i(o),c.basis1,c),b(c.basis1,c.basis1,r/2),b(c.basis2,c.basis2,s/2),G(c),c):(n.getLogger("esri.views.3d.analysis.Slice.sliceToolUtils").error(`Failed to project slice plane position, projection from ${t.spatialReference.wkid} is not supported`),null)}function ue(t,e){if(null==t||null==t.position)return null;const n=mt(t.position,e.spatialReference,e.elevationProvider);if(null==n)return null;const o=At.renderUnitScaleFactor(t.position.spatialReference,e.spatialReference),i=t.width*o,r=t.height*o;return{position:n,heading:t.heading,tilt:t.tilt,renderWidth:i,renderHeight:r}}function de(t,e,n,o=y()){const i=ue(t,e);return null==i?null:me(i,e,n,o)}function me(t,e,n,o=y()){if(null==t)return null;const i=le(t.position,t.heading,t.tilt,t.renderWidth,t.renderHeight,e.renderCoordsHelper,o);return n.tiltEnabled||null==i||yt(i,e.renderCoordsHelper,i),i}!function(t){t[t.POSITIVE_X=0]="POSITIVE_X",t[t.POSITIVE_Y=1]="POSITIVE_Y",t[t.NEGATIVE_X=2]="NEGATIVE_X",t[t.NEGATIVE_Y=3]="NEGATIVE_Y"}(Zt||(Zt={}));const pe=_t.Custom1;var fe,ge;!function(t){t[t.HEADING=1]="HEADING",t[t.TILT=2]="TILT"}(fe||(fe={})),function(t){t[t.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",t[t.HORIZONTAL=1]="HORIZONTAL",t[t.VERTICAL=2]="VERTICAL",t[t.TILTED=3]="TILTED"}(ge||(ge={}));const be=_t.Custom2,Te=H(),he=Math.PI/2,we=_t.Custom1,Ae=_t.Custom2;var Oe;function Re(t){return null!=("building-scene-3d"===t.type?t:null)}!function(t){t[t.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",t[t.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(Oe||(Oe={}));export{pe as DidPointerMoveRecentlyFlag,be as IsShiftEdgeOnScreenFlag,Oe as OffsetMode,fe as RotationAxis,ge as SliceOrientation,re as addArrowTips,Dt as calculateBoundedPlaneTranslateRotate,$t as calculateDiagonalResizeHandleScale,Gt as calculatePlaneHalfSize,zt as calculateResizeHandlePadding,qt as calculateScreenSpaceBasisLength2,ee as createGridVisualElement,te as createOutlineVisualElement,Nt as createPlane,ne as createResizeManipulator,Qt as createRotateManipulator,Ht as createRotatePlane,Kt as createShiftManipulator,kt as createShiftPlane,yt as forceHorizontalOrVertical,Jt as isDiagonalResizeHandle,Re as isIBuildingSceneLayerView3D,Vt as normalToBases,ae as planeToExtent,se as planeToShape,ue as projectAndElevationAlignShape,me as projectedShapeToPlane,we as resizeNormal,Ae as resizeOutlineOnly,St as resizePlane,de as shapeToPlane,Ft as updateResizeHandle,Xt as updateRotateHeadingHandle,Yt as updateRotateTiltHandle,Bt as updateShiftRestartHandle};
|
|
5
|
+
import e from"../../../../Color.js";import"../../../../geometry.js";import t from"../../../../analysis/SlicePlane.js";import"../../../../core/has.js";import n from"../../../../core/Logger.js";import{rad2deg as o,deg2rad as i}from"../../../../core/mathUtils.js";import{castRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{o as s,b as a,k as c,m as l,r as u,i as d,w as m,F as g}from"../../../../chunks/mat4.js";import{c as p}from"../../../../chunks/mat4f64.js";import{r as f}from"../../../../chunks/quat.js";import{g as b,c as h,e as T,f as w,n as A,a as O,l as R,b as I,s as E,p as j,A as C}from"../../../../chunks/vec3.js";import{a as L,c as U,f as v}from"../../../../chunks/vec3f64.js";import{tryProjectWithZConversion as _}from"../../../../geometry/projection.js";import{Axis as M}from"../../../../geometry/support/Axis.js";import{r as P,f as N,i as V,a as y,n as S,u as G}from"../../../../chunks/boundedPlane.js";import{fromVectorsAndPoint as k,fromPositionAndNormal as D}from"../../../../geometry/support/plane.js";import{create as H}from"../../../../geometry/support/ray.js";import{angleAroundAxis as B}from"../../../../geometry/support/vector.js";import{sv3d as x,sm4d as F,sq4d as X}from"../../../../geometry/support/vectorStacks.js";import{CalloutStyle as Y,PlaneStyle as Z}from"./settings.js";import{VERTICAL_DOT_THRESHOLD as W,SMALL_ANGLE_DOT_THRESHOLD as q,PLANE_MIN_BASIS_SCREEN_LEN2 as z,INITIAL_PLANE_HALF_SIZE_VIEW_PROPORTION as $,SHIFT_RESTART_OFFSET_DISTANCE as J,RESIZE_HANDLE_EDGE_PADDING_FRAC as K,SHIFT_RESTART_TIP_RADIUS as Q,PLANE_OUTLINE_WIDTH as ee,RESIZE_HANDLE_CORNER_INPUT_RADIUS as te,RESIZE_HANDLE_EDGE_INPUT_RADIUS as ne,SHIFT_RESTART_TIP_LENGTH as oe,SHIFT_RESTART_ARROW_LENGTH as ie,SHIFT_RESTART_ARROW_OUTLINE_WIDTH as re,RESIZE_HANDLE_CORNER_WIDTH as se,RESIZE_HANDLE_EDGE_WIDTH as ae,DISPLAY_FOCUS_MULTIPLIER as ce,SHIFT_RESTART_TUBE_RADIUS as le,SHIFT_RESTART_TUBE_FOCUS_MULTIPLIER as ue,SHIFT_RESTART_TIP_FOCUS_MULTIPLIER as de}from"./sliceToolConfig.js";import{applyProjectionAndElevationAlignment as me}from"../support/projectionUtils.js";import{Manipulator3D as ge}from"../../interactive/Manipulator3D.js";import{calculateTranslateRotateFromBases as pe,createRotateManipulator as fe,worldScaledManipulatorSettings as be}from"../../interactive/manipulatorUtils.js";import{RenderObject as he}from"../../interactive/RenderObject.js";import{LineVisualElement as Te}from"../../interactive/visualElements/LineVisualElement.js";import{SlicePlaneVisualElement as we}from"../../interactive/visualElements/SlicePlaneVisualElement.js";import{RenderCoordsHelper as Ae}from"../../support/RenderCoordsHelper.js";import{fromRender as Oe}from"../../support/geometryUtils/ray.js";import{CullFaceOptions as Re}from"../../webgl-engine/lib/basicInterfaces.js";import{createPolylineGeometry as Ie,createConeGeometry as Ee,createPathExtrusionGeometry as je}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as Ce}from"../../webgl-engine/lib/Material.js";import{ColorMaterial as Le}from"../../webgl-engine/materials/ColorMaterial.js";import{NativeLineMaterial as Ue}from"../../webgl-engine/materials/NativeLineMaterial.js";import{RibbonLineMaterial as ve}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{ManipulatorStateCustomFlags as _e,ManipulatorStateFlags as Me}from"../../../interactive/interfaces.js";import Pe from"../../../../geometry/Extent.js";function Ne(e,t,n,o,i,r,s,a){return Ve(t,s.worldUpAtPosition(e,x.get()),i,r,a.basis1,a.basis2),b(a.basis1,a.basis1,n),b(a.basis2,a.basis2,o),h(a.origin,e),k(a.basis2,a.basis1,a.origin,a.plane),a}function Ve(e,t,n,o,i,r){const s=T(e,t),a=x.get(),c=x.get();switch(o===ft.HORIZONTAL_OR_VERTICAL?Math.abs(s)>W?ft.HORIZONTAL:ft.VERTICAL:o){case ft.VERTICAL:{const o=Math.abs(s)<=q?e:n.viewUp;w(a,o,t),h(c,t);break}case ft.HORIZONTAL:w(a,n.viewUp,t),w(c,t,a);break;case ft.TILTED:{const o=Math.abs(s)<=q?t:n.viewUp;w(a,o,e),w(c,e,a);break}}const l=w(x.get(),a,c);T(l,n.viewForward)>0&&b(c,c,-1),A(i,a),A(r,c)}function ye(e,t,n){const o=t.worldUpAtPosition(e.origin,x.get()),i=e.basis1,r=ct(e,o),s=Math.round(r/Tt)*Tt;return P(e,s-r,i,n)}function Se(e,t,n,o,i,r){const s=h(x.get(),i.origin);O(s,s,b(x.get(),i.basis1,e.direction[0]<0?1:-1)),O(s,s,b(x.get(),i.basis2,e.direction[1]<0?1:-1));const a=R(i.basis1),c=R(i.basis2),l=I(x.get(),n,s),u=I(x.get(),t,s);let d=0,m=0;if(Je(e)){const t=$e(i),n=$e(r);d=a-.5*e.direction[0]*T(i.basis1,u)/a,m=c-.5*e.direction[1]*T(i.basis2,u)/c;const o=n/t;d*=o,m*=o}const g=d+.5*e.direction[0]*T(i.basis1,l)/a,p=m+.5*e.direction[1]*T(i.basis2,l)/c,f=b(x.get(),i.basis1,g/a),w=b(x.get(),i.basis2,p/c);(g<=0||qe(r.origin,f,o)<=z)&&h(f,r.basis1),(p<=0||qe(r.origin,w,o)<=z)&&h(w,r.basis2);const A=h(x.get(),s);return O(A,A,b(x.get(),f,e.direction[0]<0?-1:1)),O(A,A,b(x.get(),w,e.direction[1]<0?-1:1)),N(A,f,w,r)}function Ge(e,t){return $*Math.min(t.width,t.height)*t.computeRenderPixelSizeAt(e)}function ke(e,t,n,o){const i=w(x.get(),t,n);return w(i,i,t),D(e,i,o)}function De(e,t){return pe(e.basis1,e.basis2,e.origin,t)}function He(e,t,n,o){const i=t.worldUpAtPosition(e.origin,x.get()),r=x.get();switch(n){case pt.HEADING:h(r,i);break;case pt.TILT:h(r,e.basis1)}return D(e.origin,r,o)}function Be(e,t,n,o){const i=We(n,Ze.NEGATIVE_X),a=F.get();s(a,t,i.edge*Math.PI/2);const c=A(x.get(),i.basis);let l=b(x.get(),c,i.direction*o.computeScreenPixelSizeAt(i.position)*J);O(l,l,i.position);const u=o.projectToRenderScreen(l,r(x.get())),d=xe(o,u);Oe(o,u,ht),A(ht.direction,ht.direction);const m=x.get();!d&&V(n,ht,m)&&(l=m),a[12]=0,a[13]=0,a[14]=0,e.modelTransform=a,e.renderLocation=L(l),d?e.state|=bt:e.state&=~bt}function xe(e,t){const[n,o,i,r]=e.viewport,s=Math.min(i,r)/16;let a=!0;return t[0]<n+s?(t[0]=n+s,a=!1):t[0]>n+i-s&&(t[0]=n+i-s,a=!1),t[1]<o+s?(t[1]=o+s,a=!1):t[1]>o+r-s&&(t[1]=o+r-s,a=!1),a}function Fe(e,t,n,o){const i=R(o.basis1),r=R(o.basis2),s=ze(o),u=$e(o),d=E(x.get(),0,0,0);O(d,b(x.get(),o.basis1,t.direction[0]),b(x.get(),o.basis2,t.direction[1])),O(d,o.origin,d);let m=0,g=1;if(Je(t))1===t.direction[0]&&-1===t.direction[1]?m=Tt:1===t.direction[0]&&1===t.direction[1]?m=Math.PI:-1===t.direction[0]&&1===t.direction[1]&&(m=3*Math.PI/2),g=u;else{const e=0!==t.direction[0]?1:2;m=1===e?Tt:0,g=(1===e?r:i)-s}const p=a(F.get(),m);c(p,p,E(x.get(),g,g,g)),l(p,n,p),p[12]=0,p[13]=0,p[14]=0,e.modelTransform=p,e.renderLocation=d}function Xe(e,t,n,o){const i=o.worldUpAtPosition(n.origin,x.get()),r=We(n,Ze.POSITIVE_X),s=a(F.get(),r.edge*Math.PI/2);u(s,s,-ct(n,i)),l(s,t,s),s[12]=0,s[13]=0,s[14]=0,e.modelTransform=s,e.renderLocation=r.position}function Ye(e,t,n){const o=We(n,Ze.POSITIVE_Y),i=a(F.get(),o.edge*Math.PI/2);u(i,i,Tt),l(i,t,i),i[12]=0,i[13]=0,i[14]=0,e.modelTransform=i,e.renderLocation=o.position}var Ze;function We(e,t){switch(t){case Ze.POSITIVE_X:return{basis:e.basis1,direction:1,position:O(x.get(),e.origin,e.basis1),edge:t};case Ze.POSITIVE_Y:return{basis:e.basis2,direction:1,position:O(x.get(),e.origin,e.basis2),edge:t};case Ze.NEGATIVE_X:return{basis:e.basis1,direction:-1,position:I(x.get(),e.origin,e.basis1),edge:t};case Ze.NEGATIVE_Y:return{basis:e.basis2,direction:-1,position:I(x.get(),e.origin,e.basis2),edge:t}}}function qe(e,t,n){const o=n.projectToRenderScreen(O(x.get(),e,t),r(x.get())),i=n.projectToRenderScreen(I(x.get(),e,t),r(x.get()));return j(I(o,o,i))}function ze(e){const t=R(e.basis1),n=R(e.basis2);return K*Math.min(t,n)}function $e(e){return ze(e)}function Je(e){return 0!==e.direction[0]&&0!==e.direction[1]}function Ke(t,n){const o=n.offsetMode===Ot.CENTER_ON_CALLOUT?J:0,i=[v(o,0,-ie/2),v(o,0,ie/2)],r=rt(i,!0),s=(e,t)=>ot(i,e,t,n),a=s(0,!1),c=s(re,!0),l=new Ue({color:e.toUnitRGBA(n.calloutColor),renderOccluded:Ce.OccludeAndTransparent,isDecoration:!0}),u=Ie(l,[[o,0,0],[o-J,0,0]]),d=Ie(l,[[o,0,0],[o-J,0,0]]);return new ge({view:t,renderObjects:[...a.normal.map((e=>new he(e,Me.Unfocused|gt))),...c.normal.map((e=>new he(e,Me.Unfocused|gt))),new he(u,Me.Unfocused|gt|bt),...a.focused.map((e=>new he(e,Me.Focused|gt))),...c.focused.map((e=>new he(e,Me.Focused|gt))),new he(d,Me.Focused|gt|bt)],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[r]},collisionPriority:1,radius:Q,state:gt})}function Qe(t,n){const o=new Y(t.effectiveTheme),i=fe(t,{calloutColor:e.toUnitRGBA(o.color),customStateMask:gt,texture:n});return i.state=gt,i}function et(t){const n=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]],o=new Z(t.effectiveTheme);return new Te({view:t,attached:!1,color:e.toUnitRGBA(o.outlineColor),width:ee,renderOccluded:Ce.OccludeAndTransparent,geometry:[n],isDecoration:!0})}function tt(t){const n=new Z(t.effectiveTheme);return new we({view:t,attached:!1,backgroundColor:e.toUnitRGBA(n.color),gridColor:e.toUnitRGBA(n.gridColor),gridWidth:4,renderOccluded:Ce.OccludeAndTransparent,isDecoration:!0})}function nt(t,n,o){const i=Je(n),r=i?[v(1,0,0),v(0,0,0),v(0,1,0)]:[v(1,0,0),v(-1,0,0)],s=e.toUnitRGBA(o.color),a=e=>new ve({color:s,width:e,renderOccluded:Ce.OccludeAndTransparent,isDecoration:!0}),c=()=>new Ue({color:s,renderOccluded:Ce.OccludeAndTransparent,isDecoration:!0}),l=i?se:ae,u=l*ce,d=ae,m=e=>e>1?a(e):c(),g=[new he(Ie(m(l),r),Me.Unfocused|wt),new he(Ie(m(u),r),Me.Focused|wt),new he(Ie(m(d),r),At)],p=new ge({view:t,renderObjects:g,collisionType:{type:"line",paths:[r]},radius:i?te:ne,...be});return p.state=wt,p}function ot(t,n,o,i){const r=e.blendColors(i.color,i.outlineColor,.4),s=e.blendColors(i.color,i.outlineColor,.14),a=new Le({color:e.toUnitRGBA(i.color),cullFace:Re.Back,renderOccluded:Ce.Opaque,isDecoration:!0}),u=new Le({color:e.toUnitRGBA(r),cullFace:Re.Back,renderOccluded:Ce.Opaque,isDecoration:!0}),h=new Le({color:e.toUnitRGBA(s),cullFace:Re.Back,renderOccluded:Ce.Opaque,isDecoration:!0}),T=new Le({color:e.toUnitRGBA(i.outlineColor),transparent:!0,writeDepth:!1,cullFace:Re.Front,renderOccluded:Ce.Transparent,isDecoration:!0}),w=e=>{const i=t.slice(0),r=I(x.get(),i[0],i[1]);A(r,r);const s=I(x.get(),i[i.length-1],i[i.length-2]);if(A(s,s),n>0){const e=b(U(),s,-n);i[i.length-1]=O(e,e,i[i.length-1]);const t=b(U(),r,-n);i[0]=O(t,t,i[0])}const w=e?de:1,R=oe*w,j=Q*w,C=d(F.get());if(n>0){const e=R/4,t=E(x.get(),0,e,0),o=1+n/e;m(C,C,t),c(C,C,E(x.get(),o,o,o)),m(C,C,b(t,t,-1/o))}const L=d(p()),_=v(0,1,0),M=g(p(),f(X.get(),_,s));M[12]=i[i.length-1][0],M[13]=i[i.length-1][1],M[14]=i[i.length-1][2],l(M,M,C);const P=it(le*(e?ue:1)+n,i,o?T:h);P.transformation=L;const N=[P],V=Ee(o?T:a,R,j,24,!1,!1,!0);V.transformation=M,N.push(V);const y=Ee(o?T:u,R,j,24,!1,!0,!1);y.transformation=M,N.push(y);const S=g(p(),f(X.get(),_,r));return S[12]=i[0][0],S[13]=i[0][1],S[14]=i[0][2],l(S,S,C),N.push(V.instantiate({transformation:S})),N.push(y.instantiate({transformation:S})),N};return{normal:w(!1),focused:w(!0)}}function it(e,t,n){const o=[],i=12;for(let r=0;r<i;r++){const t=r/i*2*Math.PI;o.push([Math.cos(t)*e,Math.sin(t)*e])}return je(n,o,t,[],[],!1)}function rt(e,t){const n=I(U(),e[e.length-1],e[e.length-2]);if(A(n,n),b(n,n,oe),O(n,n,e[e.length-1]),t){const t=I(U(),e[0],e[1]);return A(t,t),b(t,t,oe),O(t,t,e[0]),[t,...e,n]}return[...e,n]}function st(e,n,i,r=new t){if(null==e)return null;const{renderCoordsHelper:s}=n,a=s.fromRenderCoords(e.origin,n.spatialReference);if(null==a)return null;const c=_(a,i);if(null==c)return null;r.position=c;const l=2*R(e.basis1),u=2*R(e.basis2),d=Ae.renderUnitScaleFactor(n.spatialReference,i);r.width=l*d,r.height=u*d;const m=s.worldUpAtPosition(e.origin,x.get());return r.tilt=o(ct(e,m)),r.heading=s.headingAtPosition(e.origin,e.basis1)-90,r}function at(e,t,n){if(null==e)return null;const o=e.origin,i=x.get(),r=x.get(),s=x.get(),a=x.get();let c,l,u,d,m,g;O(i,o,e.basis1),O(i,i,e.basis2),O(r,o,e.basis1),C(r,r,e.basis2),C(s,o,e.basis1),C(s,s,e.basis2),C(a,o,e.basis1),O(a,a,e.basis2);for(const p of[i,r,s,a]){const e=t.fromRenderCoords(p,p,n);if(null==e)return null;c=null==c?e[0]:Math.min(c,e[0]),l=null==l?e[0]:Math.max(l,e[0]),u=null==u?e[1]:Math.min(u,e[1]),d=null==d?e[1]:Math.max(d,e[1]),m=null==m?e[2]:Math.min(m,e[2]),g=null==g?e[2]:Math.max(g,e[2])}return new Pe({xmin:c,xmax:l,ymin:u,ymax:d,zmin:m,zmax:g,spatialReference:n})}function ct(e,t){return B(t,e.basis2,e.basis1)+Tt}function lt(e,t,o,r,s,a,c=y()){return a.toRenderCoords(e,c.origin)?(a.worldBasisAtPosition(c.origin,M.X,c.basis1),a.worldBasisAtPosition(c.origin,M.Y,c.basis2),k(c.basis2,c.basis1,c.origin,c.plane),P(c,-i(t),S(c),c),P(c,i(o),c.basis1,c),b(c.basis1,c.basis1,r/2),b(c.basis2,c.basis2,s/2),G(c),c):(n.getLogger("esri.views.3d.analysis.Slice.sliceToolUtils").error(`Failed to project slice plane position, projection from ${e.spatialReference.wkid} is not supported`),null)}function ut(e,t){if(null==e||null==e.position)return null;const n=me(e.position,t.spatialReference,t.elevationProvider);if(null==n)return null;const o=Ae.renderUnitScaleFactor(e.position.spatialReference,t.spatialReference),i=e.width*o,r=e.height*o;return{position:n,heading:e.heading,tilt:e.tilt,renderWidth:i,renderHeight:r}}function dt(e,t,n,o=y()){const i=ut(e,t);return null==i?null:mt(i,t,n,o)}function mt(e,t,n,o=y()){if(null==e)return null;const i=lt(e.position,e.heading,e.tilt,e.renderWidth,e.renderHeight,t.renderCoordsHelper,o);return n.tiltEnabled||null==i||ye(i,t.renderCoordsHelper,i),i}!function(e){e[e.POSITIVE_X=0]="POSITIVE_X",e[e.POSITIVE_Y=1]="POSITIVE_Y",e[e.NEGATIVE_X=2]="NEGATIVE_X",e[e.NEGATIVE_Y=3]="NEGATIVE_Y"}(Ze||(Ze={}));const gt=_e.Custom1;var pt,ft;!function(e){e[e.HEADING=1]="HEADING",e[e.TILT=2]="TILT"}(pt||(pt={})),function(e){e[e.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",e[e.HORIZONTAL=1]="HORIZONTAL",e[e.VERTICAL=2]="VERTICAL",e[e.TILTED=3]="TILTED"}(ft||(ft={}));const bt=_e.Custom2,ht=H(),Tt=Math.PI/2,wt=_e.Custom1,At=_e.Custom2;var Ot;function Rt(e){return null!=("building-scene-3d"===e.type?e:null)}!function(e){e[e.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",e[e.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"}(Ot||(Ot={}));export{gt as DidPointerMoveRecentlyFlag,bt as IsShiftEdgeOnScreenFlag,Ot as OffsetMode,pt as RotationAxis,ft as SliceOrientation,rt as addArrowTips,De as calculateBoundedPlaneTranslateRotate,$e as calculateDiagonalResizeHandleScale,Ge as calculatePlaneHalfSize,ze as calculateResizeHandlePadding,qe as calculateScreenSpaceBasisLength2,tt as createGridVisualElement,et as createOutlineVisualElement,Ne as createPlane,nt as createResizeManipulator,Qe as createRotateManipulator,He as createRotatePlane,Ke as createShiftManipulator,ke as createShiftPlane,ye as forceHorizontalOrVertical,Je as isDiagonalResizeHandle,Rt as isIBuildingSceneLayerView3D,Ve as normalToBases,at as planeToExtent,st as planeToShape,ut as projectAndElevationAlignShape,mt as projectedShapeToPlane,wt as resizeNormal,At as resizeOutlineOnly,Se as resizePlane,dt as shapeToPlane,Fe as updateResizeHandle,Xe as updateRotateHeadingHandle,Ye as updateRotateTiltHandle,Be as updateShiftRestartHandle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../core/Handles.js";import{clamp as t,lerp as s,smoothstep as i}from"../../../core/mathUtils.js";import{watch as r}from"../../../core/reactiveUtils.js";import{s as a}from"../../../chunks/vec2.js";import{s as o,l as n,p as h}from"../../../chunks/vec3.js";import{s as d}from"../../../chunks/vec4.js";import{earth as m}from"../../../geometry/support/Ellipsoid.js";import{AtmosphereType as u}from"./AtmosphereType.js";import{atmosphereHeight as p,innerAtmosphereDepth as c,computeInnerAltitudeFade as l}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as _,ChapmanAtmosphereTechnique as T}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as f}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{ColorFormat as b}from"../webgl-engine/core/FBOCache.js";import{Pos2Tex as v}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as w}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as x}from"../webgl-engine/lib/textureUtils.js";import{A as R}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as q}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{PrimitiveType as g}from"../../webgl/enums.js";class P{constructor(t,s){this._view=t,this._context=s,this.type=u.Realistic,this._handles=new e,this._atmosphereCompositionParameters=new R,this._atmosphereConfiguration=new f,this._passParameters=new _,this._rootTileElevationMin=NaN,this._lowerBoundEarthRadius=m.radius,this._fadeHaze=0,this._updateRadius(m.radius);const i=this._context.renderContext.rctx;this._updateRootTileElevationBounds(),this._handles.add([r((()=>this._view?.basemapTerrain?.rootTileElevationBounds),(()=>this._view?.basemapTerrain?this._updateRootTileElevationBounds():null)),r((()=>this._view?.basemapTerrain?.visibleElevationBounds),(()=>this._view?.basemapTerrain?this._updateVisibleElevationBounds():null))]);const a=new f;a.haze=!1,this._atmosphereTechnique=this._context.techniqueRepository.acquire(T,a),a.haze=!0,this._atmosphereHazeTechnique=this._context.techniqueRepository.acquire(T,a),a.reduced=!0,a.haze=!1,this._atmosphereReducedTechnique=this._context.techniqueRepository.acquire(T,a),a.haze=!0,this._atmosphereHazeReducedTechnique=this._context.techniqueRepository.acquire(T,a),this._vao=w(i,v)}destroy(){this._handles.destroy(),this._atmosphereTechnique.release(),this._atmosphereHazeTechnique.release(),this._atmosphereReducedTechnique.release(),this._atmosphereHazeReducedTechnique.release(),this._vao.dispose()}render(e,t){this._render(e,t?this._atmosphereTechnique:this._atmosphereReducedTechnique,e.offscreenRenderingHelper.depthTexture,t,!1)}renderHaze(e,t,s){this._fadeHaze=t,this._render(e,s?this._atmosphereHazeTechnique:this._atmosphereHazeReducedTechnique,e.bindParameters.linearDepth?.colorTexture,s,!0)}_render(e,t,i,r,a){if(null==i)return;const h=e.offscreenRenderingHelper;this._update(e.bindParameters.camera),this._passParameters.depthTexture=i;const d=h.backgroundColor;o(this._passParameters.backgroundColor,d[0]*d[3],d[1]*d[3],d[2]*d[3]);const u=e.rctx.bindTechnique(t,this._passParameters,e.bindParameters);if(r)h.renderDepthDetached((()=>this._renderCommon(u,e)));else{const t=e.rctx.getViewport(),r=n(e.bindParameters.camera.eye)-m.radius;let o;if(r<p){const e=Math.min(1,Math.max(0,r/p));o=a?s(.4,.5,e):s(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(r-p)/(15*p)));o=a?s(.5,1,e):s(.3,.6,e)}const d=x(Math.round(o*e.bindParameters.camera.fullViewport[2])),c=x(Math.round(o*e.bindParameters.camera.fullViewport[3]));e.rctx.setViewport(0,0,d,c);const l=h.renderToCachedFBO(null,(()=>this._renderCommon(u,e)),[0,0,0,1],b.RGBA,null,d,c);e.rctx.setViewport(t.x,t.y,t.width,t.height),this._atmosphereCompositionParameters.color=l.colorTexture,this._atmosphereCompositionParameters.depth=i,this._atmosphereConfiguration.haze=a;const _=this._context.techniqueRepository.acquire(q,this._atmosphereConfiguration);e.rctx.bindTechnique(_,this._atmosphereCompositionParameters,e.bindParameters),h.renderDepthDetached((()=>
|
|
5
|
+
import e from"../../../core/Handles.js";import{clamp as t,lerp as s,smoothstep as i}from"../../../core/mathUtils.js";import{watch as r}from"../../../core/reactiveUtils.js";import{s as a}from"../../../chunks/vec2.js";import{s as o,l as n,p as h}from"../../../chunks/vec3.js";import{s as d}from"../../../chunks/vec4.js";import{earth as m}from"../../../geometry/support/Ellipsoid.js";import{AtmosphereType as u}from"./AtmosphereType.js";import{atmosphereHeight as p,innerAtmosphereDepth as c,computeInnerAltitudeFade as l}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as _,ChapmanAtmosphereTechnique as T}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as f}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{ColorFormat as b}from"../webgl-engine/core/FBOCache.js";import{Pos2Tex as v}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as w}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as x}from"../webgl-engine/lib/textureUtils.js";import{A as R}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as q}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{PrimitiveType as g}from"../../webgl/enums.js";class P{constructor(t,s){this._view=t,this._context=s,this.type=u.Realistic,this._handles=new e,this._atmosphereCompositionParameters=new R,this._atmosphereConfiguration=new f,this._passParameters=new _,this._rootTileElevationMin=NaN,this._lowerBoundEarthRadius=m.radius,this._fadeHaze=0,this._updateRadius(m.radius);const i=this._context.renderContext.rctx;this._updateRootTileElevationBounds(),this._handles.add([r((()=>this._view?.basemapTerrain?.rootTileElevationBounds),(()=>this._view?.basemapTerrain?this._updateRootTileElevationBounds():null)),r((()=>this._view?.basemapTerrain?.visibleElevationBounds),(()=>this._view?.basemapTerrain?this._updateVisibleElevationBounds():null))]);const a=new f;a.haze=!1,this._atmosphereTechnique=this._context.techniqueRepository.acquire(T,a),a.haze=!0,this._atmosphereHazeTechnique=this._context.techniqueRepository.acquire(T,a),a.reduced=!0,a.haze=!1,this._atmosphereReducedTechnique=this._context.techniqueRepository.acquire(T,a),a.haze=!0,this._atmosphereHazeReducedTechnique=this._context.techniqueRepository.acquire(T,a),this._vao=w(i,v)}destroy(){this._handles.destroy(),this._atmosphereTechnique.release(),this._atmosphereHazeTechnique.release(),this._atmosphereReducedTechnique.release(),this._atmosphereHazeReducedTechnique.release(),this._vao.dispose()}render(e,t){this._render(e,t?this._atmosphereTechnique:this._atmosphereReducedTechnique,e.offscreenRenderingHelper.depthTexture,t,!1)}renderHaze(e,t,s){this._fadeHaze=t,this._render(e,s?this._atmosphereHazeTechnique:this._atmosphereHazeReducedTechnique,e.bindParameters.linearDepth?.colorTexture,s,!0)}_render(e,t,i,r,a){if(null==i)return;const h=e.offscreenRenderingHelper;this._update(e.bindParameters.camera),this._passParameters.depthTexture=i;const d=h.backgroundColor;o(this._passParameters.backgroundColor,d[0]*d[3],d[1]*d[3],d[2]*d[3]);const u=e.rctx.bindTechnique(t,this._passParameters,e.bindParameters);if(r)h.renderDepthDetached((()=>this._renderCommon(u,e)));else{const t=e.rctx.getViewport(),r=n(e.bindParameters.camera.eye)-m.radius;let o;if(r<p){const e=Math.min(1,Math.max(0,r/p));o=a?s(.4,.5,e):s(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(r-p)/(15*p)));o=a?s(.5,1,e):s(.3,.6,e)}const d=x(Math.round(o*e.bindParameters.camera.fullViewport[2])),c=x(Math.round(o*e.bindParameters.camera.fullViewport[3]));e.rctx.setViewport(0,0,d,c);const l=h.renderToCachedFBO(null,(()=>this._renderCommon(u,e)),[0,0,0,1],b.RGBA,null,d,c);e.rctx.setViewport(t.x,t.y,t.width,t.height),this._atmosphereCompositionParameters.color=l.colorTexture,this._atmosphereCompositionParameters.depth=i,this._atmosphereConfiguration.haze=a;const _=this._context.techniqueRepository.acquire(q,this._atmosphereConfiguration);e.rctx.bindTechnique(_,this._atmosphereCompositionParameters,e.bindParameters),h.renderDepthDetached((()=>e.rctx.screen.draw())),_.release(),l.release()}}_renderCommon(e,t){null!=this._vao&&(t.rctx.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),t.rctx.drawArrays(g.TRIANGLE_STRIP,0,4))}_adjustRadiusForTesselation(e){return e*Math.cos(Math.PI/16/16)}_updateRootTileElevationBounds(){const e=this._view.basemapTerrain.rootTileElevationBounds.min;e!==this._rootTileElevationMin&&(this._rootTileElevationMin=e,this._lowerBoundEarthRadius=m.radius,this._updateVisibleElevationBounds())}_updateVisibleElevationBounds(){const e=this._adjustRadiusForTesselation(m.radius+this._view.basemapTerrain.visibleElevationBounds.min);e<this._lowerBoundEarthRadius&&this._updateRadius(e)}_updateRadius(e){this._lowerBoundEarthRadius=e,a(this._passParameters.radii,e,e+p),this._passParameters.innerFadeDistance=2*Math.sqrt((2*e-c)*c)}_update(e){if(!e)return;const r=h(e.eye),a=Math.sqrt(r),o=r-this._passParameters.radii[1]*this._passParameters.radii[1],n=t((a-this._passParameters.radii[0])/p,0,1);d(this._passParameters.heightParameters,a,r,o,n),this._passParameters.altitudeFade=l(a-this._lowerBoundEarthRadius),this._passParameters.hazeStrength=s(s(.6,1,i(9500,10500,a-m.radius)),1,this._fadeHaze)}static isSupported(e){return e.renderContext.rctx.capabilities.depthTexture}}export{P as ChapmanAtmosphere};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import i from"../../../../../core/Collection.js";import e from"../../../../../core/Evented.js";import{makeHandle as o}from"../../../../../core/handleUtils.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{scale as n,zeroMeters as s}from"../../../../../core/quantityUtils.js";import{watch as r,syncAndInitial as p}from"../../../../../core/reactiveUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../../../core/support/UpdatingHandles.js";import{makeDehydratedPoint as u}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as m,getConvertedElevation as d}from"../../../../../support/elevationInfoUtils.js";import{getGraphicAttachmentOrigin as g}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{SupportedGraphicResult as v}from"../isSupportedGraphicUtils.js";import{canMoveZ as M}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as _}from"../meshFastUpdateUtils.js";import{createVisualElements as y}from"../visualElementUtils.js";import{DISC_RADIUS as w}from"../manipulations/config.js";import{ManipulationType as j,MoveManipulation as b}from"../manipulations/MoveManipulation.js";import{shapeOrientation as x,axisConstrainedDragSign as S}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as E}from"../manipulations/MoveXYGraphicManipulation.js";import{isSupportedGraphic as T}from"./isSupportedGraphic.js";import{OutlineVisualElement as H}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as O}from"../../../layers/graphics/GraphicState.js";import{dragGraphicMany as U,resetGraphicMany as D}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as X}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as G}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import Y from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as z}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as A}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as P}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as k,TranslateGraphicZTooltipInfo as I,TranslateGraphicXYTooltipInfo as R}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as F}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as Z}from"../../../../support/euclideanLengthMeasurementUtils.js";class C{constructor(t){this.allGraphics=t,this.type="graphic-move-start"}}class V{constructor(t,i,e){this.dx=t,this.dy=i,this.allGraphics=e,this.type="graphic-move"}}class L{constructor(t){this.allGraphics=t,this.type="graphic-move-stop"}}const N="manipulators";let q=class extends(e.EventedMixin(X)){constructor(t){super(t),this._infos=new Map,this.graphics=new i,this.enableZ=!0,this.tooltipOptions=new Y,this.type="move-3d",this._updatingHandles=new h,this._moveManipulation=null,this._tooltip=null}initialize(){const{view:t}=this;this.addHandles([this.graphics.on("change",(t=>{t.removed.forEach((t=>this.removeHandles(t))),this._updateGraphicInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators()})),r((()=>this.tooltipOptions.enabled),(i=>{this._tooltip=i?new P({view:t}):a(this._tooltip)}),p)]);const i=this.graphics.toArray();this._updateGraphicInfos({added:i,removed:[]}),this._setupFastTransformUpdates(i),this._refreshManipulators(),this.finishToolCreation()}destroy(){this._tooltip=a(this._tooltip),this._moveManipulation=a(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}reset(){}_updateGraphicInfos({added:t,removed:i}){for(const e of t){if(T(e)!==v.SUPPORTED)continue;const t=new B(e),i=this.view.trackGraphicState(t.state);this._infos.set(t.graphic,{info:t,handle:i})}for(const e of i)this._infos.get(e)?.handle.remove(),this._infos.delete(e)}_setupFastTransformUpdates(t){for(const i of t){const{info:t}=this._infos.get(i);this.addHandles(_(t.state),i)}}_refreshManipulators(){if(this.removeHandles(N),this._moveManipulation=a(this._moveManipulation),this.manipulators.removeAll(),0===this._infos.size)return;const t=Array.from(this._infos.values(),(({info:t})=>t));this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const i of t){const e=i.state;i.manipulationXY=new E({tool:this,view:this.view,graphicState:e}),i.manipulationXY.forEachManipulator((t=>this.addHandles([t.events.on("immediate-click",(t=>{this.emit("immediate-click",{...t,graphic:e.graphic}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{const{tooltipOptions:i,_tooltip:e}=this;null!=e&&("start"===t?e.info=new k({tooltipOptions:i}):e.clear())}))],N))),this.addHandles(i.manipulationXY.createDragPipeline(((i,e,o,a)=>this._buildDragEventPipeline(t,j.XY,i,e,o,a))),N)}this._createMoveManipulation(t)}_createMoveManipulation(t){const i=new b({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?b.radiusForSymbol(t[0].graphic.symbol):w});this._moveManipulation=i,i.elevationInfo={mode:"absolute-height",offset:0},i.forEachManipulator((t=>{this.addHandles(t.events.on("immediate-click",(e=>{i.zManipulation.hasManipulator(t)||1!==this.graphics.length||this.emit("immediate-click",{...e,graphic:this.graphics.at(0)}),e.stopPropagation()})),N)}));const e=i=>e=>{this.addHandles(e.events.on("focus-changed",(({action:e})=>{const o=this._tooltip;null!=o&&("focus"===e?this._updateMoveTooltip(t,i):o.clear())})),N)};this._moveManipulation.xyManipulation.forEachManipulator(e(j.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(j.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(j.Z));const o=()=>this._updateMoveManipulation(t);for(const n of t)this.addHandles([n.state.on("changed",o),r((()=>n.state.displaying),o)],N);const a=t.at(-1);this.addHandles(a.state.on("changed",(()=>this._updateMoveManipulationAngle(a))),N),this.addHandles(i.createDragPipeline(((i,e,o,a,n)=>this._buildDragEventPipeline(t,i,e,o,a,n)),m(a.graphic),a.graphic.geometry.spatialReference,a.graphic),N),this._updateMoveManipulationAngle(a)}_createVisualElements(t){for(const i of t){const e=i.graphic,a=y({view:this.view,graphic:e,forEachManipulator:t=>{i.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>o()});null!=a&&(i.geometryRepresentation=a.visualElement,i.geometryRepresentation instanceof H&&this.addHandles([i.geometryRepresentation.events.on("attachment-origin-changed",(()=>{i.state.isDraped||this._updateMoveManipulation(t)})),r((()=>i.state.isDraped),(()=>this._updateMoveManipulation(t)))],N),this.addHandles(a,N))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=x(t.graphic.geometry))}_updateMoveManipulation(t){const i=u(0,0,0,this.view.spatialReference);let e=0,o=!1;const a=this._moveManipulation;if(a){for(const a of t){if(!a.state.displaying)continue;const t=a.state.graphic;this.enableZ&&M(t)&&(o=!0);const n=a.geometryRepresentation instanceof H&&!a.state.isDraped?a.geometryRepresentation.attachmentOrigin:g(this.view,t);if(null!=n){const{x:t,y:o,z:a}=n;i.x+=t,i.y+=o,a&&(i.z??=0,i.z+=a),e++}}e>0?(i.x/=e,i.y/=e,i.z??=0,i.z/=e,a.location=i,a.xyManipulation.available=!0,a.xyAxisManipulation.available=!0,a.zManipulation.available=o):a.available=!1}}_buildDragEventPipeline(t,i,e,o,a,n){const s=[],r=[];let p=null,l=null;const c=()=>{for(const t of s)t.dragging=!1;s.length=0,r.length=0,p=null,l=null,this._moveManipulation&&(this._moveManipulation.interactive=!0)};if(1===t.length&&i===j.XY){const i=t[0].graphic;({steps:o,cancel:a}=this._buildSnappingPipelineSteps(i,m(i),o,a,n))}return a=a.next((t=>l?.(t))).next((()=>(this.emit("graphic-move-stop",new L(r)),this.destroyed||c(),null))),{steps:o=o.next((i=>{if("start"===i.action){s.length=0,r.length=0;for(const i of t)i.dragging||!i.manipulationXY?.hasManipulator(e)&&i.manipulationXY?.grabbing||(s.push(i),r.push(i.graphic),i.dragging=!0);if(0!==r.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),p=U(r,this.view.state.viewingMode),l=D(r),this.emit("graphic-move-start",new C(r)),this.destroyed))return null}return 0!==r.length?i:null})).next((t=>p?.(t))).next((e=>(this._updateMoveTooltip(t,i,e),e))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const i=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd),o=e.x-i.x,a=e.y-i.y;if(this.emit("graphic-move",new V(o,a,r)),this.destroyed)return null}break;case"end":if(this.emit("graphic-move-stop",new L(r)),this.destroyed)return null;c()}return null})),cancel:a}}_updateMoveTooltip(t,i,e){const{tooltipOptions:o,_tooltip:a}=this;if(null==a)return;a.clear();const s=0===t.length?"absolute-height":t[0].state.isDraped?"on-the-ground":"absolute-height";switch(i){case j.XY:a.info=new k({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>F(t,i,s)));break;case j.XY_AXIS:a.info=new R({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>{const o=F(t,i,s);return n(o,S(e))}));break;case j.Z:a.info=new I({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,Z)}}_updateMoveTooltipDistance(t,i,e){if(null!=i&&"end"!==i.action){const{mapStart:o,mapEnd:a}=i,n=e(o,a);t.distance=null!=n?n:s}}_buildSnappingPipelineSteps(t,i,e,o,a){const n=t.geometry;if(null==n||"point"!==n.type&&"mesh"!==n.type)return{steps:e,cancel:o};const s=("point"===n.type?n:n.anchor).clone(),r=new z({elevationInfo:i,pointer:a,editGeometryOperations:G.fromGeometry(s,this.view.state.viewingMode),visualizer:new f,excludeFeature:t}),p=this.snappingManager,{snappingStep:l,cancelSnapping:c}=A({snappingContext:r,snappingManager:p,updatingHandles:this._updatingHandles});return o=o.next(c),{steps:e=e.next((i=>{s.z=d(this.view,s,m(t),{mode:"absolute-height",offset:0});return{...i,snapOrigin:r.coordinateHelper.pointToVector(s)}})).next(...l),cancel:o}}get test(){return{tooltip:this._tooltip}}};t([l({constructOnly:!0,nonNullable:!0})],q.prototype,"view",void 0),t([l()],q.prototype,"graphics",void 0),t([l({constructOnly:!0,nonNullable:!0})],q.prototype,"enableZ",void 0),t([l({constructOnly:!0,type:Y})],q.prototype,"tooltipOptions",void 0),t([l({constructOnly:!0})],q.prototype,"snappingManager",void 0),t([l()],q.prototype,"type",void 0),t([l()],q.prototype,"updating",null),q=t([c("esri.views.3d.interactive.editingTools.graphicMove3D.GraphicMoveTool")],q);class B{constructor(t){this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1,this.state=new O({graphic:t})}get graphic(){return this.state.graphic}}export{V as GraphicMoveEvent,C as GraphicMoveStartEvent,L as GraphicMoveStopEvent,q as GraphicMoveTool};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import i from"../../../../../core/Collection.js";import e from"../../../../../core/Evented.js";import{makeHandle as o}from"../../../../../core/handleUtils.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{scale as n,zeroMeters as s}from"../../../../../core/quantityUtils.js";import{watch as r,syncAndInitial as p}from"../../../../../core/reactiveUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import{makeDehydratedPoint as u}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as m,getConvertedElevation as d}from"../../../../../support/elevationInfoUtils.js";import{getGraphicAttachmentOrigin as g}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{SupportedGraphicResult as v}from"../isSupportedGraphicUtils.js";import{canMoveZ as M}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as _}from"../meshFastUpdateUtils.js";import{createVisualElements as y}from"../visualElementUtils.js";import{DISC_RADIUS as w}from"../manipulations/config.js";import{ManipulationType as j,MoveManipulation as b}from"../manipulations/MoveManipulation.js";import{shapeOrientation as x,axisConstrainedDragSign as S}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as E}from"../manipulations/MoveXYGraphicManipulation.js";import{isSupportedGraphic as T}from"./isSupportedGraphic.js";import{OutlineVisualElement as H}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as O}from"../../../layers/graphics/GraphicState.js";import{dragGraphicMany as U,resetGraphicMany as D}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as X}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as G}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import Y from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as z}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as A}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as P}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as k,TranslateGraphicZTooltipInfo as I,TranslateGraphicXYTooltipInfo as R}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as F}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as Z}from"../../../../support/euclideanLengthMeasurementUtils.js";class C{constructor(t){this.allGraphics=t,this.type="graphic-move-start"}}class V{constructor(t,i,e){this.dx=t,this.dy=i,this.allGraphics=e,this.type="graphic-move"}}class L{constructor(t){this.allGraphics=t,this.type="graphic-move-stop"}}const N="manipulators";let q=class extends(e.EventedMixin(X)){constructor(t){super(t),this._infos=new Map,this.graphics=new i,this.enableZ=!0,this.tooltipOptions=new Y,this.type="move-3d",this._updatingHandles=new c,this._moveManipulation=null,this._tooltip=null}initialize(){const{view:t}=this;this.addHandles([this.graphics.on("change",(t=>{t.removed.forEach((t=>this.removeHandles(t))),this._updateGraphicInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators()})),r((()=>this.tooltipOptions.enabled),(i=>{this._tooltip=i?new P({view:t}):a(this._tooltip)}),p)]);const i=this.graphics.toArray();this._updateGraphicInfos({added:i,removed:[]}),this._setupFastTransformUpdates(i),this._refreshManipulators(),this.finishToolCreation()}destroy(){this._tooltip=a(this._tooltip),this._moveManipulation=a(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}reset(){}_updateGraphicInfos({added:t,removed:i}){for(const e of t){if(T(e)!==v.SUPPORTED)continue;const t=new B(e),i=this.view.trackGraphicState(t.state);this._infos.set(t.graphic,{info:t,handle:i})}for(const e of i)this._infos.get(e)?.handle.remove(),this._infos.delete(e)}_setupFastTransformUpdates(t){for(const i of t){const{info:t}=this._infos.get(i);this.addHandles(_(t.state),i)}}_refreshManipulators(){if(this.removeHandles(N),this._moveManipulation=a(this._moveManipulation),this.manipulators.removeAll(),0===this._infos.size)return;const t=Array.from(this._infos.values(),(({info:t})=>t));this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const i of t){const e=i.state;i.manipulationXY=new E({tool:this,view:this.view,graphicState:e}),i.manipulationXY.forEachManipulator((t=>this.addHandles([t.events.on("immediate-click",(t=>{this.emit("immediate-click",{...t,graphic:e.graphic}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{const{tooltipOptions:i,_tooltip:e}=this;null!=e&&("start"===t?e.info=new k({tooltipOptions:i}):e.clear())}))],N))),this.addHandles(i.manipulationXY.createDragPipeline(((i,e,o,a)=>this._buildDragEventPipeline(t,j.XY,i,e,o,a))),N)}this._createMoveManipulation(t)}_createMoveManipulation(t){const i=new b({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?b.radiusForSymbol(t[0].graphic.symbol):w});this._moveManipulation=i,i.elevationInfo={mode:"absolute-height",offset:0},i.forEachManipulator((t=>{this.addHandles(t.events.on("immediate-click",(e=>{i.zManipulation.hasManipulator(t)||1!==this.graphics.length||this.emit("immediate-click",{...e,graphic:this.graphics.at(0)}),e.stopPropagation()})),N)}));const e=i=>e=>{this.addHandles(e.events.on("focus-changed",(({action:e})=>{const o=this._tooltip;null!=o&&("focus"===e?this._updateMoveTooltip(t,i):o.clear())})),N)};this._moveManipulation.xyManipulation.forEachManipulator(e(j.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(j.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(j.Z));const o=()=>this._updateMoveManipulation(t);for(const n of t)this.addHandles([n.state.on("changed",o),r((()=>n.state.displaying),o)],N);const a=t[t.length-1];this.addHandles(a.state.on("changed",(()=>this._updateMoveManipulationAngle(a))),N),this.addHandles(i.createDragPipeline(((i,e,o,a,n)=>this._buildDragEventPipeline(t,i,e,o,a,n)),m(a.graphic),a.graphic.geometry.spatialReference,a.graphic),N),this._updateMoveManipulationAngle(a)}_createVisualElements(t){for(const i of t){const e=i.graphic,a=y({view:this.view,graphic:e,forEachManipulator:t=>{i.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>o()});null!=a&&(i.geometryRepresentation=a.visualElement,i.geometryRepresentation instanceof H&&this.addHandles([i.geometryRepresentation.events.on("attachment-origin-changed",(()=>{i.state.isDraped||this._updateMoveManipulation(t)})),r((()=>i.state.isDraped),(()=>this._updateMoveManipulation(t)))],N),this.addHandles(a,N))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=x(t.graphic.geometry))}_updateMoveManipulation(t){const i=u(0,0,0,this.view.spatialReference);let e=0,o=!1;const a=this._moveManipulation;if(a){for(const a of t){if(!a.state.displaying)continue;const t=a.state.graphic;this.enableZ&&M(t)&&(o=!0);const n=a.geometryRepresentation instanceof H&&!a.state.isDraped?a.geometryRepresentation.attachmentOrigin:g(this.view,t);if(null!=n){const{x:t,y:o,z:a}=n;i.x+=t,i.y+=o,a&&(i.z??=0,i.z+=a),e++}}e>0?(i.x/=e,i.y/=e,i.z??=0,i.z/=e,a.location=i,a.xyManipulation.available=!0,a.xyAxisManipulation.available=!0,a.zManipulation.available=o):a.available=!1}}_buildDragEventPipeline(t,i,e,o,a,n){const s=[],r=[];let p=null,l=null;const h=()=>{for(const t of s)t.dragging=!1;s.length=0,r.length=0,p=null,l=null,this._moveManipulation&&(this._moveManipulation.interactive=!0)};if(1===t.length&&i===j.XY){const i=t[0].graphic;({steps:o,cancel:a}=this._buildSnappingPipelineSteps(i,m(i),o,a,n))}return a=a.next((t=>l?.(t))).next((()=>(this.emit("graphic-move-stop",new L(r)),this.destroyed||h(),null))),{steps:o=o.next((i=>{if("start"===i.action){s.length=0,r.length=0;for(const i of t)i.dragging||!i.manipulationXY?.hasManipulator(e)&&i.manipulationXY?.grabbing||(s.push(i),r.push(i.graphic),i.dragging=!0);if(0!==r.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),p=U(r,this.view.state.viewingMode),l=D(r),this.emit("graphic-move-start",new C(r)),this.destroyed))return null}return 0!==r.length?i:null})).next((t=>p?.(t))).next((e=>(this._updateMoveTooltip(t,i,e),e))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const i=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd),o=e.x-i.x,a=e.y-i.y;if(this.emit("graphic-move",new V(o,a,r)),this.destroyed)return null}break;case"end":if(this.emit("graphic-move-stop",new L(r)),this.destroyed)return null;h()}return null})),cancel:a}}_updateMoveTooltip(t,i,e){const{tooltipOptions:o,_tooltip:a}=this;if(null==a)return;a.clear();const s=0===t.length?"absolute-height":t[0].state.isDraped?"on-the-ground":"absolute-height";switch(i){case j.XY:a.info=new k({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>F(t,i,s)));break;case j.XY_AXIS:a.info=new R({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>{const o=F(t,i,s);return n(o,S(e))}));break;case j.Z:a.info=new I({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,Z)}}_updateMoveTooltipDistance(t,i,e){if(null!=i&&"end"!==i.action){const{mapStart:o,mapEnd:a}=i,n=e(o,a);t.distance=null!=n?n:s}}_buildSnappingPipelineSteps(t,i,e,o,a){const n=t.geometry;if(null==n||"point"!==n.type&&"mesh"!==n.type)return{steps:e,cancel:o};const s=("point"===n.type?n:n.anchor).clone(),r=new z({elevationInfo:i,pointer:a,editGeometryOperations:G.fromGeometry(s,this.view.state.viewingMode),visualizer:new f,excludeFeature:t}),p=this.snappingManager,{snappingStep:l,cancelSnapping:h}=A({snappingContext:r,snappingManager:p,updatingHandles:this._updatingHandles});return o=o.next(h),{steps:e=e.next((i=>{s.z=d(this.view,s,m(t),{mode:"absolute-height",offset:0});return{...i,snapOrigin:r.coordinateHelper.pointToVector(s)}})).next(...l),cancel:o}}get test(){return{tooltip:this._tooltip}}};t([l({constructOnly:!0,nonNullable:!0})],q.prototype,"view",void 0),t([l()],q.prototype,"graphics",void 0),t([l({constructOnly:!0,nonNullable:!0})],q.prototype,"enableZ",void 0),t([l({constructOnly:!0,type:Y})],q.prototype,"tooltipOptions",void 0),t([l({constructOnly:!0})],q.prototype,"snappingManager",void 0),t([l()],q.prototype,"type",void 0),t([l()],q.prototype,"updating",null),q=t([h("esri.views.3d.interactive.editingTools.graphicMove3D.GraphicMoveTool")],q);class B{constructor(t){this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1,this.state=new O({graphic:t})}get graphic(){return this.state.graphic}}export{V as GraphicMoveEvent,C as GraphicMoveStartEvent,L as GraphicMoveStopEvent,q as GraphicMoveTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{whenOnce as t}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{projectDatasetExtent as a}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{LayerView3D as l}from"./LayerView3D.js";import{TiledLayerView3D as n}from"./TiledLayerView3D.js";import{RasterTile as o}from"../terrain/RasterTile.js";import m from"../../layers/ImageryTileLayerView.js";import p from"../../layers/LayerView.js";import h from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as c}from"../../support/drapedUtils.js";import{getWebGLCapabilities as y}from"../../webgl/capabilities.js";let d=class extends(m(h(n(l(p))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this.isAlignedMapTile=!0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=t((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const e=this.view.basemapTerrain.tilingScheme,r=this.layer.tileInfo,t=["png","png24","png32","jpg","mixed"].includes(r.format)&&e.compatibleWith(r);this.isAlignedMapTile=t;const i=t?r:e.toTileInfo();this.tileInfo=i,this._updatingHandles.add((()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent]),(()=>this.refresh()))}));this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this.view=null}get _blankTile(){const e=document.createElement("canvas"),r=e.getContext("2d"),[t,i]=this.tileInfo.size;return e.width=t,e.height=i,r.clearRect(0,0,t,i),r.getImageData(0,0,t,i)}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.tileInfo.lods,r=this.layer.tileInfo.lods,t=e[0].scale,i=r.
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{whenOnce as t}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{projectDatasetExtent as a}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{LayerView3D as l}from"./LayerView3D.js";import{TiledLayerView3D as n}from"./TiledLayerView3D.js";import{RasterTile as o}from"../terrain/RasterTile.js";import m from"../../layers/ImageryTileLayerView.js";import p from"../../layers/LayerView.js";import h from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as c}from"../../support/drapedUtils.js";import{getWebGLCapabilities as y}from"../../webgl/capabilities.js";let d=class extends(m(h(n(l(p))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this.isAlignedMapTile=!0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=t((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const e=this.view.basemapTerrain.tilingScheme,r=this.layer.tileInfo,t=["png","png24","png32","jpg","mixed"].includes(r.format)&&e.compatibleWith(r);this.isAlignedMapTile=t;const i=t?r:e.toTileInfo();this.tileInfo=i,this._updatingHandles.add((()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent]),(()=>this.refresh()))}));this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this.view=null}get _blankTile(){const e=document.createElement("canvas"),r=e.getContext("2d"),[t,i]=this.tileInfo.size;return e.width=t,e.height=i,r.clearRect(0,0,t,i),r.getImageData(0,0,t,i)}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.tileInfo.lods,r=this.layer.tileInfo.lods,t=e[0].scale,i=r[r.length-1].scale;return this.levelRangeFromScaleRange(t,i)}_getfullExtent(){return a(this.layer.rasterInfo,this.view.basemapTerrain&&null!=this.view.basemapTerrain.spatialReference?this.view.basemapTerrain.spatialReference:this.view.spatialReference)}async fetchTile(e,r,t,i){const s=this.tileInfo,a=this._canSymbolizeInWebGL(),l={tileInfo:s,requestRawData:a,signal:i.signal,timeExtent:this.timeExtent,requestAsImageElement:this.isAlignedMapTile},n=await this.layer.fetchTile(e,r,t,l);if(n instanceof HTMLImageElement)return n;let m=n&&n.pixelBlock;if(null==m)return this._blankTile;if(!a&&(m=await this.layer.applyRenderer(n),null==m))return this._blankTile;const p=new o([e,r,t],m,s.size[0],s.size[1]);return a?(p.symbolizerRenderer=this.layer.symbolizer.rendererJSON,p.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e)),p.transformGrid=n.transformGrid):p.isRendereredSource=!0,p.interpolation=this.layer.interpolation,p.bandIds=this.layer.bandIds,p}_getSymbolizerOptions(e){const r=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:this.view.basemapTerrain&&null!=this.view.basemapTerrain.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:r,y:r},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,r){return c(e,r,this.view)}refresh(){this.emit("data-changed")}async doRefresh(){this.suspended||this.emit("data-changed")}_canSymbolizeInWebGL(){const e=y("3d"),{symbolizer:r}=this.layer,t=r.lookup?.colormapLut?.indexedColormap,i=t&&t.length>4*(e.maxTextureSize||4906);return e.supportsTextureFloat&&r.canRenderInWebGL&&!i}};e([i({readOnly:!0})],d.prototype,"_blankTile",null),e([i({readOnly:!0})],d.prototype,"imageFormatIsOpaque",null),e([i({readOnly:!0})],d.prototype,"hasMixedImageFormats",null),e([i({readOnly:!0})],d.prototype,"dataLevelRange",null),d=e([s("esri.views.3d.layers.ImageryTileLayerView3D")],d);const u=d;export{u as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{whenOnce as i}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{updatingProgress as l,updatingProgressValue as s}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as n}from"../terrain/terrainUtils.js";const o=o=>{let c=class extends o{get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}get dataScaleRange(){const e=this.tileInfo.lods;let t=e[0].scale,i=e.
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{whenOnce as i}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{updatingProgress as l,updatingProgressValue as s}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as n}from"../terrain/terrainUtils.js";const o=o=>{let c=class extends o{get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}get dataScaleRange(){const e=this.tileInfo.lods;let t=e[0].scale,i=e[e.length-1].scale;if("tilemapCache"in this.layer&&this.layer.tilemapCache){const{effectiveMinLOD:e,effectiveMaxLOD:r}=this.layer.tilemapCache;t=this.tileInfo.lodAt(e).scale,i=this.tileInfo.lodAt(r).scale}return{minScale:t,maxScale:i}}get dataLevelRange(){const{minScale:e,maxScale:t}=this.dataScaleRange;return this.levelRangeFromScaleRange(e,t)}get displayLevelRange(){const e=this.layer.minScale||this.dataScaleRange.minScale,t=this.layer.maxScale||this.dataScaleRange.maxScale,i=this.levelRangeFromScaleRange(e,t);return this.layer.maxScale&&i.maxLevel++,i}getTileUrl(e,t,i){return this.layer.getTileUrl(e,t,i)}_addTilingSchemeMatchPromise(){if(null==this.fullExtent)return this.addResolvingPromise(Promise.reject(new t("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(null!=e)return this.addResolvingPromise(Promise.reject(e));const r=i((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const e=this.view.basemapTerrain.tilingScheme,t=this._getTileInfoCompatibilityError(this.tileInfo,e);if(t)throw t}));this.addResolvingPromise(r)}_getTileInfoSupportError(e,i){const r=n(e,i,this.view.spatialReference,this.view.state.viewingMode);if(r){const e={layer:this.layer,error:r};let i;switch(r.name){case"tilingscheme:spatial-reference-mismatch":case"tilingscheme:global-unsupported-spatial-reference":case"tilingscheme:local-unsupported-spatial-reference":i=new t("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",e);break;default:i=new t("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",e)}return i}return null}_getTileInfoCompatibilityError(e,i){return null!=e&&i.compatibleWith(e)?null:new t("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")}levelRangeFromScaleRange(e,t){const i={minLevel:0,maxLevel:1/0},r=this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!r)return i;const a=r.levels[0],l=e=>{const t=Math.log(a.scale/e)/Math.LN2;return.5-Math.abs(.5-t%1)<1e-9?Math.round(t):Math.ceil(t)};return null!=e&&e>0&&(i.minLevel=Math.max(0,l(e))),null!=t&&t>0&&(i.maxLevel=Math.max(0,l(t))),i}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};return e([r({readOnly:!0})],c.prototype,"imageFormatIsOpaque",null),e([r({readOnly:!0})],c.prototype,"updating",void 0),e([r(l)],c.prototype,"updatingProgress",void 0),e([r(s)],c.prototype,"updatingProgressValue",void 0),e([r()],c.prototype,"fullExtent",null),e([r({readOnly:!0})],c.prototype,"isOpaque",null),e([r()],c.prototype,"dataScaleRange",null),e([r({readOnly:!0})],c.prototype,"dataLevelRange",null),e([r({readOnly:!0})],c.prototype,"displayLevelRange",null),e([r()],c.prototype,"layer",void 0),e([r()],c.prototype,"tileInfo",void 0),c=e([a("esri.views.3d.layers.TiledLayerView3D")],c),c};export{o as TiledLayerView3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import has from"../../../core/has.js";import{disposeMaybe as i,abortMaybe as l,destroyMaybe as r}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{whenOnce as o,watch as a,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{SchemaHelper as m}from"../../2d/engine/vectorTiles/SchemaHelper.js";import p from"../../2d/engine/vectorTiles/TileHandler3D.js";import d from"../../2d/engine/vectorTiles/VTLPainter3D.js";import f from"../../2d/engine/vectorTiles/style/StyleRepository.js";import{LayerView3D as y}from"./LayerView3D.js";import{TiledLayerView3D as g}from"./TiledLayerView3D.js";import{vtlAssumes256PixelSizeAsDefault as v,test as u}from"../terrain/terrainUtils.js";import _ from"../../layers/LayerView.js";let C=class extends(g(y(_))){constructor(){super(...arguments),this._tileHandlerController=null,this.type="vector-tile-3d",this.levelShift=has("disable-feature:vtl-level-shift")?0:1,this.contentZoom=has("disable-feature:vtl-level-shift")?1:1.5}initialize(){if(null==this.layer.fullExtent)return void this.addResolvingPromise(Promise.reject(new t("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const{basemapTerrain:e,spatialReference:i,state:l,viewingMode:r}=this.view,h="local"===r&&!v(i)||u.force512VTL,c=this.layer.tileInfo.spatialReference.isGeographic,y=h?this.layer.tileInfo:this.layer.tileInfo.getOrCreateCompatible(256,c?1:2),g=this._getTileInfoSupportError(y,this.layer.fullExtent);if(null!=g)return this.addResolvingPromise(Promise.reject(g));const _=o((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const t=e.tilingScheme,i=t.pixelSize,l=256===i?1:2,r=e.spatialReference?.isGeographic&&256===i?1:0,s=e.spatialReference?.isGeographic||256!==i?0:1;let o;if(this.schemaHelper=new m(l,r,this.levelShift+s),256===i){const e=this.layer.tileInfo.spatialReference.isGeographic;o=this.layer.tileInfo.getOrCreateCompatible(256,e?1:2)}else o=this.view.spatialReference?.isGeographic?this.layer.tileInfo.getOrCreateCompatible(512,.5):this.layer.tileInfo;const a=this._getTileInfoCompatibilityError(o,t);if(a)throw a;this.tileInfo=o}));this._tileHandlerController=new AbortController;const C=this.view.resourceController;this._memCache=C.memoryController.newCache(`vtl-${this.layer.uid}`,(e=>{e.release()})),this.addHandles(a((()=>this.view.qualitySettings.memoryLimit),(e=>this._memCache.maxSize=Math.ceil(e/10*1048576)),n));const S=new f(this.layer.currentStyleInfo.style);this._tileHandler=new p(this.layer,S,l.contentPixelRatio,this._memCache);const w=this._tileHandlerController.signal,R=H(C),j=this._tileHandler.start({signal:w,schedule:R}),x=this._tileHandler.spriteMosaic;x.then((e=>{!s(w)&&this._tileHandler&&(this.painter=new d(e,this._tileHandler.glyphMosaic))})),j.then((()=>this._tileHandlerController=null)),this._updatingHandles.add((()=>({style:this.layer.currentStyleInfo.style,pixelRatio:this.view.state?.contentPixelRatio})),(({style:e,pixelRatio:t})=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const i=new f(e),l=new p(this.layer,i,t,this._memCache),r=l.start({signal:this._tileHandlerController.signal,schedule:R}),s=l.spriteMosaic;r.then((()=>this._tileHandlerController=null)),this._updatingHandles.addPromise(Promise.all([r,s]).then((([,e])=>{const t=this._tileHandler,i=this.painter;this.painter=new d(e,l.glyphMosaic),this._tileHandler=l,this.emit("data-changed"),t.destroy(),i&&i.dispose()})))}));const L=Promise.all([_,j,x]);this.addResolvingPromise(L)}destroy(){this.painter=i(this.painter),this._tileHandlerController=l(this._tileHandlerController),this._tileHandler=r(this._tileHandler),this._memCache=r(this._memCache)}get displayLevelRange(){const e=this.tileInfo.lods,t=this.layer.minScale||e[0].scale,i=this.layer.maxScale||e.
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import has from"../../../core/has.js";import{disposeMaybe as i,abortMaybe as l,destroyMaybe as r}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{whenOnce as o,watch as a,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{SchemaHelper as m}from"../../2d/engine/vectorTiles/SchemaHelper.js";import p from"../../2d/engine/vectorTiles/TileHandler3D.js";import d from"../../2d/engine/vectorTiles/VTLPainter3D.js";import f from"../../2d/engine/vectorTiles/style/StyleRepository.js";import{LayerView3D as y}from"./LayerView3D.js";import{TiledLayerView3D as g}from"./TiledLayerView3D.js";import{vtlAssumes256PixelSizeAsDefault as v,test as u}from"../terrain/terrainUtils.js";import _ from"../../layers/LayerView.js";let C=class extends(g(y(_))){constructor(){super(...arguments),this._tileHandlerController=null,this.type="vector-tile-3d",this.levelShift=has("disable-feature:vtl-level-shift")?0:1,this.contentZoom=has("disable-feature:vtl-level-shift")?1:1.5}initialize(){if(null==this.layer.fullExtent)return void this.addResolvingPromise(Promise.reject(new t("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const{basemapTerrain:e,spatialReference:i,state:l,viewingMode:r}=this.view,h="local"===r&&!v(i)||u.force512VTL,c=this.layer.tileInfo.spatialReference.isGeographic,y=h?this.layer.tileInfo:this.layer.tileInfo.getOrCreateCompatible(256,c?1:2),g=this._getTileInfoSupportError(y,this.layer.fullExtent);if(null!=g)return this.addResolvingPromise(Promise.reject(g));const _=o((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const t=e.tilingScheme,i=t.pixelSize,l=256===i?1:2,r=e.spatialReference?.isGeographic&&256===i?1:0,s=e.spatialReference?.isGeographic||256!==i?0:1;let o;if(this.schemaHelper=new m(l,r,this.levelShift+s),256===i){const e=this.layer.tileInfo.spatialReference.isGeographic;o=this.layer.tileInfo.getOrCreateCompatible(256,e?1:2)}else o=this.view.spatialReference?.isGeographic?this.layer.tileInfo.getOrCreateCompatible(512,.5):this.layer.tileInfo;const a=this._getTileInfoCompatibilityError(o,t);if(a)throw a;this.tileInfo=o}));this._tileHandlerController=new AbortController;const C=this.view.resourceController;this._memCache=C.memoryController.newCache(`vtl-${this.layer.uid}`,(e=>{e.release()})),this.addHandles(a((()=>this.view.qualitySettings.memoryLimit),(e=>this._memCache.maxSize=Math.ceil(e/10*1048576)),n));const S=new f(this.layer.currentStyleInfo.style);this._tileHandler=new p(this.layer,S,l.contentPixelRatio,this._memCache);const w=this._tileHandlerController.signal,R=H(C),j=this._tileHandler.start({signal:w,schedule:R}),x=this._tileHandler.spriteMosaic;x.then((e=>{!s(w)&&this._tileHandler&&(this.painter=new d(e,this._tileHandler.glyphMosaic))})),j.then((()=>this._tileHandlerController=null)),this._updatingHandles.add((()=>({style:this.layer.currentStyleInfo.style,pixelRatio:this.view.state?.contentPixelRatio})),(({style:e,pixelRatio:t})=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const i=new f(e),l=new p(this.layer,i,t,this._memCache),r=l.start({signal:this._tileHandlerController.signal,schedule:R}),s=l.spriteMosaic;r.then((()=>this._tileHandlerController=null)),this._updatingHandles.addPromise(Promise.all([r,s]).then((([,e])=>{const t=this._tileHandler,i=this.painter;this.painter=new d(e,l.glyphMosaic),this._tileHandler=l,this.emit("data-changed"),t.destroy(),i&&i.dispose()})))}));const L=Promise.all([_,j,x]);this.addResolvingPromise(L)}destroy(){this.painter=i(this.painter),this._tileHandlerController=l(this._tileHandlerController),this._tileHandler=r(this._tileHandler),this._memCache=r(this._memCache)}get displayLevelRange(){const e=this.tileInfo.lods,t=this.layer.minScale||e[0].scale,i=this.layer.maxScale||e[e.length-1].scale,l=this.levelRangeFromScaleRange(t,i);return this.layer.maxScale?l.maxLevel++:l.maxLevel+=this.levelShift,l}get dataScaleRange(){const e=this.tileInfo.lods;return{minScale:e[0].scale,maxScale:e[e.length-1].scale}}get dataLevelRange(){const{minScale:e,maxScale:t}=this.dataScaleRange,i=this.levelRangeFromScaleRange(e,t);return 1===i.minLevel&&256===this.tileInfo.size[0]&&(i.minLevel=0),i.maxLevel+=this.levelShift,i}async fetchTile(e,t,i,l){return this._tileHandler.getVectorTile(e,t,i,l)}};e([h()],C.prototype,"layer",void 0),e([h()],C.prototype,"levelShift",void 0),e([h()],C.prototype,"contentZoom",void 0),e([h()],C.prototype,"displayLevelRange",null),e([h()],C.prototype,"tileInfo",void 0),e([h()],C.prototype,"dataScaleRange",null),e([h()],C.prototype,"dataLevelRange",null),e([h()],C.prototype,"updatingProgressValue",void 0),C=e([c("esri.views.3d.layers.VectorTileLayerView3D")],C);const S=C;function H(e){return t=>e.immediate.schedule(t)}export{S as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{lerp as s}from"../../../../core/mathUtils.js";import e from"../../../../core/PooledArray.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{p as a}from"../../../../chunks/mat4.js";import{c}from"../../../../chunks/mat4f64.js";import{a as n}from"../../../../chunks/vec2f64.js";import{m as l,g as h,s as p,c as u}from"../../../../chunks/vec3.js";import{Z as d,c as f}from"../../../../chunks/vec3f64.js";import{s as _,t as m,b as g}from"../../../../chunks/vec4.js";import{c as b}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as v}from"../../../../geometry/ellipsoidUtils.js";import{create as y,empty as G,offset as S,width as B,height as D,expand as w,intersects as N}from"../../../../geometry/support/aaBoundingRect.js";import{a as j,c as I,e as V}from"../../../../chunks/boundedPlane.js";import{create as C}from"../../../../geometry/support/ray.js";import{d as P,g as A,i as O,c as M}from"../../../../chunks/sphere.js";import{drawAccelerationStruct as x,prepare as z,drawPoly as E}from"./deconflictorDebug.js";import{VisibilityGroup as T,VisibilityFlag as X}from"./enums.js";import{Camera as F}from"../../webgl-engine/lib/Camera.js";import{applyPrecomputedScaleFactor as L}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as Y}from"../../webgl-engine/lib/VertexAttribute.js";import{HUDMaterial as k}from"../../webgl-engine/materials/HUDMaterial.js";import{ScaleInfo as R}from"../../webgl-engine/materials/ScaleInfo.js";const U=f(),W=b(),H=b(),Z=f(),q=c(),J=M(),K=C(),Q=f(),$=y();class ii{constructor(){this.aabr=y(),this.distance=0,this.culled=!1,this.visible=!1}}class ti{constructor(i,t){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this.info={}}}var si;!function(i){i[i.Idle=0]="Idle",i[i.Process=1]="Process",i[i.Sort=2]="Sort",i[i.Deconflict=3]="Deconflict",i[i.NumStates=4]="NumStates"}(si||(si={}));class ei{constructor(){this.camera=new F,this.slicePlane=j(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.copyFrom(i.camera),I(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let ri=class extends t{get dirty(){return this._dirty}get state(){return this._state}constructor(i){super(i),this._dirty=!1,this._runningViewState=new ei,this._state=si.Idle,this._active=new Map,this._visible=new Map,this._iterators=new li,this._accBinsNumX=15,this._accBinsNumY=20,this._accBinsSizeX=0,this._accBinsSizeY=0,this._accBins=null,this.accNumTests=0}destroy(){this._active.clear(),this._visible.clear(),this._iterators=null}setDirty(){!this._dirty&&this._active.size>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._state!==si.Idle||this._dirty}get updatingProgress(){if(!this.updating)return 1;const i=this._state/si.NumStates;return this._dirty?.5*i:i}get running(){return this.view.ready&&null!=this.view.state&&this.updating}runTask(i){switch(this._state){case si.Idle:this._startUpdate(),i.madeProgress();case si.Process:if(this._state=si.Process,!this._processActiveGraphics(i))return;case si.Sort:if(this._state=si.Sort,!this._sortVisibleGraphics(i))return;case si.Deconflict:if(this._state=si.Deconflict,!this._deconflictVisibleGraphics(i))return;default:x(this,this._visible),this._state=si.Idle,this.notifyChange("updating")}}modifyGraphics(i,t){t?i.forEach((i=>this.addToActiveGraphics(i))):i.forEach((i=>this.removeFromActiveGraphics(i))),this.setDirty()}layerSupportsDeconfliction(i){if(null==i||"object3d"!==i.type)return!1;const t=i.stageObject;if(1!==(t?t.geometries.length:0))return!1;const s=t?.geometries[0],e=s?.material;return e instanceof k}_startUpdate(){z(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._runningViewState.camera;this._initBins(i,t),this._resetIterators()}addToActiveGraphics(i){i.info[this.visibilityGroup]=new ii,this._active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){this._visible.delete(i.graphics3DGraphic.graphic.uid),oi(i,this.visibilityGroup),delete i.info[this.visibilityGroup],this._active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}_processActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),s=a(q,this._runningViewState.camera.projectionMatrix),e="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&this._runningViewState.camera.relativeElevation>0?J:null;let r=0;for(null!=e&&(l(e,d,this._runningViewState.camera.viewMatrix),e[3]=v(this.view.spatialReference).radius,r=P(e,d));!i.done;){i.madeProgress();const o=t.next();if(!0===o.done)return this._resetActiveGraphicsIterator(),!0;const a=o.value,c=a&&a.info[this.visibilityGroup];c&&(this._collectGraphics3DGraphics(a,s,e,r),c.culled?this._visible.delete(a.graphics3DGraphic.graphic.uid):this._visible.set(a.graphics3DGraphic.graphic.uid,a))}return!1}_sortVisibleGraphics(i){const t=this._ensureSortGraphicsIterator();for(;!i.done;){const s=t.next();if(i.madeProgress(),!0===s.done)return this._resetSortGraphicsIterator(),!0}return!1}_deconflictVisibleGraphics(i){const t=this._ensureVisibleGraphicsIterator(),s=this.visibilityGroup===T.LABEL;for(;!i.done;){i.madeProgress();const e=t.next();if(!0===e.done)return this._resetVisibleGraphicsIterator(),!0;const r=e.value,o=r.info[this.visibilityGroup];if(!o||o.culled)continue;const a=r.graphics3DGraphic,c=!s||a.isVisible();o.visible=c&&!this._isConflicted(r),o.visible&&this._addToBins(r),this._setGraphicVisibility(r,o.visible),E(o,o.visible)}return!1}_resetIterators(){this._iterators.active=null,this._iterators.visible=null,this._iterators.sort=null}_ensureActiveGraphicsIterator(){return this._iterators.active||(this._iterators.active=ai(this._active)),this._iterators.active}_resetActiveGraphicsIterator(){this._iterators.active=null}_ensureVisibleGraphicsIterator(){return this._iterators.visible||(this._iterators.visible=ai(this._visible)),this._iterators.visible}_resetVisibleGraphicsIterator(){this._iterators.visible=null}_ensureSortGraphicsIterator(){return this._iterators.sort||(this._iterators.sort=ci(this._visible,this._iterators.sortArray,this.visibilityGroup)),this._iterators.sort}_resetSortGraphicsIterator(){this._iterators.sort=null}_collectGraphics3DGraphics(i,t,s,e){const r=i.graphics3DGraphic;if(r.destroyed)return;const o=i.info[this.visibilityGroup];if(!r.isVisible(T.GRAPHIC,X.DECONFLICTION))return void(o.culled=!0);const a=this.getGraphicsLayers(r);G(o.aabr);let c=null;for(const n of a){if(!this.layerSupportsDeconfliction(n))continue;const r=n.stageObject.geometries[0].material;if(null==c&&(c=ui,this._getProjectionInfo(n,t,c),c.isOutsideScreen||this._isCulledBySlice(i,U)||null!=s&&this._isCulledByHorizon(c,s,e)))return void(o.culled=!0);this._expandBoundingRect(o,n,r,c)}null==c?o.culled=!0:(o.distance=c.distance,o.culled=!1)}_getProjectionInfo(i,t,s){const e=this._runningViewState.camera,r=i.stageObject,o=r.geometries[0],a=o.material,c=A(r.boundingVolumeWorldSpace.bounds);l(U,c,e.viewMatrix);const n=o.vertexAttributes,u=n.get(Y.NORMAL).data,d=n.get(Y.AUXPOS1).data;a.applyShaderOffsetsView(U,u,r.transformation,d,e,s.scaleInfo,U),_(W,U[0],U[1],U[2],1),m(H,W,e.projectionMatrix),h(s.positionNDC,H,1/H[3]),a.applyShaderOffsetsNDC(s.positionNDC,d,e,s.positionNDC,Z),s.distanceWithoutPolygonOffset=e.depthNDCToWorld(Z[2]),s.distance=Z[2]===s.positionNDC[2]?s.distanceWithoutPolygonOffset:e.depthNDCToWorld(s.positionNDC[2]),_(H,s.positionNDC[0],s.positionNDC[1],s.positionNDC[2],1),m(W,H,t),g(W,W,1/W[3]),p(s.positionView,U[0],U[1],U[2])}_isCulledByHorizon(i,t,s){return u(K.direction,i.positionView),p(K.origin,0,0,0),!!O(t,K,Q)&&i.distanceWithoutPolygonOffset>s}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&V(this._runningViewState.slicePlane,t)}_expandBoundingRect(i,t,e,{positionNDC:r,scaleInfo:o}){const a=this._runningViewState.camera,c=t.getScreenSize(hi);L(c,o.factor,c),c[0]*=a.pixelRatio,c[1]*=a.pixelRatio;const n=S(e.calculateRelativeScreenBounds(c,o.factorAlignment.scale,$),s(0,a.fullWidth,.5+.5*r[0]),s(0,a.fullHeight,.5+.5*r[1])),l=this.iconMarginFactor;if(0!==l){const i=l*Math.min(B(n),D(n));n[0]-=i,n[1]-=i,n[2]+=i,n[3]+=i}w(i.aabr,n,i.aabr)}_isConflicted(i){const t=i.graphics3DGraphic.graphic.uid,s=i.info[this.visibilityGroup];for(let e=Math.floor(s.aabr[0]/this._accBinsSizeX);e<=Math.floor(s.aabr[2]/this._accBinsSizeX);e++)if(!(e<0||e>=this._accBinsNumX))for(let i=Math.floor(s.aabr[1]/this._accBinsSizeY);i<=Math.floor(s.aabr[3]/this._accBinsSizeY);i++){if(i<0||i>=this._accBinsNumY)continue;const r=this._accBins[e][i];for(let i=0;i<r.length;i++){const e=r.data[i],o=e.info[this.visibilityGroup];if(o&&o.visible&&e.graphics3DGraphic.graphic.uid!==t&&(this.accNumTests++,N(o.aabr,s.aabr)))return!0}}return!1}_initBins(i,t){if(null==this._accBins){this._accBins=[];for(let i=0;i<this._accBinsNumX;i++){this._accBins.push([]);const i=this._accBins.at(-1);for(let t=0;t<this._accBinsNumY;t++)i.push(new e)}}else for(let s=0;s<this._accBinsNumX;s++)for(let i=0;i<this._accBinsNumY;i++)this._accBins[s][i].clear();this._accBinsSizeX=i/this._accBinsNumX,this._accBinsSizeY=t/this._accBinsNumY,this.accNumTests=0}_addToBins(i){const t=i.info[this.visibilityGroup],s=Math.floor(t.aabr[0]/this._accBinsSizeX),e=Math.floor(t.aabr[2]/this._accBinsSizeX),r=Math.floor(t.aabr[1]/this._accBinsSizeY),o=Math.floor(t.aabr[3]/this._accBinsSizeY);for(let a=s;a<=e;a++)if(!(a<0||a>=this._accBinsNumX))for(let t=r;t<=o;t++)t<0||t>=this._accBinsNumY||this._accBins[a][t].push(i)}_setGraphicVisibility(i,t){const s=i.graphics3DGraphic;s.destroyed||(s.setVisibilityFlag(this.visibilityGroup,X.DECONFLICTION,t),this.visibilityGroup===T.LABEL&&this.view.labeler.setLabelGraphicVisibility(s,t))}};function oi(i,t){const s=i.graphics3DGraphic;s.destroyed||s.setVisibilityFlag(t,X.DECONFLICTION,!0)}function*ai(i){if(Map.prototype.entries){const t=i.entries();for(let i=t.next();!i.done;i=t.next())yield i.value[1]}else yield*i.values()}function*ci(i,t,s){t.clear(),i.forEach(((i,e)=>{const r=t.pushNew();r.id=e,r.visible=i.graphics3DGraphic.getVisibilityFlag(s,X.DECONFLICTION);const o=i.info&&i.info[s];r.prio=i.graphics3DGraphic.deconflictionPriority,r.distance=o?o.distance:Number.MAX_VALUE})),yield;const e=t.iterableSort(((i,t)=>i.prio!==t.prio?t.prio-i.prio:i.distance!==t.distance?i.distance-t.distance:i.visible!==t.visible?i.visible?-1:1:i.id-t.id));for(let r=e.next();!r.done;r=e.next())yield;t.forAll((t=>{const s=i.get(t.id);s&&(i.delete(t.id),i.set(t.id,s))})),t.clear()}i([r({constructOnly:!0})],ri.prototype,"view",void 0),i([r({type:Boolean,readOnly:!0})],ri.prototype,"updating",null),ri=i([o("esri.views.3d.layers.graphics.Deconflictor")],ri);class ni{constructor(){this.id=0,this.visible=!1,this.prio=0,this.distance=0}}class li{constructor(i=null,t=null,s=null){this.active=i,this.visible=t,this.sort=s,this.sortArray=new e({allocator:i=>i||new ni})}}const hi=n();class pi{constructor(){this.positionView=f(),this.positionNDC=f(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo=new R}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1}}const ui=new pi;export{ri as Deconflictor,ti as DeconflictorGraphic,ei as DeconflictorViewState,si as State};
|
|
5
|
+
import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{lerp as s}from"../../../../core/mathUtils.js";import e from"../../../../core/PooledArray.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{p as a}from"../../../../chunks/mat4.js";import{c}from"../../../../chunks/mat4f64.js";import{a as n}from"../../../../chunks/vec2f64.js";import{m as l,g as h,s as p,c as u}from"../../../../chunks/vec3.js";import{Z as d,c as f}from"../../../../chunks/vec3f64.js";import{s as _,t as m,b as g}from"../../../../chunks/vec4.js";import{c as b}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as v}from"../../../../geometry/ellipsoidUtils.js";import{create as y,empty as G,offset as S,width as B,height as D,expand as w,intersects as N}from"../../../../geometry/support/aaBoundingRect.js";import{a as j,c as I,e as V}from"../../../../chunks/boundedPlane.js";import{create as C}from"../../../../geometry/support/ray.js";import{d as P,g as A,i as O,c as M}from"../../../../chunks/sphere.js";import{drawAccelerationStruct as x,prepare as z,drawPoly as E}from"./deconflictorDebug.js";import{VisibilityGroup as T,VisibilityFlag as X}from"./enums.js";import{Camera as F}from"../../webgl-engine/lib/Camera.js";import{applyPrecomputedScaleFactor as L}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as Y}from"../../webgl-engine/lib/VertexAttribute.js";import{HUDMaterial as k}from"../../webgl-engine/materials/HUDMaterial.js";import{ScaleInfo as R}from"../../webgl-engine/materials/ScaleInfo.js";const U=f(),W=b(),H=b(),Z=f(),q=c(),J=M(),K=C(),Q=f(),$=y();class ii{constructor(){this.aabr=y(),this.distance=0,this.culled=!1,this.visible=!1}}class ti{constructor(i,t){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this.info={}}}var si;!function(i){i[i.Idle=0]="Idle",i[i.Process=1]="Process",i[i.Sort=2]="Sort",i[i.Deconflict=3]="Deconflict",i[i.NumStates=4]="NumStates"}(si||(si={}));class ei{constructor(){this.camera=new F,this.slicePlane=j(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.copyFrom(i.camera),I(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let ri=class extends t{get dirty(){return this._dirty}get state(){return this._state}constructor(i){super(i),this._dirty=!1,this._runningViewState=new ei,this._state=si.Idle,this._active=new Map,this._visible=new Map,this._iterators=new li,this._accBinsNumX=15,this._accBinsNumY=20,this._accBinsSizeX=0,this._accBinsSizeY=0,this._accBins=null,this.accNumTests=0}destroy(){this._active.clear(),this._visible.clear(),this._iterators=null}setDirty(){!this._dirty&&this._active.size>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._state!==si.Idle||this._dirty}get updatingProgress(){if(!this.updating)return 1;const i=this._state/si.NumStates;return this._dirty?.5*i:i}get running(){return this.view.ready&&null!=this.view.state&&this.updating}runTask(i){switch(this._state){case si.Idle:this._startUpdate(),i.madeProgress();case si.Process:if(this._state=si.Process,!this._processActiveGraphics(i))return;case si.Sort:if(this._state=si.Sort,!this._sortVisibleGraphics(i))return;case si.Deconflict:if(this._state=si.Deconflict,!this._deconflictVisibleGraphics(i))return;default:x(this,this._visible),this._state=si.Idle,this.notifyChange("updating")}}modifyGraphics(i,t){t?i.forEach((i=>this.addToActiveGraphics(i))):i.forEach((i=>this.removeFromActiveGraphics(i))),this.setDirty()}layerSupportsDeconfliction(i){if(null==i||"object3d"!==i.type)return!1;const t=i.stageObject;if(1!==(t?t.geometries.length:0))return!1;const s=t?.geometries[0],e=s?.material;return e instanceof k}_startUpdate(){z(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._runningViewState.camera;this._initBins(i,t),this._resetIterators()}addToActiveGraphics(i){i.info[this.visibilityGroup]=new ii,this._active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){this._visible.delete(i.graphics3DGraphic.graphic.uid),oi(i,this.visibilityGroup),delete i.info[this.visibilityGroup],this._active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}_processActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),s=a(q,this._runningViewState.camera.projectionMatrix),e="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&this._runningViewState.camera.relativeElevation>0?J:null;let r=0;for(null!=e&&(l(e,d,this._runningViewState.camera.viewMatrix),e[3]=v(this.view.spatialReference).radius,r=P(e,d));!i.done;){i.madeProgress();const o=t.next();if(!0===o.done)return this._resetActiveGraphicsIterator(),!0;const a=o.value,c=a&&a.info[this.visibilityGroup];c&&(this._collectGraphics3DGraphics(a,s,e,r),c.culled?this._visible.delete(a.graphics3DGraphic.graphic.uid):this._visible.set(a.graphics3DGraphic.graphic.uid,a))}return!1}_sortVisibleGraphics(i){const t=this._ensureSortGraphicsIterator();for(;!i.done;){const s=t.next();if(i.madeProgress(),!0===s.done)return this._resetSortGraphicsIterator(),!0}return!1}_deconflictVisibleGraphics(i){const t=this._ensureVisibleGraphicsIterator(),s=this.visibilityGroup===T.LABEL;for(;!i.done;){i.madeProgress();const e=t.next();if(!0===e.done)return this._resetVisibleGraphicsIterator(),!0;const r=e.value,o=r.info[this.visibilityGroup];if(!o||o.culled)continue;const a=r.graphics3DGraphic,c=!s||a.isVisible();o.visible=c&&!this._isConflicted(r),o.visible&&this._addToBins(r),this._setGraphicVisibility(r,o.visible),E(o,o.visible)}return!1}_resetIterators(){this._iterators.active=null,this._iterators.visible=null,this._iterators.sort=null}_ensureActiveGraphicsIterator(){return this._iterators.active||(this._iterators.active=ai(this._active)),this._iterators.active}_resetActiveGraphicsIterator(){this._iterators.active=null}_ensureVisibleGraphicsIterator(){return this._iterators.visible||(this._iterators.visible=ai(this._visible)),this._iterators.visible}_resetVisibleGraphicsIterator(){this._iterators.visible=null}_ensureSortGraphicsIterator(){return this._iterators.sort||(this._iterators.sort=ci(this._visible,this._iterators.sortArray,this.visibilityGroup)),this._iterators.sort}_resetSortGraphicsIterator(){this._iterators.sort=null}_collectGraphics3DGraphics(i,t,s,e){const r=i.graphics3DGraphic;if(r.destroyed)return;const o=i.info[this.visibilityGroup];if(!r.isVisible(T.GRAPHIC,X.DECONFLICTION))return void(o.culled=!0);const a=this.getGraphicsLayers(r);G(o.aabr);let c=null;for(const n of a){if(!this.layerSupportsDeconfliction(n))continue;const r=n.stageObject.geometries[0].material;if(null==c&&(c=ui,this._getProjectionInfo(n,t,c),c.isOutsideScreen||this._isCulledBySlice(i,U)||null!=s&&this._isCulledByHorizon(c,s,e)))return void(o.culled=!0);this._expandBoundingRect(o,n,r,c)}null==c?o.culled=!0:(o.distance=c.distance,o.culled=!1)}_getProjectionInfo(i,t,s){const e=this._runningViewState.camera,r=i.stageObject,o=r.geometries[0],a=o.material,c=A(r.boundingVolumeWorldSpace.bounds);l(U,c,e.viewMatrix);const n=o.vertexAttributes,u=n.get(Y.NORMAL).data,d=n.get(Y.AUXPOS1).data;a.applyShaderOffsetsView(U,u,r.transformation,d,e,s.scaleInfo,U),_(W,U[0],U[1],U[2],1),m(H,W,e.projectionMatrix),h(s.positionNDC,H,1/H[3]),a.applyShaderOffsetsNDC(s.positionNDC,d,e,s.positionNDC,Z),s.distanceWithoutPolygonOffset=e.depthNDCToWorld(Z[2]),s.distance=Z[2]===s.positionNDC[2]?s.distanceWithoutPolygonOffset:e.depthNDCToWorld(s.positionNDC[2]),_(H,s.positionNDC[0],s.positionNDC[1],s.positionNDC[2],1),m(W,H,t),g(W,W,1/W[3]),p(s.positionView,U[0],U[1],U[2])}_isCulledByHorizon(i,t,s){return u(K.direction,i.positionView),p(K.origin,0,0,0),!!O(t,K,Q)&&i.distanceWithoutPolygonOffset>s}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&V(this._runningViewState.slicePlane,t)}_expandBoundingRect(i,t,e,{positionNDC:r,scaleInfo:o}){const a=this._runningViewState.camera,c=t.getScreenSize(hi);L(c,o.factor,c),c[0]*=a.pixelRatio,c[1]*=a.pixelRatio;const n=S(e.calculateRelativeScreenBounds(c,o.factorAlignment.scale,$),s(0,a.fullWidth,.5+.5*r[0]),s(0,a.fullHeight,.5+.5*r[1])),l=this.iconMarginFactor;if(0!==l){const i=l*Math.min(B(n),D(n));n[0]-=i,n[1]-=i,n[2]+=i,n[3]+=i}w(i.aabr,n,i.aabr)}_isConflicted(i){const t=i.graphics3DGraphic.graphic.uid,s=i.info[this.visibilityGroup];for(let e=Math.floor(s.aabr[0]/this._accBinsSizeX);e<=Math.floor(s.aabr[2]/this._accBinsSizeX);e++)if(!(e<0||e>=this._accBinsNumX))for(let i=Math.floor(s.aabr[1]/this._accBinsSizeY);i<=Math.floor(s.aabr[3]/this._accBinsSizeY);i++){if(i<0||i>=this._accBinsNumY)continue;const r=this._accBins[e][i];for(let i=0;i<r.length;i++){const e=r.data[i],o=e.info[this.visibilityGroup];if(o&&o.visible&&e.graphics3DGraphic.graphic.uid!==t&&(this.accNumTests++,N(o.aabr,s.aabr)))return!0}}return!1}_initBins(i,t){if(null==this._accBins){this._accBins=[];for(let i=0;i<this._accBinsNumX;i++){this._accBins.push([]);const i=this._accBins[this._accBins.length-1];for(let t=0;t<this._accBinsNumY;t++)i.push(new e)}}else for(let s=0;s<this._accBinsNumX;s++)for(let i=0;i<this._accBinsNumY;i++)this._accBins[s][i].clear();this._accBinsSizeX=i/this._accBinsNumX,this._accBinsSizeY=t/this._accBinsNumY,this.accNumTests=0}_addToBins(i){const t=i.info[this.visibilityGroup],s=Math.floor(t.aabr[0]/this._accBinsSizeX),e=Math.floor(t.aabr[2]/this._accBinsSizeX),r=Math.floor(t.aabr[1]/this._accBinsSizeY),o=Math.floor(t.aabr[3]/this._accBinsSizeY);for(let a=s;a<=e;a++)if(!(a<0||a>=this._accBinsNumX))for(let t=r;t<=o;t++)t<0||t>=this._accBinsNumY||this._accBins[a][t].push(i)}_setGraphicVisibility(i,t){const s=i.graphics3DGraphic;s.destroyed||(s.setVisibilityFlag(this.visibilityGroup,X.DECONFLICTION,t),this.visibilityGroup===T.LABEL&&this.view.labeler.setLabelGraphicVisibility(s,t))}};function oi(i,t){const s=i.graphics3DGraphic;s.destroyed||s.setVisibilityFlag(t,X.DECONFLICTION,!0)}function*ai(i){if(Map.prototype.entries){const t=i.entries();for(let i=t.next();!i.done;i=t.next())yield i.value[1]}else yield*i.values()}function*ci(i,t,s){t.clear(),i.forEach(((i,e)=>{const r=t.pushNew();r.id=e,r.visible=i.graphics3DGraphic.getVisibilityFlag(s,X.DECONFLICTION);const o=i.info&&i.info[s];r.prio=i.graphics3DGraphic.deconflictionPriority,r.distance=o?o.distance:Number.MAX_VALUE})),yield;const e=t.iterableSort(((i,t)=>i.prio!==t.prio?t.prio-i.prio:i.distance!==t.distance?i.distance-t.distance:i.visible!==t.visible?i.visible?-1:1:i.id-t.id));for(let r=e.next();!r.done;r=e.next())yield;t.forAll((t=>{const s=i.get(t.id);s&&(i.delete(t.id),i.set(t.id,s))})),t.clear()}i([r({constructOnly:!0})],ri.prototype,"view",void 0),i([r({type:Boolean,readOnly:!0})],ri.prototype,"updating",null),ri=i([o("esri.views.3d.layers.graphics.Deconflictor")],ri);class ni{constructor(){this.id=0,this.visible=!1,this.prio=0,this.distance=0}}class li{constructor(i=null,t=null,s=null){this.active=i,this.visible=t,this.sort=s,this.sortArray=new e({allocator:i=>i||new ni})}}const hi=n();class pi{constructor(){this.positionView=f(),this.positionNDC=f(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo=new R}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1}}const ui=new pi;export{ri as Deconflictor,ti as DeconflictorGraphic,ei as DeconflictorViewState,si as State};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Logger.js";import{someMap as i}from"../../../../core/MapUtils.js";import{isAbortError as r,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{on as n}from"../../../../core/reactiveUtils.js";import{schedule as o}from"../../../../core/scheduling.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as h,equals as c,clone as d,expand as p,toExtent as f}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as m,hasVertices as _}from"../../../../layers/graphics/dehydratedFeatures.js";import g from"../../../../rest/support/QuantizationParameters.js";import F from"../../../../rest/support/Query.js";import{ViewingMode as y}from"../../../ViewingMode.js";import{MultiFeatureReference as T,SingleFeatureReference as x}from"./featureReference.js";import{FAILED_FEATURE_COUNT as E,FetchStatus as C,FeatureTile as R}from"./FeatureTile.js";import{tilesAreRelated as b}from"../../terrain/tileUtils.js";import{ImmediateTask as v,TaskPriority as M}from"../../../support/Scheduler.js";const w="esri.views.3d.layers.support.FeatureTileFetcher3D",D=s.getLogger(w);let O=class extends t{set maximumNumberOfFeatures(e){e=e||1/0;const t=this._get("maximumNumberOfFeatures");e===t||e<1||(this._set("maximumNumberOfFeatures",e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set("memoryFactor",e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set("lodFactor",e),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&null!=this.context.query.queryFeatureCount}set useTileCount(e){this._useTileCount=e,this.notifyChange("useTileCount")}get memoryForUnusedFeatures(){let e=0;return this._featureTiles.forEach((t=>e+=t.estimatedUnusedSize)),e}get totalVertices(){let e=0;return this._featureTiles.forEach((t=>e+=t.numVertices)),e}get totalFeatures(){let e=0;return this._featureTiles.forEach((t=>e+=t.numFeatures)),e}set filterExtent(e){if(null!=e&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void D.error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||null!=t&&e&&t.equals(e))return;const s=null!=e?e.clone():null;this._set("filterExtent",s),this._reclip(s,t)}constructor(e){super(e),this._useTileCount=!1,this.updating=!1,this.running=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this.maximumNumberOfFeaturesExceededThrottle=1e3,this._fullRatio=1,this._farRatio=1,this._changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this._frameTask=v,this._dirty=!1,this._featureTiles=new Map,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._suspended=!0,this._pendingEdits=null}initialize(){this.addHandles(n((()=>this.tileDescriptors),"change",(()=>this._setDirty()),{onListenerAdd:()=>this._setDirty()})),this._objectIdField=this.context.objectIdField,this.FeatureReferenceClass=this.context.capabilities.supportsMultipleResolutions?T:x;const e=this.context.scheduler;null!=e&&(this._frameTask=e.registerTask(M.FEATURE_TILE_FETCHER,this)),this._setDirty()}destroy(){this._frameTask.remove(),this._featureTiles.forEach((e=>{this._cancelFetchTile(e),this._removeTile(e)})),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),this._pendingEdits?.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach((e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)})),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach((e=>{this._cancelFetchTile(e),this._resetFetchTile(e)})),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}_pause(){this._paused&&(this._featureTiles.forEach((e=>this._cancelFetchTile(e))),this._updated())}_unpause(){this._paused||(this._setDirty(),this._updated())}get availableFields(){let e=null;return this._featureTiles.forEach((t=>{null!=t.displayingFeatures&&0!==t.displayingFeatures.length&&(null==e?e=new Set(t.availableFields):e.forEach((s=>{t.availableFields.has(s)||e.delete(s)})))})),null!=e?e:new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this._pendingEdits;t.count++;const s=t.edits.then((()=>e.result.catch((e=>{if(r(e))throw e;return null})).then((e=>e?(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then((()=>e))):e)).then((e=>(0==--t.count&&(this._pendingEdits===t&&(this._pendingEdits=null),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._unpause(),this._updated()),e)))));return t.edits=s,this._updated(),s}_applyEditsDeleteFeatures(e){if(0===e.length)return;const t=this.context.globalIdField,s=t&&this.availableFields.has(t),i=new Set,r=this._objectIdField;e.forEach((({objectId:e,globalId:a})=>{if((!e||e<0)&&t){s||D.errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`);const e=this.features.find((e=>e.attributes&&e.attributes[t]===a));e&&i.add(m(e,r))}else i.add(e)})),this._featureTiles.forEach((e=>{if(!e.features)return;const t=e.features.filter((e=>!i.has(m(e,this._objectIdField))));t.length!==e.features.length&&(e.setFeatures(t,0,e.availableFields),this._invalidateCounts())}))}async _applyEditsAddUpdateFeatures(e,t,s){const i=[],r=new Set;if(e.forEach((e=>i.push(e.objectId))),t.forEach((e=>{i.push(e.objectId),r.add(e.objectId)})),0===i.length)return;const a=[];this._featureTiles.forEach((e=>{const t=this._applyEditsAddUpdateTile(e,i,r,s);t&&a.push(t)})),await Promise.allSettled(a)}async _applyEditsAddUpdateTile(e,t,s,i){if(!e.features)return;const r=this._createQuery(e);r.resultType=void 0,r.cacheHint=!1,r.objectIds=t;const a=await this._queryFeatures(r,i);let n=null;if(s.size>0){const t=e.features.filter((e=>!s.has(m(e,this._objectIdField))));t.length!==e.features.length&&(n=t)}if(a.features.length>0){n||(n=e.features.slice());for(const e of a.features)n.push(e)}n&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,n.length)),e.setFeatures(n,0,q(e.availableFields,a.fields)),this._invalidateCounts())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:Q})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){if(this._frameTask.processQueue(e),!this._dirty||!this.initialized)return;this._dirty=!1;const t=this._getListOfTiles();if(this._markTilesNotAlive(t),!e.run((()=>this._addTiles(t,e)))||!e.run((()=>this._filterExtentTiles(t,e)))||!e.run((()=>this._removeTiles(t,e)))||e.done)return void this._setDirty();const s=this._sortTiles(t);e.run((()=>this._showTiles(s,e)))&&e.run((()=>this._fetchTiles(s,e)))&&e.run((()=>this._updateMemoryEstimates(s,e)))||this._setDirty(),this._updated(),this.updating||this._updateMaximumNumberOfFeaturesExceeded()}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!this._suspended&&(this.tileDescriptors.forEach((s=>{const i=this._featureTiles.get(s.id);i?i.alive=!0:t.done||(e.push(this._addTile(s)),t.madeProgress())})),t.hasProgressed)}_filterExtentTiles(e,t){for(const s of e){if(t.done)break;s.alive&&(s.filtered=!s.intersects(this.filterExtent),s.filtered&&(this._clearTile(s),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let s=e.length-1;s>=0&&!t.done;s--){const i=e[s];i.alive||(this._removeTile(i),s!==e.length-1&&(e[s]=e.at(-1)),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort(((e,t)=>(e.descriptor.loadPriority??0)-(t.descriptor.loadPriority??0))),e}_showTiles(e,t){const s=this._updateRatio(e),i=e=>{const t=this._fullRatio<1?s(e)*this._farRatio:1;return e.reduceFeatures(t,this.memoryFactor,this._objectIdField)&&this._setDirty(),this._showTile(e)};for(const r of e)if(!t.run((()=>i(r)))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let s=!1;for(const i of e){if(!i.needsFetching)continue;const e=null!=this.context.memoryCache?this.context.memoryCache.pop(i.id):null;if(null==e){if(this._needsNumFeatures(i)){const e=new AbortController,r=this._fetchTileCount(i,e.signal);this._handleRequest(i,r,e,(()=>i.numFeatures=E)),s=!0,t.madeProgress()}if(t.done)return!0}else i.cache=e,this._setDirty(),this._scheduleUpdated(),t.madeProgress()}if(s)return t.hasProgressed;for(const i of e)if(i.needsFetching){const e=new AbortController,s=this._fetchTile(i,e.signal);if(this._handleRequest(i,s,e,(e=>{i.setFeatures([],0,null),this._invalidateCounts(),i.featuresMissing=!1,this.context.logFetchError(D,e)})),t.madeProgress())return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some((e=>!t.run((()=>e.updateMemoryEstimates()))&&(this._setDirty(),!0))),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;const s=new Array;this._featureTiles.forEach((i=>{null!=i.displayingFeatures&&0!==i.displayingFeatures.length&&(i.intersectionIncludingBorrowed(t,L),i.intersectionIncludingBorrowed(e,H),c(L,H)||s.push(i))})),this._refreshDisplayingFeatures(s),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,s=this._changes.updates;for(const i of e)if(null!=i.displayingFeatures)for(const e of i.displayingFeatures){const i=m(e,this._objectIdField);if(t.has(i))continue;t.add(i);const r=this._displayingFeatureReferences.get(i).feature;s.removes.push(r),s.adds.push(r)}this._applyChanges()}_updated(){let e=0;this._paused||this._featureTiles.forEach((t=>t.isFetching?++e:0));const t=this._dirty||!!this._pendingEdits||e>0;if(this._set("running",this._dirty),this._set("updating",t),t){let t=0,s=0,i=0,r=0,a=0;const n=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach((e=>{if(++s,e.isFetching&&e.hasPreciseFeatureCount){const t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),s=null!=e.displayingFeatures?e.displayingFeatures.length*n:0;a+=t-s}e.needsFetching?++r:e.numFeatures>0&&(++i,t+=e.numFeatures)})),r+=e;let o=0,u=0;t?(u=t,o=Math.min(r*t/i,t)):(u=s,o=r),a=Math.min(this.maximumNumberOfFeatures-this.features.length,a),this._set("updatingTotal",u),this._set("updatingRemaining",o),this._set("expectedFeatureDiff",a)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger&&this.debugger.update()}_updateMaximumNumberOfFeaturesExceeded(){const e=i(this._featureTiles,(e=>e.perTileMaximumNumberOfFeaturesExceeded));this._set("maximumNumberOfFeaturesExceeded",e)}_updateRatio(e){const t=P(e),s=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0]));let i=0,r=0;for(const a of e){const e=a.numFeatures;i+=e,r+=e*s(a)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/i),this._farRatio=this.maximumNumberOfFeatures/r,this._scheduleUpdated(),s}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this._featureTiles.forEach((e=>{if(!e.featuresMissing)return;const t=this._maximumFeaturesForTile(e);e.features&&(e.features.length>=t||e.fetchStatus===C.FULL)||(this._cancelFetchTile(e),this._resetFetchTile(e))})),this._setDirty())}_addTile(e){const t=new R(e);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.descriptor.resolution;this._featureTiles.forEach((s=>{if(!(null==s.displayingFeatures||e===s||e.descriptor.lij&&s.descriptor.lij&&!b(e.descriptor.lij,s.descriptor.lij))){null==e.displayingFeatures&&(e.displayingFeatures=[]),e.descriptor.extent&&s.descriptor.extent&&(null==e.extentIncludingBorrowedFeatures&&(e.extentIncludingBorrowedFeatures=d(e.descriptor.extent)),p(e.extentIncludingBorrowedFeatures,s.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const i of s.displayingFeatures){e.displayingFeatures.push(i);const s=this._displayingFeatureReferences.get(m(i,this._objectIdField));s.ref(s.feature,t),this._numDisplayingFeatureReferences++}}})),e.featureLimit=null!=e.displayingFeatures?e.displayingFeatures.length:0}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetching&&(e.fetchStatus=C.DONE):e.fetchStatus=C.FETCH_NEEDED}_cancelFetchTile(e){const t=e.requestController;null!=t&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){return e.numFeatures=await this._fetchCount(e,t),this._updateRatio(this._getListOfTiles()),e.fetchStatus===C.REFETCHING?C.REFETCH_NEEDED:C.FETCH_NEEDED}async _fetchTile(e,t){const s=this._maximumFeaturesForTile(e);if(s<=0)return I(e);const i=this._getMaxRecordCount(e),r=Math.ceil(s/i);if(j(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=s&&r>F.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const n=this._createQuery(e);if(n.maxRecordCountFactor=Math.ceil(s/i),e.isRefetching&&e.features&&e.features.length>0){const t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/i);n.maxRecordCountFactor=Math.max(t+1,n.maxRecordCountFactor)}const{features:o,exceededTransferLimit:u,fields:l}=await this._queryFeatures(n,t),h=u?n.maxRecordCountFactor>=F.MAX_MAX_RECORD_COUNT_FACTOR?C.FULL:C.DONE:C.FULL;return await this._frameTask.schedule((()=>{e.featuresMissing=o.length<e.numFeatures||!!u;const t=this._removeEmptyFeatures(o);e.setFeatures(o,t,A(l))}),t),a(t),this._invalidateCounts(),h}async _fetchCount(e,t){return this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t})}async _fetchPagedTile(e,t){let s,i=0,r=0,n=0,o=this._maximumFeaturesForTile(e)-n;const u=this._getMaxRecordCount(e);let l=null;for(;;){const h=this._createQuery(e),c=this._setPagingParameters(h,i,o,u),{features:d,exceededTransferLimit:p,fields:f}=await this._queryFeatures(h,t);if(await this._frameTask.schedule((()=>{c&&(i+=h.num),n+=d.length,r+=this._removeEmptyFeatures(d),e.featuresMissing=i<e.numFeatures||!!p,s=s?s.concat(d):d,l=q(l,f),e.setFeatures(s,r,l)}),t),a(t),this._invalidateCounts(),this._setDirty(),o=this._maximumFeaturesForTile(e)-n,!c||!p||o<=0)return p?C.DONE:C.FULL}}_createFeatureCountQuery(e){const t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){const t=this.context.createQuery(),s=e.descriptor.extent;if(s){const e=this.context.tilingScheme.spatialReference;t.geometry=f(s,e)}return this._setResolutionParams(t,e),this._useTileQuery(e)?t.resultType="tile":this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),t}_setPagingParameters(e,t,s,i){return!!this.context.capabilities.supportsPagination&&(e.start=t,s>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(s/i),e.num=Math.min(e.maxRecordCountFactor*i,s)):e.num=Math.min(i),!0)}_getEffectiveTileResolution(e){if(null==e.descriptor.resolution)return null;const t=this.context.viewingMode===y.Global?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.descriptor.resolution,t)/this.lodFactor}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&"point"!==this.context.geometryType}_setResolutionParams(e,t){if(!this._supportsResolution)return;const s=this._getEffectiveTileResolution(t);null!=s&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new g({mode:"view",originPosition:"upper-left",tolerance:s,extent:this.context.fullExtent}):"polyline"===this.context.geometryType&&(e.maxAllowableOffset=s))}_removeEmptyFeatures(e){const t=e.length;for(let s=0;s<e.length;){const t=e[s];_(t.geometry)?++s:(e[s]=e.at(-1),--e.length)}return t-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!j(e)}_getMaxRecordCount(e){const{tileMaxRecordCount:t,maxRecordCount:s}=this.context;return this._useTileQuery(e)&&null!=t&&t>0&&this.context.capabilities.supportsResultType?t:null!=s&&s>0?s:S}_useTileQuery(e){return(!j(e)||!this.context.capabilities.supportsCacheHint)&&this.context.capabilities.supportsResultType}_handleRequest(e,t,s,i){e.fetchStatus=e.needsRefetching?C.REFETCHING:C.FETCHING,e.requestController=s;let a=!1;t.then((t=>{e.requestController=null,e.fetchStatus=t})).catch((t=>{e.requestController===s&&(e.requestController=null,e.fetchStatus=C.DONE),r(t)?a=!0:i(t)})).then((()=>{a||this._setDirty(),this._scheduleUpdated()}))}_scheduleUpdated(){this.hasHandles("scheduleUpdated")||this.addHandles(o((()=>{this.removeHandles("scheduleUpdated"),this._updated()})),"scheduleUpdated")}_showTile(e){if(null!=e.displayingFeatures&&!e.needsDisplayUpdate)return!1;const t=e.features;if(0===e.featureLimit||!t){const t=null!=e.displayingFeatures&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}const s=e.descriptor.resolution,i=this._changes.updates,r=this._changes.adds,a=Math.min(e.featureLimit,t.length);e.featureLimit=a;for(let n=0;n<a;++n){const e=t[n],a=m(e,this._objectIdField),o=this._displayingFeatureReferences.get(a);if(o){const t=o.ref(e,s);t.oldVersion!==t.newVersion&&(t.oldVersion&&i.removes.push(t.oldVersion),t.newVersion&&i.adds.push(t.newVersion))}else this._displayingFeatureReferences.set(a,new this.FeatureReferenceClass(e,s)),r.push(e);this._numDisplayingFeatureReferences++}return this._hideTileFeatures(e),this._applyChanges(),e.displayingFeatures=t.slice(0,a),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(null==e.displayingFeatures)return;const t=this._changes.updates,s=this._changes.removes;for(const i of e.displayingFeatures){const r=m(i,this._objectIdField),a=this._displayingFeatureReferences.get(r);if(!a)continue;const n=a.unref(e.descriptor.resolution);this._numDisplayingFeatureReferences--,n?n.oldVersion!==n.newVersion&&(null==n.newVersion?(this._displayingFeatureReferences.delete(r),n.oldVersion&&s.push(n.oldVersion)):(t.adds.push(n.newVersion),n.oldVersion&&t.removes.push(n.oldVersion))):console.error("Hiding unreferenced feature")}this._applyChanges(),e.displayingFeatures=null}_applyChanges(){const e=this._changes.updates;e.removes.length>0&&(this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this.features.addMany(e.adds),e.adds.length=0);const t=this._changes.adds,s=this._changes.removes,i=Math.min(t.length,s.length);let r=0;for(;r<i;){const e=Math.min(r+V,i);this.features.addMany(t.slice(r,e)),this.features.removeMany(s.slice(r,e)),r=e}t.length>i&&this.features.addMany(0===r?t:t.slice(r)),s.length>i&&this.features.removeMany(0===r?s:s.slice(r)),t.length=0,s.length=0}_clearTile(e){if(this._hideTile(e),e.features&&null!=this.context.memoryCache){const t=16+e.estimatedSize;this.context.memoryCache.put(e.id,e.cache,t)}e.setFeatures(null,0,null),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures"),this.notifyChange("memoryForUnusedFeatures")}_getListOfTiles(){return Array.from(this._featureTiles.values())}get storedFeatures(){return this._getListOfTiles().reduce(((e,t)=>e+(t.features?t.features.length:0)),0)}get missingTiles(){return Array.from(this._featureTiles.values()).reduce(((e,t)=>e+(t.needsFetching||t.isFetching?1:0)),0)}_maximumFeaturesForTile(e){const t=e.hasPreciseFeatureCount?e.numFeatures:1/0,s=e.hasPreciseFeatureCount?t:this.maximumNumberOfFeatures,i=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(s*i/(1-e.emptyFeatureRatio)),t)}get test(){return{process:e=>this.runTask(e),getFeatureTileById:e=>this._featureTiles.get(e),forEachFeatureTile:e=>this._featureTiles.forEach(e)}}};function j(e){return"dummy-tile-full-extent"===e.id}function P(e){let t=0;for(const s of e)s.features&&s.features.length>0&&s.alive&&(t=Math.max(t,s.descriptor.lij[0]));return t}function N(e){const t=e.capabilities.query;return{supportsMultipleResolutions:U(e),supportsPagination:!(!t||!t.supportsPagination),supportsResultType:!(!t||!t.supportsResultType),supportsCacheHint:!(!t||!t.supportsCacheHint),supportsQuantization:!(!t||!t.supportsQuantization),supportsQuantizationEditMode:!(!t||!t.supportsQuantizationEditMode),supportsMaxRecordCountFactor:!(!t||!t.supportsMaxRecordCountFactor),supportsFormatPBF:!(!t||!t.supportsFormatPBF)}}function U(e){switch(e.geometryType){case"polyline":return!0;case"polygon":return e.capabilities&&e.capabilities.query&&e.capabilities.query.supportsQuantization;default:return!1}}function I(e){return e.setFeatures([],0,null),e.featuresMissing=!1,C.DONE}function A(e){return null==e?new Set:new Set(e.map((e=>e.name)))}function q(e,t){if(null==e||null==t)return A(t);const s=new Set;for(const{name:i}of t)e.has(i)&&s.add(i);return s}e([u({constructOnly:!0})],O.prototype,"features",void 0),e([u()],O.prototype,"tileDescriptors",void 0),e([u({value:1/0})],O.prototype,"maximumNumberOfFeatures",null),e([u({value:1})],O.prototype,"memoryFactor",null),e([u({value:1})],O.prototype,"lodFactor",null),e([u()],O.prototype,"useTileCount",null),e([u({readOnly:!0})],O.prototype,"updating",void 0),e([u({readOnly:!0})],O.prototype,"running",void 0),e([u({readOnly:!0})],O.prototype,"updatingTotal",void 0),e([u({readOnly:!0})],O.prototype,"updatingRemaining",void 0),e([u({readOnly:!0})],O.prototype,"expectedFeatureDiff",void 0),e([u({readOnly:!0})],O.prototype,"memoryForUnusedFeatures",null),e([u({readOnly:!0})],O.prototype,"maximumNumberOfFeaturesExceeded",void 0),e([u({constructOnly:!0})],O.prototype,"maximumNumberOfFeaturesExceededThrottle",void 0),e([u({readOnly:!0})],O.prototype,"totalVertices",null),e([u({readOnly:!0})],O.prototype,"totalFeatures",null),e([u()],O.prototype,"filterExtent",null),e([u({constructOnly:!0})],O.prototype,"context",void 0),O=e([l(w)],O);const S=2e3,L=h(),H=h(),Q=6e5,V=200;export{O as FeatureTileFetcher3D,N as contextCapabilitiesFromLayer};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Logger.js";import{someMap as i}from"../../../../core/MapUtils.js";import{isAbortError as r,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{on as n}from"../../../../core/reactiveUtils.js";import{schedule as o}from"../../../../core/scheduling.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as h,equals as c,clone as d,expand as p,toExtent as f}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as m,hasVertices as _}from"../../../../layers/graphics/dehydratedFeatures.js";import g from"../../../../rest/support/QuantizationParameters.js";import F from"../../../../rest/support/Query.js";import{ViewingMode as y}from"../../../ViewingMode.js";import{MultiFeatureReference as T,SingleFeatureReference as x}from"./featureReference.js";import{FAILED_FEATURE_COUNT as E,FetchStatus as C,FeatureTile as R}from"./FeatureTile.js";import{tilesAreRelated as b}from"../../terrain/tileUtils.js";import{ImmediateTask as v,TaskPriority as M}from"../../../support/Scheduler.js";const w="esri.views.3d.layers.support.FeatureTileFetcher3D",D=s.getLogger(w);let O=class extends t{set maximumNumberOfFeatures(e){e=e||1/0;const t=this._get("maximumNumberOfFeatures");e===t||e<1||(this._set("maximumNumberOfFeatures",e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set("memoryFactor",e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set("lodFactor",e),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&null!=this.context.query.queryFeatureCount}set useTileCount(e){this._useTileCount=e,this.notifyChange("useTileCount")}get memoryForUnusedFeatures(){let e=0;return this._featureTiles.forEach((t=>e+=t.estimatedUnusedSize)),e}get totalVertices(){let e=0;return this._featureTiles.forEach((t=>e+=t.numVertices)),e}get totalFeatures(){let e=0;return this._featureTiles.forEach((t=>e+=t.numFeatures)),e}set filterExtent(e){if(null!=e&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void D.error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||null!=t&&e&&t.equals(e))return;const s=null!=e?e.clone():null;this._set("filterExtent",s),this._reclip(s,t)}constructor(e){super(e),this._useTileCount=!1,this.updating=!1,this.running=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this.maximumNumberOfFeaturesExceededThrottle=1e3,this._fullRatio=1,this._farRatio=1,this._changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this._frameTask=v,this._dirty=!1,this._featureTiles=new Map,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._suspended=!0,this._pendingEdits=null}initialize(){this.addHandles(n((()=>this.tileDescriptors),"change",(()=>this._setDirty()),{onListenerAdd:()=>this._setDirty()})),this._objectIdField=this.context.objectIdField,this.FeatureReferenceClass=this.context.capabilities.supportsMultipleResolutions?T:x;const e=this.context.scheduler;null!=e&&(this._frameTask=e.registerTask(M.FEATURE_TILE_FETCHER,this)),this._setDirty()}destroy(){this._frameTask.remove(),this._featureTiles.forEach((e=>{this._cancelFetchTile(e),this._removeTile(e)})),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),this._pendingEdits?.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach((e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)})),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach((e=>{this._cancelFetchTile(e),this._resetFetchTile(e)})),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}_pause(){this._paused&&(this._featureTiles.forEach((e=>this._cancelFetchTile(e))),this._updated())}_unpause(){this._paused||(this._setDirty(),this._updated())}get availableFields(){let e=null;return this._featureTiles.forEach((t=>{null!=t.displayingFeatures&&0!==t.displayingFeatures.length&&(null==e?e=new Set(t.availableFields):e.forEach((s=>{t.availableFields.has(s)||e.delete(s)})))})),null!=e?e:new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this._pendingEdits;t.count++;const s=t.edits.then((()=>e.result.catch((e=>{if(r(e))throw e;return null})).then((e=>e?(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then((()=>e))):e)).then((e=>(0==--t.count&&(this._pendingEdits===t&&(this._pendingEdits=null),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._unpause(),this._updated()),e)))));return t.edits=s,this._updated(),s}_applyEditsDeleteFeatures(e){if(0===e.length)return;const t=this.context.globalIdField,s=t&&this.availableFields.has(t),i=new Set,r=this._objectIdField;e.forEach((({objectId:e,globalId:a})=>{if((!e||e<0)&&t){s||D.errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`);const e=this.features.find((e=>e.attributes&&e.attributes[t]===a));e&&i.add(m(e,r))}else i.add(e)})),this._featureTiles.forEach((e=>{if(!e.features)return;const t=e.features.filter((e=>!i.has(m(e,this._objectIdField))));t.length!==e.features.length&&(e.setFeatures(t,0,e.availableFields),this._invalidateCounts())}))}async _applyEditsAddUpdateFeatures(e,t,s){const i=[],r=new Set;if(e.forEach((e=>i.push(e.objectId))),t.forEach((e=>{i.push(e.objectId),r.add(e.objectId)})),0===i.length)return;const a=[];this._featureTiles.forEach((e=>{const t=this._applyEditsAddUpdateTile(e,i,r,s);t&&a.push(t)})),await Promise.allSettled(a)}async _applyEditsAddUpdateTile(e,t,s,i){if(!e.features)return;const r=this._createQuery(e);r.resultType=void 0,r.cacheHint=!1,r.objectIds=t;const a=await this._queryFeatures(r,i);let n=null;if(s.size>0){const t=e.features.filter((e=>!s.has(m(e,this._objectIdField))));t.length!==e.features.length&&(n=t)}if(a.features.length>0){n||(n=e.features.slice());for(const e of a.features)n.push(e)}n&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,n.length)),e.setFeatures(n,0,q(e.availableFields,a.fields)),this._invalidateCounts())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:Q})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){if(this._frameTask.processQueue(e),!this._dirty||!this.initialized)return;this._dirty=!1;const t=this._getListOfTiles();if(this._markTilesNotAlive(t),!e.run((()=>this._addTiles(t,e)))||!e.run((()=>this._filterExtentTiles(t,e)))||!e.run((()=>this._removeTiles(t,e)))||e.done)return void this._setDirty();const s=this._sortTiles(t);e.run((()=>this._showTiles(s,e)))&&e.run((()=>this._fetchTiles(s,e)))&&e.run((()=>this._updateMemoryEstimates(s,e)))||this._setDirty(),this._updated(),this.updating||this._updateMaximumNumberOfFeaturesExceeded()}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!this._suspended&&(this.tileDescriptors.forEach((s=>{const i=this._featureTiles.get(s.id);i?i.alive=!0:t.done||(e.push(this._addTile(s)),t.madeProgress())})),t.hasProgressed)}_filterExtentTiles(e,t){for(const s of e){if(t.done)break;s.alive&&(s.filtered=!s.intersects(this.filterExtent),s.filtered&&(this._clearTile(s),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let s=e.length-1;s>=0&&!t.done;s--){const i=e[s];i.alive||(this._removeTile(i),s!==e.length-1&&(e[s]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort(((e,t)=>(e.descriptor.loadPriority??0)-(t.descriptor.loadPriority??0))),e}_showTiles(e,t){const s=this._updateRatio(e),i=e=>{const t=this._fullRatio<1?s(e)*this._farRatio:1;return e.reduceFeatures(t,this.memoryFactor,this._objectIdField)&&this._setDirty(),this._showTile(e)};for(const r of e)if(!t.run((()=>i(r)))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let s=!1;for(const i of e){if(!i.needsFetching)continue;const e=null!=this.context.memoryCache?this.context.memoryCache.pop(i.id):null;if(null==e){if(this._needsNumFeatures(i)){const e=new AbortController,r=this._fetchTileCount(i,e.signal);this._handleRequest(i,r,e,(()=>i.numFeatures=E)),s=!0,t.madeProgress()}if(t.done)return!0}else i.cache=e,this._setDirty(),this._scheduleUpdated(),t.madeProgress()}if(s)return t.hasProgressed;for(const i of e)if(i.needsFetching){const e=new AbortController,s=this._fetchTile(i,e.signal);if(this._handleRequest(i,s,e,(e=>{i.setFeatures([],0,null),this._invalidateCounts(),i.featuresMissing=!1,this.context.logFetchError(D,e)})),t.madeProgress())return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some((e=>!t.run((()=>e.updateMemoryEstimates()))&&(this._setDirty(),!0))),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;const s=new Array;this._featureTiles.forEach((i=>{null!=i.displayingFeatures&&0!==i.displayingFeatures.length&&(i.intersectionIncludingBorrowed(t,L),i.intersectionIncludingBorrowed(e,H),c(L,H)||s.push(i))})),this._refreshDisplayingFeatures(s),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,s=this._changes.updates;for(const i of e)if(null!=i.displayingFeatures)for(const e of i.displayingFeatures){const i=m(e,this._objectIdField);if(t.has(i))continue;t.add(i);const r=this._displayingFeatureReferences.get(i).feature;s.removes.push(r),s.adds.push(r)}this._applyChanges()}_updated(){let e=0;this._paused||this._featureTiles.forEach((t=>t.isFetching?++e:0));const t=this._dirty||!!this._pendingEdits||e>0;if(this._set("running",this._dirty),this._set("updating",t),t){let t=0,s=0,i=0,r=0,a=0;const n=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach((e=>{if(++s,e.isFetching&&e.hasPreciseFeatureCount){const t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),s=null!=e.displayingFeatures?e.displayingFeatures.length*n:0;a+=t-s}e.needsFetching?++r:e.numFeatures>0&&(++i,t+=e.numFeatures)})),r+=e;let o=0,u=0;t?(u=t,o=Math.min(r*t/i,t)):(u=s,o=r),a=Math.min(this.maximumNumberOfFeatures-this.features.length,a),this._set("updatingTotal",u),this._set("updatingRemaining",o),this._set("expectedFeatureDiff",a)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger&&this.debugger.update()}_updateMaximumNumberOfFeaturesExceeded(){const e=i(this._featureTiles,(e=>e.perTileMaximumNumberOfFeaturesExceeded));this._set("maximumNumberOfFeaturesExceeded",e)}_updateRatio(e){const t=P(e),s=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0]));let i=0,r=0;for(const a of e){const e=a.numFeatures;i+=e,r+=e*s(a)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/i),this._farRatio=this.maximumNumberOfFeatures/r,this._scheduleUpdated(),s}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this._featureTiles.forEach((e=>{if(!e.featuresMissing)return;const t=this._maximumFeaturesForTile(e);e.features&&(e.features.length>=t||e.fetchStatus===C.FULL)||(this._cancelFetchTile(e),this._resetFetchTile(e))})),this._setDirty())}_addTile(e){const t=new R(e);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.descriptor.resolution;this._featureTiles.forEach((s=>{if(!(null==s.displayingFeatures||e===s||e.descriptor.lij&&s.descriptor.lij&&!b(e.descriptor.lij,s.descriptor.lij))){null==e.displayingFeatures&&(e.displayingFeatures=[]),e.descriptor.extent&&s.descriptor.extent&&(null==e.extentIncludingBorrowedFeatures&&(e.extentIncludingBorrowedFeatures=d(e.descriptor.extent)),p(e.extentIncludingBorrowedFeatures,s.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const i of s.displayingFeatures){e.displayingFeatures.push(i);const s=this._displayingFeatureReferences.get(m(i,this._objectIdField));s.ref(s.feature,t),this._numDisplayingFeatureReferences++}}})),e.featureLimit=null!=e.displayingFeatures?e.displayingFeatures.length:0}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetching&&(e.fetchStatus=C.DONE):e.fetchStatus=C.FETCH_NEEDED}_cancelFetchTile(e){const t=e.requestController;null!=t&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){return e.numFeatures=await this._fetchCount(e,t),this._updateRatio(this._getListOfTiles()),e.fetchStatus===C.REFETCHING?C.REFETCH_NEEDED:C.FETCH_NEEDED}async _fetchTile(e,t){const s=this._maximumFeaturesForTile(e);if(s<=0)return I(e);const i=this._getMaxRecordCount(e),r=Math.ceil(s/i);if(j(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=s&&r>F.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const n=this._createQuery(e);if(n.maxRecordCountFactor=Math.ceil(s/i),e.isRefetching&&e.features&&e.features.length>0){const t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/i);n.maxRecordCountFactor=Math.max(t+1,n.maxRecordCountFactor)}const{features:o,exceededTransferLimit:u,fields:l}=await this._queryFeatures(n,t),h=u?n.maxRecordCountFactor>=F.MAX_MAX_RECORD_COUNT_FACTOR?C.FULL:C.DONE:C.FULL;return await this._frameTask.schedule((()=>{e.featuresMissing=o.length<e.numFeatures||!!u;const t=this._removeEmptyFeatures(o);e.setFeatures(o,t,A(l))}),t),a(t),this._invalidateCounts(),h}async _fetchCount(e,t){return this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t})}async _fetchPagedTile(e,t){let s,i=0,r=0,n=0,o=this._maximumFeaturesForTile(e)-n;const u=this._getMaxRecordCount(e);let l=null;for(;;){const h=this._createQuery(e),c=this._setPagingParameters(h,i,o,u),{features:d,exceededTransferLimit:p,fields:f}=await this._queryFeatures(h,t);if(await this._frameTask.schedule((()=>{c&&(i+=h.num),n+=d.length,r+=this._removeEmptyFeatures(d),e.featuresMissing=i<e.numFeatures||!!p,s=s?s.concat(d):d,l=q(l,f),e.setFeatures(s,r,l)}),t),a(t),this._invalidateCounts(),this._setDirty(),o=this._maximumFeaturesForTile(e)-n,!c||!p||o<=0)return p?C.DONE:C.FULL}}_createFeatureCountQuery(e){const t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){const t=this.context.createQuery(),s=e.descriptor.extent;if(s){const e=this.context.tilingScheme.spatialReference;t.geometry=f(s,e)}return this._setResolutionParams(t,e),this._useTileQuery(e)?t.resultType="tile":this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),t}_setPagingParameters(e,t,s,i){return!!this.context.capabilities.supportsPagination&&(e.start=t,s>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(s/i),e.num=Math.min(e.maxRecordCountFactor*i,s)):e.num=Math.min(i),!0)}_getEffectiveTileResolution(e){if(null==e.descriptor.resolution)return null;const t=this.context.viewingMode===y.Global?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.descriptor.resolution,t)/this.lodFactor}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&"point"!==this.context.geometryType}_setResolutionParams(e,t){if(!this._supportsResolution)return;const s=this._getEffectiveTileResolution(t);null!=s&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new g({mode:"view",originPosition:"upper-left",tolerance:s,extent:this.context.fullExtent}):"polyline"===this.context.geometryType&&(e.maxAllowableOffset=s))}_removeEmptyFeatures(e){const t=e.length;for(let s=0;s<e.length;){const t=e[s];_(t.geometry)?++s:(e[s]=e[e.length-1],--e.length)}return t-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!j(e)}_getMaxRecordCount(e){const{tileMaxRecordCount:t,maxRecordCount:s}=this.context;return this._useTileQuery(e)&&null!=t&&t>0&&this.context.capabilities.supportsResultType?t:null!=s&&s>0?s:S}_useTileQuery(e){return(!j(e)||!this.context.capabilities.supportsCacheHint)&&this.context.capabilities.supportsResultType}_handleRequest(e,t,s,i){e.fetchStatus=e.needsRefetching?C.REFETCHING:C.FETCHING,e.requestController=s;let a=!1;t.then((t=>{e.requestController=null,e.fetchStatus=t})).catch((t=>{e.requestController===s&&(e.requestController=null,e.fetchStatus=C.DONE),r(t)?a=!0:i(t)})).then((()=>{a||this._setDirty(),this._scheduleUpdated()}))}_scheduleUpdated(){this.hasHandles("scheduleUpdated")||this.addHandles(o((()=>{this.removeHandles("scheduleUpdated"),this._updated()})),"scheduleUpdated")}_showTile(e){if(null!=e.displayingFeatures&&!e.needsDisplayUpdate)return!1;const t=e.features;if(0===e.featureLimit||!t){const t=null!=e.displayingFeatures&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}const s=e.descriptor.resolution,i=this._changes.updates,r=this._changes.adds,a=Math.min(e.featureLimit,t.length);e.featureLimit=a;for(let n=0;n<a;++n){const e=t[n],a=m(e,this._objectIdField),o=this._displayingFeatureReferences.get(a);if(o){const t=o.ref(e,s);t.oldVersion!==t.newVersion&&(t.oldVersion&&i.removes.push(t.oldVersion),t.newVersion&&i.adds.push(t.newVersion))}else this._displayingFeatureReferences.set(a,new this.FeatureReferenceClass(e,s)),r.push(e);this._numDisplayingFeatureReferences++}return this._hideTileFeatures(e),this._applyChanges(),e.displayingFeatures=t.slice(0,a),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(null==e.displayingFeatures)return;const t=this._changes.updates,s=this._changes.removes;for(const i of e.displayingFeatures){const r=m(i,this._objectIdField),a=this._displayingFeatureReferences.get(r);if(!a)continue;const n=a.unref(e.descriptor.resolution);this._numDisplayingFeatureReferences--,n?n.oldVersion!==n.newVersion&&(null==n.newVersion?(this._displayingFeatureReferences.delete(r),n.oldVersion&&s.push(n.oldVersion)):(t.adds.push(n.newVersion),n.oldVersion&&t.removes.push(n.oldVersion))):console.error("Hiding unreferenced feature")}this._applyChanges(),e.displayingFeatures=null}_applyChanges(){const e=this._changes.updates;e.removes.length>0&&(this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this.features.addMany(e.adds),e.adds.length=0);const t=this._changes.adds,s=this._changes.removes,i=Math.min(t.length,s.length);let r=0;for(;r<i;){const e=Math.min(r+V,i);this.features.addMany(t.slice(r,e)),this.features.removeMany(s.slice(r,e)),r=e}t.length>i&&this.features.addMany(0===r?t:t.slice(r)),s.length>i&&this.features.removeMany(0===r?s:s.slice(r)),t.length=0,s.length=0}_clearTile(e){if(this._hideTile(e),e.features&&null!=this.context.memoryCache){const t=16+e.estimatedSize;this.context.memoryCache.put(e.id,e.cache,t)}e.setFeatures(null,0,null),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures"),this.notifyChange("memoryForUnusedFeatures")}_getListOfTiles(){return Array.from(this._featureTiles.values())}get storedFeatures(){return this._getListOfTiles().reduce(((e,t)=>e+(t.features?t.features.length:0)),0)}get missingTiles(){return Array.from(this._featureTiles.values()).reduce(((e,t)=>e+(t.needsFetching||t.isFetching?1:0)),0)}_maximumFeaturesForTile(e){const t=e.hasPreciseFeatureCount?e.numFeatures:1/0,s=e.hasPreciseFeatureCount?t:this.maximumNumberOfFeatures,i=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(s*i/(1-e.emptyFeatureRatio)),t)}get test(){return{process:e=>this.runTask(e),getFeatureTileById:e=>this._featureTiles.get(e),forEachFeatureTile:e=>this._featureTiles.forEach(e)}}};function j(e){return"dummy-tile-full-extent"===e.id}function P(e){let t=0;for(const s of e)s.features&&s.features.length>0&&s.alive&&(t=Math.max(t,s.descriptor.lij[0]));return t}function N(e){const t=e.capabilities.query;return{supportsMultipleResolutions:U(e),supportsPagination:!(!t||!t.supportsPagination),supportsResultType:!(!t||!t.supportsResultType),supportsCacheHint:!(!t||!t.supportsCacheHint),supportsQuantization:!(!t||!t.supportsQuantization),supportsQuantizationEditMode:!(!t||!t.supportsQuantizationEditMode),supportsMaxRecordCountFactor:!(!t||!t.supportsMaxRecordCountFactor),supportsFormatPBF:!(!t||!t.supportsFormatPBF)}}function U(e){switch(e.geometryType){case"polyline":return!0;case"polygon":return e.capabilities&&e.capabilities.query&&e.capabilities.query.supportsQuantization;default:return!1}}function I(e){return e.setFeatures([],0,null),e.featuresMissing=!1,C.DONE}function A(e){return null==e?new Set:new Set(e.map((e=>e.name)))}function q(e,t){if(null==e||null==t)return A(t);const s=new Set;for(const{name:i}of t)e.has(i)&&s.add(i);return s}e([u({constructOnly:!0})],O.prototype,"features",void 0),e([u()],O.prototype,"tileDescriptors",void 0),e([u({value:1/0})],O.prototype,"maximumNumberOfFeatures",null),e([u({value:1})],O.prototype,"memoryFactor",null),e([u({value:1})],O.prototype,"lodFactor",null),e([u()],O.prototype,"useTileCount",null),e([u({readOnly:!0})],O.prototype,"updating",void 0),e([u({readOnly:!0})],O.prototype,"running",void 0),e([u({readOnly:!0})],O.prototype,"updatingTotal",void 0),e([u({readOnly:!0})],O.prototype,"updatingRemaining",void 0),e([u({readOnly:!0})],O.prototype,"expectedFeatureDiff",void 0),e([u({readOnly:!0})],O.prototype,"memoryForUnusedFeatures",null),e([u({readOnly:!0})],O.prototype,"maximumNumberOfFeaturesExceeded",void 0),e([u({constructOnly:!0})],O.prototype,"maximumNumberOfFeaturesExceededThrottle",void 0),e([u({readOnly:!0})],O.prototype,"totalVertices",null),e([u({readOnly:!0})],O.prototype,"totalFeatures",null),e([u()],O.prototype,"filterExtent",null),e([u({constructOnly:!0})],O.prototype,"context",void 0),O=e([l(w)],O);const S=2e3,L=h(),H=h(),Q=6e5,V=200;export{O as FeatureTileFetcher3D,N as contextCapabilitiesFromLayer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import"../../../../geometry/SpatialReference.js";import"../../../../geometry/support/aaBoundingBox.js";import"../../../../core/mathUtils.js";import"../../../../geometry/Extent.js";import"../../../../geometry/Geometry.js";import"../../../../geometry/Multipoint.js";import"../../../../geometry/Point.js";import"../../../../geometry/Polygon.js";import"../../../../geometry/Polyline.js";import"../../../../geometry/support/typeUtils.js";import"../../../../layers/support/Field.js";import{equals as e}from"../../../../layers/graphics/dehydratedFeatureComparison.js";class t{get isReferenced(){return 0!==this.versions.length}get isSingle(){return 1===this.versions.length&&1===this.versions[0].refCount}constructor(e,t){this._highestResolutionVersion=null,this.versions=[],this.ref(e,t)}ref(t,s){const r=this.feature;i.oldVersion=r,this.feature&&Object.defineProperty(t,"uid",{value:this.feature.uid,configurable:!0});for(const n of this.versions)if(n.resolution===s){n.refCount++;const s=this._highestResolutionVersion===n&&!e(t,n.feature);return(s||this._highestResolutionVersion!==n)&&(n.feature=t),i.newVersion=s?t:r,i}const o={feature:t,resolution:s,refCount:1};return this.versions.push(o),!this._highestResolutionVersion||s<this._highestResolutionVersion.resolution?(i.newVersion=t,this._highestResolutionVersion=o):i.newVersion=r,i}unref(e){for(let t=0;t<this.versions.length;t++){const s=this.versions[t];if(s.resolution===e)return s.refCount--,i.oldVersion=this.feature,0===s.refCount&&(this.versions[t]=this.versions.
|
|
5
|
+
import"../../../../core/has.js";import"../../../../geometry/SpatialReference.js";import"../../../../geometry/support/aaBoundingBox.js";import"../../../../core/mathUtils.js";import"../../../../geometry/Extent.js";import"../../../../geometry/Geometry.js";import"../../../../geometry/Multipoint.js";import"../../../../geometry/Point.js";import"../../../../geometry/Polygon.js";import"../../../../geometry/Polyline.js";import"../../../../geometry/support/typeUtils.js";import"../../../../layers/support/Field.js";import{equals as e}from"../../../../layers/graphics/dehydratedFeatureComparison.js";class t{get isReferenced(){return 0!==this.versions.length}get isSingle(){return 1===this.versions.length&&1===this.versions[0].refCount}constructor(e,t){this._highestResolutionVersion=null,this.versions=[],this.ref(e,t)}ref(t,s){const r=this.feature;i.oldVersion=r,this.feature&&Object.defineProperty(t,"uid",{value:this.feature.uid,configurable:!0});for(const n of this.versions)if(n.resolution===s){n.refCount++;const s=this._highestResolutionVersion===n&&!e(t,n.feature);return(s||this._highestResolutionVersion!==n)&&(n.feature=t),i.newVersion=s?t:r,i}const o={feature:t,resolution:s,refCount:1};return this.versions.push(o),!this._highestResolutionVersion||s<this._highestResolutionVersion.resolution?(i.newVersion=t,this._highestResolutionVersion=o):i.newVersion=r,i}unref(e){for(let t=0;t<this.versions.length;t++){const s=this.versions[t];if(s.resolution===e)return s.refCount--,i.oldVersion=this.feature,0===s.refCount&&(this.versions[t]=this.versions[this.versions.length-1],this.versions.length--,this._highestResolutionVersion===s&&(this._recalculateHighestResolutionVersion(),i.oldVersion=s.feature)),i.newVersion=this.feature,i}return null}get feature(){return this._highestResolutionVersion?this._highestResolutionVersion.feature:null}_recalculateHighestResolutionVersion(){if(0===this.versions.length)return void(this._highestResolutionVersion=null);let e=this.versions[0];for(let t=1;t<this.versions.length;t++){const s=this.versions[t];s.resolution<e.resolution&&(e=s)}this._highestResolutionVersion=e}}class s{get isReferenced(){return 0!==this._refCount}get isSingle(){return 1===this._refCount}constructor(e){this._feature=e,this._refCount=1}ref(t){return++this._refCount,i.oldVersion=this._feature,this.feature&&Object.defineProperty(t,"uid",{value:this.feature.uid,configurable:!0}),e(this._feature,t)||(this._feature=t),i.newVersion=this._feature,i}unref(){return i.oldVersion=this._feature,this._refCount>0&&(this._refCount--,!this.isReferenced)?(i.newVersion=null,i):(i.newVersion=this._feature,i)}get feature(){return this._feature}}const i={oldVersion:null,newVersion:null};export{t as MultiFeatureReference,s as SingleFeatureReference};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{releaseMaybe as t,disposeMaybe as i}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{c as r,a}from"../../../chunks/vec3.js";import{create as h,fromRay as l,getStart as o,getEnd as c}from"../../../geometry/support/clipRay.js";import{intersectClipRay as d}from"../../../geometry/support/frustum.js";import{copy as p}from"../../../geometry/support/lineSegment.js";import{wrap as _}from"../../../geometry/support/ray.js";import{ViewingMode as u}from"../../ViewingMode.js";import{LaserlinePathData as m}from"./LaserlinePathData.js";import{ShaderOutput as g}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncPrepareRenderPlugin as P}from"../webgl-engine/effects/RenderPlugin.js";import{RenderSlot as b}from"../webgl-engine/lib/RenderSlot.js";import{updateParameters as f}from"../webgl-engine/materials/internal/MaterialUtil.js";import{LaserlinePathTechnique as E}from"../webgl-engine/shaders/LaserlinePathTechnique.js";import{LaserlinePathTechniqueConfiguration as q}from"../webgl-engine/shaders/LaserlinePathTechniqueConfiguration.js";import{LaserlinePassParameters as L,LaserlineTechnique as V}from"../webgl-engine/shaders/LaserlineTechnique.js";import{LaserlineTechniqueConfiguration as R}from"../webgl-engine/shaders/LaserlineTechniqueConfiguration.js";let D=class extends P{constructor(e){super(e),this._technique=null,this._heightManifoldEnabled=!1,this._pointDistanceEnabled=!1,this._lineVerticalPlaneEnabled=!1,this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._viewingMode=u.Local,this._pathVerticalPlaneEnabled=!1,this._pathVerticalPlaneData=null,this._pathTechnique=null,this._passParameters=new L}initialize(){this._passParameters.renderCoordsHelper=this.renderCoordsHelper}get renderSlots(){return[this.contrastControlEnabled?b.LASERLINES_CONTRAST_CONTROL:b.LASERLINES]}canRender(){return!0}requiresOutput(e){return e===g.Depth}get isDecoration(){return this._isDecoration}get heightManifoldEnabled(){return this._heightManifoldEnabled}set heightManifoldEnabled(e){this._heightManifoldEnabled!==e&&(this._heightManifoldEnabled=e,this._requestRender())}get heightManifoldTarget(){return this._passParameters.heightManifoldTarget}set heightManifoldTarget(e){r(this._passParameters.heightManifoldTarget,e),this._requestRender()}get pointDistanceEnabled(){return this._pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._pointDistanceEnabled&&(this._pointDistanceEnabled=e,this._requestRender())}get pointDistanceTarget(){return this._passParameters.pointDistanceTarget}set pointDistanceTarget(e){r(this._passParameters.pointDistanceTarget,e),this._requestRender()}get pointDistanceOrigin(){return this._passParameters.pointDistanceOrigin}set pointDistanceOrigin(e){r(this._passParameters.pointDistanceOrigin,e),this._requestRender()}get lineVerticalPlaneEnabled(){return this._lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._lineVerticalPlaneEnabled&&(this._lineVerticalPlaneEnabled=e,this._requestRender())}get lineVerticalPlaneSegment(){return this._passParameters.lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){p(e,this._passParameters.lineVerticalPlaneSegment),this._requestRender()}get intersectsLineEnabled(){return this._intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._intersectsLineEnabled&&(this._intersectsLineEnabled=e,this._requestRender())}get intersectsLineSegment(){return this._passParameters.intersectsLineSegment}set intersectsLineSegment(e){p(e,this._passParameters.intersectsLineSegment),this._requestRender()}get intersectsLineRadius(){return this._passParameters.intersectsLineRadius}set intersectsLineRadius(e){e!==this._passParameters.intersectsLineRadius&&(this._passParameters.intersectsLineRadius=e,this._requestRender())}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this._requestRender())}get viewingMode(){return this._viewingMode}set viewingMode(e){e!==this._viewingMode&&(this._viewingMode=e,this._requestRender())}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,null!=this._pathVerticalPlaneData&&this._requestRender())}set pathVerticalPlaneVertices(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new m(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this._requestRender()}set pathVerticalPlaneBuffers(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new m(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this._requestRender()}setParameters(e){f(this._passParameters,e)&&this._requestRender()}initializeRenderContext(e){this._context=e,this._techniqueRepository=e.techniqueRepository,this._techniqueConfig=new R;const t=new q;t.contrastControlEnabled=this.contrastControlEnabled,this._pathTechnique=this._techniqueRepository.acquire(E,t)}uninitializeRenderContext(){this._technique=t(this._technique),this._pathVerticalPlaneData=i(this._pathVerticalPlaneData),this._pathTechnique=t(this._pathTechnique)}prepareTechnique(){return this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled?(this._techniqueConfig.heightManifoldEnabled=this.heightManifoldEnabled,this._techniqueConfig.lineVerticalPlaneEnabled=this.lineVerticalPlaneEnabled,this._techniqueConfig.pointDistanceEnabled=this.pointDistanceEnabled,this._techniqueConfig.intersectsLineEnabled=this.intersectsLineEnabled,this._techniqueConfig.contrastControlEnabled=this.contrastControlEnabled,this._techniqueConfig.spherical=this._viewingMode===u.Global,this._technique=this._techniqueRepository.releaseAndAcquire(V,this._techniqueConfig,this._technique),this._technique):this._pathTechnique}render(e,t){(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(e,t),this.pathVerticalPlaneEnabled&&this._renderPath(e)}_renderUnified(e,t){const i=e.rctx;this._updatePassParameters(e),i.bindTechnique(t,this._passParameters,e.bindParameters),
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{releaseMaybe as t,disposeMaybe as i}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{c as r,a}from"../../../chunks/vec3.js";import{create as h,fromRay as l,getStart as o,getEnd as c}from"../../../geometry/support/clipRay.js";import{intersectClipRay as d}from"../../../geometry/support/frustum.js";import{copy as p}from"../../../geometry/support/lineSegment.js";import{wrap as _}from"../../../geometry/support/ray.js";import{ViewingMode as u}from"../../ViewingMode.js";import{LaserlinePathData as m}from"./LaserlinePathData.js";import{ShaderOutput as g}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncPrepareRenderPlugin as P}from"../webgl-engine/effects/RenderPlugin.js";import{RenderSlot as b}from"../webgl-engine/lib/RenderSlot.js";import{updateParameters as f}from"../webgl-engine/materials/internal/MaterialUtil.js";import{LaserlinePathTechnique as E}from"../webgl-engine/shaders/LaserlinePathTechnique.js";import{LaserlinePathTechniqueConfiguration as q}from"../webgl-engine/shaders/LaserlinePathTechniqueConfiguration.js";import{LaserlinePassParameters as L,LaserlineTechnique as V}from"../webgl-engine/shaders/LaserlineTechnique.js";import{LaserlineTechniqueConfiguration as R}from"../webgl-engine/shaders/LaserlineTechniqueConfiguration.js";let D=class extends P{constructor(e){super(e),this._technique=null,this._heightManifoldEnabled=!1,this._pointDistanceEnabled=!1,this._lineVerticalPlaneEnabled=!1,this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._viewingMode=u.Local,this._pathVerticalPlaneEnabled=!1,this._pathVerticalPlaneData=null,this._pathTechnique=null,this._passParameters=new L}initialize(){this._passParameters.renderCoordsHelper=this.renderCoordsHelper}get renderSlots(){return[this.contrastControlEnabled?b.LASERLINES_CONTRAST_CONTROL:b.LASERLINES]}canRender(){return!0}requiresOutput(e){return e===g.Depth}get isDecoration(){return this._isDecoration}get heightManifoldEnabled(){return this._heightManifoldEnabled}set heightManifoldEnabled(e){this._heightManifoldEnabled!==e&&(this._heightManifoldEnabled=e,this._requestRender())}get heightManifoldTarget(){return this._passParameters.heightManifoldTarget}set heightManifoldTarget(e){r(this._passParameters.heightManifoldTarget,e),this._requestRender()}get pointDistanceEnabled(){return this._pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._pointDistanceEnabled&&(this._pointDistanceEnabled=e,this._requestRender())}get pointDistanceTarget(){return this._passParameters.pointDistanceTarget}set pointDistanceTarget(e){r(this._passParameters.pointDistanceTarget,e),this._requestRender()}get pointDistanceOrigin(){return this._passParameters.pointDistanceOrigin}set pointDistanceOrigin(e){r(this._passParameters.pointDistanceOrigin,e),this._requestRender()}get lineVerticalPlaneEnabled(){return this._lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._lineVerticalPlaneEnabled&&(this._lineVerticalPlaneEnabled=e,this._requestRender())}get lineVerticalPlaneSegment(){return this._passParameters.lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){p(e,this._passParameters.lineVerticalPlaneSegment),this._requestRender()}get intersectsLineEnabled(){return this._intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._intersectsLineEnabled&&(this._intersectsLineEnabled=e,this._requestRender())}get intersectsLineSegment(){return this._passParameters.intersectsLineSegment}set intersectsLineSegment(e){p(e,this._passParameters.intersectsLineSegment),this._requestRender()}get intersectsLineRadius(){return this._passParameters.intersectsLineRadius}set intersectsLineRadius(e){e!==this._passParameters.intersectsLineRadius&&(this._passParameters.intersectsLineRadius=e,this._requestRender())}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this._requestRender())}get viewingMode(){return this._viewingMode}set viewingMode(e){e!==this._viewingMode&&(this._viewingMode=e,this._requestRender())}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,null!=this._pathVerticalPlaneData&&this._requestRender())}set pathVerticalPlaneVertices(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new m(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this._requestRender()}set pathVerticalPlaneBuffers(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new m(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this._requestRender()}setParameters(e){f(this._passParameters,e)&&this._requestRender()}initializeRenderContext(e){this._context=e,this._techniqueRepository=e.techniqueRepository,this._techniqueConfig=new R;const t=new q;t.contrastControlEnabled=this.contrastControlEnabled,this._pathTechnique=this._techniqueRepository.acquire(E,t)}uninitializeRenderContext(){this._technique=t(this._technique),this._pathVerticalPlaneData=i(this._pathVerticalPlaneData),this._pathTechnique=t(this._pathTechnique)}prepareTechnique(){return this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled?(this._techniqueConfig.heightManifoldEnabled=this.heightManifoldEnabled,this._techniqueConfig.lineVerticalPlaneEnabled=this.lineVerticalPlaneEnabled,this._techniqueConfig.pointDistanceEnabled=this.pointDistanceEnabled,this._techniqueConfig.intersectsLineEnabled=this.intersectsLineEnabled,this._techniqueConfig.contrastControlEnabled=this.contrastControlEnabled,this._techniqueConfig.spherical=this._viewingMode===u.Global,this._technique=this._techniqueRepository.releaseAndAcquire(V,this._techniqueConfig,this._technique),this._technique):this._pathTechnique}render(e,t){(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(e,t),this.pathVerticalPlaneEnabled&&this._renderPath(e)}_renderUnified(e,t){const i=e.rctx;this._updatePassParameters(e),i.bindTechnique(t,this._passParameters,e.bindParameters),i.screen.draw()}_renderPath(e){if(null==this._pathVerticalPlaneData||null==this._pathTechnique)return;const t=e.rctx,i=this._pathTechnique;t.bindTechnique(i,{...this._passParameters,origin:this._pathVerticalPlaneData.origin},e.bindParameters),this._pathVerticalPlaneData.draw(e.rctx)}_updatePassParameters(e){if(!this._intersectsLineEnabled)return;const t=e.bindParameters.camera;if(this._intersectsLineInfinite){if(l(_(this._passParameters.intersectsLineSegment.origin,this._passParameters.intersectsLineSegment.vector),S),S.c0=-Number.MAX_VALUE,!d(t.frustum,S))return;o(S,this._passParameters.lineStartWorld),c(S,this._passParameters.lineEndWorld)}else r(this._passParameters.lineStartWorld,this._passParameters.intersectsLineSegment.origin),a(this._passParameters.lineEndWorld,this._passParameters.intersectsLineSegment.origin,this._passParameters.intersectsLineSegment.vector)}_requestRender(){this._context&&this._context.requestRender()}get test(){return{passParameters:this._passParameters}}};e([s({constructOnly:!0})],D.prototype,"contrastControlEnabled",void 0),e([s({constructOnly:!0})],D.prototype,"_isDecoration",void 0),e([s({constructOnly:!0})],D.prototype,"renderCoordsHelper",void 0),D=e([n("esri.views.3d.support.LaserLineRenderer")],D);const S=h();export{D as LaserLineRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{create as e,offset as t,copy as r}from"../../../geometry/support/aaBoundingRect.js";import{RenderTargetType as s,OverlayIndex as i}from"./interfaces.js";import{fromValues as o}from"../webgl-engine/lib/LocalOriginFactory.js";var a;!function(e){e[e.None=0]="None",e[e.ColorAndWater=1]="ColorAndWater",e[e.Highlight=2]="Highlight",e[e.Occluded=3]="Occluded",e[e.ObjectAndLayerIdColor=4]="ObjectAndLayerIdColor"}(a||(a={}));const n=1.3;class h{get extent(){return this._extent}constructor(t,r){this.index=t,this.renderTargets=r,this._extent=e(),this.resolution=0,this.renderLocalOrigin=o(0,0,0,"O"),this.pixelRatio=1,this.mapUnitsPerPixel=1,this.canvasGeometries=new u,this.hasDrapedFeatureSource=!1,this.hasDrapedRasterSource=!1,this.hasTargetWithoutRasterImage=!1,this.index=t}getTargetTexture(e){return this.renderTargets.getTexture(e)}get _needsColorWithoutRasterImage(){return this.hasDrapedRasterSource&&this.hasDrapedFeatureSource&&this.hasTargetWithoutRasterImage}getColorTexture(e){switch(e){case a.ColorAndWater:return this.renderTargets.getTexture(s.Color);case a.Highlight:return this.renderTargets.getTexture(s.Highlight);case a.ObjectAndLayerIdColor:return this.renderTargets.getTexture(s.ObjectAndLayerIdColor);case a.Occluded:return this.renderTargets.getTexture(s.Occluded);case a.None:return null}}getColorTextureNoRasterImage(){return this._needsColorWithoutRasterImage?this.getTargetTexture(s.ColorNoRasterImage):this.hasDrapedFeatureSource?this.getTargetTexture(s.Color):null}getNormalTexture(e){return e===a.ColorAndWater?this.renderTargets.getTexture(s.Water):null}draw(e,t){for(const r of this.renderTargets.
|
|
5
|
+
import{create as e,offset as t,copy as r}from"../../../geometry/support/aaBoundingRect.js";import{RenderTargetType as s,OverlayIndex as i}from"./interfaces.js";import{fromValues as o}from"../webgl-engine/lib/LocalOriginFactory.js";var a;!function(e){e[e.None=0]="None",e[e.ColorAndWater=1]="ColorAndWater",e[e.Highlight=2]="Highlight",e[e.Occluded=3]="Occluded",e[e.ObjectAndLayerIdColor=4]="ObjectAndLayerIdColor"}(a||(a={}));const n=1.3;class h{get extent(){return this._extent}constructor(t,r){this.index=t,this.renderTargets=r,this._extent=e(),this.resolution=0,this.renderLocalOrigin=o(0,0,0,"O"),this.pixelRatio=1,this.mapUnitsPerPixel=1,this.canvasGeometries=new u,this.hasDrapedFeatureSource=!1,this.hasDrapedRasterSource=!1,this.hasTargetWithoutRasterImage=!1,this.index=t}getTargetTexture(e){return this.renderTargets.getTexture(e)}get _needsColorWithoutRasterImage(){return this.hasDrapedRasterSource&&this.hasDrapedFeatureSource&&this.hasTargetWithoutRasterImage}getColorTexture(e){switch(e){case a.ColorAndWater:return this.renderTargets.getTexture(s.Color);case a.Highlight:return this.renderTargets.getTexture(s.Highlight);case a.ObjectAndLayerIdColor:return this.renderTargets.getTexture(s.ObjectAndLayerIdColor);case a.Occluded:return this.renderTargets.getTexture(s.Occluded);case a.None:return null}}getColorTextureNoRasterImage(){return this._needsColorWithoutRasterImage?this.getTargetTexture(s.ColorNoRasterImage):this.hasDrapedFeatureSource?this.getTargetTexture(s.Color):null}getNormalTexture(e){return e===a.ColorAndWater?this.renderTargets.getTexture(s.Water):null}draw(e,t){for(const r of this.renderTargets.targets)(r.type!==s.ColorNoRasterImage||this._needsColorWithoutRasterImage)&&e.drawTarget(this,r,t)}setupGeometryViewsCyclical(e){this.setupGeometryViewsDirect();const r=.001*e.range;if(this._extent[0]-r<=e.min){const r=this.canvasGeometries.extents[this.canvasGeometries.numViews++];t(this._extent,e.range,0,r)}if(this._extent[2]+r>=e.max){const r=this.canvasGeometries.extents[this.canvasGeometries.numViews++];t(this._extent,-e.range,0,r)}}setupGeometryViewsDirect(){this.canvasGeometries.numViews=1,r(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let e=0;e<this.canvasGeometries.numViews;e++){const t=this.canvasGeometries.extents[e];if(t[0]!==t[2]&&t[1]!==t[3])return!0}return!1}applyViewport(e){e.setViewport(this.index===i.INNER?0:this.resolution,0,this.resolution,this.resolution)}}class u{constructor(){this.extents=[e(),e(),e()],this.numViews=0}}export{h as Overlay,a as OverlaySource,n as OverlayStretch};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{releaseMaybe as e}from"../../../core/maybe.js";class t{constructor(e,t){this._fbos=e,this._format=t}get valid(){return null!=this._handle}dispose(){this._handle=e(this._handle)}
|
|
5
|
+
import{releaseMaybe as e}from"../../../core/maybe.js";class t{constructor(e,t){this._fbos=e,this._format=t}get valid(){return null!=this._handle}dispose(){this._handle=e(this._handle)}get texture(){return this._handle?.colorTexture}bind(t,h,r){this._handle&&this._handle.fbo.width===h&&this._handle.fbo.height===r||(e(this._handle),this._handle=this._fbos.acquire(this._format,h,r)),t.bindFramebuffer(this._handle?.fbo)}generateMipMap(){this._handle?.colorTexture?.descriptor?.hasMipmap&&this._handle?.colorTexture?.generateMipmap()}get gpuMemoryUsage(){return this._handle?.memoryUsage??0}}export{t as OverlayFramebufferObject};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../core/has.js";import{RenderTargetType as e}from"./interfaces.js";import{OverlayFramebufferObject as r}from"./OverlayFramebufferObject.js";import{ColorFormat as t}from"../webgl-engine/core/FBOCache.js";import{ShaderOutput as o}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";class s{constructor(e,o,s,a=t.RGBA_MIPMAP){this.output=o,this.type=s,this.fbo=new r(e,a)}get valid(){return this.fbo.valid}}class a{constructor(r){this.
|
|
5
|
+
import has from"../../../core/has.js";import{RenderTargetType as e}from"./interfaces.js";import{OverlayFramebufferObject as r}from"./OverlayFramebufferObject.js";import{ColorFormat as t}from"../webgl-engine/core/FBOCache.js";import{ShaderOutput as o}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";class s{constructor(e,o,s,a=t.RGBA_MIPMAP){this.output=o,this.type=s,this.fbo=new r(e,a)}get valid(){return this.fbo.valid}}class a{constructor(r){this.targets=[new s(r,o.Color,e.Color),new s(r,o.Color,e.ColorNoRasterImage),new s(r,o.Highlight,e.Highlight,t.RGBA4),new s(r,o.Normal,e.Water),new s(r,o.Color,e.Occluded)],has("enable-feature:objectAndLayerId-rendering")&&this.targets.push(new s(r,o.ObjectAndLayerIdColor,e.ObjectAndLayerIdColor))}getTexture(e){return this.targets[e]?.fbo.texture}dispose(){for(const e of this.targets)e.fbo.dispose()}computeValidity(){return this.targets.reduce(((e,r,t)=>r.valid?e|=1<<t:e),0)}get gpuMemoryUsage(){return this.targets.reduce(((e,r)=>e+r.fbo.gpuMemoryUsage),0)}}export{a as OverlayRenderTarget,s as RenderTargetDescriptor};
|