@arcgis/core 4.24.0-next.20220508 → 4.24.0-next.20220511
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/AggregateGraphic.js +1 -1
- package/analysis/Analysis.js +1 -1
- package/analysis/DimensioningAnalysis.js +1 -1
- package/analysis/LengthDimension.d.ts +4 -0
- package/analysis/LengthDimension.js +5 -0
- package/analysis/dimensionUtils.js +5 -0
- package/arcade/Dictionary.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/arcade.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/credentials.js +1 -1
- package/arcade/featureSetCollection.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/actions/AttributeFilter.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/OrderBy.js +1 -1
- package/arcade/featureset/actions/SpatialFilter.js +1 -1
- package/arcade/featureset/actions/Top.js +1 -1
- package/arcade/featureset/sources/Empty.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/featureset/support/stats.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetgeom.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade/request.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0564f1cfa3d17ff1aad3.js +1 -0
- package/assets/esri/core/workers/chunks/0806d5d706a864542bfb.js +1 -0
- package/assets/esri/core/workers/chunks/0a6977144ea1abf96fbf.js +1 -0
- package/assets/esri/core/workers/chunks/13387f56acbc3291561a.js +1 -0
- package/assets/esri/core/workers/chunks/16c4e0a32d50d4db984d.js +1 -0
- package/assets/esri/core/workers/chunks/{076d1b1101b59af0d389.js → 1c010202b4c7e1d15f23.js} +1 -1
- package/assets/esri/core/workers/chunks/26827ec144676e6385f8.js +1 -0
- package/assets/esri/core/workers/chunks/287c484fd40eee643f3a.js +1 -0
- package/assets/esri/core/workers/chunks/5210f0b42dba27945226.js +1 -0
- package/assets/esri/core/workers/chunks/{db6c5b3b4efe8d804f9c.js → 52478ee2d2a1354b6900.js} +1 -1
- package/assets/esri/core/workers/chunks/5759af97f96f24c40105.js +1 -0
- package/assets/esri/core/workers/chunks/{b85218d44c6094b7e5e6.js → 6d7e2a23a0a5dd9ded1d.js} +1 -1
- package/assets/esri/core/workers/chunks/70b6356357e7640c4e8b.js +1 -0
- package/assets/esri/core/workers/chunks/7574316b3af61c389e8f.js +1 -0
- package/assets/esri/core/workers/chunks/7bc828fbdd54c0b28aac.js +1 -0
- package/assets/esri/core/workers/chunks/7e5c22b5a32ac74b1b6e.js +1 -0
- package/assets/esri/core/workers/chunks/8102bb78fe96e6197e4e.js +1 -0
- package/assets/esri/core/workers/chunks/88384e7cafbfd2348598.js +1 -0
- package/assets/esri/core/workers/chunks/9d7533aaeac3b8d145c4.js +1 -0
- package/assets/esri/core/workers/chunks/{1eecae5227318f491263.js → 9f4d892abf55e8625bc9.js} +3 -3
- package/assets/esri/core/workers/chunks/{98607a0da63626cc4614.js → a054a52712a118c6d505.js} +1 -1
- package/assets/esri/core/workers/chunks/{69a20e4d9e28c3e599fc.js → a3bb600bfcb0282622f1.js} +1 -1
- package/assets/esri/core/workers/chunks/aa49841b14c6e6df2a07.js +1 -0
- package/assets/esri/core/workers/chunks/b089058b64db3912478f.js +1 -0
- package/assets/esri/core/workers/chunks/b28539c5a6bedb71b038.js +1 -0
- package/assets/esri/core/workers/chunks/b4f171db73355c6f766e.js +1 -0
- package/assets/esri/core/workers/chunks/b7572b0921b23aef8b9d.js +1 -0
- package/assets/esri/core/workers/chunks/b758f3c419edc2306784.js +1 -0
- package/assets/esri/core/workers/chunks/c3e7290fb128d4fefd44.js +1 -0
- package/assets/esri/core/workers/chunks/c51c9b5da855f84b9a48.js +1 -0
- package/assets/esri/core/workers/chunks/c66ac36da6392b6bf331.js +1 -0
- package/assets/esri/core/workers/chunks/d16b328d32a6ddc2fdb9.js +1 -0
- package/assets/esri/core/workers/chunks/d94c5f36d52cf71f0bb9.js +1 -0
- package/assets/esri/core/workers/chunks/db937849b2c1af87b481.js +1 -0
- package/assets/esri/core/workers/chunks/{66cd99e91dad60c5274c.js → dc3ed59f450283d97a19.js} +1 -1
- package/assets/esri/core/workers/chunks/dcd0653191cd4a1ccaae.js +2 -0
- package/assets/esri/core/workers/chunks/{31df729c17470245288c.js.LICENSE.txt → dcd0653191cd4a1ccaae.js.LICENSE.txt} +2 -2
- package/assets/esri/core/workers/chunks/e4fdd1eaf987977d0a51.js +1 -0
- package/assets/esri/core/workers/chunks/e51f0e71f2a55af604d3.js +1 -0
- package/assets/esri/core/workers/chunks/eb3855d3753d6b8334bd.js +1 -0
- package/assets/esri/core/workers/chunks/{7c290763920f52a1f504.js → eeed138930a4a805691d.js} +1 -1
- package/assets/esri/core/workers/chunks/f435dc615fdc8917f6ca.js +1 -0
- package/assets/esri/core/workers/chunks/{d5c5b9f7f5401f36a3a5.js → f7f3dde4c8f9c687cc1e.js} +1 -1
- package/assets/esri/core/workers/chunks/fc6beaf9466ea3898549.js +1 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Tooltip.scss +1 -0
- package/assets/esri/themes/base/widgets/_Weather.scss +1 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/BlendLayers.glsl.js +6 -6
- package/chunks/arcade.js +1 -1
- package/chunks/array.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/core/sql/StandardizedFunctions.js +1 -1
- package/geohash/GeohashTree.js +1 -1
- package/geometry/support/contains.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/intersects.js +1 -1
- package/geometry/support/intersectsBase.js +1 -1
- package/geometry/support/normalizeUtilsCommon.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/interfaces.d.ts +685 -37
- package/layers/MediaLayer.d.ts +4 -0
- package/layers/MediaLayer.js +5 -0
- package/layers/VoxelLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +5 -0
- package/layers/graphics/OptimizedGeometry.js +1 -1
- package/layers/graphics/data/BoundsStore.js +1 -1
- package/layers/support/CornersGeoreference.d.ts +4 -0
- package/layers/support/CornersGeoreference.js +5 -0
- package/layers/support/ExtentAndRotationGeoreference.d.ts +4 -0
- package/layers/support/ExtentAndRotationGeoreference.js +5 -0
- package/layers/support/FeatureReduction.js +1 -1
- package/layers/support/FeatureReductionBinning.js +5 -0
- package/layers/support/GeoreferenceBase.js +5 -0
- package/layers/support/ImageElement.d.ts +4 -0
- package/layers/support/ImageElement.js +5 -0
- package/layers/support/LocalMediaElementSource.d.ts +4 -0
- package/layers/support/LocalMediaElementSource.js +5 -0
- package/layers/support/MediaElementBase.d.ts +4 -0
- package/layers/support/MediaElementBase.js +5 -0
- package/layers/support/RouteStopSymbols.d.ts +4 -0
- package/layers/support/RouteSymbols.d.ts +4 -0
- package/layers/support/VoxelFormat.d.ts +4 -0
- package/layers/support/VoxelStyle.d.ts +4 -0
- package/layers/support/VoxelVariable.d.ts +4 -0
- package/layers/support/VoxelVolume.d.ts +4 -0
- package/layers/support/VoxelVolumeStyle.d.ts +4 -0
- package/layers/support/arcgisLayerUrl.js +1 -1
- package/layers/support/featureReductionUtils.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/rasterFormats/Lerc.js +1 -1
- package/package.json +3 -3
- package/request.js +1 -1
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/Font.js +1 -1
- package/symbols/support/textUtils.js +1 -1
- package/views/2d/engine/brushes.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +5 -0
- package/views/2d/engine/webgl/OverlayContainer.js +5 -0
- package/views/2d/engine/webgl/brushes/BrushOverlay.js +5 -0
- package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
- package/views/2d/engine/webgl/shaders/OverlayPrograms.js +5 -0
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +5 -0
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureStore2D.js +1 -1
- package/views/2d/layers/features/Pipeline.js +1 -1
- package/views/2d/layers/features/Store2D.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/views/2d/layers/features/sources/GeoEventSource.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/BinStore.js +5 -0
- package/views/2d/layers/features/support/ClusterStore.js +1 -1
- package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/support/clusterUtils.js +1 -1
- package/views/2d/magnifier/MagnifierView2D.js +1 -1
- package/views/2d/navigation/actions/Pinch.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/analysis/AnalysisView3D.js +1 -1
- package/views/3d/analysis/Dimensioning/DimensioningTool.js +5 -0
- package/views/3d/analysis/Dimensioning/DimensioningVisualization.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +5 -0
- package/views/3d/analysis/Dimensioning/{LinearDimensionVisualization.js → LengthDimensionVisualization.js} +1 -1
- package/views/3d/analysis/Dimensioning/settings.js +5 -0
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/SegmentLabels3D.js +5 -0
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/GraphicReshapeTool.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +5 -0
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/i3s/IDBCache.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/local/ZoomController.js +1 -1
- package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/SegmentLabels.js +5 -0
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/LineSnapper.js +1 -1
- package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/interactive/support/viewUtils.js +5 -0
- package/views/interactive/tooltip/DrawPointTooltipInfo.js +5 -0
- package/views/interactive/tooltip/DrawPolygonTooltipInfo.js +5 -0
- package/views/interactive/tooltip/DrawPolylineTooltipInfo.js +5 -0
- package/views/interactive/tooltip/Tooltip.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/support/measurements.js +5 -0
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/layers/GroupLayerView.js +1 -1
- package/views/overlay/TextOverlayItem.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/support/screenUtils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/Attribution/AttributionViewModel.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureContent/FeatureContentViewModel.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/InputFieldGroup.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +11 -11
- package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/FeatureTemplates/TemplateItem.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/LayerList/ListItem.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/styles/Card.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print/FileLink.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/TableList/ListItem.js +1 -1
- package/widgets/Weather/LabeledSlider.js +1 -1
- package/widgets/Weather/VisibleElements.js +5 -0
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/support/AnalysisViewModel.js +1 -1
- package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
- package/analysis/LinearDimension.d.ts +0 -4
- package/analysis/LinearDimension.js +0 -5
- package/assets/esri/core/workers/chunks/0018053ac16a09feba70.js +0 -1
- package/assets/esri/core/workers/chunks/042938ca73f0b9e5a7e2.js +0 -1
- package/assets/esri/core/workers/chunks/048645611caa28dca7cd.js +0 -1
- package/assets/esri/core/workers/chunks/0b72d123386dc4ec7538.js +0 -1
- package/assets/esri/core/workers/chunks/13b04d5bf348ab5054c2.js +0 -1
- package/assets/esri/core/workers/chunks/215007e7c44811d90777.js +0 -1
- package/assets/esri/core/workers/chunks/31df729c17470245288c.js +0 -2
- package/assets/esri/core/workers/chunks/36272141b3c33cb19026.js +0 -1
- package/assets/esri/core/workers/chunks/36c8e8de9c3f67d32572.js +0 -1
- package/assets/esri/core/workers/chunks/37c428489c59df4b597b.js +0 -1
- package/assets/esri/core/workers/chunks/493169fd978fd543ef3b.js +0 -1
- package/assets/esri/core/workers/chunks/4f378ad6f4299183df85.js +0 -1
- package/assets/esri/core/workers/chunks/58e4c6ce1580427e7b55.js +0 -1
- package/assets/esri/core/workers/chunks/6c5441da675a8af35be2.js +0 -1
- package/assets/esri/core/workers/chunks/6ea16f6a0df946de480b.js +0 -1
- package/assets/esri/core/workers/chunks/7dfd70f4fa1096e56641.js +0 -1
- package/assets/esri/core/workers/chunks/88193e61072d7bf957f5.js +0 -1
- package/assets/esri/core/workers/chunks/8ccbde593c86c872e525.js +0 -1
- package/assets/esri/core/workers/chunks/9c6be39f1f21ab8b1c2d.js +0 -1
- package/assets/esri/core/workers/chunks/a73795cce722ba15b3da.js +0 -1
- package/assets/esri/core/workers/chunks/a8ed1a938dc164b401d9.js +0 -1
- package/assets/esri/core/workers/chunks/a9a73bc4875a5aeaf1b9.js +0 -1
- package/assets/esri/core/workers/chunks/adcc5bce6c0971c1b592.js +0 -1
- package/assets/esri/core/workers/chunks/afddfe620e6539991e6b.js +0 -1
- package/assets/esri/core/workers/chunks/b340c9bdabdb37995c8f.js +0 -1
- package/assets/esri/core/workers/chunks/b4c23630d6c85f7b59c0.js +0 -1
- package/assets/esri/core/workers/chunks/c180c40838246985479d.js +0 -1
- package/assets/esri/core/workers/chunks/caed2365bd296fcc8a75.js +0 -1
- package/assets/esri/core/workers/chunks/d85b5b73a151c6fbb658.js +0 -1
- package/assets/esri/core/workers/chunks/da6261673c3e1537b6a6.js +0 -1
- package/assets/esri/core/workers/chunks/dafe120243db6648a4ab.js +0 -1
- package/assets/esri/core/workers/chunks/ec6d138e8183e193f977.js +0 -1
- package/assets/esri/core/workers/chunks/ed4519ac9533a4d340f1.js +0 -1
- package/assets/esri/core/workers/chunks/f206300eef4560611728.js +0 -1
- package/assets/esri/core/workers/chunks/f55cbaf5a1d6ee6ac171.js +0 -1
- package/layers/GeoreferencedImageLayer.d.ts +0 -4
- package/layers/GeoreferencedImageLayer.js +0 -5
- package/layers/VoxelWasmManager.js +0 -5
- package/layers/VoxelWasmPerScene.js +0 -5
- package/views/3d/interactive/measurementTools/support/viewUtils.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import{someMap as i}from"../../../../core/MapUtils.js";import{destroyMaybe as n,disposeMaybe as a,isSome as h,isNone as d,applySome as o,unwrap as _}from"../../../../core/maybe.js";import{watch as l,syncAndInitial as c,initial as p,sync as m}from"../../../../core/reactiveUtils.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{v as T,a as R,m as A}from"../../../../chunks/mat4.js";import{I as E,c as P}from"../../../../chunks/mat4f64.js";import{c as b}from"../../../../chunks/boundedPlane.js";import{MAXIMUM_ANIMATION_LOAD as S,MINIMUM_IDLE_ANIMATION_MS as H}from"../../support/animationUtils.js";import w from"../../support/debugFlags.js";import{RenderPassManager as M}from"../core/renderPasses/RenderPassManager.js";import{HUDTransparentRenderStyle as I}from"../core/shaderLibrary/hud/HUDUniforms.js";import{AntiAliasingMode as x,TransparencyPassType as C,Decorations as L,RenderRequestType as O,StencilBits as D}from"./basicInterfaces.js";import{BoundingInfo as y}from"./BoundingInfo.js";import{ZERO as N,union as v}from"./depthRange.js";import{depthRangeFromScene as U}from"./depthRangeUtils.js";import{createEmptyDepthTexture as F}from"./glUtil3D.js";import{Highlight as j}from"./Highlight.js";import{RenderOccludedFlag as q}from"./Material.js";import{OffscreenRendering as G}from"./OffscreenRendering.js";import{RenderContext as V}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as B}from"./rendererUtils.js";import{RenderPass as W}from"./RenderPass.js";import{RenderPluginManager as k}from"./RenderPluginManager.js";import{RenderSlot as Q}from"./RenderSlot.js";import{ShadowAccumulator as z}from"./ShadowAccumulator.js";import{ShadowHighlight as X}from"./ShadowHighlight.js";import{ShadowMap as Y,SnapshotSlot as K}from"./ShadowMap.js";import J from"./SliceHelper.js";import{SmaaRenderPass as Z}from"./SmaaRenderPass.js";import{SSAOHelper as $}from"./SSAOHelper.js";import{EdgeView as ee}from"./edgeRendering/EdgeView.js";import{Transparency as re}from"./edgeRendering/interfaces.js";import{MergedRenderer as te}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as se}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as ie,Statistics as ne}from"../statistics/RendererPerformanceInfo.js";import{ClearBufferBit as ae,PixelFormat as he,PixelType as de}from"../../../webgl/enums.js";const oe=.9;let _e=class extends r{constructor(e,r,t,i,n,a,h,d,o){super({}),this._materialRepository=e,this._shaderTechniqueRepository=t,this._rctx=i,this._compositingHelper=n,this._magnifierHelper=a,this._requestRender=h,this._stage=o,this._materialRenderers=new Map,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._content=new Map,this._isRendering=!1,this._fallbackDepthStencilTexture=null,this.performanceInfo=new ie,this._antialiasing=x.SMAA,this._oitEnabled=!1,this._multipassTerrain=!0,this._transparentTerrain=!1,this._hasAnimations=!1,this._animationTimestep=g(0),this._handles=new s,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this._smaaPass=new Z(this._rctx,t),this._oitEnabled=this._hasOITSupport,this._requestRender(),this._offscreenRendering=new G(this._rctx,this._compositingHelper),this._sliceHelper=new J,this._shadowMap=new Y(this._rctx,o.viewingMode,2),this._ssaoHelper=new $(t,this._rctx,(()=>this._requestRender())),this._highlight=new j(t,this._rctx),this._shadowHighlight=new X(this._rctx,o.viewingMode),this._shadowAccumulator=new z(this._rctx,t,o,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureCameraBindParameters(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t),this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_ALL,e.shadowMap),e.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(e.camera,e.contentCamera)}),(()=>this._requestRender())),this._renderContext=new V(this._rctx,this._offscreenRendering,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new k({renderContext:this._renderContext,shaderTechniqueRepository:t,textureRep:r,materialRep:this._materialRepository,requestRender:this._requestRender,schedule:d}),this.renderPassManager=new M(this._rctx,this._shaderTechniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([l((()=>this._stage.state.camera),(()=>this._requestRender()),c),l((()=>w.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(re.TRANSPARENT):()=>{},this._requestRender()}),p)])}get _bindParameters(){return this._renderContext.bindParameters}get hasWater(){return this._hasWater||this._hasOverlayWater}get hasWaterReflection(){return this.hasWater&&this._waterReflectionEnabled}normalizeCtorArgs(){return{}}dispose(){this._handles.destroy(),this._smaaPass.dispose(),this._materialRenderers.forEach((e=>e.dispose())),this._materialRenderers.clear(),this._edgeView=n(this._edgeView),this._offscreenRendering.dispose(),this._fallbackDepthStencilTexture=a(this._fallbackDepthStencilTexture),this._shadowMap.enabled=!1,this._shadowMap.dispose(),this._ssaoHelper.enabled=!1,this._ssaoHelper.dispose(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),y.prune(),this._content.clear()}disposeOffscreenBuffers(){this._offscreenRendering.dispose(),this._shadowMap.dispose(),this._smaaPass.disable(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._antialiasing===x.SMAA&&this._smaaPass.updating||h(this._edgeView)&&this._edgeView.updating||this._shadowAccumulator.running||!this.isCameraFinal}ensureEdgeView(){return d(this._edgeView)&&(this._edgeView=new ee({rctx:this._rctx,renderSR:this._stage.renderSR,techniqueRepository:this._shaderTechniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:e=>this._stage.resourceController.schedule(e)}),this._handles.add(l((()=>o(this._edgeView,(e=>e.updating))),(()=>this._requestRender()),m)),this._requestRender()),this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return T(this._bindParameters.ssr.reprojectionMatrix,E)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setRenderParameters(e){const{_shadowMap:r,_ssaoHelper:t,_bindParameters:s}=this;void 0!==e.screenSpaceReflectionsEnabled&&s.ssr.enabled!==e.screenSpaceReflectionsEnabled&&(s.ssr.enabled=e.screenSpaceReflectionsEnabled,this._requestRender()),void 0!==e.enableFillLights&&s.enableFillLights!==e.enableFillLights&&(s.enableFillLights=e.enableFillLights,this._requestRender()),void 0!==e.shadowMap&&r.enabled!==e.shadowMap&&(r.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),void 0!==e.ssao&&t.enabled!==e.ssao&&(t.enabled=e.ssao,this._requestRender()),e.background&&this._offscreenRendering.background!==e.background&&(this._offscreenRendering.background=e.background,this._requestRender());const i=e.antialiasingEnabled?x.SMAA:x.NONE;void 0!==e.antialiasingEnabled&&this._antialiasing!==i&&(this._antialiasing=i,this._requestRender()),void 0!==e.highQualityTransparency&&this._multipassTerrain!==e.highQualityTransparency&&(this._multipassTerrain=e.highQualityTransparency,this._oitEnabled=e.highQualityTransparency&&this._hasOITSupport,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=_(e.slicePlane),this._requestRender()),void 0!==e.waterReflectionEnabled&&this._waterReflectionEnabled!==e.waterReflectionEnabled&&(this._waterReflectionEnabled=e.waterReflectionEnabled,this._requestRender()),void 0!==e.enableFillLights&&s.enableFillLights!==e.enableFillLights&&(s.enableFillLights=e.enableFillLights,this._requestRender()),void 0!==e.transparentTerrain&&this._transparentTerrain!==e.transparentTerrain&&(this._transparentTerrain=e.transparentTerrain,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlendWorking}modify(e){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:t,updates:s}=e;if(0===r.length&&0===t.length&&0===s.length)return;t.forAll((({id:e})=>this._content.delete(e))),r.forAll((e=>this._content.set(e.id,e)));const n=B(e);let a=!1;n.forEach(((e,r)=>{let t=this._materialRenderers.get(r);if(!t){if(!(e.adds.length>0))return;t=new te(this._rctx,this._materialRepository,r),this._materialRenderers.set(r,t)}t.modify(e),t.isEmpty&&(a=!0)})),a&&this._materialRenderers.forEach(((e,r)=>{e.isEmpty&&(this._materialRenderers.delete(r),e.dispose())})),this._hasHighlights=i(this._materialRenderers,(e=>e.hasHighlights)),this._bindParameters.hasOccludees=i(this._materialRenderers,(e=>e.hasOccludees)),this._hasWater=i(this._materialRenderers,(e=>e.hasWater)),this._needsTransparentPass=i(this._materialRenderers,(e=>e.requiresSlot(Q.TRANSPARENT_MATERIAL,W.MATERIAL))),this._hasHUDElements=i(this._materialRenderers,(e=>e.requiresSlot(Q.LINE_CALLOUTS_HUD_DEPTH,W.MATERIAL)||e.requiresSlot(Q.HUD_MATERIAL,W.MATERIAL)||e.requiresSlot(Q.LABEL_MATERIAL,W.MATERIAL))),this._requestRender()}updateAnimation(e){return this._hasAnimations=!1,this._materialRenderers.forEach((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations}get animationTimestep(){return this._animationTimestep}updateLightSources(e,r,t){this._bindParameters.lighting.groundLightingFactor=r,this._bindParameters.lighting.globalFactor=t,this._bindParameters.lighting.set(e)}render(e,r,t,s){this._isRendering=!0,this.performanceInfo.prerender(this._rctx),this._bindParameters.transparencyPassType=C.NONE;const i=this._offscreenRendering;i.needLastFrameColorTexture=this.hasWaterReflection,i.advanceCurrentRenderTarget();const n=b(this._sliceHelper.plane);s===L.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),r.setGLViewport(this._rctx),this._ensureCameraBindParameters(r,t),this._renderPlugins.prepareRender(),this.performanceInfo.advance(ne.Prepare);const a=this._computeDepthRange(r);this._renderShadowMap(e,r,this._bindParameters.lighting.lightingMainDirection,a),this.performanceInfo.advance(ne.Shadowmap),i.initializeFrame(r),this._ensureBindParameters(r,t),this._renderLinearDepth(),this.performanceInfo.advance(ne.Lineardepth),this._accumulateShadows(a,r,t),this._renderNormal(),this.performanceInfo.advance(ne.Normals),this._ensureBindParametersSSR(),this._ssaoHelper.computeSSAO(this._bindParameters,i.linearDepthTexture,i.normalTexture),this.performanceInfo.advance(ne.SSAO),this._renderContext.pass=W.MATERIAL,i.bindFramebuffer(),this._renderOpaqueGeometry(),this.performanceInfo.advance(ne.Opaque);const o=this._multipassTerrain&&this._transparentTerrain;this._renderTerrainLinearDepth(o),this._setMultipassEnabled(o),this._setTerrainCulling(o),this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ne.OpaqueEdges),this._renderHiddenTransparentEdges();const _=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;_&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(ne.Transparent),this._renderGeometryLinearDepth(o);const l=this._renderHUDVisibility();o||this._renderInternalSlot(Q.LINE_CALLOUTS),this.performanceInfo.advance(ne.Hudvisibility),this._renderEdges(re.TRANSPARENT,o),this.performanceInfo.advance(ne.TransparentEdges),this._renderSlot(Q.VOXEL),this._renderTransparentTerrain(),this._transparentTerrain&&l&&(o?this._renderLineCallouts(I.Occluded):i.compositeTransparentTerrainOntoHUDVisibility(this._bindParameters),this._renderHUD(I.Occluded,i.framebuffer),this.performanceInfo.advance(ne.HudOccluded)),this.performanceInfo.advance(ne.TransparentTerrain),this._setTerrainCulling(!1),this._transparentTerrain&&(i.compositeTransparentTerrainOntoMain(this._bindParameters),o&&(this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ne.OpaqueEdges),_&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(ne.Transparent),this._renderEdges(re.TRANSPARENT),this.performanceInfo.advance(ne.TransparentEdges))),o&&this._renderLineCallouts(I.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),i.renderToTargets((()=>{this._renderInternalSlot(Q.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(Q.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(Q.LASERLINES)}),i.currentColorTarget,i.mainDepth),this.performanceInfo.advance(ne.Atmosphere),this._renderPlugins.needsLaserlineWithContrastControl&&i.renderTmpAndCompositeToMain((()=>this._renderSlot(Q.LASERLINES_CONTRAST_CONTROL)),this._bindParameters,se.PremultipliedAlpha),this.performanceInfo.advance(ne.Laserline),this._renderOccluded(),this.performanceInfo.advance(ne.Occluded);const c=s===L.ON&&this._magnifierHelper.enabled,p=c&&d(e)?this._offscreenRendering.getFramebuffer(this._offscreenRendering.tmpColor,this._offscreenRendering.tmpDepth):e;this._rctx.bindFramebuffer(p);const m=this._offscreenRendering.colorTexture;!this._renderAntiAliasing(this._antialiasing,m)&&h(m)&&this._compositingHelper.composite(this._bindParameters,m,se.None),this.performanceInfo.advance(ne.Antialiasing),this._renderHUD(I.NotOccluded,p),this.performanceInfo.advance(ne.HudNotoccluded),this._renderHighlights(p,this._bindParameters),this.performanceInfo.advance(ne.Highlights),c&&this._magnifierHelper.render(this._rctx,this._bindParameters),p!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.tmpColorTexture,se.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=n,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.postrender()}finish(e){if(this._hasAnimations||(this._animationTimestep=g(0)),e===O.BACKGROUND){this._rctx.gl.getError();const e=this.performanceInfo.elapsedTime/S;this._animationTimestep=g(Math.max(this._animationTimestep*oe+e*(1-oe),H))}}readDepthPixels(e,r,t){const s=this._offscreenRendering.bindTarget(this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=ae.COLOR_BUFFER_BIT|ae.DEPTH_BUFFER_BIT|ae.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH)}s.readPixels(r[0],r[1],r[2],r[3],he.RGBA,de.UNSIGNED_BYTE,t)}readHUDVisibility(e,r,t,s,i){this._offscreenRendering.bindTarget(this._offscreenRendering.hudVisibility).readPixels(e,r,t,s,he.RGBA,de.UNSIGNED_BYTE,i)}readAccumulatedShadow(e,r){return this._shadowAccumulator.readAccumulatedShadow(e,r)}_setMultipassEnabled(e){this._bindParameters.multipassTerrain.enabled=this._bindParameters.multipassGeometry.enabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_renderSlot(e){this._bindParameters.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;h(t)&&t.shouldRender()&&this._offscreenRendering.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),this._bindParameters,se.Alpha,r)}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&(i.start(r,t,s),this._shadowHighlight.updateParameters(r,t),this.needsShadowHighlight?(this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT,this._shadowMap,(e=>i.takeCascadeSnapshotTo(e,K.Highlight))),i.clear(),this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_DEFAULT,this._shadowMap,(e=>{i.takeCascadeSnapshotTo(e,K.Default),this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT)}))):this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_ALL),i.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.getCascades())s.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(s.camera,s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.enabled||this._renderPlugins.needsLinearDepth||this._hasWater&&this._waterReflectionEnabled||this.needsShadowHighlight||this.needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreenRendering.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH)),this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.linearDepth),this._bindParameters.linearDepthTexture=this._offscreenRendering.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.pass;this._renderContext.pass=W.MATERIAL_DEPTH,this._offscreenRendering.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreenRendering.terrainLinearDepth,this._offscreenRendering.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.terrainLinearDepth);this._bindParameters.multipassTerrain.linearDepthTexture=this._offscreenRendering.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.pass;this._offscreenRendering.renderToTargets((()=>this._renderGeometryPass(W.MATERIAL_DEPTH)),this._offscreenRendering.geometryLinearDepth,this._offscreenRendering.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.geometryLinearDepth);this._bindParameters.multipassGeometry.linearDepthTexture=this._offscreenRendering.geometryLinearDepthTexture}get needsNormal(){return this._ssaoHelper.enabled}_renderNormal(){this.needsNormal?this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_NORMAL)}),this._offscreenRendering.normal,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.normal)}get needsDepthRange(){return this._shadowMap.enabled||this.needsShadowCast}_computeDepthRange(e){if(!this.needsDepthRange)return N;const r=U(e,this._content,this._stage.layers);return v(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.pass=e,this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.pass=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderOpaqueGeometry(){this._renderSlot(Q.INTEGRATED_MESH),this._renderSlot(Q.OPAQUE_TERRAIN),this._renderInternalSlot(Q.OPAQUE_MATERIAL),this._renderSlot(Q.OPAQUE_MATERIAL),this._renderSlot(Q.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(Q.TRANSPARENT_MATERIAL),this._renderSlot(Q.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){this._renderSlot(Q.TRANSPARENT_TERRAIN)}_renderHUDVisibility(){let e=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,e=this._renderInternalSlot(Q.OCCLUSION_PIXELS)}),this._multipassTerrain&&this._transparentTerrain),e}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===I.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderInternalSlot(Q.LINE_CALLOUTS)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderInternalSlot(Q.LINE_CALLOUTS)}_renderHUD(e,r){this._hasHUDElements&&(this._oitEnabled?(this._renderOrderIndependentTransparency((()=>this._renderHUDElements(e)),!0),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.hudColorTexture,se.PremultipliedAlpha)):e===I.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderHUDElements(I.Occluded)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderHUDElements(e))}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._renderInternalSlot(Q.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(Q.HUD_MATERIAL),this._renderInternalSlot(Q.LABEL_MATERIAL)}get needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this.needsHighlight}_renderHighlights(e,r){if(!this.needsHighlight)return void this._offscreenRendering.disposeTarget(this._offscreenRendering.highlight);const t=this._highlight,s=this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_HIGHLIGHT),this._rctx.clearSafe(ae.DEPTH_BUFFER_BIT),this._renderHUDElements(I.Both)}),this._offscreenRendering.highlight,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=s.colorTexture,this.needsShadowHighlight&&this._shadowHighlight.render(r,e),t.render(this._bindParameters,s,e)}get needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this.needsShadowCast&&this._shadowAccumulator.renderAccumulation(this._offscreenRendering.linearDepthTexture,e,r,t)}_renderOrderIndependentTransparency(e,r){const t=t=>{this._bindParameters.transparencyPassType=t,this._offscreenRendering.renderOITPass((()=>e()),t,r)},s=this._renderContext.pass;this._renderContext.pass=W.MATERIAL_ALPHA,t(C.Alpha),this._renderContext.pass=W.MATERIAL,t(C.Color),t(C.FrontFace),this._offscreenRendering.compositeTransparentOntoOpaque(this._bindParameters,r),this._bindParameters.transparencyPassType=C.NONE,this._renderContext.pass=s,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreenRendering.disposeTarget(this._offscreenRendering.alphaFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.colorFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.frontFaceTarget)),this._oitUsed=!1}_renderOccluded(){let e=0;this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&t.renderOccluded===q.OccludeAndTransparentStencil&&(e|=t.renderOccluded,pe.push(t))}));const r=this._offscreenRendering,t=(t,s,i,n,a)=>{0!=(e&s)&&(r.renderToTargets(i,r.tmpColor,r.mainDepth,[0,0,0,0],n,a),r.compositeOccludedOntoMain(this._bindParameters,t))};0!==pe.length&&(this._renderInternalSlot(Q.OCCLUDER_MATERIAL,pe),t(.5,q.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(Q.TRANSPARENT_OCCLUDER_MATERIAL,pe)),!1,!1),pe.length=0),this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&(t.renderOccluded===q.OccludeAndTransparent||t.renderOccluded===q.Transparent||t.renderOccluded===q.Opaque)&&(e|=t.renderOccluded,ce.push(t))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,s>q.Occlude&&this._renderSlot(Q.OCCLUDED_TERRAIN),this._renderInternalSlot(Q.OPAQUE_MATERIAL,ce),this._renderInternalSlot(Q.TRANSPARENT_MATERIAL,ce),this._renderInternalSlot(Q.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,ce),this._renderContext.resetRenderOccludedMask()};this._renderContext.pass=W.MATERIAL,t(.5,q.OccludeAndTransparent,(()=>i(q.OccludeAndTransparent)),!0,D.OutlineVisualElementMask),t(.5,q.Transparent,(()=>i(q.Transparent)),!0,D.OutlineVisualElementMask),t(1,q.Opaque,(()=>i(q.Opaque)),!0,D.OutlineVisualElementMask),ce.length=0}_renderAntiAliasing(e,r){if(e===x.SMAA){if(this._smaaPass.enable((()=>this._requestRender()))&&h(r))return this._smaaPass.render(r),!0}else this._smaaPass.disable();return!1}_ensureCameraBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._ensureCameraBindParameters(e,r);const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibilityTexture=t.hudVisibilityTexture,this._bindParameters.highlightDepthTexture=t.depthTexture??this._getFallbackDepthTexture()}_ensureBindParametersSSR(){this.hasWaterReflection?(this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=E:(R(ge,this._bindParameters.camera.viewMatrix),R(me,this._bindParameters.camera.projectionMatrix),A(ue,ge,me),A(ue,this._renderContext.lastFrameCamera.viewMatrix,ue),A(ue,this._renderContext.lastFrameCamera.projectionMatrix,ue),this._reprojectionMatrix=ue),this._bindParameters.ssr.lastFrameColorTexture=this._offscreenRendering.lastFrameColorTexture):this._bindParameters.ssr.lastFrameColorTexture=null,this._bindParameters.ssr.enabled=this.hasWaterReflection}_renderInternalSlot(e,r){let t=!1;return this._bindParameters.slot=e,h(r)?r.forEach((e=>{if(!e.shouldRender(this._renderContext))return;const r=this._materialRenderers.get(e);h(r)&&(t=r.render(this._renderContext.pass,this._bindParameters)||t)})):this._materialRenderers.forEach(((e,r)=>{r.shouldRender(this._renderContext)&&e.render(this._renderContext.pass,this._bindParameters)&&(t=!0)})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=F(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){return{offscreen:this._offscreenRendering?.gpuMemoryUsage??0,highlights:(this._highlight?.gpuMemoryUsage??0)+(this._shadowHighlight?.gpuMemoryUsage??0),shadows:this._shadowMap?.gpuMemoryUsage??0,ssao:this._ssaoHelper?.gpuMemoryUsage??0}}get test(){const e=this;return{offscreen:this._offscreenRendering,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,getFramebufferTexture:r=>{switch(r){case le.Color:return e._offscreenRendering.colorTexture;case le.LinearDepth:return e._offscreenRendering.linearDepthTexture;case le.Normals:return e._offscreenRendering.normalTexture;case le.ShadowMap:return e._shadowMap.depthTexture;case le.HudVisibility:return e._offscreenRendering.hudVisibilityTexture;case le.Highlight:return e._offscreenRendering.highlightTexture}}}}};var le;e([u()],_e.prototype,"_shadowAccumulator",void 0),e([u()],_e.prototype,"_smaaPass",void 0),e([u()],_e.prototype,"_antialiasing",void 0),e([u()],_e.prototype,"_edgeView",void 0),e([u()],_e.prototype,"updating",null),e([u()],_e.prototype,"isCameraFinal",null),_e=e([f("esri.views.3d.webgl-engine.lib.Renderer")],_e),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(le||(le={}));const ce=[],pe=[],me=P(),ge=P(),ue=P();export{le as FramebufferId,_e as Renderer};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import{someMap as i}from"../../../../core/MapUtils.js";import{destroyMaybe as n,disposeMaybe as a,isSome as h,isNone as d,applySome as o,unwrap as _}from"../../../../core/maybe.js";import{watch as l,syncAndInitial as c,initial as p,sync as m}from"../../../../core/reactiveUtils.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{v as T,a as R,m as A}from"../../../../chunks/mat4.js";import{I as E,c as P}from"../../../../chunks/mat4f64.js";import{c as b}from"../../../../chunks/boundedPlane.js";import{MAXIMUM_ANIMATION_LOAD as S,MINIMUM_IDLE_ANIMATION_MS as H}from"../../support/animationUtils.js";import w from"../../support/debugFlags.js";import{RenderPassManager as M}from"../core/renderPasses/RenderPassManager.js";import{HUDTransparentRenderStyle as I}from"../core/shaderLibrary/hud/HUDUniforms.js";import{AntiAliasingMode as x,TransparencyPassType as C,Decorations as L,RenderRequestType as O,StencilBits as D}from"./basicInterfaces.js";import{BoundingInfo as y}from"./BoundingInfo.js";import{ZERO as N,union as v}from"./depthRange.js";import{depthRangeFromScene as U}from"./depthRangeUtils.js";import{createEmptyDepthTexture as F}from"./glUtil3D.js";import{Highlight as j}from"./Highlight.js";import{RenderOccludedFlag as q}from"./Material.js";import{OffscreenRendering as G}from"./OffscreenRendering.js";import{RenderContext as V}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as B}from"./rendererUtils.js";import{RenderPass as W}from"./RenderPass.js";import{RenderPluginManager as k}from"./RenderPluginManager.js";import{RenderSlot as Q}from"./RenderSlot.js";import{ShadowAccumulator as z}from"./ShadowAccumulator.js";import{ShadowHighlight as X}from"./ShadowHighlight.js";import{ShadowMap as Y,SnapshotSlot as K}from"./ShadowMap.js";import J from"./SliceHelper.js";import{SmaaRenderPass as Z}from"./SmaaRenderPass.js";import{SSAOHelper as $}from"./SSAOHelper.js";import{EdgeView as ee}from"./edgeRendering/EdgeView.js";import{Transparency as re}from"./edgeRendering/interfaces.js";import{MergedRenderer as te}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as se}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as ie,Statistics as ne}from"../statistics/RendererPerformanceInfo.js";import{ClearBufferBit as ae,PixelFormat as he,PixelType as de}from"../../../webgl/enums.js";const oe=.9;let _e=class extends r{constructor(e,r,t,i,n,a,h,d,o){super({}),this._materialRepository=e,this._shaderTechniqueRepository=t,this._rctx=i,this._compositingHelper=n,this._magnifierHelper=a,this._requestRender=h,this._stage=o,this._materialRenderers=new Map,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._content=new Map,this._isRendering=!1,this._fallbackDepthStencilTexture=null,this.performanceInfo=new ie,this._antialiasing=x.SMAA,this._oitEnabled=!1,this._multipassTerrain=!0,this._transparentTerrain=!1,this._hasAnimations=!1,this._animationTimestep=g(0),this._handles=new s,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this._smaaPass=new Z(this._rctx,t),this._oitEnabled=this._hasOITSupport,this._requestRender(),this._offscreenRendering=new G(this._rctx,this._compositingHelper),this._sliceHelper=new J,this._shadowMap=new Y(this._rctx,o.viewingMode,2),this._ssaoHelper=new $(t,this._rctx,(()=>this._requestRender())),this._highlight=new j(t,this._rctx),this._shadowHighlight=new X(this._rctx,o.viewingMode),this._shadowAccumulator=new z(this._rctx,t,o,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureCameraBindParameters(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t),this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_ALL,e.shadowMap),e.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(e.camera,e.contentCamera)}),(()=>this._requestRender())),this._renderContext=new V(this._rctx,this._offscreenRendering,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new k({renderContext:this._renderContext,shaderTechniqueRepository:t,textureRep:r,materialRep:this._materialRepository,requestRender:this._requestRender,schedule:d}),this.renderPassManager=new M(this._rctx,this._shaderTechniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([l((()=>this._stage.state.camera),(()=>this._requestRender()),c),l((()=>w.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(re.TRANSPARENT):()=>{},this._requestRender()}),p)])}get _bindParameters(){return this._renderContext.bindParameters}get hasWater(){return this._hasWater||this._hasOverlayWater}get hasWaterReflection(){return this.hasWater&&this._waterReflectionEnabled}normalizeCtorArgs(){return{}}dispose(){this._handles.destroy(),this._smaaPass.dispose(),this._materialRenderers.forEach((e=>e.dispose())),this._materialRenderers.clear(),this._edgeView=n(this._edgeView),this._offscreenRendering.dispose(),this._fallbackDepthStencilTexture=a(this._fallbackDepthStencilTexture),this._shadowMap.enabled=!1,this._shadowMap.dispose(),this._ssaoHelper.enabled=!1,this._ssaoHelper.dispose(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),y.prune(),this._content.clear()}disposeOffscreenBuffers(){this._offscreenRendering.dispose(),this._shadowMap.dispose(),this._smaaPass.disable(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._antialiasing===x.SMAA&&this._smaaPass.updating||h(this._edgeView)&&this._edgeView.updating||this._shadowAccumulator.running||!this.isCameraFinal}ensureEdgeView(){return d(this._edgeView)&&(this._edgeView=new ee({rctx:this._rctx,renderSR:this._stage.renderSR,techniqueRepository:this._shaderTechniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:e=>this._stage.resourceController.schedule(e)}),this._handles.add(l((()=>o(this._edgeView,(e=>e.updating))),(()=>this._requestRender()),m)),this._requestRender()),this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return T(this._bindParameters.ssr.reprojectionMatrix,E)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setRenderParameters(e){const{_shadowMap:r,_ssaoHelper:t,_bindParameters:s}=this;void 0!==e.screenSpaceReflectionsEnabled&&s.ssr.enabled!==e.screenSpaceReflectionsEnabled&&(s.ssr.enabled=e.screenSpaceReflectionsEnabled,this._requestRender()),void 0!==e.enableFillLights&&s.enableFillLights!==e.enableFillLights&&(s.enableFillLights=e.enableFillLights,this._requestRender()),void 0!==e.shadowMap&&r.enabled!==e.shadowMap&&(r.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),void 0!==e.ssao&&t.enabled!==e.ssao&&(t.enabled=e.ssao,this._requestRender()),e.background&&this._offscreenRendering.background!==e.background&&(this._offscreenRendering.background=e.background,this._requestRender());const i=e.antialiasingEnabled?x.SMAA:x.NONE;void 0!==e.antialiasingEnabled&&this._antialiasing!==i&&(this._antialiasing=i,this._requestRender()),void 0!==e.highQualityTransparency&&this._multipassTerrain!==e.highQualityTransparency&&(this._multipassTerrain=e.highQualityTransparency,this._oitEnabled=e.highQualityTransparency&&this._hasOITSupport,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=_(e.slicePlane),this._requestRender()),void 0!==e.waterReflectionEnabled&&this._waterReflectionEnabled!==e.waterReflectionEnabled&&(this._waterReflectionEnabled=e.waterReflectionEnabled,this._requestRender()),void 0!==e.enableFillLights&&s.enableFillLights!==e.enableFillLights&&(s.enableFillLights=e.enableFillLights,this._requestRender()),void 0!==e.transparentTerrain&&this._transparentTerrain!==e.transparentTerrain&&(this._transparentTerrain=e.transparentTerrain,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlendWorking}modify(e){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:t,updates:s}=e;if(0===r.length&&0===t.length&&0===s.length)return;t.forAll((({id:e})=>this._content.delete(e))),r.forAll((e=>this._content.set(e.id,e)));const n=B(e);let a=!1;n.forEach(((e,r)=>{let t=this._materialRenderers.get(r);if(!t){if(!(e.adds.length>0))return;t=new te(this._rctx,this._materialRepository,r),this._materialRenderers.set(r,t)}t.modify(e),t.isEmpty&&(a=!0)})),a&&this._materialRenderers.forEach(((e,r)=>{e.isEmpty&&(this._materialRenderers.delete(r),e.dispose())})),this._hasHighlights=i(this._materialRenderers,(e=>e.hasHighlights)),this._bindParameters.hasOccludees=i(this._materialRenderers,(e=>e.hasOccludees)),this._hasWater=i(this._materialRenderers,(e=>e.hasWater)),this._needsTransparentPass=i(this._materialRenderers,(e=>e.requiresSlot(Q.TRANSPARENT_MATERIAL,W.MATERIAL))),this._hasHUDElements=i(this._materialRenderers,(e=>e.requiresSlot(Q.LINE_CALLOUTS_HUD_DEPTH,W.MATERIAL)||e.requiresSlot(Q.HUD_MATERIAL,W.MATERIAL)||e.requiresSlot(Q.LABEL_MATERIAL,W.MATERIAL))),this._requestRender()}updateAnimation(e){return this._hasAnimations=!1,this._materialRenderers.forEach((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations}get animationTimestep(){return this._animationTimestep}updateLightSources(e,r,t){this._bindParameters.lighting.groundLightingFactor=r,this._bindParameters.lighting.globalFactor=t,this._bindParameters.lighting.set(e)}render(e,r,t,s){this._isRendering=!0,this.performanceInfo.prerender(this._rctx),this._bindParameters.transparencyPassType=C.NONE;const i=this._offscreenRendering;i.needLastFrameColorTexture=this.hasWaterReflection,i.advanceCurrentRenderTarget();const n=b(this._sliceHelper.plane);s===L.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),r.setGLViewport(this._rctx),this._ensureCameraBindParameters(r,t),this._renderPlugins.prepareRender(),this.performanceInfo.advance(ne.Prepare);const a=this._computeDepthRange(r);this._renderShadowMap(e,r,this._bindParameters.lighting.lightingMainDirection,a),this.performanceInfo.advance(ne.Shadowmap),i.initializeFrame(r),this._ensureBindParameters(r,t),this._renderLinearDepth(),this.performanceInfo.advance(ne.Lineardepth),this._accumulateShadows(a,r,t),this._renderNormal(),this.performanceInfo.advance(ne.Normals),this._ensureBindParametersSSR(),this._ssaoHelper.computeSSAO(this._bindParameters,i.linearDepthTexture,i.normalTexture),this.performanceInfo.advance(ne.SSAO),this._renderContext.pass=W.MATERIAL,i.bindFramebuffer(),this._renderOpaqueGeometry(),this.performanceInfo.advance(ne.Opaque);const o=this._multipassTerrain&&this._transparentTerrain;this._renderTerrainLinearDepth(o),this._setMultipassEnabled(o),this._setTerrainCulling(o),this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ne.OpaqueEdges),this._renderSlot(Q.VOXEL),this._renderHiddenTransparentEdges();const _=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;_&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(ne.Transparent),this._renderGeometryLinearDepth(o);const l=this._renderHUDVisibility();o||this._renderInternalSlot(Q.LINE_CALLOUTS),this.performanceInfo.advance(ne.Hudvisibility),this._renderEdges(re.TRANSPARENT,o),this.performanceInfo.advance(ne.TransparentEdges),this._renderTransparentTerrain(),this._transparentTerrain&&l&&(o?this._renderLineCallouts(I.Occluded):i.compositeTransparentTerrainOntoHUDVisibility(this._bindParameters),this._renderHUD(I.Occluded,i.framebuffer),this.performanceInfo.advance(ne.HudOccluded)),this.performanceInfo.advance(ne.TransparentTerrain),this._setTerrainCulling(!1),this._transparentTerrain&&(i.compositeTransparentTerrainOntoMain(this._bindParameters),o&&(this._renderEdges(re.OPAQUE),this.performanceInfo.advance(ne.OpaqueEdges),_&&(this._oitEnabled?this._renderOrderIndependentTransparency((()=>this._renderTransparentGeometry()),!1):this._renderTransparentGeometry()),this.performanceInfo.advance(ne.Transparent),this._renderEdges(re.TRANSPARENT),this.performanceInfo.advance(ne.TransparentEdges))),o&&this._renderLineCallouts(I.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),i.renderToTargets((()=>{this._renderInternalSlot(Q.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(Q.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(Q.LASERLINES)}),i.currentColorTarget,i.mainDepth),this.performanceInfo.advance(ne.Atmosphere),this._renderPlugins.needsLaserlineWithContrastControl&&i.renderTmpAndCompositeToMain((()=>this._renderSlot(Q.LASERLINES_CONTRAST_CONTROL)),this._bindParameters,se.PremultipliedAlpha),this.performanceInfo.advance(ne.Laserline),this._renderOccluded(),this.performanceInfo.advance(ne.Occluded);const c=s===L.ON&&this._magnifierHelper.enabled,p=c&&d(e)?this._offscreenRendering.getFramebuffer(this._offscreenRendering.tmpColor,this._offscreenRendering.tmpDepth):e;this._rctx.bindFramebuffer(p);const m=this._offscreenRendering.colorTexture;!this._renderAntiAliasing(this._antialiasing,m)&&h(m)&&this._compositingHelper.composite(this._bindParameters,m,se.None),this.performanceInfo.advance(ne.Antialiasing),this._renderHUD(I.NotOccluded,p),this.performanceInfo.advance(ne.HudNotoccluded),this._renderHighlights(p,this._bindParameters),this.performanceInfo.advance(ne.Highlights),c&&this._magnifierHelper.render(this._rctx,this._bindParameters),p!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.tmpColorTexture,se.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=n,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.postrender()}finish(e){if(this._hasAnimations||(this._animationTimestep=g(0)),e===O.BACKGROUND){this._rctx.gl.getError();const e=this.performanceInfo.elapsedTime/S;this._animationTimestep=g(Math.max(this._animationTimestep*oe+e*(1-oe),H))}}readDepthPixels(e,r,t){const s=this._offscreenRendering.bindTarget(this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=ae.COLOR_BUFFER_BIT|ae.DEPTH_BUFFER_BIT|ae.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH)}s.readPixels(r[0],r[1],r[2],r[3],he.RGBA,de.UNSIGNED_BYTE,t)}readHUDVisibility(e,r,t,s,i){this._offscreenRendering.bindTarget(this._offscreenRendering.hudVisibility).readPixels(e,r,t,s,he.RGBA,de.UNSIGNED_BYTE,i)}readAccumulatedShadow(e,r){return this._shadowAccumulator.readAccumulatedShadow(e,r)}_setMultipassEnabled(e){this._bindParameters.multipassTerrain.enabled=this._bindParameters.multipassGeometry.enabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_renderSlot(e){this._bindParameters.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;h(t)&&t.shouldRender()&&this._offscreenRendering.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),this._bindParameters,se.Alpha,r)}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&(i.start(r,t,s),this._shadowHighlight.updateParameters(r,t),this.needsShadowHighlight?(this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT,this._shadowMap,(e=>i.takeCascadeSnapshotTo(e,K.Highlight))),i.clear(),this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_DEFAULT,this._shadowMap,(e=>{i.takeCascadeSnapshotTo(e,K.Default),this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT)}))):this._renderShadowCascades(W.MATERIAL_DEPTH_SHADOWMAP_ALL),i.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.getCascades())s.camera.setGLViewport(this._rctx),this._ensureCameraBindParameters(s.camera,s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.enabled||this._renderPlugins.needsLinearDepth||this._hasWater&&this._waterReflectionEnabled||this.needsShadowHighlight||this.needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreenRendering.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_DEPTH)),this._offscreenRendering.linearDepth,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.linearDepth),this._bindParameters.linearDepthTexture=this._offscreenRendering.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.pass;this._renderContext.pass=W.MATERIAL_DEPTH,this._offscreenRendering.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreenRendering.terrainLinearDepth,this._offscreenRendering.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.terrainLinearDepth);this._bindParameters.multipassTerrain.linearDepthTexture=this._offscreenRendering.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.pass;this._offscreenRendering.renderToTargets((()=>this._renderGeometryPass(W.MATERIAL_DEPTH)),this._offscreenRendering.geometryLinearDepth,this._offscreenRendering.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.pass=e}else this._offscreenRendering.disposeTarget(this._offscreenRendering.geometryLinearDepth);this._bindParameters.multipassGeometry.linearDepthTexture=this._offscreenRendering.geometryLinearDepthTexture}get needsNormal(){return this._ssaoHelper.enabled}_renderNormal(){this.needsNormal?this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_NORMAL)}),this._offscreenRendering.normal,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0):this._offscreenRendering.disposeTarget(this._offscreenRendering.normal)}get needsDepthRange(){return this._shadowMap.enabled||this.needsShadowCast}_computeDepthRange(e){if(!this.needsDepthRange)return N;const r=U(e,this._content,this._stage.layers);return v(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.pass=e,this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.pass=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderOpaqueGeometry(){this._renderSlot(Q.INTEGRATED_MESH),this._renderSlot(Q.OPAQUE_TERRAIN),this._renderInternalSlot(Q.OPAQUE_MATERIAL),this._renderSlot(Q.OPAQUE_MATERIAL),this._renderSlot(Q.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(Q.TRANSPARENT_MATERIAL),this._renderSlot(Q.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){this._renderSlot(Q.TRANSPARENT_TERRAIN)}_renderHUDVisibility(){let e=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,e=this._renderInternalSlot(Q.OCCLUSION_PIXELS)}),this._multipassTerrain&&this._transparentTerrain),e}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===I.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderInternalSlot(Q.LINE_CALLOUTS)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderInternalSlot(Q.LINE_CALLOUTS)}_renderHUD(e,r){this._hasHUDElements&&(this._oitEnabled?(this._renderOrderIndependentTransparency((()=>this._renderHUDElements(e)),!0),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,this._offscreenRendering.hudColorTexture,se.PremultipliedAlpha)):e===I.Occluded?this._offscreenRendering.renderToTargets((()=>this._renderHUDElements(I.Occluded)),this._offscreenRendering.currentColorTarget,this._offscreenRendering.tmpDepth,void 0,!0,!0):this._renderHUDElements(e))}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._renderInternalSlot(Q.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(Q.HUD_MATERIAL),this._renderInternalSlot(Q.LABEL_MATERIAL)}get needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this.needsHighlight}_renderHighlights(e,r){if(!this.needsHighlight)return void this._offscreenRendering.disposeTarget(this._offscreenRendering.highlight);const t=this._highlight,s=this._offscreenRendering.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(W.MATERIAL_HIGHLIGHT),this._rctx.clearSafe(ae.DEPTH_BUFFER_BIT),this._renderHUDElements(I.Both)}),this._offscreenRendering.highlight,this._offscreenRendering.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=s.colorTexture,this.needsShadowHighlight&&this._shadowHighlight.render(r,e),t.render(this._bindParameters,s,e)}get needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this.needsShadowCast&&this._shadowAccumulator.renderAccumulation(this._offscreenRendering.linearDepthTexture,e,r,t)}_renderOrderIndependentTransparency(e,r){const t=t=>{this._bindParameters.transparencyPassType=t,this._offscreenRendering.renderOITPass((()=>e()),t,r)},s=this._renderContext.pass;this._renderContext.pass=W.MATERIAL_ALPHA,t(C.Alpha),this._renderContext.pass=W.MATERIAL,t(C.Color),t(C.FrontFace),this._offscreenRendering.compositeTransparentOntoOpaque(this._bindParameters,r),this._bindParameters.transparencyPassType=C.NONE,this._renderContext.pass=s,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreenRendering.disposeTarget(this._offscreenRendering.alphaFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.colorFloatTarget),this._offscreenRendering.disposeTarget(this._offscreenRendering.frontFaceTarget)),this._oitUsed=!1}_renderOccluded(){let e=0;this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&t.renderOccluded===q.OccludeAndTransparentStencil&&(e|=t.renderOccluded,pe.push(t))}));const r=this._offscreenRendering,t=(t,s,i,n,a)=>{0!=(e&s)&&(r.renderToTargets(i,r.tmpColor,r.mainDepth,[0,0,0,0],n,a),r.compositeOccludedOntoMain(this._bindParameters,t))};0!==pe.length&&(this._renderInternalSlot(Q.OCCLUDER_MATERIAL,pe),t(.5,q.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(Q.TRANSPARENT_OCCLUDER_MATERIAL,pe)),!1,!1),pe.length=0),this._materialRenderers.forEach(((r,t)=>{t&&t.isVisible()&&(t.renderOccluded===q.OccludeAndTransparent||t.renderOccluded===q.Transparent||t.renderOccluded===q.Opaque)&&(e|=t.renderOccluded,ce.push(t))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,s>q.Occlude&&this._renderSlot(Q.OCCLUDED_TERRAIN),this._renderInternalSlot(Q.OPAQUE_MATERIAL,ce),this._renderInternalSlot(Q.TRANSPARENT_MATERIAL,ce),this._renderInternalSlot(Q.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,ce),this._renderContext.resetRenderOccludedMask()};this._renderContext.pass=W.MATERIAL,t(.5,q.OccludeAndTransparent,(()=>i(q.OccludeAndTransparent)),!0,D.OutlineVisualElementMask),t(.5,q.Transparent,(()=>i(q.Transparent)),!0,D.OutlineVisualElementMask),t(1,q.Opaque,(()=>i(q.Opaque)),!0,D.OutlineVisualElementMask),ce.length=0}_renderAntiAliasing(e,r){if(e===x.SMAA){if(this._smaaPass.enable((()=>this._requestRender()))&&h(r))return this._smaaPass.render(r),!0}else this._smaaPass.disable();return!1}_ensureCameraBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._ensureCameraBindParameters(e,r);const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibilityTexture=t.hudVisibilityTexture,this._bindParameters.highlightDepthTexture=t.depthTexture??this._getFallbackDepthTexture()}_ensureBindParametersSSR(){this.hasWaterReflection?(this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=E:(R(ge,this._bindParameters.camera.viewMatrix),R(me,this._bindParameters.camera.projectionMatrix),A(ue,ge,me),A(ue,this._renderContext.lastFrameCamera.viewMatrix,ue),A(ue,this._renderContext.lastFrameCamera.projectionMatrix,ue),this._reprojectionMatrix=ue),this._bindParameters.ssr.lastFrameColorTexture=this._offscreenRendering.lastFrameColorTexture):this._bindParameters.ssr.lastFrameColorTexture=null,this._bindParameters.ssr.enabled=this.hasWaterReflection}_renderInternalSlot(e,r){let t=!1;return this._bindParameters.slot=e,h(r)?r.forEach((e=>{if(!e.shouldRender(this._renderContext))return;const r=this._materialRenderers.get(e);h(r)&&(t=r.render(this._renderContext.pass,this._bindParameters)||t)})):this._materialRenderers.forEach(((e,r)=>{r.shouldRender(this._renderContext)&&e.render(this._renderContext.pass,this._bindParameters)&&(t=!0)})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=F(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){return{offscreen:this._offscreenRendering?.gpuMemoryUsage??0,highlights:(this._highlight?.gpuMemoryUsage??0)+(this._shadowHighlight?.gpuMemoryUsage??0),shadows:this._shadowMap?.gpuMemoryUsage??0,ssao:this._ssaoHelper?.gpuMemoryUsage??0}}get test(){const e=this;return{offscreen:this._offscreenRendering,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,getFramebufferTexture:r=>{switch(r){case le.Color:return e._offscreenRendering.colorTexture;case le.LinearDepth:return e._offscreenRendering.linearDepthTexture;case le.Normals:return e._offscreenRendering.normalTexture;case le.ShadowMap:return e._shadowMap.depthTexture;case le.HudVisibility:return e._offscreenRendering.hudVisibilityTexture;case le.Highlight:return e._offscreenRendering.highlightTexture}}}}};var le;e([u()],_e.prototype,"_shadowAccumulator",void 0),e([u()],_e.prototype,"_smaaPass",void 0),e([u()],_e.prototype,"_antialiasing",void 0),e([u()],_e.prototype,"_edgeView",void 0),e([u()],_e.prototype,"updating",null),e([u()],_e.prototype,"isCameraFinal",null),_e=e([f("esri.views.3d.webgl-engine.lib.Renderer")],_e),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(le||(le={}));const ce=[],pe=[],me=P(),ge=P(),ue=P();export{le as FramebufferId,_e as Renderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{isSome as e}from"../../../../core/maybe.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutputOptions.js";import{ResourceState as a}from"../lib/basicInterfaces.js";import s from"../lib/GLMaterial.js";import{WaterTechnique as r}from"./WaterTechnique.js";class o extends s{_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.receiveShadows&&this._material.setParameters({receiveShadows:e.shadowMap.enabled})}_updateSSRState(e){e.ssr.enabled!==this._material.parameters.hasScreenSpaceReflections&&this._material.setParameters({hasScreenSpaceReflections:e.ssr.enabled})}_updateCloudsReflectionState(t){const a=e(t.cloudsComposition.clouds);a!==this._material.parameters.hasCloudsReflections&&this._material.setParameters({hasCloudsReflections:a})}ensureResources(e){const t=this._techniqueRepository.constructionContext.waterTextureRepository;return t.resourceState===a.NOT_LOADED&&t.loadTextures(e),t.resourceState}beginSlot(e){return this._output===t.Color&&(this._updateShadowState(e),this._updateSSRState(e),this._updateCloudsReflectionState(e)),this.ensureTechnique(r,e)}}export{o as WaterGLMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{f as t}from"../../../../chunks/vec2f64.js";import{f as i}from"../../../../chunks/vec4f64.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutputOptions.js";import{AnimationTimer as
|
|
5
|
+
import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{f as t}from"../../../../chunks/vec2f64.js";import{f as i}from"../../../../chunks/vec4f64.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutputOptions.js";import{AnimationTimer as s}from"../lib/AnimationTimer.js";import{outputFromPass as a}from"../lib/GLMaterials.js";import{Material as n,MaterialParameters as o}from"../lib/Material.js";import{OITPolygonOffsetLimit as h}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{WaterGLMaterial as p}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as l}from"./WaterTechnique.js";import{DefaultBufferWriter as m,PositionUVLayout as u}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as f}from"./internal/MaterialUtil.js";class d extends n{constructor(e){super(e,new A),this._techniqueConfig=new l,this.animation=new s}getConfiguration(e,t){return this._techniqueConfig.output=e,this._techniqueConfig.writeDepth=this.parameters.writeDepth,this._techniqueConfig.receiveShadows=this.parameters.receiveShadows,this._techniqueConfig.hasSlicePlane=this.parameters.hasSlicePlane,this._techniqueConfig.transparent=this.parameters.transparent,this._techniqueConfig.hasScreenSpaceReflections=this.parameters.hasScreenSpaceReflections,this._techniqueConfig.hasCloudsReflections=this.parameters.hasCloudsReflections,this._techniqueConfig.isDraped=this.parameters.isDraped,this._techniqueConfig.transparencyPassType=t.transparencyPassType,this._techniqueConfig.enableOffset=t.camera.relativeElevation<h,this._techniqueConfig.hasMultipassTerrain=t.multipassTerrain.enabled,this._techniqueConfig.cullAboveGround=t.multipassTerrain.cullAboveGround,this._techniqueConfig}update(t){const i=Math.min(t.camera.relativeElevation,t.camera.distance);this.animation.enabled=Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*i<R;const r=this.animation.advance(t);return this.setParameters({timeElapsed:e(this.animation.time)*this.parameters.animationSpeed},!1),this.animation.enabled&&r}intersect(e,t,i,r,s,a,n){f(e,t,r,s,a,void 0,n)}requiresSlot(e,t){switch(a(t)){case r.Normal:return e===c.DRAPED_WATER;case r.Color:if(this.parameters.isDraped)return e===c.DRAPED_MATERIAL;break;case r.Highlight:return e===c.OPAQUE_MATERIAL||e===c.DRAPED_MATERIAL}let i=c.OPAQUE_MATERIAL;return this.parameters.transparent&&(i=this.parameters.writeDepth?c.TRANSPARENT_MATERIAL:c.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===i}createGLMaterial(e){if(e.output===r.Color&&this.parameters.isDraped)return e.output=r.Draped,new p(e);switch(e.output){case r.Color:case r.Normal:case r.Highlight:case r.Alpha:return new p(e)}return null}createBufferWriter(){return new m(u)}}class A extends o{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=t(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.writeDepth=!0,this.hasSlicePlane=!1,this.isDraped=!1,this.receiveShadows=!0,this.hasScreenSpaceReflections=!1,this.hasCloudsReflections=!1}}const R=35e3;export{d as WaterMaterial,A as WaterMaterialParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ViewingMode as t}from"../../../ViewingMode.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutputOptions.js";import{PBRMode as r}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{doublePrecisionRequiresObfuscation as i}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as s}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as n}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as p}from"../lib/basicInterfaces.js";import{Default3D as u}from"../lib/DefaultVertexAttributeLocations.js";import{blendingDefault as l,oitBlending as c,oitDepthTest as h,oitDepthWrite as d,getOITPolygonOffset as f}from"../lib/OrderIndependentTransparency.js";import{Program as m}from"../lib/Program.js";import{DefaultTechniqueConfiguration as y}from"./DefaultTechniqueConfiguration.js";import{W as b}from"../../../../chunks/WaterSurface.glsl.js";import{makePipelineState as g,defaultDepthWriteParams as v,defaultColorWriteParams as P}from"../../../webgl/renderState.js";class S extends a{constructor(e,t,o){super(e,t,o),this._textureRepository=e.waterTextureRepository}initializeConfiguration(e,o){o.spherical=e.viewingMode===t.Global,o.doublePrecisionRequiresObfuscation=i(e.rctx)}initializeProgram(e){const t=S.shader.get().build(this.configuration);return new m(e.rctx,t,u)}bindPass(e,t){this.program.bindPass(e,t),this.configuration.output!==o.Color&&this.configuration.output!==o.Normal||this._textureRepository.bind(this.program)}_setPipelineState(e){const t=this.configuration,r=e===p.NONE,i=e===p.FrontFace;return g({blending:t.output!==o.Normal&&t.output!==o.Highlight&&t.transparent?r?l:c(e):null,depthTest:{func:h(e)},depthWrite:r?t.writeDepth&&v:d(e),colorWrite:P,polygonOffset:r||i?null:f(t.enableOffset)})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}S.shader=new s(b,(()=>import("../shaders/WaterSurface.glsl.js")));class T extends y{constructor(){super(...arguments),this.output=o.Color,this.transparencyPassType=p.NONE,this.spherical=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.transparent=!1,this.enableOffset=!0,this.writeDepth=!1,this.hasScreenSpaceReflections=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasCloudsReflections=!1,this.isDraped=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}}e([n({count:o.COUNT})],T.prototype,"output",void 0),e([n({count:p.COUNT})],T.prototype,"transparencyPassType",void 0),e([n()],T.prototype,"spherical",void 0),e([n()],T.prototype,"receiveShadows",void 0),e([n()],T.prototype,"hasSlicePlane",void 0),e([n()],T.prototype,"transparent",void 0),e([n()],T.prototype,"enableOffset",void 0),e([n()],T.prototype,"writeDepth",void 0),e([n()],T.prototype,"hasScreenSpaceReflections",void 0),e([n()],T.prototype,"doublePrecisionRequiresObfuscation",void 0),e([n()],T.prototype,"hasCloudsReflections",void 0),e([n()],T.prototype,"isDraped",void 0),e([n()],T.prototype,"hasMultipassTerrain",void 0),e([n()],T.prototype,"cullAboveGround",void 0),e([n({constValue:r.Water})],T.prototype,"pbrMode",void 0),e([n({constValue:!0})],T.prototype,"useCustomDTRExponentForWater",void 0),e([n({constValue:!0})],T.prototype,"highStepCount",void 0),e([n({constValue:!1})],T.prototype,"useFillLights",void 0);export{S as WaterTechnique,T as WaterTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutputOptions.js";import{PBRMode as t}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OverlayMode as r}from"../core/shaderLibrary/terrain/Overlay.glsl.js";import{parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as s}from"../materials/DefaultTechniqueConfiguration.js";class p extends s{constructor(){super(...arguments),this.output=o.Color,this.overlayMode=r.Disabled,this.spherical=!1,this.atmosphere=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.backfaceCullingEnabled=!1,this.stencilEnabled=!1,this.textureFadingEnabled=!1,this.hasBackgroundColor=!1,this.useGrid=!1,this.renderOccluded=!1,this.hasScreenSpaceReflections=!1,this.hasCloudsReflections=!1,this.tileBorders=!1,this.screenSizePerspective=!1,this.receiveAmbientOcclusion=!1}}e([i({count:o.COUNT})],p.prototype,"output",void 0),e([i({count:r.COUNT})],p.prototype,"overlayMode",void 0),e([i()],p.prototype,"spherical",void 0),e([i()],p.prototype,"atmosphere",void 0),e([i()],p.prototype,"receiveShadows",void 0),e([i()],p.prototype,"hasSlicePlane",void 0),e([i()],p.prototype,"backfaceCullingEnabled",void 0),e([i()],p.prototype,"stencilEnabled",void 0),e([i()],p.prototype,"textureFadingEnabled",void 0),e([i()],p.prototype,"hasBackgroundColor",void 0),e([i()],p.prototype,"useGrid",void 0),e([i()],p.prototype,"renderOccluded",void 0),e([i()],p.prototype,"hasScreenSpaceReflections",void 0),e([i()],p.prototype,"hasCloudsReflections",void 0),e([i()],p.prototype,"tileBorders",void 0),e([i()],p.prototype,"screenSizePerspective",void 0),e([i()],p.prototype,"receiveAmbientOcclusion",void 0),e([i({constValue:!0})],p.prototype,"isGround",void 0),e([i({constValue:t.Disabled})],p.prototype,"pbrMode",void 0),e([i({constValue:!1})],p.prototype,"highStepCount",void 0),e([i({constValue:!1})],p.prototype,"useCustomDTRExponentForWater",void 0),e([i({constValue:!1})],p.prototype,"useFillLights",void 0);export{p as TerrainTechniqueConfiguration};
|
package/views/DOMContainer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{reparent as t,byId as s,empty as i}from"../core/domUtils.js";import{watch as o,initial as r}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import d from"./overlay/ViewOverlay.js";import u from"../widgets/Popup.js";const l=[0,0];function p(e){const t=(e.ownerDocument||window.document).defaultView,s=e.getBoundingClientRect();return l[0]=s.left+t.pageXOffset,l[1]=s.top+t.pageYOffset,l}function c(e){e&&(i(e),e.parentNode&&e.parentNode.removeChild(e))}function m(e){const t=document.createElement("div");return e.appendChild(t),t}const f=16,y=750,v=512,_=2,g=i=>{let l=class extends i{constructor(...e){super(...e),this._freqInfo={freq:f,time:y},this._overlayRenderTaskHandle=null,this.height=0,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.handles.add([this.
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{reparent as t,byId as s,empty as i}from"../core/domUtils.js";import{watch as o,initial as r}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import d from"./overlay/ViewOverlay.js";import u from"../widgets/Popup.js";const l=[0,0];function p(e){const t=(e.ownerDocument||window.document).defaultView,s=e.getBoundingClientRect();return l[0]=s.left+t.pageXOffset,l[1]=s.top+t.pageYOffset,l}function c(e){e&&(i(e),e.parentNode&&e.parentNode.removeChild(e))}function m(e){const t=document.createElement("div");return e.appendChild(t),t}const f=16,y=750,v=512,_=2,g=i=>{let l=class extends i{constructor(...e){super(...e),this._freqInfo={freq:f,time:y},this._overlayRenderTaskHandle=null,this.height=0,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.handles.add([o((()=>this.cursor),(e=>{const{surface:t}=this;t&&t.setAttribute("data-cursor",e)})),o((()=>this.interacting),(e=>{const{surface:t}=this;t&&t.setAttribute("data-interacting",e.toString())}))])}initialize(){this.handles.add(o((()=>this.ui),((e,t)=>this._handleUIChange(e,t)))),this._wireUI(this.ui),this.handles.add([this.on("focus",(()=>this.notifyChange("focused"))),this.on("blur",(()=>this.notifyChange("focused")))])}destroy(){this.destroyed||(this.ui&&(this.ui.destroy(),this.ui=null),this.popup&&!this.popup.destroyed&&this.popup.destroy(),this.container=null)}set container(e){const s=this._get("container");if(s===e)return;const i="dom-size";if(this.handles.remove(i),this._stopMeasuring(),s&&(s.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay.destroy(),this._set("overlay",null),c(this.root),this._set("root",null),t(this.userContent,s),c(this.userContent),this._set("userContent",null)),e){e.classList.add("esri-view");const s=document.createElement("div");s.className="esri-view-user-storage",t(e,s),e.appendChild(s),this._set("userContent",s);const h=document.createElement("div");h.className="esri-view-root",e.insertBefore(h,e.firstChild),this._set("root",h);const a=document.createElement("div");a.className="esri-view-surface",a.setAttribute("role","application"),a.tabIndex=0,h.appendChild(a),this._set("surface",a);const u=new d;h.appendChild(u.surface),this._set("overlay",u),o((()=>u.needsRender),(e=>{e&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=n({render:()=>{this.overlay.render()}}):this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null)})),this.forceDOMReadyCycle(),this.handles.add(o((()=>this.size),(e=>{const[t,s]=e,i="esri-view-surface--inset-outline";t>=document.body.clientWidth||s>=document.body.clientHeight?a.classList.add(i):a.classList.remove(i)}),r),i),this._set("container",e),this._startMeasuring()}else this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),this._set("container",null)}get focused(){const e=document.activeElement===this.surface;return document.hasFocus()&&e}get popup(){return this._get("popup")||new u({view:this})}set popup(e){const t=this._get("popup");t&&t!==e&&t.destroy(),this._set("popup",e)}get size(){return[this.width,this.height]}blur(){this.surface&&this.surface.blur()}focus(){this.surface&&this.surface.focus()}pageToContainer(e,t,s){const i=this.position;return e-=i[0],t-=i[1],s?(s[0]=e,s[1]=t):s=[e,t],s}containerToPage(e,t,s){const i=this.position;return e+=i[0],t+=i[1],s?(s[0]=e,s[1]=t):s=[e,t],s}_handleUIChange(e,t){t&&(this.handles.remove("ui"),t.destroy()),e&&this._wireUI(e),this._set("ui",e)}_wireUI(e){this.handles.remove("ui"),e&&(e.view=this,this.handles.add([o((()=>this.root),(t=>{e.container=t?m(t):null}),r),o((()=>this.popup),((t,s)=>{const i="popup",o="manual";s&&e.remove(s,i),t&&(t.view=e.view,e.add(t,{key:i,position:o}))}),r)],"ui"))}_stopMeasuring(){this.handles.remove("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const e=this._freqInfo;e.freq=f,e.time=y,this.handles.add([(()=>{const t=()=>{e.freq=f,e.time=y};return window.addEventListener("resize",t),{remove(){window.removeEventListener("resize",t)}}})(),n({prepare:e=>{const t=this._measure(),s=this._freqInfo;if(s.time+=e.deltaTime,t&&(s.freq=f,this._get("resizing")||this._set("resizing",!0)),s.time<s.freq)return;s.time=0;const i=this._position();s.freq=i||t?f:Math.min(y,s.freq*_),!t&&s.freq>=v&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const e=this.container,t=e?e.clientWidth:0,s=e?e.clientHeight:0;if(0===t||0===s)return this.suspended||this._set("suspended",!0),!1;const i=this.width,o=this.height;return t===i&&s===o?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",t),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:i,oldHeight:o,width:t,height:s}),!0)}_position(){const e=this.container,t=this.position,s=p(e);return(!t||s[0]!==t[0]||s[1]!==t[1])&&(this._set("position",[s[0],s[1]]),!0)}forceDOMReadyCycle(){}};return e([h({value:null,cast:e=>s(e)})],l.prototype,"container",null),e([h({readOnly:!0})],l.prototype,"focused",null),e([h({readOnly:!0})],l.prototype,"height",void 0),e([h({type:u})],l.prototype,"popup",null),e([h({type:d})],l.prototype,"overlay",void 0),e([h({readOnly:!0})],l.prototype,"position",void 0),e([h({readOnly:!0})],l.prototype,"resizing",void 0),e([h({readOnly:!0})],l.prototype,"root",void 0),e([h({value:null,readOnly:!0})],l.prototype,"size",null),e([h({readOnly:!0})],l.prototype,"surface",void 0),e([h({readOnly:!0})],l.prototype,"suspended",void 0),e([h()],l.prototype,"ui",void 0),e([h({readOnly:!0})],l.prototype,"userContent",void 0),e([h({readOnly:!0})],l.prototype,"width",void 0),e([h()],l.prototype,"widthBreakpoint",void 0),l=e([a("esri.views.DOMContainer")],l),l};function w(e){return e&&"focus"in e}export{g as DOMContainer,w as isDOMContainer};
|
package/views/GroundView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import s from"../core/Accessor.js";import t from"../core/Collection.js";import r from"../core/Handles.js";import{when as i,watch as a,sync as o}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import l from"./support/GroundViewElevationSampler.js";let d=class extends s{constructor(e){super(e),this.handles=new r,this.view=null,this.layerViews=new t}initialize(){this.handles.add(i((()=>this.view?.map?.ground),(e=>e.load()))),this.handles.add(this.layerViews.on("after-changes",(()=>this._layerViewsAfterChangesHandler())))}destroy(){this._set("view",null),this.handles&&(this.handles.destroy(),this.handles=null)}get elevationSampler(){return this.view?"2d"===this.view.type?null:this.view.ready&&this.view.basemapTerrain&&this.view.basemapTerrain.ready?new l({view:this.view}):null:null}get updating(){return!this.suspended&&this.layerViews.some((e=>e.updating))}get suspended(){return!this.view||this.view.suspended}_layerViewsAfterChangesHandler(){this.handles.remove("updating"),this.handles.add(this.layerViews.map((e=>a((()=>e.updating),(()=>this._updateUpdating()),o))).toArray(),"updating"),this._updateUpdating()}_updateUpdating(){this.notifyChange("updating")}};e([n({readOnly:!0})],d.prototype,"elevationSampler",null),e([n({type:Boolean,readOnly:!0})],d.prototype,"updating",null),e([n({constructOnly:!0})],d.prototype,"view",void 0),e([n({type:t,readOnly:!0})],d.prototype,"layerViews",void 0),e([n({readOnly:!0})],d.prototype,"suspended",null),d=e([p("esri.views.GroundView")],d);const h=d;export{h as default};
|
package/views/SceneView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import"../geometry.js";import i from"../Graphic.js";import r from"../Viewpoint.js";import s from"../core/Collection.js";import{byId as n}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{handlesGroup as l,makeHandle as p}from"../core/handleUtils.js";import h from"../core/has.js";import{isIterable as d}from"../core/iteratorUtils.js";import c from"../core/Logger.js";import{destroyMaybe as u,isNone as g,isSome as m,unwrapOr as f}from"../core/maybe.js";import{ObservableChangesType as y}from"../core/ObservableChangesType.js";import{throwIfAborted as w}from"../core/promiseUtils.js";import{on as v,initial as _,syncAndInitial as b,whenOnce as S,watch as M}from"../core/reactiveUtils.js";import{setFrameDuration as R}from"../core/scheduling.js";import{screenPointObjectToArray as V,createScreenPoint as T,createScreenPointArray as C}from"../core/screenUtils.js";import{initialize as O}from"../core/workers/workers.js";import{property as x}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as E}from"../core/accessorSupport/decorators/cast.js";import{subclass as j}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as P}from"../core/accessorSupport/ensureType.js";import{c as I}from"../chunks/vec3f64.js";import{owningCollectionProperty as G}from"../core/support/OwningCollection.js";import L from"../geometry/HeightModelInfo.js";import{canProjectWithoutEngine as H,project as U,projectPointToVector as A,projectVectorToVector as D,projectBoundingRect as F}from"../geometry/projection.js";import{create as W,toExtent as k}from"../geometry/support/aaBoundingRect.js";import{B as q,a as z}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as N}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as B}from"../geometry/support/scaleUtils.js";import Q from"../layers/VoxelWasmManager.js";import{isImageryTileLayer as $,isTiledLayer as X,isVoxelLayer as Y}from"../layers/support/layerUtils.js";import{AnalysesCollection as Z}from"../support/AnalysesCollection.js";import{BreakpointsOwner as J}from"./BreakpointsOwner.js";import{DOMContainer as K}from"./DOMContainer.js";import ee from"./GroundView.js";import{PopupView as te}from"./PopupView.js";import ie from"./View.js";import re from"./ViewAnimation.js";import{ViewingMode as se,stringFromViewingMode as ne,viewingModeFromString as ae}from"./ViewingMode.js";import{layerView3DImporter as oe}from"./3d/layerViewModuleImportUtils.js";import le from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as pe}from"./3d/constraints/Constraints.js";import he from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as de}from"./3d/environment/SceneViewEnvironmentManager.js";import ce from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as ue}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ge}from"./3d/layers/graphics/Labeler.js";import{ObjectResourceCache as me}from"./3d/layers/graphics/ObjectResourceCache.js";import{FeatureTileTree3D as fe}from"./3d/layers/support/FeatureTileTree3D.js";import ye from"./3d/state/ViewState.js";import we from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ve}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as _e}from"./3d/support/CombinedElevationProvider.js";import be from"./3d/support/debugFlags.js";import Se from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as Me}from"./3d/support/ElevationProvider.js";import Re from"./3d/support/HighlightOptions.js";import{MapCoordsHelper as Ve}from"./3d/support/MapCoordsHelper.js";import{PropertiesPool as Te}from"./3d/support/PropertiesPool.js";import Ce from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Oe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as xe}from"./3d/support/ResourceController.js";import Ee from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as je}from"./3d/support/SharedSymbolResources.js";import{PointsOfInterest as Pe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ie from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ge,getTiledLayerInfo as Le,checkIfTileInfoSupportedForView as He}from"./3d/terrain/terrainUtils.js";import{Stage as Ue}from"./3d/webgl-engine/Stage.js";import{newIntersector as Ae,DEFAULT_TOLERANCE as De}from"./3d/webgl-engine/lib/Intersector.js";import{StoreResults as Fe,IntersectorType as We}from"./3d/webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as ke}from"./3d/webgl-engine/lib/intersectorUtils.js";import{toGraphic as qe,toOwner as ze}from"./3d/webgl-engine/lib/intersectorUtilsConversions.js";import{TERRAIN_ID as Ne}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{hitTestSelectSimilarDistance as Be}from"./support/hitTestSelectUtils.js";import{occludeesSupported as Qe}from"./support/layerViewUtils.js";import{encode as $e,encodeData as Xe,toRenderSettings as Ye,screenshotSuperSampleSettings as Ze}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as Je,createScreenPointFromSupportedEvent as Ke}from"./support/screenUtils.js";import{isSpatialReferenceSupported as et}from"./support/spatialReferenceSupport.js";import{check as tt}from"./support/WebGLRequirements.js";import it from"./ui/3d/DefaultUI3D.js";import rt from"../webscene/Environment.js";import st from"../geometry/Extent.js";import nt from"../geometry/SpatialReference.js";import at from"../geometry/Point.js";const ot=c.getLogger("esri.views.SceneView");let lt=class extends(J(K(te(ie)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this.propertiesPool=new Te({slicePlane:q},this),this._resourceController=xe(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new ue({view:this}),this.labeler=new ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new Z,this.basemapTerrain=null,this.elevationProvider=null,this.camera=null,this.canvas=null,this.center=null,this.constraints=new pe,this.environmentManager=new de,this.extent=null,this.floors=new s,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new le({view:this}),this.groundView=null,this.navigating=!1,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ye,this.scale=null,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new it,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.viewpoint=null,this.zoom=null,this.highlightOptions=new Re,O(),e&&e.environment||(this._defaults.environment=new he,this.environment=this._defaults.environment);const t=(e=null)=>{m(e)&&e.type===y.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.handles.add([v((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),this.watch("map",(e=>{e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new ce({view:this}),this.stateManager=new we({view:this})}initialize(){this.groundView=new ee({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.handles.add(v((()=>this.map?.allLayers),"after-changes",e,{onListenerAdd:e,onListenerRemove:e})),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),(e=>R(e>0?1e3/Math.ceil(e):0)),_),this.updatingHandles.add((()=>this.map?.ground),e,b),this.updatingHandles.add((()=>this.map?.ground?.opacity),(()=>this._updateDefaultHitTestOptions()),b),this.handles.add(this.watch("spatialReference",(()=>this.notifyChange("clippingArea")),!0))}destroy(){this.destroyed||(this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=u(this.sharedSymbolResources),this.labeler.destroy(),this._set("labeler",null),this.deconflictor.destroy(),this._set("deconflictor",null),this._resourceController=u(this._resourceController),this.stateManager.destroy(),this._set("stateManager",null),this.inputManager.destroy(),this._set("inputManager",null),this.propertiesPool.destroy(),this.handles.remove("updatingMonitors"),this.environmentManager.destroy(),this._set("environmentManager",null),this.groundView=u(this.groundView))}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain&&this.basemapTerrain.spatialReference}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get clippingArea(){if("global"===this.viewingMode)return null;let e=this._userClippingArea||this.get("map.clippingArea");return!(!!this._userClippingArea||this.get("map.clippingEnabled"))||g(e)?(this._clippingArea=null,null):e instanceof st?this.spatialReference&&(e=dt(e,this.spatialReference),g(e))?(ot.error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(e=e.clone(),g(e.intersection(this.groundAndLayersExtent))&&(e.xmin=e.xmax,e.ymin=e.ymax),e.zmin=void 0,e.zmax=void 0,e.equals(this._clippingArea)||(this._clippingArea=e),this._clippingArea):(ot.error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&m(e)?ot.error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===se.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return g(t)||g(e)||t.spatialReference.equals(e)?t:dt(t,e)}get dataExtent(){let e=this.groundAndLayersExtent;const t=this.spatialReference||nt.WGS84,i=dt(this.clippingArea,t);m(i)&&(e=m(e)?e.intersection(i):i);const r=this._get("dataExtent");return m(e)&&e.equals(r)?r:e}get groundAndLayersExtent(){const e=this.spatialReference||nt.WGS84;let t;const i=i=>{const r=dt(i,e);g(r)||(m(t)?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new st({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{!m(e.fullExtent)||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(g(t))return null;t.hasZ?(t.zmin=Math.min(0,t.zmin),t.zmax=Math.max(0,t.zmax)):(t.zmin=0,t.zmax=0);const s=this._get("groundAndLayersExtent");return t.equals(s)?s:t}set environment(e){e!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",e)}castEnvironment(e){return e?e instanceof he?e:e instanceof rt?null!=this.environment?this.environment.cloneWithWebsceneEnvironment(e):he.fromWebsceneEnvironment(e):P(he,e):new he}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||m(this.activeTool)}get stationary(){return!this.animation&&!this.resizing&&(g(this.state)||this.state.stationary)}set qualityProfile(e){Se.isValidProfile(e)&&(Se.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Se.getDefaultProfile()}set slicePlane(e){if(m(this._stage)&&this._stage.renderView.setRenderParameters({slicePlane:e}),g(e))return void this._set("slicePlane",null);const t=this.propertiesPool.get("slicePlane");z(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return null!=this.spatialReference?B(this.scale,this.spatialReference):0}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?L.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ge(r))return;++i,e+=r.updatingProgress}}else++i}));for(const r of[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this.featureTreeDebugger,this.toolViewManager,this.analysisViewManager])if(m(r)&&r.updating){const t=.1;i+=t,e+=.5*t}for(const r of[this.deconflictor,this.labeler,this.basemapTerrain])m(r)&&r.updating&&(++i,e+=r.updatingProgress);if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||this._createGraphicsViewController||this.inputManager?.hasPendingInputs||this.map?.allLayers?.some((e=>!e.isFulfilled()))),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=this._resourceController.scheduler.now;if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get viewingMode(){const e=this._predeterminedViewingMode;if(m(e))return ne(e);const t=this.spatialReference;return t?m(this.defaultsFromMap?.viewingMode)&&t.equals(this.defaultsFromMap.spatialReference)?ne(this.defaultsFromMap.viewingMode):et(t,se.Global)?"global":"local":"global"}set viewingMode(e){this.ready?ot.error("#viewingMode","viewingMode cannot be set once view is ready"):e?this._override("viewingMode",e):void 0===e&&this._clearOverride("viewingMode")}get resourceController(){return this._resourceController}get performanceInfo(){return new Ee(this)}forceAnimationTime(e){this._stage.renderView.forcedAnimationTime=this.basemapTerrain.overlayManager.forcedAnimationTime=e}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return ot.error("#toMap()","Scene view cannot be used before it is ready"),null;const i=t?this.externalToInternalIntersectOptions(t):this._defaultToMapOptions,r=m(i.graphics)&&(m(i.graphics.include)||m(i.graphics.exclude)),s=Je(e)?Ke(this,e):e,n=V(s);i.enableDraped=i.include&&!i.include.has(Ne)||i.exclude&&i.exclude.has(Ne);const a=this.sceneIntersectionHelper,o=Ae(this.state.viewingMode);if(o.options.selectionMode=!0,o.options.store=r?Fe.ALL:Fe.MIN,a.intersectIntersectorScreen(n,o,i),r){for(const e of o.results.all){const t=qe(e,this);if(g(t))return this._intersectResultToMapPoint(e);if(this._testGraphicUidFilter(i.graphics,t))return this._intersectResultToMapPoint(e)}return null}return this._intersectResultToMapPoint(o.results.min)}toScreen(e){if(!this.ready)return ot.error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=f(null==e.z&&Me(this.elevationProvider,e),0);return A(e,ut,this.renderSpatialReference,t),this.state.camera.projectToScreen(ut,gt),T(gt[0],gt[1])}pixelSizeAt(e){return this.ready?e?(A(e,ut,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(ut)):0:(ot.error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e):1}hitTest(e,t){if(!this.ready)return ot.error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=Je(e)?Ke(this,e):e,r=C(i.x,i.y),s=t?this.externalToInternalIntersectOptions(t):this._defaultHitTestOptions;s.requiresGroundFeedback=!0,s.enableDraped=!0;const n=Ae(this.state.viewingMode);n.options.selectionMode=!0,n.options.store=Fe.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(r,n,s);const a=this._intersectResultsToHits(n.results.all,s.graphics),o=n.results.ground,l=ze(o,this),p=m(l)&&"type"in l&&"integrated-mesh"===l.type?l:null,h={screenPoint:i,results:a,ground:{mapPoint:this._intersectResultToMapPoint(o),distance:ke(o)?o.distanceInRenderSpace:0,layer:p}};return be.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=n),Promise.resolve(h)}popupHitTest(e){return Be(this,e).then((({results:t,ground:i})=>{let r=null;return!(0===t.length||Math.abs(f(t[0].distance,0)-i.distance)<1e-5)||i.layer&&"integrated-mesh"===i.layer.type||(r=i.mapPoint),{results:t,screenPoint:e,mapPoint:r}}))}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(await this.whenReady(),g(e.parent))throw new a("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});if("analysis"===e.parent.type){return(await this.whenLayerView(e.parent)).whenAnalysisView()}return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return $e(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return Xe(i,this._pixelFormat())}_completeSettings(e){const t=Ye(e,this);return t.pixelRatio/=this.state.pixelRatio,Ze(t,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){return{takeScreenshot:e=>this._takeScreenshot(e)}}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return oe.importLayerView(e)}hasLayerViewModule(e){return oe.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=tt(this.type);if(h("safari")&&h("safari")<9&&(e=new a("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:h("safari")})),m(e))throw ot.warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return m(e)?ae(e):null}getSpatialReferenceSupport({spatialReference:e,layer:t}){const i=this._predeterminedViewingMode;if(m(i))return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,se.Local),s=this._validateSpatialReferenceForViewingMode(e,t,se.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,se.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,se.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!et(e,i)&&(!!g(t)||(!!$(t)||(!X(t)||!g(Le(t,e,i)))&&(!Y(t)||i!==se.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(g(t))return[{spatialReference:e,viewingMode:i}];const r=e.isWebMercator,s=e.isWGS84;if($(t)&&(r||s)){return!s||i===se.Local||null===He(t.tileInfo,t.fullExtent,e,se.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:nt.WebMercator,viewingMode:i}]:[{spatialReference:r?nt.WGS84:nt.WebMercator,viewingMode:i}]}return X(t)||Y(t)||!r&&!s?X(t)&&r&&i!==se.Global?[{spatialReference:e,viewingMode:i},{spatialReference:nt.WGS84,viewingMode:se.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?nt.WGS84:nt.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=m(this.getSpatialReferenceSupport({spatialReference:e})),i=this._predeterminedViewingMode;return t||(m(i)?ot.warnOnce(`Spatial reference defined on view not supported in ${ne(i)} viewing mode.`):e.isGeographic&&ot.warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}computeMapPointFromVec3d(e,t){let i=this.spatialReference||nt.WGS84;return D(e,this.renderSpatialReference,e,i)||(i=nt.WGS84,D(e,this.renderSpatialReference,e,i)),t?(t.x=e[0],t.y=e[1],t.z=e[2],t.spatialReference=i):t=new at(e,i),t}trackGraphicState(e){if(!e.graphic)return ot.error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&m(t)&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return m(t)?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,m(i)&&(i.remove(),i=null)}}}highlight(e){if(Array.isArray(e))return l(e.map((e=>this.highlight(e))));if(s.isCollection(e))return l(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):p()}maskOccludee(e){if(!e)return ot.error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&m(t)&&Qe(t)&&(i=t.maskOccludee(e))};return m(t)?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,m(i)&&(i.remove(),i=null)}}}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){m(this.graphicsView)&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await S((()=>this.graphicsView)),this.graphicsView;if(!e.layer||!this.map)throw new a("no-view-for-graphic");return t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer)}externalToInternalIntersectOptions(e){const t=this._externalToInternalRenderItems(e.include,ct.INCLUDE),i=this._externalToInternalRenderItems(e.exclude,ct.EXCLUDE);return{include:t.layerUids,exclude:i.layerUids,graphics:{include:t.graphicUids,exclude:i.graphicUids}}}_intersectResultToMapPoint(e,t){return e.getIntersectionPoint(ut)?(t=this.computeMapPointFromVec3d(ut,t),e.intersector===We.TERRAIN&&this.basemapTerrain&&(t.z=f(Me(this.basemapTerrain,t),0)),t):null}_intersectResultsToHits(e,t){const i=new Array;let r=null;for(let s=0;s<e.length;s++){const n=e[s],a=ze(n,this);if(m(a)&&(a===this.map.ground||"type"in a&&"integrated-mesh"===a.type))break;const o=qe(n,this);if(g(o))continue;if(g(r)&&s!==e.length-1&&(r=new Set),m(r)){const e=this._getGraphicFilterUid(o);if(r.has(e))continue;r.add(e)}if(!this._testGraphicUidFilter(t,o))continue;const l=this._intersectResultToMapPoint(n),p=n.distanceInRenderSpace;i.push({graphic:o,mapPoint:l,distance:p})}return i}_getGraphicFilterUid(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}_testGraphicUidFilter(e,t){const i=this._getGraphicFilterUid(t);return g(e)||(g(e.include)||e.include.has(i))&&(g(e.exclude)||!e.exclude.has(i))}_externalToInternalRenderItems(e,t,r={layerUids:null,graphicUids:null}){if(!e)return r;if(e instanceof i)ht(r,this._getGraphicFilterUid(e)),t===ct.INCLUDE&&(m(this.graphicsView)&&e.layer===this?pt(r,this.graphicsView.processor.layer.id):e.layer&&pt(r,e.layer.uid));else if(d(e))for(const i of e)i===this.graphics&&m(this.graphicsView)?pt(r,this.graphicsView.processor.layer.id):i===this.map.ground?pt(r,Ne):this._externalToInternalRenderItems(i,t,r);else"uid"in e&&pt(r,e.uid);return r}_initBasemapTerrain(){this._set("basemapTerrain",new Ie({view:this})),this._set("elevationProvider",new _e({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Pe({view:this})),this._set("featureTiles",new fe({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.contentCameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain&&this.basemapTerrain.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=m(this.basemapTerrain.extent)?U(k(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;m(this.clippingArea)?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.handles.add([this.updatingHandles.add((()=>be.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this.featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this.featureTreeDebugger&&be.FEATURE_TILE_TREE_SHOW_TILES&&(this.featureTreeDebugger=new e({view:this}))})):e||!this.featureTreeDebugger||be.FEATURE_TILE_TREE_SHOW_TILES||(this.featureTreeDebugger.destroy(),this.featureTreeDebugger=null)}),b),this.updatingHandles.add((()=>this.clippingArea),e,b),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,b)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.deinit(),this.handles.remove("render-coords-helper"),this.handles.remove("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new Ve(this.map,e));const t=this.state.isGlobal,i=N(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Oe.create(this.state.viewingMode,i)),t||this.handles.add(this.watch("basemapTerrain.extent",(e=>{const t=this.renderCoordsHelper.spatialReference;0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!F(e,this.basemapTerrain.spatialReference,mt,t)||(this.renderCoordsHelper.extent=mt)}),!0),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.handles.remove("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){m(e)&&e.type===y.MOVE||(this.handles.remove("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.handles.add([e.watch(["updating","updatingProgress"],(()=>this._updatingChanged()),!0)],"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}_renderScreenshotOverlay(e,t){if(!this.overlay||!this.overlay.hasVisibleItems)return t;const i=e.getContext("2d");return i.putImageData(t,0,0),this.overlay.renderCanvas(e),i.getImageData(0,0,t.width,t.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,canvas:this.renderCanvas,screenshot:{renderOverlay:(e,t)=>this._renderScreenshotOverlay(e,t)}},t=new ve(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=n(this.surface),{resourceController:r,state:s,renderSpatialReference:l}=this;this._stage=new Ue({options:e,container:i,resourceController:r,state:s,sceneIntersectionHelper:t,renderSR:l}),this._stage.renderView.setRenderParameters({slicePlane:this.slicePlane}),this._lostWebGLContextHandle=o(this._stage.renderView.canvas,"webglcontextlost",(()=>this.fatalError=new a("webgl-context-lost"))),this.handles.add([this.updatingHandles.add((()=>this.qualitySettings.antialiasingEnabled),(()=>this._stage.renderView.setRenderParameters({antialiasingEnabled:this.qualitySettings.antialiasingEnabled})),_),this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(()=>this._stage.renderView.setRenderParameters({highQualityTransparency:this.qualitySettings.highQualityTransparency})),_),M((()=>this.magnifier),(e=>this._stage.renderView.magnifier=e),b)],"stage");const p=()=>{this._stage.renderView.setRenderParameters({defaultHighlightOptions:Re.toEngineOptions(this.highlightOptions)})};this.handles.add(this.updatingHandles.add((()=>[this.highlightOptions.color,this.highlightOptions.haloColor,this.highlightOptions.haloOpacity,this.highlightOptions.fillOpacity,this.highlightOptions.shadowOpacity,this.highlightOptions.shadowColor,this.highlightOptions.shadowDifference]),p),"stage"),p(),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage.destroy(),this._stage=null,this._lostWebGLContextHandle.remove(),this._lostWebGLContextHandle=null,this.handles.remove("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new je({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state,objectResourceCache:new me})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.handles.remove("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;w(e),await S((()=>!0===this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.handles.remove("graphics-view"),m(this.graphicsView)&&(this.handles.remove(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=ae(this.viewingMode);if(e===se.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.handles.add(v((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const e=this.get("map.initialViewProperties.environment");e&&(this.environment=e)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const t=this._resolveWhenReady;this._resolveWhenReady=[],t.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.handles.remove("graphics-view"),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(Ne);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(Ne);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&e.opacity<1&&this._defaultToMapOptions.exclude.add(e.uid)}}getVoxelWasmPerSceneView(){return Q.getInstance().getVoxelWasmPerSceneView(this)}};function pt(e,t){e.layerUids||(e.layerUids=new Set),e.layerUids.add(t)}function ht(e,t){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(t)}function dt(e,t){return m(e)&&H(e.spatialReference,t)?U(e,t):null}var ct;lt.type="3d",e([x()],lt.prototype,"_userClippingArea",void 0),e([x()],lt.prototype,"_resourceController",void 0),e([x()],lt.prototype,"_stage",void 0),e([x({readOnly:!0})],lt.prototype,"deconflictor",void 0),e([x({readOnly:!0})],lt.prototype,"labeler",void 0),e([x(G(Z,"analyses"))],lt.prototype,"analyses",void 0),e([x({type:re,readOnly:!0,aliasOf:"state.animation"})],lt.prototype,"animation",void 0),e([x({readOnly:!0})],lt.prototype,"basemapTerrain",void 0),e([x({readOnly:!0})],lt.prototype,"elevationProvider",void 0),e([x({type:t,aliasOf:"stateManager.camera"})],lt.prototype,"camera",void 0),e([x({type:t,aliasOf:"stateManager.contentCamera"})],lt.prototype,"contentCamera",void 0),e([x({readOnly:!0})],lt.prototype,"canvas",void 0),e([x({type:at,aliasOf:"stateManager.center"})],lt.prototype,"center",void 0),e([x({type:st})],lt.prototype,"clippingArea",null),e([x({type:pe})],lt.prototype,"constraints",void 0),e([x({type:st,readOnly:!0})],lt.prototype,"renderDataExtent",null),e([x({type:st,readOnly:!0})],lt.prototype,"dataExtent",null),e([x({type:st,readOnly:!0})],lt.prototype,"groundAndLayersExtent",null),e([x({value:null,type:he})],lt.prototype,"environment",null),e([E("environment")],lt.prototype,"castEnvironment",null),e([x({readOnly:!0})],lt.prototype,"environmentManager",void 0),e([x({type:st,aliasOf:"stateManager.extent"})],lt.prototype,"extent",void 0),e([x()],lt.prototype,"floors",void 0),e([x({readOnly:!0,aliasOf:"stateManager.screenCenter"})],lt.prototype,"screenCenter",void 0),e([x({aliasOf:"stateManager.frustum"})],lt.prototype,"frustum",void 0),e([x({type:Number,readOnly:!0})],lt.prototype,"fullOpacity",void 0),e([x({readOnly:!0})],lt.prototype,"graphicsView",void 0),e([x({readOnly:!0})],lt.prototype,"analysisViewManager",void 0),e([x()],lt.prototype,"groundView",void 0),e([x({type:Boolean})],lt.prototype,"initialExtentRequired",null),e([x()],lt.prototype,"_defaultsFromMapSettings",null),e([x({type:Boolean,readOnly:!0})],lt.prototype,"interacting",null),e([x()],lt.prototype,"stationary",null),e([x({aliasOf:"state.navigating"})],lt.prototype,"navigating",void 0),e([x()],lt.prototype,"map",void 0),e([x({readOnly:!0})],lt.prototype,"mapCoordsHelper",void 0),e([x({aliasOf:"stateManager.padding"})],lt.prototype,"padding",void 0),e([x({type:Pe,readOnly:!0})],lt.prototype,"pointsOfInterest",void 0),e([x({type:fe,readOnly:!0})],lt.prototype,"featureTiles",void 0),e([x()],lt.prototype,"featureTreeDebugger",void 0),e([x({type:Boolean})],lt.prototype,"screenSizePerspectiveEnabled",void 0),e([x({constructOnly:!0})],lt.prototype,"deactivatedWebGLExtensions",void 0),e([x({constructOnly:!0})],lt.prototype,"debugWebGLExtensions",void 0),e([x({constructOnly:!0})],lt.prototype,"renderCanvas",void 0),e([x({constructOnly:!0})],lt.prototype,"state",void 0),e([x({readOnly:!0})],lt.prototype,"inputManager",void 0),e([x({readOnly:!0})],lt.prototype,"stateManager",void 0),e([x({type:["low","medium","high"]})],lt.prototype,"qualityProfile",null),e([x({type:Ce,get(){let e=this._get("qualitySettings");return e||(e=new Ce,Se.apply(this.qualityProfile,e)),e}})],lt.prototype,"qualitySettings",void 0),e([x()],lt.prototype,"slicePlane",null),e([x({readOnly:!0})],lt.prototype,"typeSpecificPreconditionsReady",null),e([x({readOnly:!0})],lt.prototype,"renderCoordsHelper",void 0),e([x({readOnly:!0})],lt.prototype,"sceneIntersectionHelper",void 0),e([x({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],lt.prototype,"resolution",null),e([x({type:Number,aliasOf:"stateManager.scale"})],lt.prototype,"scale",void 0),e([x()],lt.prototype,"heightModelInfo",null),e([x()],lt.prototype,"spatialReference",void 0),e([x({type:Boolean,constructOnly:!0})],lt.prototype,"alphaCompositingEnabled",void 0),e([x({type:Boolean})],lt.prototype,"supersampleScreenshotsEnabled",void 0),e([x({readOnly:!0})],lt.prototype,"type",void 0),e([x({type:it})],lt.prototype,"ui",void 0),e([x({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.hasPendingInputs","toolViewManager.updating","analysisViewManager.updating"]})],lt.prototype,"updating",null),e([x({type:Number,readOnly:!0,dependsOn:["updating"]})],lt.prototype,"updatingProgress",void 0),e([x({type:["global","local"]})],lt.prototype,"viewingMode",null),e([x({type:r,aliasOf:"stateManager.viewpoint"})],lt.prototype,"viewpoint",void 0),e([x({type:Number,aliasOf:"stateManager.zoom"})],lt.prototype,"zoom",void 0),e([x({type:Re})],lt.prototype,"highlightOptions",void 0),lt=e([j("esri.views.SceneView")],lt),function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(ct||(ct={}));const ut=I(),gt=C(),mt=W(),ft=lt;export{ft as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import"../geometry.js";import i from"../Graphic.js";import r from"../Viewpoint.js";import s from"../core/Collection.js";import{byId as n}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{handlesGroup as l,makeHandle as p}from"../core/handleUtils.js";import h from"../core/has.js";import{isIterable as d}from"../core/iteratorUtils.js";import{equalsShallow as c}from"../core/lang.js";import u from"../core/Logger.js";import{destroyMaybe as g,isNone as m,isSome as f,unwrapOr as y}from"../core/maybe.js";import{ObservableChangesType as w}from"../core/ObservableChangesType.js";import{throwIfAborted as v}from"../core/promiseUtils.js";import{on as _,watch as b,initial as S,syncAndInitial as M,whenOnce as R,sync as V}from"../core/reactiveUtils.js";import{setFrameDuration as T}from"../core/scheduling.js";import{screenPointObjectToArray as C,createScreenPoint as x,createScreenPointArray as O}from"../core/screenUtils.js";import{initialize as E}from"../core/workers/workers.js";import{property as j}from"../core/accessorSupport/decorators/property.js";import{cast as P}from"../core/accessorSupport/decorators/cast.js";import{subclass as I}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as L}from"../core/accessorSupport/ensureType.js";import{c as G}from"../chunks/vec3f64.js";import{owningCollectionProperty as H}from"../core/support/OwningCollection.js";import U from"../geometry/HeightModelInfo.js";import{canProjectWithoutEngine as A,project as F,projectPointToVector as D,projectVectorToVector as W,projectBoundingRect as q}from"../geometry/projection.js";import{create as k,toExtent as z}from"../geometry/support/aaBoundingRect.js";import{B as N,a as B}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as Q}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as $}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as X,isTiledLayer as Y,isVoxelLayer as Z}from"../layers/support/layerUtils.js";import{AnalysesCollection as J}from"../support/AnalysesCollection.js";import{BreakpointsOwner as K}from"./BreakpointsOwner.js";import{DOMContainer as ee}from"./DOMContainer.js";import te from"./GroundView.js";import{PopupView as ie}from"./PopupView.js";import re from"./View.js";import se from"./ViewAnimation.js";import{ViewingMode as ne,stringFromViewingMode as ae,viewingModeFromString as oe}from"./ViewingMode.js";import{layerView3DImporter as le}from"./3d/layerViewModuleImportUtils.js";import pe from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as he}from"./3d/constraints/Constraints.js";import de from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as ce}from"./3d/environment/SceneViewEnvironmentManager.js";import ue from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as ge}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as me}from"./3d/layers/graphics/Labeler.js";import{ObjectResourceCache as fe}from"./3d/layers/graphics/ObjectResourceCache.js";import{FeatureTileTree3D as ye}from"./3d/layers/support/FeatureTileTree3D.js";import we from"./3d/state/ViewState.js";import ve from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as _e}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as be}from"./3d/support/CombinedElevationProvider.js";import Se from"./3d/support/debugFlags.js";import Me from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as Re}from"./3d/support/ElevationProvider.js";import Ve from"./3d/support/HighlightOptions.js";import{MapCoordsHelper as Te}from"./3d/support/MapCoordsHelper.js";import{PropertiesPool as Ce}from"./3d/support/PropertiesPool.js";import xe from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Oe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ee}from"./3d/support/ResourceController.js";import je from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Pe}from"./3d/support/SharedSymbolResources.js";import{PointsOfInterest as Ie}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Le from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ge,getTiledLayerInfo as He,checkIfTileInfoSupportedForView as Ue}from"./3d/terrain/terrainUtils.js";import{Stage as Ae}from"./3d/webgl-engine/Stage.js";import{newIntersector as Fe,DEFAULT_TOLERANCE as De}from"./3d/webgl-engine/lib/Intersector.js";import{StoreResults as We,IntersectorType as qe}from"./3d/webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as ke}from"./3d/webgl-engine/lib/intersectorUtils.js";import{toGraphic as ze,toOwner as Ne}from"./3d/webgl-engine/lib/intersectorUtilsConversions.js";import{TERRAIN_ID as Be}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{hitTestSelectSimilarDistance as Qe}from"./support/hitTestSelectUtils.js";import{occludeesSupported as $e}from"./support/layerViewUtils.js";import{encode as Xe,encodeData as Ye,toRenderSettings as Ze,screenshotSuperSampleSettings as Je}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as Ke,createScreenPointFromSupportedEvent as et}from"./support/screenUtils.js";import{isSpatialReferenceSupported as tt}from"./support/spatialReferenceSupport.js";import{check as it}from"./support/WebGLRequirements.js";import rt from"./ui/3d/DefaultUI3D.js";import st from"../webscene/Environment.js";import nt from"../geometry/Extent.js";import at from"../geometry/SpatialReference.js";import ot from"../geometry/Point.js";const lt=u.getLogger("esri.views.SceneView");let pt=class extends(K(ee(ie(re)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this.propertiesPool=new Ce({slicePlane:N},this),this._resourceController=Ee(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new ge({view:this}),this.labeler=new me({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new J,this.basemapTerrain=null,this.elevationProvider=null,this.camera=null,this.canvas=null,this.center=null,this.constraints=new he,this.environmentManager=new ce,this.extent=null,this.floors=new s,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new pe({view:this}),this.groundView=null,this.navigating=!1,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new we,this.scale=null,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new rt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.viewpoint=null,this.zoom=null,this.highlightOptions=new Ve,this.voxelWasm=null,E(),e&&e.environment||(this._defaults.environment=new de,this.environment=this._defaults.environment);const t=(e=null)=>{f(e)&&e.type===w.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.handles.add([_((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),b((()=>this.map),(e=>{e&&"load"in e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new ue({view:this}),this.stateManager=new ve({view:this})}initialize(){this.groundView=new te({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.handles.add(_((()=>this.map?.allLayers),"after-changes",e,{onListenerAdd:e,onListenerRemove:e})),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),S),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),S),this.updatingHandles.add((()=>this.qualitySettings.frameRate),(e=>T(e>0?1e3/Math.ceil(e):0)),S),this.updatingHandles.add((()=>this.map?.ground),e,M),this.updatingHandles.add((()=>this.map?.ground?.opacity),(()=>this._updateDefaultHitTestOptions()),M),this.handles.add(b((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),V))}destroy(){this.destroyed||(this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=g(this.sharedSymbolResources),this.labeler.destroy(),this._set("labeler",null),this.deconflictor.destroy(),this._set("deconflictor",null),this._resourceController=g(this._resourceController),this.stateManager.destroy(),this._set("stateManager",null),this.inputManager.destroy(),this._set("inputManager",null),this.propertiesPool.destroy(),this.handles.remove("updatingMonitors"),this.environmentManager.destroy(),this._set("environmentManager",null),this.groundView=g(this.groundView))}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get clippingArea(){if("global"===this.viewingMode)return null;let e=this._userClippingArea||this.get("map.clippingArea");return!(!!this._userClippingArea||this.get("map.clippingEnabled"))||m(e)?(this._clippingArea=null,null):e instanceof nt?this.spatialReference&&(e=ct(e,this.spatialReference),m(e))?(lt.error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(e=e.clone(),m(e.intersection(this.groundAndLayersExtent))&&(e.xmin=e.xmax,e.ymin=e.ymax),e.zmin=void 0,e.zmax=void 0,e.equals(this._clippingArea)||(this._clippingArea=e),this._clippingArea):(lt.error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&f(e)?lt.error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===ne.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return m(t)||m(e)||t.spatialReference.equals(e)?t:ct(t,e)}get dataExtent(){let e=this.groundAndLayersExtent;const t=this.spatialReference||at.WGS84,i=ct(this.clippingArea,t);f(i)&&(e=f(e)?e.intersection(i):i);const r=this._get("dataExtent");return f(e)&&e.equals(r)?r:e}get groundAndLayersExtent(){const e=this.spatialReference||at.WGS84;let t;const i=i=>{const r=ct(i,e);m(r)||(f(t)?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new nt({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{!f(e.fullExtent)||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(m(t))return null;t.hasZ?(t.zmin=Math.min(0,t.zmin),t.zmax=Math.max(0,t.zmax)):(t.zmin=0,t.zmax=0);const s=this._get("groundAndLayersExtent");return t.equals(s)?s:t}set environment(e){e!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",e)}castEnvironment(e){return e?e instanceof de?e:e instanceof st?null!=this.environment?this.environment.cloneWithWebsceneEnvironment(e):de.fromWebsceneEnvironment(e):L(de,e):new de}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||f(this.activeTool)}get stationary(){return!this.animation&&!this.resizing&&(m(this.state)||this.state.stationary)}set qualityProfile(e){Me.isValidProfile(e)&&(Me.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Me.getDefaultProfile()}set slicePlane(e){if(f(this._stage)&&this._stage.renderView.setRenderParameters({slicePlane:e}),m(e))return void this._set("slicePlane",null);const t=this.propertiesPool.get("slicePlane");B(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return null!=this.spatialReference?$(this.scale,this.spatialReference):0}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?U.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ge(r))return;++i,e+=r.updatingProgress}}else++i}));for(const r of[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this.featureTreeDebugger,this.toolViewManager,this.analysisViewManager])if(f(r)&&r.updating){const t=.1;i+=t,e+=.5*t}for(const r of[this.deconflictor,this.labeler,this.basemapTerrain])f(r)&&r.updating&&(++i,e+=r.updatingProgress);if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||this._createGraphicsViewController||this.inputManager?.hasPendingInputs||this.map?.allLayers?.some((e=>!e.isFulfilled()))),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get viewingMode(){const e=this._predeterminedViewingMode;if(f(e))return ae(e);const t=this.spatialReference;return t?f(this.defaultsFromMap?.viewingMode)&&t.equals(this.defaultsFromMap.spatialReference)?ae(this.defaultsFromMap.viewingMode):tt(t,ne.Global)?"global":"local":"global"}set viewingMode(e){this.ready?lt.error("#viewingMode","viewingMode cannot be set once view is ready"):e?this._override("viewingMode",e):void 0===e&&this._clearOverride("viewingMode")}get resourceController(){return this._resourceController}get performanceInfo(){return new je(this)}forceAnimationTime(e){this._stage.renderView.forcedAnimationTime=this.basemapTerrain.overlayManager.forcedAnimationTime=e}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return lt.error("#toMap()","Scene view cannot be used before it is ready"),null;const i=t?this.externalToInternalIntersectOptions(t):this._defaultToMapOptions,r=f(i.graphics)&&(f(i.graphics.include)||f(i.graphics.exclude)),s=Ke(e)?et(this,e):e,n=C(s);i.enableDraped=i.include&&!i.include.has(Be)||i.exclude&&i.exclude.has(Be);const a=this.sceneIntersectionHelper,o=Fe(this.state.viewingMode);if(o.options.selectionMode=!0,o.options.store=r?We.ALL:We.MIN,a.intersectIntersectorScreen(n,o,i),r){for(const e of o.results.all){const t=ze(e,this);if(m(t))return this._intersectResultToMapPoint(e);if(this._testGraphicUidFilter(i.graphics,t))return this._intersectResultToMapPoint(e)}return null}return this._intersectResultToMapPoint(o.results.min)}toScreen(e){if(!this.ready)return lt.error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=y(null==e.z&&Re(this.elevationProvider,e),0);return D(e,gt,this.renderSpatialReference,t),this.state.camera.projectToScreen(gt,mt),x(mt[0],mt[1])}pixelSizeAt(e){return this.ready?e?(D(e,gt,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(gt)):0:(lt.error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e):1}hitTest(e,t){if(!this.ready)return lt.error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=Ke(e)?et(this,e):e,r=O(i.x,i.y),s=t?this.externalToInternalIntersectOptions(t):this._defaultHitTestOptions;s.requiresGroundFeedback=!0,s.enableDraped=!0;const n=Fe(this.state.viewingMode);n.options.selectionMode=!0,n.options.store=We.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(r,n,s);const a=this._intersectResultsToHits(n.results.all,s.graphics),o=n.results.ground,l=Ne(o,this),p=f(l)&&"type"in l&&"integrated-mesh"===l.type?l:null,h={screenPoint:i,results:a,ground:{mapPoint:this._intersectResultToMapPoint(o),distance:ke(o)?o.distanceInRenderSpace:0,layer:p}};return Se.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=n),Promise.resolve(h)}popupHitTest(e){return Qe(this,e).then((({results:t,ground:i})=>{let r=null;return!(0===t.length||Math.abs(y(t[0].distance,0)-i.distance)<1e-5)||i.layer&&"integrated-mesh"===i.layer.type||(r=i.mapPoint),{results:t,screenPoint:e,mapPoint:r}}))}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(await this.whenReady(),m(e.parent))throw new a("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});if("analysis"===e.parent.type){return(await this.whenLayerView(e.parent)).whenAnalysisView()}return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return Xe(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return Ye(i,this._pixelFormat())}_completeSettings(e){const t=Ze(e,this);return t.pixelRatio/=this.state.pixelRatio,Je(t,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){return{takeScreenshot:e=>this._takeScreenshot(e)}}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return le.importLayerView(e)}hasLayerViewModule(e){return le.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=it(this.type);if(h("safari")&&h("safari")<9&&(e=new a("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:h("safari")})),f(e))throw lt.warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return f(e)?oe(e):null}getSpatialReferenceSupport({spatialReference:e,layer:t}){const i=this._predeterminedViewingMode;if(f(i))return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ne.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ne.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ne.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ne.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!tt(e,i)&&(!!m(t)||(!!X(t)||(!Y(t)||!m(He(t,e,i)))&&(!Z(t)||i!==ne.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(m(t))return[{spatialReference:e,viewingMode:i}];const r=e.isWebMercator,s=e.isWGS84;if(X(t)&&(r||s)){return!s||i===ne.Local||null===Ue(t.tileInfo,t.fullExtent,e,ne.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:at.WebMercator,viewingMode:i}]:[{spatialReference:r?at.WGS84:at.WebMercator,viewingMode:i}]}return Y(t)||Z(t)||!r&&!s?Y(t)&&r&&i!==ne.Global?[{spatialReference:e,viewingMode:i},{spatialReference:at.WGS84,viewingMode:ne.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?at.WGS84:at.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=f(this.getSpatialReferenceSupport({spatialReference:e})),i=this._predeterminedViewingMode;return t||(f(i)?lt.warnOnce(`Spatial reference defined on view not supported in ${ae(i)} viewing mode.`):e.isGeographic&<.warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}computeMapPointFromVec3d(e,t){let i=this.spatialReference||at.WGS84;return W(e,this.renderSpatialReference,e,i)||(i=at.WGS84,W(e,this.renderSpatialReference,e,i)),t?(t.x=e[0],t.y=e[1],t.z=e[2],t.spatialReference=i):t=new ot(e,i),t}trackGraphicState(e){if(!e.graphic)return lt.error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&f(t)&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return f(t)?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,f(i)&&(i.remove(),i=null)}}}highlight(e){if(Array.isArray(e))return l(e.map((e=>this.highlight(e))));if(s.isCollection(e))return l(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):p()}maskOccludee(e){if(!e)return lt.error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&f(t)&&$e(t)&&(i=t.maskOccludee(e))};return f(t)?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,f(i)&&(i.remove(),i=null)}}}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){f(this.graphicsView)&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await R((()=>this.graphicsView)),this.graphicsView;if(!e.layer||!this.map)throw new a("no-view-for-graphic");return t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer)}externalToInternalIntersectOptions(e){const t=this._externalToInternalRenderItems(e.include,ut.INCLUDE),i=this._externalToInternalRenderItems(e.exclude,ut.EXCLUDE);return{include:t.layerUids,exclude:i.layerUids,graphics:{include:t.graphicUids,exclude:i.graphicUids}}}_intersectResultToMapPoint(e,t){return e.getIntersectionPoint(gt)?(t=this.computeMapPointFromVec3d(gt,t),e.intersector===qe.TERRAIN&&this.basemapTerrain&&(t.z=y(Re(this.basemapTerrain,t),0)),t):null}_intersectResultsToHits(e,t){const i=new Array;let r=null;for(let s=0;s<e.length;s++){const n=e[s],a=Ne(n,this);if(f(a)&&(a===this.map.ground||"type"in a&&"integrated-mesh"===a.type))break;const o=ze(n,this);if(m(o))continue;if(m(r)&&s!==e.length-1&&(r=new Set),f(r)){const e=this._getGraphicFilterUid(o);if(r.has(e))continue;r.add(e)}if(!this._testGraphicUidFilter(t,o))continue;const l=this._intersectResultToMapPoint(n),p=n.distanceInRenderSpace;i.push({graphic:o,mapPoint:l,distance:p})}return i}_getGraphicFilterUid(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}_testGraphicUidFilter(e,t){const i=this._getGraphicFilterUid(t);return m(e)||(m(e.include)||e.include.has(i))&&(m(e.exclude)||!e.exclude.has(i))}_externalToInternalRenderItems(e,t,r={layerUids:null,graphicUids:null}){if(!e)return r;if(e instanceof i)dt(r,this._getGraphicFilterUid(e)),t===ut.INCLUDE&&(f(this.graphicsView)&&e.layer===this?ht(r,this.graphicsView.processor.layer.id):e.layer&&ht(r,e.layer.uid));else if(d(e))for(const i of e)i===this.graphics&&f(this.graphicsView)?ht(r,this.graphicsView.processor.layer.id):i===this.map.ground?ht(r,Be):this._externalToInternalRenderItems(i,t,r);else"uid"in e&&ht(r,e.uid);return r}_initBasemapTerrain(){this._set("basemapTerrain",new Le({view:this})),this._set("elevationProvider",new be({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Ie({view:this})),this._set("featureTiles",new ye({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.contentCameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=f(this.basemapTerrain.extent)?F(z(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;f(this.clippingArea)?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.handles.add([this.updatingHandles.add((()=>Se.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this.featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this.featureTreeDebugger&&Se.FEATURE_TILE_TREE_SHOW_TILES&&(this.featureTreeDebugger=new e({view:this}))})):e||!this.featureTreeDebugger||Se.FEATURE_TILE_TREE_SHOW_TILES||(this.featureTreeDebugger.destroy(),this.featureTreeDebugger=null)}),M),this.updatingHandles.add((()=>this.clippingArea),e,M),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,M)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.deinit(),this.handles.remove("render-coords-helper"),this.handles.remove("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new Te(this.map,e));const t=this.state.isGlobal,i=Q(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Oe.create(this.state.viewingMode,i)),t||this.handles.add(b((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;e&&(0!==e[0]||0!==e[1]||0!==e[2]||0!==e[3])&&q(e,this.basemapTerrain.spatialReference,ft,t)&&(this.renderCoordsHelper.extent=ft)}),V),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.handles.remove("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){f(e)&&e.type===w.MOVE||(this.handles.remove("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.handles.add(b((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),{sync:!0,equals:c}),"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}_renderScreenshotOverlay(e,t){if(!this.overlay||!this.overlay.hasVisibleItems)return t;const i=e.getContext("2d");return i.putImageData(t,0,0),this.overlay.renderCanvas(e),i.getImageData(0,0,t.width,t.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,canvas:this.renderCanvas,screenshot:{renderOverlay:(e,t)=>this._renderScreenshotOverlay(e,t)}},t=new _e(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=n(this.surface),{resourceController:r,state:s,renderSpatialReference:l}=this;this._stage=new Ae({options:e,container:i,resourceController:r,state:s,sceneIntersectionHelper:t,renderSR:l}),this._stage.renderView.setRenderParameters({slicePlane:this.slicePlane}),this._lostWebGLContextHandle=o(this._stage.renderView.canvas,"webglcontextlost",(()=>this.fatalError=new a("webgl-context-lost"))),this.handles.add([this.updatingHandles.add((()=>this.qualitySettings.antialiasingEnabled),(()=>this._stage.renderView.setRenderParameters({antialiasingEnabled:this.qualitySettings.antialiasingEnabled})),S),this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(()=>this._stage.renderView.setRenderParameters({highQualityTransparency:this.qualitySettings.highQualityTransparency})),S),b((()=>this.magnifier),(e=>this._stage.renderView.magnifier=e),M)],"stage");const p=()=>{this._stage.renderView.setRenderParameters({defaultHighlightOptions:Ve.toEngineOptions(this.highlightOptions)})};this.handles.add(this.updatingHandles.add((()=>[this.highlightOptions.color,this.highlightOptions.haloColor,this.highlightOptions.haloOpacity,this.highlightOptions.fillOpacity,this.highlightOptions.shadowOpacity,this.highlightOptions.shadowColor,this.highlightOptions.shadowDifference]),p),"stage"),p(),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage.destroy(),this._stage=null,this._lostWebGLContextHandle.remove(),this._lostWebGLContextHandle=null,this.handles.remove("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Pe({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state,objectResourceCache:new fe})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.handles.remove("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;v(e),await R((()=>this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.handles.remove("graphics-view"),f(this.graphicsView)&&(this.handles.remove(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=oe(this.viewingMode);if(e===ne.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.handles.add(_((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const e=this.get("map.initialViewProperties.environment");e&&(this.environment=e)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const t=this._resolveWhenReady;this._resolveWhenReady=[],t.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.handles.remove("graphics-view"),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(Be);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(Be);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&e.opacity<1&&this._defaultToMapOptions.exclude.add(e.uid)}}async addVoxelLayerViewToWasm(e){if(!f(this.voxelWasm)){const e=(await import("../layers/VoxelWasmPerSceneView.js")).default;this.voxelWasm=new e(this)}return this.voxelWasm.addVoxelLayer(e)}removeVoxelLayerViewFromWasm(e){if(f(this.voxelWasm)){this.voxelWasm.removeVoxelLayer(e)<1&&(this.voxelWasm=null)}}};function ht(e,t){e.layerUids||(e.layerUids=new Set),e.layerUids.add(t)}function dt(e,t){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(t)}function ct(e,t){return f(e)&&A(e.spatialReference,t)?F(e,t):null}var ut;pt.type="3d",e([j()],pt.prototype,"_userClippingArea",void 0),e([j()],pt.prototype,"_resourceController",void 0),e([j()],pt.prototype,"_stage",void 0),e([j({readOnly:!0})],pt.prototype,"deconflictor",void 0),e([j({readOnly:!0})],pt.prototype,"labeler",void 0),e([j(H(J,"analyses"))],pt.prototype,"analyses",void 0),e([j({type:se,readOnly:!0,aliasOf:"state.animation"})],pt.prototype,"animation",void 0),e([j({readOnly:!0})],pt.prototype,"basemapTerrain",void 0),e([j({readOnly:!0})],pt.prototype,"elevationProvider",void 0),e([j({type:t,aliasOf:"stateManager.camera"})],pt.prototype,"camera",void 0),e([j({type:t,aliasOf:"stateManager.contentCamera"})],pt.prototype,"contentCamera",void 0),e([j({readOnly:!0})],pt.prototype,"canvas",void 0),e([j({type:ot,aliasOf:"stateManager.center"})],pt.prototype,"center",void 0),e([j({type:nt})],pt.prototype,"clippingArea",null),e([j({type:he})],pt.prototype,"constraints",void 0),e([j({type:nt,readOnly:!0})],pt.prototype,"renderDataExtent",null),e([j({type:nt,readOnly:!0})],pt.prototype,"dataExtent",null),e([j({type:nt,readOnly:!0})],pt.prototype,"groundAndLayersExtent",null),e([j({value:null,type:de})],pt.prototype,"environment",null),e([P("environment")],pt.prototype,"castEnvironment",null),e([j({readOnly:!0})],pt.prototype,"environmentManager",void 0),e([j({type:nt,aliasOf:"stateManager.extent"})],pt.prototype,"extent",void 0),e([j()],pt.prototype,"floors",void 0),e([j({readOnly:!0,aliasOf:"stateManager.screenCenter"})],pt.prototype,"screenCenter",void 0),e([j({aliasOf:"stateManager.frustum"})],pt.prototype,"frustum",void 0),e([j({type:Number,readOnly:!0})],pt.prototype,"fullOpacity",void 0),e([j({readOnly:!0})],pt.prototype,"graphicsView",void 0),e([j({readOnly:!0})],pt.prototype,"analysisViewManager",void 0),e([j()],pt.prototype,"groundView",void 0),e([j({type:Boolean})],pt.prototype,"initialExtentRequired",null),e([j()],pt.prototype,"_defaultsFromMapSettings",null),e([j({type:Boolean,readOnly:!0})],pt.prototype,"interacting",null),e([j()],pt.prototype,"stationary",null),e([j({aliasOf:"state.navigating"})],pt.prototype,"navigating",void 0),e([j()],pt.prototype,"map",void 0),e([j({readOnly:!0})],pt.prototype,"mapCoordsHelper",void 0),e([j({aliasOf:"stateManager.padding"})],pt.prototype,"padding",void 0),e([j({type:Ie,readOnly:!0})],pt.prototype,"pointsOfInterest",void 0),e([j({type:ye,readOnly:!0})],pt.prototype,"featureTiles",void 0),e([j()],pt.prototype,"featureTreeDebugger",void 0),e([j({type:Boolean})],pt.prototype,"screenSizePerspectiveEnabled",void 0),e([j({constructOnly:!0})],pt.prototype,"deactivatedWebGLExtensions",void 0),e([j({constructOnly:!0})],pt.prototype,"debugWebGLExtensions",void 0),e([j({constructOnly:!0})],pt.prototype,"renderCanvas",void 0),e([j({constructOnly:!0})],pt.prototype,"state",void 0),e([j({readOnly:!0})],pt.prototype,"inputManager",void 0),e([j({readOnly:!0})],pt.prototype,"stateManager",void 0),e([j({type:["low","medium","high"]})],pt.prototype,"qualityProfile",null),e([j({type:xe,get(){let e=this._get("qualitySettings");return e||(e=new xe,Me.apply(this.qualityProfile,e)),e}})],pt.prototype,"qualitySettings",void 0),e([j()],pt.prototype,"slicePlane",null),e([j({readOnly:!0})],pt.prototype,"typeSpecificPreconditionsReady",null),e([j({readOnly:!0})],pt.prototype,"renderCoordsHelper",void 0),e([j({readOnly:!0})],pt.prototype,"sceneIntersectionHelper",void 0),e([j({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],pt.prototype,"resolution",null),e([j({type:Number,aliasOf:"stateManager.scale"})],pt.prototype,"scale",void 0),e([j()],pt.prototype,"heightModelInfo",null),e([j()],pt.prototype,"spatialReference",void 0),e([j({type:Boolean,constructOnly:!0})],pt.prototype,"alphaCompositingEnabled",void 0),e([j({type:Boolean})],pt.prototype,"supersampleScreenshotsEnabled",void 0),e([j({readOnly:!0})],pt.prototype,"type",void 0),e([j({type:rt})],pt.prototype,"ui",void 0),e([j({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.hasPendingInputs","toolViewManager.updating","analysisViewManager.updating"]})],pt.prototype,"updating",null),e([j({type:Number,readOnly:!0,dependsOn:["updating"]})],pt.prototype,"updatingProgress",void 0),e([j({type:["global","local"]})],pt.prototype,"viewingMode",null),e([j({type:r,aliasOf:"stateManager.viewpoint"})],pt.prototype,"viewpoint",void 0),e([j({type:Number,aliasOf:"stateManager.zoom"})],pt.prototype,"zoom",void 0),e([j({type:Ve})],pt.prototype,"highlightOptions",void 0),pt=e([I("esri.views.SceneView")],pt),function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(ut||(ut={}));const gt=G(),mt=O(),ft=k(),yt=pt;export{yt as default};
|
package/views/ToolViewManager.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import o from"../core/Accessor.js";import e from"../core/Collection.js";import{HandleOwner as i}from"../core/HandleOwner.js";import{makeHandle as r}from"../core/handleUtils.js";import s from"../core/Logger.js";import{isSome as a,isNone as
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import o from"../core/Accessor.js";import e from"../core/Collection.js";import{HandleOwner as i}from"../core/HandleOwner.js";import{makeHandle as r}from"../core/handleUtils.js";import s from"../core/Logger.js";import{isSome as a,isNone as n,destroyMaybe as l}from"../core/maybe.js";import{watch as h}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{TextureCollection as u}from"./3d/support/TextureCollection.js";import{ViewEventPriorities as v}from"./input/InputManager.js";import{eventTypes as d}from"./input/ViewEvents.js";import{getToolCollectionHandles as m,areToolManipulatorsEditable as f}from"./interactive/interactiveToolUtils.js";import{EditableFlag as T}from"./interactive/interfaces.js";import _ from"./interactive/ToolViewManagerManipulatorState.js";const E=s.getLogger("esri.views.ToolViewManager"),g="attached",w="tools";let y=class extends i{constructor(t){super(t),this._manipulatorState=new _,this.tools=new e,this.cursor=null,this._forEachTool=t=>{for(const o of this.tools.items)if(t(o))return}}initialize(){this.handles.add([this.view.on(d,(t=>{this._handleInputEvent(t)}),v.TOOL),...m(this.tools),this.tools.on("before-remove",(({item:t})=>{this._manipulatorState.clearPointers(t,this._forEachTool)})),this.tools.on("change",(()=>{this._refreshToolWatchers()}))])}destroy(){this.detach(),this.handles.removeAll()}set activeTool(t){if(a(t)&&!this.view.ready)return void E.error("Cannot set active tool while view is not ready.");if(t===this.activeTool)return void(a(t)&&E.warn("Tool is already active - ignoring activation request."));const o=this.activeTool;this._set("activeTool",t),a(o)&&o.deactivate(),a(t)&&t.activate(),this._removeIncompleteTools(t);const e=n(this.activeTool);for(const i of this.tools){i.setEditableFlag(T.MANAGER,e||i===this.activeTool);const t=f(i);!e&&t||this._manipulatorState.clearPointers(i,this._forEachTool,!t)}this._updateCursor()}get updating(){return this.updatingHandles.updating||this.tools.some((t=>t.updating))||(this.textures?.updating??!1)}attach(){"3d"===this.view.type?(this._set("textures",new u(this.view._stage,this.view.resourceController.scheduler)),this.handles.add([h((()=>{const{state:t}=this.view;return"camera"in t&&t.camera}),(()=>{this._forEachManipulator((t=>{null!=t.onViewChange&&t.onViewChange()}))})),this.view.elevationProvider.on("elevation-change",(t=>{this._forEachManipulator((o=>{null!=o.onElevationChange&&o.onElevationChange(t)}))})),r((()=>this._set("textures",l(this.textures))))],g)):this.handles.add(h((()=>this.view.extent),(()=>{this._forEachManipulator((t=>{null!=t.onViewChange&&t.onViewChange()}))})))}detach(){a(this.activeTool)&&(this.activeTool=null),this.tools.removeAll(),this.handles.remove(g)}_forEachManipulator(t){this._forEachTool((o=>{o.manipulators&&o.manipulators.forEach((({manipulator:e})=>t(e,o)))}))}_handleInputEvent(t){let o=!1;const e={...t,stopPropagation:()=>{o=!0,t.stopPropagation()}};a(this.activeTool)?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(e):this._forEachTool((t=>{!o&&t.visible&&t.handleInputEvent(e)})),!o&&"key-down"===t.type&&"Escape"===t.key&&this.activeTool&&(t.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(e,{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:t=>{this.activeTool=t},view:this.view}),!o&&a(this.activeTool)&&this.activeTool.handleInputEventAfter(e),this._manipulatorState.handleHoverEvent(e,this._forEachTool),this._updateCursor()}_refreshToolWatchers(){this.handles.remove(w),this._forEachTool((t=>{if(t instanceof o){const o=h((()=>[t.cursor,t.visible,t.editable]),(()=>{f(t)||this._manipulatorState.clearPointers(t,this._forEachTool),this._updateCursor()}));this.handles.add(o,w)}t.manipulators&&this.handles.add(t.manipulators.on("change",(o=>{o.removed.forEach((({id:o})=>{this._manipulatorState.clearPointers(t,this._forEachTool,!0,o)})),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})),w)})),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateCursor(){const t=this._manipulatorState.cursor;let o=t;this._forEachTool((e=>!(!a(e.cursor)||!e.visible||!n(t)&&e.preferManipulatorCursor)&&(o=e.cursor,!0))),this._get("cursor")!==o&&this._set("cursor",o)}_removeIncompleteTools(t){this.tools.filter((o=>(n(t)||o!==t)&&!o.created)).forEach((t=>{this.tools.remove(t)}))}};t([c({constructOnly:!0,nonNullable:!0})],y.prototype,"view",void 0),t([c({readOnly:!0,nonNullable:!0})],y.prototype,"textures",void 0),t([c({value:null})],y.prototype,"activeTool",null),t([c({readOnly:!0,type:e})],y.prototype,"tools",void 0),t([c({readOnly:!0})],y.prototype,"cursor",void 0),t([c({readOnly:!0})],y.prototype,"updating",null),y=t([p("esri.views.ToolViewManager")],y);const j=y;export{j as default};
|