@arcgis/core 5.0.0-next.68 → 5.0.0-next.69
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/Ground.d.ts +3 -4
- package/WebDocument2D.d.ts +1 -1
- package/WebLinkChart.d.ts +2 -0
- package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +3 -4
- package/analysis/types.d.ts +1 -0
- package/applications/Components/analysisUtils.d.ts +1 -3
- package/applications/Components/arcadeFeatureUtils.d.ts +1 -1
- package/applications/ExperienceBuilder/sketchUtils.d.ts +2 -2
- package/applications/KnowledgeStudio/reshape.d.ts +2 -2
- package/applications/SceneViewer/sceneViewerUtils.d.ts +11 -0
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
- package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{c623918e289a09905cd1.js → 01d7542d85a453384cf1.js} +1 -1
- package/assets/esri/core/workers/chunks/{168ec8fca2702617a543.js → 09dfec3e097ebbef6a89.js} +1 -1
- package/assets/esri/core/workers/chunks/{794960ec36e11f4416c2.js → 1d1e25bb61eeeee8ee94.js} +1 -1
- package/assets/esri/core/workers/chunks/2e2c47f8a80ee9234350.js +1 -0
- package/assets/esri/core/workers/chunks/{b2a1e5e9182b643909eb.js → 4c04c54330b693892cfc.js} +47 -49
- package/assets/esri/core/workers/chunks/563933a84fc9b0e021f6.js +1 -0
- package/assets/esri/core/workers/chunks/58b3a776ef129f7f86dc.js +1 -0
- package/assets/esri/core/workers/chunks/58e8d41dcc450e6427c9.js +1 -0
- package/assets/esri/core/workers/chunks/6c9dac4a869742cc2718.js +1 -0
- package/assets/esri/core/workers/chunks/{e5aac523c37d906eece6.js → 827277e5da652bcecaf2.js} +1 -1
- package/assets/esri/core/workers/chunks/9f34cf024231f574009c.js +1 -0
- package/assets/esri/core/workers/chunks/a10c6dd3bb8b3602de68.js +1 -0
- package/assets/esri/core/workers/chunks/a64cd02ca959d511101c.js +1 -0
- package/assets/esri/core/workers/chunks/{0f8149fdcf0adeca268e.js → b28e0b89603d8b03f9e1.js} +1 -1
- package/assets/esri/core/workers/chunks/b5e4a36784d598ae6679.js +1 -0
- package/assets/esri/core/workers/chunks/{204d738c8b651314ae64.js → b899b4e7979c13b99526.js} +1 -1
- package/assets/esri/core/workers/chunks/bf05164b7a3e4f31e9db.js +1 -0
- package/assets/esri/core/workers/chunks/d0ae8752419d5b761190.js +1 -0
- package/assets/esri/core/workers/chunks/dbfb00fb28b8b9f687a1.js +1 -0
- package/assets/esri/core/workers/chunks/e071b912539304564b69.js +1 -0
- package/assets/esri/core/workers/chunks/{ab71865b94022e78035c.js → f92845eb7df1804fcd6d.js} +1 -1
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +108 -0
- 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/GaussianSplat.glsl.js +2 -2
- package/chunks/GaussianSplatDepthComposition.glsl.js +4 -5
- package/chunks/HUDMaterial.glsl.js +45 -47
- package/chunks/LineMarker.glsl.js +33 -34
- package/chunks/PointRenderer.glsl.js +6 -6
- package/chunks/RibbonLine.glsl.js +62 -54
- package/chunks/libtess-f32.js +1 -1
- package/chunks/libtess-f64.js +1 -1
- package/config.js +1 -1
- package/core/Collection.d.ts +3 -2
- package/core/Identifiable.d.ts +1 -3
- package/core/accessorSupport/types.d.ts +0 -8
- package/core/promiseUtils.d.ts +1 -1
- package/core/reactiveUtils.d.ts +2 -2
- package/core/units.d.ts +8 -2
- package/geometry/HeightModelInfo.d.ts +3 -3
- package/geometry/SpatialReference.d.ts +2 -2
- package/geometry/libtess.js +1 -1
- package/geometry/support/meshUtils/types.d.ts +2 -2
- package/geometry/types.d.ts +2 -0
- package/identity/IdentityManagerBase.d.ts +4 -4
- package/interfaces.d.ts +2937 -2954
- package/kernel.js +1 -1
- package/layers/BaseElevationLayer.d.ts +3 -4
- package/layers/ElevationLayer.d.ts +3 -4
- package/layers/FeatureLayer.d.ts +12 -11
- package/layers/FeatureLayer.js +1 -1
- package/layers/GroupLayer.d.ts +3 -3
- package/layers/ImageryLayer.d.ts +3 -3
- package/layers/ImageryTileLayer.d.ts +3 -4
- package/layers/Layer.d.ts +4 -4
- package/layers/LineOfSightLayer.d.ts +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.d.ts +7 -8
- package/layers/MediaLayer.d.ts +3 -3
- package/layers/OrientedImageryLayer.d.ts +3 -3
- package/layers/ParquetLayer.d.ts +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/RouteLayer.d.ts +2 -3
- package/layers/SceneLayer.d.ts +167 -3
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.d.ts +3 -3
- package/layers/SubtypeGroupLayer.d.ts +3 -3
- package/layers/WCSLayer.d.ts +3 -3
- package/layers/graphics/sources/ParquetSource.d.ts +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/SceneService.d.ts +2 -2
- package/layers/orientedImagery/queries.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.d.ts +2 -2
- package/layers/orientedImagery/transformations/types.d.ts +1 -1
- package/layers/raster/datasets/pixelReader.d.ts +1 -7
- package/layers/raster/functions/creators/createBandIndexFunctions.d.ts +29 -29
- package/layers/support/BuildingFilterMode.d.ts +3 -1
- package/layers/support/BuildingFilterMode.js +1 -1
- package/layers/support/BuildingFilterModeSolid.js +1 -1
- package/layers/support/BuildingFilterModeWireFrame.js +1 -1
- package/layers/support/BuildingFilterModeXRay.js +1 -1
- package/layers/support/CodedValue.d.ts +1 -1
- package/layers/support/ControlPoint.d.ts +6 -20
- package/layers/support/ControlPointsGeoreference.d.ts +2 -1
- package/layers/support/ElevationSampler.d.ts +2 -2
- package/layers/support/FeatureReductionBinning.d.ts +4 -4
- package/layers/support/FeatureReductionBinning.js +1 -1
- package/layers/support/FeatureReductionSelection.d.ts +3 -3
- package/layers/support/FeatureReductionSelection.js +1 -1
- package/layers/support/Field.d.ts +1 -2
- package/layers/support/ParquetGeometryEncodingLocation.d.ts +6 -4
- package/layers/support/ParquetGeometryEncodingLocation.js +1 -1
- package/layers/support/ParquetGeometryEncodingWkb.d.ts +6 -4
- package/layers/support/ParquetGeometryEncodingWkb.js +1 -1
- package/layers/support/PixelBlock.d.ts +11 -3
- package/layers/support/RangeDomain.d.ts +2 -1
- package/layers/support/SceneServiceTimeInfo.js +5 -0
- package/layers/support/SpriteSource.d.ts +1 -0
- package/layers/support/Sublayer.d.ts +17 -16
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/featureReductionUtils.js +1 -1
- package/layers/support/rasterFunctionUtils.d.ts +30 -30
- package/layers/support/types.d.ts +101 -1
- package/layers/types.d.ts +12 -1
- package/layers/wms/types.d.ts +0 -4
- package/networks/CircuitManager.d.ts +5 -5
- package/networks/Network.d.ts +5 -5
- package/networks/UtilityNetwork.d.ts +2 -2
- package/package.json +2 -2
- package/popup/content/types.d.ts +1 -3
- package/portal/PortalItem.d.ts +8 -8
- package/portal/PortalItemResource.d.ts +2 -2
- package/portal/PortalUser.d.ts +3 -3
- package/portal/support/resourceUtils.d.ts +3 -3
- package/portal/types.d.ts +6 -6
- package/renderers/support/pointCloud/types.d.ts +1 -0
- package/renderers/support/raster/types.d.ts +1 -0
- package/renderers/types.d.ts +2 -0
- package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.d.ts +0 -2
- package/rest/layerSources/DynamicDataLayer.d.ts +102 -0
- package/rest/layerSources/DynamicDataLayer.js +5 -0
- package/{layers/support/source/MapLayerSource.d.ts → rest/layerSources/DynamicMapLayer.d.ts} +4 -4
- package/rest/layerSources/DynamicMapLayer.js +5 -0
- package/rest/layerSources/JoinTableDataSource.d.ts +75 -0
- package/rest/layerSources/JoinTableDataSource.js +5 -0
- package/{layers/support/source → rest/layerSources}/QueryTableDataSource.d.ts +8 -7
- package/rest/layerSources/QueryTableDataSource.js +5 -0
- package/{layers/support/source → rest/layerSources}/RasterDataSource.d.ts +2 -2
- package/rest/layerSources/RasterDataSource.js +5 -0
- package/{layers/support/source → rest/layerSources}/TableDataSource.d.ts +2 -2
- package/rest/layerSources/TableDataSource.js +5 -0
- package/rest/layerSources/utils.js +5 -0
- package/rest/print.js +1 -1
- package/rest/query/executeQuery.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/RelationshipQuery.js +1 -1
- package/rest/support/types.d.ts +0 -4
- package/smartMapping/heuristics/binLevel.d.ts +2 -2
- package/smartMapping/heuristics/scaleRange.d.ts +2 -2
- package/smartMapping/heuristics/sizeRange.d.ts +2 -2
- package/smartMapping/heuristics/types.d.ts +3 -3
- package/smartMapping/labels/bins.d.ts +2 -2
- package/smartMapping/labels/clusters.d.ts +2 -2
- package/smartMapping/renderers/color.d.ts +14 -14
- package/smartMapping/renderers/dotDensity.d.ts +2 -2
- package/smartMapping/renderers/heatmap.d.ts +4 -4
- package/smartMapping/renderers/location.d.ts +2 -2
- package/smartMapping/renderers/opacity.d.ts +2 -2
- package/smartMapping/renderers/pieChart.d.ts +4 -4
- package/smartMapping/renderers/predominance.d.ts +2 -2
- package/smartMapping/renderers/relationship.d.ts +4 -4
- package/smartMapping/renderers/size.d.ts +15 -15
- package/smartMapping/renderers/support/rendererUtils.d.ts +2 -2
- package/smartMapping/renderers/type.d.ts +4 -4
- package/smartMapping/renderers/univariateColorSize.d.ts +4 -4
- package/smartMapping/statistics/classBreaks.d.ts +2 -2
- package/smartMapping/statistics/heatmapStatistics.d.ts +2 -2
- package/smartMapping/statistics/histogram.d.ts +2 -2
- package/smartMapping/statistics/predominantCategories.d.ts +2 -2
- package/smartMapping/statistics/summaryStatistics.d.ts +2 -2
- package/smartMapping/statistics/summaryStatisticsForAge.d.ts +2 -2
- package/smartMapping/statistics/support/ageUtils.d.ts +2 -2
- package/smartMapping/statistics/types.d.ts +7 -7
- package/smartMapping/statistics/uniqueValues.d.ts +2 -2
- package/smartMapping/symbology/color.d.ts +8 -8
- package/smartMapping/symbology/dotDensity.d.ts +6 -6
- package/smartMapping/symbology/flow.d.ts +6 -6
- package/smartMapping/symbology/heatmap.d.ts +6 -6
- package/smartMapping/symbology/location.d.ts +2 -2
- package/smartMapping/symbology/pieChart.d.ts +6 -6
- package/smartMapping/symbology/predominance.d.ts +6 -6
- package/smartMapping/symbology/relationship.d.ts +6 -6
- package/smartMapping/symbology/size.d.ts +2 -2
- package/smartMapping/symbology/support/colorRamps.d.ts +2 -2
- package/smartMapping/symbology/type.d.ts +6 -6
- package/support/popupUtils.d.ts +2 -2
- package/support/revision.js +1 -1
- package/symbols/LineSymbol3D.d.ts +2 -2
- package/symbols/PointSymbol3D.d.ts +2 -2
- package/symbols/PolygonSymbol3D.d.ts +2 -2
- package/symbols/patterns/LinePattern3D.d.ts +8 -0
- package/symbols/patterns/LineStylePattern3D.d.ts +1 -2
- package/symbols/patterns/Pattern3D.d.ts +9 -0
- package/symbols/patterns/StylePattern3D.d.ts +1 -2
- package/symbols/types.d.ts +7 -0
- package/unionTypes.d.ts +13 -13
- package/views/2d/analysis/types.d.ts +1 -0
- package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/BaseLayerView2D.d.ts +0 -5
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/support/MediaLayerInteractionOptions.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +0 -2
- package/views/3d/analysis/types.d.ts +1 -0
- package/views/3d/environment/SunLighting.d.ts +1 -3
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/support/MediaLayerInteractionOptions.d.ts +4 -0
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Transform.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js +5 -0
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/LocalOriginManager.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/LegacyTransform.js +5 -0
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/types.d.ts +4 -0
- package/views/input/types.d.ts +2 -4
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/layers/CatalogLayerView.d.ts +1 -4
- package/views/layers/DimensionLayerView.d.ts +4 -6
- package/views/layers/DimensionLayerViewMixin.d.ts +0 -97
- package/views/layers/LineOfSightLayerView.d.ts +4 -6
- package/views/layers/LineOfSightLayerViewMixin.d.ts +0 -77
- package/views/layers/StreamLayerView.d.ts +31 -2
- package/views/support/WebAssemblyRequirements.js +5 -0
- package/views/support/WebGLRequirements.js +1 -1
- package/webdoc/support/SlideThumbnail.d.ts +6 -3
- package/webdoc/support/SlideThumbnail.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +2 -2
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.d.ts +2 -2
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +7 -0
- package/widgets/BatchAttributeForm/inputs/TextElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/textInputElementUtils.js +5 -0
- package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.d.ts +2 -2
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/Directions/DirectionsViewModel.d.ts +20 -4
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.d.ts +2 -3
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +2 -2
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +2 -2
- package/widgets/Editor.d.ts +2 -2
- package/widgets/ElevationProfile/support/HoveredPoints.js +1 -1
- package/widgets/ElevationProfile/types.d.ts +3 -4
- package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
- package/widgets/Feature/types.d.ts +1 -5
- package/widgets/FeatureTable/Grid/types.d.ts +0 -2
- package/widgets/FeatureTable/support/types.d.ts +8 -8
- package/widgets/Features/FeaturesViewModel.d.ts +3 -3
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.d.ts +2 -2
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/Popup/types.d.ts +0 -2
- package/widgets/ShadowCast/ShadowCastVisibleElements.d.ts +2 -0
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/types.d.ts +2 -2
- package/widgets/Slice/SliceViewModel.d.ts +2 -2
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Spinner/SpinnerViewModel.js +1 -1
- package/widgets/support/AnalysisViewModelMixin.js +5 -0
- package/widgets/support/AnchorElementViewModel.js +1 -1
- package/widgets/support/InteractiveToolViewModelMixin.js +5 -0
- package/assets/esri/core/workers/chunks/3c3d311b88f5400951ef.js +0 -1
- package/assets/esri/core/workers/chunks/4a060147d25929680ec8.js +0 -1
- package/assets/esri/core/workers/chunks/4d0eaeb4cd6cd55e25fd.js +0 -1
- package/assets/esri/core/workers/chunks/61801bb8c7be8fe77086.js +0 -1
- package/assets/esri/core/workers/chunks/62b28f73f814413c10fc.js +0 -1
- package/assets/esri/core/workers/chunks/6925f09d44cc38480d53.js +0 -1
- package/assets/esri/core/workers/chunks/98f4b44eca91c42ca08e.js +0 -1
- package/assets/esri/core/workers/chunks/990341f7c47bd656c782.js +0 -1
- package/assets/esri/core/workers/chunks/ba7f57788847cc0f68df.js +0 -1
- package/assets/esri/core/workers/chunks/bf06250be7a7a36306b1.js +0 -1
- package/assets/esri/core/workers/chunks/cd2708fb7636b3ace229.js +0 -1
- package/assets/esri/core/workers/chunks/f7d93aae350796b88562.js +0 -1
- package/assets/esri/core/workers/chunks/f95e488d2b86e320624f.js +0 -1
- package/layers/mixins/TemporalSceneLayer.d.ts +0 -177
- package/layers/mixins/TemporalSceneLayer.js +0 -5
- package/layers/mixins/properties/ILayerWithSave.d.ts +0 -11
- package/layers/support/ContingencyConstraintViolation.d.ts +0 -2
- package/layers/support/ContingentValue.d.ts +0 -2
- package/layers/support/ContingentValuesResult.d.ts +0 -2
- package/layers/support/ElevationQuery.d.ts +0 -35
- package/layers/support/ElevationQueryContext.d.ts +0 -37
- package/layers/support/FeatureReduction.d.ts +0 -3
- package/layers/support/FeatureReduction.js +0 -5
- package/layers/support/FieldGroup.d.ts +0 -2
- package/layers/support/FieldValueType.d.ts +0 -2
- package/layers/support/I3SLayer.d.ts +0 -9
- package/layers/support/ParquetGeometryEncodingBase.d.ts +0 -9
- package/layers/support/ParquetGeometryEncodingBase.js +0 -5
- package/layers/support/SimpleBandStatistics.d.ts +0 -10
- package/layers/support/source/DataLayerSource.d.ts +0 -171
- package/layers/support/source/DataLayerSource.js +0 -5
- package/layers/support/source/MapLayerSource.js +0 -5
- package/layers/support/source/QueryTableDataSource.js +0 -5
- package/layers/support/source/RasterDataSource.js +0 -5
- package/layers/support/source/TableDataSource.js +0 -5
- package/layers/support/source/types.d.ts +0 -4
- package/views/2d/layers/features/FeaturePipelineWorkerProxy.d.ts +0 -32
- package/views/3d/webgl-engine/shaders/GaussianSplatColorTechnique.js +0 -5
- package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechniqueConfiguration.js +0 -5
- package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +0 -5
- package/widgets/support/AnalysisViewModel.d.ts +0 -5
- package/widgets/support/AnalysisViewModel.js +0 -5
- package/widgets/support/AnchorElementViewModel.d.ts +0 -3
- package/widgets/support/InteractiveToolViewModel.d.ts +0 -4
- package/widgets/support/InteractiveToolViewModel.js +0 -5
- /package/webdoc/support/{thumbnailUtils.d.ts → types.d.ts} +0 -0
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import i from"../../../TrackGraphic.js";import{isSome as s}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as n,handlesGroup as u}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import l from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as c}from"../../../core/object.js";import{createAbortError as p,createResolver as d,ignoreAbortErrors as y,throwIfNotAbortError as g,isAbortError as f}from"../../../core/promiseUtils.js";import{watch as m,sync as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as _}from"../../../core/units.js";import{property as b,subclass as A}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import{isCurvedGeometry as j}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as U}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import x from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as I}from"../../../layers/graphics/featureConversionUtils.js";import k from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as E}from"../../../layers/support/featureLayerUtils.js";import{packFields as C}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as O}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as R}from"../../../layers/support/timeSupport.js";import q from"../../../rest/support/AggregateFeatureSet.js";import V from"../../../rest/support/AttributeBinsFeatureSet.js";import Q from"../../../rest/support/AttributeBinsQuery.js";import L from"../../../rest/support/FeatureSet.js";import M from"../../../rest/support/Query.js";import{LayerView2DMixin as T}from"./LayerView2D.js";import{FeatureContainer as P}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as H}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as D}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as G}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as N}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as J}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as $}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as B}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as z}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as Z}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as K}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as X}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Y}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as ee}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as te}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as re}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ie}from"./support/util.js";import{FeatureTileSubscriptionManager as se}from"../tiling/FeatureTileSubscriptionManager.js";import{FeatureLayerViewMixin as ae}from"../../layers/FeatureLayerViewMixin.js";import oe from"../../layers/LayerView.js";import{RefreshableLayerView as ne}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ue}from"../../support/highlightOptionsUtils.js";function le(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const he=4294967294;function ce(e,t){return u(e.map(e=>m(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t,w)))}function pe(e){if(!e.geometry)return e;if(!j(e.geometry))return e;const t=.001/_(e.geometry.spatialReference),r=100;return{geometry:U(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:r*t,maxDeviation:0}),attributes:e.attributes}}let de=class extends(ae(ne(T(oe)))){constructor(){super(...arguments),this._commandsQueue=new te({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new x,this._lastUpdate=0}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(p()),this._commandsQueue.destroy()}initialize(){this._workerAttached=d(),y(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===O(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await H(t)}async _attachProxy(){const e={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};try{await this._workerProxy.pipeline.onAttach(e),this._workerAttached.resolve()}catch(t){this._workerAttached.reject(p()),g(t)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:i,labelingInfo:s})=>({labelingInfo:s,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:i,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new J(this.layer):new G(this.layer);case"geojson":case"csv":case"wfs":return new J(this.layer);case"parquet":return new Z(this.layer);case"subtype-group":return new X(this.layer);case"ogc-feature":return new B(this.layer);case"stream":return new K(this.layer);case"oriented-imagery":return new z(this.layer);case"knowledge-graph-sublayer":return new $(this.layer);case"catalog-footprint":return new D(this.layer);default:this.layer}return null}get timeExtent(){return R(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let i;e instanceof r?i=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?i=[e]:a.isCollection(e)&&e.length>0?i=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=i?.filter(s);if(!o?.length)return n();const u=ue(t);return this._addHighlights(o,u),n(()=>!this.destroyed&&this._removeHighlights(o,u))}async hitTest(e,s){const a=await this.featureContainer.hitTest(s);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;n.sort(c).reverse(),u.sort(c).reverse();const p=has("parquetlayer-hittest-max-feature-count")??1;return"parquet"===this.layer.type&&n.length>p&&(n.length=p),[...u.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createTrackGraphicHit(e,i.fromJSON(t))),...n.map(t=>this._createFeatureGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return re(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,r);return re(a,{})}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),i,r);return re(s,{})}async queryUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,r);return re(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,r);return re(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,r);return re(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,r);return re(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForHistogram(this._cleanUpQuery(e),s,r);return re(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,r);return re(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=L.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),i=await re(r,{features:[]}),s=L.fromJSON(i);return s.features.forEach(e=>this._setOriginForFeature(e)),s}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),i=await re(r,{features:[]}),s=q.fromJSON(i);return s.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),s}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return re(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return re(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return re(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return re(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return re(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return re(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),i=await re(r,{count:0,extent:null});return{count:i.count,extent:F.fromJSON(i.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),i=await re(r,{features:[]});return V.fromJSON(i)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),i=new Set(this.subscriptionManager.coverage?.target.keys());for(const s of this.featureContainer.tiles||[])s.isCoverage=i.has(s.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),y(this._updatingHandles.addPromise(this._workerAttached.promise)),y(this._attachProxy()),this.featureContainer=new P(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new se({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),y(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ce([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),m(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),m(()=>this.visible,e=>{this.view.labelManager.symbolFader.restartDeclutter(),this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.view.labelManager.removeContainer(this.featureContainer),this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=h(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=d(),y(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new o("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,i=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||r)||i||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${i}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return s}_createClientOptions(){const e=this;return{openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){const e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw new Error("InternalError: Layer adapter does not support opening message ports")},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const i of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(i));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const i={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const s=r.visualVariableUniforms,a=ie(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Y({...o.data,hasTextStringTemplates:!0},{uniforms:s,path:"renderer",schemaOptions:i})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=M.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=Q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=M.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const i of t.aggregateIds??[])r.push(i);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%he+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%he+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?l.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const i="globalIdField"in this.layer&&this.layer.globalIdField,s=i&&this.availableFields.includes(i);if(r.length&&!s)return l.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${i} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,i=ie(this.layer.geometryType),s=N(this.layer),a=[];for(const n of e.added){const e=I(pe(n),i,t,r,s);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.updated){const e=I(pe(n),i,t,r,s);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.removed)if(null==n)throw new o("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:n});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,i="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(i&&this._canEditByFeature(i)){const{adds:e,deletes:t,updates:s}=i.editedFeatures,a=this.layer.objectIdField,o=s.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[s,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...s,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),E(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const i=this.featureEffect,s={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:await this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(s,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=c(this._lastSchema?.source.strategy,o.source.strategy)||c(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=i);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const h=await this.getWorker();await h.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=i,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const p=o.processor.mesh.strategy,d="cluster"===p.type||"binning"===p.type,y="heatmap"===o.processor.mesh.factory.symbology.type,g=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(g),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){}}async _doOverride(e){const t=await this.getWorker();try{let r=new ee;for(const i of e.messages)switch(i.type){case"edit":r.tryAdd(await this._resolveEdit(i.event))||(await t.pipeline.onOverride(r.toMessage()),r=new ee,r.tryAdd(await this._resolveEdit(i.event)));break;case"override":r.tryAdd(this._resolveOverrides(i.options))||(await t.pipeline.onOverride(r.toMessage()),r=new ee,r.tryAdd(this._resolveOverrides(i.options)));break}await t.pipeline.onOverride(r.toMessage())}catch(r){f(r),0}}_getEffectiveAvailableFields(e){const t=le(this._lastAvailableFields,e);return this._lastAvailableFields=t,C(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[ye(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{f(e)||l.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function ye(e,t,r,i,s,a){s&&(s=s.clone());const o=null!=s?s.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(s??=new k,s.timeExtent=n),s=t.addFilters?.(s,e)??s,a&&(s??=new k,s.where=v(s.where,a));let u=s?.toJSON()??null;return i.size&&(u??=(new k).toJSON(),u.hiddenIds=Array.from(i)),u}e([b()],de.prototype,"_commandsQueue",void 0),e([b()],de.prototype,"_sourceRefreshVersion",void 0),e([b()],de.prototype,"_displayRefreshVersion",void 0),e([b({readOnly:!0})],de.prototype,"_pipelineUpdating",void 0),e([b()],de.prototype,"_sourceUpdating",void 0),e([b({readOnly:!0})],de.prototype,"dataUpdating",null),e([b({readOnly:!0})],de.prototype,"hasAllFeatures",null),e([b({readOnly:!0})],de.prototype,"hasAllFeaturesInView",null),e([b({readOnly:!0})],de.prototype,"hasFullGeometries",null),e([b()],de.prototype,"featureEffectView",void 0),e([b()],de.prototype,"labelingCollisionInfos",null),e([b()],de.prototype,"layerAdapter",null),e([b({readOnly:!0})],de.prototype,"timeExtent",null),de=e([A("esri.views.2d.layers.FeatureLayerView2D")],de);export{de as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import i from"../../../TrackGraphic.js";import{isSome as s}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{makeHandle as n,handlesGroup as u}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import l from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as c}from"../../../core/object.js";import{createAbortError as p,createResolver as d,ignoreAbortErrors as y,throwIfNotAbortError as g,isAbortError as f}from"../../../core/promiseUtils.js";import{watch as m,sync as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{getMetersPerUnitForSR as _}from"../../../core/units.js";import{property as b,subclass as A}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import{isCurvedGeometry as j}from"../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as x}from"../../../geometry/support/curves/densifyCurvedGeometry.js";import U from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as E}from"../../../layers/graphics/featureConversionUtils.js";import I from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as k}from"../../../layers/support/featureLayerUtils.js";import{packFields as C}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as O}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as R}from"../../../layers/support/timeSupport.js";import q from"../../../rest/support/AggregateFeatureSet.js";import V from"../../../rest/support/AttributeBinsFeatureSet.js";import Q from"../../../rest/support/AttributeBinsQuery.js";import L from"../../../rest/support/FeatureSet.js";import M from"../../../rest/support/Query.js";import{LayerView2DMixin as T}from"./LayerView2D.js";import{FeatureContainer as P}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as H}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as D}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as G}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as N}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as J}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as $}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as B}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as z}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as Z}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as K}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as X}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Y}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as ee}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as te}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as re}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ie}from"./support/util.js";import{FeatureTileSubscriptionManager as se}from"../tiling/FeatureTileSubscriptionManager.js";import{FeatureLayerViewMixin as ae}from"../../layers/FeatureLayerViewMixin.js";import oe from"../../layers/LayerView.js";import{RefreshableLayerView as ne}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ue}from"../../support/highlightOptionsUtils.js";function le(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const he=4294967294;function ce(e,t){return u(e.map(e=>m(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t,w)))}function pe(e){if(!e.geometry)return e;if(!j(e.geometry))return e;const t=.001/_(e.geometry.spatialReference),r=100;return{geometry:x(e.geometry,{maxSegmentsPerCurve:12e3,maxSegmentLength:r*t,maxDeviation:0}),attributes:e.attributes}}let de=class extends(ae(ne(T(oe)))){constructor(){super(...arguments),this._commandsQueue=new te({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new U,this._lastUpdate=0}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(p()),this._commandsQueue.destroy()}initialize(){this._workerAttached=d(),y(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new o("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===O(e)?.operations.supportsQuery)throw new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await H(t)}async _attachProxy(){const e={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};try{await this._workerProxy.pipeline.onAttach(e),this._workerAttached.resolve()}catch(t){this._workerAttached.reject(p()),g(t)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:i,labelingInfo:s})=>({labelingInfo:s,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:i,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new J(this.layer):new G(this.layer);case"geojson":case"csv":case"wfs":return new J(this.layer);case"parquet":return new Z(this.layer);case"subtype-group":return new X(this.layer);case"ogc-feature":return new B(this.layer);case"stream":return new K(this.layer);case"oriented-imagery":return new z(this.layer);case"knowledge-graph-sublayer":return new $(this.layer);case"catalog-footprint":return new D(this.layer);default:this.layer}return null}get timeExtent(){return R(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let i;e instanceof r?i=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?i=[e]:a.isCollection(e)&&e.length>0?i=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=i?.filter(s);if(!o?.length)return n();const u=ue(t);return this._addHighlights(o,u),n(()=>!this.destroyed&&this._removeHighlights(o,u))}async hitTest(e,s){const a=await this.featureContainer.hitTest(s);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;n.sort(c).reverse(),u.sort(c).reverse();const p=has("parquetlayer-hittest-max-feature-count")??1;return"parquet"===this.layer.type&&n.length>p&&(n.length=p),[...u.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createTrackGraphicHit(e,i.fromJSON(t))),...n.map(t=>this._createFeatureGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return re(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,r);return re(a,{})}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),i,r);return re(s,{})}async queryUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,r);return re(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,r);return re(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,r);return re(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,r);return re(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForHistogram(this._cleanUpQuery(e),s,r);return re(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,r);return re(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=L.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),i=await re(r,{features:[]}),s=L.fromJSON(i);return s.features.forEach(e=>this._setOriginForFeature(e)),s}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),i=await re(r,{features:[]}),s=q.fromJSON(i);return s.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),s}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return re(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return re(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return re(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return re(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return re(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return re(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),i=await re(r,{count:0,extent:null});return{count:i.count,extent:F.fromJSON(i.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),i=await re(r,{features:[]});return V.fromJSON(i)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),i=new Set(this.subscriptionManager.coverage?.target.keys());for(const s of this.featureContainer.tiles||[])s.isCoverage=i.has(s.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),y(this._updatingHandles.addPromise(this._workerAttached.promise)),y(this._attachProxy()),this.featureContainer=new P(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new se({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),y(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ce([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),m(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),m(()=>this.visible,e=>{this.view.labelManager.symbolFader.restartDeclutter(),this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.view.labelManager.removeContainer(this.featureContainer),this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=h(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=d(),y(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new o("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}onProxyClientEvent(e){}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,i=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||r)||i||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${i}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return s}_createClientOptions(){const e=this;return{openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){const e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw new Error("InternalError: Layer adapter does not support opening message ports")},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.onProxyClientEvent(e)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const i of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(i));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const i={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const s=r.visualVariableUniforms,a=ie(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Y({...o.data,hasTextStringTemplates:!0},{uniforms:s,path:"renderer",schemaOptions:i})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=M.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=Q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=M.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const i of t.aggregateIds??[])r.push(i);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%he+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%he+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?l.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const i="globalIdField"in this.layer&&this.layer.globalIdField,s=i&&this.availableFields.includes(i);if(r.length&&!s)return l.getLogger(this).error(new o("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${i} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,i=ie(this.layer.geometryType),s=N(this.layer),a=[];for(const n of e.added){const e=E(pe(n),i,t,r,s);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.updated){const e=E(pe(n),i,t,r,s);if(null==e.objectId)throw new o("featurelayerview:bad-override","Feature does not have an objectId",{feature:n});a.push(e)}for(const n of e.removed)if(null==n)throw new o("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:n});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,i="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(i&&this._canEditByFeature(i)){const{adds:e,deletes:t,updates:s}=i.editedFeatures,a=this.layer.objectIdField,o=s.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[s,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...s,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),k(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const i=this.featureEffect,s={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:await this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(s,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=c(this._lastSchema?.source.strategy,o.source.strategy)||c(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=i);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const h=await this.getWorker();await h.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=i,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const p=o.processor.mesh.strategy,d="cluster"===p.type||"binning"===p.type,y="heatmap"===o.processor.mesh.factory.symbology.type,g=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(g),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){}}async _doOverride(e){const t=await this.getWorker();try{let r=new ee;for(const i of e.messages)switch(i.type){case"edit":r.tryAdd(await this._resolveEdit(i.event))||(await t.pipeline.onOverride(r.toMessage()),r=new ee,r.tryAdd(await this._resolveEdit(i.event)));break;case"override":r.tryAdd(this._resolveOverrides(i.options))||(await t.pipeline.onOverride(r.toMessage()),r=new ee,r.tryAdd(this._resolveOverrides(i.options)));break}await t.pipeline.onOverride(r.toMessage())}catch(r){f(r),0}}_getEffectiveAvailableFields(e){const t=le(this._lastAvailableFields,e);return this._lastAvailableFields=t,C(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[ye(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{f(e)||l.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function ye(e,t,r,i,s,a){s&&(s=s.clone());const o=null!=s?s.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(s??=new I,s.timeExtent=n),s=t.addFilters?.(s,e)??s,a&&(s??=new I,s.where=v(s.where,a));let u=s?.toJSON()??null;return i.size&&(u??=(new I).toJSON(),u.hiddenIds=Array.from(i)),u}e([b()],de.prototype,"_commandsQueue",void 0),e([b()],de.prototype,"_sourceRefreshVersion",void 0),e([b()],de.prototype,"_displayRefreshVersion",void 0),e([b({readOnly:!0})],de.prototype,"_pipelineUpdating",void 0),e([b()],de.prototype,"_sourceUpdating",void 0),e([b({readOnly:!0})],de.prototype,"dataUpdating",null),e([b({readOnly:!0})],de.prototype,"hasAllFeatures",null),e([b({readOnly:!0})],de.prototype,"hasAllFeaturesInView",null),e([b({readOnly:!0})],de.prototype,"hasFullGeometries",null),e([b()],de.prototype,"featureEffectView",void 0),e([b()],de.prototype,"labelingCollisionInfos",null),e([b()],de.prototype,"layerAdapter",null),e([b({readOnly:!0})],de.prototype,"timeExtent",null),de=e([A("esri.views.2d.layers.FeatureLayerView2D")],de);export{de as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{handlesGroup as r,makeHandle as s}from"../../../core/handleUtils.js";import{watch as n}from"../../../core/reactiveUtils.js";import{property as i,subclass as o}from"../../../core/accessorSupport/decorators.js";import a from"../../../rest/support/FeatureSet.js";import{isNumber as l}from"../../../support/guards.js";import c from"./FeatureLayerView2D.js";import{handleNoEngineError as h}from"./support/handleNoEngineError.js";import{StreamLayerViewMixin as u}from"../../layers/StreamLayerView.js";let p=class extends(u(c)){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([n(()=>this.layer.customParameters,async e=>{(await this.getWorker()).streamMessenger.updateCustomParameters(e)}),this.layer.on("send-message-to-socket",async e=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(e)}),this.layer.on("send-message-to-client",async e=>{(await this.getWorker()).streamMessenger.sendMessageToClient(e),this._isUserPaused&&"type"in e&&"clear"===e.type&&this.incrementSourceRefreshVersion()}),n(()=>this.layer.purgeOptions,()=>this._update()),n(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new t("stream-controller",this.pipelineErrorString):null}on(e,t){if(Array.isArray(e))return r(e.map(e=>this.on(e,t)));const n=["data-received","message-received"].includes(e);n&&this.getWorker().then(t=>t.streamMessenger.enableEvent(e,!0));const i=super.on(e,t),o=this;return s(()=>{i.remove(),n&&(o._workerProxy.closed||o.hasEventListener(e)||o.getWorker().then(t=>t.streamMessenger.enableEvent(e,!1)))})}async queryLatestObservations(e,r){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new t("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");const s=await this.getWorker();return h(s.features.executeQueryForLatestObservations(this._cleanUpQuery(e),r).then(e=>{const t=a.fromJSON(e);return t.features.forEach(e=>{e.layer=this.layer,e.sourceLayer=this.layer,e.origin=this.layer.graphicOrigin}),t}),new a({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}onProxyClientEvent(e){this.emit(e.name,e.event)}async queryObjectIds(e,t){return(await super.queryObjectIds(e,t)).filter(l)}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){null!=this._refreshInterval&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){null==this._refreshInterval&&(this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval))}_doDisconnect(){this.getWorker().then(e=>e.streamMessenger.disconnect()),this._doPause()}_doConnect(){this.getWorker().then(e=>e.streamMessenger.connect()),this.resume()}_doClear(){this.getWorker().then(e=>e.streamMessenger.clear()),null==this._refreshInterval&&this.incrementSourceRefreshVersion()}_createClientOptions(){const e=super._createClientOptions(),t=this;return{...e,get container(){return t.featureContainer},setProperty:e=>{this.set(e.propertyName,e.value)}}}};e([i()],p.prototype,"pipelineConnectionStatus",void 0),e([i()],p.prototype,"pipelineErrorString",void 0),e([i({readOnly:!0})],p.prototype,"connectionError",null),e([i({readOnly:!0})],p.prototype,"_streamConnectionStatus",null),p=e([o("esri.views.2d.layers.StreamLayerView2D")],p);const d=p;export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{notDeepEqual as e}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import{MultiTileMeshData as n}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as c}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as h}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as u}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as g}from"../../engine/webgl/util/MatcherContext.js";import{ProcessorTileMessageQueue as p}from"./ProcessorTileMessageQueue.js";import{BinningStrategy as y}from"./processor/BinningStrategy.js";import{ClusterStrategy as d}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as _}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as l}from"./processor/TrackStrategy.js";import{AttributeStore as m}from"./support/AttributeStore.js";import{ComputedAttributeStorage as f}from"./support/ComputedAttributeStorage.js";class b{constructor(t,e){this._connection=t,this._source=e,this._version=1,this._registry=new u,this._proxy=new h({fetch:(t,e)=>this._connection.layerView.fetch(t,e),fetchDictionary:(t,e)=>this._connection.layerView.fetchDictionary(t,e)}),this._attributeStore=new m({isLocal:!1,update:t=>o(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let t=0;return t+=this._attributeStore.usedMemory,this._strategy&&(t+=this._strategy.usedMemory),t}get version(){return this._version}getDisplayFeatures(t){return this._strategy?this._strategy.getDisplayFeatures(t):{features:[],aggregates:[],tracks:[]}}getDisplayIds(t){const e={};return this._strategy?(this._strategy.displayMap(t,t=>t,(t,s,r)=>{e[r]=t}),e):e}getFeatureObjectIdsForAggregate(t){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(t):[]}onSubscribe(t){this._strategy?.onSubscribe(t)}onUnsubscribe(t){this._strategy?.onUnsubscribe(t)}requiresInvalidation(){return this._strategy?.requiresInvalidation()??!1}async update(t,s,r,i,o){const n=t.processor,h=e(this._schema?.storage,n.storage),u=e(this._schema?.mesh.properties,n.mesh.properties),p=e(this._schema?.mesh.factory,n.mesh.factory),y=e(this._schema?.mesh.strategy,n.mesh.strategy),d=w(this._schema?.expressionProperties,n.expressionProperties),_=d.some(t=>this._attributeStore.hasArcadeDependency(t)),l=d.some(t=>this._factory?.hasArcadeDependency(t)??!1),m=d.some(t=>this._strategy?.hasArcadeDependency(t))||this._strategy?.isAggregate&&_,b=l||m,I=u||p||y;if(!(h||I||(l||_||m))&&!i)return!1;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a(this._schema,n),schema:n}),this._schema=n;const j=new f({fields:this._source.metadata.fieldsIndex,spatialReference:this._source.metadata.outSpatialReference}),x={currentUser:n.mesh.properties.currentUser};if((h||I||_)&&(await this._attributeStore.update(n.storage,j,this._source.metadata,s),this._strategy?.invalidateAttributeData(S(n))),!i&&!I&&!b)return!1;(y||u||b)&&await this._updateStrategy(n.mesh.strategy,o,S(n),x),this._updateSortKey(j,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const v="dictionary"===n.mesh.factory.symbology.type?n.mesh.factory.symbology.fieldMap:null,M=new g(j,this._proxy,r,this._registry,v);return(p||"dictionary"===n.mesh.factory.symbology.type)&&(this._factory=await c.create(M,n.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(t){if(!this._strategy)return;const e=this._strategy.applyOverrideUpdate(t);for await(const r of e)try{await this._process(r)}catch(s){}}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(t){this._strategy?.removeChunks(t),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:t}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(t.map(({objectId:t,highlightFlags:e})=>({objectId:t,highlightFlags:e,displayId:-1})),t);const e=this._strategy.displayMap(t,({objectId:t})=>t,(t,{highlightFlags:e},s)=>({objectId:s,displayId:t,highlightFlags:e}));this._attributeStore.setHighlight(e,t)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(){if(!this._strategy)return;const t=this._strategy.updateChunks(),e=[],r=new Map;for await(const a of t){let t=r.get(a.id);null==t&&(t=new p({concurrency:16,process:t=>this._process(t)}),r.set(a.id,t));const i=t.push(a).catch(t=>s(t));e.push(i)}try{await Promise.all(e)}catch(i){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(t,e,s,r){switch(this._strategy?.destroy(),t.type){case"feature":this._strategy=new _(this._source,this._attributeStore,s,r);break;case"binning":this._strategy=await y.create(t,this._source,this._attributeStore,s,r);break;case"cluster":this._strategy=await d.create(this._connection,t,this._source,this._attributeStore,s,r);break;case"track":this._strategy=await l.create(t,this._source,this._attributeStore,s,r)}for(const i of e)this._strategy.onSubscribe(i)}async _updateSortKey(e,s){if(this._sortInfo=t(this._sortInfo?.computed),null!=s){const t=s.byRenderer?null:await e.createComputedField(s);this._sortInfo={...s,computed:t}}}async _process(t){const e=t.subscription;if(has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process`)}const s={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(t,s),r(e.signal);const i=await this._write(t,e.tile.createArcadeEvaluationOptions(S(this._schema)),s),a=e.tile.tileInfoView.getLODInfoAt(e.tile.key);r(e.signal);const{message:o,transferList:n}=i.serialize(a),c={objectIdMap:null,inner:t.createMessage(o,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){c.objectIdMap={};const e=t.reader?.getCursor();if(e)for(;e.next();)c.objectIdMap[e.getDisplayId()]=e.getObjectId()}if(r(e.signal),await this._connection.container.onMessage(c,{signal:e.signal,transferList:n}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process.await`)}}async _fetchResources(t,e){await this._fetchMatcherResources(t),await this._fetchWriterResources(t,e)}async _fetchMatcherResources(t){if(t.reader)return this._factory.enqueueMatcherRequests(this._proxy,t.reader)}async _fetchWriterResources(t,e){if(!t.reader)return;const s=t.reader.getCursor(),r=t.subscription.tile.createArcadeEvaluationOptions(S(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,e);await this._proxy.fetchEnqueuedResources()}async _write(t,e,s){const a=t.subscription.tile,o=t.reader?.getCursor(),c=o?.getSize()??0,h=a.tileInfoView.tileInfo.isWrappable,u=a.tileInfoView.tileInfo.spatialReference.isWGS84,g=new n(a.key,this._strategy.enablePixelBuffering,h,u,c);if(!o)return g;const p=a.createArcadeEvaluationOptions(S(this._schema));let y=0;for(;o.next();){++y%1e3||(await i(0),r(t.subscription));const n=this._getSortKeyValue(o,e);g.entityStart(o.getDisplayId(),n)
|
|
5
|
+
import has from"../../../../core/has.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{notDeepEqual as e}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import{MultiTileMeshData as n}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as c}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as h}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as u}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as g}from"../../engine/webgl/util/MatcherContext.js";import{ProcessorTileMessageQueue as p}from"./ProcessorTileMessageQueue.js";import{BinningStrategy as y}from"./processor/BinningStrategy.js";import{ClusterStrategy as d}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as _}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as l}from"./processor/TrackStrategy.js";import{AttributeStore as m}from"./support/AttributeStore.js";import{ComputedAttributeStorage as f}from"./support/ComputedAttributeStorage.js";class b{constructor(t,e){this._connection=t,this._source=e,this._version=1,this._registry=new u,this._proxy=new h({fetch:(t,e)=>this._connection.layerView.fetch(t,e),fetchDictionary:(t,e)=>this._connection.layerView.fetchDictionary(t,e)}),this._attributeStore=new m({isLocal:!1,update:t=>o(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let t=0;return t+=this._attributeStore.usedMemory,this._strategy&&(t+=this._strategy.usedMemory),t}get version(){return this._version}getDisplayFeatures(t){return this._strategy?this._strategy.getDisplayFeatures(t):{features:[],aggregates:[],tracks:[]}}getDisplayIds(t){const e={};return this._strategy?(this._strategy.displayMap(t,t=>t,(t,s,r)=>{e[r]=t}),e):e}getFeatureObjectIdsForAggregate(t){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(t):[]}onSubscribe(t){this._strategy?.onSubscribe(t)}onUnsubscribe(t){this._strategy?.onUnsubscribe(t)}requiresInvalidation(){return this._strategy?.requiresInvalidation()??!1}async update(t,s,r,i,o){const n=t.processor,h=e(this._schema?.storage,n.storage),u=e(this._schema?.mesh.properties,n.mesh.properties),p=e(this._schema?.mesh.factory,n.mesh.factory),y=e(this._schema?.mesh.strategy,n.mesh.strategy),d=w(this._schema?.expressionProperties,n.expressionProperties),_=d.some(t=>this._attributeStore.hasArcadeDependency(t)),l=d.some(t=>this._factory?.hasArcadeDependency(t)??!1),m=d.some(t=>this._strategy?.hasArcadeDependency(t))||this._strategy?.isAggregate&&_,b=l||m,I=u||p||y;if(!(h||I||(l||_||m))&&!i)return!1;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a(this._schema,n),schema:n}),this._schema=n;const j=new f({fields:this._source.metadata.fieldsIndex,spatialReference:this._source.metadata.outSpatialReference}),x={currentUser:n.mesh.properties.currentUser};if((h||I||_)&&(await this._attributeStore.update(n.storage,j,this._source.metadata,s),this._strategy?.invalidateAttributeData(S(n))),!i&&!I&&!b)return!1;(y||u||b)&&await this._updateStrategy(n.mesh.strategy,o,S(n),x),this._updateSortKey(j,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const v="dictionary"===n.mesh.factory.symbology.type?n.mesh.factory.symbology.fieldMap:null,M=new g(j,this._proxy,r,this._registry,v);return(p||"dictionary"===n.mesh.factory.symbology.type)&&(this._factory=await c.create(M,n.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(t){if(!this._strategy)return;const e=this._strategy.applyOverrideUpdate(t);for await(const r of e)try{await this._process(r)}catch(s){}}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(t){this._strategy?.removeChunks(t),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:t}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(t.map(({objectId:t,highlightFlags:e})=>({objectId:t,highlightFlags:e,displayId:-1})),t);const e=this._strategy.displayMap(t,({objectId:t})=>t,(t,{highlightFlags:e},s)=>({objectId:s,displayId:t,highlightFlags:e}));this._attributeStore.setHighlight(e,t)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(){if(!this._strategy)return;const t=this._strategy.updateChunks(),e=[],r=new Map;for await(const a of t){let t=r.get(a.id);null==t&&(t=new p({concurrency:16,process:t=>this._process(t)}),r.set(a.id,t));const i=t.push(a).catch(t=>s(t));e.push(i)}try{await Promise.all(e)}catch(i){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(t,e,s,r){switch(this._strategy?.destroy(),t.type){case"feature":this._strategy=new _(this._source,this._attributeStore,s,r);break;case"binning":this._strategy=await y.create(t,this._source,this._attributeStore,s,r);break;case"cluster":this._strategy=await d.create(this._connection,t,this._source,this._attributeStore,s,r);break;case"track":this._strategy=await l.create(t,this._source,this._attributeStore,s,r)}for(const i of e)this._strategy.onSubscribe(i)}async _updateSortKey(e,s){if(this._sortInfo=t(this._sortInfo?.computed),null!=s){const t=s.byRenderer?null:await e.createComputedField(s);this._sortInfo={...s,computed:t}}}async _process(t){const e=t.subscription;if(has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process`)}const s={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(t,s),r(e.signal);const i=await this._write(t,e.tile.createArcadeEvaluationOptions(S(this._schema)),s),a=e.tile.tileInfoView.getLODInfoAt(e.tile.key);r(e.signal);const{message:o,transferList:n}=i.serialize(a),c={objectIdMap:null,inner:t.createMessage(o,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){c.objectIdMap={};const e=t.reader?.getCursor();if(e)for(;e.next();)c.objectIdMap[e.getDisplayId()]=e.getObjectId()}if(r(e.signal),await this._connection.container.onMessage(c,{signal:e.signal,transferList:n}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process.await`)}}async _fetchResources(t,e){await this._fetchMatcherResources(t),await this._fetchWriterResources(t,e)}async _fetchMatcherResources(t){if(t.reader)return this._factory.enqueueMatcherRequests(this._proxy,t.reader)}async _fetchWriterResources(t,e){if(!t.reader)return;const s=t.reader.getCursor(),r=t.subscription.tile.createArcadeEvaluationOptions(S(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,e);await this._proxy.fetchEnqueuedResources()}async _write(t,e,s){const a=t.subscription.tile,o=t.reader?.getCursor(),c=o?.getSize()??0,h=a.tileInfoView.tileInfo.isWrappable,u=a.tileInfoView.tileInfo.spatialReference.isWGS84,g=new n(a.key,this._strategy.enablePixelBuffering,h,u,c);if(!o)return g;const p=a.createArcadeEvaluationOptions(S(this._schema));let y=0;for(;o.next();){++y%1e3||(await i(0),r(t.subscription));const n=this._getSortKeyValue(o,e);g.entityStart(o.getDisplayId(),n);try{this._factory.write(g,this._proxy,o,p,s,a.level)}catch(d){}g.entityEnd()}return g}_getSortKeyValue(t,e){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(t,e):s?.read(t,e);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function w(t,e){const s=[];return t?.timeExtent?.start===e.timeExtent?.start&&t?.timeExtent?.end===e.timeExtent?.end||s.push("timeProperties"),s}function S(t){const{timeZone:e}=t?.mesh.properties??{},{timeExtent:s}=t?.expressionProperties??{};return{timeZone:e,timeExtent:s}}export{b as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import r from"../../../../core/Accessor.js";import{property as t,subclass as s}from"../../../../core/accessorSupport/decorators.js";let e=class extends r{constructor(){super(
|
|
5
|
+
import{__decorate as o}from"tslib";import r from"../../../../core/Accessor.js";import{property as t,subclass as s}from"../../../../core/accessorSupport/decorators.js";let e=class extends r{constructor(o){super(o),this.tool="transform"}};o([t()],e.prototype,"tool",void 0),e=o([s("esri.views.2d.layers.support.MediaLayerInteractionOptions")],e);export{e as MediaLayerInteractionOptions};
|
|
@@ -5,8 +5,6 @@ import type LineOfSightAnalysisResult from "./LineOfSightAnalysisResult.js";
|
|
|
5
5
|
import type { AbortOptions } from "../../../core/promiseUtils.js";
|
|
6
6
|
import type { LineOfSightPlacementResult } from "./LineOfSight/types.js";
|
|
7
7
|
|
|
8
|
-
export interface LineOfSightView3DEvents {}
|
|
9
|
-
|
|
10
8
|
/**
|
|
11
9
|
* Represents the analysis view of a [LineOfSightAnalysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-LineOfSightAnalysis.html)
|
|
12
10
|
* after it has been added to [SceneView#analyses](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#analyses).
|
|
@@ -24,4 +24,5 @@ export interface AnalysisView3DMap {
|
|
|
24
24
|
|
|
25
25
|
export type AnalysisView3DFor<AnalysisType extends Analysis> = AnalysisView3DMap[AnalysisType["type"]];
|
|
26
26
|
|
|
27
|
+
/** Union of all possible analysis views that can be added to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). */
|
|
27
28
|
export type AnalysisView3DUnion = AreaMeasurementAnalysisView3D | DimensionAnalysisView3D | DirectLineMeasurementAnalysisView3D | ElevationProfileAnalysisView3D | LineOfSightAnalysisView3D | ShadowCastAnalysisView3D | SliceAnalysisView3D | ViewshedAnalysisView3D | VolumeMeasurementAnalysisView3D;
|
|
@@ -66,6 +66,4 @@ export default class SunLighting extends SunLightingSuperclass {
|
|
|
66
66
|
/** Indicates that the light source is simulated position of the sun. */
|
|
67
67
|
get type(): "sun";
|
|
68
68
|
}
|
|
69
|
-
declare const SunLightingSuperclass: typeof WebSceneSunLighting & typeof EventedMixin
|
|
70
|
-
|
|
71
|
-
export interface TimezoneWillChangeEvent {}
|
|
69
|
+
declare const SunLightingSuperclass: typeof WebSceneSunLighting & typeof EventedMixin
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{removeMaybe as s}from"../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../core/reactiveUtils.js";import{convertUnit as a}from"../../../core/units.js";import{property as n,subclass as o}from"../../../core/accessorSupport/decorators.js";import{fromValues as l}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{isCompatible as h}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as
|
|
5
|
+
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{removeMaybe as s}from"../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../core/reactiveUtils.js";import{convertUnit as a}from"../../../core/units.js";import{property as n,subclass as o}from"../../../core/accessorSupport/decorators.js";import{fromValues as l}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{isCompatible as h}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as u,isWebMercator as d,equals as m}from"../../../geometry/support/spatialReferenceUtils.js";import{getHeightModelInfoFromVCS as p}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as f}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as c}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as y}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as _}from"./LayerView3D.js";import{addLayerViewToWasm as g,getLyr3DWasm as w,removeLayerViewFromWasm as b}from"./Lyr3DWasm.js";import{Obb as C}from"../support/orientedBoundingBox.js";import{splatPageSizeInU32 as v,elementsPerSplatPage as S,packedGaussianSizeInU32 as M,splatPageSizeInU32WithoutHeader as x,gaussiansPerSplatPage as H,splatAtlasTextureWidth as U}from"../support/gaussianSplatting/GaussianSplatAtlasPages.js";import{GaussianSplatFadeHelper as V}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianTile as j}from"../support/gaussianSplatting/GaussianTile.js";import{GaussianSplatRenderNode as G}from"../webgl-engine/lib/GaussianSplatRenderNode.js";import A from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as I,isInEffectiveScaleRange as L}from"../../support/layerViewUtils.js";const O=()=>t.getLogger("esri.views.3d.layers.GaussianSplatLayerView3D");let R=class extends(_(A)){constructor(e){super(e),this.type="gaussian-splat-3d",this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._pageBuffer=new Uint32Array(v),this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedMemory=0,this._cacheMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer);const{view:t}=e;this._memCache=t.resourceController.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._fadeHelper=new V(this),this._renderNode=new G({view:t,fadeHelper:this._fadeHelper})}initialize(){if(!this._canProjectWithoutEngine())throw I("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=g(this).then(e=>{this._wasmLayerId=e,this.addHandles([i(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e))]),this._suspendedHandle=i(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),r),this.setMaximumGaussianCount(this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians)});this.addHandles([i(()=>this.view.qualitySettings.fadeDuration,e=>{this._fadeHelper.onFadeDurationChanged(e),this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}),i(()=>this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians,e=>this.setMaximumGaussianCount(e))]),this.addResolvingPromise(e)}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}get _wasm(){return w(this.view)}get usedMemory(){return this._usedMemory}get cachedMemory(){return this._cacheMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get data(){return this._renderNode.data}get visibleAtCurrentScale(){return L(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this._renderNode.data.isUpdating()||this._fadeHelper.isUpdating())}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const s=t.desc.prims[0],i=s.vertexCount,r=s.atrbs[0].view,a=s.atrbs[0].view.byteCount,n=s.atrbs[0].view.byteOffset;let o=null;if("U32"!==r.type)return O().warnOnce("unexpected meshData.data format"),{memUsageBytes:0,numGaussians:0};o=new Uint32Array(t.data.buffer,n,a/4);const h=this.extractHeader(o),u=Math.ceil(i/H),d=new Uint32Array(i),m=[];for(let l=0;l<u;l++){let e=this.data.textureAtlas.requestPage();if(null===e&&(this._freeInvisibleTiles(),e=this.data.textureAtlas.requestPage()),null===e)return O().warnOnce("ran out of gaussian splat memory"),{memUsageBytes:0,numGaussians:0};{m.push(e);const t=i-l*H,s=Math.min(t,H),r=l*H;for(let i=0;i<s;i++)d[i+r]=i+S*e;const a=l*x;this._pageBuffer.set(o.subarray(a,a+s*M)),this._pageBuffer.set(h.packedHeader,x);const n=e*S,u=n%U,p=Math.floor(n/U);this.data.textureAtlas.update(u,p,this._pageBuffer)}}const p=new Float64Array(3*i),f=new Float64Array(i),c=2.048,y=h.tileOrigin.x*c,_=h.tileOrigin.y*c,g=h.tileOrigin.z*c,w=h.invPosScale;let b=0,v=0;for(let l=0;l<i;l++){const e=l*M,{rawX:t,rawY:s,rawZ:i}=this._extractGaussianPosition(o,e),r=this._extractGaussianSphericalScale(o,e);p[b]=t*w+y,p[b+1]=s*w+_,p[b+2]=i*w+g,f[l]=r*r,v=Math.max(v,r),b+=3}let V=null;if(t.desc.obb){const e=t.desc.obb.quaternion;V=new C(t.desc.obb.center,t.desc.obb.halfSize,l(...e))}V||(O().warnOnce("encountered tile without a bounding box"),V=new C);const G=new j(e.handle,V,d,m,p,f,v);return this._memCache.put(`${G.handle}`,G),this._tileHandles.set(e.handle,G),this._cacheMemory+=G.usedMemory,{memUsageBytes:G.usedMemory,numGaussians:i}}_extractGaussianPosition(e,t){const s=e[t+1];return{rawX:16383&s,rawY:s>>>14&16383,rawZ:s>>>28&15|(1023&e[t+2])<<4}}_extractGaussianSphericalScale(e,t){const s=e[t+2],i=s>>>10&255,r=s>>>18&255,a=s>>>26&63|(3&e[t+3])<<6,n=Math.exp(i/16-10),o=Math.exp(r/16-10),l=Math.exp(a/16-10);return Math.max(n,o,l)}freeRenderable(e){const t=this._tileHandles.get(e);t&&(t.isVisible&&!this._fadeHelper.isTileFadingOut(t)?this._usedMemory-=t.usedMemory:this._cacheMemory-=t.usedMemory,t.pageIds.forEach(e=>this.data.textureAtlas.freePage(e)),this.freeObject(t),this._tileHandles.delete(e)),this.updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}setRenderableVisibility(e,t,s){for(let i=0;i<s;i++){if(!t[i])continue;const s=e[i],r=this._tileHandles.get(s);r&&(r.isVisible&&!this._fadeHelper.isTileFadingOut(r)||(r.isVisible=!0,this._fadeHelper.isTileFadingOut(r)||this._popTileFromCache(r),this._fadeHelper.fadeTile(r,0)))}for(let i=0;i<s;i++){if(t[i])continue;const s=e[i],r=this._tileHandles.get(s);r&&r.isVisible&&this._fadeHelper.fadeTile(r,1)}this.updateGaussians()}_popTileFromCache(e){this._usedMemory+=e.usedMemory,this._cacheMemory-=e.usedMemory,this._memCache.pop(`${e.handle}`)}moveTileToCache(e){this._usedMemory-=e.usedMemory,this._cacheMemory+=e.usedMemory,this._memCache.put(`${e.handle}`,e)}destroy(){b(this),this._suspendedHandle&&(this._suspendedHandle=s(this._suspendedHandle)),this._renderNode.destroy(),this._memCache.destroy()}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if(u(this.view.renderSpatialReference)||d(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&m(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){const e=p(this.layer.esriCrsSpatialReference),t=this.view.heightModelInfo;return this._useEsriCrs=0===h(e,t,!1),this._useEsriCrs&&e&&(this._metersPerVCSUnit=a(1,"meters",e.heightUnit),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(e?.offset)if(this._useEsriCrs){const t=c(e?.unit)/this._metersPerVCSUnit,s=e?.offset??0;this._wasm?.setLayerOffset(this,s*t)}else this._wasm?.setLayerOffset(this,f(e));else this._wasm?.setLayerOffset(this,0)}updateGaussians(){const e=new Array;for(const t of this._tileHandles.values())t.isVisible&&e.push(t);this.data.updateGaussianVisibility(e),this.notifyChange("updating")}setMaximumGaussianCount(e){this._wasm?.setMaximumGaussianSplatCount(e)}_freeInvisibleTiles(){for(const e of this._tileHandles.values())e.isVisible||this._deleteTile(e)}extractHeader(e){const t=e.length-4,s=this.reinterpretU32AsFloat(e[t]),i=this.reinterpretU32AsFloat(e[t+1]),r=this.reinterpretU32AsFloat(e[t+2]),a=1/(1<<(255&e[t+3]));return{packedHeader:e.subarray(t,t+4),tileOrigin:{x:s,y:i,z:r},invPosScale:a}}_deleteTile(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}get performanceInfo(){let e=0,t=0;return this._tileHandles.forEach(s=>{s.isVisible?e++:t++}),new y(this.usedMemory,e,t,this.cachedMemory)}get test(){}};e([n()],R.prototype,"layer",void 0),e([n({readOnly:!0})],R.prototype,"visibleAtCurrentScale",null),e([n()],R.prototype,"fullExtentInLocalViewSpatialReference",void 0),R=e([o("esri.views.3d.layers.GaussianSplatLayerView3D")],R);const E=R;export{E as default};
|
|
@@ -7,6 +7,10 @@ export interface MediaLayerInteractionOptionsProperties extends Partial<Pick<Med
|
|
|
7
7
|
reshapeOptions?: MediaLayerInteractionReshapeOptionsProperties;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Options for when the media layer view is interactive in 3D.
|
|
12
|
+
* Configure the interaction tool and reshape behavior for media elements.
|
|
13
|
+
*/
|
|
10
14
|
export default abstract class MediaLayerInteractionOptions extends Accessor {
|
|
11
15
|
/** Changes the behavior of the `reshape` tool. */
|
|
12
16
|
get reshapeOptions(): MediaLayerInteractionReshapeOptions;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";function a(e){return
|
|
5
|
+
import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";function a(e){return l[e]}function o(){return has("esri-iPhone")?"low":"medium"}const i={reset(){const e=m();for(const a of Object.keys(e))l[a]=e[a]}},t={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430},l=m();function m(){const a=!!has("esri-mobile"),o=!!has("ios"),i=e(400);return{low:{graphics3D:{maxTotalNumberOfFeatures:5e4,maxNumberOfDrawCalls:8e3,maxTotalNumberOfVertices:255e4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0},heatmap:{pixelRatio:.125},sceneService:{objectLoDFactor:.2,pointLoDFactor:1,meshLoDFactor:.6,pointCloudLoDFactor:.5},gaussianSplat:{minimumSplatPixelRadius:2,minimumOpacity:0,maximumNumberOfGaussians:1e6},flow:{maxTotalNumberOfStreamlines:25e3,maxTracingResolution:1024},tiledSurface:{lodBias:-1,angledSplitBias:.5,vtlContentZoom:.75,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:e(0),physicallyBasedRenderingEnabled:!1,maxTexturePixels:a?1048576:4194304,memoryLimit:200+t.IPhone12Pro,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:15e4,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:625e4,polygonLodFactor:a?.8:1,polylineLodFactor:a?1.2:1.5,snapshotAvailable:!o,skipHighSymbolLods:!1},heatmap:{pixelRatio:.25},sceneService:{objectLoDFactor:1,pointLoDFactor:1,meshLoDFactor:1,pointCloudLoDFactor:1},gaussianSplat:{minimumSplatPixelRadius:1,minimumOpacity:1,maximumNumberOfGaussians:2e6},flow:{maxTotalNumberOfStreamlines:1e5,maxTracingResolution:2048},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:3,reduceTileLevelDifferences:!0},fadeDuration:i,physicallyBasedRenderingEnabled:!0,maxTexturePixels:a?4194304:4096**2,memoryLimit:a?600+t.GalaxyS20:750+t.FullHD,additionalCacheMemory:a?-100:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:3e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:125e5,polygonLodFactor:a?1.2:2,polylineLodFactor:a?1.2:2,snapshotAvailable:!o,skipHighSymbolLods:!1},heatmap:{pixelRatio:.5},sceneService:{objectLoDFactor:1,pointLoDFactor:1,meshLoDFactor:1,pointCloudLoDFactor:1},gaussianSplat:{minimumSplatPixelRadius:.5,minimumOpacity:2,maximumNumberOfGaussians:8e6},flow:{maxTotalNumberOfStreamlines:1e5,maxTracingResolution:2048},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,elevationLevelDelta:2,reduceTileLevelDifferences:!0},fadeDuration:i,physicallyBasedRenderingEnabled:!0,maxTexturePixels:a?4096**2:1/0,memoryLimit:a?900+t.SurfacePro7:1500+t.FullHDRetina,additionalCacheMemory:a?-150:0,frameRate:0,maximumPixelRatio:a?1:1/0}}}export{i as QualityProfileTest,o as getDefaultQualityProfileName,a as getQualityProfileSettings};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{Milliseconds as o}from"../../../core/time.js";import{property as i,subclass as s}from"../../../core/accessorSupport/decorators.js";let r=class extends e{constructor(t={}){super(t),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};t([i()],r.prototype,"maxTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxNumberOfDrawCalls",void 0),t([i()],r.prototype,"maxTotalNumberOfVertices",void 0),t([i()],r.prototype,"snapshotAvailable",void 0),t([i()],r.prototype,"polygonLodFactor",void 0),t([i()],r.prototype,"polylineLodFactor",void 0),t([i()],r.prototype,"skipHighSymbolLods",void 0),r=t([s("esri.views.3d.support.QualitySettings.Graphics3DSettings")],r);let p=class extends e{constructor(t={}){super(t),this.objectLoDFactor=1,this.pointLoDFactor=1,this.meshLoDFactor=1,this.pointCloudLoDFactor=1}};t([i()],p.prototype,"objectLoDFactor",void 0),t([i()],p.prototype,"pointLoDFactor",void 0),t([i()],p.prototype,"meshLoDFactor",void 0),t([i()],p.prototype,"pointCloudLoDFactor",void 0),p=t([s("esri.views.3d.support.QualitySettings.SceneServiceSettings")],p);let a=class extends e{constructor(t={}){super(t),this.lodBias=0,this.angledSplitBias=1,this.vtlContentZoom=1,this.elevationLevelDelta=3,this.reduceTileLevelDifferences=!0}};t([i()],a.prototype,"lodBias",void 0),t([i()],a.prototype,"angledSplitBias",void 0),t([i()],a.prototype,"vtlContentZoom",void 0),t([i()],a.prototype,"elevationLevelDelta",void 0),t([i()],a.prototype,"reduceTileLevelDifferences",void 0),a=t([s("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],a);let l=class extends e{constructor(t={}){super(t),this.minimumSplatPixelRadius=1,this.minimumOpacity=1,this.
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{Milliseconds as o}from"../../../core/time.js";import{property as i,subclass as s}from"../../../core/accessorSupport/decorators.js";let r=class extends e{constructor(t={}){super(t),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};t([i()],r.prototype,"maxTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxNumberOfDrawCalls",void 0),t([i()],r.prototype,"maxTotalNumberOfVertices",void 0),t([i()],r.prototype,"snapshotAvailable",void 0),t([i()],r.prototype,"polygonLodFactor",void 0),t([i()],r.prototype,"polylineLodFactor",void 0),t([i()],r.prototype,"skipHighSymbolLods",void 0),r=t([s("esri.views.3d.support.QualitySettings.Graphics3DSettings")],r);let p=class extends e{constructor(t={}){super(t),this.objectLoDFactor=1,this.pointLoDFactor=1,this.meshLoDFactor=1,this.pointCloudLoDFactor=1}};t([i()],p.prototype,"objectLoDFactor",void 0),t([i()],p.prototype,"pointLoDFactor",void 0),t([i()],p.prototype,"meshLoDFactor",void 0),t([i()],p.prototype,"pointCloudLoDFactor",void 0),p=t([s("esri.views.3d.support.QualitySettings.SceneServiceSettings")],p);let a=class extends e{constructor(t={}){super(t),this.lodBias=0,this.angledSplitBias=1,this.vtlContentZoom=1,this.elevationLevelDelta=3,this.reduceTileLevelDifferences=!0}};t([i()],a.prototype,"lodBias",void 0),t([i()],a.prototype,"angledSplitBias",void 0),t([i()],a.prototype,"vtlContentZoom",void 0),t([i()],a.prototype,"elevationLevelDelta",void 0),t([i()],a.prototype,"reduceTileLevelDifferences",void 0),a=t([s("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],a);let l=class extends e{constructor(t={}){super(t),this.minimumSplatPixelRadius=1,this.minimumOpacity=1,this.maximumNumberOfGaussians=8e6}};t([i()],l.prototype,"minimumSplatPixelRadius",void 0),t([i()],l.prototype,"minimumOpacity",void 0),t([i()],l.prototype,"maximumNumberOfGaussians",void 0),l=t([s("esri.views.3d.support.QualitySettings.GaussianSplatSettings")],l);let d=class extends e{constructor(t={}){super(t),this.pixelRatio=1}};t([i()],d.prototype,"pixelRatio",void 0),d=t([s("esri.views.3d.support.QualitySettings.HeatmapSettings")],d);let n=class extends e{constructor(){super(...arguments),this.maxTotalNumberOfStreamlines=1e5,this.maxTracingResolution=2048}};t([i()],n.prototype,"maxTotalNumberOfStreamlines",void 0),t([i()],n.prototype,"maxTracingResolution",void 0),n=t([s("esri.views.3d.support.QualitySettings.FlowSettings")],n);let m=class extends e{constructor(t){super(t),this.graphics3D=new r,this.sceneService=new p,this.tiledSurface=new a,this.gaussianSplat=new l,this.heatmap=new d,this.flow=new n,this.fadeDuration=o(400),this.physicallyBasedRenderingEnabled=!1,this.glow=!1,this.maxTexturePixels=1/0,this.memoryLimit=750,this.additionalCacheMemory=0,this.frameRate=0,this.maximumPixelRatio=1/0}};t([i({type:r})],m.prototype,"graphics3D",void 0),t([i({type:p})],m.prototype,"sceneService",void 0),t([i({type:a})],m.prototype,"tiledSurface",void 0),t([i({type:l})],m.prototype,"gaussianSplat",void 0),t([i({type:d})],m.prototype,"heatmap",void 0),t([i({type:n})],m.prototype,"flow",void 0),t([i()],m.prototype,"fadeDuration",void 0),t([i()],m.prototype,"physicallyBasedRenderingEnabled",void 0),t([i()],m.prototype,"glow",void 0),t([i()],m.prototype,"maxTexturePixels",void 0),t([i()],m.prototype,"memoryLimit",void 0),t([i()],m.prototype,"additionalCacheMemory",void 0),t([i()],m.prototype,"frameRate",void 0),t([i()],m.prototype,"maximumPixelRatio",void 0),m=t([s("esri.views.3d.support.QualitySettings")],m);const u=m;export{u as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{signal as r}from"../../../../core/signal.js";import{n as t}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as i}from"../../../../geometry/support/frustum.js";import{Sphere as n}from"../../../../geometry/support/sphere.js";import{makeScheduleFunction as a}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as o}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as u}from"./GaussianSplatFadeTexture.js";import{GaussianSplatOrderTexture as h}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as d}from"./GaussianSplatTextureAtlas.js";class l{constructor(e){this._updating=r(!1),this._useDeterministicSort=!1,this.visibleGaussians=0,this._visibleGaussianTiles=new Array,this._workerHandle=null,this._isSorting=!1,this._pendingSortTask=!1,this._bufferCapacity=0,this._minimumBoundingSphere=new n,this._cameraDirectionNormalized=s(),this._renderer=e,this._orderTexture=new h(this._renderer.renderingContext),this._fadingTexture=new u(this._renderer.renderingContext),this._textureAtlas=new d(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:t}=this._renderer.view;this._workerHandle=new o(a(t))}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get visibleGaussianTiles(){return this._visibleGaussianTiles}updateGaussianVisibility(e){this._visibleGaussianTiles=e,this.requestSort()}isUpdating(){return this._updating.value}destroy(){this._pendingSortTask=!1,this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){this._updating.value=!0,this._isSorting?this._pendingSortTask=!0:(this._isSorting=!0,this._pendingSortTask=!1,this._sortOnWorker().then(()=>this._handleSortComplete()).catch(()=>this._handleSortComplete()))}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this.requestSort():this._updating.value=!1}_clearBuffersAndTextures(){this._bufferCapacity=0,this._orderTexture.clear(),this._textureAtlas.clear()}_ensureBufferCapacity(r){if(this._bufferCapacity<r){const t=Math.ceil(r*e);this._atlasIndicesBuffer=new Uint32Array(t),this._sortedAtlasIndicesBuffer=new Uint32Array(t),this._distancesBuffer=new Float64Array(t),this._sortOrderBuffer=new Uint32Array(t),this._bufferCapacity=t}}async _sortOnWorker(){if(0===this._visibleGaussianTiles.length)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);this._useDeterministicSort&&this._visibleGaussianTiles.sort((e,r)=>e.obb.centerX-r.obb.centerX||e.obb.centerY-r.obb.centerY||e.obb.centerZ-r.obb.centerZ);let e=this._visibleGaussianTiles.reduce((e,r)=>e+r.gaussianAtlasIndices.length,0);this._ensureBufferCapacity(e),this._textureAtlas.ensureTextureAtlas();const{frustum:r}=this._renderer.camera;t(this._cameraDirectionNormalized,this._renderer.camera.ray.direction);const s=this._cameraDirectionNormalized[0],n=this._cameraDirectionNormalized[1],a=this._cameraDirectionNormalized[2];let o=0;if(this._visibleGaussianTiles.forEach(t=>{const{gaussianAtlasIndices:u,positions:h}=t;if(this._minimumBoundingSphere.center=t.obb.center,this._minimumBoundingSphere.radius=t.obb.radius+t.maxScale,i(r,this._minimumBoundingSphere))for(let e=0;e<u.length;e++){this._atlasIndicesBuffer[o]=u[e];const r=3*e,t=h[r],i=h[r+1],d=h[r+2];this._distancesBuffer[o]=t*s+i*n+d*a,this._sortOrderBuffer[o]=o,o++}else e-=u.length}),0===e)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);const u={distances:this._distancesBuffer,sortOrderIndices:this._sortOrderBuffer,numGaussians:e,preciseSort:this._useDeterministicSort};await(this._workerHandle?.sort(u).then(r=>{this._distancesBuffer=r.distances,this._sortOrderBuffer=r.sortedOrderIndices;const t=this._sortedAtlasIndicesBuffer.subarray(0,e);for(let
|
|
5
|
+
import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{signal as r}from"../../../../core/signal.js";import{n as t}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as i}from"../../../../geometry/support/frustum.js";import{Sphere as n}from"../../../../geometry/support/sphere.js";import{makeScheduleFunction as a}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as o}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as u}from"./GaussianSplatFadeTexture.js";import{GaussianSplatOrderTexture as h}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as d}from"./GaussianSplatTextureAtlas.js";class l{constructor(e){this._updating=r(!1),this._useDeterministicSort=!1,this.visibleGaussians=0,this._visibleGaussianTiles=new Array,this._workerHandle=null,this._isSorting=!1,this._pendingSortTask=!1,this._bufferCapacity=0,this._minimumBoundingSphere=new n,this._cameraDirectionNormalized=s(),this._renderer=e,this._orderTexture=new h(this._renderer.renderingContext),this._fadingTexture=new u(this._renderer.renderingContext),this._textureAtlas=new d(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:t}=this._renderer.view;this._workerHandle=new o(a(t))}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get visibleGaussianTiles(){return this._visibleGaussianTiles}updateGaussianVisibility(e){this._visibleGaussianTiles=e,this.requestSort()}isUpdating(){return this._updating.value}destroy(){this._pendingSortTask=!1,this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){this._updating.value=!0,this._isSorting?this._pendingSortTask=!0:(this._isSorting=!0,this._pendingSortTask=!1,this._sortOnWorker().then(()=>this._handleSortComplete()).catch(()=>this._handleSortComplete()))}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this.requestSort():this._updating.value=!1}_clearBuffersAndTextures(){this._bufferCapacity=0,this._orderTexture.clear(),this._textureAtlas.clear()}_ensureBufferCapacity(r){if(this._bufferCapacity<r){const t=Math.ceil(r*e);this._atlasIndicesBuffer=new Uint32Array(t),this._sortedAtlasIndicesBuffer=new Uint32Array(t),this._distancesBuffer=new Float64Array(t),this._sortOrderBuffer=new Uint32Array(t),this._bufferCapacity=t}}async _sortOnWorker(){if(0===this._visibleGaussianTiles.length)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);this._useDeterministicSort&&this._visibleGaussianTiles.sort((e,r)=>e.obb.centerX-r.obb.centerX||e.obb.centerY-r.obb.centerY||e.obb.centerZ-r.obb.centerZ);let e=this._visibleGaussianTiles.reduce((e,r)=>e+r.gaussianAtlasIndices.length,0);this._ensureBufferCapacity(e),this._textureAtlas.ensureTextureAtlas();const{frustum:r}=this._renderer.camera;t(this._cameraDirectionNormalized,this._renderer.camera.ray.direction);const s=this._cameraDirectionNormalized[0],n=this._cameraDirectionNormalized[1],a=this._cameraDirectionNormalized[2];let o=0;if(this._visibleGaussianTiles.forEach(t=>{const{gaussianAtlasIndices:u,positions:h}=t;if(this._minimumBoundingSphere.center=t.obb.center,this._minimumBoundingSphere.radius=t.obb.radius+t.maxScale,i(r,this._minimumBoundingSphere))for(let e=0;e<u.length;e++){this._atlasIndicesBuffer[o]=u[e];const r=3*e,t=h[r],i=h[r+1],d=h[r+2];this._distancesBuffer[o]=t*s+i*n+d*a,this._sortOrderBuffer[o]=o,o++}else e-=u.length}),0===e)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);const u={distances:this._distancesBuffer,sortOrderIndices:this._sortOrderBuffer,numGaussians:e,preciseSort:this._useDeterministicSort};await(this._workerHandle?.sort(u).then(r=>{this._distancesBuffer=r.distances,this._sortOrderBuffer=r.sortedOrderIndices;const t=this._sortedAtlasIndicesBuffer.subarray(0,e);for(let s=0;s<e;s++)t[s]=this._atlasIndicesBuffer[r.sortedOrderIndices[s]];this._orderTexture.setData(t,e),this.visibleGaussians=e,this._renderer.requestRender(1)}))}set useDeterministicSort(e){this._useDeterministicSort=e}}export{l as GaussianSplatDataStore};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import r from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import{PixelType as i,SizedPixelFormat as s}from"../../../webgl/enums.js";import"../../../webgl/Util.js";import{
|
|
5
|
+
import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import r from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import{PixelType as i,SizedPixelFormat as s}from"../../../webgl/enums.js";import"../../../webgl/Util.js";import{initialSplatAtlasTexturePages as a}from"./GaussianSplatAtlasPages.js";import{TextureDescriptor as o}from"../../../webgl/TextureDescriptor.js";class u{constructor(e){this.texture=null,this._fadeTextureCapacity=0,this._rctx=e}ensureCapacity(t){if(this._fadeTextureCapacity>t)return;const u=Math.max(Math.ceil(t*e),a),[f,p]=this._evalTextureSize(u),c=f*p,h=this._fadeBuffer,m=new Uint8Array(c);h&&m.set(h.subarray(0,this._fadeTextureCapacity)),this._fadeBuffer=m,this._fadeTextureCapacity=c,this.texture?.dispose();const l=new o;l.width=f,l.height=p,l.pixelFormat=36244,l.dataType=i.UNSIGNED_BYTE,l.internalFormat=s.R8UI,l.unpackAlignment=1,l.wrapMode=33071,l.samplingMode=9728,l.isImmutable=!0,this.texture=new r(this._rctx,l)}updateTexture(e){this.ensureCapacity(e);const t=this.texture.descriptor.width,r=Math.ceil(e/t),i=t*r;this.texture.updateData(0,0,0,t,r,this._fadeBuffer.subarray(0,i))}updateBuffer(e,t){this.ensureCapacity(t+1),this._fadeBuffer&&(this._fadeBuffer[t]=e)}destroy(){this.texture?.dispose()}_evalTextureSize(e){const r=Math.ceil(Math.sqrt(e)),i=Math.ceil(e/r);return t(r,i)}}export{u as GaussianSplatFadeTexture};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class
|
|
5
|
+
class t{constructor(t,o){this.position=t,this.rotationScale=o}}export{t as Transform};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{glsl as o}from"../../shaderModules/glsl.js";const s=o`vec4(0.0, 0.0, 2.0, 1.0)`;export{s as positionOutsideClipSpace};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as s,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{e as r,b as n,j as o,q as l,g as h,D as u,d as p,K as c}from"../../../../chunks/vec32.js";import{create as d,clone as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as _}from"../../../../chunks/vec42.js";import{create as f}from"../../../../geometry/support/plane.js";import{fromPoints as g}from"../../../../geometry/support/ray.js";import{Sphere as b}from"../../../../geometry/support/sphere.js";import{RenderCategory as P}from"../../webgl.js";import{GaussianSplatTarget as C}from"../../layers/i3s/Intersector.js";import{GaussianSplatDataStore as S}from"../../support/gaussianSplatting/GaussianSplatDataStore.js";import x from"../../webgl/RenderNode.js";import{IntersectorResult as w}from"./IntersectorResult.js";import{G as v}from"../../../../chunks/GaussianSplat.glsl.js";import{GaussianSplatColorTechnique as y}from"../shaders/GaussianSplatColorTechnique.js";import{G as D}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as T}from"../shaders/GaussianSplatCompositionTechnique.js";import{G as q}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as A}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatDepthTechnique as E}from"../shaders/GaussianSplatDepthTechnique.js";import{GaussianSplatTechnique as G}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as O}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{DepthStencilAttachment as j,ColorAttachment1 as F,PrimitiveType as N}from"../../../webgl/enums.js";var I;let H=class extends x{static{I=this}constructor(e){super(e),this.gaussianPosition=d(),this.intersectionRayDir=d(),this.intersectionPlane=f(),this._slicePlaneEnabled=!1,this._data=null,this.produces=P.OPAQUE,this.type=0,this.isGround=!1,this.layerViewUid="",this._passParameters=new v,this._compositionPassParameters=new D,this._depthCompositionPassParameters=new q,this._previousCameraPosition=d(),this._previousCameraDirection=d(),this.fadeHelper=null,this._configuration=new O(e.view.state.isGlobal),this._colorOnlyConfiguration=new O(e.view.state.isGlobal,!0),this._depthOnlyConfiguration=new O(e.view.state.isGlobal,!1,!0)}async initialize(){this._data=new S(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this),this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange())])}precompile(){const e=this.view.qualitySettings.gaussianSplat.minimumOpacity,t=this.bindParameters.terrainDepthTest,s=this.fadeHelper.fadingEnabled,i=s=>{s.alphaCutoff=e,s.terrainDepthTest=t};this.renderingContext.capabilities.drawBuffersIndexed?(i(this._configuration),this._configuration.fadingEnabled=s,this.techniques.precompile(G,this._configuration)):(i(this._colorOnlyConfiguration),this._colorOnlyConfiguration.fadingEnabled=s,this.techniques.precompile(y,this._colorOnlyConfiguration),i(this._depthOnlyConfiguration),this.techniques.precompile(E,this._depthOnlyConfiguration)),this.techniques.precompile(T),this.techniques.precompile(A)}render(e){const t=e.find(({name:e})=>e===P.OPAQUE);if(this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return t;const s=!!this.renderingContext.capabilities.drawBuffersIndexed,i=s?this.techniques.get(G,this._configuration):null,a=s?null:this.techniques.get(y,this._colorOnlyConfiguration),r=s?null:this.techniques.get(E,this._depthOnlyConfiguration),n=this.techniques.get(T),o=this.techniques.get(A);if(!(i?.compiled||a?.compiled&&r?.compiled)||!o.compiled||!n.compiled)return this.requestRender(1),t;const{fullWidth:l,fullHeight:h}=this.bindParameters.camera;this._prepareParameters(h,l);const u=this.renderingContext,p=this.fboCache,c=p.acquire(l,h,"gaussian color output"),d=t.getAttachment(j);c.attachDepth(d);let m=null;s?this._singlePass(c,i):m=this._multiPass(c,d,a,r);const _=p.acquire(l,h,this.produces);return this._depthCompositionPassParameters.splatDepth=m?m.getTexture():c.getTexture(F),_.attachDepth(t.getAttachment(j)),u.bindFramebuffer(_.fbo),u.bindTechnique(o,this.bindParameters,this._depthCompositionPassParameters),u.screen.draw(),this._compositionPassParameters.color=t.getTexture(),this._compositionPassParameters.splatColor=c.getTexture(),u.bindFramebuffer(_.fbo),u.bindTechnique(n,this.bindParameters,this._compositionPassParameters),u.screen.draw(),c.release(),m?.release(),_}intersect(e,t,s,i){const{gaussianPosition:a,intersectionRayDir:p,intersectionPlane:c,layerViewUid:f}=this,P=g(s,i);r(p,i,s);const S=1/n(p);o(p,p,S);const x=d();l(x,p),_(c,p[0],p[1],p[2],-h(p,s));const v=new U,y=new U,D=new Array;this._data.visibleGaussianTiles.forEach(r=>{const{maxScale:n}=r,o=r.obb.minimumDistancePlane(c),l=r.obb.maximumDistancePlane(c),d=l<0,_=null!=v.dist&&null!=y.dist&&v.dist<o*S&&y.dist>l*S;if(d||_)return;if(!new b(r.obb.center,r.obb.radius+n).intersectRay(P,null))return;if(!r.obb.intersectRay(s,p,n))return;const{positions:g,squaredScales:C,gaussianAtlasIndices:w}=r,T=w.length;for(let c=0;c<T;c++){const r=3*c;a[0]=g[r]-s[0],a[1]=g[r+1]-s[1],a[2]=g[r+2]-s[2];const n=C[c],o=h(a,p),l=o*o;if(u(a)-l>n)continue;const d=o*S,_=e=>(e.point=e.point?e.point.fill(a[0],a[1],a[2]):m(a),e.dist=d,e.normal=x,e.layerViewUid=f,e);if((null==v.dist||d<v.dist)&&(null==t||t(s,i,d))&&_(v),0!==e.options.store&&(null==y.dist||d>y.dist)&&(null==t||t(s,i,d))&&_(y),2===e.options.store&&(null==t||t(s,i,d))){const e=new U;D.push(_(e))}}});const T=(e,t)=>{const{layerViewUid:s}=t,i=new C(t.point,s);e.set(0,i,t.dist,t.normal)};if(R(v)){const t=e.results.min;(null==t.distance||v.dist<t.distance)&&T(t,v)}if(R(y)&&0!==e.options.store){const t=e.results.max;(null==t.distance||y.dist>t.distance)&&T(t,y)}if(2===e.options.store)for(const r of D){const t=new w(P);T(t,r),e.results.all.push(t)}}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}get data(){return this._data}destroy(){this._data.destroy(),super.destroy()}_onCameraChange(){const e=this.view.state.camera.eye,t=this.view.state.camera.ray.direction,s=.001;(Math.abs(e[0]-this._previousCameraPosition[0])>s||Math.abs(e[1]-this._previousCameraPosition[1])>s||Math.abs(e[2]-this._previousCameraPosition[2])>s||Math.abs(t[0]-this._previousCameraDirection[0])>s||Math.abs(t[1]-this._previousCameraDirection[1])>s||Math.abs(t[2]-this._previousCameraDirection[2])>s)&&(p(this._previousCameraPosition,e),p(this._previousCameraDirection,t),this._data.requestSort())}_prepareParameters(e,t){this._passParameters.totalGaussians=this._data.visibleGaussians,this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture;const s=Math.tan(.5*this.camera.fovY),i=s/e*t;a(this._passParameters.tanFov,i,s),this._passParameters.focalLength=e/(2*s);const r=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius;this._passParameters.minSplatRadius=r*Math.sqrt(t*e)/Math.sqrt(2073600),this._prepareHighPrecisionCameraPosition()}_singlePass(e,t){const s=this.renderingContext,i=this.renderingContext.gl,a=this.renderingContext.capabilities.drawBuffersIndexed;e.acquireColor(F,this._getDepthTextureFormat(),"gaussian depth output"),s.bindFramebuffer(e.fbo),s.setClearColor(0,0,0,0),s.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),a.enableiOES(i.BLEND,0),a.blendEquationSeparateiOES(0,i.FUNC_ADD,i.FUNC_ADD),a.blendFuncSeparateiOES(0,i.ONE_MINUS_DST_ALPHA,i.ONE,i.ONE_MINUS_DST_ALPHA,i.ONE),a.enableiOES(i.BLEND,1),a.blendEquationSeparateiOES(1,i.FUNC_ADD,i.FUNC_ADD),a.blendFuncSeparateiOES(1,i.ONE_MINUS_DST_ALPHA,i.DST_ALPHA,i.ONE_MINUS_DST_ALPHA,i.ONE),this.renderingContext.drawArraysInstanced(N.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_multiPass(e,t,s,i){const{fullWidth:a,fullHeight:r}=this.bindParameters.camera,n=this.renderingContext;n.bindFramebuffer(e.fbo),n.setClearColor(0,0,0,0),n.clear(16384),this.renderingContext.bindTechnique(s,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(N.TRIANGLE_STRIP,0,4,this._data.visibleGaussians);const o=this.fboCache.acquire(a,r,"gaussian depth output",this._getDepthTextureFormat());return o.attachDepth(t),n.bindFramebuffer(o.fbo),n.setClearColor(0,0,0,0),n.clear(16384),this.renderingContext.bindTechnique(i,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(N.TRIANGLE_STRIP,0,4,this._data.visibleGaussians),o}_prepareHighPrecisionCameraPosition(){o(this._passParameters.tileCameraPosition,this.camera.eye,1/I.tileSize),c(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),o(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,I.tileSize),r(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this.fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const e=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this.fadeHelper.updateAllTileFading(e),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}_getDepthTextureFormat(){return this.renderingContext.capabilities.colorBufferFloat?.floatBlend?9:8}static{this.tileSize=2.048}};function R(e){return null!=e.dist&&null!=e.point}e([s({constructOnly:!0})],H.prototype,"fadeHelper",void 0),H=I=e([i("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],H);class U{constructor(){this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}export{H as GaussianSplatRenderNode};
|
|
5
|
+
import{__decorate as t}from"tslib";import{watch as e}from"../../../../core/reactiveUtils.js";import{property as s,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{e as r,b as n,j as o,q as l,g as h,D as m,d as p,K as u}from"../../../../chunks/vec32.js";import{create as c,clone as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as f}from"../../../../chunks/vec42.js";import{create as _}from"../../../../geometry/support/plane.js";import{fromPoints as g}from"../../../../geometry/support/ray.js";import{Sphere as P}from"../../../../geometry/support/sphere.js";import{RenderCategory as b}from"../../webgl.js";import{GaussianSplatTarget as C}from"../../layers/i3s/Intersector.js";import{GaussianSplatDataStore as v}from"../../support/gaussianSplatting/GaussianSplatDataStore.js";import w from"../../webgl/RenderNode.js";import{IntersectorResult as x}from"./IntersectorResult.js";import{G as y}from"../../../../chunks/GaussianSplat.glsl.js";import{G as S}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as q}from"../shaders/GaussianSplatCompositionTechnique.js";import{G as j}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as D}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatTechnique as T}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as G}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{DepthStencilAttachment as A,ColorAttachment1 as F,PrimitiveType as R}from"../../../webgl/enums.js";var E;let H=class extends w{static{E=this}constructor(t){super(t),this.gaussianPosition=c(),this.intersectionRayDir=c(),this.intersectionPlane=_(),this._slicePlaneEnabled=!1,this._data=null,this.produces=b.OPAQUE,this.type=0,this.isGround=!1,this.layerViewUid="",this._passParameters=new y,this._compositionPassParameters=new S,this._depthCompositionPassParameters=new j,this._previousCameraPosition=c(),this._previousCameraDirection=c(),this.fadeHelper=null,this._configuration=new G(t.view.state.isGlobal)}async initialize(){this._data=new v(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this),this.addHandles([e(()=>this.view.state.camera,()=>this._onCameraChange())])}precompile(){this._configuration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._configuration.terrainDepthTest=this.bindParameters.terrainDepthTest,this._configuration.fadingEnabled=this.fadeHelper.fadingEnabled,this.techniques.precompile(T,this._configuration),this.techniques.precompile(q),this.techniques.precompile(D)}render(t){const e=t.find(({name:t})=>t===b.OPAQUE);if(this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return e;const s=this.techniques.get(T,this._configuration),i=this.techniques.get(q),a=this.techniques.get(D);if(!s.compiled||!a.compiled||!i.compiled)return this.requestRender(1),e;const{fullWidth:r,fullHeight:n}=this.bindParameters.camera;this._prepareParameters(n,r);const o=this.renderingContext,l=this.fboCache,h=l.acquire(r,n,"gaussian color output"),m=e.getAttachment(A);h.attachDepth(m),this._renderGaussianColorAndDepth(h,s);const p=l.acquire(r,n,this.produces);return this._depthCompositionPassParameters.splatDepth=h.getTexture(F),p.attachDepth(e.getAttachment(A)),o.bindFramebuffer(p.fbo),o.bindTechnique(a,this.bindParameters,this._depthCompositionPassParameters),o.screen.draw(),this._compositionPassParameters.color=e.getTexture(),this._compositionPassParameters.splatColor=h.getTexture(),o.bindFramebuffer(p.fbo),o.bindTechnique(i,this.bindParameters,this._compositionPassParameters),o.screen.draw(),h.release(),p}intersect(t,e,s,i){const{gaussianPosition:a,intersectionRayDir:p,intersectionPlane:u,layerViewUid:_}=this,b=g(s,i);r(p,i,s);const v=1/n(p);o(p,p,v);const w=c();l(w,p),f(u,p[0],p[1],p[2],-h(p,s));const y=new I,S=new I,q=new Array;this._data.visibleGaussianTiles.forEach(r=>{const{maxScale:n}=r,o=r.obb.minimumDistancePlane(u),l=r.obb.maximumDistancePlane(u),c=l<0,f=null!=y.dist&&null!=S.dist&&y.dist<o*v&&S.dist>l*v;if(c||f)return;if(!new P(r.obb.center,r.obb.radius+n).intersectRay(b,null))return;if(!r.obb.intersectRay(s,p,n))return;const{positions:g,squaredScales:C,gaussianAtlasIndices:x}=r,j=x.length;for(let u=0;u<j;u++){const r=3*u;a[0]=g[r]-s[0],a[1]=g[r+1]-s[1],a[2]=g[r+2]-s[2];const n=C[u],o=h(a,p),l=o*o;if(m(a)-l>n)continue;const c=o*v,f=t=>(t.point=t.point?t.point.fill(a[0],a[1],a[2]):d(a),t.dist=c,t.normal=w,t.layerViewUid=_,t);if((null==y.dist||c<y.dist)&&(null==e||e(s,i,c))&&f(y),0!==t.options.store&&(null==S.dist||c>S.dist)&&(null==e||e(s,i,c))&&f(S),2===t.options.store&&(null==e||e(s,i,c))){const t=new I;q.push(f(t))}}});const j=(t,e)=>{const{layerViewUid:s}=e,i=new C(e.point,s);t.set(0,i,e.dist,e.normal)};if(M(y)){const e=t.results.min;(null==e.distance||y.dist<e.distance)&&j(e,y)}if(M(S)&&0!==t.options.store){const e=t.results.max;(null==e.distance||S.dist>e.distance)&&j(e,S)}if(2===t.options.store)for(const r of q){const e=new x(b);j(e,r),t.results.all.push(e)}}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(t){this._slicePlaneEnabled!==t&&(this._slicePlaneEnabled=t,this.requestRender(1))}get data(){return this._data}destroy(){this._data.destroy(),super.destroy()}_onCameraChange(){const t=this.view.state.camera.eye,e=this.view.state.camera.ray.direction,s=.001;(Math.abs(t[0]-this._previousCameraPosition[0])>s||Math.abs(t[1]-this._previousCameraPosition[1])>s||Math.abs(t[2]-this._previousCameraPosition[2])>s||Math.abs(e[0]-this._previousCameraDirection[0])>s||Math.abs(e[1]-this._previousCameraDirection[1])>s||Math.abs(e[2]-this._previousCameraDirection[2])>s)&&(p(this._previousCameraPosition,t),p(this._previousCameraDirection,e),this._data.requestSort())}_prepareParameters(t,e){this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture;const s=Math.tan(.5*this.camera.fovY),i=s/t*e;a(this._passParameters.tanFov,i,s),this._passParameters.focalLength=t/(2*s);const r=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius;this._passParameters.minSplatRadius=r*Math.sqrt(e*t)/Math.sqrt(2073600),this._prepareHighPrecisionCameraPosition()}_renderGaussianColorAndDepth(t,e){const s=this.renderingContext;t.acquireColor(F,8,"gaussian depth output"),s.bindFramebuffer(t.fbo),s.setClearColor(0,0,0,0),s.clear(16384),this.renderingContext.bindTechnique(e,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(R.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_prepareHighPrecisionCameraPosition(){o(this._passParameters.tileCameraPosition,this.camera.eye,1/E.tileSize),u(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),o(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,E.tileSize),r(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this.fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const t=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this.fadeHelper.updateAllTileFading(t),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};function M(t){return null!=t.dist&&null!=t.point}t([s({constructOnly:!0})],H.prototype,"fadeHelper",void 0),H=E=t([i("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],H);class I{constructor(){this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}export{H as GaussianSplatRenderNode};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{copy as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{applyToViewMatrix as r}from"./localOriginHelper.js";class e{constructor(i){this._factory=i,this._originData=new Map}acquire(i){return this.register(this._factory.getOrigin(i))}register(i){const t=this._originData.get(i.id)||new o(i);return t.refCount++,this._originData.has(t.origin.id)||this._originData.set(t.origin.id,t),t}release(i){i
|
|
5
|
+
import{copy as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{applyToViewMatrix as r}from"./localOriginHelper.js";class e{constructor(i){this._factory=i,this._originData=new Map}acquire(i){return this.register(this._factory.getOrigin(i))}register(i){const t=this._originData.get(i.id)||new o(i);return t.refCount++,this._originData.has(t.origin.id)||this._originData.set(t.origin.id,t),t}release(i){i.refCount--,0===i.refCount&&this._originData.delete(i.origin.id)}updateViewMatrices(t){this._originData.forEach(e=>{i(e.viewMatrix,t),r(e.origin.vec3,e.viewMatrix)})}}class o{constructor(i){this.origin=i,this.refCount=0,this.viewMatrix=t()}}export{e as LocalOriginManager,o as OriginData};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../core/PooledArray.js";import{transpose as r,invert as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{h as i}from"../../../../../chunks/vec32.js";import{debugFlags as a}from"../../../support/debugFlags.js";import{TwoVectorPosition as o}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as n}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as l}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as d}from"./EdgeShaderTechniqueConfiguration.js";import{
|
|
5
|
+
import e from"../../../../../core/PooledArray.js";import{transpose as r,invert as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{h as i}from"../../../../../chunks/vec32.js";import{debugFlags as a}from"../../../support/debugFlags.js";import{TwoVectorPosition as o}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as n}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as l}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as d}from"./EdgeShaderTechniqueConfiguration.js";import{isLegacyTransform as h}from"./LegacyTransform.js";import{PrimitiveType as c}from"../../../../webgl/enums.js";const m=8,_=128,g={type:0,hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0};class f{constructor(r,t,s){this.rctx=r,this._techniques=t,this._configuration=new d,this.refCount=0,this._renderables=new Set,this._sortedRenderables={0:{0:new e,1:new e},1:{0:new e,1:new e}},this._renderablesDirty=!1,this._drawParameters=new n,this._settings={...g,...s},this.key=f.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const i=this._settings.strokesTexture.variants;this.writerSettings={variants:i,reducedPrecision:a.TESTS_DISABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.type=this._settings.type,this._configuration.silhouette=!1,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.spherical=s.spherical}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){this._renderablesDirty&&this._sortRenderables();const t=this._sortedRenderables[r];t[0].forAll(e),t[1].forAll(e)}acquireTechnique(e,r){return this._lastOriginId=null,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.silhouette=r,this._techniques.get(l,this._configuration)}renderRegularEdges(e,r,t,s,i){this._render(e,r,r.regular.vao,t,s,i)}renderSilhouetteEdges(e,r,t,s,i){this._render(e,r,r.silhouette.vao,t,s,i)}_render(e,r,t,s,i,a){a>0&&(this._bindDraw(e,r,s,i),this.rctx.bindVAO(t),this.rctx.drawArraysInstanced(c.TRIANGLE_FAN,0,4,a))}_bindDraw(e,s,a,n){if(this._drawParameters.componentDataTextureBuffer=s.components.buffer.textureBuffer,this._drawParameters.strokesTexture=this._settings.strokesTexture,h(s.transform)){const{origin:r}=s.transform,t=r.origin.id;this._lastOriginId!==t&&(e.setUniformMatrix4fv("localView",r.viewMatrix),this._lastOriginId=t),e.setUniformMatrix4fv("model",s.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=r.origin.vec3}else{const e=new o(s.transform.position),a=r(u,t(u,s.transform.rotationScale));this._drawParameters.transformWorldFromModelTL=e.low,this._drawParameters.transformWorldFromModelTH=e.high,this._drawParameters.transformWorldFromModelRS=s.transform.rotationScale,this._drawParameters.transformNormalGlobalFromModel=a;const l=n.camera.viewInverseTransposeMatrix;i(this._drawParameters.slicePlaneLocalOrigin,l[3],l[7],l[11])}e.bindDraw(n,a,this._drawParameters)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[0][0].clear(),this._sortedRenderables[0][1].clear(),this._sortedRenderables[1][0].clear(),this._sortedRenderables[1][1].clear(),this._renderables.forEach(e=>this._sortedRenderables[e.objectTransparency][e.edgeTransparency].push(e));const e=(e,r)=>h(e.transform)?h(r.transform)?e.transform.origin.origin.id<r.transform.origin.origin.id?-1:e.transform.origin.origin.id>r.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[0][0].sort(e),this._sortedRenderables[0][1].sort(e),this._sortedRenderables[1][0].sort(e),this._sortedRenderables[1][1].sort(e)}static getKey(e,r,t){return`edges-t:${e}:${r}:${t}`}}const u=s();export{f as EdgeRenderer,_ as extensionLengthOffset,m as lineWidthFractionFactor};
|