@arcgis/core 6.0.0-next.53 → 6.0.0-next.55
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/WebScene.js +2 -2
- package/applications/Components/OrientedImageryViewer/shared/constants.js +1 -1
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/validation/arcadeValidator.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +1 -0
- package/assets/esri/core/workers/chunks/{6602310c3fcd91fb6a2f.js → 07c8ac092e4b9e8d5b3c.js} +1 -1
- package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +1 -0
- package/assets/esri/core/workers/chunks/{db0a7671ab5cbe8afd72.js → 123661019bb69c53f2d3.js} +1 -1
- package/assets/esri/core/workers/chunks/{d14732a57c8e63948c60.js → 14259910f44c08fd5bbd.js} +1 -1
- package/assets/esri/core/workers/chunks/{1b41ba050cde068d2860.js → 193a73a2c7f4f8482c21.js} +1 -1
- package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +1 -0
- package/assets/esri/core/workers/chunks/{e507dfc4788295d9c244.js → 249a687ce1b6d0815242.js} +1 -1
- package/assets/esri/core/workers/chunks/{afb4dfb89fbc8a342cc5.js → 3354f1fa90f8ce4c8fde.js} +1 -1
- package/assets/esri/core/workers/chunks/{9b458b0d1627f22fdd93.js → 3b11e4d2e69b7aea1d65.js} +1 -1
- package/assets/esri/core/workers/chunks/41694ee8990e799da225.js +1 -0
- package/assets/esri/core/workers/chunks/{e592f2483db71230e8e5.js → 4401b3f8ebb658abe789.js} +1 -1
- package/assets/esri/core/workers/chunks/{12add2003631fa314f25.js → 5060be52a380fc4920f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{2aa6be0b047a1b25a520.js → 53bbb9aa6e4e4a0a8121.js} +1 -1
- package/assets/esri/core/workers/chunks/{4707aedcc1b3bdf5e987.js → 5c34d49a6c9cc34b7626.js} +1 -1
- package/assets/esri/core/workers/chunks/69a09c6acb5ae03c67f6.js +1 -0
- package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +1 -0
- package/assets/esri/core/workers/chunks/{e83806797979138fd22a.js → 844c593754b2692257f4.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d3e977f3b75474d7ebc.js → 846248697c398468d8e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7e33d37dd11fb08f3f8.js → 97107e64407fa6825620.js} +1 -1
- package/assets/esri/core/workers/chunks/{032733b863426c5bde00.js → 9e508f930086d2ef5f22.js} +3 -3
- package/assets/esri/core/workers/chunks/{5118c7269b706089c88e.js → a05a2c2aaf0c288f9681.js} +1 -1
- package/assets/esri/core/workers/chunks/{817bf487df056da1e6ec.js → a116dd204921e7464944.js} +1 -1
- package/assets/esri/core/workers/chunks/{944f17e9c9f681b971fb.js → a12e2a345005189c64be.js} +1 -1
- package/assets/esri/core/workers/chunks/{15b3386ad92a0b4149b8.js → a24dc5350af001db417a.js} +1 -1
- package/assets/esri/core/workers/chunks/{10967a36c77c5188690d.js → a66d6298236d59a615db.js} +1 -1
- package/assets/esri/core/workers/chunks/{255f5b45c4d32f97f86c.js → ac0861014b3d2f1a1de2.js} +1 -1
- package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +1 -0
- package/assets/esri/core/workers/chunks/ae48ee283cfa5b3c14b0.js +1 -0
- package/assets/esri/core/workers/chunks/bbd8fcb0bbba7bde3d9b.js +1 -0
- package/assets/esri/core/workers/chunks/{ac8d38016e4bee37a77c.js → be0b8bb4f09aae6ff5de.js} +1 -1
- package/assets/esri/core/workers/chunks/d0659f1b0495734be4b3.js +1 -0
- package/assets/esri/core/workers/chunks/{b9a2b05ede02c305e865.js → d8ffb1502def5c85740b.js} +1 -1
- package/assets/esri/core/workers/chunks/{7dfe1e78d2e66de6be22.js → d9ef244019954d5a8a27.js} +1 -1
- package/assets/esri/core/workers/chunks/{95403bb27a4ea0a4b7b1.js → ddbfa664e69612295785.js} +1 -1
- package/assets/esri/core/workers/chunks/{c6d82397044e403a1f61.js → e61082f56c08abe54b3a.js} +1 -1
- package/assets/esri/core/workers/chunks/{55d28d3f5b8ced061e39.js → eaf73ce60f39a48ddd2a.js} +1 -1
- package/assets/esri/core/workers/chunks/ed2f2a5da830d058e339.js +1 -0
- package/assets/esri/core/workers/chunks/{944cb751c85d3a127f49.js → f52d081bbde5c95265cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{1de9be7b65109c207bd5.js → fbd5f3b81cd9f061824d.js} +1 -1
- package/assets/esri/layers/raster/formats/blosc-wasm.wasm +0 -0
- package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
- package/basemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/chunks/CypherParser.js +1 -1
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/blosc-wasm.js +2 -0
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/parquet.js +1 -1
- package/chunks/text.js +1 -1
- package/config.js +1 -1
- package/core/sql/SqlInterval.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/geometryEngine.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/support/Ellipsoid.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/geodesicConstants.js +1 -1
- package/geometry/support/meshUtils/primitives.js +1 -1
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/effects/parser.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/parquet.js +1 -1
- package/layers/raster/datasets/ZarrRaster.js +1 -1
- package/layers/raster/datasets/wcsCoverageParser.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/formats/blosc.js +2 -0
- package/layers/support/BuildingFilter.js +1 -1
- package/layers/support/IntegratedMeshSemantics.js +1 -1
- package/layers/support/fieldUtils.d.ts +23 -87
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/layersMapping.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/legend/ActiveLayerInfo.js +1 -1
- package/libs/ajv/ajv.bundle-wrapper.js +1 -1
- package/package.json +4 -4
- package/renderers/types.d.ts +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
- package/smartMapping/statistics/support/attributeDensity.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/support/tests/serviceMockDependencies.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/rasterizingUtils.js +1 -1
- package/views/2d/PaddedViewState.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
- package/views/2d/engine/vectorTiles/constants.js +1 -1
- package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +1 -1
- package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/ParquetLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/EnvironmentView.js +1 -1
- package/views/3d/focusAreaUtils.js +1 -1
- package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/config.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolFactory.js +1 -1
- package/views/3d/layers/graphics/LabelInfo.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
- package/views/3d/layers/support/selectTiles3DSpatialReference.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/state/Constraints.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/RenderCoordsHelper.js +1 -1
- package/views/3d/support/SweptSphereVolume.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/engineContent/marker.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/ExtentHelper.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TilingSchemeLogic.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
- package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/MapView.d.ts +1 -0
- package/views/SceneView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/ViewingMode.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/helpMessageUtils.js +1 -1
- package/views/draw/support/managers/EditSessionManager.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/AddOrUpdatePart.js +1 -1
- package/views/layers/support/editableLayerViews.js +1 -1
- package/views/overlay/TextOverlayItem.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/support/spatialReferenceSupport.js +1 -1
- package/views/webgl/ShaderTranspiler.js +2 -2
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather.js +1 -1
- package/assets/esri/core/workers/chunks/021bd07b9a3e70598840.js +0 -1
- package/assets/esri/core/workers/chunks/170e68624b71ac96de4a.js +0 -1
- package/assets/esri/core/workers/chunks/8a820e303941b351de81.js +0 -1
- package/assets/esri/core/workers/chunks/90d567e920b6982b402d.js +0 -1
- package/assets/esri/core/workers/chunks/97cdcedfe853280f6258.js +0 -1
- package/assets/esri/core/workers/chunks/9ebc6026934400fc1e1f.js +0 -1
- package/assets/esri/core/workers/chunks/b4a325dcf50e276751d7.js +0 -1
- package/assets/esri/core/workers/chunks/be5857b0d1b00faf430b.js +0 -1
- package/assets/esri/core/workers/chunks/cd9100a7c8309dfa7569.js +0 -1
- package/assets/esri/core/workers/chunks/e58f51618251f74aaafd.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{exactEquals as e,subtract as t,add as n,set as r,
|
|
2
|
+
import{exactEquals as e,subtract as t,add as n,set as r,normalize as i,copy as a,length as o,scale as s,dot as c,transformMat3 as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as u,create as d,fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as p,getMin as m,setMax as h,getMax as g}from"../../../../geometry/support/aaBoundingBox.js";import{alphaCutoff as _}from"../../../../webscene/support/AlphaCutoff.js";import{is3DGeometryOrShadowLike as v}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as y}from"../lib/GLTextureMaterial.js";import{Material as b}from"../lib/Material.js";import{intersectTriangleGeometry as x}from"../lib/RayIntersections.js";import{intersectTriangleGeometryWithScreenPolygon as S}from"../lib/screenPolygonTriangleIntersections.js";import{getVerticalOffsetObject3D as C}from"../lib/verticalOffsetUtils.js";import{usesVertexTangents as w,getLayout as T,DefaultMaterialPassParameters as E,DefaultMaterialTechnique as D}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as O}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as k}from"../shaders/RealisticTreeTechnique.js";import{configureShadedMaterial as A}from"../shaders/ShadedMaterialConfiguration.js";import{DefaultBufferWriter as j}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as M}from"./internal/MaterialUtil.js";import{intersectWithPolygonOffset as N,applyPolygonOffsetToHit as P}from"./intersectWithPolygonOffset.js";class F extends b{constructor(e,t){super(e,L),this.materialType=`default`,this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>v(e)&&!this.transparent],[4,e=>v(e)&&this.transparent]]),this._configuration=new O(t)}isVisibleForOutput(e){return e===5||e===7||e===6?this.parameters.castShadows:!0}get visible(){let{layerOpacity:e,colorMixMode:t,opacity:n,externalColor:r}=this.parameters,i=t===`replace`?1:n,a=t===`ignore`||isNaN(r[3])?1:r[3];return e*i*a>=_}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get emissions(){return this.parameters.emissiveStrength>0&&(this.parameters.emissiveSource===0&&this._hasEmissiveBase||this.parameters.emissiveSource===1)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);let{parameters:t,_configuration:n}=this;n.hasNormalTexture=t.hasNormalTexture,n.hasColorTexture=t.hasColorTexture,n.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,n.hasOcclusionTexture=t.hasOcclusionTexture;let{treeRendering:r,doubleSided:i,doubleSidedType:a}=t;n.hasVertexTangents=w(t),n.instanced=t.instanced,n.instancedDoublePrecision=t.instancedDoublePrecision,n.hasVVColor=!!t.vvColor,n.hasVVSize=!!t.vvSize,n.hasVerticalOffset=t.verticalOffset!=null,n.hasScreenSizePerspective=t.screenSizePerspective!=null,n.hasSlicePlane=t.hasSlicePlane,n.alphaDiscardMode=t.textureAlphaMode,n.normalType=r?0:t.normalType,n.transparent=this.transparent,n.enableOITOffset=e.enableOITOffset,n.customDepthTest=t.customDepthTest??0,n.hasOccludees=e.hasOccludees,n.cullFace=t.hasSlicePlane?0:t.cullFace,n.hasModelTransformation=!r&&t.modelTransformation!=null,n.hasVertexColors=t.hasVertexColors,n.hasSymbolColors=t.hasSymbolColors,n.doubleSidedMode=r?2:i&&a===`normal`?1:i&&a===`winding-order`?2:0,n.instancedFeatureAttribute=t.instancedFeatureAttribute,n.instancedColor=t.instancedColor,A(n,e,t),n.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,n.pbrMode=t.usePBR?t.unlit?7:t.isSchematic?2:1:0,n.emissionSource=t.emissionSource,n.offsetBackfaces=!!(this.transparent&&t.offsetTransparentBackfaces),n.snowCover=e.snowCover>0,n.hasColorTextureTransform=!!t.colorTextureTransformMatrix,n.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,n.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,n.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,n.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,n,r,i,a,o){let s=this._getMaterialVerticalOffset(n,r);s!=null&&(i=t(R,i,s),a=t(z,a,s)),o=N(o,this._configuration,r.camera,i,a),x(e,r,i,a,C(r.verticalOffset),o)}intersectScreenPolygon(e,t,n,r){return P(S(e,n,t,r,this._createScreenPolygonVertexDisplacement(t,n)),this._configuration,n.camera)}createGLMaterial(e){return new I(e)}createBufferWriter(){return new j(T(this.parameters),this.parameters.pretransformedNormals)}get transparent(){let{drivenOpacity:e,opacity:t,externalColor:n,layerOpacity:r,texture:i,textureId:a,textureAlphaMode:o,colorMixMode:s}=this.parameters,c=n[3];return e||t<1&&s!==`replace`||c<1&&s!==`ignore`||r<1||(i!=null||a!=null)&&o!==1&&o!==2&&s!==`replace`}_createScreenPolygonVertexDisplacement(e,t){let r=this._getMaterialVerticalOffset(e,t);return r==null?null:{applyToVertex:(e,t,n,i)=>(e[0]=t+r[0],e[1]=n+r[1],e[2]=i+r[2],e),applyToAabb:e=>(p(e,n(G,m(e,G),r)),h(e,n(G,g(e,G),r)),e)}}_getMaterialVerticalOffset(e,n){if(this.parameters.verticalOffset==null)return null;let u=n.camera;r(H,e[12],e[13],e[14]);let d=n.isGlobal?i(V,H):a(V,B),f=t(U,H,u.eye),p=o(f),m=s(f,f,1/p),h=null;this.parameters.screenSizePerspective&&(h=c(d,m));let g=M(u,p,this.parameters.verticalOffset,h??0,this.parameters.screenSizePerspective,null);return s(d,d,g),l(W,d,n.transform.inverseRotation)}}class I extends y{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});let t=this._material.parameters;this.updateTexture(t.textureId);let n=e.camera.viewInverseTransposeMatrix;return r(t.origin,n[3],n[7],n[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?k:D,e)}}class L extends E{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.emissiveTextureId!=null&&this.emissiveSource===0?3:this.emissiveSource===0?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||this.emissionSource===3||this.hasOcclusionTexture}}const R=d(),z=d(),B=f(0,0,1),V=d(),H=d(),U=d(),W=d(),G=d();export{I as DefaultGLMaterial,F as DefaultMaterial,L as DefaultMaterialParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{isOITColorAlpha as e}from"../core/shaderLibrary/ShaderOutput.js";const t=l(-1),n=l(1),r={factor:0,units:-10},i=t,a=[];a[0]=null,a[1]=n,a[2]=t,a[3]=l(-2),a[4]=l(-3);const o=a.map(e=>c(i,e));a[1]=n;function s({output:t,enableOITOffset:n,polygonOffset:r}){return e(t)&&n?o[r]:a[r]}function c(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}function l(e){return{factor
|
|
2
|
+
import{isOITColorAlpha as e}from"../core/shaderLibrary/ShaderOutput.js";const t=l(-1),n=l(1),r={factor:0,units:-10},i=t,a=[];a[0]=null,a[1]=n,a[2]=t,a[3]=l(-2),a[4]=l(-3);const o=a.map(e=>c(i,e));a[1]=n;function s({output:t,enableOITOffset:n,polygonOffset:r}){return e(t)&&n?o[r]:a[r]}function c(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}function l(e){return{factor:+e,units:2*e}}function u(e){let n=s(e)??{factor:0,units:0};return{factor:n.factor+t.factor*e.polygonOffsetIndex,units:n.units+t.units*e.polygonOffsetIndex}}export{u as getRibbonLineLayerPolygonOffset,r as lineMarkerPolygonOffset,s as polygonOffset};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{copy as e,set as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as r,subtract as i,dot as a,scale as o,add as s,copy as c,length as l,distance as u,lerp as d,transformMat4 as f,normalize as p,applyTranslation as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import _ from"../../../../core/Logger.js";import{clamp as v}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as y,createScreenPointArray as b}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as x,Seconds as S}from"../../../../core/time.js";import{BufferViewVec3f as ee,BufferViewUint32 as te}from"../../../../geometry/support/buffer/BufferView.js";import{fromPoints as C,distance2 as ne,closestLineSegmentPoint as re,projectPoint as ie,projectPointFraction as ae,create as oe}from"../../../../geometry/support/lineSegment.js";import{fromPoints as w,signedDistance as T,getNormal as se,create as E}from"../../../../geometry/support/plane.js";import{alphaCutoff as ce}from"../../../../webscene/support/AlphaCutoff.js";import{isHighlightOrOLID as le,isColor as D,isDepth as ue,isColorHighlightOLIDOrDepth as de,is2DGeometryOutput as fe}from"../core/shaderLibrary/ShaderOutput.js";import{getScalarAttributeView as O}from"../lib/attributeViewUtils.js";import pe from"../lib/GLMaterial.js";import{LineMaterial as me}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as he}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as ge,screenPolygonIntersectsBufferedSegment as _e}from"../lib/screenPolygonOverlapUtils.js";import{Hit as ve,DrapedHit as ye}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as be}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as xe,assert as k}from"../lib/Util.js";import{createVerticesView as Se}from"../lib/VerticesView.js";import{getLayout as Ce,getTextureBufferLayout as we}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Te}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Ee}from"../shaders/RibbonLineTechniqueConfiguration.js";import{getNumJoinSubdivisions as De,getRibbonLinePositions as A,isClosed as j,getUnpaddedRibbonLinePositionCount as Oe,ribbonLineVertexCount as ke,writeRibbonLineTextureBuffer as Ae,writeRibbonLineVertices as je}from"./internal/ribbonLineBufferUtils.js";import{intersectRayWithWorldSizedLineSegment as Me,intersectScreenPolygonWithWorldSizedLineSegment as Ne}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{isImagePattern as Pe}from"./lineStippleUtils.js";import{VisualVariablePassParameters as Fe}from"./VisualVariablePassParameters.js";class Ie extends me{constructor(e,t){super(e,Re),this.produces=new Map([[2,e=>le(e)||D(e)&&this.parameters.renderOccluded===8],[3,e=>ue(e)],[10,e=>de(e)&&this.parameters.renderOccluded===8],[11,e=>de(e)&&this.parameters.renderOccluded===8],[4,e=>D(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>D(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>fe(e)]]),this._configuration=new Ee(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=De(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Ve(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=ce||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>ce}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped(e,t,n,r,i,a,o){if(!t.options.selectionMode)return;let s=this._getLineSize(e,!0),c=A(e,!!this.parameters.isClosed),l=n[0],u=n[1],d=M(s,a,o,this.parameters.usesWorldSizedWidth()),f=Number.MAX_VALUE,p=0;for(let e of Be(F,I,c,j(this.parameters,c.count))){let t=l-F[0],n=u-F[1],r=I[0]-F[0],i=I[1]-F[1],a=r*t+i*n,o=r*r+i*i,s=v(a/o,0,1),c=r*s-t,d=i*s-n,m=c*c+d*d;m<f&&(f=m,p=e)}f<d*d&&r(i.distance,i.renderDistance,i.normal,p)}intersectRay(e,t,n,r,i,a){let{options:o,camera:s}=n;if(!o.selectionMode||!e.visible||!s)return;if(!xe(t)){_.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let c=this._getLineSize(e);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(e,t,n,c,a):this._intersectRayWithScreenSizedLine(e,t,n,c,a)}_intersectRayWithScreenSizedLine(t,n,d,f,p){let{camera:m}=d,h=A(t,!!this.parameters.isClosed),g=V;e(g,d.point);let _=f*m.pixelRatio,v=Q*m.pixelRatio,y=_/2+v;r(K[0],g[0]-y,g[1]+y,0),r(K[1],g[0]+y,g[1]+y,0),r(K[2],g[0]+y,g[1]-y,0),r(K[3],g[0]-y,g[1]-y,0);for(let e=0;e<4;e++)if(!m.unprojectFromRenderScreen(K[e],q[e]))return;w(m.eye,q[0],q[1],J),w(m.eye,q[1],q[2],Y),w(m.eye,q[2],q[3],X),w(m.eye,q[3],q[0],Z);let b=Number.MAX_VALUE,x=0;for(let e of this._forEachTransformedLineSegment(N,P,h,n,j(this.parameters,h.count))){if(T(J,N)<0&&T(J,P)<0||T(Y,N)<0&&T(Y,P)<0||T(X,N)<0&&T(X,P)<0||T(Z,N)<0&&T(Z,P)<0)continue;let t=m.projectToRenderScreen(N,H),n=m.projectToRenderScreen(P,U);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){i(z,N,P);let e=m.frustum,n=-T(e[4],N)/a(z,se(e[4]));if(o(z,z,n),s(N,N,z),!m.projectToRenderScreen(N,t))continue}else if(t[2]>0&&n[2]<0){i(z,P,N);let e=m.frustum,t=-T(e[4],P)/a(z,se(e[4]));if(o(z,z,t),s(P,P,z),!m.projectToRenderScreen(P,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let r=C(t,n,W),l=ne(r,g);if(!(l>=b)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(r,N,P,g,m,f,v);if(l>=e*e)continue}b=l,c(Ke,N),c(qe,P),x=e}}if(b<y*y){let{rayBegin:e,rayEnd:t}=d,n=Number.MAX_VALUE;if(re(C(Ke,qe,W),C(e,t,G),B)){i(B,B,e);let r=l(B);o(B,B,1/r),n=r/u(e,t)}p(n,n,B,x)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,l=A(e,!!this.parameters.isClosed),u=r/(2*s),d=1/0,f=0;for(let e of this._forEachTransformedLineSegment(N,P,l,t,j(this.parameters,l.count))){let t=Me(N,P,u,a,o,Je);if(t!=null&&t<d&&(d=t,f=e,c(B,Je),t===0))break}d<1/0&&i(d,d,B,f)}intersectScreenPolygon(e,t,n,r){let{options:i}=n;if(!i.selectionMode||!e.visible)return null;if(!xe(t))return _.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let a=this._getLineSize(e);return this.parameters.worldSized?this._intersectWorldSizedPolygon(e,t,n,r,a):this._intersectScreenSizedPolygon(e,t,n,r,a)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=A(e,!!this.parameters.isClosed),c=Q,l=c*a.pixelRatio,f=new ve(4);for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count)))for(let[t,n]of o.processLineSegment($,N,P)){if(!ge(a,t,n,H,U))continue;let o=C(H,U,W),s=i/2+c;this.parameters.screenSizePerspective&&(d(V,H,U,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,V,a,i,l)/a.pixelRatio)),a.renderToScreen(H,We),a.renderToScreen(U,Ge),_e(r,We,Ge,s)&&(ie(C(t,n,G),a.eye,L),f.updateIfCloserFromValues(u(a.eye,L),e,L,null))}return f}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=i/(2*s),d=new ve(4);for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count)))for(let[t,n]of o.processLineSegment($,N,P)){ie(C(t,n,G),a.eye,L);let i=u(a.eye,L);d.valid&&i>=d.distance||Ne(t,n,l,a,r)&&d.updateIfCloserFromValues(i,e,L,null)}return d}intersectScreenPolygonDraped(e,t,n,r,i,a){if(!n.options.selectionMode)return null;let o=this._getLineSize(e,!0),s=A(e,!!this.parameters.isClosed),c=M(o,i,a,this.parameters.usesWorldSizedWidth());for(let e of Be(F,I,s,j(this.parameters,s.count),t))if(_e(r,F,I,c))return new ye(e);return null}getPrimitivePositionCount(e,t){let n=(t??e).storage.getField(`position`,ee),r=Oe(n.count,this.parameters.isClosed);return 2*Math.max(0,r-1)}createPrimitivePositionReader(e,t){let n=(t??e).storage.getField(`position`,ee);return(e,t)=>n.getVec(1+Math.ceil(t/2),e)}computeAttachmentOrigin(e,t,n){return!this.parameters.wireframe&&super.computeAttachmentOrigin(e,t,n)}createBufferWriter(){return new ze(Ce(this.parameters),we(this.parameters),this.parameters)}createGLMaterial(e){return new Le(e)}validateParameters(e){k(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:x(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=ae(e,r);d(L,t,n,s),f(Ue,L,i.viewMatrix);let c=l(Ue),u=this.computeCameraAbsCosAngle(L,i,this._configuration.spherical);return He.update(u,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),He.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?p(B,e):r(B,0,0,1),i(R,e,t.eye),p(R,R),Math.abs(a(B,R))}_getLineSize(e,t=!1){let n=this.parameters.width;if(this.parameters.vvSize){let r=O(e,`sizeFeatureAttribute`).get(0);Number.isNaN(r)?t&&(n*=this.parameters.vvSize.fallback[0]):n*=v(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else if(this.parameters.hasVertexSize){let t=O(e,`size`);t!=null&&(n*=t.get(0))}return n}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.count:n.count-1;for(let i=0;i<a;i++)n.getVec(i,e),m(e,e,r),n.getVec((i+1)%n.count,t),m(t,t,r),yield i}}class Le extends pe{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Te,e)}}class Re extends Fe{constructor(){super(...arguments),this._width=0,this.color=g,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=S(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=S(0),this.endTime=S(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return Pe(this.stipplePattern)&&this.stippleTexture!=null}}class ze{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.maxTextureBufferItemIndex=he.getField(0).max}_isClosed(e){return j(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){let t=e.get(`position`);return t.data.length/3+(this._isClosed(t.data.length/t.stride)?3:2)}elementCount(e){let t=e.get(`position`),n=t.indices.length/2+1;return ke(n,this._isClosed(t.data.length/t.stride),this._parameters)}rebaseBuffers(e,t,n,r){if(r?.buffer.copyFrom(e.storage,0,r.offset),t!=null){let r=n.from,i=e.vertex.getField(`ribbonLineVertexInfo`,te),a=t.buffer.getField(`ribbonLineVertexInfo`,te),o=he.getField(0);for(let e=0;e<i.count;e++){let n=i.get(e),s=o.get(n)+r;a.set(t.offset+e,n===0?0:o.set(n,s))}}}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=Se(t.get(`position`),3),i=t.get(`timeStamps`);i!=null&&n.buffer.layout.fields.has(`timeStamps`)&&k(i.size===4),Ae({position:r,color:t.get(`color`)?.data,size:t.get(`size`)?.data,colorFeature:t.get(`colorFeatureAttribute`)?.data,sizeFeature:t.get(`sizeFeatureAttribute`)?.data,opacityFeature:t.get(`opacityFeatureAttribute`)?.data,distancesToStart:t.get(`distanceToStart`)?.data,timeStamps:i?.data,olidColor:t.get(`olidColor`)?.data},this._isClosed(r.count),n,e)}_writeVertexBuffer(e,t,n){let r=e.get(`position`),i=r.indices,a=r.data.length/3,o=this._isClosed(r.data.length/r.stride),s=a+(o?3:2);i&&i.length!==2*(a-1)&&console.warn(`RibbonLineMaterial does not support indices`),k(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let c=n.from;k(n.numElements===s,`Expected number of elements in TextureBuffer to equal number of points`),je(a,o,this._parameters,t,c)}}function M(e,t,n,r){return r?e/(2*n)+Q*t:(e/2+Q)*t}function*Be(n,r,i,a,o){let s=a?i.count:i.count-1,c=o?.[0]??0,l=o?.[1]??0;t(n,i.get(0,0)+c,i.get(0,1)+l);for(let a=1;a<=s;a++){let o=a%i.count;t(r,i.get(o,0)+c,i.get(o,1)+l),yield a,e(n,r)}}function Ve(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}const He=new be,N=h(),P=h(),F=n(),I=n(),L=h(),Ue=h(),R=h(),z=h(),B=h(),V=h(),H=y(),U=y(),We=b(),Ge=b(),Ke=h(),qe=h(),Je=h(),W=oe(),G=oe(),K=[y(),y(),y(),y()],q=[h(),h(),h(),h()],J=E(),Y=E(),X=E(),Z=E(),Q=4,Ye={getDrapedRibbonLineMaxDistance:M},$=[h(),h()];export{Re as Parameters,Ie as RibbonLineMaterial,Ye as test};
|
|
2
|
+
import{copy as e,set as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as r,subtract as i,dot as a,scale as o,add as s,copy as c,length as l,distance as u,lerp as d,transformMat4 as f,normalize as p,applyTranslation as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import _ from"../../../../core/Logger.js";import{clamp as v}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as y,createScreenPointArray as b}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as x,Seconds as S}from"../../../../core/time.js";import{BufferViewVec3f as ee,BufferViewUint32 as te}from"../../../../geometry/support/buffer/BufferView.js";import{fromPoints as C,distance2 as ne,closestLineSegmentPoint as re,projectPoint as ie,projectPointFraction as ae,create as oe}from"../../../../geometry/support/lineSegment.js";import{fromPoints as w,signedDistance as T,getNormal as se,create as E}from"../../../../geometry/support/plane.js";import{alphaCutoff as ce}from"../../../../webscene/support/AlphaCutoff.js";import{isHighlightOrOLID as le,isColor as D,isDepth as ue,isColorHighlightOLIDOrDepth as de,is2DGeometryOutput as fe}from"../core/shaderLibrary/ShaderOutput.js";import{getScalarAttributeView as O}from"../lib/attributeViewUtils.js";import pe from"../lib/GLMaterial.js";import{LineMaterial as me}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as he}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as ge,screenPolygonIntersectsBufferedSegment as _e}from"../lib/screenPolygonOverlapUtils.js";import{Hit as ve,DrapedHit as ye}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as be}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as xe,assert as k}from"../lib/Util.js";import{createVerticesView as Se}from"../lib/VerticesView.js";import{getLayout as Ce,getTextureBufferLayout as we}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Te}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Ee}from"../shaders/RibbonLineTechniqueConfiguration.js";import{getNumJoinSubdivisions as De,getRibbonLinePositions as A,isClosed as j,getUnpaddedRibbonLinePositionCount as Oe,ribbonLineVertexCount as ke,writeRibbonLineTextureBuffer as Ae,writeRibbonLineVertices as je}from"./internal/ribbonLineBufferUtils.js";import{intersectRayWithWorldSizedLineSegment as Me,intersectScreenPolygonWithWorldSizedLineSegment as Ne}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{isImagePattern as Pe}from"./lineStippleUtils.js";import{VisualVariablePassParameters as Fe}from"./VisualVariablePassParameters.js";class Ie extends me{constructor(e,t){super(e,Re),this.produces=new Map([[2,e=>le(e)||D(e)&&this.parameters.renderOccluded===8],[3,e=>ue(e)&&this._writesGeometryDepthPrepass],[10,e=>de(e)&&this.parameters.renderOccluded===8],[11,e=>de(e)&&this.parameters.renderOccluded===8],[4,e=>D(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>D(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>fe(e)]]),this._configuration=new Ee(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=De(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Ve(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=ce||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>ce}get _writesGeometryDepthPrepass(){return this.parameters.animation!==3}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped(e,t,n,r,i,a,o){if(!t.options.selectionMode)return;let s=this._getLineSize(e,!0),c=A(e,!!this.parameters.isClosed),l=n[0],u=n[1],d=M(s,a,o,this.parameters.usesWorldSizedWidth()),f=Number.MAX_VALUE,p=0;for(let e of Be(F,I,c,j(this.parameters,c.count))){let t=l-F[0],n=u-F[1],r=I[0]-F[0],i=I[1]-F[1],a=r*t+i*n,o=r*r+i*i,s=v(a/o,0,1),c=r*s-t,d=i*s-n,m=c*c+d*d;m<f&&(f=m,p=e)}f<d*d&&r(i.distance,i.renderDistance,i.normal,p)}intersectRay(e,t,n,r,i,a){let{options:o,camera:s}=n;if(!o.selectionMode||!e.visible||!s)return;if(!xe(t)){_.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let c=this._getLineSize(e);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(e,t,n,c,a):this._intersectRayWithScreenSizedLine(e,t,n,c,a)}_intersectRayWithScreenSizedLine(t,n,d,f,p){let{camera:m}=d,h=A(t,!!this.parameters.isClosed),g=V;e(g,d.point);let _=f*m.pixelRatio,v=Q*m.pixelRatio,y=_/2+v;r(K[0],g[0]-y,g[1]+y,0),r(K[1],g[0]+y,g[1]+y,0),r(K[2],g[0]+y,g[1]-y,0),r(K[3],g[0]-y,g[1]-y,0);for(let e=0;e<4;e++)if(!m.unprojectFromRenderScreen(K[e],q[e]))return;w(m.eye,q[0],q[1],J),w(m.eye,q[1],q[2],Y),w(m.eye,q[2],q[3],X),w(m.eye,q[3],q[0],Z);let b=Number.MAX_VALUE,x=0;for(let e of this._forEachTransformedLineSegment(N,P,h,n,j(this.parameters,h.count))){if(T(J,N)<0&&T(J,P)<0||T(Y,N)<0&&T(Y,P)<0||T(X,N)<0&&T(X,P)<0||T(Z,N)<0&&T(Z,P)<0)continue;let t=m.projectToRenderScreen(N,H),n=m.projectToRenderScreen(P,U);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){i(z,N,P);let e=m.frustum,n=-T(e[4],N)/a(z,se(e[4]));if(o(z,z,n),s(N,N,z),!m.projectToRenderScreen(N,t))continue}else if(t[2]>0&&n[2]<0){i(z,P,N);let e=m.frustum,t=-T(e[4],P)/a(z,se(e[4]));if(o(z,z,t),s(P,P,z),!m.projectToRenderScreen(P,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let r=C(t,n,W),l=ne(r,g);if(!(l>=b)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(r,N,P,g,m,f,v);if(l>=e*e)continue}b=l,c(Ke,N),c(qe,P),x=e}}if(b<y*y){let{rayBegin:e,rayEnd:t}=d,n=Number.MAX_VALUE;if(re(C(Ke,qe,W),C(e,t,G),B)){i(B,B,e);let r=l(B);o(B,B,1/r),n=r/u(e,t)}p(n,n,B,x)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,l=A(e,!!this.parameters.isClosed),u=r/(2*s),d=1/0,f=0;for(let e of this._forEachTransformedLineSegment(N,P,l,t,j(this.parameters,l.count))){let t=Me(N,P,u,a,o,Je);if(t!=null&&t<d&&(d=t,f=e,c(B,Je),t===0))break}d<1/0&&i(d,d,B,f)}intersectScreenPolygon(e,t,n,r){let{options:i}=n;if(!i.selectionMode||!e.visible)return null;if(!xe(t))return _.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let a=this._getLineSize(e);return this.parameters.worldSized?this._intersectWorldSizedPolygon(e,t,n,r,a):this._intersectScreenSizedPolygon(e,t,n,r,a)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=A(e,!!this.parameters.isClosed),c=Q,l=c*a.pixelRatio,f=new ve(4);for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count)))for(let[t,n]of o.processLineSegment($,N,P)){if(!ge(a,t,n,H,U))continue;let o=C(H,U,W),s=i/2+c;this.parameters.screenSizePerspective&&(d(V,H,U,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,V,a,i,l)/a.pixelRatio)),a.renderToScreen(H,We),a.renderToScreen(U,Ge),_e(r,We,Ge,s)&&(ie(C(t,n,G),a.eye,L),f.updateIfCloserFromValues(u(a.eye,L),e,L,null))}return f}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=i/(2*s),d=new ve(4);for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count)))for(let[t,n]of o.processLineSegment($,N,P)){ie(C(t,n,G),a.eye,L);let i=u(a.eye,L);d.valid&&i>=d.distance||Ne(t,n,l,a,r)&&d.updateIfCloserFromValues(i,e,L,null)}return d}intersectScreenPolygonDraped(e,t,n,r,i,a){if(!n.options.selectionMode)return null;let o=this._getLineSize(e,!0),s=A(e,!!this.parameters.isClosed),c=M(o,i,a,this.parameters.usesWorldSizedWidth());for(let e of Be(F,I,s,j(this.parameters,s.count),t))if(_e(r,F,I,c))return new ye(e);return null}getPrimitivePositionCount(e,t){let n=(t??e).storage.getField(`position`,ee),r=Oe(n.count,this.parameters.isClosed);return 2*Math.max(0,r-1)}createPrimitivePositionReader(e,t){let n=(t??e).storage.getField(`position`,ee);return(e,t)=>n.getVec(1+Math.ceil(t/2),e)}computeAttachmentOrigin(e,t,n){return!this.parameters.wireframe&&super.computeAttachmentOrigin(e,t,n)}createBufferWriter(){return new ze(Ce(this.parameters),we(this.parameters),this.parameters)}createGLMaterial(e){return new Le(e)}validateParameters(e){k(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:x(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=ae(e,r);d(L,t,n,s),f(Ue,L,i.viewMatrix);let c=l(Ue),u=this.computeCameraAbsCosAngle(L,i,this._configuration.spherical);return He.update(u,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),He.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?p(B,e):r(B,0,0,1),i(R,e,t.eye),p(R,R),Math.abs(a(B,R))}_getLineSize(e,t=!1){let n=this.parameters.width;if(this.parameters.vvSize){let r=O(e,`sizeFeatureAttribute`).get(0);Number.isNaN(r)?t&&(n*=this.parameters.vvSize.fallback[0]):n*=v(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else if(this.parameters.hasVertexSize){let t=O(e,`size`);t!=null&&(n*=t.get(0))}return n}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.count:n.count-1;for(let i=0;i<a;i++)n.getVec(i,e),m(e,e,r),n.getVec((i+1)%n.count,t),m(t,t,r),yield i}}class Le extends pe{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Te,e)}}class Re extends Fe{constructor(){super(...arguments),this._width=0,this.color=g,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=S(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=S(0),this.endTime=S(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return Pe(this.stipplePattern)&&this.stippleTexture!=null}}class ze{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.maxTextureBufferItemIndex=he.getField(0).max}_isClosed(e){return j(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){let t=e.get(`position`);return t.data.length/3+(this._isClosed(t.data.length/t.stride)?3:2)}elementCount(e){let t=e.get(`position`),n=t.indices.length/2+1;return ke(n,this._isClosed(t.data.length/t.stride),this._parameters)}rebaseBuffers(e,t,n,r){if(r?.buffer.copyFrom(e.storage,0,r.offset),t!=null){let r=n.from,i=e.vertex.getField(`ribbonLineVertexInfo`,te),a=t.buffer.getField(`ribbonLineVertexInfo`,te),o=he.getField(0);for(let e=0;e<i.count;e++){let n=i.get(e),s=o.get(n)+r;a.set(t.offset+e,n===0?0:o.set(n,s))}}}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=Se(t.get(`position`),3),i=t.get(`timeStamps`);i!=null&&n.buffer.layout.fields.has(`timeStamps`)&&k(i.size===4),Ae({position:r,color:t.get(`color`)?.data,size:t.get(`size`)?.data,colorFeature:t.get(`colorFeatureAttribute`)?.data,sizeFeature:t.get(`sizeFeatureAttribute`)?.data,opacityFeature:t.get(`opacityFeatureAttribute`)?.data,distancesToStart:t.get(`distanceToStart`)?.data,timeStamps:i?.data,olidColor:t.get(`olidColor`)?.data},this._isClosed(r.count),n,e)}_writeVertexBuffer(e,t,n){let r=e.get(`position`),i=r.indices,a=r.data.length/3,o=this._isClosed(r.data.length/r.stride),s=a+(o?3:2);i&&i.length!==2*(a-1)&&console.warn(`RibbonLineMaterial does not support indices`),k(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let c=n.from;k(n.numElements===s,`Expected number of elements in TextureBuffer to equal number of points`),je(a,o,this._parameters,t,c)}}function M(e,t,n,r){return r?e/(2*n)+Q*t:(e/2+Q)*t}function*Be(n,r,i,a,o){let s=a?i.count:i.count-1,c=o?.[0]??0,l=o?.[1]??0;t(n,i.get(0,0)+c,i.get(0,1)+l);for(let a=1;a<=s;a++){let o=a%i.count;t(r,i.get(o,0)+c,i.get(o,1)+l),yield a,e(n,r)}}function Ve(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}const He=new be,N=h(),P=h(),F=n(),I=n(),L=h(),Ue=h(),R=h(),z=h(),B=h(),V=h(),H=y(),U=y(),We=b(),Ge=b(),Ke=h(),qe=h(),Je=h(),W=oe(),G=oe(),K=[y(),y(),y(),y()],q=[h(),h(),h(),h()],J=E(),Y=E(),X=E(),Z=E(),Q=4,Ye={getDrapedRibbonLineMaxDistance:M},$=[h(),h()];export{Re as Parameters,Ie as RibbonLineMaterial,Ye as test};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{toConst as i}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as a}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import{removeMaybe as o,destroyMaybe as s}from"../../../../core/maybe.js";import{when as ee,initial as c,watch as l,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{addFrameTask as d}from"../../../../core/scheduling.js";import{signal as f}from"../../../../core/signal.js";import{Milliseconds as p}from"../../../../core/time.js";import{isMoon as m,isMars as h}from"../../../../geometry/ellipsoidUtils.js";import{noBudget as te}from"../../../support/Scheduler.js";import{checkWebGLError as g}from"../../../webgl/checkWebGLError.js";import{debugFlags as _}from"../../support/debugFlags.js";import{ComponentObjectCollection as v}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as y}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as b}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{LocalAtmosphere as x}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as S}from"../effects/atmosphere/MarsAtmosphere.js";import{RealisticAtmosphere as C}from"../effects/atmosphere/RealisticAtmosphere.js";import{Fog as w}from"../effects/fog/Fog.js";import{ObjectAndLayerID as T}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as E}from"../effects/geometry/olidUtils.js";import{RenderOccluded as D}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as O}from"../effects/globalIllumination/GlobalIllumination.js";import{Haze as k}from"../effects/haze/Haze.js";import{Highlight as A}from"../effects/highlight/Highlight.js";import{ShadowHighlight as j}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as M}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as N}from"../effects/magnifier/Magnifier.js";import{ShadowAccumulator as P}from"../effects/shadowAccumulation/ShadowAccumulator.js";import{ShadowCastRenderer as ne}from"../effects/shadowAccumulation/ShadowCastRenderer.js";import{SMAA as F}from"../effects/smaa/SMAA.js";import{SSAO as I}from"../effects/ssao/SSAO.js";import{Stars as L}from"../effects/stars/Stars.js";import{EmissionComposite as R}from"../lib/EmissionComposite.js";import{GLMaterialRepository as z}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as B}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as V}from"../lib/Renderer.js";import{RenderingContext as H}from"../lib/RenderingContext.js";import{RenderingContextOptions as U}from"../lib/RenderingContextOptions.js";import{TextureRepository as W}from"../lib/TextureRepository.js";import{WaterTextureRepository as G}from"../materials/internal/WaterTextureRepository.js";import{createMarkerTextureRepository as K}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as q}from"../materials/stippleTextureRepository.js";import{getContextCache as J}from"./contextCache.js";import{removeLoadedShaderModules as Y}from"./renderUtils.js";import{ScreenshotManager as X,ScreenshotContext as Z}from"./ScreenshotManager.js";import{contextCache as re}from"./testUtils.js";const ie=has(`disable-feature:async-navigation-3d-depth-readback`);let Q=class extends t{constructor(e,t){super(e),this.olidRenderHelper=E()?new B:null,this.waterTextures=new G,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._fog=f(null),this.globalIllumination=null,this.shadowAccumulator=null,this.test=null,this._initializeContext(t);let{memoryController:n}=t.view.resourceController;this.stippleTextures=q(this._rctx,n),this.markerTextures=K(this._rctx,n),this.techniques=new b(new y(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new W(t),this.addHandles(this.textures.events.on(`changed`,e=>this.requestRender(e)));let r=new z(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new V(t,r,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([ee(()=>t.view.ready,()=>this._createRenderNodes(),c),l(()=>this.waterTextures.updating,()=>this.requestRender(),c),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),u),l(()=>t.view.environment.lighting.globalIllumination,e=>this.renderer?.updateGlobalIllumination(e),u)]);let i={renderScene:(e,t,n,r)=>(this.renderer.setTime(t),this.renderer.render(e,n,r)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,n,r)=>t.options.screenshot.renderOverlay(e,n,r)};this._screenshotManager=new X(this._rctx,i,e=>t.view.overlayManager.updateOverlays(te,e.camera,0)),this._registerFrameTask(t)}destroy(){let e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=o(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=s(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.globalIllumination=null,this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=s(this._rctx),this.test?.destroy()}_createRenderNodes(){let{view:e,viewingMode:t}=this.stage;this.shadowAccumulator=new P({view:e}),this.shadowAccumulator.accumulationRenderer=new ne({view:e,data:this.shadowAccumulator}),this.renderer.setShadowAccumulator(this.shadowAccumulator),new L({view:e}),m(e.spatialReference)||(t===2?new x({view:e}):h(e.spatialReference)?new S({view:e}):(new C({view:e}),new k({view:e}),this._fog.value=new w({view:e}))),new I({view:e}),this.globalIllumination=new O({view:e});let n=new F({view:e,isEnabled:()=>this.renderer.hasSMAA});new N({view:e}),new A({view:e,antialias:n}),new M({view:e}),new j({view:e,viewingMode:t}),new R({view:e}),new D({view:e}),E()&&new T({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulation();case 0:this._needsRender=!0}}get updating(){let e=this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating;return e&&_.UPDATING&&console.log(` RenderView:`,this._needsUpdate,this._needsWaterReflectionUpdate,this.renderer.updating,this.textures.updating,this.waterTextures.updating),e}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(i(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,n,r,i,a=i){let o=ie?this._readMainDepthSynchronously(t,n,r,i,a):this.renderer.navigationDepthCache.getMinimalDepthForArea(t,n,r,i,a)??Number.MAX_VALUE;if(e){let i=e.pickDepth(t*r.pixelRatio,n*r.pixelRatio,r);i!=null&&o>i&&i!==r.nearFar[0]&&i!==r.nearFar[1]&&(o=i)}return o===Number.MAX_VALUE?void 0:o}whenRepresentativeDepthForArea(e,t,n,r,i,a=1){return this.renderer.navigationDepthCache.whenRepresentativeDepthForArea(e,t,n,r,i,a)}_readMainDepthSynchronously(e,t,n,r,i){let a=n.constrainWindowSize(e,t,r*n.pixelRatio,i*n.pixelRatio),o=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,o);let s=Number.MAX_VALUE;for(let e=0;e<a[2]*a[3];e++){let t=this._linearDepthFromTexture(e*4,o,n.nearFar);s>t&&t!==n.nearFar[0]&&t!==n.nearFar[1]&&(s=t)}return s}_linearDepthFromTexture(e,t,n){return a(t,e)*(n[1]-n[0])+n[0]}_ensureLinearDepthArrayBuffer(e){let t=4*e[2]*e[3];return(this._tmpDepthBuffer==null||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){Y(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){let t=e.view.state,n=!1,r=0,i=!1,a={preRender:({time:i})=>{n=this.updating,r=+!!this._needsUpdate,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;let a=p(i-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(a>this.renderer.animationTimestep||n||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){let e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),i=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();let n=new Z(t,this.renderer.fboCache,this.globalIllumination?.isAccumulating??!1);e=this.test?.time??e,this._screenshotManager.update(n,e)},finish:()=>{i&&=(this.renderer.finish(t.mode===2?r:1),!1)}};this._frameTask=d(a)}_initializeContext(e){let{options:t}=e,{canvas:n,gl:r}=t.context;n.setAttribute(`style`,`width: 100%; height:100%; display:block;`),this._canvas=n,g(r,!0),this._rctx=ae(r,e),this._loadShaderOnlyExtensions();let{container:i}=e;!this._rctx.contextAttributes.alpha&&has(`safari`)>=11&&(i.style.backgroundColor=`black`),i.contains(n)||i.appendChild(n)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable(`textureFloatLinear`)}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new v(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){this.test?.time!=null&&e.fadeDuration!=null&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=p(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}get fog(){return i(this._fog.value)}};e([n()],Q.prototype,`updating`,null),e([n({constructOnly:!0})],Q.prototype,`view`,void 0),e([n({readOnly:!0})],Q.prototype,`componentObjectCollection`,null),e([n()],Q.prototype,`_componentObjectCollection`,void 0),e([n()],Q.prototype,`_needsUpdate`,void 0),e([n()],Q.prototype,`_needsWaterReflectionUpdate`,void 0),Q=e([r(`esri.views.3d.webgl-engine.parts.RenderView`)],Q);function ae(e,t){let n=new U(t);if(re.enabled){let t=$.get(e);return t?.refCount===1?(t.configure(n),t.ref(),t):(t=new H(e,n),$.set(e,t),t.ref(),t)}return new H(e,n)}const $=J();export{Q as RenderView};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{toConst as i}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as a}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import{removeMaybe as o,destroyMaybe as s}from"../../../../core/maybe.js";import{when as ee,initial as c,watch as l,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{addFrameTask as d}from"../../../../core/scheduling.js";import{signal as f}from"../../../../core/signal.js";import{Milliseconds as p}from"../../../../core/time.js";import{isMoon as m,isMars as h}from"../../../../geometry/ellipsoidUtils.js";import{noBudget as te}from"../../../support/Scheduler.js";import{checkWebGLError as g}from"../../../webgl/checkWebGLError.js";import{debugFlags as _}from"../../support/debugFlags.js";import{ComponentObjectCollection as v}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as y}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as b}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{LocalAtmosphere as x}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as S}from"../effects/atmosphere/MarsAtmosphere.js";import{RealisticAtmosphere as C}from"../effects/atmosphere/RealisticAtmosphere.js";import{Fog as w}from"../effects/fog/Fog.js";import{ObjectAndLayerID as T}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as E}from"../effects/geometry/olidUtils.js";import{RenderOccluded as D}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as O}from"../effects/globalIllumination/GlobalIllumination.js";import{Haze as k}from"../effects/haze/Haze.js";import{Highlight as A}from"../effects/highlight/Highlight.js";import{ShadowHighlight as j}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as M}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as N}from"../effects/magnifier/Magnifier.js";import{ShadowAccumulator as P}from"../effects/shadowAccumulation/ShadowAccumulator.js";import{ShadowCastRenderer as ne}from"../effects/shadowAccumulation/ShadowCastRenderer.js";import{SMAA as F}from"../effects/smaa/SMAA.js";import{SSAO as I}from"../effects/ssao/SSAO.js";import{Stars as L}from"../effects/stars/Stars.js";import{EmissionComposite as R}from"../lib/EmissionComposite.js";import{GLMaterialRepository as z}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as B}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as V}from"../lib/Renderer.js";import{RenderingContext as H}from"../lib/RenderingContext.js";import{RenderingContextOptions as U}from"../lib/RenderingContextOptions.js";import{TextureRepository as W}from"../lib/TextureRepository.js";import{WaterTextureRepository as G}from"../materials/internal/WaterTextureRepository.js";import{createMarkerTextureRepository as K}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as q}from"../materials/stippleTextureRepository.js";import{getContextCache as J}from"./contextCache.js";import{removeLoadedShaderModules as Y}from"./renderUtils.js";import{ScreenshotManager as X,ScreenshotContext as Z}from"./ScreenshotManager.js";import{contextCache as re}from"./testUtils.js";const ie=has(`disable-feature:async-navigation-3d-depth-readback`);let Q=class extends t{constructor(e,t){super(e),this.olidRenderHelper=E()?new B:null,this.waterTextures=new G,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._fog=f(null),this.globalIllumination=null,this.shadowAccumulator=null,this.test=null,this._initializeContext(t);let{memoryController:n}=t.view.resourceController;this.stippleTextures=q(this._rctx,n),this.markerTextures=K(this._rctx,n),this.techniques=new b(new y(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new W(t),this.addHandles(this.textures.events.on(`changed`,e=>this.requestRender(e)));let r=new z(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new V(t,r,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([ee(()=>t.view.ready,()=>this._createRenderNodes(),c),l(()=>this.waterTextures.updating,()=>this.requestRender(),c),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),u),l(()=>t.view.environment.lighting.globalIllumination,e=>this.renderer?.updateGlobalIllumination(e),u)]);let i={renderScene:(e,t,n,r)=>(this.renderer.setTime(t),this.renderer.render(e,n,r)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,n,r)=>t.options.screenshot.renderOverlay(e,n,r)};this._screenshotManager=new X(this._rctx,i,e=>t.view.overlayManager.updateOverlays(te,e.camera,0)),this._registerFrameTask(t)}destroy(){let e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=o(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=s(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.globalIllumination=null,this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=s(this._rctx),this.test?.destroy()}_createRenderNodes(){let{view:e}=this.stage;this.shadowAccumulator=new P({view:e}),this.shadowAccumulator.accumulationRenderer=new ne({view:e,data:this.shadowAccumulator}),this.renderer.setShadowAccumulator(this.shadowAccumulator),new L({view:e}),m(e.spatialReference)||(this._isGlobal?h(e.spatialReference)?new S({view:e}):(new C({view:e}),new k({view:e}),this._fog.value=new w({view:e})):new x({view:e})),new I({view:e}),this.globalIllumination=new O({view:e});let t=new F({view:e,isEnabled:()=>this.renderer.hasSMAA});new N({view:e}),new A({view:e,antialias:t}),new M({view:e}),new j({view:e,isGlobal:this._isGlobal}),new R({view:e}),new D({view:e}),E()&&new T({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulation();case 0:this._needsRender=!0}}get updating(){let e=this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating;return e&&_.UPDATING&&console.log(` RenderView:`,this._needsUpdate,this._needsWaterReflectionUpdate,this.renderer.updating,this.textures.updating,this.waterTextures.updating),e}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(i(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,n,r,i,a=i){let o=ie?this._readMainDepthSynchronously(t,n,r,i,a):this.renderer.navigationDepthCache.getMinimalDepthForArea(t,n,r,i,a)??Number.MAX_VALUE;if(e){let i=e.pickDepth(t*r.pixelRatio,n*r.pixelRatio,r);i!=null&&o>i&&i!==r.nearFar[0]&&i!==r.nearFar[1]&&(o=i)}return o===Number.MAX_VALUE?void 0:o}whenRepresentativeDepthForArea(e,t,n,r,i,a=1){return this.renderer.navigationDepthCache.whenRepresentativeDepthForArea(e,t,n,r,i,a)}_readMainDepthSynchronously(e,t,n,r,i){let a=n.constrainWindowSize(e,t,r*n.pixelRatio,i*n.pixelRatio),o=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,o);let s=Number.MAX_VALUE;for(let e=0;e<a[2]*a[3];e++){let t=this._linearDepthFromTexture(e*4,o,n.nearFar);s>t&&t!==n.nearFar[0]&&t!==n.nearFar[1]&&(s=t)}return s}_linearDepthFromTexture(e,t,n){return a(t,e)*(n[1]-n[0])+n[0]}_ensureLinearDepthArrayBuffer(e){let t=4*e[2]*e[3];return(this._tmpDepthBuffer==null||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){Y(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){let t=e.view.state,n=!1,r=0,i=!1,a={preRender:({time:i})=>{n=this.updating,r=+!!this._needsUpdate,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;let a=p(i-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(a>this.renderer.animationTimestep||n||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){let e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),i=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();let n=new Z(t,this.renderer.fboCache,this.globalIllumination?.isAccumulating??!1);e=this.test?.time??e,this._screenshotManager.update(n,e)},finish:()=>{i&&=(this.renderer.finish(t.mode===2?r:1),!1)}};this._frameTask=d(a)}_initializeContext(e){let{options:t}=e,{canvas:n,gl:r}=t.context;n.setAttribute(`style`,`width: 100%; height:100%; display:block;`),this._canvas=n,g(r,!0),this._rctx=ae(r,e),this._loadShaderOnlyExtensions();let{container:i}=e;!this._rctx.contextAttributes.alpha&&has(`safari`)>=11&&(i.style.backgroundColor=`black`),i.contains(n)||i.appendChild(n)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable(`textureFloatLinear`)}get _isGlobal(){return this.stage.isGlobal}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new v(this.renderer.renderPassManager,this._isGlobal,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){this.test?.time!=null&&e.fadeDuration!=null&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=p(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}get fog(){return i(this._fog.value)}};e([n()],Q.prototype,`updating`,null),e([n({constructOnly:!0})],Q.prototype,`view`,void 0),e([n({readOnly:!0})],Q.prototype,`componentObjectCollection`,null),e([n()],Q.prototype,`_componentObjectCollection`,void 0),e([n()],Q.prototype,`_needsUpdate`,void 0),e([n()],Q.prototype,`_needsWaterReflectionUpdate`,void 0),Q=e([r(`esri.views.3d.webgl-engine.parts.RenderView`)],Q);function ae(e,t){let n=new U(t);if(re.enabled){let t=$.get(e);return t?.refCount===1?(t.configure(n),t.ref(),t):(t=new H(e,n),$.set(e,t),t.ref(),t)}return new H(e,n)}const $=J();export{Q as RenderView};
|
package/views/MapView.d.ts
CHANGED
|
@@ -123,6 +123,7 @@ export interface MapViewProperties extends View2DProperties {}
|
|
|
123
123
|
*
|
|
124
124
|
* // Set the center and zoom level on the view.
|
|
125
125
|
* // In this case, the view's spatial reference wkid is 3031
|
|
126
|
+
* readonly viewingMode: "local";
|
|
126
127
|
* // center is lat/long. The projectOperator will be loaded dynamically
|
|
127
128
|
* // to project the center to match the spatial reference of the view
|
|
128
129
|
* const view = new MapView({
|
package/views/SceneView.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a,ensureClass as o}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as s}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as c}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ee}from"../core/accessorSupport/trackingUtils.js";import l from"../core/Collection.js";import{byId as te}from"../core/domUtils.js";import u from"../core/Error.js";import{on as ne}from"../core/events.js";import{destroyHandle as re,makeHandle as d}from"../core/handleUtils.js";import has from"../core/has.js";import{create as ie}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ae}from"../core/libs/rbush/PooledRBush.js";import f from"../core/Logger.js";import{mapCollectionAsync as oe}from"../core/mapCollectionUtils.js";import{destroyMaybe as p,maybeProperty as se}from"../core/maybe.js";import{throwIfDestroyed as ce,throwIfAborted as m,createAbortError as le}from"../core/promiseUtils.js";import ue from"../core/ReactiveSet.js";import{on as h,watch as g,initial as _,sync as v,whenOnce as y,syncAndInitial as b}from"../core/reactiveUtils.js";import{setFrameDuration as de,cleanupScheduling as fe}from"../core/scheduling.js";import{createScreenPoint as pe,createScreenPointArray as me}from"../core/screenUtils.js";import{cleanupWhereClauseCache as he}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as ge,getMetersPerUnitForSR as x}from"../core/units.js";import{initialize as _e}from"../core/workers/workers.js";import S from"../geometry/Extent.js";import ve from"../geometry/HeightModelInfo.js";import ye from"../geometry/Point.js";import{projectBoundingRect as be}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as xe}from"../geometry/projection/projectPointToVector.js";import{project as Se,canProjectWithoutEngine as Ce}from"../geometry/projectionUtils.js";import C from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as we}from"../geometry/spatialReferenceEllipsoidUtils.js";import{toExtent as Te,create as Ee}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as De}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Oe}from"../geometry/support/scaleUtils.js";import{wgs84 as ke,webMercator as Ae}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as je}from"../layers/graphics/dehydratedPoint.js";import{IntegratedMeshSemantics as w}from"../layers/support/IntegratedMeshSemantics.js";import{isImageryTileLayer as T,isTiledLayer as E,isVoxelLayer as D,isIntegratedMeshLayer as O,isGaussianSplatLayer as Me}from"../layers/support/layerUtils.js";import{TilemapCache as Ne}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Pe}from"../portal/portalDefault.js";import{WebSceneTag as Fe}from"../support/tagSymbols.js";import Ie from"../Viewpoint.js";import Le from"../webscene/Environment.js";import{clearVNodeCache as Re}from"../widgets/support/vnodeCache.js";import{importAnalysisViewModule as ze}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Be}from"./3d/camera/intersectionUtils.js";import k from"./3d/constraints/Constraints.js";import A from"./3d/environment/Environment.js";import{EnvironmentView as Ve}from"./3d/environment/EnvironmentView.js";import{GroundView3D as He}from"./3d/GroundView3D.js";import Ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as We}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ge}from"./3d/layers/graphics/Labeler.js";import Ke from"./3d/layers/i3s/I3SLodHandling.js";import{layerView3DImporter as j}from"./3d/layerViewModuleImportUtils.js";import{Navigation3D as qe}from"./3d/navigation/Navigation3D.js";import{cleanupPointToPointAnimationController as Je}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Ye}from"./3d/state/helpers/SceneIntersectionHelper.js";import{ScreenSizePerspective as Xe}from"./3d/state/ScreenSizePerspective.js";import{cleanupNavigationUtils as Ze}from"./3d/state/utils/navigationUtils.js";import M from"./3d/state/ViewState.js";import{ViewStateManager as Qe,cleanupViewStateManager as $e}from"./3d/state/ViewStateManager.js";import et from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as tt}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as N}from"./3d/support/debugFlags.js";import{getElevationAtPoint as nt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as rt}from"./3d/support/GroundAndIMSurface.js";import{toMap as it,hitTest as at}from"./3d/support/hitTest.js";import{PointsOfInterest as P}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import{popupHitTest as ot}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as st,getQualityProfileSettings as F}from"./3d/support/QualityProfile.js";import I from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as ct}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as lt}from"./3d/support/ResourceController.js";import ut from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as dt}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ft}from"./3d/support/ViewSlice.js";import L from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as pt,getTiledLayerInfo as mt,checkIfTileInfoSupportedForView as ht}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as gt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as _t}from"./3d/terrain/TileRenderer.js";import{createWebGLContext as vt}from"./3d/webgl-engine/createWebGLContext.js";import{olidEnabled as yt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as bt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{cleanupEdgeProcessing as xt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import{defaultTolerance as R}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as St}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as z}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{Stage as Ct}from"./3d/webgl-engine/Stage.js";import{BreakpointsOwner as wt}from"./BreakpointsOwner.js";import{DOMContainer as Tt}from"./DOMContainer.js";import B from"./interactive/options/ViewOptions.js";import{PopupView as Et}from"./PopupView.js";import Dt from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as Ot}from"./support/drapedUtils.js";import{occludeesSupported as kt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as V,createScreenPointFromSupportedEvent as H}from"./support/screenUtils.js";import{isSpatialReferenceSupported as U}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as At,destroyTextureCompressionWorker as jt}from"./support/TextureCompressionHelper.js";import W from"./ui/3d/DefaultUI3D.js";import Mt from"./ui/DefaultUI.js";import G from"./View.js";import Nt from"./ViewAnimation.js";import{stringFromViewingMode as K,viewingModeFromString as q}from"./ViewingMode.js";var J;const Pt=Symbol(),Y=Symbol();function Ft(e){let t=o(B,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let X=class extends wt(Et(Tt(G))){static{J=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new B({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=lt(this),this.deconflictor=new We({view:this}),this.attribution3D=new et({view:this}),this.labeler=new Ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new qe({view:this}),this.basemapTerrain=null,this.elevationProvider=new tt({view:this}),this._canvas=null,this.constraints=new k,this._environment=new A,this.environmentView=new Ve,this.floors=new l,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Dt({importAnalysisViewModule:e=>ze(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ue,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new M({view:this}),this.slice=new ft,this.renderCoordsHelper=new ct,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new W,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,_e();let t=()=>this._updatingChanged();this.addHandles(re(oe(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([h(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),g(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ue({view:this}),this.stateManager=new Qe({view:this}),this.screenSizePerspective=new Xe({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=At(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new He({view:this}),this.groundAndIMSurface=new rt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>de(e>0?1e3/Math.ceil(e):0),_),this.addHandles([g(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),v),g(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),v)])}destroy(){this.destroyed||(jt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set(`labeler`,p(this.labeler)),this._set(`deconflictor`,p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set(`stateManager`,p(this.stateManager)),this._set(`inputManager`,p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,p(this.environmentView)),this._set(`environment`,p(this.environment)),this.groundView=p(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=a(ye,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||se(e,`clippingArea`);return!(this._userClippingArea||se(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof S?this.spatialReference&&(t=Z(t,this.spatialReference),t==null)?(f.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(f.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?f.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.isGlobal)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:Z(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||C.WGS84,n=Z(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||C.WGS84,t,n=n=>{let r=Z(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new S({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent==null||e.type===`graphics`&&e.internal||n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof A?e:e instanceof Le?this.environment?.cloneWithWebsceneEnvironment(e)??A.fromWebsceneEnvironment(e):a(A,e):new A}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return J._layerToLayerview}static{this._layerToLayerview=G._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Fe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=F(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new I(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||st()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?c(()=>Oe(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=ge(this.spatialReference);if(t&&e.heightUnit!==t)return new ve({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&f.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||pt(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return N.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this.groundView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return N.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedViewingMode;if(e!=null)return K(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?K(this.defaultsFromMap.viewingMode):U(t,1)?`global`:`local`:`global`}set viewingMode(e){this.ready?f.getLogger(this).error(`#viewingMode`,`viewingMode cannot be set once view is ready`):this._overrideIfSome(`viewingMode`,e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ut(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return f.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return it(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return f.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=Lt,t.x=e.x,t.y=e.y,t.z=nt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),xe(t,Q,this.renderSpatialReference),this.state.camera.projectToScreen(Q,$),pe($[0],$[1])}pixelSizeAt(e,t){if(!this.ready)return f.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;xe(e,Q,n);let r=this.state.camera.computeScreenPixelSizeAt(Q);return t&&n!==t?r*x(n)/x(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return f.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return at(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return ot(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new u(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!yt())throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),a=await this._completeSettings(e);return a.format=`png`,[i,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return j.importLayerView(e)}hasLayerViewModule(e){return j.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedViewingMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:q(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n?r(n):[...r(1)??[],...r(2)??[]];return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return U(e,n)?t==null||T(t)?!0:!(E(t)&&mt(t,e,n)==null||D(t)&&n===1):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,viewingMode:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?C.WGS84:C.WebMercator:new C({...i?ke:Ae,vcsWkid:o,latestVcsWkid:s});return T(t)&&(i||a)?!(a&&r!==2)||ht(t.tileInfo,t.fullExtent,e,1)===null?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:[{spatialReference:c(),viewingMode:n}]:!E(t)&&!D(t)&&(i||a)?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:n}]:E(t)&&i&&n!==1?[{spatialReference:e,viewingMode:n},{spatialReference:c(),viewingMode:2}]:[{spatialReference:e,viewingMode:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedViewingMode;return t||(n==null?e.isGeographic&&f.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):f.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${K(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return f.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return f.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&kt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await y(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),d(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await Rt[e]();if(t&&(ce(this),m(n.signal),await t(n.signal)),this.destroyed)throw le();return m(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new L({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new P({view:this})),this.addHandles([this.updatingHandles.add(()=>N.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&N.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},b),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?Se(Te(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},b),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},v)],Pt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Y),this.removeHandles(Pt),this._featureTiles=p(this.featureTiles),this._set(`pointsOfInterest`,p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=De(t,e);n!==this.renderSpatialReference&&(this.renderCoordsHelper.viewingMode=this.state.viewingMode,this.renderCoordsHelper.spatialReference=n,t||this.addHandles(g(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&be(e,this.groundView.spatialReference,It,t)&&(this.renderCoordsHelper.extent=It)},v),Y),this.sceneIntersectionHelper?.setTolerance(R/this.renderCoordsHelper.unitInMeters))}}_exitCoordinateSystem(){this.removeHandles(Y)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(g(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),v),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(e){let t={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,context:e,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},n=new Ye(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,n);let r=te(this.surface);this._stage=new Ct({view:this,options:t,container:r}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),ne(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new u(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.sceneIntersectionHelper.setTolerance(R/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=p(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface();let e=vt(this.renderCanvas,{alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled});this._initStage(e),this._initGlobe(),this.sharedSymbolResources=new dt({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>y(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){q(this.viewingMode)===1&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(h(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?s(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(z);for(let t of this.allLayerViews)(O(t.layer)&&w.shouldIntersectAsGround(t.layer)||Me(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(z);for(let t of this.allLayerViews)O(t.layer)&&w.shouldIntersectAsGround(t.layer)&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Re(),ee(),he(),xt(),$e(),Be(),we(),Ot(),Pe(),_t(),St(),Je(),Ze(),ae(),fe(),bt(),gt(),Ke.cleanupI3SLodHandling(),Ne.cleanupTilemapCache(),M.cleanupViewstate(),L.cleanupTerrainSurface()}};e([n({nonNullable:!0}),r(Ft)],X.prototype,`options`,void 0),e([n()],X.prototype,`_userClippingArea`,void 0),e([n()],X.prototype,`_resourceController`,void 0),e([n()],X.prototype,`stage`,null),e([n({readOnly:!0})],X.prototype,`deconflictor`,void 0),e([n({readOnly:!0})],X.prototype,`labeler`,void 0),e([n()],X.prototype,`navigation`,void 0),e([n({type:Nt,readOnly:!0})],X.prototype,`animation`,null),e([n({readOnly:!0})],X.prototype,`basemapTerrain`,void 0),e([n({readOnly:!0})],X.prototype,`overlayManager`,null),e([n({readOnly:!0})],X.prototype,`elevationProvider`,void 0),e([n()],X.prototype,`camera`,null),e([n({type:t})],X.prototype,`contentCamera`,null),e([n({readOnly:!0})],X.prototype,`canvas`,null),e([n({type:ye,useTypeForAutocast:!1})],X.prototype,`center`,null),e([n({type:S})],X.prototype,`clippingArea`,null),e([n({type:k,nonNullable:!0})],X.prototype,`constraints`,void 0),e([n({type:S,readOnly:!0})],X.prototype,`renderDataExtent`,null),e([n({readOnly:!0})],X.prototype,`tileInfo`,null),e([n({type:S,readOnly:!0})],X.prototype,`dataExtent`,null),e([n({type:S,readOnly:!0})],X.prototype,`_groundAndLayersExtent`,null),e([n({type:A})],X.prototype,`environment`,null),e([r(`environment`)],X.prototype,`castEnvironment`,null),e([n({readOnly:!0})],X.prototype,`environmentView`,void 0),e([n({type:S})],X.prototype,`extent`,null),e([n({type:l})],X.prototype,`floors`,void 0),e([n()],X.prototype,`screenCenter`,null),e([n()],X.prototype,`frustum`,null),e([n({type:Number,readOnly:!0})],X.prototype,`fullOpacity`,void 0),e([n({readOnly:!0})],X.prototype,`graphicsView`,void 0),e([n()],X.prototype,`analysisViewManager`,void 0),e([n()],X.prototype,`groundView`,void 0),e([n({readOnly:!0})],X.prototype,`layerviewCollections`,null),e([n({type:Boolean})],X.prototype,`initialExtentRequired`,null),e([n()],X.prototype,`defaultsFromMapSettings`,null),e([n()],X.prototype,`interacting`,null),e([n()],X.prototype,`stationary`,null),e([n()],X.prototype,`navigating`,null),e([n()],X.prototype,`map`,void 0),e([n()],X.prototype,`padding`,null),e([n({type:P,readOnly:!0})],X.prototype,`pointsOfInterest`,void 0),e([n()],X.prototype,`_featureTiles`,void 0),e([n()],X.prototype,`featureTiles`,null),e([n()],X.prototype,`_featureTreeDebugger`,void 0),e([n({constructOnly:!0})],X.prototype,`deactivatedWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`debugWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`renderCanvas`,void 0),e([n({constructOnly:!0})],X.prototype,`state`,void 0),e([n()],X.prototype,`screenSizePerspective`,void 0),e([n({readOnly:!0})],X.prototype,`inputManager`,void 0),e([n({readOnly:!0})],X.prototype,`stateManager`,void 0),e([n({type:[`low`,`medium`,`high`]})],X.prototype,`qualityProfile`,null),e([n({type:I,get(){let e=this._get(`qualitySettings`);if(!e){let t=F(this.qualityProfile);e=new I(t)}return e}})],X.prototype,`qualitySettings`,void 0),e([n()],X.prototype,`slice`,void 0),e([n({readOnly:!0})],X.prototype,`typeSpecificPreconditionsReady`,null),e([n({readOnly:!0})],X.prototype,`sceneIntersectionHelper`,void 0),e([n({type:Number,readOnly:!0})],X.prototype,`resolution`,null),e([n({type:Number})],X.prototype,`scale`,null),e([n({readOnly:!0,type:Number})],X.prototype,`terrainLevel`,null),e([n()],X.prototype,`heightModelInfo`,null),e([n({type:C})],X.prototype,`spatialReference`,void 0),e([n({type:Boolean,value:!1})],X.prototype,`alphaCompositingEnabled`,null),e([n({constructOnly:!0})],X.prototype,`preserveDrawingBufferEnabled`,void 0),e([n({type:Boolean})],X.prototype,`supersampleScreenshotsEnabled`,void 0),e([n({readOnly:!0})],X.prototype,`type`,void 0),e([n(),r(e=>e instanceof Mt?e:o(W,e))],X.prototype,`ui`,void 0),e([n({type:Boolean,readOnly:!0})],X.prototype,`updating`,null),e([n()],X.prototype,`_updatingObjects`,null),e([n()],X.prototype,`_updatingObjectsWithProgress`,null),e([n()],X.prototype,`_updatingObjectsToDebug`,null),e([n({type:Number,readOnly:!0})],X.prototype,`updatingProgress`,void 0),e([n({type:[`global`,`local`]})],X.prototype,`viewingMode`,null),e([n({type:Ie})],X.prototype,`viewpoint`,null),e([n({readOnly:!0})],X.prototype,`visibleArea`,null),e([n({type:Number})],X.prototype,`zoom`,null),e([n({readOnly:!0})],X.prototype,`quality`,null),e([n({readOnly:!0})],X.prototype,`resolutionScale`,null),e([n()],X.prototype,`focusAreasView`,void 0),e([n()],X.prototype,`_defaultToMapOptions`,null),e([n()],X.prototype,`_defaultHitTestOptions`,null),X=J=e([i(`esri.views.SceneView`)],X);function Z(e,t){return e!=null&&Ce(e.spatialReference,t)?Se(e,t):null}const Q=ie(),$=me(),It=Ee(),Lt=je(0,0,0,C.WebMercator),Rt={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},zt=X;export{zt as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a,ensureClass as o}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as s}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as c}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ee}from"../core/accessorSupport/trackingUtils.js";import l from"../core/Collection.js";import{byId as te}from"../core/domUtils.js";import u from"../core/Error.js";import{on as ne}from"../core/events.js";import{destroyHandle as re,makeHandle as d}from"../core/handleUtils.js";import has from"../core/has.js";import{create as ie}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ae}from"../core/libs/rbush/PooledRBush.js";import f from"../core/Logger.js";import{mapCollectionAsync as oe}from"../core/mapCollectionUtils.js";import{destroyMaybe as p,maybeProperty as se}from"../core/maybe.js";import{throwIfDestroyed as ce,throwIfAborted as m,createAbortError as le}from"../core/promiseUtils.js";import ue from"../core/ReactiveSet.js";import{on as h,watch as g,initial as _,sync as v,whenOnce as y,syncAndInitial as b}from"../core/reactiveUtils.js";import{setFrameDuration as de,cleanupScheduling as fe}from"../core/scheduling.js";import{createScreenPoint as pe,createScreenPointArray as me}from"../core/screenUtils.js";import{cleanupWhereClauseCache as he}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as ge,getMetersPerUnitForSR as x}from"../core/units.js";import{initialize as _e}from"../core/workers/workers.js";import S from"../geometry/Extent.js";import ve from"../geometry/HeightModelInfo.js";import ye from"../geometry/Point.js";import{projectBoundingRect as be}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as xe}from"../geometry/projection/projectPointToVector.js";import{project as Se,canProjectWithoutEngine as Ce}from"../geometry/projectionUtils.js";import C from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as we}from"../geometry/spatialReferenceEllipsoidUtils.js";import{toExtent as Te,create as Ee}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as De}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Oe}from"../geometry/support/scaleUtils.js";import{wgs84 as ke,webMercator as Ae}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as je}from"../layers/graphics/dehydratedPoint.js";import{IntegratedMeshSemantics as w}from"../layers/support/IntegratedMeshSemantics.js";import{isImageryTileLayer as T,isTiledLayer as E,isVoxelLayer as D,isIntegratedMeshLayer as O,isGaussianSplatLayer as Me}from"../layers/support/layerUtils.js";import{TilemapCache as Ne}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Pe}from"../portal/portalDefault.js";import{WebSceneTag as Fe}from"../support/tagSymbols.js";import Ie from"../Viewpoint.js";import Le from"../webscene/Environment.js";import{clearVNodeCache as Re}from"../widgets/support/vnodeCache.js";import{importAnalysisViewModule as ze}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as Be}from"./3d/camera/intersectionUtils.js";import k from"./3d/constraints/Constraints.js";import A from"./3d/environment/Environment.js";import{EnvironmentView as Ve}from"./3d/environment/EnvironmentView.js";import{GroundView3D as He}from"./3d/GroundView3D.js";import Ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as We}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ge}from"./3d/layers/graphics/Labeler.js";import Ke from"./3d/layers/i3s/I3SLodHandling.js";import{layerView3DImporter as j}from"./3d/layerViewModuleImportUtils.js";import{Navigation3D as qe}from"./3d/navigation/Navigation3D.js";import{cleanupPointToPointAnimationController as Je}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Ye}from"./3d/state/helpers/SceneIntersectionHelper.js";import{ScreenSizePerspective as Xe}from"./3d/state/ScreenSizePerspective.js";import{cleanupNavigationUtils as Ze}from"./3d/state/utils/navigationUtils.js";import M from"./3d/state/ViewState.js";import{ViewStateManager as Qe,cleanupViewStateManager as $e}from"./3d/state/ViewStateManager.js";import et from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as tt}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as N}from"./3d/support/debugFlags.js";import{getElevationAtPoint as nt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as rt}from"./3d/support/GroundAndIMSurface.js";import{toMap as it,hitTest as at}from"./3d/support/hitTest.js";import{PointsOfInterest as P}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import{popupHitTest as ot}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as st,getQualityProfileSettings as F}from"./3d/support/QualityProfile.js";import I from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as ct}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as lt}from"./3d/support/ResourceController.js";import ut from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as dt}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ft}from"./3d/support/ViewSlice.js";import L from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as pt,getTiledLayerInfo as mt,checkIfTileInfoSupportedForView as ht}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as gt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as _t}from"./3d/terrain/TileRenderer.js";import{createWebGLContext as vt}from"./3d/webgl-engine/createWebGLContext.js";import{olidEnabled as yt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as bt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{cleanupEdgeProcessing as xt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import{defaultTolerance as R}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as St}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as z}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{Stage as Ct}from"./3d/webgl-engine/Stage.js";import{BreakpointsOwner as wt}from"./BreakpointsOwner.js";import{DOMContainer as Tt}from"./DOMContainer.js";import B from"./interactive/options/ViewOptions.js";import{PopupView as Et}from"./PopupView.js";import Dt from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as Ot}from"./support/drapedUtils.js";import{occludeesSupported as kt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as V,createScreenPointFromSupportedEvent as H}from"./support/screenUtils.js";import{isSpatialReferenceSupported as U}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as At,destroyTextureCompressionWorker as jt}from"./support/TextureCompressionHelper.js";import W from"./ui/3d/DefaultUI3D.js";import Mt from"./ui/DefaultUI.js";import G from"./View.js";import Nt from"./ViewAnimation.js";import{stringFromIsGlobal as K,isGlobalFromString as q}from"./ViewingMode.js";var J;const Pt=Symbol(),Y=Symbol();function Ft(e){let t=o(B,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let X=class extends wt(Et(Tt(G))){static{J=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new B({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=lt(this),this.deconflictor=new We({view:this}),this.attribution3D=new et({view:this}),this.labeler=new Ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new qe({view:this}),this.basemapTerrain=null,this.elevationProvider=new tt({view:this}),this._canvas=null,this.constraints=new k,this._environment=new A,this.environmentView=new Ve,this.floors=new l,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Dt({importAnalysisViewModule:e=>ze(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new ue,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new M({view:this}),this.slice=new ft,this.renderCoordsHelper=new ct,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new W,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,_e();let t=()=>this._updatingChanged();this.addHandles(re(oe(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([h(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),g(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Ue({view:this}),this.stateManager=new Qe({view:this}),this.screenSizePerspective=new Xe({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=At(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new He({view:this}),this.groundAndIMSurface=new rt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>de(e>0?1e3/Math.ceil(e):0),_),this.addHandles([g(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),v),g(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),v)])}destroy(){this.destroyed||(jt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set(`labeler`,p(this.labeler)),this._set(`deconflictor`,p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set(`stateManager`,p(this.stateManager)),this._set(`inputManager`,p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,p(this.environmentView)),this._set(`environment`,p(this.environment)),this.groundView=p(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=a(ye,e))}get clippingArea(){if(this.viewingMode===`global`)return null;let e=this.map,t=this._userClippingArea||se(e,`clippingArea`);return!(this._userClippingArea||se(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof S?this.spatialReference&&(t=Z(t,this.spatialReference),t==null)?(f.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(f.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode===`global`&&e!=null?f.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.isGlobal)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:Z(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||C.WGS84,n=Z(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||C.WGS84,t,n=n=>{let r=Z(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new S({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent==null||e.type===`graphics`&&e.internal||n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof A?e:e instanceof Le?this.environment?.cloneWithWebsceneEnvironment(e)??A.fromWebsceneEnvironment(e):a(A,e):new A}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return J._layerToLayerview}static{this._layerToLayerview=G._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Fe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=F(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new I(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||st()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?c(()=>Oe(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=ge(this.spatialReference);if(t&&e.heightUnit!==t)return new ve({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&f.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||pt(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return N.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this.groundView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return N.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedGlobalMode;if(e!=null)return K(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?K(this.defaultsFromMap.viewingMode===1):U(t,!0)?`global`:`local`:`global`}set viewingMode(e){this.ready?f.getLogger(this).error(`#viewingMode`,`viewingMode cannot be set once view is ready`):this._overrideIfSome(`viewingMode`,e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ut(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return f.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return it(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return f.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=Lt,t.x=e.x,t.y=e.y,t.z=nt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),xe(t,Q,this.renderSpatialReference),this.state.camera.projectToScreen(Q,$),pe($[0],$[1])}pixelSizeAt(e,t){if(!this.ready)return f.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;xe(e,Q,n);let r=this.state.camera.computeScreenPixelSizeAt(Q);return t&&n!==t?r*x(n)/x(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return f.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return at(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return ot(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new u(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!yt())throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),a=await this._completeSettings(e);return a.format=`png`,[i,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return j.importLayerView(e)}hasLayerViewModule(e){return j.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedGlobalMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:q(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedGlobalMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n==null?[...r(!0)??[],...r(!1)??[]]:r(n);return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return U(e,n)?t==null||T(t)?!0:!(E(t)&&mt(t,e,n)==null||D(t)&&n):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,isGlobal:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?C.WGS84:C.WebMercator:new C({...i?ke:Ae,vcsWkid:o,latestVcsWkid:s});return T(t)&&(i||a)?!(a&&r!==!1)||ht(t.tileInfo,t.fullExtent,e,!0)===null?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:[{spatialReference:c(),isGlobal:n}]:!E(t)&&!D(t)&&(i||a)?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:E(t)&&i&&!n?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:!1}]:[{spatialReference:e,isGlobal:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedGlobalMode;return t||(n==null?e.isGeographic&&f.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):f.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${K(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return f.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return f.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&kt(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await y(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),d(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await Rt[e]();if(t&&(ce(this),m(n.signal),await t(n.signal)),this.destroyed)throw le();return m(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new L({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new P({view:this})),this.addHandles([this.updatingHandles.add(()=>N.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&N.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},b),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?Se(Te(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},b),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},v)],Pt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Y),this.removeHandles(Pt),this._featureTiles=p(this.featureTiles),this._set(`pointsOfInterest`,p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=De(t,e);n!==this.renderSpatialReference&&(this.renderCoordsHelper.isGlobal=this.state.isGlobal,this.renderCoordsHelper.spatialReference=n,t||this.addHandles(g(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&be(e,this.groundView.spatialReference,It,t)&&(this.renderCoordsHelper.extent=It)},v),Y),this.sceneIntersectionHelper?.setTolerance(R/this.renderCoordsHelper.unitInMeters))}}_exitCoordinateSystem(){this.removeHandles(Y)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(g(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),v),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(e){let t={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,context:e,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},n=new Ye(this.state.isGlobal,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,n);let r=te(this.surface);this._stage=new Ct({view:this,options:t,container:r}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),ne(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new u(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.sceneIntersectionHelper.setTolerance(R/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=p(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface();let e=vt(this.renderCanvas,{alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled});this._initStage(e),this._initGlobe(),this.sharedSymbolResources=new dt({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>y(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){q(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(h(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?s(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(z);for(let t of this.allLayerViews)(O(t.layer)&&w.shouldIntersectAsGround(t.layer)||Me(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(z);for(let t of this.allLayerViews)O(t.layer)&&w.shouldIntersectAsGround(t.layer)&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Re(),ee(),he(),xt(),$e(),Be(),we(),Ot(),Pe(),_t(),St(),Je(),Ze(),ae(),fe(),bt(),gt(),Ke.cleanupI3SLodHandling(),Ne.cleanupTilemapCache(),M.cleanupViewstate(),L.cleanupTerrainSurface()}};e([n({nonNullable:!0}),r(Ft)],X.prototype,`options`,void 0),e([n()],X.prototype,`_userClippingArea`,void 0),e([n()],X.prototype,`_resourceController`,void 0),e([n()],X.prototype,`stage`,null),e([n({readOnly:!0})],X.prototype,`deconflictor`,void 0),e([n({readOnly:!0})],X.prototype,`labeler`,void 0),e([n()],X.prototype,`navigation`,void 0),e([n({type:Nt,readOnly:!0})],X.prototype,`animation`,null),e([n({readOnly:!0})],X.prototype,`basemapTerrain`,void 0),e([n({readOnly:!0})],X.prototype,`overlayManager`,null),e([n({readOnly:!0})],X.prototype,`elevationProvider`,void 0),e([n()],X.prototype,`camera`,null),e([n({type:t})],X.prototype,`contentCamera`,null),e([n({readOnly:!0})],X.prototype,`canvas`,null),e([n({type:ye,useTypeForAutocast:!1})],X.prototype,`center`,null),e([n({type:S})],X.prototype,`clippingArea`,null),e([n({type:k,nonNullable:!0})],X.prototype,`constraints`,void 0),e([n({type:S,readOnly:!0})],X.prototype,`renderDataExtent`,null),e([n({readOnly:!0})],X.prototype,`tileInfo`,null),e([n({type:S,readOnly:!0})],X.prototype,`dataExtent`,null),e([n({type:S,readOnly:!0})],X.prototype,`_groundAndLayersExtent`,null),e([n({type:A})],X.prototype,`environment`,null),e([r(`environment`)],X.prototype,`castEnvironment`,null),e([n({readOnly:!0})],X.prototype,`environmentView`,void 0),e([n({type:S})],X.prototype,`extent`,null),e([n({type:l})],X.prototype,`floors`,void 0),e([n()],X.prototype,`screenCenter`,null),e([n()],X.prototype,`frustum`,null),e([n({type:Number,readOnly:!0})],X.prototype,`fullOpacity`,void 0),e([n({readOnly:!0})],X.prototype,`graphicsView`,void 0),e([n()],X.prototype,`analysisViewManager`,void 0),e([n()],X.prototype,`groundView`,void 0),e([n({readOnly:!0})],X.prototype,`layerviewCollections`,null),e([n({type:Boolean})],X.prototype,`initialExtentRequired`,null),e([n()],X.prototype,`defaultsFromMapSettings`,null),e([n()],X.prototype,`interacting`,null),e([n()],X.prototype,`stationary`,null),e([n()],X.prototype,`navigating`,null),e([n()],X.prototype,`map`,void 0),e([n()],X.prototype,`padding`,null),e([n({type:P,readOnly:!0})],X.prototype,`pointsOfInterest`,void 0),e([n()],X.prototype,`_featureTiles`,void 0),e([n()],X.prototype,`featureTiles`,null),e([n()],X.prototype,`_featureTreeDebugger`,void 0),e([n({constructOnly:!0})],X.prototype,`deactivatedWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`debugWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`renderCanvas`,void 0),e([n({constructOnly:!0})],X.prototype,`state`,void 0),e([n()],X.prototype,`screenSizePerspective`,void 0),e([n({readOnly:!0})],X.prototype,`inputManager`,void 0),e([n({readOnly:!0})],X.prototype,`stateManager`,void 0),e([n({type:[`low`,`medium`,`high`]})],X.prototype,`qualityProfile`,null),e([n({type:I,get(){let e=this._get(`qualitySettings`);if(!e){let t=F(this.qualityProfile);e=new I(t)}return e}})],X.prototype,`qualitySettings`,void 0),e([n()],X.prototype,`slice`,void 0),e([n({readOnly:!0})],X.prototype,`typeSpecificPreconditionsReady`,null),e([n({readOnly:!0})],X.prototype,`sceneIntersectionHelper`,void 0),e([n({type:Number,readOnly:!0})],X.prototype,`resolution`,null),e([n({type:Number})],X.prototype,`scale`,null),e([n({readOnly:!0,type:Number})],X.prototype,`terrainLevel`,null),e([n()],X.prototype,`heightModelInfo`,null),e([n({type:C})],X.prototype,`spatialReference`,void 0),e([n({type:Boolean,value:!1})],X.prototype,`alphaCompositingEnabled`,null),e([n({constructOnly:!0})],X.prototype,`preserveDrawingBufferEnabled`,void 0),e([n({type:Boolean})],X.prototype,`supersampleScreenshotsEnabled`,void 0),e([n({readOnly:!0})],X.prototype,`type`,void 0),e([n(),r(e=>e instanceof Mt?e:o(W,e))],X.prototype,`ui`,void 0),e([n({type:Boolean,readOnly:!0})],X.prototype,`updating`,null),e([n()],X.prototype,`_updatingObjects`,null),e([n()],X.prototype,`_updatingObjectsWithProgress`,null),e([n()],X.prototype,`_updatingObjectsToDebug`,null),e([n({type:Number,readOnly:!0})],X.prototype,`updatingProgress`,void 0),e([n({type:[`global`,`local`]})],X.prototype,`viewingMode`,null),e([n({type:Ie})],X.prototype,`viewpoint`,null),e([n({readOnly:!0})],X.prototype,`visibleArea`,null),e([n({type:Number})],X.prototype,`zoom`,null),e([n({readOnly:!0})],X.prototype,`quality`,null),e([n({readOnly:!0})],X.prototype,`resolutionScale`,null),e([n()],X.prototype,`focusAreasView`,void 0),e([n()],X.prototype,`_defaultToMapOptions`,null),e([n()],X.prototype,`_defaultHitTestOptions`,null),X=J=e([i(`esri.views.SceneView`)],X);function Z(e,t){return e!=null&&Ce(e.spatialReference,t)?Se(e,t):null}const Q=ie(),$=me(),It=Ee(),Lt=je(0,0,0,C.WebMercator),Rt={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},zt=X;export{zt as default};
|
package/views/View2D.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,cast as n,subclass as r}from"../core/accessorSupport/decorators.js";import{ensureClass as i}from"../core/accessorSupport/ensureType.js";import a from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import s from"../core/Error.js";import"../core/has.js";import c from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{watch as u,syncAndInitial as d}from"../core/reactiveUtils.js";import{isScreenPoint as f,screenRectToPolygon as p,createScreenPoint as m}from"../core/screenUtils.js";import{initialize as h}from"../core/workers/workers.js";import g from"../geometry/Point.js";import _ from"../geometry/Polygon.js";import{isLoadedOrLoadFor as v}from"../geometry/projectionUtils.js";import y from"../layers/support/TileInfo.js";import b from"../Viewpoint.js";import x from"../webmap/background/ColorBackground.js";import{isWebMap as S}from"../webmap/utils.js";import{importAnalysisViewModule as C}from"./2d/analysis/analysisViewModuleImportUtils.js";import w from"./2d/AnimationManager.js";import T from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as E}from"./2d/layers/support/util.js";import{layerView2DImporter as D}from"./2d/layerViewModuleImportUtils.js";import{hitTest as O}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as k,takeScreenshot as A}from"./2d/support/screenshotUtils.js";import{Timeline as j}from"./2d/support/Timeline.js";import M from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as N}from"./2d/viewpointUtils.js";import{BreakpointsOwner as P}from"./BreakpointsOwner.js";import{DOMContainer as F}from"./DOMContainer.js";import I from"./navigation/Navigation.js";import L from"./navigation/NavigationActionMap.js";import{PopupView as R}from"./PopupView.js";import z from"./support/AnalysisViewManager.js";import B from"./ui/2d/DefaultUI2D.js";import V from"./ui/DefaultUI.js";import H from"./View.js";import{Viewport2DBaseMixin as U}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as W}from"./Viewport2DMixin.js";import{RenderingContextOptions as G}from"./webgl/RenderingContextOptions.js";let K,q,J,Y,X,Z;async function Q(){let[,{GraphicsView2D:e,GraphicContainer:t,MapViewNavigation:n,MagnifierView2D:r,GridView2D:i,Stage:a}]=await Promise.all([import(`./2d/webglDeps.js`),import(`./2d/mapViewDeps.js`)]);q=e,J=t,Y=n,X=r,Z=i,K=a}let $=class extends W(U(P(R(F(H))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new o({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.navigation=new I({actionMap:new L({dragTertiary:`none`})}),this.renderingOptions={samplingMode:`dynamic`,edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analysisViewManager=new z({importAnalysisViewModule:e=>C(e),view:this}),this.floors=new a,this.grid=null,this.map=null,this.timeline=new j,this.type=`2d`,this.view2dType=null,this.ui=new B,this.test={takeScreenshot:async e=>k(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},h()}destroy(){this.layerViewManager.clear(),this._set(`preconditionsReady`,!1),this.frameTask=l(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set(`inputManager`,null)}get graphicsTileStore(){return new T(this.featuresTilingScheme)}get constraintsInfo(){let e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;let{scale:e,constraints:t,center:n,viewpoint:r,extent:i}=this,a=this.zoom;return!(this.map&&`initialViewProperties`in this.map&&this.map.initialViewProperties?.viewpoint||i||(t?.effectiveLODs||(a=-1),n&&(e!==0||a!==-1))||r?.targetGeometry!=null&&(r.targetGeometry.type===`extent`||r.scale))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){let e=this._getDefaultViewpoint();if(!e)return!1;let t=e.targetGeometry,n=this.spatialReference;return v(t.spatialReference,n)}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get background(){return S(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override(`background`,e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get extent(){return super.extent}set extent(e){super.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get(`spatialReferenceLocked`)}set spatialReferenceLocked(e){this.stage&&c.getLogger(this).warn(`spatialReferenceLocked cannot be changed after the view has become ready`),this._set(`spatialReferenceLocked`,e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){if(this.destroying||this.destroyed)return!1;let{analysisViewManager:e,allLayerViews:t,frameTask:n,graphicsView:r,inputManager:i,layerViewManager:a,magnifier:o,map:s,ready:c,rendering:l,selectionManager:u,stationary:d,toolViewManager:f,updatingHandles:p,stage:m}=this,h=s?.basemap,g=s?.ground,_=h?.loadStatus===`loading`,v=g?.loadStatus===`loading`,y=_||v||!!s?.allLayers?.some(e=>e.parent!==g&&!e.isFulfilled()),b=!m||m.updating,x=!p||p.updating,S=!e||e.updating,C=!f||f.updating,w=!i||i.updating,T=!r||r.updating,E=!n||n.updating,D=!a||a.updating,O=!u||u.updating,k=!!(o.visible&&o.position!==null&&this._magnifierView?.updatingHandles.updating),A=t.some(e=>e.updating&&!e.destroyed);return!c||!d||l||y||A||k||x||S||E||C||w||D||T||O||b}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){let e=this.stateManager.visibleArea;return e&&new _({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference})}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return O(this,e,t)}async takeScreenshot(e){return A(this._getScreenshotView(e),e)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(e.parent==null)throw new s(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){this.graphicsView&&this.graphicsView.graphicUpdateHandler(e)}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}zoomIn(){return super.zoomIn()}zoomOut(){return super.zoomOut()}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.map&&`initialViewProperties`in this.map?this.map.initialViewProperties.spatialReference:null}getDefaultTimeZone(){return S(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return S(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return D.hasLayerViewModule(e)}importLayerView(e){return D.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(c.getLogger(this).error(`#pixelSizeAt()`,`Map view cannot be used before it is ready`),null)}async popupHitTest(e){let t=f(e)?this.toMap(e):p(this,e),n=f(e)?e:m(e.x+e.width/2,e.y+e.height/2),r=this.toMap(n),i=await this.hitTest(e),a=new Set(this.allLayerViews),o=this.allLayerViews.filter(e=>!e.suspended&&a.has(e)).reverse(),s=new globalThis.Map(o.map(e=>[e.layer.uid,e])),c=[],l=0,u=0;for(;l<i.results.length||u<o.length;){let e=i.results.at(l);if(e&&e.type!==`graphic`){++l;continue}let n=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||n)&&u<o.length&&o.at(u)!==n){let e=o.at(u);`fetchPopupFeaturesAtTarget`in e&&c.push({geometry:t,layerView:e}),++u}else e&&(c.push({graphic:e.graphic,layerView:n}),++l)}return{hits:c,location:r}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return Q()}_getDefaultViewpoint(){let{constraints:e,initialExtent:t,map:n,padding:r,size:i}=this;if(!e)return null;let a=n&&`initialViewProperties`in n?n.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),s=a?.viewpoint,c=s?.targetGeometry?.extent??t,l=c?.center,u=s?.rotation??0,d=s?.scale||c&&N(c,[i[0]-r.left-r.right,i[1]-r.top-r.bottom]),f=o.center??l,p=o.rotation??u,m=o.scale??d;return!f||!m?null:new b({targetGeometry:f,scale:m,rotation:p})}_startup(){this.timeline.begin(`MapView Startup`);let e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;let t=this._createFeaturesTilingScheme(),n=new K(this._getOrCreateRenderCanvas(),{contextOptions:new G(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),featuresTilingScheme:t,renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=n,this._magnifierView=new X,this._magnifierView.magnifier=this.magnifier,this._gridView=new Z;let r=new w({view:this});this._set(`animationManager`,r);let i=new Y({view:this,animationManager:r});this._set(`mapViewNavigation`,i),this._setupSpatialReferenceDependentProperties(t),this.addHandles([this.rootLayerViews.on(`change`,()=>this._updateStageChildren()),n.on(`webgl-error`,e=>this.fatalError=e.error),u(()=>this.stationary,e=>n.stationary=e,d),u(()=>this.background,e=>{n.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},d),u(()=>this.magnifier,e=>this._magnifierView.magnifier=e,d),u(()=>this.grid,e=>this._gridView.grid=e,d),u(()=>this.renderingOptions,e=>n.renderingOptions=e,d),u(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{n.highlightGradient=E(n.highlightGradient,this.highlights.items)},d),u(()=>this.state.id,()=>n.state=this.state,d),u(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,d)],`map-view`),this._updateStageChildren();let a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach(e=>e(this)),this.timeline.end(`MapView Startup`),this.frameTask.start(),this._set(`ready`,!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles(`map-view`),this.mapViewNavigation.destroy(),this._set(`mapViewNavigation`,null),this.animation=null,this.animationManager.destroy(),this._set(`animationManager`,null),this.layerViewManager.clear(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set(`graphicsView`,null),this._magnifierView=null,this._gridView=null,this._set(`mapViewNavigation`,null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set(`ready`,!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});let e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(e=this._createFeaturesTilingScheme()){this._set(`featuresTilingScheme`,e),this.stage.labelManager.featuresTilingScheme=e;let t=new q({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new J(e,!0)});this._set(`graphicsView`,t)}_createFeaturesTilingScheme(){return new M(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}))}_destroySpatialReferenceDependentProperties(){let e=this.graphicsView;this._set(`graphicsView`,null),e.destroy(),this._set(`featuresTilingScheme`,null)}_getScreenshotView(e){let{allLayerViews:t,padding:n,size:r,stage:i}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:n,size:r,stage:i}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(let e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(let e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type=`2d`}};e([t()],$.prototype,`_magnifierView`,void 0),e([t()],$.prototype,`_gridView`,void 0),e([t({constructOnly:!0})],$.prototype,`deactivatedWebGLExtensions`,void 0),e([t({constructOnly:!0})],$.prototype,`debugWebGLExtensions`,void 0),e([t({readOnly:!0})],$.prototype,`featuresTilingScheme`,void 0),e([t({readOnly:!0})],$.prototype,`graphicsTileStore`,null),e([t()],$.prototype,`graphicsView`,void 0),e([t()],$.prototype,`constraintsInfo`,null),e([t()],$.prototype,`initialExtentRequired`,null),e([t({type:I,nonNullable:!0})],$.prototype,`navigation`,void 0),e([t()],$.prototype,`renderingOptions`,void 0),e([t({constructOnly:!0})],$.prototype,`supersampleScreenshotsEnabled`,void 0),e([t()],$.prototype,`defaultsFromMapSettings`,null),e([t({readOnly:!0})],$.prototype,`typeSpecificPreconditionsReady`,null),e([t()],$.prototype,`analysisViewManager`,void 0),e([t({type:x})],$.prototype,`background`,null),e([t({type:g})],$.prototype,`center`,null),e([t({type:a})],$.prototype,`floors`,void 0),e([t()],$.prototype,`grid`,void 0),e([t()],$.prototype,`map`,void 0),e([t()],$.prototype,`padding`,null),e([t({readOnly:!0})],$.prototype,`rendering`,null),e([t({readOnly:!0})],$.prototype,`resolution`,null),e([t()],$.prototype,`scale`,null),e([t({type:Boolean,value:!1})],$.prototype,`spatialReferenceLocked`,null),e([t({readOnly:!0})],$.prototype,`tileInfo`,null),e([t({type:j,readOnly:!0})],$.prototype,`timeline`,void 0),e([t({readOnly:!0})],$.prototype,`type`,void 0),e([t({type:Boolean,readOnly:!0})],$.prototype,`updating`,null),e([t({readOnly:!0})],$.prototype,`view2dType`,void 0),e([t({readOnly:!0})],$.prototype,`visibleArea`,null),e([t()],$.prototype,`zoom`,null),e([t({readOnly:!0})],$.prototype,`navigating`,null),e([t(),n(e=>e instanceof V?e:i(B,e))],$.prototype,`ui`,void 0),$=e([r(`esri.views.View2D`)],$);const ee=$;export{ee as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,cast as n,subclass as r}from"../core/accessorSupport/decorators.js";import{ensureClass as i}from"../core/accessorSupport/ensureType.js";import a from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import s from"../core/Error.js";import"../core/has.js";import c from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{watch as u,syncAndInitial as d}from"../core/reactiveUtils.js";import{isScreenPoint as f,screenRectToPolygon as p,createScreenPoint as m}from"../core/screenUtils.js";import{initialize as h}from"../core/workers/workers.js";import g from"../geometry/Point.js";import _ from"../geometry/Polygon.js";import{isLoadedOrLoadFor as v}from"../geometry/projectionUtils.js";import y from"../layers/support/TileInfo.js";import b from"../Viewpoint.js";import x from"../webmap/background/ColorBackground.js";import{isWebMap as S}from"../webmap/utils.js";import{importAnalysisViewModule as C}from"./2d/analysis/analysisViewModuleImportUtils.js";import w from"./2d/AnimationManager.js";import T from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as E}from"./2d/layers/support/util.js";import{layerView2DImporter as D}from"./2d/layerViewModuleImportUtils.js";import{hitTest as O}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as k,takeScreenshot as A}from"./2d/support/screenshotUtils.js";import{Timeline as j}from"./2d/support/Timeline.js";import M from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as N}from"./2d/viewpointUtils.js";import{BreakpointsOwner as P}from"./BreakpointsOwner.js";import{DOMContainer as F}from"./DOMContainer.js";import I from"./navigation/Navigation.js";import L from"./navigation/NavigationActionMap.js";import{PopupView as R}from"./PopupView.js";import z from"./support/AnalysisViewManager.js";import B from"./ui/2d/DefaultUI2D.js";import V from"./ui/DefaultUI.js";import H from"./View.js";import{Viewport2DBaseMixin as U}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as W}from"./Viewport2DMixin.js";import{RenderingContextOptions as G}from"./webgl/RenderingContextOptions.js";let K,q,J,Y,X,Z;async function Q(){let[,{GraphicsView2D:e,GraphicContainer:t,MapViewNavigation:n,MagnifierView2D:r,GridView2D:i,Stage:a}]=await Promise.all([import(`./2d/webglDeps.js`),import(`./2d/mapViewDeps.js`)]);q=e,J=t,Y=n,X=r,Z=i,K=a}let $=class extends W(U(P(R(F(H))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new o({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.navigation=new I({actionMap:new L({dragTertiary:`none`})}),this.renderingOptions={samplingMode:`dynamic`,edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analysisViewManager=new z({importAnalysisViewModule:e=>C(e),view:this}),this.floors=new a,this.grid=null,this.map=null,this.timeline=new j,this.type=`2d`,this.viewingMode=`local`,this.view2dType=null,this.ui=new B,this.test={takeScreenshot:async e=>k(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},h()}destroy(){this.layerViewManager.clear(),this._set(`preconditionsReady`,!1),this.frameTask=l(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set(`inputManager`,null)}get graphicsTileStore(){return new T(this.featuresTilingScheme)}get constraintsInfo(){let e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;let{scale:e,constraints:t,center:n,viewpoint:r,extent:i}=this,a=this.zoom;return!(this.map&&`initialViewProperties`in this.map&&this.map.initialViewProperties?.viewpoint||i||(t?.effectiveLODs||(a=-1),n&&(e!==0||a!==-1))||r?.targetGeometry!=null&&(r.targetGeometry.type===`extent`||r.scale))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){let e=this._getDefaultViewpoint();if(!e)return!1;let t=e.targetGeometry,n=this.spatialReference;return v(t.spatialReference,n)}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get background(){return S(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override(`background`,e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get extent(){return super.extent}set extent(e){super.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get(`spatialReferenceLocked`)}set spatialReferenceLocked(e){this.stage&&c.getLogger(this).warn(`spatialReferenceLocked cannot be changed after the view has become ready`),this._set(`spatialReferenceLocked`,e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){if(this.destroying||this.destroyed)return!1;let{analysisViewManager:e,allLayerViews:t,frameTask:n,graphicsView:r,inputManager:i,layerViewManager:a,magnifier:o,map:s,ready:c,rendering:l,selectionManager:u,stationary:d,toolViewManager:f,updatingHandles:p,stage:m}=this,h=s?.basemap,g=s?.ground,_=h?.loadStatus===`loading`,v=g?.loadStatus===`loading`,y=_||v||!!s?.allLayers?.some(e=>e.parent!==g&&!e.isFulfilled()),b=!m||m.updating,x=!p||p.updating,S=!e||e.updating,C=!f||f.updating,w=!i||i.updating,T=!r||r.updating,E=!n||n.updating,D=!a||a.updating,O=!u||u.updating,k=!!(o.visible&&o.position!==null&&this._magnifierView?.updatingHandles.updating),A=t.some(e=>e.updating&&!e.destroyed);return!c||!d||l||y||A||k||x||S||E||C||w||D||T||O||b}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){let e=this.stateManager.visibleArea;return e&&new _({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference})}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return O(this,e,t)}async takeScreenshot(e){return A(this._getScreenshotView(e),e)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(e.parent==null)throw new s(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){this.graphicsView&&this.graphicsView.graphicUpdateHandler(e)}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}zoomIn(){return super.zoomIn()}zoomOut(){return super.zoomOut()}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.map&&`initialViewProperties`in this.map?this.map.initialViewProperties.spatialReference:null}getDefaultTimeZone(){return S(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return S(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return D.hasLayerViewModule(e)}importLayerView(e){return D.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(c.getLogger(this).error(`#pixelSizeAt()`,`Map view cannot be used before it is ready`),null)}async popupHitTest(e){let t=f(e)?this.toMap(e):p(this,e),n=f(e)?e:m(e.x+e.width/2,e.y+e.height/2),r=this.toMap(n),i=await this.hitTest(e),a=new Set(this.allLayerViews),o=this.allLayerViews.filter(e=>!e.suspended&&a.has(e)).reverse(),s=new globalThis.Map(o.map(e=>[e.layer.uid,e])),c=[],l=0,u=0;for(;l<i.results.length||u<o.length;){let e=i.results.at(l);if(e&&e.type!==`graphic`){++l;continue}let n=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||n)&&u<o.length&&o.at(u)!==n){let e=o.at(u);`fetchPopupFeaturesAtTarget`in e&&c.push({geometry:t,layerView:e}),++u}else e&&(c.push({graphic:e.graphic,layerView:n}),++l)}return{hits:c,location:r}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return Q()}_getDefaultViewpoint(){let{constraints:e,initialExtent:t,map:n,padding:r,size:i}=this;if(!e)return null;let a=n&&`initialViewProperties`in n?n.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),s=a?.viewpoint,c=s?.targetGeometry?.extent??t,l=c?.center,u=s?.rotation??0,d=s?.scale||c&&N(c,[i[0]-r.left-r.right,i[1]-r.top-r.bottom]),f=o.center??l,p=o.rotation??u,m=o.scale??d;return!f||!m?null:new b({targetGeometry:f,scale:m,rotation:p})}_startup(){this.timeline.begin(`MapView Startup`);let e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;let t=this._createFeaturesTilingScheme(),n=new K(this._getOrCreateRenderCanvas(),{contextOptions:new G(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),featuresTilingScheme:t,renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=n,this._magnifierView=new X,this._magnifierView.magnifier=this.magnifier,this._gridView=new Z;let r=new w({view:this});this._set(`animationManager`,r);let i=new Y({view:this,animationManager:r});this._set(`mapViewNavigation`,i),this._setupSpatialReferenceDependentProperties(t),this.addHandles([this.rootLayerViews.on(`change`,()=>this._updateStageChildren()),n.on(`webgl-error`,e=>this.fatalError=e.error),u(()=>this.stationary,e=>n.stationary=e,d),u(()=>this.background,e=>{n.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},d),u(()=>this.magnifier,e=>this._magnifierView.magnifier=e,d),u(()=>this.grid,e=>this._gridView.grid=e,d),u(()=>this.renderingOptions,e=>n.renderingOptions=e,d),u(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{n.highlightGradient=E(n.highlightGradient,this.highlights.items)},d),u(()=>this.state.id,()=>n.state=this.state,d),u(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,d)],`map-view`),this._updateStageChildren();let a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach(e=>e(this)),this.timeline.end(`MapView Startup`),this.frameTask.start(),this._set(`ready`,!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles(`map-view`),this.mapViewNavigation.destroy(),this._set(`mapViewNavigation`,null),this.animation=null,this.animationManager.destroy(),this._set(`animationManager`,null),this.layerViewManager.clear(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set(`graphicsView`,null),this._magnifierView=null,this._gridView=null,this._set(`mapViewNavigation`,null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set(`ready`,!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});let e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(e=this._createFeaturesTilingScheme()){this._set(`featuresTilingScheme`,e),this.stage.labelManager.featuresTilingScheme=e;let t=new q({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new J(e,!0)});this._set(`graphicsView`,t)}_createFeaturesTilingScheme(){return new M(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}))}_destroySpatialReferenceDependentProperties(){let e=this.graphicsView;this._set(`graphicsView`,null),e.destroy(),this._set(`featuresTilingScheme`,null)}_getScreenshotView(e){let{allLayerViews:t,padding:n,size:r,stage:i}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:n,size:r,stage:i}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(let e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(let e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type=`2d`}};e([t()],$.prototype,`_magnifierView`,void 0),e([t()],$.prototype,`_gridView`,void 0),e([t({constructOnly:!0})],$.prototype,`deactivatedWebGLExtensions`,void 0),e([t({constructOnly:!0})],$.prototype,`debugWebGLExtensions`,void 0),e([t({readOnly:!0})],$.prototype,`featuresTilingScheme`,void 0),e([t({readOnly:!0})],$.prototype,`graphicsTileStore`,null),e([t()],$.prototype,`graphicsView`,void 0),e([t()],$.prototype,`constraintsInfo`,null),e([t()],$.prototype,`initialExtentRequired`,null),e([t({type:I,nonNullable:!0})],$.prototype,`navigation`,void 0),e([t()],$.prototype,`renderingOptions`,void 0),e([t({constructOnly:!0})],$.prototype,`supersampleScreenshotsEnabled`,void 0),e([t()],$.prototype,`defaultsFromMapSettings`,null),e([t({readOnly:!0})],$.prototype,`typeSpecificPreconditionsReady`,null),e([t()],$.prototype,`analysisViewManager`,void 0),e([t({type:x})],$.prototype,`background`,null),e([t({type:g})],$.prototype,`center`,null),e([t({type:a})],$.prototype,`floors`,void 0),e([t()],$.prototype,`grid`,void 0),e([t()],$.prototype,`map`,void 0),e([t()],$.prototype,`padding`,null),e([t({readOnly:!0})],$.prototype,`rendering`,null),e([t({readOnly:!0})],$.prototype,`resolution`,null),e([t()],$.prototype,`scale`,null),e([t({type:Boolean,value:!1})],$.prototype,`spatialReferenceLocked`,null),e([t({readOnly:!0})],$.prototype,`tileInfo`,null),e([t({type:j,readOnly:!0})],$.prototype,`timeline`,void 0),e([t({readOnly:!0})],$.prototype,`type`,void 0),e([t({type:Boolean,readOnly:!0})],$.prototype,`updating`,null),e([t({readOnly:!0})],$.prototype,`view2dType`,void 0),e([t({readOnly:!0})],$.prototype,`visibleArea`,null),e([t()],$.prototype,`zoom`,null),e([t({readOnly:!0})],$.prototype,`navigating`,null),e([t(),n(e=>e instanceof V?e:i(B,e))],$.prototype,`ui`,void 0),$=e([r(`esri.views.View2D`)],$);const ee=$;export{ee as default};
|
package/views/ViewingMode.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
function e(e){return e===`global
|
|
2
|
+
function e(e){return e===`global`}function t(e){return e?`global`:`local`}export{e as isGlobalFromString,t as stringFromIsGlobal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{convertUnit as e}from"../../../core/units.js";import{getConfig as t}from"./constants.js";import{yAxisExtraFactorBottom as n,yAxisExtraFactorTop as r,minRange as i}from"./elevationProfileChartTheme.js";const a={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};function o({data:o,pixelWidth:l,pixelHeight:u}){if(!o)return a;let d=o.statistics,f=d?.maxDistance,p=d?.minElevation,m=d?.maxElevation;if(f==null||p==null||m==null)return a;let h=Math.max(f
|
|
2
|
+
import{convertUnit as e}from"../../../core/units.js";import{getConfig as t}from"./constants.js";import{yAxisExtraFactorBottom as n,yAxisExtraFactorTop as r,minRange as i}from"./elevationProfileChartTheme.js";const a={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};function o({data:o,pixelWidth:l,pixelHeight:u}){if(!o)return a;let d=o.statistics,f=d?.maxDistance,p=d?.minElevation,m=d?.maxElevation;if(f==null||p==null||m==null)return a;let h=Math.max(+f,i),g=Math.max(m-p,i),_=o.effectiveUnits;if(o.dynamicElevationRange){let n=e(h,_.distance,_.elevation);g=Math.max(g,n/t().maxChartRatio)}return p-=n*g,m=p+g+r*g,[p,m]=c(p,m,10),g=m-p,o.uniformScaling&&l>0&&u>0?s({data:o,bounds:{minX:0,maxX:f,minY:p,maxY:m},pixelWidth:l,pixelHeight:u,centered:!0}):{minX:0,maxX:0+h,minY:p,maxY:p+g}}function s({data:t,bounds:n,pixelWidth:r,pixelHeight:i,centered:o}){if(!t)return n;let{minX:s,maxX:c,minY:l,maxY:d}=n;if(s==null||c==null||l==null||d==null)return a;let f=c-s,p=d-l,m=t.effectiveUnits,h=e(p,m.elevation,m.distance),g=f/r,_=h/i/g;return _>=1?[s,c]=u([s,c],_):[l,d]=u([l,d],1/_),{minX:s,maxX:c,minY:l,maxY:d}}function c(e,t,n=10){let r=l(t-e,!1);if(r===0)return[e,t];let i=l(r/(n-1),!0);return[Math.floor(e/i)*i,Math.ceil(t/i)*i]}function l(e,t){let n=Math.floor(Math.log10(e)),r=e/10**n,i;return i=t?r<1.5?1:r<3?2:r<5?2.5:r<7?5:10:r<=1?1:r<=2?2:r<=3?2.5:r<=5?5:10,i*10**n}function u([e,t],n,r){let i=(t-e)*n;{let n=(e+t)/2-i/2;return[n,n+i]}}export{o as getAdjustedBounds};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{distance as e,lerp as t}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{lerp as n}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{floatEqualUlp as r,lerp as i}from"../../../core/mathUtils.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../../../core/units.js";import{geodesicLengths as s,isSupported as c,inverseGeodeticSolver as l,directGeodeticSolver as u}from"../../../geometry/geodesicUtils.js";import d from"../../../geometry/Polyline.js";import{initializeProjection as f,project as p}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{getElevationOffset as h}from"../../../support/elevationInfoUtils.js";import{TooComplexError as g}from"./elevationProfileErrors.js";async function _(e,t,n,r,i,c,l){let u,d,h,_=e.spatialReference,b=_.isGeographic||_.isWebMercator,x=0;if(!b){let{lengthExecute:t}=await import(`../../../geometry/operators/lengthOperator.js`);a(l),x=t(e,{unit:`meters`}),a(l)}let S=1/o(r);if(b){await f([{source:_,dest:r},{source:_,dest:m.WGS84}],l);let a=z(e);u=s([a],`meters`)[0];let o=v(u,i);if(V(e,u,o)>c)throw new g;let b=y(a,t,n);({densifiedPath:d,distances:h}=M(b,o,S)),d=p(d,r)}else{await f([{source:_,dest:r}],l),u=x;let o=v(u,i);if(V(e,u,o)>c)throw new g;let s=y(e,t,n);({densifiedPath:d,distances:h}=j(s,o,S)),a(l),d=p(d,r)}return{densifiedPath:d,pathLength:u*S,distances:h}}function v(e,t){let n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function y(e,t,n){if(t==null)return S(e);let r=e.spatialReference,i=t.mode,a=h(t,r),o=null;switch(n.type){case`2d`:o=b(e,i,a);break;case`3d`:o=x(e,i,a,n)}return o==null?S(e):new d({hasZ:!0,hasM:!1,spatialReference:r,paths:C(e.paths,o)})}function b({hasZ:e},t,n){
|
|
2
|
+
import{distance as e,lerp as t}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{lerp as n}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{floatEqualUlp as r,lerp as i}from"../../../core/mathUtils.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../../../core/units.js";import{geodesicLengths as s,isSupported as c,inverseGeodeticSolver as l,directGeodeticSolver as u}from"../../../geometry/geodesicUtils.js";import d from"../../../geometry/Polyline.js";import{initializeProjection as f,project as p}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{getElevationOffset as h}from"../../../support/elevationInfoUtils.js";import{TooComplexError as g}from"./elevationProfileErrors.js";async function _(e,t,n,r,i,c,l){let u,d,h,_=e.spatialReference,b=_.isGeographic||_.isWebMercator,x=0;if(!b){let{lengthExecute:t}=await import(`../../../geometry/operators/lengthOperator.js`);a(l),x=t(e,{unit:`meters`}),a(l)}let S=1/o(r);if(b){await f([{source:_,dest:r},{source:_,dest:m.WGS84}],l);let a=z(e);u=s([a],`meters`)[0];let o=v(u,i);if(V(e,u,o)>c)throw new g;let b=y(a,t,n);({densifiedPath:d,distances:h}=M(b,o,S)),d=p(d,r)}else{await f([{source:_,dest:r}],l),u=x;let o=v(u,i);if(V(e,u,o)>c)throw new g;let s=y(e,t,n);({densifiedPath:d,distances:h}=j(s,o,S)),a(l),d=p(d,r)}return{densifiedPath:d,pathLength:u*S,distances:h}}function v(e,t){let n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function y(e,t,n){if(t==null)return S(e);let r=e.spatialReference,i=t.mode,a=h(t,r),o=null;switch(n.type){case`2d`:o=b(e,i,a);break;case`3d`:o=x(e,i,a,n)}return o==null?S(e):new d({hasZ:!0,hasM:!1,spatialReference:r,paths:C(e.paths,o)})}function b({hasZ:e},t,n){return t===`absolute-height`?e?([e,t,r])=>[e,t,r+n]:([e,t])=>[e,t,n]:null}function x({spatialReference:e,hasZ:t},n,r,{elevationProvider:i}){let a=(t,n,r,a)=>i?.getElevation(t,n,r,e,a)??0;switch(n){case`on-the-ground`:return([e,t])=>[e,t,a(e,t,0,`ground`)];case`absolute-height`:return t?([e,t,n])=>[e,t,n+r]:([e,t])=>[e,t,r];case`relative-to-ground`:return t?([e,t,n])=>[e,t,n+a(e,t,n,`ground`)+r]:([e,t])=>[e,t,a(e,t,0,`ground`)+r];case`relative-to-scene`:return t?([e,t,n])=>[e,t,n+a(e,t,n,`scene`)+r]:([e,t])=>[e,t,a(e,t,0,`scene`)+r];default:return null}}function S(e){return e.hasZ?new d({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:C(e.paths,([e,t])=>[e,t])}):e}function C(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i){let n=e[i],a=n.length,o=Array(n.length);r[i]=o;for(let e=0;e<a;++e)o[e]=t(n[e])}return r}function w(e){return D(e)&&e.paths.some(e=>e.length>1)}function T(e){return E(e)&&w(e.geometry)}function E(e){return O(e)&&D(e?.geometry)}function D(e){return!O(e)&&e!=null&&e.type===`polyline`}function O(e){return e!=null&&`geometry`in e}function k(e){let t=e?.layer;return t!=null&&t.type===`graphics`&&t.internal}function A(e,t,n,i,a){let{spatialReference:s,hasZ:c}=e,l={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:s,metersPerSR:o(s)},u=[],f=[],p=0;for(let o=0;o<e.paths.length;++o){let s=e.paths[o],c=[],d=[],m=0;for(let e=1;e<s.length;++e){let o=s[e-1],u=s[e],f=i(l,o,u),h;for(h=m;h<f.distance&&!r(h,f.distance);h+=t)c.push(a(f,h)),d.push((p+h)*n);m=h-f.distance,p+=f.distance,c.push(u),d.push(p*n)}u[o]=c,f[o]=d}return{densifiedPath:new d({spatialReference:s,hasZ:c,paths:u}),distances:f}}function j(e,t,n){let{hasZ:r}=e;return A(e,t,n,P,r?R:L)}function M(e,t,n){let{hasZ:r}=e;return A(e,t,n,N,r?I:F)}function N(e,t,n){return e.distance=0,l(e,t,n,e.spatialReference),e.from=t,e.to=n,e}function P(t,n,r){return t.from=n,t.to=r,t.distance=e(r,n)*t.metersPerSR,t}function F({from:e,azimuth:t,spatialReference:n},r){return u([0,0],e,t,r,n)}function I({from:e,to:t,azimuth:n,distance:r,spatialReference:a},o){let s=o/r,c=[0,0,i(e[2],t[2],s)];return u(c,e,n,o,a),c}function L({from:e,to:n,distance:r},i){return t([0,0],e,n,i/r)}function R({from:e,to:t,distance:r},i){return n([0,0,0],e,t,i/r)}function z(e){return c(e.spatialReference)?e:p(e,m.WGS84)}function B(e){return e.paths.reduce((e,t)=>e+t.length,0)}function V(e,t,n){return B(e)+Math.floor(t/n)+Math.max(0,e.paths.reduce(e=>1+e,0)-1)}export{B as countPoints,_ as densifyPath,O as isGraphic,k as isInternalGraphic,D as isPolyline,E as isPolylineGraphic,T as isValidInputGraphic,w as isValidInputPath,y as toAbsoluteHeightElevation};
|
package/views/draw/DrawAction.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{destroyMaybe as a}from"../../core/maybe.js";import{EsriPromiseMixin as o}from"../../core/Promise.js";import{ignoreAbortErrors as s}from"../../core/promiseUtils.js";import{createScreenPointArray as c}from"../../core/screenUtils.js";import{makeDehydratedPoint as l}from"../../layers/graphics/dehydratedPoint.js";import u from"../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as d}from"../2d/interactive/SnappingVisualizer2D.js";import{createCoordinateHelper as f}from"../interactive/coordinateHelper.js";import{EditGeometry as p,Part as m}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as h}from"../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as g}from"../interactive/snapping/SnappingContext.js";import{SnappingOperation as _}from"../interactive/snapping/SnappingOperation.js";var v;let y=class extends o(r){static{v=this}constructor(e={}){let{editGeometryType:t,snappingManager:n,...r}=e;super(r),this._hasZ=null,this._cursorScreenPoint=null,this._activePointerId=null,this._stagedVertexUnsnapped=null,this._lastVertexUnsnapped=null,this.interactiveUndoDisabled=!1,this.history=[],this.redoHistory=[],this.snapToScene=!1,this.view=null,this.elevationInfo=null,this.defaultZ=0,this._coordinateHelper=f(!!e.hasZ,!1,e.view.spatialReference),this._snappingManager=n
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{destroyMaybe as a}from"../../core/maybe.js";import{EsriPromiseMixin as o}from"../../core/Promise.js";import{ignoreAbortErrors as s}from"../../core/promiseUtils.js";import{createScreenPointArray as c}from"../../core/screenUtils.js";import{makeDehydratedPoint as l}from"../../layers/graphics/dehydratedPoint.js";import u from"../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as d}from"../2d/interactive/SnappingVisualizer2D.js";import{createCoordinateHelper as f}from"../interactive/coordinateHelper.js";import{EditGeometry as p,Part as m}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as h}from"../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as g}from"../interactive/snapping/SnappingContext.js";import{SnappingOperation as _}from"../interactive/snapping/SnappingOperation.js";var v;let y=class extends o(r){static{v=this}constructor(e={}){let{editGeometryType:t,snappingManager:n,...r}=e;super(r),this._hasZ=null,this._cursorScreenPoint=null,this._activePointerId=null,this._stagedVertexUnsnapped=null,this._lastVertexUnsnapped=null,this.interactiveUndoDisabled=!1,this.history=[],this.redoHistory=[],this.snapToScene=!1,this.view=null,this.elevationInfo=null,this.defaultZ=0,this._coordinateHelper=f(!!e.hasZ,!1,e.view.spatialReference),this._snappingManager=n;let i=e.view?.state.isGlobal??!1;this._editGeometryOperations=new h(new p(t??`polygon`,this._coordinateHelper),i),this._snappingGraphicsLayer=new u({id:v.SNAPPING_GRAPHICS_LAYER_ID,listMode:`hide`,internal:!0,title:`Snapping graphics`}),this._snappingContext=new g({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:`on-the-ground`,offset:0},pointer:`mouse`,visualizer:new d(this._snappingGraphicsLayer)}),this._activeComponent=new m(e.view.spatialReference,i),this._editGeometryOperations.data.parts.push(this._activeComponent)}initialize(){this._snappingOperation=new _({view:this.view}),this.view.type===`2d`&&this.view.map.layers.add(this._snappingGraphicsLayer)}destroy(){this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy(),this._snappingManager!=null&&this._snappingManager.doneSnapping(),this._snappingOperation=a(this._snappingOperation),this._editGeometryOperations.destroy()}get _committedVertices(){return this._editGeometryOperations.data.parts[0].vertices.map(e=>e.pos)}get vertices(){return this._stagedVertex==null?this._committedVertices:[...this._committedVertices,this._coordinateHelper.pointToArray(this._stagedVertex)]}get hasZ(){return this._hasZ==null?this.view.type===`3d`:this._hasZ}set hasZ(e){this._hasZ=e,this.notifyChange(`hasZ`)}get _stagedVertex(){return this._snappingOperation?.stagedPoint}set _stagedVertex(e){this._snappingOperation&&(this._snappingOperation.stagedPoint=i(e))}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this.canUndo&&this._editGeometryOperations.undo()}redo(){this.canRedo&&this._editGeometryOperations.redo()}getCoordsFromScreenPoint(e){let t=e&&this.screenToMap(e);return t==null?null:t.hasZ?[t.x,t.y,t.z]:[t.x,t.y]}getCoordsAndPointFromScreenPoint(e){let t=this.screenToMap(e);return t==null?null:t.hasZ?{vertex:[t.x,t.y,t.z],mapPoint:t}:{vertex:[t.x,t.y],mapPoint:t}}screenToMap(e){let t=null;if(this.view.type===`3d`){if(this.hasZ){let n=this.elevationInfo??b;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(c(e.x,e.y),n,this._getGeometryZValue())}else{let n=this.elevationInfo??x;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(c(e.x,e.y),n,0),t!=null&&(t.z=void 0)}}else t=this.view.toMap(e),t!=null&&(t.z=this.hasZ?this._getGeometryZValue():void 0);return t}_pushCursorVertex(e,t){let n=l(e[0],e[1],void 0,this.view.spatialReference);this._stagedVertexUnsnapped=n;let r=this._snappingManager;r==null?(this._stagedVertex=n,t()):s(this._snappingOperation.snap({point:n},r,this._snappingContext)).then(()=>{t()})}_popCursorVertex(){this._stagedVertexUnsnapped=null,this._stagedVertex=null}_getGeometryZValue(){return this.defaultZ}_abortSnapping(){this._snappingOperation.abort()}_isDuplicateOfLastVertex(e){let t=this._editGeometryOperations.data.parts[0].getLastVertex()?.pos;if(t&&e[0]===t[0]&&e[1]===t[1])return!0;let{x:n,y:r}=this._coordinateHelper.vectorToDehydratedPoint(e);return this._lastVertexUnsnapped!=null&&n===this._lastVertexUnsnapped.x&&r===this._lastVertexUnsnapped.y}_shouldHandlePointerEvent(e){return S(e)&&(this._activePointerId==null||this._activePointerId===e.pointerId)}_vertexAddHandler(e){let t=this._stagedVertex==null?this.getCoordsFromScreenPoint(this._cursorScreenPoint):this._coordinateHelper.pointToArray(this._stagedVertex);t!=null&&this._addVertex(t,e.native)}_drawCompleteHandler(e){this._completeDrawing(e.native)}static{this.SNAPPING_GRAPHICS_LAYER_ID=`DrawAction-snapping-graphics-layer`}};e([t({readOnly:!0})],y.prototype,`vertices`,null),e([t({type:Boolean,nonNullable:!0})],y.prototype,`interactiveUndoDisabled`,void 0),e([t({readOnly:!0})],y.prototype,`history`,void 0),e([t({readOnly:!0})],y.prototype,`redoHistory`,void 0),e([t()],y.prototype,`snapToScene`,void 0),e([t()],y.prototype,`view`,void 0),e([t()],y.prototype,`elevationInfo`,void 0),e([t({nonNullable:!0})],y.prototype,`defaultZ`,void 0),e([t()],y.prototype,`hasZ`,null),e([t()],y.prototype,`_snappingOperation`,void 0),e([t()],y.prototype,`_stagedVertex`,null),y=v=e([n(`esri.views.draw.DrawAction`)],y);const b={mode:`absolute-height`,offset:0},x={mode:`on-the-ground`,offset:0};function S(e){return e.pointerType!==`mouse`||e.button===0}const C=y;export{C as default};
|