@arcgis/core 6.0.0-next.40 → 6.0.0-next.41
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/Camera.js +1 -1
- package/applications/Components/arcadeFeatureUtils.d.ts +12 -0
- package/applications/Components/arcadeFeatureUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00d43f02119167531d1b.js +1 -0
- package/assets/esri/core/workers/chunks/059cda6f11a91dbc9e28.js +1 -0
- package/assets/esri/core/workers/chunks/{1c406ab2bf99ac563316.js → 0696fa44a04b99738d7b.js} +1 -1
- package/assets/esri/core/workers/chunks/073f0232135f71b6c7a5.js +1 -0
- package/assets/esri/core/workers/chunks/098ac10877d92fde1006.js +1 -0
- package/assets/esri/core/workers/chunks/0a29d87b6e58a3c6df8f.js +1 -0
- package/assets/esri/core/workers/chunks/0bf43d80cb40c2b43333.js +1 -0
- package/assets/esri/core/workers/chunks/0d04353843ccb7440342.js +1 -0
- package/assets/esri/core/workers/chunks/1866f832e5f52958bc97.js +1 -0
- package/assets/esri/core/workers/chunks/19e51cbb354954ddafbd.js +1 -0
- package/assets/esri/core/workers/chunks/1c7096eb48a3a7f27d4f.js +1 -0
- package/assets/esri/core/workers/chunks/1cc03067f8405285057c.js +1 -0
- package/assets/esri/core/workers/chunks/23f3692c7426173e8352.js +1 -0
- package/assets/esri/core/workers/chunks/24bdeafbb16ae83bb8c3.js +1 -0
- package/assets/esri/core/workers/chunks/2b27d3bc492e000bbe58.js +1 -0
- package/assets/esri/core/workers/chunks/2d64a13c2303e9cae613.js +1 -0
- package/assets/esri/core/workers/chunks/2dfe6af28cd1b29d5ebc.js +1 -0
- package/assets/esri/core/workers/chunks/2e760d04641755d1820d.js +1 -0
- package/assets/esri/core/workers/chunks/{0b21d0e2e5a91c34a108.js → 2f54e4feb554c1a7b9c4.js} +1 -1
- package/assets/esri/core/workers/chunks/305eeaac0b4d5b79ebde.js +1 -0
- package/assets/esri/core/workers/chunks/353976c812ebf0c98549.js +1 -0
- package/assets/esri/core/workers/chunks/45aaefbdffe5e15dfb24.js +1 -0
- package/assets/esri/core/workers/chunks/{592b5db1459c02cf6a0c.js → 46504fc81f357bc7465a.js} +1 -1
- package/assets/esri/core/workers/chunks/4caebb64a365da18453f.js +1 -0
- package/assets/esri/core/workers/chunks/{2fcd7db1e192858a650e.js → 503ee206e7de1f65e291.js} +1 -1
- package/assets/esri/core/workers/chunks/{76e80381fa6d1e084796.js → 54de7dc0597fc80d7a52.js} +1 -1
- package/assets/esri/core/workers/chunks/55c0c074e4afe05f5d4d.js +1 -0
- package/assets/esri/core/workers/chunks/598ba405e93ebccf7b2d.js +1 -0
- package/assets/esri/core/workers/chunks/5bfb962ca192f90a2724.js +1 -0
- package/assets/esri/core/workers/chunks/6699fac01ccd842851ba.js +1 -0
- package/assets/esri/core/workers/chunks/672a5390182b20d632be.js +1 -0
- package/assets/esri/core/workers/chunks/{00311d1b18d5952a014b.js → 6738b3d6bce34a1e8be2.js} +1 -1
- package/assets/esri/core/workers/chunks/67c2e5953087dadfd245.js +1 -0
- package/assets/esri/core/workers/chunks/67caef2ecf0dc5f2eed3.js +1 -0
- package/assets/esri/core/workers/chunks/68fd7b314377d27aaa54.js +1 -0
- package/assets/esri/core/workers/chunks/6d863761f29f31a030eb.js +1 -0
- package/assets/esri/core/workers/chunks/{ce8ef2eec290e1df6b2a.js → 7390af96250e89194332.js} +1 -1
- package/assets/esri/core/workers/chunks/7452b5ae971a9ff2e6e9.js +1 -0
- package/assets/esri/core/workers/chunks/7672c123cfb960f4ddad.js +1 -0
- package/assets/esri/core/workers/chunks/{9934e8e19f94e9169eea.js → 776b64a1e1a57878c34c.js} +1 -1
- package/assets/esri/core/workers/chunks/{58716a3a6106a1b0fb9d.js → 832c887fdc5af4c08cf2.js} +1 -1
- package/assets/esri/core/workers/chunks/84fb27e3425515cd0e3f.js +1 -0
- package/assets/esri/core/workers/chunks/8b0be232723424dda320.js +1 -0
- package/assets/esri/core/workers/chunks/{7023651ed6398dcf8efb.js → 8b0efcc30184593a0812.js} +21 -21
- package/assets/esri/core/workers/chunks/8b38fad017c4c0d9e1ec.js +1 -0
- package/assets/esri/core/workers/chunks/{b2d6b1ac9fbb50c7c8ab.js → 929ca32ddbb43328ef31.js} +1 -1
- package/assets/esri/core/workers/chunks/98958203a5ca45b24d72.js +1 -0
- package/assets/esri/core/workers/chunks/a03f15f2cbc3fed291c2.js +1 -0
- package/assets/esri/core/workers/chunks/{22e73501e1435a896826.js → a5f17e9a025ac2b6e1bf.js} +1 -1
- package/assets/esri/core/workers/chunks/a6e846361bf5dd3a11c7.js +1 -0
- package/assets/esri/core/workers/chunks/af2087b75225d7d7dbd8.js +1 -0
- package/assets/esri/core/workers/chunks/afe3e89737fb45189a99.js +1 -0
- package/assets/esri/core/workers/chunks/b18459c1bed75dbdec08.js +1 -0
- package/assets/esri/core/workers/chunks/{f07fb9b3fa30d7ee1681.js → b386e921c273de3ac7a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{d03b82e962c70a3fd377.js → b4928831a2a13b2da745.js} +1 -1
- package/assets/esri/core/workers/chunks/b7205620ca248f4efc88.js +1 -0
- package/assets/esri/core/workers/chunks/{dae2036faa28dade2119.js → beccbfff549902733c4e.js} +1 -1
- package/assets/esri/core/workers/chunks/c5364ff8dd1358af3603.js +1 -0
- package/assets/esri/core/workers/chunks/{9e2c30b67bab5795306e.js → cb2329d1ea72ce5cc057.js} +1 -1
- package/assets/esri/core/workers/chunks/cd46d9b4a8de644e7332.js +1 -0
- package/assets/esri/core/workers/chunks/d0172d31389dbfaaa848.js +1 -0
- package/assets/esri/core/workers/chunks/da1e6962ba0c85c37953.js +1 -0
- package/assets/esri/core/workers/chunks/dff845574c0037a1dca6.js +1 -0
- package/assets/esri/core/workers/chunks/e0864ca82ffa3c9a0776.js +1 -0
- package/assets/esri/core/workers/chunks/e0cf6e1e21d0ee739009.js +1 -0
- package/assets/esri/core/workers/chunks/e69cd62f824ce7a22fa0.js +1 -0
- package/assets/esri/core/workers/chunks/{396299c22994c502e41c.js → efc1a90742813b55602e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9feffb9884cfed52c4b.js → f190a3124d6d03417d73.js} +1 -1
- package/assets/esri/core/workers/chunks/f4135779bfdaf349352a.js +1 -0
- package/assets/esri/core/workers/chunks/f6f5937a1308f28bb959.js +1 -0
- package/assets/esri/core/workers/chunks/fd17c4a9e13bf77aa86a.js +1 -0
- package/assets/esri/core/workers/chunks/fdd2b35388f9fe42b623.js +1 -0
- package/assets/esri/core/workers/chunks/fe24e039385473bf77f9.js +1 -0
- package/chunks/cameraUtilsPlanar.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/config.js +1 -1
- package/core/Accessor.d.ts +1 -1
- package/core/Accessor.js +1 -1
- package/core/accessorSupport/DefaultsStore.js +1 -1
- package/core/accessorSupport/Properties.js +1 -1
- package/core/accessorSupport/Property.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/mat4.js +1 -1
- package/core/workers/workers.js +1 -6
- package/core/workers.d.ts +1 -2
- package/geometry/Extent.js +1 -1
- package/geometry/Geometry.js +1 -1
- package/geometry/Multipoint.js +1 -1
- package/geometry/Point.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/Polyline.js +1 -1
- package/geometry/coordinateFormatter.js +1 -1
- package/geometry/operators/gx/operatorRelate.js +2 -0
- package/geometry/operators/relateOperator.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/kernel.js +1 -1
- package/layers/BaseElevationLayer.js +1 -1
- package/layers/BaseTileLayer.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoRSSLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/OpenStreetMapLayer.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/TileLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/layers/WebTileLayer.js +1 -1
- package/layers/graphics/sources/CSVSource.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/raster/formats/tiffParser.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/GeometryDescriptor.js +1 -1
- package/layers/support/KMLSublayer.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/package.json +3 -3
- package/portal/PortalItem.js +1 -1
- package/rest/query/executePivotQuery.js +1 -1
- package/rest/query/operations/queryPivot.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/PivotQuery.js +1 -1
- package/rest/support/Query.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
- package/symbols/PictureFillSymbol.js +1 -1
- package/symbols/PictureMarkerSymbol.js +1 -1
- package/symbols/SimpleFillSymbol.js +1 -1
- package/symbols/SimpleLineSymbol.js +1 -1
- package/symbols/SimpleMarkerSymbol.js +1 -1
- package/symbols/TextSymbol.js +1 -1
- package/symbols/cim/Rasterizer.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/PaddedViewState.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/WMSLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStateSet.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStates.js +1 -1
- package/views/3d/layers/i3s/Highlights.js +1 -1
- package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
- package/views/3d/layers/support/createFeatureFilterHighlight.js +2 -0
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/layers/support/highlightUtils.js +1 -1
- package/views/3d/layers/support/selectTiles3DSpatialReference.js +2 -0
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/earthUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/createWebGLContext.js +2 -0
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/ribbonLineBufferUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl.d.ts +2 -1
- package/views/3d/webgl.js +1 -1
- package/views/SceneView.d.ts +7 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +3 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/GraphicsLayerView.d.ts +3 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/SceneLayerView.d.ts +3 -2
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/types.d.ts +1 -0
- package/webscene/version.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Attribution.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/Statistics.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureContent.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureFields.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature/support/FeatureElementInfo.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/HistogramRangeSlider.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/SizeRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltip.js +1 -1
- package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Spinner.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList/ListItemPanel.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.js +1 -1
- package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
- package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
- package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ClassedColorSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider.js +1 -1
- package/widgets/smartMapping/OpacitySlider.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/MeasurementWidgetContent.js +1 -1
- package/widgets/support/PluginSettingsControls.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/TimezonePicker.js +1 -1
- package/widgets/support/UnitSelect.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/assets/esri/core/workers/chunks/01803f76bc0d9f2cd566.js +0 -1
- package/assets/esri/core/workers/chunks/02940f7ddaf98e69521e.js +0 -1
- package/assets/esri/core/workers/chunks/07e5482e1fc69be5de09.js +0 -1
- package/assets/esri/core/workers/chunks/0c893837f67829757df7.js +0 -1
- package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +0 -1
- package/assets/esri/core/workers/chunks/1a91443970d64a59521d.js +0 -1
- package/assets/esri/core/workers/chunks/20a2124cbe43e5527c40.js +0 -1
- package/assets/esri/core/workers/chunks/26ea39dfdf887f357fce.js +0 -1
- package/assets/esri/core/workers/chunks/276a0b549acf048e8673.js +0 -1
- package/assets/esri/core/workers/chunks/2c3612379111457c3221.js +0 -1
- package/assets/esri/core/workers/chunks/34467f7d84baffd772a3.js +0 -1
- package/assets/esri/core/workers/chunks/398ec098fffe6abceedd.js +0 -1
- package/assets/esri/core/workers/chunks/3b32a24488b3068f0cb7.js +0 -1
- package/assets/esri/core/workers/chunks/427d929dc7f89b0a1ea9.js +0 -1
- package/assets/esri/core/workers/chunks/432728c557be5dfa26b5.js +0 -1
- package/assets/esri/core/workers/chunks/4c240ca50f70bf30813f.js +0 -1
- package/assets/esri/core/workers/chunks/514cc15acb77dc85035c.js +0 -1
- package/assets/esri/core/workers/chunks/585ae43c7bcb86a26762.js +0 -1
- package/assets/esri/core/workers/chunks/5e48898cebb6dbaf09b5.js +0 -1
- package/assets/esri/core/workers/chunks/5ec5a6cef9ee9a8cc400.js +0 -1
- package/assets/esri/core/workers/chunks/601e1d020b8115497944.js +0 -1
- package/assets/esri/core/workers/chunks/687deb918eb48a963c8f.js +0 -1
- package/assets/esri/core/workers/chunks/6a21dc13a465757ba007.js +0 -1
- package/assets/esri/core/workers/chunks/6e910342ada398c98e30.js +0 -1
- package/assets/esri/core/workers/chunks/78818c2a898444f7e890.js +0 -1
- package/assets/esri/core/workers/chunks/7d2cbc767c336d15e4d5.js +0 -1
- package/assets/esri/core/workers/chunks/7d497df6e13162156342.js +0 -1
- package/assets/esri/core/workers/chunks/7dbf4c7480bf9c72820d.js +0 -1
- package/assets/esri/core/workers/chunks/80c234ee5276ea1645db.js +0 -1
- package/assets/esri/core/workers/chunks/966204d6dedc8149c3e9.js +0 -1
- package/assets/esri/core/workers/chunks/9ab0735e86cf8932bf9d.js +0 -1
- package/assets/esri/core/workers/chunks/a0356702f2d3f787aeac.js +0 -1
- package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +0 -1
- package/assets/esri/core/workers/chunks/ab0ea4042f4e13874aed.js +0 -1
- package/assets/esri/core/workers/chunks/ab98ade3257360015d6c.js +0 -1
- package/assets/esri/core/workers/chunks/b13d8f4e4e80ef00b1bd.js +0 -1
- package/assets/esri/core/workers/chunks/b15a8d4322f3b7819d2f.js +0 -1
- package/assets/esri/core/workers/chunks/b472c0a21ae29e653f7d.js +0 -1
- package/assets/esri/core/workers/chunks/b90271ce38522bcf813b.js +0 -1
- package/assets/esri/core/workers/chunks/ba91df9835cdea7698a9.js +0 -1
- package/assets/esri/core/workers/chunks/bd812dd75d2a3d7d0441.js +0 -1
- package/assets/esri/core/workers/chunks/bfe13ac9fa1aafb190a1.js +0 -1
- package/assets/esri/core/workers/chunks/c1cf3edce15f09648eb4.js +0 -1
- package/assets/esri/core/workers/chunks/c31830ee897d5a7f2582.js +0 -1
- package/assets/esri/core/workers/chunks/c48d97c38e821be17dc5.js +0 -1
- package/assets/esri/core/workers/chunks/c7ad62f54d2abe1d17a0.js +0 -1
- package/assets/esri/core/workers/chunks/cf21b217b13770757cb8.js +0 -1
- package/assets/esri/core/workers/chunks/d42a4f47843e075c56a8.js +0 -1
- package/assets/esri/core/workers/chunks/deb408bee61ca192b2ce.js +0 -1
- package/assets/esri/core/workers/chunks/e121d15b883184ee83e7.js +0 -1
- package/assets/esri/core/workers/chunks/e4042e43f0081fe49f7b.js +0 -1
- package/assets/esri/core/workers/chunks/e932951598499befabf5.js +0 -1
- package/assets/esri/core/workers/chunks/eaab787a5f2445be5e5a.js +0 -1
- package/assets/esri/core/workers/chunks/f06ef153e106b26a6748.js +0 -1
- package/assets/esri/core/workers/chunks/faae3c43048b42341536.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,removeMaybe as r,destroyMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as o,whenOnce as s,initial as c}from"../../../core/reactiveUtils.js";import{unitFromRESTJSON as l,convertUnit as u}from"../../../core/units.js";import{property as d,subclass as f}from"../../../core/accessorSupport/decorators.js";import{getReferenceEllipsoid as p}from"../../../geometry/ellipsoidUtils.js";import m from"../../../geometry/HeightModelInfo.js";import{create as h}from"../../../geometry/support/aaBoundingBox.js";import{isCompatible as g}from"../../../geometry/support/heightModelInfoUtils.js";import{isInEffectiveScaleRange as _}from"../../../geometry/support/scaleUtils.js";import{isPlateCarree as v,isWebMercator as y,equals as b,isGeographic as x}from"../../../geometry/support/spatialReferenceUtils.js";import S from"../../../geometry/support/WKIDUnitConversion.js";import{makeCacheKey as C,getHeightModelInfoFromVCS as w}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as T}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as E}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as D}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as O}from"./LayerView3D.js";import{addLayerViewToWasm as k,getLyr3DWasm as A,removeLayerViewFromWasm as j}from"./Lyr3DWasm.js";import{LayerElevationProvider as M}from"./i3s/LayerElevationProvider.js";import{projectToBoundingBox as N}from"../support/extentUtils.js";import{GaussianSplatDataStore as P}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as F}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as I}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTileBuilder as L}from"../support/gaussianSplatting/GaussianTileBuilder.js";import{GaussianTileLifecycle as R}from"../support/gaussianSplatting/GaussianTileLifecycle.js";import{GaussianSplatDepthRenderer as z}from"../webgl-engine/lib/GaussianSplatDepthRenderer.js";import{GaussianSplatRenderer as B}from"../webgl-engine/lib/GaussianSplatRenderer.js";import{GaussianSplatShadows as V}from"../webgl-engine/lib/GaussianSplatShadows.js";import H from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as U}from"../../support/layerViewUtils.js";import{TaskPriority as W}from"../../support/Scheduler.js";const G=()=>t.getLogger(`esri.views.3d.layers.GaussianSplatLayerView3D`);let K=class extends O(H){constructor(e){super(e),this.type=`gaussian-splat-3d`,this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._renderablesBeingCreated=new Set,this._tileLifecycle=new R(this),this._createRenderableAbortController=new AbortController,this.skipHeightModelInfoValidation=!0,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(W.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;let e=h();return N(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderer?.clippingBox??null}initialize(){let{view:e}=this;this.addHandles([o(()=>e.qualitySettings.fadeDuration,e=>{this.data&&(this.fadeHelper.onFadeDurationChanged(e),this.updateFadingTexture())})]),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;let{signal:t}=this._initializationController;if(await s(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t),!this._canProjectWithoutEngine())throw U(`layer`,this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._wasmLayerId=await k(this,t),a(t),this._renderer=new B({view:e,layerView:this}),this.data=new P(this._renderer,(e,t)=>this._tileLifecycle.onSortComplete(e,t),()=>this._freeInvisibleTiles()),this._tileBuilder=new L(this.data.textureAtlas,this.data.headerTexture,()=>this._freeInvisibleTiles()),this._shadows=new V({view:e,layerView:this}),this.fadeHelper=new F(this,e=>this._tileLifecycle.onTileFullyFadedOut(e)),this._prepassDepthRenderer=new z({view:e,layerView:this});let n=new I(this);this._intersectionHandler=n,e.sceneIntersectionHelper.addIntersectionHandler(n),this._elevationProvider=new M({view:e,layerElevationSource:this,intersectionHandler:n}),e.elevationProvider.register(2,this._elevationProvider),this.addHandles([o(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),o(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),c)]),this._suspendedHandle=o(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),c),this.addHandles([o(()=>this._clippingBox,e=>{this._renderer&&(this._renderer.clippingBox=e)},c),o(()=>this.maximumGaussianCount,e=>this._wasm?.setMaximumGaussianSplatCount(Math.min(e,this.data.textureAtlas.maximumSupportedVisibleGaussians)),c)]),this._initializationController=null}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}updateFadingTexture(){this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}get _wasm(){return A(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return T(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return _(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){let e=this._wasm;return this._wasmLayerId<0||e==null?!1:e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let t=this._tileBuilder.prepare(e);if(!t)return G().warnOnce(`encountered tile with zero Gaussians`),()=>({memUsageBytes:0,numGaussians:0});let n=this.view.state.isGlobal,r=n?p(this.view.spatialReference).radius:0,i={...t,isGlobal:n,ellipsoidRadius:r};this._renderablesBeingCreated.add(e.handle);let a;try{a=await this._frameTask.scheduleGenerator(e=>this._createRenderableTask(i,e),this._createRenderableAbortController.signal)}finally{this._renderablesBeingCreated.delete(e.handle)}return()=>a}*_createRenderableTask(e,t){let n=yield*this._tileBuilder.build(e,t);return this._tileHandles.set(n.handle,n),this._cacheTileMemory+=n.usedMemory,this._memCache.put(`${n.handle}`,n),{memUsageBytes:n.usedMemory,numGaussians:n.gaussianCount}}freeRenderable(e){this._tileLifecycle.freeTile(e)}releaseTile(e,t){let n=this.data?.textureAtlas;t?(this._usedTileMemory-=e.usedMemory,this._intersectionHandler.removeTile(e)):this._cacheTileMemory-=e.usedMemory,n&&e.pageIds.forEach(e=>n.freePage(e)),this._removeTileCacheEntry(e),this._tileHandles.delete(e.handle)}_removeTileCacheEntry(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(e.length,t=>{for(let{obb:n}of e)if(!t(n))break})}setRenderableVisibility(e,t,n){this._tileLifecycle.setVisibility(e,t,n)}activateTile(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(C(e.handle))}cacheTile(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(C(e.handle),e)}destroy(){this._initializationController=n(this._initializationController),this._createRenderableAbortController.abort(),j(this),this._suspendedHandle&&=r(this._suspendedHandle),this._intersectionHandler&&=(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(this._tileHandles.size,e=>{for(let{obb:t}of this._tileHandles.values())if(!e(t))break}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._tileBuilder=null,this._shadows=i(this._shadows),this._prepassDepthRenderer=i(this._prepassDepthRenderer),this._renderer=i(this._renderer),this._memCache.destroy(),this.data=i(this.data)}_canProjectWithoutEngine(){if(this.view.state.viewingMode===1||v(this.view.renderSpatialReference)||y(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&b(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(this.layer.esriCrsSpatialReference.vcsWkid===115700)return!1;let e=w(this.layer.esriCrsSpatialReference);if(!e){let t=this.layer.esriCrsSpatialReference,n=x(t),r=`meters`;!n&&t.wkid&&t.wkid!==-1&&(r=l(S.units[S[t.wkid]])),r&&(e=new m({heightModel:`gravity-related-height`,heightUnit:r}))}let t=this.view.heightModelInfo;return this._useEsriCrs=g(e,t,!1)===0,this._useEsriCrs&&(e&&(this._metersPerVCSUnit=u(1,e.heightUnit,`meters`)),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(!e?.offset)this._wasm?.setLayerOffset(this,0);else if(!this._useEsriCrs)this._wasm?.setLayerOffset(this,T(e));else{let t=E(e?.unit)/this._metersPerVCSUnit,n=e?.offset??0;this._wasm?.setLayerOffset(this,n*t)}}_slicePlaneEnabledChanged(e){this._renderer&&(this._renderer.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateActiveTileVisibility(){let e=[];for(let t of this._tileHandles.values())t.lifecycleState!==0&&e.push(t);this.data.updateGaussianVisibility(e,this._tileLifecycle.visibilityChange),this.notifyChange(`updating`)}get maximumGaussianCount(){return this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*this.view.quality}set maximumGaussianCount(e){this._set(`maximumGaussianCount`,e)}_freeInvisibleTiles(){for(let e of this._tileHandles.values())e.lifecycleState===0&&!this._renderablesBeingCreated.has(e.handle)&&this._deleteTile(e)}_deleteTile(e){this._renderablesBeingCreated.has(e.handle)||this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(n=>{n.lifecycleState===0?t++:e++});let n=this.data?.textureAtlasMemory??0,r=this.data?.headerTextureMemory??0,i=this.data?.orderTextureMemory??0,a=this.data?.fadingTextureMemory??0,o=this.data?.sortBufferMemory??0;return new D(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,n,r,i,a,o)}get test(){}};e([d()],K.prototype,`layer`,void 0),e([d({readOnly:!0})],K.prototype,`_clippingBox`,null),e([d()],K.prototype,`elevationOffset`,null),e([d({readOnly:!0})],K.prototype,`visibleAtCurrentScale`,null),e([d()],K.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([d()],K.prototype,`maximumGaussianCount`,null),K=e([f(`esri.views.3d.layers.GaussianSplatLayerView3D`)],K);const q=K;export{q as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,removeMaybe as r,destroyMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as o,whenOnce as s,initial as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{getReferenceEllipsoid as d}from"../../../geometry/ellipsoidUtils.js";import{create as f}from"../../../geometry/support/aaBoundingBox.js";import{isInEffectiveScaleRange as p}from"../../../geometry/support/scaleUtils.js";import{makeCacheKey as m}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as h}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as g}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as _}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as v}from"./LayerView3D.js";import{addLayerViewToWasm as y,getLyr3DWasm as b,removeLayerViewFromWasm as x}from"./Lyr3DWasm.js";import{LayerElevationProvider as S}from"./i3s/LayerElevationProvider.js";import{selectTiles3DSpatialReference as C}from"./support/selectTiles3DSpatialReference.js";import{projectToBoundingBox as w}from"../support/extentUtils.js";import{GaussianSplatDataStore as T}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as E}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as D}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTileBuilder as O}from"../support/gaussianSplatting/GaussianTileBuilder.js";import{GaussianTileLifecycle as k}from"../support/gaussianSplatting/GaussianTileLifecycle.js";import{GaussianSplatDepthRenderer as A}from"../webgl-engine/lib/GaussianSplatDepthRenderer.js";import{GaussianSplatRenderer as j}from"../webgl-engine/lib/GaussianSplatRenderer.js";import{GaussianSplatShadows as M}from"../webgl-engine/lib/GaussianSplatShadows.js";import N from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as P}from"../../support/layerViewUtils.js";import{TaskPriority as F}from"../../support/Scheduler.js";const I=()=>t.getLogger(`esri.views.3d.layers.GaussianSplatLayerView3D`);let L=class extends v(N){constructor(e){super(e),this.type=`gaussian-splat-3d`,this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._renderablesBeingCreated=new Set,this._tileLifecycle=new k(this),this._createRenderableAbortController=new AbortController,this.skipHeightModelInfoValidation=!0,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(F.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;let e=f();return w(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderer?.clippingBox??null}initialize(){let{view:e}=this;this.addHandles([o(()=>e.qualitySettings.fadeDuration,e=>{this.data&&(this.fadeHelper.onFadeDurationChanged(e),this.updateFadingTexture())})]),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;let{signal:t}=this._initializationController;await s(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t);let n=C({viewingMode:e.state.viewingMode,renderSpatialReference:e.renderSpatialReference,esriCrsSpatialReference:this.layer.esriCrsSpatialReference,heightModelInfo:e.heightModelInfo});if(!n)throw P(`layer`,this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._useEsriCrs=n.useEsriCrs,this._metersPerVCSUnit=n.metersPerVCSUnit,n.useEsriCrs&&(this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._wasmLayerId=await y(this,t),a(t),this._renderer=new j({view:e,layerView:this}),this.data=new T(this._renderer,(e,t)=>this._tileLifecycle.onSortComplete(e,t),()=>this._freeInvisibleTiles()),this._tileBuilder=new O(this.data.textureAtlas,this.data.headerTexture,()=>this._freeInvisibleTiles()),this._shadows=new M({view:e,layerView:this}),this.fadeHelper=new E(this,e=>this._tileLifecycle.onTileFullyFadedOut(e)),this._prepassDepthRenderer=new A({view:e,layerView:this});let r=new D(this);this._intersectionHandler=r,e.sceneIntersectionHelper.addIntersectionHandler(r),this._elevationProvider=new S({view:e,layerElevationSource:this,intersectionHandler:r}),e.elevationProvider.register(2,this._elevationProvider),this.addHandles([o(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),o(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),c)]),this._suspendedHandle=o(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),c),this.addHandles([o(()=>this._clippingBox,e=>{this._renderer&&(this._renderer.clippingBox=e)},c),o(()=>this.maximumGaussianCount,e=>this._wasm?.setMaximumGaussianSplatCount(Math.min(e,this.data.textureAtlas.maximumSupportedVisibleGaussians)),c)]),this._initializationController=null}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}updateFadingTexture(){this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}get _wasm(){return b(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return h(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return p(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){let e=this._wasm;return this._wasmLayerId<0||e==null?!1:e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let t=this._tileBuilder.prepare(e);if(!t)return I().warnOnce(`encountered tile with zero Gaussians`),()=>({memUsageBytes:0,numGaussians:0});let n=this.view.state.isGlobal,r=n?d(this.view.spatialReference).radius:0,i={...t,isGlobal:n,ellipsoidRadius:r};this._renderablesBeingCreated.add(e.handle);let a;try{a=await this._frameTask.scheduleGenerator(e=>this._createRenderableTask(i,e),this._createRenderableAbortController.signal)}finally{this._renderablesBeingCreated.delete(e.handle)}return()=>a}*_createRenderableTask(e,t){let n=yield*this._tileBuilder.build(e,t);return this._tileHandles.set(n.handle,n),this._cacheTileMemory+=n.usedMemory,this._memCache.put(`${n.handle}`,n),{memUsageBytes:n.usedMemory,numGaussians:n.gaussianCount}}freeRenderable(e){this._tileLifecycle.freeTile(e)}releaseTile(e,t){let n=this.data?.textureAtlas;t?(this._usedTileMemory-=e.usedMemory,this._intersectionHandler.removeTile(e)):this._cacheTileMemory-=e.usedMemory,n&&e.pageIds.forEach(e=>n.freePage(e)),this._removeTileCacheEntry(e),this._tileHandles.delete(e.handle)}_removeTileCacheEntry(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(e.length,t=>{for(let{obb:n}of e)if(!t(n))break})}setRenderableVisibility(e,t,n){this._tileLifecycle.setVisibility(e,t,n)}activateTile(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(m(e.handle))}cacheTile(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(m(e.handle),e)}destroy(){this._initializationController=n(this._initializationController),this._createRenderableAbortController.abort(),x(this),this._suspendedHandle&&=r(this._suspendedHandle),this._intersectionHandler&&=(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(this._tileHandles.size,e=>{for(let{obb:t}of this._tileHandles.values())if(!e(t))break}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._tileBuilder=null,this._shadows=i(this._shadows),this._prepassDepthRenderer=i(this._prepassDepthRenderer),this._renderer=i(this._renderer),this._memCache.destroy(),this.data=i(this.data)}_elevationInfoChanged(e){if(!e?.offset)this._wasm?.setLayerOffset(this,0);else if(!this._useEsriCrs)this._wasm?.setLayerOffset(this,h(e));else{let t=g(e?.unit)/this._metersPerVCSUnit,n=e?.offset??0;this._wasm?.setLayerOffset(this,n*t)}}_slicePlaneEnabledChanged(e){this._renderer&&(this._renderer.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateActiveTileVisibility(){let e=[];for(let t of this._tileHandles.values())t.lifecycleState!==0&&e.push(t);this.data.updateGaussianVisibility(e,this._tileLifecycle.visibilityChange),this.notifyChange(`updating`)}get maximumGaussianCount(){return this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*this.view.quality}set maximumGaussianCount(e){this._set(`maximumGaussianCount`,e)}_freeInvisibleTiles(){for(let e of this._tileHandles.values())e.lifecycleState===0&&!this._renderablesBeingCreated.has(e.handle)&&this._deleteTile(e)}_deleteTile(e){this._renderablesBeingCreated.has(e.handle)||this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(n=>{n.lifecycleState===0?t++:e++});let n=this.data?.textureAtlasMemory??0,r=this.data?.headerTextureMemory??0,i=this.data?.orderTextureMemory??0,a=this.data?.fadingTextureMemory??0,o=this.data?.sortBufferMemory??0;return new _(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,n,r,i,a,o)}get test(){}};e([l()],L.prototype,`layer`,void 0),e([l({readOnly:!0})],L.prototype,`_clippingBox`,null),e([l()],L.prototype,`elevationOffset`,null),e([l({readOnly:!0})],L.prototype,`visibleAtCurrentScale`,null),e([l()],L.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([l()],L.prototype,`maximumGaussianCount`,null),L=e([u(`esri.views.3d.layers.GaussianSplatLayerView3D`)],L);const R=L;export{R as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,destroyMaybe as r,removeMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a,createAbortError as o}from"../../../core/promiseUtils.js";import{initial as s,whenOnce as c,watch as l,when as u}from"../../../core/reactiveUtils.js";import{schedule as d}from"../../../core/scheduling.js";import{isUint8Array as f,isFloat32Array as p,isUint32Array as m,isUint16Array as h}from"../../../core/typedArrayUtil.js";import{unitFromRESTJSON as g,convertUnit as _}from"../../../core/units.js";import{property as v,subclass as y}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as b,invert as x}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as S,IDENTITY as C}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as T}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as E,sub as D,dot as O,set as k}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as A,freeze as j,clone as ee,ZEROS as te,fromValues as ne}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as re,clone as ie,ONES as ae}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as oe,isMars as se,getReferenceEllipsoid as M,SphericalECEFSpatialReferenceLike as ce}from"../../../geometry/ellipsoidUtils.js";import le from"../../../geometry/HeightModelInfo.js";import{computeTranslationToOriginAndRotation as ue}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as de}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as fe}from"../../../geometry/projection/projectVectorToVector.js";import{create as pe}from"../../../geometry/support/aaBoundingRect.js";import{isCompatible as me}from"../../../geometry/support/heightModelInfoUtils.js";import{isInEffectiveScaleRange as he,validateScaleRange as N}from"../../../geometry/support/scaleUtils.js";import{isPlateCarree as P,isWebMercator as F,equals as I,isGeographic as L,isCGCS2000 as R}from"../../../geometry/support/spatialReferenceUtils.js";import z from"../../../geometry/support/WKIDUnitConversion.js";import{BufferViewVec4u8 as ge,BufferViewVec3u8 as _e,BufferViewVec2f as ve,BufferViewVec3f as B,BufferViewUint32 as V,BufferViewUint16 as H}from"../../../geometry/support/buffer/BufferView.js";import{nullId as U}from"../../../layers/ILyr3DWasmPerSceneView.js";import ye from"../../../layers/support/SceneModification.js";import{getHeightModelInfoFromVCS as be,validateEntity3D as xe,makeCacheKey as W,isValidHandle as G}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as K}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as Se}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as Ce}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as we}from"./Lyr3DViewPerformanceInfo.js";import{addLayerViewToWasm as Te,removeLayerViewFromWasm as Ee,getLyr3DWasm as De}from"./Lyr3DWasm.js";import{toWasmModification as q}from"./SceneLayerWorkerHandle.js";import{LayerElevationProvider as Oe}from"./i3s/LayerElevationProvider.js";import{IntegratedMesh3DTilesLayerView3DSymbol as ke}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as Ae,alphaModeConversion as je,faceCullingConversion as Me,wrapModeConversion as Ne}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as Pe}from"./support/makeScheduleFunction.js";import{Tiles3DMeshIntersectionHandler as Fe}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as Ie}from"../state/Frustum.js";import{ElevationRange as Le}from"../support/ElevationRange.js";import{toBoundingRect as Re}from"../support/extentUtils.js";import{Obb as ze}from"../support/orientedBoundingBox.js";import{glLayout as Be}from"../support/buffer/glUtil.js";import{getGroundTransparencyModeFromOpacity as Ve}from"../terrain/TransparencyMode.js";import{ComponentGeometryParameters as He,SourceGeometry as Ue}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as We}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as Ge}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as Ke}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as qe}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as Je}from"../webgl-engine/materials/pbrUtils.js";import Ye from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as Xe}from"../../support/layerViewUtils.js";import{TaskPriority as Ze}from"../../support/Scheduler.js";import{CompressedTextureFormat as J,SizedPixelFormat as Y}from"../../webgl/enums.js";import{alphaCutoff as X}from"../../../webscene/support/AlphaCutoff.js";var Z;function Qe(e,t,n){if(t===`image/vnd-ms.dds`)switch(n){case`Dxt1`:return J.COMPRESSED_RGB_S3TC_DXT1_EXT;case`Dxt5`:return J.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if(t===`image/ktx`)return n===`Etc1`?J.COMPRESSED_RGB8_ETC2:null;switch(e){case 33319:return Y.RG8;case 6407:return Y.RGB8;case 6408:return Y.RGBA8;case 6403:return Y.R8;default:return null}}let Q=class extends Ce(Ye){static{Z=ke}constructor(e){super(e),this[Z]=!0,this.type=`integrated-mesh-3dtiles`,this.skipHeightModelInfoValidation=!0,this.freeze=!1,this._modifications=[],this._visibleGeometryChangedSchedulerHandle=null,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._applySSAO=!has(`disable-feature:im-ssao`),this._imShading=!!has(`enable-feature:im-shading`),this._imVertexNormals=!!has(`enable-feature:im-vertex-normals`),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._dbgFlags=new Set;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._frameTask=t.scheduler.registerTask(Ze.TILES3D,this),this._frustum=new Ie(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{a(t);let n=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=n}):null}canRecycleWith(e){return e.url===this.layer.url&&e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain===this._replacesTerrain}initialize(){this._dbg(2,`Tiles3DLayerView3D initialize() called`);let{view:e}=this;this._workerHandle=new Se(Pe(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),s),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;let{signal:t}=this._initializationController;if(await c(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t),!this._canProjectWithoutEngine())throw Xe(`layer`,this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._wasmLayerId=await Te(this,t),a(t);let n=new Fe(this);this._intersectionHandler=n,e.sceneIntersectionHelper.addIntersectionHandler(n),this._elevationProvider=new Oe({view:e,layerElevationSource:this,intersectionHandler:n});let r=this._getElevationContext();e.elevationProvider.register(r,this._elevationProvider),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.overlayManager.renderer.isEmpty,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),s),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),s),this._updatingHandles.add(()=>this.layer.isUsedAsGroundLayer,()=>this._groundUsageChanged()),e.overlayManager.registerDrapeTarget(this),this.addHandles([l(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),u(()=>this.fullOpacity,()=>this._opacityChange()),l(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),s),l(()=>this.freeze,e=>{e?this._wasm?.incrementFrozenLayerViewCount(this):(this._wasm?.decrementFrozenLayerViewCount(this),this._cameraChanged())})]),this._initializationController=null,this.addHandles(l(()=>this._replacesTerrain&&!!this._wasm?.isTerrainReady||!this._replacesTerrain&&!!has(`enable-feature:im-as-ground`)&&this.layer.isUsedAsGroundLayer,e=>{this.layer.queryElevationCallback=e?(e,t)=>this._queryElevation(e,t):null},s))}destroy(){if(this.freeze=!1,this._initializationController=n(this._initializationController),this._dbg(2,`Tiles3DLayerView3D destroy() called`),this._workerHandle?.destroyContextAndSelf(this.uid),Ee(this),this.layer.queryElevationCallback=null,this._intersectionHandler&&=(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),null),this._elevationProvider){let e=Array.from(this._lyrHandleToObjects.values()),t=e.reduce((e,{componentObjects:t})=>e+t.length,0);this._elevationProvider.notifyObjectsChangedFunctional(t,t=>{for(let{componentObjects:n}of e)for(let{obb:e}of n)if(!t(e))return}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null}this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=r(this._updatingHandles),this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=i(this._visibleGeometryChangedSchedulerHandle)}get usedAsGround(){return this.layer.isUsedAsGroundLayer}get replacesTerrain(){return this._replacesTerrain}get fullOpacity(){return has(`enable-feature:im-as-ground`)?this.usedAsGround?this.view.map.ground.opacity:this.layer.opacity:this.replacesTerrain?this.view.map.ground.opacity:1}get opaque(){return this._groundTransparencyMode===0}get invisible(){return this._groundTransparencyMode===3}get _groundTransparencyMode(){return(has(`enable-feature:im-as-ground`)?!this.usedAsGround:!this._replacesTerrain)?0:Ve(this.fullOpacity,this.view.overlayManager.renderer.isEmpty)}get _renderOpacity(){switch(this._groundTransparencyMode){case 3:return 0;case 2:return X;default:return this.fullOpacity}}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){let e=this._renderOpacity,t=this._groundTransparencyMode;this.forEachComponentObject(n=>this._collection.updateObjectOpacity(n,e,t))}_getElevationContext(){return this.replacesTerrain?0:has(`enable-feature:im-as-ground`)?this.usedAsGround?1:2:1}_groundUsageChanged(){let e=this._getElevationContext();this.view.elevationProvider.unregister(this._elevationProvider),this.view.elevationProvider.register(e,this._elevationProvider),this._intersectionHandler.isGround=!has(`enable-feature:im-as-ground`)||this.usedAsGround,this._intersectionHandler.slicePlaneEnabled=this.slicePlaneEnabled&&!this.replacesTerrain,this.view.overlayManager.unregisterDrapeTarget(this),this.view.overlayManager.registerDrapeTarget(this),this._loadModifications();let t=has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,n=this._renderOpacity,r=this._groundTransparencyMode;this.forEachComponentObject(e=>e.updateMaterial({isGround:t,opacity:n,groundTransparencyMode:r}))}_cameraChanged(){if(this.freeze)return;let e=this._frustum;e.update(this.view.state.contentCamera);let t=this._visibleObjects,n=!1;this._loadedObjects.forEach(r=>{let i=r.obb?.intersectsFrustum(e)??!1;i!==r.isVisible&&(r.isVisible=i,i?t.add(r):t.delete(r),r.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,i)),n||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(i,r.elevationRange))}),n&&this._setVisibleElevationRangeDirty()}intersect(e,t,n,r){this._intersectionHandler.intersectRay(e,t,n,r,null,!1)}get ready(){return!this.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){let e=this.useEsriCrs?this.layer.supportedSpatialReferences[1]:this.layer.supportedSpatialReferences[0],t=q(this._layerClippingArea,this._modifications,e,this.view.state.isGlobal);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){let e=this.layer.spatialReference,t=pe();this._layerClippingArea=Re(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=d(()=>{this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,K(e))}get _wasm(){return De(this.view)}_queryElevation(e,t){return this.destroying||this.destroyed?Promise.reject(o()):this._wasm?.queryElevation(this,e,t)??Promise.reject(o())}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._useEsriCrs}get visibleAtCurrentScale(){return this.replacesTerrain||he(this.layer.effectiveScaleRange,this.view.scale)}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this.replacesTerrain||N(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,n=0,r=0,i=0,a=0;return this._lyrHandleToObjects.forEach(o=>{o.isLoaded?(e+=o.textureMemoryUsage,t+=o.vboMemoryUsage,i++):(n+=o.textureMemoryUsage,r+=o.vboMemoryUsage,a++)}),new we(this.usedMemory,i,a,$(t),$(e),$(r),$(n))}_canProjectWithoutEngine(){if(this.view.state.viewingMode===1||P(this.view.renderSpatialReference)||F(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&I(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(this.layer.esriCrsSpatialReference.vcsWkid===115700)return!1;let e=be(this.layer.esriCrsSpatialReference);if(!e){let t=this.layer.esriCrsSpatialReference,n=L(t),r=`meters`;!n&&t.wkid&&t.wkid!==-1&&(r=g(z.units[z[t.wkid]])),r&&(e=new le({heightModel:`gravity-related-height`,heightUnit:r}))}let t=this.view.heightModelInfo;return this._useEsriCrs=me(e,t,!1)===0,this._useEsriCrs&&(e&&(this._metersPerVCSUnit=_(1,e.heightUnit,`meters`)),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return K(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){let e=new Le;this._visibleObjects.size===0?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));let t=this._get(`visibleElevationRange`);return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange(`visibleElevationRange`)}_forEachRelevantVisibleTile(e){let{view:t}=this,{spatialReference:n}=t,r=n.isWGS84||n.isWebMercator||R(n)||oe(n)||se(n);if(this.view.state.isGlobal||!r)return this.forEachVisibleTile(e);let i=M(n).radius,{eye:a,viewForward:o,near:s}=t.state.contentCamera,c=E(A(),o),l=Math.max(a[2],500),u=l+i,d=Math.sqrt(u**2-i**2),f=Math.abs(Math.atan2(d,i))*i,p=l>.5*i?.5*Math.PI*i:f,m=A();this.forEachVisibleTile(t=>{let{mbsRadius:n,mbsCenter:r}=t;if(n<0)return;D(m,r,a);let i=O(m,c);Math.abs(i)<p&&i+n>s&&i-n<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(let t of this._visibleObjects)e(t)}forEachTile(e){for(let t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(let{componentObjects:n}of e)for(let e of n)t(e)}get drapeTargetType(){return has(`enable-feature:im-as-ground`)?+!this.usedAsGround:+!this.replacesTerrain}isUpdating(){let e=this._wasm;return!this.freeze&&this._wasmLayerId>=0&&e!=null&&e.isUpdating(this._wasmLayerId)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let{entity3d:t}=e;if(!xe(t))throw Error(`entity3D not valid`);let n=new Map,r;try{r=this._createPrimitiveTextureBundles(t,n)}catch(e){throw n.forEach(e=>this._stage?.removeTexture(e)),e}let i=null;try{if(i=await this._createRenderableMain(t,r),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance`);let{tileObb:a,componentObjects:o,elevationRange:s}=i,c=0,l=0,u=0;for(let e of o){let{texture:t,textureMetallicRoughness:n,textureEmissive:r,textureOcclusion:i,textureNormal:a}=e.renderable.drawParameters;c+=(t?.usedMemory??0)+(n?.usedMemory??0)+(r?.usedMemory??0)+(i?.usedMemory??0)+(a?.usedMemory??0),l+=this._collection.getObjectGPUMemoryUsage(e),u+=e.intersectionGeometry.usedMemory}let d=Array.from(n.values()),f=new et(e.handle,o,d,u,l,c,a,e.stableNodeId,e.nodeDepth,s);return this._lyrHandleToObjects.set(e.handle,f),()=>{this._memCache.put(W(f.handle),f);let{usedMemory:e}=f;return this._cacheMemory+=e,{memUsageBytes:e}}}catch(e){throw r.forEach(e=>e.cleanup()),i?.componentObjects.forEach(e=>this._collection.destroyObject(e)),n.forEach(e=>this._stage?.removeTexture(e)),e}}_createPrimitiveTextureBundles(e,t){let n=[];try{let r=e.desc.geometry;for(let i of e.validPrimitiveIndices){let a=r.prims[i].materialId,o=e.desc.materials?.materials&&a!=null&&a!==U?e.desc.materials.materials[a]:null,s=Promise.resolve(nt),c=null,l=null,u=null,d=null,f=null;if(o){let n=o.lightingModel===`Pbr`;c=this._getTexture(o.baseColorTex,e,t),l=n?this._getTexture(o.metalTex,e,t):null,u=n?this._getTexture(o.emissiveTex,e,t):null,d=n?this._getTexture(o.occlusionTex,e,t):null,f=n?this._getTexture(o.normalTex,e,t):null;let r=[c,l,u,d,f].map(e=>e?.loadPromise??null);s=Promise.all(r)}n.push(new rt(s,c,l,u,d,f))}}catch(e){throw n.forEach(e=>e.cleanup()),e}return n}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy`);let n=[],r=e.desc,i=j(...e.origin),a=this.view.groundView.spatialReference,o=this.view.state.isGlobal,s=C;if(o){let e=w();ue(ce,i,e,a),s=b(S(),e)}let c=tt(r.obb),l=o?M(this.view.spatialReference).radius:0,u=o?Math.hypot(c.centerX,c.centerY,c.centerZ)-l:c.centerZ,d=o?Math.max(-l,u-c.radius):u-c.radius,f=u+c.radius,p=[];try{let u=-1;for(let n of e.validPrimitiveIndices){u+=1;let i=r.geometry.prims[n],a=t[u];if(this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(i)),Ae[i.ptype]==null){this._dbg(2,`[Unsupported Feature] Unsupported primitive mode (`+i.ptype+`). Skipping primitive.`),a.cleanup();continue}let{positionView:o,normalsData:s,colorView:c,texCoord0Data:l,indicesView:d}=this._getBufferViews(i,e);if(o==null||d==null){a.cleanup();continue}let f=o.count,m=(e,t)=>e!=null&&e!==f?(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1):!0;!m(l==null?void 0:l.length/2,`numTexcoord`)||!m(c?.count,`numColors`)||!m(s?.length,`normals`)?a.cleanup():p.push({componentIndex:u,positionView:o,indicesView:d,texCoord0Data:l,colorView:c,normalsData:s})}let m=s!==C,h=m?x(S(),s)??C:C,{vertexProcessingOutputs:g,obbHalfSizeAccumulator:_,elevationRange:v}=await this._workerHandle.processTiles3DVertices(p,i,l,o,s,c,this._imVertexNormals&&!this.usedAsGround);if(this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);let y=r.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);g.length>0&&c.setHalfSize(_);for(let o of g){let{componentIndex:s,positionView:l,indicesView:u,layout:d,textureCoordinateType:f,interleavedVertexData:p,indices:g}=o,_=e.validPrimitiveIndices[s],v=r.geometry.prims[_],b=t[s],x=c.clone(),S=Be(d),C=new Uint32Array([0,u.typedBuffer.length]),w=new He(S,this._imShading?2:0,f,m?2:0),T=new Ue({interleavedVertexData:p,vertexCount:p.byteLength/S[0].stride,indexData:g},{positions:l.typedBuffer,indices:u.typedBuffer},C,w),E=this.view.renderSpatialReference,D=A(),O=[1,1,1];de(i,E,O,a)||this._dbg(3,`Unsupported coordinate system for IM overlay`),fe(i,E,D,a);let k=this._createComponentMaterialInitParameters(y,v.materialId,b);k.baseColorTexture||this._dbg(3,`No colour texture 1`);let j=this._collection.createObject({toMapSpace:re(D[0],D[1],O[0],O[1]),transform:new We(i,h),obb:x,geometry:T,elevationAlignable:!1},k);n.push(j)}return v.minElevation=Math.max(v.minElevation,d),v.maxElevation=Math.min(v.maxElevation,f),{tileObb:c,componentObjects:n,elevationRange:v}}catch(e){throw n.forEach(e=>this._collection.destroyObject(e)),e}}_createComponentMaterialInitParameters(e,t,n){let r=e?.materials!=null&&t!=null&&t!==U?e.materials[t]:null,i=1,a=r?.baseColorTex?.imageId;if(a!=null&&e&&Array.isArray(e.images)&&a>=0&&a<e.images.length){let t=e.images[a];t.alpha&&(i=je[t.alpha])}let o=(r==null?`Unlit`:r.lightingModel)===`Pbr`,s=ae,c=X,l=!1,u=2,d=ne(0,0,0),f=ee(Je),p=n.baseColorTexture,m=n.metallicRoughnessTexture,h=n.emissionTexture,g=n.occlusionTexture,_=n.normalTexture;return r&&(s=ie(r.baseColorFactor),c=r.alphaCutoff??X,o&&(k(f,r.metallicFactor,r.roughnessFactor,0),r.emissiveFactor&&(d=r.emissiveFactor)),l=r.isDoubleSided,u=Me[r.faceCulling??`NotSet`]),{isIntegratedMesh:!0,baseColor:s,textureAlphaCutoff:c,mrrFactors:f,baseColorTexture:p,metallicRoughnessTexture:m,normalTexture:_,occlusionTexture:g,emissionTexture:h,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:i,doubleSided:l,cullFace:u,isGround:has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,groundTransparencyMode:this._groundTransparencyMode,emissiveBaseColor:d,usePBR:o,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this._renderOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){let t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){let t=W(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,n){if(this.destroyed||this.destroying)return;let r=this._frustum,i=[],a=!1,o=!1;for(let s=0;s<n;++s){if(!t[s])continue;let n=e[s],c=this._lyrHandleToObjects.get(n);if(c){if(c.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${c.stableNodeId}`);continue}a=!0,c.isLoaded=!0,this._loadedObjects.add(c),this._intersectionHandler.addTile(c),this._usedMemory+=c.usedMemory,this._cacheMemory-=c.usedMemory;let e=c.obb?.intersectsFrustum(r)??!0;c.isVisible=e,e&&(this._visibleObjects.add(c),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,c.elevationRange)),i.push(c.obb),c.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(W(n))}else this._dbg(3,`Tried to mark Non existent object ${n} as loaded`)}for(let r=0;r<n;++r){let n=e[r];if(t[r])continue;let a=this._lyrHandleToObjects.get(n);if(a){if(!a.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${a.stableNodeId}`);continue}let e=a.isVisible;this._visibleObjects.delete(a),a.isVisible=!1,a.isLoaded=!1,this._loadedObjects.delete(a),this._intersectionHandler.removeTile(a),e&&(this._visibleGeometryChanged(),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,a.elevationRange)),this._usedMemory-=a.usedMemory,this._cacheMemory+=a.usedMemory,i.push(a.obb),a.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(W(n),a)}else this._dbg(3,`Tried to mark Non existent object ${n} as not loaded`)}a&&this._visibleGeometryChanged(),i.length>0&&this._elevationProvider.notifyObjectsChanged(i),o&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){let{visibleElevationRange:n}=this,{minElevation:r,maxElevation:i}=t;return e?r<n.minElevation||i>n.maxElevation:r===n.minElevation||i===n.maxElevation}_getTexture(e,t,n){let r=e&&t.desc.materials?.images?.[e.imageId];if(!r||!G(r.data))return null;let i=t.assets[r.data];if(!i||i.byteCount<1||i.dataType!==`U8`)return null;let a=n.get(r)??this._createTexture(e,r,i,n);return a?new Ge(this._stage.renderView.textures,a.id):null}_createTexture(e,n,r,i){let a=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,o=n.mipCount?!0:a>1,s=Ne[e.wrapMode??`None`],c=n.alpha?6408:6407,l=new Uint8Array(r.data.buffer,0,r.byteCount),u=null,d=null;switch(n.format){case`Raw`:if(n.pixelFormat===`R8`)u=l,c=6403,d=``;else if(n.pixelFormat===`Rg8`||n.pixelFormat===`Ga8`)u=l,c=33319,d=``;else if(n.pixelFormat===`Rgb8`)u=l,c=6407,d=``;else if(n.pixelFormat===`Rgba8`)u=l,c=6408,d=``;else return t.getLogger(this).error(`Raw texture pixel format ${n.pixelFormat} not supported`),null;break;case`Dxt1`:u=l,c=6407,d=`image/vnd-ms.dds`;break;case`Dxt5`:u=l,c=6408,d=`image/vnd-ms.dds`;break;case`Basis`:u=l,c=6407,d=`image/ktx2`;break;case`Etc1`:u=l,c=6407,d=`image/ktx`;break;default:return t.getLogger(this).error(`${n.format} texture not supported`),null}if(u&&d!=null){let e=Qe(c,d,n.format),t=new Ke(u,{mipmap:o,maxAnisotropy:a,encoding:d,wrap:s,pixelFormat:c,internalFormat:e??void 0,immutable:e!=null,noUnpackFlip:!0,width:n.mip0Width,height:n.mip0Height});return this._stage.addTexture(t),i.set(n,t),t}return null}_getBufferViews(e,t){let n,r,i,a;for(let o=0;o<e.atrbs.length;o++){let s=e.atrbs[o],c=t.assets[s.assetId];if(!c)continue;let l=c.data.buffer,u=c.byteCount;try{switch(s.sem){case`Position`:c.ncomp!==3||c.dataType!==`F32`||!p(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Position (`+c+`)`):n=new B(l,0,void 0,u);break;case`Normal`:if(c.ncomp!==3||c.dataType!==`F32`||!p(c.data))this._dbg(3,`[Unsupported Feature] Unsupported view for Normal (`+c+`)`);else{let e=new B(l,0,void 0,u);a=new Uint32Array(e.count),qe(e.typedBuffer,new Int16Array(a.buffer,a.byteOffset,a.length*2))}break;case`TexCoord`:c.ncomp!==2||c.dataType!==`F32`||!p(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Texcoord (`+c+`)`):i===void 0&&(i=new ve(l,0,void 0,u).typedBuffer);break;case`Color`:c.dataType===`U8`&&f(c.data)&&(c.ncomp===4?r=new ge(l,0,void 0,u):c.ncomp===3&&(r=new _e(l,0,void 0,u))),r??this._dbg(3,`[Unsupported Feature] Unsupported view for Color (`+c+`)`);break;case`FeatureIndex`:break;default:this._dbg(2,`[Unsupported Feature] Unsupported semantic (`+s.sem+`). Skipping vertex attribute.`)}}catch(e){this._dbg(2,`Error Creating buffer (`+e+`). Skipping vertex attribute.`)}}let o,s=!1;if(G(e.index)){let n=t.assets[e.index];if(!n)s=!0;else{let e=n.byteCount;switch(n.dataType){case`U16`:n.ncomp===1&&h(n.data)&&(o=new H(n.data.buffer,0,void 0,e));break;case`U32`:n.ncomp===1&&m(n.data)&&(o=new V(n.data.buffer,0,void 0,e))}s=!o}}if(!s&&o==null&&n!=null){let e=n.count;o=o=e<65535?new H(new Uint16Array(e).buffer):new V(new Uint32Array(e).buffer);for(let t=0;t<e;t++)o.set(t,t)}return{positionView:n,colorView:r,texCoord0Data:i,indicesView:o,normalsData:a}}_loadModifications(){if(this.removeHandles(`modifications`),this.layer.modifications==null){this._modifications=[];return}let e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.usedAsGround&&e.type!==`replace`)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info(`Ground layers only support replace modifications. Other modification types have been ignored.`)},s),`modifications`)}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,n){this._dbgFlags.has(e)&&(e===3?t.getLogger(this).error(n):t.getLogger(this).warn(n))}};e([v()],Q.prototype,`freeze`,void 0),e([v()],Q.prototype,`fullOpacity`,null),e([v()],Q.prototype,`opaque`,null),e([v()],Q.prototype,`invisible`,null),e([v({readOnly:!0})],Q.prototype,`ready`,null),e([v({type:[ye]})],Q.prototype,`_modifications`,void 0),e([v()],Q.prototype,`_visibleGeometryChangedSchedulerHandle`,void 0),e([v()],Q.prototype,`layer`,void 0),e([v({readOnly:!0})],Q.prototype,`visibleAtCurrentScale`,null),e([v({readOnly:!0})],Q.prototype,`_collection`,null),e([v()],Q.prototype,`elevationOffset`,null),e([v({readOnly:!0})],Q.prototype,`visibleElevationRange`,null),e([v()],Q.prototype,`fullExtentInLocalViewSpatialReference`,void 0),Q=e([y(`esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D`)],Q);const $e=Q;class et{constructor(e,t,n,r,i,a,o,s,c,l){this.handle=e,this.componentObjects=t,this.textures=n,this.cpuMemoryUsage=r,this.vboMemoryUsage=i,this.textureMemoryUsage=a,this.obb=o,this.stableNodeId=s,this.nodeDepth=c,this.elevationRange=l,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;let u=A();o?.getCenter(u),this._obbCenterX=u[0],this._obbCenterY=u[1],this._obbCenterZ=u[2];let d=o?.radius??-1;this._obbRadius=d,this._obbRadiusSquared=d*d,this._obbShortestHalfsize=o?Math.min(o.halfSizeX,o.halfSizeY,o.halfSizeZ):0,this._mbsCenter=o?o.getCenter(A()):te}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){if(!this.obb)return!0;let{_obbCenterX:n,_obbCenterY:r,_obbCenterZ:i}=this,a=n-e[0],o=r-e[1],s=i-e[2],c=a*t[0]+o*t[1]+s*t[2];return a*a+o*o+s*s-c*c<=this._obbRadiusSquared&&this.obb.intersectRay(e,t)}boundingVolumeIntersectsSphere(e){let t=this._obbRadius;if(t<0)return!0;let n=e.center,r=e.radius,i=t+r,a=this._obbCenterX-n[0];if(a>i)return!1;let o=this._obbCenterY-n[1];if(o>i)return!1;let s=this._obbCenterZ-n[2];if(s>i)return!1;let c=a*a+o*o+s*s;if(c>i*i)return!1;if(c<=(this._obbShortestHalfsize+r)**2)return!0;let l=r-t;return l>0&&c<=l*l?!0:this.obb?.intersectSphere(e)??!0}}function $(e){return Math.round(e/1048.576)/1e3}function tt(e){return new ze(e.center,e.halfSize,T(...e.quaternion))}const nt=[];class rt{constructor(e,t,n,r,i,a){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=n,this.emissionTexture=r,this.occlusionTexture=i,this.normalTexture=a}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}export{$e as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,destroyMaybe as r,removeMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a,createAbortError as o}from"../../../core/promiseUtils.js";import{initial as s,whenOnce as c,watch as l,when as u}from"../../../core/reactiveUtils.js";import{schedule as d}from"../../../core/scheduling.js";import{isUint8Array as f,isFloat32Array as p,isUint32Array as m,isUint16Array as h}from"../../../core/typedArrayUtil.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as v,invert as y}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as b,IDENTITY as x}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as S}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as C}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as w,sub as T,dot as E,set as D}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as O,freeze as k,clone as A,ZEROS as j,fromValues as ee}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as M,clone as N,ONES as P}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as F,isMars as te,getReferenceEllipsoid as I,SphericalECEFSpatialReferenceLike as ne}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as re}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as ie}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as ae}from"../../../geometry/projection/projectVectorToVector.js";import{create as oe}from"../../../geometry/support/aaBoundingRect.js";import{isInEffectiveScaleRange as se,validateScaleRange as ce}from"../../../geometry/support/scaleUtils.js";import{isCGCS2000 as le}from"../../../geometry/support/spatialReferenceUtils.js";import{BufferViewVec4u8 as ue,BufferViewVec3u8 as L,BufferViewVec2f as R,BufferViewVec3f as z,BufferViewUint32 as B,BufferViewUint16 as V}from"../../../geometry/support/buffer/BufferView.js";import{nullId as H}from"../../../layers/ILyr3DWasmPerSceneView.js";import U from"../../../layers/support/SceneModification.js";import{validateEntity3D as de,makeCacheKey as W,isValidHandle as G}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as K}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as fe}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as pe}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as me}from"./Lyr3DViewPerformanceInfo.js";import{addLayerViewToWasm as he,removeLayerViewFromWasm as ge,getLyr3DWasm as _e}from"./Lyr3DWasm.js";import{toWasmModification as ve}from"./SceneLayerWorkerHandle.js";import{LayerElevationProvider as ye}from"./i3s/LayerElevationProvider.js";import{IntegratedMesh3DTilesLayerView3DSymbol as be}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as xe,alphaModeConversion as Se,faceCullingConversion as Ce,wrapModeConversion as we}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as Te}from"./support/makeScheduleFunction.js";import{selectTiles3DSpatialReference as Ee}from"./support/selectTiles3DSpatialReference.js";import{Tiles3DMeshIntersectionHandler as De}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as Oe}from"../state/Frustum.js";import{ElevationRange as ke}from"../support/ElevationRange.js";import{toBoundingRect as Ae}from"../support/extentUtils.js";import{Obb as je}from"../support/orientedBoundingBox.js";import{glLayout as Me}from"../support/buffer/glUtil.js";import{getGroundTransparencyModeFromOpacity as Ne}from"../terrain/TransparencyMode.js";import{ComponentGeometryParameters as Pe,SourceGeometry as Fe}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as Ie}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as Le}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as Re}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as ze}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as Be}from"../webgl-engine/materials/pbrUtils.js";import q from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as Ve}from"../../support/layerViewUtils.js";import{TaskPriority as He}from"../../support/Scheduler.js";import{CompressedTextureFormat as J,SizedPixelFormat as Y}from"../../webgl/enums.js";import{alphaCutoff as X}from"../../../webscene/support/AlphaCutoff.js";var Z;function Ue(e,t,n){if(t===`image/vnd-ms.dds`)switch(n){case`Dxt1`:return J.COMPRESSED_RGB_S3TC_DXT1_EXT;case`Dxt5`:return J.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if(t===`image/ktx`)return n===`Etc1`?J.COMPRESSED_RGB8_ETC2:null;switch(e){case 33319:return Y.RG8;case 6407:return Y.RGB8;case 6408:return Y.RGBA8;case 6403:return Y.R8;default:return null}}let Q=class extends pe(q){static{Z=be}constructor(e){super(e),this[Z]=!0,this.type=`integrated-mesh-3dtiles`,this.skipHeightModelInfoValidation=!0,this.freeze=!1,this._modifications=[],this._visibleGeometryChangedSchedulerHandle=null,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._applySSAO=!has(`disable-feature:im-ssao`),this._imShading=!!has(`enable-feature:im-shading`),this._imVertexNormals=!!has(`enable-feature:im-vertex-normals`),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._dbgFlags=new Set;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._frameTask=t.scheduler.registerTask(He.TILES3D,this),this._frustum=new Oe(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{a(t);let n=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=n}):null}canRecycleWith(e){return e.url===this.layer.url&&e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain===this._replacesTerrain}initialize(){this._dbg(2,`Tiles3DLayerView3D initialize() called`);let{view:e}=this;this._workerHandle=new fe(Te(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),s),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;let{signal:t}=this._initializationController;await c(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t);let n=Ee({viewingMode:e.state.viewingMode,renderSpatialReference:e.renderSpatialReference,esriCrsSpatialReference:this.layer.esriCrsSpatialReference,heightModelInfo:e.heightModelInfo});if(!n)throw Ve(`layer`,this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._useEsriCrs=n.useEsriCrs,this._metersPerVCSUnit=n.metersPerVCSUnit,n.useEsriCrs&&(this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._wasmLayerId=await he(this,t),a(t);let r=new De(this);this._intersectionHandler=r,e.sceneIntersectionHelper.addIntersectionHandler(r),this._elevationProvider=new ye({view:e,layerElevationSource:this,intersectionHandler:r});let i=this._getElevationContext();e.elevationProvider.register(i,this._elevationProvider),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.overlayManager.renderer.isEmpty,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),s),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),s),this._updatingHandles.add(()=>this.layer.isUsedAsGroundLayer,()=>this._groundUsageChanged()),e.overlayManager.registerDrapeTarget(this),this.addHandles([l(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),u(()=>this.fullOpacity,()=>this._opacityChange()),l(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),s),l(()=>this.freeze,e=>{e?this._wasm?.incrementFrozenLayerViewCount(this):(this._wasm?.decrementFrozenLayerViewCount(this),this._cameraChanged())})]),this._initializationController=null,this.addHandles(l(()=>this._replacesTerrain&&!!this._wasm?.isTerrainReady||!this._replacesTerrain&&!!has(`enable-feature:im-as-ground`)&&this.layer.isUsedAsGroundLayer,e=>{this.layer.queryElevationCallback=e?(e,t)=>this._queryElevation(e,t):null},s))}destroy(){if(this.freeze=!1,this._initializationController=n(this._initializationController),this._dbg(2,`Tiles3DLayerView3D destroy() called`),this._workerHandle?.destroyContextAndSelf(this.uid),ge(this),this.layer.queryElevationCallback=null,this._intersectionHandler&&=(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),null),this._elevationProvider){let e=Array.from(this._lyrHandleToObjects.values()),t=e.reduce((e,{componentObjects:t})=>e+t.length,0);this._elevationProvider.notifyObjectsChangedFunctional(t,t=>{for(let{componentObjects:n}of e)for(let{obb:e}of n)if(!t(e))return}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null}this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=r(this._updatingHandles),this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=i(this._visibleGeometryChangedSchedulerHandle)}get usedAsGround(){return this.layer.isUsedAsGroundLayer}get replacesTerrain(){return this._replacesTerrain}get fullOpacity(){return has(`enable-feature:im-as-ground`)?this.usedAsGround?this.view.map.ground.opacity:this.layer.opacity:this.replacesTerrain?this.view.map.ground.opacity:1}get opaque(){return this._groundTransparencyMode===0}get invisible(){return this._groundTransparencyMode===3}get _groundTransparencyMode(){return(has(`enable-feature:im-as-ground`)?!this.usedAsGround:!this._replacesTerrain)?0:Ne(this.fullOpacity,this.view.overlayManager.renderer.isEmpty)}get _renderOpacity(){switch(this._groundTransparencyMode){case 3:return 0;case 2:return X;default:return this.fullOpacity}}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){let e=this._renderOpacity,t=this._groundTransparencyMode;this.forEachComponentObject(n=>this._collection.updateObjectOpacity(n,e,t))}_getElevationContext(){return this.replacesTerrain?0:has(`enable-feature:im-as-ground`)?this.usedAsGround?1:2:1}_groundUsageChanged(){let e=this._getElevationContext();this.view.elevationProvider.unregister(this._elevationProvider),this.view.elevationProvider.register(e,this._elevationProvider),this._intersectionHandler.isGround=!has(`enable-feature:im-as-ground`)||this.usedAsGround,this._intersectionHandler.slicePlaneEnabled=this.slicePlaneEnabled&&!this.replacesTerrain,this.view.overlayManager.unregisterDrapeTarget(this),this.view.overlayManager.registerDrapeTarget(this),this._loadModifications();let t=has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,n=this._renderOpacity,r=this._groundTransparencyMode;this.forEachComponentObject(e=>e.updateMaterial({isGround:t,opacity:n,groundTransparencyMode:r}))}_cameraChanged(){if(this.freeze)return;let e=this._frustum;e.update(this.view.state.contentCamera);let t=this._visibleObjects,n=!1;this._loadedObjects.forEach(r=>{let i=r.obb?.intersectsFrustum(e)??!1;i!==r.isVisible&&(r.isVisible=i,i?t.add(r):t.delete(r),r.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,i)),n||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(i,r.elevationRange))}),n&&this._setVisibleElevationRangeDirty()}intersect(e,t,n,r){this._intersectionHandler.intersectRay(e,t,n,r,null,!1)}get ready(){return!this.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){let e=this.useEsriCrs?this.layer.supportedSpatialReferences[1]:this.layer.supportedSpatialReferences[0],t=ve(this._layerClippingArea,this._modifications,e,this.view.state.isGlobal);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){let e=this.layer.spatialReference,t=oe();this._layerClippingArea=Ae(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=d(()=>{this.emit(`visible-geometry-changed`),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,K(e))}get _wasm(){return _e(this.view)}_queryElevation(e,t){return this.destroying||this.destroyed?Promise.reject(o()):this._wasm?.queryElevation(this,e,t)??Promise.reject(o())}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._useEsriCrs}get visibleAtCurrentScale(){return this.replacesTerrain||se(this.layer.effectiveScaleRange,this.view.scale)}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this.replacesTerrain||ce(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,n=0,r=0,i=0,a=0;return this._lyrHandleToObjects.forEach(o=>{o.isLoaded?(e+=o.textureMemoryUsage,t+=o.vboMemoryUsage,i++):(n+=o.textureMemoryUsage,r+=o.vboMemoryUsage,a++)}),new me(this.usedMemory,i,a,$(t),$(e),$(r),$(n))}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return K(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){let e=new ke;this._visibleObjects.size===0?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));let t=this._get(`visibleElevationRange`);return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange(`visibleElevationRange`)}_forEachRelevantVisibleTile(e){let{view:t}=this,{spatialReference:n}=t,r=n.isWGS84||n.isWebMercator||le(n)||F(n)||te(n);if(this.view.state.isGlobal||!r)return this.forEachVisibleTile(e);let i=I(n).radius,{eye:a,viewForward:o,near:s}=t.state.contentCamera,c=w(O(),o),l=Math.max(a[2],500),u=l+i,d=Math.sqrt(u**2-i**2),f=Math.abs(Math.atan2(d,i))*i,p=l>.5*i?.5*Math.PI*i:f,m=O();this.forEachVisibleTile(t=>{let{mbsRadius:n,mbsCenter:r}=t;if(n<0)return;T(m,r,a);let i=E(m,c);Math.abs(i)<p&&i+n>s&&i-n<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(let t of this._visibleObjects)e(t)}forEachTile(e){for(let t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(let{componentObjects:n}of e)for(let e of n)t(e)}get drapeTargetType(){return has(`enable-feature:im-as-ground`)?+!this.usedAsGround:+!this.replacesTerrain}isUpdating(){let e=this._wasm;return!this.freeze&&this._wasmLayerId>=0&&e!=null&&e.isUpdating(this._wasmLayerId)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let{entity3d:t}=e;if(!de(t))throw Error(`entity3D not valid`);let n=new Map,r;try{r=this._createPrimitiveTextureBundles(t,n)}catch(e){throw n.forEach(e=>this._stage?.removeTexture(e)),e}let i=null;try{if(i=await this._createRenderableMain(t,r),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance`);let{tileObb:a,componentObjects:o,elevationRange:s}=i,c=0,l=0,u=0;for(let e of o){let{texture:t,textureMetallicRoughness:n,textureEmissive:r,textureOcclusion:i,textureNormal:a}=e.renderable.drawParameters;c+=(t?.usedMemory??0)+(n?.usedMemory??0)+(r?.usedMemory??0)+(i?.usedMemory??0)+(a?.usedMemory??0),l+=this._collection.getObjectGPUMemoryUsage(e),u+=e.intersectionGeometry.usedMemory}let d=Array.from(n.values()),f=new Ge(e.handle,o,d,u,l,c,a,e.stableNodeId,e.nodeDepth,s);return this._lyrHandleToObjects.set(e.handle,f),()=>{this._memCache.put(W(f.handle),f);let{usedMemory:e}=f;return this._cacheMemory+=e,{memUsageBytes:e}}}catch(e){throw r.forEach(e=>e.cleanup()),i?.componentObjects.forEach(e=>this._collection.destroyObject(e)),n.forEach(e=>this._stage?.removeTexture(e)),e}}_createPrimitiveTextureBundles(e,t){let n=[];try{let r=e.desc.geometry;for(let i of e.validPrimitiveIndices){let a=r.prims[i].materialId,o=e.desc.materials?.materials&&a!=null&&a!==H?e.desc.materials.materials[a]:null,s=Promise.resolve(qe),c=null,l=null,u=null,d=null,f=null;if(o){let n=o.lightingModel===`Pbr`;c=this._getTexture(o.baseColorTex,e,t),l=n?this._getTexture(o.metalTex,e,t):null,u=n?this._getTexture(o.emissiveTex,e,t):null,d=n?this._getTexture(o.occlusionTex,e,t):null,f=n?this._getTexture(o.normalTex,e,t):null;let r=[c,l,u,d,f].map(e=>e?.loadPromise??null);s=Promise.all(r)}n.push(new Je(s,c,l,u,d,f))}}catch(e){throw n.forEach(e=>e.cleanup()),e}return n}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy`);let n=[],r=e.desc,i=k(...e.origin),a=this.view.groundView.spatialReference,o=this.view.state.isGlobal,s=x;if(o){let e=S();re(ne,i,e,a),s=v(b(),e)}let c=Ke(r.obb),l=o?I(this.view.spatialReference).radius:0,u=o?Math.hypot(c.centerX,c.centerY,c.centerZ)-l:c.centerZ,d=o?Math.max(-l,u-c.radius):u-c.radius,f=u+c.radius,p=[];try{let u=-1;for(let n of e.validPrimitiveIndices){u+=1;let i=r.geometry.prims[n],a=t[u];if(this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(i)),xe[i.ptype]==null){this._dbg(2,`[Unsupported Feature] Unsupported primitive mode (`+i.ptype+`). Skipping primitive.`),a.cleanup();continue}let{positionView:o,normalsData:s,colorView:c,texCoord0Data:l,indicesView:d}=this._getBufferViews(i,e);if(o==null||d==null){a.cleanup();continue}let f=o.count,m=(e,t)=>e!=null&&e!==f?(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1):!0;!m(l==null?void 0:l.length/2,`numTexcoord`)||!m(c?.count,`numColors`)||!m(s?.length,`normals`)?a.cleanup():p.push({componentIndex:u,positionView:o,indicesView:d,texCoord0Data:l,colorView:c,normalsData:s})}let m=s!==x,h=m?y(b(),s)??x:x,{vertexProcessingOutputs:g,obbHalfSizeAccumulator:_,elevationRange:v}=await this._workerHandle.processTiles3DVertices(p,i,l,o,s,c,this._imVertexNormals&&!this.usedAsGround);if(this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);let S=r.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance`);g.length>0&&c.setHalfSize(_);for(let o of g){let{componentIndex:s,positionView:l,indicesView:u,layout:d,textureCoordinateType:f,interleavedVertexData:p,indices:g}=o,_=e.validPrimitiveIndices[s],v=r.geometry.prims[_],y=t[s],b=c.clone(),x=Me(d),C=new Uint32Array([0,u.typedBuffer.length]),w=new Pe(x,this._imShading?2:0,f,m?2:0),T=new Fe({interleavedVertexData:p,vertexCount:p.byteLength/x[0].stride,indexData:g},{positions:l.typedBuffer,indices:u.typedBuffer},C,w),E=this.view.renderSpatialReference,D=O(),k=[1,1,1];ie(i,E,k,a)||this._dbg(3,`Unsupported coordinate system for IM overlay`),ae(i,E,D,a);let A=this._createComponentMaterialInitParameters(S,v.materialId,y);A.baseColorTexture||this._dbg(3,`No colour texture 1`);let j=this._collection.createObject({toMapSpace:M(D[0],D[1],k[0],k[1]),transform:new Ie(i,h),obb:b,geometry:T,elevationAlignable:!1},A);n.push(j)}return v.minElevation=Math.max(v.minElevation,d),v.maxElevation=Math.min(v.maxElevation,f),{tileObb:c,componentObjects:n,elevationRange:v}}catch(e){throw n.forEach(e=>this._collection.destroyObject(e)),e}}_createComponentMaterialInitParameters(e,t,n){let r=e?.materials!=null&&t!=null&&t!==H?e.materials[t]:null,i=1,a=r?.baseColorTex?.imageId;if(a!=null&&e&&Array.isArray(e.images)&&a>=0&&a<e.images.length){let t=e.images[a];t.alpha&&(i=Se[t.alpha])}let o=(r==null?`Unlit`:r.lightingModel)===`Pbr`,s=P,c=X,l=!1,u=2,d=ee(0,0,0),f=A(Be),p=n.baseColorTexture,m=n.metallicRoughnessTexture,h=n.emissionTexture,g=n.occlusionTexture,_=n.normalTexture;return r&&(s=N(r.baseColorFactor),c=r.alphaCutoff??X,o&&(D(f,r.metallicFactor,r.roughnessFactor,0),r.emissiveFactor&&(d=r.emissiveFactor)),l=r.isDoubleSided,u=Ce[r.faceCulling??`NotSet`]),{isIntegratedMesh:!0,baseColor:s,textureAlphaCutoff:c,mrrFactors:f,baseColorTexture:p,metallicRoughnessTexture:m,normalTexture:_,occlusionTexture:g,emissionTexture:h,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:i,doubleSided:l,cullFace:u,isGround:has(`enable-feature:im-as-ground`)?this.usedAsGround:this.replacesTerrain,groundTransparencyMode:this._groundTransparencyMode,emissiveBaseColor:d,usePBR:o,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this._renderOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){let t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){let t=W(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,n){if(this.destroyed||this.destroying)return;let r=this._frustum,i=[],a=!1,o=!1;for(let s=0;s<n;++s){if(!t[s])continue;let n=e[s],c=this._lyrHandleToObjects.get(n);if(c){if(c.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${c.stableNodeId}`);continue}a=!0,c.isLoaded=!0,this._loadedObjects.add(c),this._intersectionHandler.addTile(c),this._usedMemory+=c.usedMemory,this._cacheMemory-=c.usedMemory;let e=c.obb?.intersectsFrustum(r)??!0;c.isVisible=e,e&&(this._visibleObjects.add(c),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,c.elevationRange)),i.push(c.obb),c.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(W(n))}else this._dbg(3,`Tried to mark Non existent object ${n} as loaded`)}for(let r=0;r<n;++r){let n=e[r];if(t[r])continue;let a=this._lyrHandleToObjects.get(n);if(a){if(!a.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${a.stableNodeId}`);continue}let e=a.isVisible;this._visibleObjects.delete(a),a.isVisible=!1,a.isLoaded=!1,this._loadedObjects.delete(a),this._intersectionHandler.removeTile(a),e&&(this._visibleGeometryChanged(),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,a.elevationRange)),this._usedMemory-=a.usedMemory,this._cacheMemory+=a.usedMemory,i.push(a.obb),a.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(W(n),a)}else this._dbg(3,`Tried to mark Non existent object ${n} as not loaded`)}a&&this._visibleGeometryChanged(),i.length>0&&this._elevationProvider.notifyObjectsChanged(i),o&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){let{visibleElevationRange:n}=this,{minElevation:r,maxElevation:i}=t;return e?r<n.minElevation||i>n.maxElevation:r===n.minElevation||i===n.maxElevation}_getTexture(e,t,n){let r=e&&t.desc.materials?.images?.[e.imageId];if(!r||!G(r.data))return null;let i=t.assets[r.data];if(!i||i.byteCount<1||i.dataType!==`U8`)return null;let a=n.get(r)??this._createTexture(e,r,i,n);return a?new Le(this._stage.renderView.textures,a.id):null}_createTexture(e,n,r,i){let a=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,o=n.mipCount?!0:a>1,s=we[e.wrapMode??`None`],c=n.alpha?6408:6407,l=new Uint8Array(r.data.buffer,0,r.byteCount),u=null,d=null;switch(n.format){case`Raw`:if(n.pixelFormat===`R8`)u=l,c=6403,d=``;else if(n.pixelFormat===`Rg8`||n.pixelFormat===`Ga8`)u=l,c=33319,d=``;else if(n.pixelFormat===`Rgb8`)u=l,c=6407,d=``;else if(n.pixelFormat===`Rgba8`)u=l,c=6408,d=``;else return t.getLogger(this).error(`Raw texture pixel format ${n.pixelFormat} not supported`),null;break;case`Dxt1`:u=l,c=6407,d=`image/vnd-ms.dds`;break;case`Dxt5`:u=l,c=6408,d=`image/vnd-ms.dds`;break;case`Basis`:u=l,c=6407,d=`image/ktx2`;break;case`Etc1`:u=l,c=6407,d=`image/ktx`;break;default:return t.getLogger(this).error(`${n.format} texture not supported`),null}if(u&&d!=null){let e=Ue(c,d,n.format),t=new Re(u,{mipmap:o,maxAnisotropy:a,encoding:d,wrap:s,pixelFormat:c,internalFormat:e??void 0,immutable:e!=null,noUnpackFlip:!0,width:n.mip0Width,height:n.mip0Height});return this._stage.addTexture(t),i.set(n,t),t}return null}_getBufferViews(e,t){let n,r,i,a;for(let o=0;o<e.atrbs.length;o++){let s=e.atrbs[o],c=t.assets[s.assetId];if(!c)continue;let l=c.data.buffer,u=c.byteCount;try{switch(s.sem){case`Position`:c.ncomp!==3||c.dataType!==`F32`||!p(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Position (`+c+`)`):n=new z(l,0,void 0,u);break;case`Normal`:if(c.ncomp!==3||c.dataType!==`F32`||!p(c.data))this._dbg(3,`[Unsupported Feature] Unsupported view for Normal (`+c+`)`);else{let e=new z(l,0,void 0,u);a=new Uint32Array(e.count),ze(e.typedBuffer,new Int16Array(a.buffer,a.byteOffset,a.length*2))}break;case`TexCoord`:c.ncomp!==2||c.dataType!==`F32`||!p(c.data)?this._dbg(3,`[Unsupported Feature] Unsupported view for Texcoord (`+c+`)`):i===void 0&&(i=new R(l,0,void 0,u).typedBuffer);break;case`Color`:c.dataType===`U8`&&f(c.data)&&(c.ncomp===4?r=new ue(l,0,void 0,u):c.ncomp===3&&(r=new L(l,0,void 0,u))),r??this._dbg(3,`[Unsupported Feature] Unsupported view for Color (`+c+`)`);break;case`FeatureIndex`:break;default:this._dbg(2,`[Unsupported Feature] Unsupported semantic (`+s.sem+`). Skipping vertex attribute.`)}}catch(e){this._dbg(2,`Error Creating buffer (`+e+`). Skipping vertex attribute.`)}}let o,s=!1;if(G(e.index)){let n=t.assets[e.index];if(!n)s=!0;else{let e=n.byteCount;switch(n.dataType){case`U16`:n.ncomp===1&&h(n.data)&&(o=new V(n.data.buffer,0,void 0,e));break;case`U32`:n.ncomp===1&&m(n.data)&&(o=new B(n.data.buffer,0,void 0,e))}s=!o}}if(!s&&o==null&&n!=null){let e=n.count;o=o=e<65535?new V(new Uint16Array(e).buffer):new B(new Uint32Array(e).buffer);for(let t=0;t<e;t++)o.set(t,t)}return{positionView:n,colorView:r,texCoord0Data:i,indicesView:o,normalsData:a}}_loadModifications(){if(this.removeHandles(`modifications`),this.layer.modifications==null){this._modifications=[];return}let e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.usedAsGround&&e.type!==`replace`)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info(`Ground layers only support replace modifications. Other modification types have been ignored.`)},s),`modifications`)}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,n){this._dbgFlags.has(e)&&(e===3?t.getLogger(this).error(n):t.getLogger(this).warn(n))}};e([g()],Q.prototype,`freeze`,void 0),e([g()],Q.prototype,`fullOpacity`,null),e([g()],Q.prototype,`opaque`,null),e([g()],Q.prototype,`invisible`,null),e([g({readOnly:!0})],Q.prototype,`ready`,null),e([g({type:[U]})],Q.prototype,`_modifications`,void 0),e([g()],Q.prototype,`_visibleGeometryChangedSchedulerHandle`,void 0),e([g()],Q.prototype,`layer`,void 0),e([g({readOnly:!0})],Q.prototype,`visibleAtCurrentScale`,null),e([g({readOnly:!0})],Q.prototype,`_collection`,null),e([g()],Q.prototype,`elevationOffset`,null),e([g({readOnly:!0})],Q.prototype,`visibleElevationRange`,null),e([g()],Q.prototype,`fullExtentInLocalViewSpatialReference`,void 0),Q=e([_(`esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D`)],Q);const We=Q;class Ge{constructor(e,t,n,r,i,a,o,s,c,l){this.handle=e,this.componentObjects=t,this.textures=n,this.cpuMemoryUsage=r,this.vboMemoryUsage=i,this.textureMemoryUsage=a,this.obb=o,this.stableNodeId=s,this.nodeDepth=c,this.elevationRange=l,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;let u=O();o?.getCenter(u),this._obbCenterX=u[0],this._obbCenterY=u[1],this._obbCenterZ=u[2];let d=o?.radius??-1;this._obbRadius=d,this._obbRadiusSquared=d*d,this._obbShortestHalfsize=o?Math.min(o.halfSizeX,o.halfSizeY,o.halfSizeZ):0,this._mbsCenter=o?o.getCenter(O()):j}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){if(!this.obb)return!0;let{_obbCenterX:n,_obbCenterY:r,_obbCenterZ:i}=this,a=n-e[0],o=r-e[1],s=i-e[2],c=a*t[0]+o*t[1]+s*t[2];return a*a+o*o+s*s-c*c<=this._obbRadiusSquared&&this.obb.intersectRay(e,t)}boundingVolumeIntersectsSphere(e){let t=this._obbRadius;if(t<0)return!0;let n=e.center,r=e.radius,i=t+r,a=this._obbCenterX-n[0];if(a>i)return!1;let o=this._obbCenterY-n[1];if(o>i)return!1;let s=this._obbCenterZ-n[2];if(s>i)return!1;let c=a*a+o*o+s*s;if(c>i*i)return!1;if(c<=(this._obbShortestHalfsize+r)**2)return!0;let l=r-t;return l>0&&c<=l*l?!0:this.obb?.intersectSphere(e)??!0}}function $(e){return Math.round(e/1048.576)/1e3}function Ke(e){return new je(e.center,e.halfSize,C(...e.quaternion))}const qe=[];class Je{constructor(e,t,n,r,i,a){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=n,this.emissionTexture=r,this.occlusionTexture=i,this.normalTexture=a}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}export{We as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{estimateNumberArrayMemory as r}from"../../../core/memoryEstimations.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{initial as a,watch as o,sync as s}from"../../../core/reactiveUtils.js";import{generateUID as c}from"../../../core/uid.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{set as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as f,create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as m}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as h}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as g,extentContainsCoords2D as _}from"../../../geometry/support/contains.js";import{newDoubleArray as v,doubleArrayFrom as ee}from"../../../geometry/support/DoubleArray.js";import{isInEffectiveScaleRange as te}from"../../../geometry/support/scaleUtils.js";import{getGeometryZScaler as ne}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as re}from"../../../layers/LayerConstants.js";import{estimateSize as ie}from"../../../layers/graphics/dehydratedFeatures.js";import{ImmutableDehydratedPoint as y}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as b}from"../../../layers/graphics/hydratedFeatures.js";import x from"../../../layers/graphics/controllers/I3SOnDemandController.js";import ae from"../../../layers/support/FeatureFilter.js";import{I3SExtractChanges as S}from"../../../layers/support/I3SExtractChanges.js";import C from"../../../rest/support/Query.js";import{isBasemapLayerView as oe}from"../../../support/basemapUtils.js";import{isGraphic as se}from"../../../support/graphicInstanceUtils.js";import{I3SPointsWorkerHandle as w}from"./I3SPointsWorkerHandle.js";import{LayerView3D as ce}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as T}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as E}from"./graphics/QueryEngine.js";import{QueryEngineContext as D}from"./graphics/QueryEngineContext.js";import{createInteractiveEditSession as O,normalizeEditResultsEvent as k,processAttributeEdits as A}from"./i3s/featureEditing.js";import{getCachedAttributeValue as j}from"./i3s/I3SBinaryReader.js";import{I3SGraphicsMap as M}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as N}from"./i3s/I3SOverrides.js";import{checkRecyclable as P,checkSpatialReferences as F,containsDraco as I,whenGraphicAttributes as L}from"./i3s/I3SUtil.js";import{attributeLookup as R}from"./support/attributeUtils.js";import{DefinitionExpressionSceneLayerView as z}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as B}from"./support/fieldProperties.js";import{normalizeHighlightTarget as V,emptyHighlightHandle as H,isObjectId as U}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as le}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as W}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as ue}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as de}from"./support/TemporalSceneLayerView.js";import{debugFlags as G}from"../support/debugFlags.js";import{compute as fe}from"../support/orientedBoundingBox.js";import{updatingProgress as pe}from"../support/updatingProperties.js";import{Vertices as me}from"../webgl-engine/lib/Attribute.js";import he from"../../layers/SceneLayerView.js";import{hasPopupTemplate as ge}from"../../layers/support/popupUtils.js";import{getHighlightName as _e}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as K}from"../../support/layerViewUtils.js";import{TaskPriority as ve}from"../../support/Scheduler.js";const q=B();class ye{constructor(e,t,n,r){this.graphics=e,this.featureIds=t,this.attributeInfo=n,this.node=r}get usedMemory(){return this.graphics.reduce((e,t)=>ie(t)+e,r(this.featureIds)+1024)}}let J=class extends de(z(W(ce(he)))){constructor(){super(...arguments),this.type=`scene-layer-graphics-3d`,this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this._pendingEditsQueue=Promise.resolve(),this.loadedGraphics=new M((e,t,n)=>Se(e,t,n),e=>this.processor.graphicsCore.recreateGraphics(e),this.logError),this.holeFilling=`always`,this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url!==this.layer.url||!this._i3sOverrides.isEmpty?null:e.load(t).then(()=>{i(t),P(this.layer,e,this._i3sOverrides),this.layer=e,this._reinitializeOverrides(),n(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()})}initialize(){this.addResolvingPromise(this.layer.indexInfo),this._reinitializeOverrides(),F(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new ue({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),a),this._updatingHandles.add(()=>this.layer.renderer,(e,t)=>this._rendererChange(e,t)),this._updatingHandles.add(()=>[this.parsedDefinitionExpression,this.layer.excludeObjectIds],()=>this._filterChange()),this._set(`processor`,new T({owner:this,preferredUpdatePolicy:0,scaleVisibilityEnabled:!K(),filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on(`invalidate-elevation`,({extent:e,spatialReference:t})=>this._controller.updateElevationChanged(e,t)),this.supportsHeightUnitConversion&&(this._verticalScale=ne(`point`,this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.when()),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new x({layerView:this}),I(this.layer.geometryDefinitions)&&(this._workerHandle=new w(e=>this.view.resourceController.immediate.schedule(e))),this.addHandles(this.layer.on(`apply-edits`,e=>this._updatingHandles.addPromise(e.result))),this.addHandles([this.layer.on(`edits`,e=>{let t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.consumePromise(t)}),o(()=>G.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){let e=this._controller.crsIndex;import(`./support/I3STreeDebugger.js`).then(({I3STreeDebugger:t})=>{!this._treeDebugger&&G.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else!e&&this._treeDebugger&&!G.I3S_TREE_SHOW_TILES&&(this._treeDebugger.destroy(),this._treeDebugger=null)},a)]),this.when(()=>{this._setupQueryEngine(),this._updatingHandles.add(()=>this.availableFields,()=>this._queryEngine?.clear(),s),this._updatingHandles.add(()=>this.maximumNumberOfFeatures,e=>this._controller.featureTarget=e,a),this._updatingHandles.add(()=>this.suspended,e=>{e&&this._removeAllNodeData()})}).catch(()=>{})}_reinitializeOverrides(){this._i3sOverrides?.destroy(),this._extractChanges?.destroy();let{layer:e}=this,t=this.view.resourceController?.memoryController;this._extractChanges=new S({layer:e}),this._i3sOverrides=new N({view:this.view,layer:e,memoryController:t,extractChanges:this._extractChanges})}destroy(){this._treeDebugger=n(this._treeDebugger),this._i3sOverrides=n(this._i3sOverrides),this._extractChanges=n(this._extractChanges),this._set(`processor`,n(this.processor)),this._controller=n(this._controller),this._queryEngine=n(this._queryEngine),this._workerHandle=n(this._workerHandle),this._memCache=n(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=n(this._fieldsHelper)}get layerViewUid(){return this.uid}get updatingProgressValue(){return this._controller?.updatingProgress??1}get visibleAtCurrentScale(){return K()?te(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){return this.processor?.graphicsCore?.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){e==null?(this._clearOverride(`maximumNumberOfFeatures`),this._controller.fixedFeatureTarget=!1):(this._override(`maximumNumberOfFeatures`,e),this._controller.fixedFeatureTarget=!0)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached}get _excludeObjectIds(){return new Set(this.layer.excludeObjectIds)}get lodFactor(){return this.layer.semantic===`Labels`?1:this.view.qualitySettings.sceneService.pointLoDFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&this.layer?.legendEnabled===!0}get _graphicOrigin(){return this.layer.graphicOrigin}async whenGraphicAttributes(e,t){return L(this.layer,e,this._getObjectIdField(),t,()=>[...this.loadedGraphics.nodes()])}getHit(e){if(!this.loadedGraphics)return null;let t=b(this.loadedGraphics.find(t=>t.uid===e),this.layer,this._graphicOrigin),n=this._getObjectIdField();return t?.attributes?.[n]==null?null:{type:`graphic`,graphic:t,layer:t.layer}}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e,t){let n=_e(t),r=this.layer.objectIdField,i=V(e);if(i.length===0)return H;if(se(i[0])){let e=i;if(R(this.layer.fieldsIndex,e[0].attributes,r)!=null){let t=e.map(e=>R(this.layer.fieldsIndex,e.attributes,r));return this.processor.highlightByObjectIds(t,r,n)}return this.processor.highlightByGraphics(e,n)}return U(i[0])?this.processor.highlightByObjectIds(i,r,n):H}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return O(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){let n={geometryBuffer:e.geometryBuffer};this._workerHandle??=new w(e=>this.view.resourceController.immediate.schedule(e));let r=await this._workerHandle.invoke(n,t);if(r==null)throw Error(`Failed to decompress Draco point data`);return{positionData:r.positions,featureIds:r.featureIds}}async addNode(e,n,r){if(!Y(n)&&!xe(n))throw Error();if(this.loadedGraphics.hasNode(e.index)){t.getLogger(this).error(`I3S node `+e.id+` already added`);return}let i=this.layer.fullExtent==null?null:Ce(this.layer.fullExtent.clone(),.5),{featureIds:a,pointPositions:o}=Y(n)?await this._extractBinaryPointPositions(e,n,r):this._extractLegacyPointPositions(n),s=[];this._validatePositions(e,a,o,i,s);let c=this._controller.crsVertex,l=this.view.spatialReference;m(o,c,0,o,l,0,a.length);let u=Y(n)?e.level:0,d=this._createGraphics(a,o,e.index,u),f=new ye(d,a,n.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(f.featureIds,n.attributeDataInfo,r),e.numFeatures=f.graphics.length,this._updateNodeMemory(e),X(f),s.length>0&&(this._computeObb(e,s,c),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e)){this._cacheNodeData(f);return}if(this._verticalScale!=null)for(let e of f.graphics)this._verticalScale(e.geometry);let p=this.view.stage.renderView.olidRenderHelper;if(p){let e=oe(this.view,this.uid);for(let t=0;t<f.featureIds.length;t++){let n=f.featureIds[t];p.setUidToObjectAndLayerId(n,f.graphics[t].uid,this.layer.id,this.uid,this.layer.popupEnabled&&!e&&ge(this.layer,this.view.popup?.defaultPopupTemplateEnabled),f.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,f),this._controller.updateLoadStatus(e.index,!0),this._filterNode(f),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,n){let r=this._controller.crsIndex,i=r.isGeographic?this.view.renderSpatialReference:r;m(t,n,0,t,i,0),e.serviceObbInIndexSR=fe(new me(t,3)),r.isGeographic&&(h(e.serviceObbInIndexSR.getCenter(Z),i,Z,r),e.serviceObbInIndexSR.setCenter(Z))}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}getNodeComponentHandle(){}async _extractBinaryPointPositions(e,t,n){let r=await this._decompressBinaryPointData(t,n),i=r.positionData,a=i.length/3,o=v(a*3),s=e.serviceObbInIndexSR==null?f:e.serviceObbInIndexSR.getCenter(Te),c=Math.abs(s[2])*2**-20;for(let e=0;e<a;e++){let t=e*3;o[t]=i[t]+s[0],o[t+1]=i[t+1]+s[1],o[t+2]=i[t+2]+s[2],Math.abs(o[t+2])<c&&(o[t+2]=0)}return{featureIds:r.featureIds?ee(r.featureIds):[],pointPositions:o}}_extractLegacyPointPositions(e){let t=e.pointData.length,n=v(3*t),r=[];for(let i=0;i<t;i++){let t=e.pointData[i],a=t.featureDataPosition,o=a.length,s=t.geometries?.[0]??we[o],c=t.featureIds[0];if(s.type!==`Embedded`||s.params.type!==`points`||o<2||o>3)continue;let l=s.params.vertexAttributes?.position??[0,0,0],u=r.length*3;n[u]=a[0]+l[0],n[u+1]=a[1]+l[1],n[u+2]=o===3?a[2]+l[2]:NaN,r.push(c)}return{featureIds:r,pointPositions:n}}_validatePositions(e,n,r,i,a){if(i==null&&e.serviceObbInIndexSR)return;let o=n.length;for(let n=0;n<o;n++){let o=n*3;d(Z,r[o],r[o+1],r[o+2]);let s=!Number.isNaN(r[2]);i!=null&&(s?!g(i,Z):!_(i,Z))&&(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error(`Service Error: Coordinates outside of layer extent`),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error(`Maximum number of errors reached. Further errors are ignored.`),this._coordinatesOutsideExtentErrors++),e.serviceObbInIndexSR||a.push(Z[0],Z[1],Z[2])}}_createGraphics(e,t,n,r){let i=e.length,a=this._getObjectIdField(),o=this.processor.graphicsCore,s=[],l=this.view.spatialReference;for(let u=0;u<i;u++){let i=e[u],d={};i!=null&&(d[a]=i);let f=i??c(),p=u*3,m=isNaN(t[p+2])?void 0:t[p+2],h=new y(l,t[p],t[p+1],m),g=this.loadedGraphics.get(f);if(g!=null)(g.level==null||g.level<r)&&(Q.property=`geometry`,Q.graphic=g,Q.oldValue=g.geometry,Q.newValue=h,g.geometry=h,g.level=r,o.graphicUpdateHandler(Q),$()),s.push(g);else{let e=c();s.push({objectId:f,uid:e,geometry:h,attributes:d,visible:!0,nodeIndex:n,level:r})}}return s}_updateNodeMemory(e){e.memory=4096+(e.numFeatures??0)*this.processor.graphicsCore.usedMemoryPerGraphic}_cacheNodeData(e){this._memCache.put(this._getMemCacheKey(e.node),e)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((e,t)=>{if(e){let t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)}),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){let t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){let t=this.loadedGraphics.getNode(e);return t==null?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,n,r,i){this.loadedGraphics.hasNode(e.index)?t.getLogger(this).error(`I3S node `+e.id+` already added`):(await this._i3sOverrides.applyAttributeOverrides(n.featureIds,r,i),n.attributeInfo=r,this.loadedGraphics.addNode(e.index,n),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),X(n),this._filterNode(n),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){let e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node.id)),e.sort()}getVisibleNodes(){let e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node)),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode((t,n)=>e.push(n))}getLoadedAttributes(e){let t=this.loadedGraphics.getNode(e);if(t?.attributeInfo!=null)return t.attributeInfo.loadedAttributes}getAttributeData(e){let t=this.loadedGraphics.getNode(e);if(t?.attributeInfo!=null)return t.attributeInfo.attributeData}_setAttributeData(e,t){let n=this.loadedGraphics.getNode(e);n?.attributeInfo!=null&&(n.attributeInfo.attributeData=t,this._attributeValuesChanged(n))}async updateAttributes(e,t,n){let r=this.loadedGraphics.getNode(e);r!=null&&(await this._i3sOverrides.applyAttributeOverrides(r.featureIds,t,n),r.attributeInfo=t,this._attributeValuesChanged(r))}_attributeValuesChanged(e){X(e),this._filterNode(e);let{processor:t}=this,{graphicsCore:n}=t;if(n.labelsEnabled){let t=e.node.index,r=[];e.graphics.forEach(e=>e.nodeIndex===t&&r.push(e.uid)),n.updateLabelingInfo(r)}t.refreshFilter()}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||re}_getGlobalIdField(){return this.layer.globalIdField}async _rendererChange(e,t){let{layer:{fieldsIndex:n}}=this,r=new Set,i;e?(await e.collectRequiredFields(r,n),i=Array.from(r).sort()):i=[],r.clear();let a;t?(await t.collectRequiredFields(r,n),a=Array.from(r).sort()):a=[],i.length===a.length&&i.every((e,t)=>i[t]===a[t])||this._reloadAllNodes()}_rangeInfosChanged(e){e!=null&&e.length>0&&t.getLogger(this).warn(`Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.`)}_filterChange(){this.loadedGraphics.forEachNode(e=>this._filterNode(e))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){let t=this.parsedDefinitionExpression,n=this._excludeObjectIds,r=this._getObjectIdField();for(let i of e.graphics){let e=i.visible,a=this._evaluateClause(t,i),o=!n.has(i.attributes[r]);i.visible=a&&o,e!==i.visible&&(Q.graphic=i,Q.property=`visible`,Q.oldValue=e,Q.newValue=i.visible,this.processor.graphicsCore.graphicUpdateHandler(Q),$())}}createQuery(){let e={outFields:[`*`],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return this.filter?.createQuery(e)??new C(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(e==null?this.createQuery():C.from(e))}_setupQueryEngine(){let{layer:e,view:t,hasM:n,hasZ:r}=this,{spatialReference:i,resourceController:a}=t,o=new D(i,e,a,()=>this.processor.featureStore,r,n,()=>this.availableFields);this._queryEngine=new E({context:o,priority:ve.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))*.8}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(e){let t=this._attributeEditingContext,n=await k(t,e);A(t,n)}get _attributeEditingContext(){let e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode(t=>e(t.node,t.featureIds)),attributeStorageInfo:this.layer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,n,r)=>{this._setAttributeData(t,n);let i=this.loadedGraphics.getNode(t);if(r!=null){let t=this.loadedGraphics.get(r.attributes[e]);t!=null&&this.processor.graphicsCore.recreateGraphics([t])}else i!=null&&this.processor.graphicsCore.recreateGraphics(i.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new le(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}};e([l()],J.prototype,`processor`,void 0),e([l({type:ae})],J.prototype,`filter`,void 0),e([l()],J.prototype,`loadedGraphics`,void 0),e([l()],J.prototype,`layerViewUid`,null),e([l()],J.prototype,`_controller`,void 0),e([l()],J.prototype,`updating`,void 0),e([l()],J.prototype,`suspended`,void 0),e([l(pe)],J.prototype,`updatingProgress`,void 0),e([l()],J.prototype,`updatingProgressValue`,null),e([l({readOnly:!0})],J.prototype,`visibleAtCurrentScale`,null),e([l(q.requiredFields)],J.prototype,`requiredFields`,null),e([l(q.availableFields)],J.prototype,`availableFields`,void 0),e([l()],J.prototype,`_fieldsHelper`,void 0),e([l({type:Number})],J.prototype,`maximumNumberOfFeatures`,null),e([l({readOnly:!0})],J.prototype,`maximumNumberOfFeaturesExceeded`,null),e([l()],J.prototype,`_excludeObjectIds`,null),e([l({readOnly:!0})],J.prototype,`lodFactor`,null),e([l({readOnly:!0})],J.prototype,`hasM`,null),e([l({readOnly:!0})],J.prototype,`hasZ`,null),e([l()],J.prototype,`contentVisible`,null),e([l({readOnly:!0})],J.prototype,`legendEnabled`,null),e([l()],J.prototype,`_graphicOrigin`,null),J=e([u(`esri.views.3d.layers.SceneLayerGraphicsView3D`)],J);const be=J;function xe(e){return`pointData`in e}function Y(e){return`geometryBuffer`in e&&e.geometryBuffer!==null}function Se(e,t,n){let r=t.attributeInfo;if(r?.loadedAttributes==null||r.attributeData==null)return!1;let i=!1;for(let{name:t}of r.loadedAttributes)if(r.attributeData[t]){let a=j(r.attributeData[t],n);a!==e.attributes[t]&&(e.attributes[t]=a,i=!0)}return i}function X(e){let t=e.attributeInfo;if(t?.loadedAttributes==null||t.attributeData==null)return;let n=e.node.index;for(let r=0;r<e.graphics.length;r++){let i=e.graphics[r];if(i.nodeIndex===n){i.attributes||={};for(let{name:e}of t.loadedAttributes)t.attributeData[e]&&(i.attributes[e]=j(t.attributeData[e],r))}}}function Ce(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,e.zmin!=null&&e.zmax!=null&&(e.zmin-=t,e.zmax+=t),e.mmin!=null&&e.mmax!=null&&(e.mmin-=t,e.mmax+=t),e}const we={2:{type:`Embedded`,params:{type:`points`,vertexAttributes:{position:[0,0]}}},3:{type:`Embedded`,params:{type:`points`,vertexAttributes:{position:[0,0,0]}}}},Z=p(),Q={graphic:null,property:null,oldValue:null,newValue:null},Te=p();function $(){Q.graphic=null,Q.property=null,Q.oldValue=null,Q.newValue=null}export{be as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{estimateNumberArrayMemory as r}from"../../../core/memoryEstimations.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{initial as a,watch as o,sync as s,on as c}from"../../../core/reactiveUtils.js";import{generateUID as l}from"../../../core/uid.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import{set as f}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as p,create as m}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as h}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as g}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as ee,extentContainsCoords2D as te}from"../../../geometry/support/contains.js";import{newDoubleArray as _,doubleArrayFrom as v}from"../../../geometry/support/DoubleArray.js";import{isInEffectiveScaleRange as y}from"../../../geometry/support/scaleUtils.js";import{getGeometryZScaler as b}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as ne}from"../../../layers/LayerConstants.js";import{estimateSize as re}from"../../../layers/graphics/dehydratedFeatures.js";import{ImmutableDehydratedPoint as ie}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as ae}from"../../../layers/graphics/hydratedFeatures.js";import oe from"../../../layers/graphics/controllers/I3SOnDemandController.js";import se from"../../../layers/support/FeatureFilter.js";import{I3SExtractChanges as ce}from"../../../layers/support/I3SExtractChanges.js";import x from"../../../rest/support/Query.js";import{isBasemapLayerView as le}from"../../../support/basemapUtils.js";import{isGraphic as ue}from"../../../support/graphicInstanceUtils.js";import{I3SPointsWorkerHandle as S}from"./I3SPointsWorkerHandle.js";import{LayerView3D as C}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as w}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as T}from"./graphics/QueryEngine.js";import{QueryEngineContext as E}from"./graphics/QueryEngineContext.js";import{createInteractiveEditSession as D,normalizeEditResultsEvent as O,processAttributeEdits as k}from"./i3s/featureEditing.js";import{getCachedAttributeValue as A}from"./i3s/I3SBinaryReader.js";import{I3SGraphicsMap as j}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as M}from"./i3s/I3SOverrides.js";import{checkRecyclable as N,checkSpatialReferences as P,containsDraco as F,whenGraphicAttributes as I}from"./i3s/I3SUtil.js";import{attributeLookup as L}from"./support/attributeUtils.js";import{createFeatureFilterHighlight as R}from"./support/createFeatureFilterHighlight.js";import{DefinitionExpressionSceneLayerView as z}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as B}from"./support/fieldProperties.js";import{isFeatureFilter as V,emptyHighlightHandle as H,normalizeHighlightTarget as U,isObjectId as de}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as fe}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as pe}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as me}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as he}from"./support/TemporalSceneLayerView.js";import{debugFlags as W}from"../support/debugFlags.js";import{compute as ge}from"../support/orientedBoundingBox.js";import{updatingProgress as _e}from"../support/updatingProperties.js";import{Vertices as ve}from"../webgl-engine/lib/Attribute.js";import ye from"../../layers/SceneLayerView.js";import{hasPopupTemplate as be}from"../../layers/support/popupUtils.js";import{getHighlightName as xe}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as G}from"../../support/layerViewUtils.js";import{TaskPriority as Se}from"../../support/Scheduler.js";const K=B();class Ce{constructor(e,t,n,r){this.graphics=e,this.featureIds=t,this.attributeInfo=n,this.node=r}get usedMemory(){return this.graphics.reduce((e,t)=>re(t)+e,r(this.featureIds)+1024)}}let q=class extends he(z(pe(C(ye)))){constructor(){super(...arguments),this.type=`scene-layer-graphics-3d`,this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this._pendingEditsQueue=Promise.resolve(),this.loadedGraphics=new j((e,t,n)=>Ee(e,t,n),e=>this.processor.graphicsCore.recreateGraphics(e),this.logError),this.holeFilling=`always`,this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url!==this.layer.url||!this._i3sOverrides.isEmpty?null:e.load(t).then(()=>{i(t),N(this.layer,e,this._i3sOverrides),this.layer=e,this._reinitializeOverrides(),n(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()})}initialize(){this.addResolvingPromise(this.layer.indexInfo),this._reinitializeOverrides(),P(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new me({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),a),this._updatingHandles.add(()=>this.layer.renderer,(e,t)=>this._rendererChange(e,t)),this._updatingHandles.add(()=>[this.parsedDefinitionExpression,this.layer.excludeObjectIds],()=>this._filterChange()),this._set(`processor`,new w({owner:this,preferredUpdatePolicy:0,scaleVisibilityEnabled:!G(),filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on(`invalidate-elevation`,({extent:e,spatialReference:t})=>this._controller.updateElevationChanged(e,t)),this.supportsHeightUnitConversion&&(this._verticalScale=b(`point`,this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.when()),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new oe({layerView:this}),F(this.layer.geometryDefinitions)&&(this._workerHandle=new S(e=>this.view.resourceController.immediate.schedule(e))),this.addHandles(this.layer.on(`apply-edits`,e=>this._updatingHandles.addPromise(e.result))),this.addHandles([this.layer.on(`edits`,e=>{let t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.consumePromise(t)}),o(()=>W.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){let e=this._controller.crsIndex;import(`./support/I3STreeDebugger.js`).then(({I3STreeDebugger:t})=>{!this._treeDebugger&&W.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else!e&&this._treeDebugger&&!W.I3S_TREE_SHOW_TILES&&(this._treeDebugger.destroy(),this._treeDebugger=null)},a)]),this.when(()=>{this._setupQueryEngine(),this._updatingHandles.add(()=>this.availableFields,()=>this._queryEngine?.clear(),s),this._updatingHandles.add(()=>this.maximumNumberOfFeatures,e=>this._controller.featureTarget=e,a),this._updatingHandles.add(()=>this.suspended,e=>{e&&this._removeAllNodeData()})}).catch(()=>{})}_reinitializeOverrides(){this._i3sOverrides?.destroy(),this._extractChanges?.destroy();let{layer:e}=this,t=this.view.resourceController?.memoryController;this._extractChanges=new ce({layer:e}),this._i3sOverrides=new M({view:this.view,layer:e,memoryController:t,extractChanges:this._extractChanges})}destroy(){this._treeDebugger=n(this._treeDebugger),this._i3sOverrides=n(this._i3sOverrides),this._extractChanges=n(this._extractChanges),this._set(`processor`,n(this.processor)),this._controller=n(this._controller),this._queryEngine=n(this._queryEngine),this._workerHandle=n(this._workerHandle),this._memCache=n(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=n(this._fieldsHelper)}get layerViewUid(){return this.uid}get updatingProgressValue(){return this._controller?.updatingProgress??1}get visibleAtCurrentScale(){return G()?y(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){return this.processor?.graphicsCore?.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){e==null?(this._clearOverride(`maximumNumberOfFeatures`),this._controller.fixedFeatureTarget=!1):(this._override(`maximumNumberOfFeatures`,e),this._controller.fixedFeatureTarget=!0)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached}get _excludeObjectIds(){return new Set(this.layer.excludeObjectIds)}get lodFactor(){return this.layer.semantic===`Labels`?1:this.view.qualitySettings.sceneService.pointLoDFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&this.layer?.legendEnabled===!0}get _graphicOrigin(){return this.layer.graphicOrigin}async whenGraphicAttributes(e,t){return I(this.layer,e,this._getObjectIdField(),t,()=>[...this.loadedGraphics.nodes()])}getHit(e){if(!this.loadedGraphics)return null;let t=ae(this.loadedGraphics.find(t=>t.uid===e),this.layer,this._graphicOrigin),n=this._getObjectIdField();return t?.attributes?.[n]==null?null:{type:`graphic`,graphic:t,layer:t.layer}}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e,t){let n=xe(t),r=this.layer.objectIdField;if(V(e)){let t=this.processor.graphicsCore.objectStates;if(!t)return H;let i=this._registerHighlightFilter(e),{set:a,handle:o}=t.acquireHighlightSet(n,r);return R({owner:this,handles:[i,o],filter:e,layer:this.layer,scheduler:this.view.resourceController.scheduler,updatingHandles:this._updatingHandles,getAvailableFields:()=>this.availableFields,query:t=>this._queryEngine.executeQueryForIdSet(e,null,t),apply:e=>t.updateObjectIds(a,e),onChange:e=>c(()=>this.processor.featureStore.events,`changed`,e)})}let i=U(e);if(i.length===0)return H;if(ue(i[0])){let e=i;if(L(this.layer.fieldsIndex,e[0].attributes,r)!=null){let t=e.map(e=>L(this.layer.fieldsIndex,e.attributes,r));return this.processor.highlightByObjectIds(t,r,n)}return this.processor.highlightByGraphics(e,n)}return de(i[0])?this.processor.highlightByObjectIds(i,r,n):H}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return D(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){let n={geometryBuffer:e.geometryBuffer};this._workerHandle??=new S(e=>this.view.resourceController.immediate.schedule(e));let r=await this._workerHandle.invoke(n,t);if(r==null)throw Error(`Failed to decompress Draco point data`);return{positionData:r.positions,featureIds:r.featureIds}}async addNode(e,n,r){if(!J(n)&&!Te(n))throw Error();if(this.loadedGraphics.hasNode(e.index)){t.getLogger(this).error(`I3S node `+e.id+` already added`);return}let i=this.layer.fullExtent==null?null:X(this.layer.fullExtent.clone(),.5),{featureIds:a,pointPositions:o}=J(n)?await this._extractBinaryPointPositions(e,n,r):this._extractLegacyPointPositions(n),s=[];this._validatePositions(e,a,o,i,s);let c=this._controller.crsVertex,l=this.view.spatialReference;h(o,c,0,o,l,0,a.length);let u=J(n)?e.level:0,d=this._createGraphics(a,o,e.index,u),f=new Ce(d,a,n.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(f.featureIds,n.attributeDataInfo,r),e.numFeatures=f.graphics.length,this._updateNodeMemory(e),Y(f),s.length>0&&(this._computeObb(e,s,c),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e)){this._cacheNodeData(f);return}if(this._verticalScale!=null)for(let e of f.graphics)this._verticalScale(e.geometry);let p=this.view.stage.renderView.olidRenderHelper;if(p){let e=le(this.view,this.uid);for(let t=0;t<f.featureIds.length;t++){let n=f.featureIds[t];p.setUidToObjectAndLayerId(n,f.graphics[t].uid,this.layer.id,this.uid,this.layer.popupEnabled&&!e&&be(this.layer,this.view.popup?.defaultPopupTemplateEnabled),f.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,f),this._controller.updateLoadStatus(e.index,!0),this._filterNode(f),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,n){let r=this._controller.crsIndex,i=r.isGeographic?this.view.renderSpatialReference:r;h(t,n,0,t,i,0),e.serviceObbInIndexSR=ge(new ve(t,3)),r.isGeographic&&(g(e.serviceObbInIndexSR.getCenter(Z),i,Z,r),e.serviceObbInIndexSR.setCenter(Z))}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}getNodeComponentHandle(){}async _extractBinaryPointPositions(e,t,n){let r=await this._decompressBinaryPointData(t,n),i=r.positionData,a=i.length/3,o=_(a*3),s=e.serviceObbInIndexSR==null?p:e.serviceObbInIndexSR.getCenter(Oe),c=Math.abs(s[2])*2**-20;for(let e=0;e<a;e++){let t=e*3;o[t]=i[t]+s[0],o[t+1]=i[t+1]+s[1],o[t+2]=i[t+2]+s[2],Math.abs(o[t+2])<c&&(o[t+2]=0)}return{featureIds:r.featureIds?v(r.featureIds):[],pointPositions:o}}_extractLegacyPointPositions(e){let t=e.pointData.length,n=_(3*t),r=[];for(let i=0;i<t;i++){let t=e.pointData[i],a=t.featureDataPosition,o=a.length,s=t.geometries?.[0]??De[o],c=t.featureIds[0];if(s.type!==`Embedded`||s.params.type!==`points`||o<2||o>3)continue;let l=s.params.vertexAttributes?.position??[0,0,0],u=r.length*3;n[u]=a[0]+l[0],n[u+1]=a[1]+l[1],n[u+2]=o===3?a[2]+l[2]:NaN,r.push(c)}return{featureIds:r,pointPositions:n}}_validatePositions(e,n,r,i,a){if(i==null&&e.serviceObbInIndexSR)return;let o=n.length;for(let n=0;n<o;n++){let o=n*3;f(Z,r[o],r[o+1],r[o+2]);let s=!Number.isNaN(r[2]);i!=null&&(s?!ee(i,Z):!te(i,Z))&&(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error(`Service Error: Coordinates outside of layer extent`),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error(`Maximum number of errors reached. Further errors are ignored.`),this._coordinatesOutsideExtentErrors++),e.serviceObbInIndexSR||a.push(Z[0],Z[1],Z[2])}}_createGraphics(e,t,n,r){let i=e.length,a=this._getObjectIdField(),o=this.processor.graphicsCore,s=[],c=this.view.spatialReference;for(let u=0;u<i;u++){let i=e[u],d={};i!=null&&(d[a]=i);let f=i??l(),p=u*3,m=isNaN(t[p+2])?void 0:t[p+2],h=new ie(c,t[p],t[p+1],m),g=this.loadedGraphics.get(f);if(g!=null)(g.level==null||g.level<r)&&(Q.property=`geometry`,Q.graphic=g,Q.oldValue=g.geometry,Q.newValue=h,g.geometry=h,g.level=r,o.graphicUpdateHandler(Q),$()),s.push(g);else{let e=l();s.push({objectId:f,uid:e,geometry:h,attributes:d,visible:!0,nodeIndex:n,level:r})}}return s}_updateNodeMemory(e){e.memory=4096+(e.numFeatures??0)*this.processor.graphicsCore.usedMemoryPerGraphic}_cacheNodeData(e){this._memCache.put(this._getMemCacheKey(e.node),e)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((e,t)=>{if(e){let t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)}),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){let t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){let t=this.loadedGraphics.getNode(e);return t==null?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,n,r,i){this.loadedGraphics.hasNode(e.index)?t.getLogger(this).error(`I3S node `+e.id+` already added`):(await this._i3sOverrides.applyAttributeOverrides(n.featureIds,r,i),n.attributeInfo=r,this.loadedGraphics.addNode(e.index,n),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),Y(n),this._filterNode(n),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){let e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node.id)),e.sort()}getVisibleNodes(){let e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node)),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode((t,n)=>e.push(n))}getLoadedAttributes(e){let t=this.loadedGraphics.getNode(e);if(t?.attributeInfo!=null)return t.attributeInfo.loadedAttributes}getAttributeData(e){let t=this.loadedGraphics.getNode(e);if(t?.attributeInfo!=null)return t.attributeInfo.attributeData}_setAttributeData(e,t){let n=this.loadedGraphics.getNode(e);n?.attributeInfo!=null&&(n.attributeInfo.attributeData=t,this._attributeValuesChanged(n))}async updateAttributes(e,t,n){let r=this.loadedGraphics.getNode(e);r!=null&&(await this._i3sOverrides.applyAttributeOverrides(r.featureIds,t,n),r.attributeInfo=t,this._attributeValuesChanged(r))}_attributeValuesChanged(e){Y(e),this._filterNode(e);let{processor:t}=this,{graphicsCore:n}=t;if(n.labelsEnabled){let t=e.node.index,r=[];e.graphics.forEach(e=>e.nodeIndex===t&&r.push(e.uid)),n.updateLabelingInfo(r)}t.refreshFilter(),n.featureStore.events.emit(`changed`)}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||ne}_getGlobalIdField(){return this.layer.globalIdField}async _rendererChange(e,t){let{layer:{fieldsIndex:n}}=this,r=new Set,i;e?(await e.collectRequiredFields(r,n),i=Array.from(r).sort()):i=[],r.clear();let a;t?(await t.collectRequiredFields(r,n),a=Array.from(r).sort()):a=[],i.length===a.length&&i.every((e,t)=>i[t]===a[t])||this._reloadAllNodes()}_rangeInfosChanged(e){e!=null&&e.length>0&&t.getLogger(this).warn(`Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.`)}_filterChange(){this.loadedGraphics.forEachNode(e=>this._filterNode(e))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){let t=this.parsedDefinitionExpression,n=this._excludeObjectIds,r=this._getObjectIdField();for(let i of e.graphics){let e=i.visible,a=this._evaluateClause(t,i),o=!n.has(i.attributes[r]);i.visible=a&&o,e!==i.visible&&(Q.graphic=i,Q.property=`visible`,Q.oldValue=e,Q.newValue=i.visible,this.processor.graphicsCore.graphicUpdateHandler(Q),$())}}createQuery(){let e={outFields:[`*`],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return this.filter?.createQuery(e)??new x(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(e==null?this.createQuery():x.from(e))}_setupQueryEngine(){let{layer:e,view:t,hasM:n,hasZ:r}=this,{spatialReference:i,resourceController:a}=t,o=new E(i,e,a,()=>this.processor.featureStore,r,n,()=>this.availableFields);this._queryEngine=new T({context:o,priority:Se.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))*.8}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(e){let t=this._attributeEditingContext,n=await O(t,e);k(t,n)}get _attributeEditingContext(){let e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode(t=>e(t.node,t.featureIds)),attributeStorageInfo:this.layer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,n,r)=>{this._setAttributeData(t,n);let i=this.loadedGraphics.getNode(t);if(r!=null){let t=this.loadedGraphics.get(r.attributes[e]);t!=null&&this.processor.graphicsCore.recreateGraphics([t])}else i!=null&&this.processor.graphicsCore.recreateGraphics(i.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new fe(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}};e([u()],q.prototype,`processor`,void 0),e([u({type:se})],q.prototype,`filter`,void 0),e([u()],q.prototype,`loadedGraphics`,void 0),e([u()],q.prototype,`layerViewUid`,null),e([u()],q.prototype,`_controller`,void 0),e([u()],q.prototype,`updating`,void 0),e([u()],q.prototype,`suspended`,void 0),e([u(_e)],q.prototype,`updatingProgress`,void 0),e([u()],q.prototype,`updatingProgressValue`,null),e([u({readOnly:!0})],q.prototype,`visibleAtCurrentScale`,null),e([u(K.requiredFields)],q.prototype,`requiredFields`,null),e([u(K.availableFields)],q.prototype,`availableFields`,void 0),e([u()],q.prototype,`_fieldsHelper`,void 0),e([u({type:Number})],q.prototype,`maximumNumberOfFeatures`,null),e([u({readOnly:!0})],q.prototype,`maximumNumberOfFeaturesExceeded`,null),e([u()],q.prototype,`_excludeObjectIds`,null),e([u({readOnly:!0})],q.prototype,`lodFactor`,null),e([u({readOnly:!0})],q.prototype,`hasM`,null),e([u({readOnly:!0})],q.prototype,`hasZ`,null),e([u()],q.prototype,`contentVisible`,null),e([u({readOnly:!0})],q.prototype,`legendEnabled`,null),e([u()],q.prototype,`_graphicOrigin`,null),q=e([d(`esri.views.3d.layers.SceneLayerGraphicsView3D`)],q);const we=q;function Te(e){return`pointData`in e}function J(e){return`geometryBuffer`in e&&e.geometryBuffer!==null}function Ee(e,t,n){let r=t.attributeInfo;if(r?.loadedAttributes==null||r.attributeData==null)return!1;let i=!1;for(let{name:t}of r.loadedAttributes)if(r.attributeData[t]){let a=A(r.attributeData[t],n);a!==e.attributes[t]&&(e.attributes[t]=a,i=!0)}return i}function Y(e){let t=e.attributeInfo;if(t?.loadedAttributes==null||t.attributeData==null)return;let n=e.node.index;for(let r=0;r<e.graphics.length;r++){let i=e.graphics[r];if(i.nodeIndex===n){i.attributes||={};for(let{name:e}of t.loadedAttributes)t.attributeData[e]&&(i.attributes[e]=A(t.attributeData[e],r))}}}function X(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,e.zmin!=null&&e.zmax!=null&&(e.zmin-=t,e.zmax+=t),e.mmin!=null&&e.mmax!=null&&(e.mmin-=t,e.mmax+=t),e}const De={2:{type:`Embedded`,params:{type:`points`,vertexAttributes:{position:[0,0]}}},3:{type:`Embedded`,params:{type:`points`,vertexAttributes:{position:[0,0,0]}}}},Z=m(),Q={graphic:null,property:null,oldValue:null,newValue:null},Oe=m();function $(){Q.graphic=null,Q.property=null,Q.oldValue=null,Q.newValue=null}export{we as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import a from"../../../core/ReactiveSet.js";import{initial as o}from"../../../core/reactiveUtils.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import l from"../../../core/sql/WhereClause.js";import{isInEffectiveScaleRange as u}from"../../../geometry/support/scaleUtils.js";import d from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as f}from"../../../layers/support/floorFilterUtils.js";import p from"../../../rest/support/Query.js";import{isNumber as m}from"../../../support/guards.js";import{I3SMeshView3D as h}from"./I3SMeshView3D.js";import{LayerView3D as g}from"./LayerView3D.js";import{createInteractiveEditSession as _,normalizeEditResultsEvent as v,processGeometryEdits as y,processAttributeEdits as b}from"./i3s/featureEditing.js";import{createGetFeatureExtent as x}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as S}from"./i3s/I3SMeshViewFilter.js";import{I3SOverrides as C}from"./i3s/I3SOverrides.js";import{I3SQueryEngine as w}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as T,I3SQueryFeature as E}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as D}from"./i3s/I3SQueryFeatureStore.js";import{checkRecyclable as O,getIndexCrs as k,objectIdFilter as A}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as j}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as M}from"./support/fieldProperties.js";import{PopupSceneLayerView as N}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as P}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as F}from"./support/TemporalSceneLayerView.js";import{updatingProgress as I}from"../support/updatingProperties.js";import L from"../../layers/SceneLayerView.js";import{hasPopupTemplate as R}from"../../layers/support/popupUtils.js";import{TaskPriority as z}from"../../support/Scheduler.js";const B=M();let V=class extends h(F(j(N(g(L))))){constructor(){super(...arguments),this.type=`scene-layer-3d`,this.viewFilter=null,this._setVisibilityHiddenObjectIds=new a,this.progressiveLoadFactor=1,this._elevationContext=2,this._supportsLabeling=!0,this._pendingEditsQueue=Promise.resolve(),this._interactiveEditingSessions=new Map,this._queryEngine=null}tryRecycleWith(e,t){return e.url!==this.layer.url||!this.i3sOverrides.isEmpty?null:e.load(t).then(()=>{i(t),O(this.layer,e,this.i3sOverrides),this.layer=e,this.i3sOverrides.destroy();let n=this.view.resourceController?.memoryController;this.i3sOverrides=new C({view:this.view,layer:e,memoryController:n,extractChanges:this.extractChanges}),this.resetHighlights()})}get layerPopupEnabledAndHasTemplate(){return this.layer.popupEnabled&&R(this.layer,this.view.popup?.defaultPopupTemplateEnabled)}get filter(){return this._get(`filter`)}set filter(e){this._set(`filter`,S.checkSupport(e)?e:null)}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get _floorFilterClause(){let e=f(this);return e==null?null:l.create(e,{fieldsIndex:this.layer.fieldsIndex})}get _excludeObjectIdsSorted(){let e=this.layer.excludeObjectIds.toArray();return e.length?e.sort((e,t)=>e-t):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size?Array.from(this._setVisibilityHiddenObjectIds).sort((e,t)=>e-t):null}get lodFactor(){return this.view?.qualitySettings?.sceneService?.objectLoDFactor??1}get lodCrossfadeUncoveredDuration(){return this.view?.qualitySettings?.fadeDuration??0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get visibleAtCurrentScale(){return u(this.layer.effectiveScaleRange,this.view.scale)}get _graphicOrigin(){return this.layer.graphicOrigin}initialize(){this._fieldsHelper=new P({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),o),this._updatingHandles.add(()=>this.layer.renderer,e=>this._updatingHandles.addPromise(this._rendererChange(e)),o);let e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this.mergedFilter,e),this._updatingHandles.add(()=>this._floorFilterClause,e),this._updatingHandles.add(()=>this._excludeObjectIdsSorted,e),this._updatingHandles.add(()=>this._setVisibilityHiddenObjectIdsSorted,e),this._updatingHandles.add(()=>this.viewFilter?.sortedObjectIds,e),this._updatingHandles.add(()=>this.viewFilter?.parsedWhereClause,e),this._updatingHandles.add(()=>this.getTimeFilterDependencies(),e),this._updatingHandles.add(()=>[this.viewFilter?.parsedGeometry,this.mergedFilter?.spatialRelationship,this.layer.filter?.spatialRelationship],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>({layerViewFilter:this.mergedFilter,layerFilter:this.layerFilter}),({layerViewFilter:e,layerFilter:t})=>{if(e==null&&t==null){this._set(`viewFilter`,null);return}let n=this.viewFilter;n?(n.viewFilter=e,n.layerFilter=t,this._filterChange()):this._set(`viewFilter`,new S({layerFilter:t,viewFilter:e,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,t)=>this.addSqlFilter(e,t,this.logError),addTimeFilter:(e,t)=>this.addTimeFilter(e,t)}))},o),this.i3sOverrides.is3DOFL&&this._updatingHandles.add(()=>this.i3sOverrides.sortedGeometryChangedObjectIds,e),this.addHandles(this.layer.on(`apply-edits`,e=>this._updatingHandles.addPromise(e.result))),this.addHandles(this.layer.on(`edits`,e=>{let t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.consumePromise(t)}))}destroy(){this._fieldsHelper=r(this._fieldsHelper)}_rangeInfosChanged(e){e!=null&&e.length>0&&n.getLogger(this).warn(`Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.`)}createQuery(){let e={outFields:[`*`],returnGeometry:!0,returnZ:!0,outSpatialReference:this.view.spatialReference};return this.mergedFilter?.createQuery(e)??new p(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t?.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t?.signal).then(e=>{if(!e?.features)return e;let t=this.layer,n=this._graphicOrigin;for(let r of e.features)r.layer=t,r.sourceLayer=t,r.origin=n;return e})}async queryObjectIds(e,t){return(await this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t?.signal)).filter(m)}_ensureQueryEngine(){return this._queryEngine??=this._createQueryEngine(),this._queryEngine}_createQueryEngine(){let e=x(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new w({layerView:this,priority:z.FEATURE_QUERY_ENGINE,spatialIndex:new D({featureAdapter:new T({objectIdField:this.layer.objectIdField,attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:e}),forAllFeatures:(e,t)=>this._forAllFeatures((t,n,r)=>e(new E(t,n,r)),t,2),getFeatureExtent:e,sourceSpatialReference:k(this.layer),viewSpatialReference:this.view.spatialReference})})}createInteractiveEditSession(e){return _(this._attributeEditingContext,e)}_createLayerGraphic(e){return new t({attributes:e,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}getFilters(){let e=super.getFilters();this.i3sOverrides.is3DOFL&&this.i3sOverrides.sortedGeometryChangedObjectIds.length>0&&e.push((e,t)=>{t.node.index>=0&&A(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,e)});let t=this._setVisibilityHiddenObjectIdsSorted;t!=null&&e.push(e=>A(t,!1,e));let n=this._excludeObjectIdsSorted;return n!=null&&e.push(e=>A(n,!1,e)),this._floorFilterClause&&this.addSqlFilter(e,this._floorFilterClause,this.logError),this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this.viewFilter!=null&&this.viewFilter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}setVisibility(e,t){t?this._setVisibilityHiddenObjectIds.delete(e):this._setVisibilityHiddenObjectIds.add(e)}isUpdating(){return super.isUpdating()||!!this._fieldsHelper?.updating||this.layerFilterUpdating||this.viewFilter!=null&&this.viewFilter.updating||this.i3sOverrides!=null&&this.i3sOverrides.updating}_ensureQuery(e){return this._validateQuery(this._addDefinitionExpressionToQuery(e==null?this.createQuery():p.from(e)))}_validateQuery(e){return e.outSpatialReference&&!e.outSpatialReference.equals(this.view.spatialReference)&&(n.getLogger(this).warn(`query: outSpatialReference different from the view's spatial reference is not supported`),e.outSpatialReference=this.view.spatialReference),e.returnGeometry&&(e.returnZ=!0),e.returnCentroid=!1,e}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:e=>this._forAllNodes(t=>t==null?null:e(t.node,t.featureIds)),attributeStorageInfo:this.layer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(e,t)=>this.setAttributeData(e,t),clearMemCache:()=>this.clearMemCache()}}async _handleEdits(e){let t=this._attributeEditingContext,n=await v(t,e);y(t,n),b(t,n)}get hasGeometryFilter(){return this.viewFilter?.parsedGeometry!=null}computeNodeFiltering(e){let t=this.viewFilter;return+!(t==null||!this.view.spatialReference||t.isMBSGeometryVisible(e,this.view.spatialReference,this._controller.crsIndex))}};e([s(I)],V.prototype,`updatingProgress`,void 0),e([s({type:d})],V.prototype,`filter`,null),e([s({readOnly:!0})],V.prototype,`viewFilter`,void 0),e([s(B.requiredFields)],V.prototype,`requiredFields`,null),e([s(B.availableFields)],V.prototype,`availableFields`,void 0),e([s()],V.prototype,`_fieldsHelper`,void 0),e([s()],V.prototype,`_floorFilterClause`,null),e([s()],V.prototype,`_excludeObjectIdsSorted`,null),e([s()],V.prototype,`_setVisibilityHiddenObjectIds`,void 0),e([s()],V.prototype,`_setVisibilityHiddenObjectIdsSorted`,null),e([s()],V.prototype,`lodFactor`,null),e([s()],V.prototype,`updatingProgressValue`,null),e([s({readOnly:!0})],V.prototype,`visibleAtCurrentScale`,null),e([s()],V.prototype,`_graphicOrigin`,null),V=e([c(`esri.views.3d.layers.SceneLayerView3D`)],V);const H=V;export{H as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import a from"../../../core/ReactiveSet.js";import{initial as o,on as s}from"../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../core/accessorSupport/decorators.js";import u from"../../../core/sql/WhereClause.js";import{isInEffectiveScaleRange as d}from"../../../geometry/support/scaleUtils.js";import f from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as p}from"../../../layers/support/floorFilterUtils.js";import m from"../../../rest/support/Query.js";import{isNumber as h}from"../../../support/guards.js";import{I3SMeshView3D as g}from"./I3SMeshView3D.js";import{LayerView3D as _}from"./LayerView3D.js";import{createInteractiveEditSession as v,normalizeEditResultsEvent as y,processGeometryEdits as b,processAttributeEdits as x}from"./i3s/featureEditing.js";import{createGetFeatureExtent as S}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as C}from"./i3s/I3SMeshViewFilter.js";import{I3SOverrides as w}from"./i3s/I3SOverrides.js";import{I3SQueryEngine as T}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as E,I3SQueryFeature as D}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as O}from"./i3s/I3SQueryFeatureStore.js";import{checkRecyclable as k,getIndexCrs as A,objectIdFilter as j}from"./i3s/I3SUtil.js";import{createFeatureFilterHighlight as M}from"./support/createFeatureFilterHighlight.js";import{DefinitionExpressionSceneLayerView as N}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as P}from"./support/fieldProperties.js";import{isFeatureFilter as F}from"./support/highlightUtils.js";import{PopupSceneLayerView as I}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as L}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as R}from"./support/TemporalSceneLayerView.js";import{updatingProgress as z}from"../support/updatingProperties.js";import B from"../../layers/SceneLayerView.js";import{hasPopupTemplate as V}from"../../layers/support/popupUtils.js";import{getHighlightName as H}from"../../support/highlightOptionsUtils.js";import{TaskPriority as U}from"../../support/Scheduler.js";const W=P();let G=class extends g(R(N(I(_(B))))){constructor(){super(...arguments),this.type=`scene-layer-3d`,this.viewFilter=null,this._setVisibilityHiddenObjectIds=new a,this.progressiveLoadFactor=1,this._elevationContext=2,this._supportsLabeling=!0,this._pendingEditsQueue=Promise.resolve(),this._interactiveEditingSessions=new Map,this._queryEngine=null}tryRecycleWith(e,t){return e.url!==this.layer.url||!this.i3sOverrides.isEmpty?null:e.load(t).then(()=>{i(t),k(this.layer,e,this.i3sOverrides),this.layer=e,this.i3sOverrides.destroy();let n=this.view.resourceController?.memoryController;this.i3sOverrides=new w({view:this.view,layer:e,memoryController:n,extractChanges:this.extractChanges}),this.resetHighlights()})}get layerPopupEnabledAndHasTemplate(){return this.layer.popupEnabled&&V(this.layer,this.view.popup?.defaultPopupTemplateEnabled)}get filter(){return this._get(`filter`)}set filter(e){this._set(`filter`,C.checkSupport(e)?e:null)}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get _floorFilterClause(){let e=p(this);return e==null?null:u.create(e,{fieldsIndex:this.layer.fieldsIndex})}get _excludeObjectIdsSorted(){let e=this.layer.excludeObjectIds.toArray();return e.length?e.sort((e,t)=>e-t):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size?Array.from(this._setVisibilityHiddenObjectIds).sort((e,t)=>e-t):null}get lodFactor(){return this.view?.qualitySettings?.sceneService?.objectLoDFactor??1}get lodCrossfadeUncoveredDuration(){return this.view?.qualitySettings?.fadeDuration??0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get visibleAtCurrentScale(){return d(this.layer.effectiveScaleRange,this.view.scale)}get _graphicOrigin(){return this.layer.graphicOrigin}initialize(){this._fieldsHelper=new L({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),o),this._updatingHandles.add(()=>this.layer.renderer,e=>this._updatingHandles.addPromise(this._rendererChange(e)),o);let e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this.mergedFilter,e),this._updatingHandles.add(()=>this._floorFilterClause,e),this._updatingHandles.add(()=>this._excludeObjectIdsSorted,e),this._updatingHandles.add(()=>this._setVisibilityHiddenObjectIdsSorted,e),this._updatingHandles.add(()=>this.viewFilter?.sortedObjectIds,e),this._updatingHandles.add(()=>this.viewFilter?.parsedWhereClause,e),this._updatingHandles.add(()=>this.getTimeFilterDependencies(),e),this._updatingHandles.add(()=>[this.viewFilter?.parsedGeometry,this.mergedFilter?.spatialRelationship,this.layer.filter?.spatialRelationship],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>({layerViewFilter:this.mergedFilter,layerFilter:this.layerFilter}),({layerViewFilter:e,layerFilter:t})=>{if(e==null&&t==null){this._set(`viewFilter`,null);return}let n=this.viewFilter;n?(n.viewFilter=e,n.layerFilter=t,this._filterChange()):this._set(`viewFilter`,new C({layerFilter:t,viewFilter:e,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,t)=>this.addSqlFilter(e,t,this.logError),addTimeFilter:(e,t)=>this.addTimeFilter(e,t)}))},o),this.i3sOverrides.is3DOFL&&this._updatingHandles.add(()=>this.i3sOverrides.sortedGeometryChangedObjectIds,e),this.addHandles(this.layer.on(`apply-edits`,e=>this._updatingHandles.addPromise(e.result))),this.addHandles(this.layer.on(`edits`,e=>{let t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.consumePromise(t)}))}destroy(){this._fieldsHelper=r(this._fieldsHelper)}_rangeInfosChanged(e){e!=null&&e.length>0&&n.getLogger(this).warn(`Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.`)}createQuery(){let e={outFields:[`*`],returnGeometry:!0,returnZ:!0,outSpatialReference:this.view.spatialReference};return this.mergedFilter?.createQuery(e)??new m(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t?.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t?.signal).then(e=>{if(!e?.features)return e;let t=this.layer,n=this._graphicOrigin;for(let r of e.features)r.layer=t,r.sourceLayer=t,r.origin=n;return e})}async queryObjectIds(e,t){return(await this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t?.signal)).filter(h)}highlight(e,t){if(!F(e))return super.highlight(e,t);let n=this._registerHighlightFilter(e),r=this._ensureHighlights(),{set:i,handle:a}=r.acquireSet(H(t));return M({owner:this,handles:[n,a],filter:e,layer:this.layer,scheduler:this.view.resourceController.scheduler,updatingHandles:this._updatingHandles,getAvailableFields:()=>this.availableFields,query:async t=>new Set(await this.queryObjectIds(e.createQuery(),{signal:t})),apply:e=>r.updateFeatureIds(i,e),onChange:e=>s(()=>this,`visible-geometry-changed`,e)})}_ensureQueryEngine(){return this._queryEngine??=this._createQueryEngine(),this._queryEngine}_createQueryEngine(){let e=S(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new T({layerView:this,priority:U.FEATURE_QUERY_ENGINE,spatialIndex:new O({featureAdapter:new E({objectIdField:this.layer.objectIdField,attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:e}),forAllFeatures:(e,t)=>this._forAllFeatures((t,n,r)=>e(new D(t,n,r)),t,2),getFeatureExtent:e,sourceSpatialReference:A(this.layer),viewSpatialReference:this.view.spatialReference})})}createInteractiveEditSession(e){return v(this._attributeEditingContext,e)}_createLayerGraphic(e){return new t({attributes:e,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}getFilters(){let e=super.getFilters();this.i3sOverrides.is3DOFL&&this.i3sOverrides.sortedGeometryChangedObjectIds.length>0&&e.push((e,t)=>{t.node.index>=0&&j(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,e)});let t=this._setVisibilityHiddenObjectIdsSorted;t!=null&&e.push(e=>j(t,!1,e));let n=this._excludeObjectIdsSorted;return n!=null&&e.push(e=>j(n,!1,e)),this._floorFilterClause&&this.addSqlFilter(e,this._floorFilterClause,this.logError),this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this.viewFilter!=null&&this.viewFilter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}setVisibility(e,t){t?this._setVisibilityHiddenObjectIds.delete(e):this._setVisibilityHiddenObjectIds.add(e)}isUpdating(){return super.isUpdating()||!!this._fieldsHelper?.updating||this.layerFilterUpdating||this.viewFilter!=null&&this.viewFilter.updating||this.i3sOverrides!=null&&this.i3sOverrides.updating}_ensureQuery(e){return this._validateQuery(this._addDefinitionExpressionToQuery(e==null?this.createQuery():m.from(e)))}_validateQuery(e){return e.outSpatialReference&&!e.outSpatialReference.equals(this.view.spatialReference)&&(n.getLogger(this).warn(`query: outSpatialReference different from the view's spatial reference is not supported`),e.outSpatialReference=this.view.spatialReference),e.returnGeometry&&(e.returnZ=!0),e.returnCentroid=!1,e}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:e=>this._forAllNodes(t=>t==null?null:e(t.node,t.featureIds)),attributeStorageInfo:this.layer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(e,t)=>this.setAttributeData(e,t),clearMemCache:()=>this.clearMemCache()}}async _handleEdits(e){let t=this._attributeEditingContext,n=await y(t,e);b(t,n),x(t,n)}get hasGeometryFilter(){return this.viewFilter?.parsedGeometry!=null}computeNodeFiltering(e){let t=this.viewFilter;return+!(t==null||!this.view.spatialReference||t.isMBSGeometryVisible(e,this.view.spatialReference,this._controller.crsIndex))}};e([c(z)],G.prototype,`updatingProgress`,void 0),e([c({type:f})],G.prototype,`filter`,null),e([c({readOnly:!0})],G.prototype,`viewFilter`,void 0),e([c(W.requiredFields)],G.prototype,`requiredFields`,null),e([c(W.availableFields)],G.prototype,`availableFields`,void 0),e([c()],G.prototype,`_fieldsHelper`,void 0),e([c()],G.prototype,`_floorFilterClause`,null),e([c()],G.prototype,`_excludeObjectIdsSorted`,null),e([c()],G.prototype,`_setVisibilityHiddenObjectIds`,void 0),e([c()],G.prototype,`_setVisibilityHiddenObjectIdsSorted`,null),e([c()],G.prototype,`lodFactor`,null),e([c()],G.prototype,`updatingProgressValue`,null),e([c({readOnly:!0})],G.prototype,`visibleAtCurrentScale`,null),e([c()],G.prototype,`_graphicOrigin`,null),G=e([l(`esri.views.3d.layers.SceneLayerView3D`)],G);const K=G;export{K as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../../geometry/Extent.js";import i from"./DrapedSubView3D.js";import{DynamicLayerView3D as a}from"./DynamicLayerView3D.js";import{WMSLayerView as o}from"../../layers/WMSLayerView.js";let s=class extends o(a){constructor(){super(...arguments),this.type=`wms-3d`}initialize(){this.layer.serviceSupportsSpatialReference(this.view.spatialReference)||this.addResolvingPromise(Promise.reject(new t(`layerview:spatial-reference-incompatible`,`The spatial references supported by this WMS layer are incompatible with the spatial reference of the view`))),this._updatingHandles.add(()=>this.exportImageParameters?.version,()=>{this._updatingHandles.consumePromise(this.refreshDebounced())})}createFetchPopupFeaturesQuery(e){let{subView:t}=this;if(t.type!==`draped`)return null;let n=t.findExtentInfoAt(e),i=n.extent,a=new r(i[0],i[1],i[2],i[3],t.spatialReference),o=n.imageSize,s=o.width,c=o.height,l=a.width/s;return{extent:a,width:s,height:c,x:Math.round((e.x-a.xmin)/l),y:Math.round((a.ymax-e.y)/l)}}getFetchOptions(){return{timeExtent:this.timeExtent}}_initSubView(){this.subView=new i({layerView:this})}};s=e([n(`esri.views.3d.layers.WMSLayerView3D`)],s);const c=s;export{c as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../../geometry/Extent.js";import i from"./DrapedSubView3D.js";import{DynamicLayerView3D as a}from"./DynamicLayerView3D.js";import{WMSLayerView as o}from"../../layers/WMSLayerView.js";let s=class extends o(a){constructor(){super(...arguments),this.type=`wms-3d`}initialize(){this.layer.serviceSupportsSpatialReference(this.view.spatialReference)||this.addResolvingPromise(Promise.reject(new t(`layerview:spatial-reference-incompatible`,`The spatial references supported by this WMS layer are incompatible with the spatial reference of the view`))),this._updatingHandles.add(()=>this.exportImageParameters?.version,()=>{this._updatingHandles.consumePromise(this.refreshDebounced())})}createFetchPopupFeaturesQuery(e){let{subView:t}=this;if(t.type!==`draped`)return null;let n=t.findExtentInfoAt(e),i=n.extent,a=new r({xmin:i[0],ymin:i[1],xmax:i[2],ymax:i[3],spatialReference:t.spatialReference}),o=n.imageSize,s=o.width,c=o.height,l=a.width/s;return{extent:a,width:s,height:c,x:Math.round((e.x-a.xmin)/l),y:Math.round((a.ymax-e.y)/l)}}getFetchOptions(){return{timeExtent:this.timeExtent}}_initSubView(){this.subView=new i({layerView:this})}};s=e([n(`esri.views.3d.layers.WMSLayerView3D`)],s);const c=s;export{c as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Error.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{EsriPromise as r}from"../../../../core/Promise.js";import{initial as i,sync as a,watch as o,whenOnce as s}from"../../../../core/reactiveUtils.js";import{property as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Error.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{EsriPromise as r}from"../../../../core/Promise.js";import{initial as i,sync as a,watch as o,whenOnce as s,on as c}from"../../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{FeatureTileController3D as f}from"../../../../layers/graphics/controllers/FeatureTileController3D.js";import{symbolHasExtrudeSymbolLayer as p}from"../../../../symbols/support/utils.js";import{elevationAlignPointsInFeatures as m}from"./elevationAlignPointsInFeatures.js";import{Graphics3DFeatureProcessor as h}from"./Graphics3DFeatureProcessor.js";import{QueryEngine as g}from"./QueryEngine.js";import{QueryEngineContext as _}from"./QueryEngineContext.js";import{queryForSymbologySnapping as v}from"./queryForSymbologySnapping.js";import{createFeatureFilterHighlight as y}from"../support/createFeatureFilterHighlight.js";import{HeatmapFeatureProcessor as b}from"../support/HeatmapFeatureProcessor.js";import{emptyHighlightHandle as x}from"../support/highlightUtils.js";import{LayerViewPerformanceInfo as S}from"../support/LayerViewPerformanceInfo.js";import{hasLayerBasedScaleVisibility as C}from"../../../support/layerViewUtils.js";import{TaskPriority as w}from"../../../support/Scheduler.js";let T=class extends r{constructor(e){super(e),this._dataUpdatingState=0,this.graphicsQuery={queryForSymbologySnapping:async(e,t)=>this.symbologySnappingSupported?v(this.graphics3DProcessor,e,t):{candidates:[],sourceCandidateIndices:[]},executeQuery:(e,t)=>this.queryEngine.executeQuery(e,t),executeQueryForIds:(e,t)=>this.queryEngine.executeQueryForIds(e,t),executeQueryForCount:(e,t)=>this.queryEngine.executeQueryForCount(e,t),executeQueryForExtent:(e,t)=>this.queryEngine.executeQueryForExtent(e,t),executeQueryForLatestObservations:(e,t)=>this.queryEngine.executeQueryForLatestObservations(e,t),executeAttributeBinsQuery:(e,t)=>this.queryEngine.executeAttributeBinsQuery(e,t)},this.controller=null,this.updatingHandles=new d,this._controllerCreated=!1,this._pendingController=null}get reportGraphicSourceMemory(){return!0}initialize(){this.addResolvingPromise(this._initializeController()),this.updatingHandles.add(()=>this.layer.renderer,e=>this._recreateProcessor(e),i),this.updatingHandles.add(()=>this.updatePolicy,e=>this.processor.preferredUpdatePolicy=e),this.updatingHandles.add(()=>this.layerView.availableFields,()=>this.queryEngine?.clear(),a);let{layer:e,view:t,hasM:n,hasZ:r}=this,{spatialReference:o,resourceController:s}=t,c=new _(o,e,s,()=>this.processor.featureStore,r,n,()=>this.layerView.availableFields);this.queryEngine=new g({context:c,priority:w.FEATURE_QUERY_ENGINE})}destroy(){this.removeAllHandles(),this.updatingHandles.destroy(),this._destroyPendingController(),this.controller=n(this.controller),this.processor=n(this.processor),this.queryEngine=n(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this._pendingController=n(this._pendingController)}get updating(){return this.updatingHandles.updating||!this._controllerCreated||this.controller?.updating||this.processor?.updating}get legendEnabled(){return this.processor.legendEnabled}get layer(){return this.layerView.layer}get layerViewUid(){return this.layerView.uid}get view(){return this.layerView.view}get hasZ(){return this.layerView.hasZ}get hasM(){return this.layerView.hasM}get fullOpacity(){return this.layerView.fullOpacity}get suspended(){return this.layerView.suspended}get filter(){return`filter`in this.layerView?this.layerView.filter:null}get effectiveDisplayFilter(){return`effectiveDisplayFilter`in this.layerView?this.layerView.effectiveDisplayFilter:null}get highlightIds(){return`highlightIds`in this.layerView?this.layerView.highlightIds:null}get slicePlaneEnabled(){return this.layerView.slicePlaneEnabled}get featureSpatialReference(){return`featureSpatialReference`in this.layerView?this.layerView.featureSpatialReference:null}get graphics3DProcessor(){return this.processor?.type===`graphics-3d`?this.processor:null}get heatmapProcessor(){return this.processor?.type===`heatmap`?this.processor:null}get hasAllFeatures(){return this.controller&&`hasAllFeatures`in this.controller?this.controller.hasAllFeatures:!1}get hasAllFeaturesInView(){return this.controller&&`hasAllFeaturesInView`in this.controller?this.controller.hasAllFeaturesInView:!1}get hasFullGeometries(){return this.controller&&`hasFullGeometries`in this.controller?this.controller.hasFullGeometries:!1}get symbologySnappingSupported(){return this.layer?.renderer?.symbols?.some(p)??!1}get updatePolicy(){return 1}get scaleVisibilitySuspended(){return this.processor?.scaleVisibilitySuspended}get timeExtent(){return`timeExtent`in this.layerView?this.layerView.timeExtent:null}get dataUpdating(){return this._dataUpdatingState!==0}get suspendInfo(){return this.processor?.suspendInfo??{}}forEachGraphic(e){this.loadedGraphics.forEach(e)}findGraphic(e){return this.loadedGraphics.find(e)}queryObjectIds(e,t){return this.layerView.queryObjectIds(e,t)}whenGraphicBounds(e,t){return this.processor?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,n){let r=this.graphics3DProcessor;if(r==null)throw new t(`featurelayerview3d:missing-processor`,`A Graphics3D processor is needed to resolve graphics elevation.`);return m(this.view,this.layer,e=>r.getGraphics3DGraphicByObjectId(e),e,n)}highlightByGraphics(e,t){return this.processor.highlightByGraphics(e,t)}highlightByObjectIds(e,t){return this.processor.highlightByObjectIds(e,this.layer.objectIdField,t)}highlightByFilter(e,t){let n=this.graphics3DProcessor?.graphicsCore.objectStates;if(!n)return x;let{set:r,handle:i}=n.acquireHighlightSet(t,this.layer.objectIdField);return y({owner:this,handles:[i],filter:e,layer:this.layer,scheduler:this.view.resourceController.scheduler,updatingHandles:this.updatingHandles,getAvailableFields:()=>this.layerView.availableFields,query:t=>this.queryEngine.executeQueryForIdSet(e,null,t),apply:e=>n.updateObjectIds(r,e),onChange:e=>c(()=>this.graphics3DProcessor?.featureStore?.events,`changed`,e)})}maskOccludee(e){return this.processor.maskOccludee(e)}notifyContentGeometryUpdate(){this.layerView.emit(`visible-geometry-changed`)}async _initializeController(){let e=this.createController();this._pendingController=e,this._setupDataUpdating(e),await e.when(),this._setControllerWhenInitialized(e)}_setupDataUpdating(e){`dataUpdating`in e&&this.addHandles([o(()=>e.dataUpdating,e=>{e&&this._dataUpdatingState===0?this._dataUpdatingState=1:!e&&this._dataUpdatingState===1&&(this._dataUpdatingState=0)},a),o(()=>!!this.graphics3DProcessor?.dataUpdating,t=>{t&&this._dataUpdatingState===1?this._dataUpdatingState=2:!t&&this._dataUpdatingState===2&&(this._dataUpdatingState=+!!e.dataUpdating)},a)])}async _setControllerWhenInitialized(e){try{await this.when()}catch{}this._controllerCreated=!0,!this.isResolved()||this.destroyed?this._destroyPendingController():(await s(()=>this.view?.groundView?.ready),this.beforeSetController(e),this._pendingController=null,this.controller=e,this.loadedGraphics=e.graphics)}_recreateProcessor(e){let t=e?.type===`heatmap`,n=this.processor?.type===`heatmap`,r=this.processor;if(r&&t===n)return;let i=t?new b({owner:this}):new h({owner:this,reportGraphicSourceMemory:this.reportGraphicSourceMemory,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!C(),filterVisibilityEnabled:!0,timeExtentEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:e=>this._updateClippingExtent(e)});this.processor=i,r?.destroy(),this.queryEngine?.clear(),this.addResolvingPromise(i.when())}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case`stream`:return!1;case`feature-tile-3d`:return this.controller.extent=e,!0}}get usedMemory(){return this.processor?.usedMemory??0}get performanceInfo(){let e=this.controller instanceof f?this.controller:null;return new S(this.usedMemory,this.loadedGraphics?.length,e?.serviceDataCount??-1,e?.maximumNumberOfFeatures??-1,0,this.processor.performanceInfo)}};e([l()],T.prototype,`updating`,null),e([l()],T.prototype,`legendEnabled`,null),e([l()],T.prototype,`layerView`,void 0),e([l()],T.prototype,`layer`,null),e([l()],T.prototype,`layerViewUid`,null),e([l()],T.prototype,`view`,null),e([l()],T.prototype,`hasZ`,null),e([l()],T.prototype,`hasM`,null),e([l()],T.prototype,`fullOpacity`,null),e([l()],T.prototype,`suspended`,null),e([l()],T.prototype,`filter`,null),e([l()],T.prototype,`effectiveDisplayFilter`,null),e([l()],T.prototype,`highlightIds`,null),e([l()],T.prototype,`slicePlaneEnabled`,null),e([l()],T.prototype,`featureSpatialReference`,null),e([l()],T.prototype,`loadedGraphics`,void 0),e([l()],T.prototype,`graphics3DProcessor`,null),e([l()],T.prototype,`heatmapProcessor`,null),e([l()],T.prototype,`hasAllFeatures`,null),e([l()],T.prototype,`hasAllFeaturesInView`,null),e([l()],T.prototype,`hasFullGeometries`,null),e([l()],T.prototype,`symbologySnappingSupported`,null),e([l()],T.prototype,`updatePolicy`,null),e([l()],T.prototype,`scaleVisibilitySuspended`,null),e([l()],T.prototype,`timeExtent`,null),e([l()],T.prototype,`_dataUpdatingState`,void 0),e([l({readOnly:!0})],T.prototype,`dataUpdating`,null),e([l()],T.prototype,`controller`,void 0),e([l()],T.prototype,`processor`,void 0),e([l()],T.prototype,`updatingHandles`,void 0),e([l()],T.prototype,`_controllerCreated`,void 0),T=e([u(`esri.views.3d.layers.graphics.Graphics3DGraphicsPipeline`)],T);export{T as Graphics3DGraphicsPipeline};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{Object3DOccludeeStateSet as
|
|
2
|
+
import{getObjectId as e}from"../../../../layers/graphics/dehydratedFeatures.js";import{Object3DOccludeeStateSet as t,Object3DHighlightStateSet as n}from"../../webgl-engine/lib/Object3DStateSet.js";class r{constructor(e){this.objectIdField=e,this.ids=new Set,this.paused=!1}hasGraphic(t){let n=this.objectIdField?e(t.graphic,this.objectIdField):t.graphic.uid;return n!=null&&this.ids.has(n)}}class i extends r{constructor(e){super(e),this.stateType=1,this.objectStateSet=new t}}class a extends r{constructor(e,t){super(t),this.highlightName=e,this.stateType=0,this.objectStateSet=new n(e)}}export{a as Graphics3DObjectHighlightStateSet,i as Graphics3DOccludeeStateSet};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{makeHandle as e}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{Graphics3DOccludeeStateSet as
|
|
2
|
+
import{makeHandle as e}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{getObjectId as t}from"../../../../layers/graphics/dehydratedFeatures.js";import{Graphics3DOccludeeStateSet as n,Graphics3DObjectHighlightStateSet as r}from"./Graphics3DObjectStateSet.js";class i{constructor(e){this._graphicsCore=e,this._stateSets=[]}destroy(){this.reset(),this._stateSets=null}reset(){this._stateSets&&(this._stateSets.forEach(e=>e.objectStateSet.removeAll()),this._stateSets.length=0)}acquireOccludeeSet(t){let r=new n(t);return this._stateSets.push(r),{set:r,handle:e(()=>this.releaseSet(r))}}acquireHighlightSet(t,n){let i=new r(t,n);return this._stateSets.push(i),{set:i,handle:e(()=>this.releaseSet(i))}}releaseSet(e){e.objectStateSet.removeAll();let t=this._stateSets?this._stateSets.indexOf(e):-1;t!==-1&&this._stateSets.splice(t,1)}setUid(e,t){e.ids.add(t);let n=this._graphicsCore.graphics3DGraphics.get(t);n&&n.addObjectStateSet(e.objectStateSet)}setUids(e,t){t.forEach(t=>this.setUid(e,t))}setObjectIds(e,t){t.forEach(t=>e.ids.add(t)),this._initializeSet(e)}updateObjectIds(e,n){this._graphicsCore.graphics3DGraphics.forEach(r=>{let i=e.objectIdField?t(r.graphic,e.objectIdField):r.graphic.uid,a=i!=null&&n.has(i);a!==(i!=null&&e.ids.has(i))&&(a?r.addObjectStateSet(e.objectStateSet):r.removeObjectState(e.objectStateSet))}),e.ids.clear(),n.forEach(t=>e.ids.add(t))}addGraphic(e){this._stateSets.forEach(t=>{!t.paused&&t.hasGraphic(e)&&e.addObjectStateSet(t.objectStateSet)})}removeGraphic(e){this._stateSets.forEach(t=>{t.hasGraphic(e)&&e.removeObjectState(t.objectStateSet)})}allGraphicsDeleted(){this._stateSets&&this._stateSets.forEach(e=>e.objectStateSet.removeAll())}_initializeSet(e){let t=this._graphicsCore.graphics3DGraphics;e.objectIdField?t.forEach(t=>{t&&e.hasGraphic(t)&&t.addObjectStateSet(e.objectStateSet)}):e.ids.forEach(n=>{let r=t.get(n);r&&r.addObjectStateSet(e.objectStateSet)})}get test(){}}export{i as Graphics3DObjectStates};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{removeUnordered as e}from"../../../../core/arrayUtils.js";import{makeHandle as t}from"../../../../core/handleUtils.js";import{getOrCreateMapValue as n}from"../../../../core/MapUtils.js";class r{constructor(e){this.highlightName=e,this.ids=new Set}}class i{constructor({collection:e,forAllFeatures:t,forAllFeaturesOfNode:n}){this._highlights=new Map,this._collection=e,this._forAllFeatures=t,this._forAllFeaturesOfNode=n}destroy(){this._highlights.forEach(e=>e.forEach(e=>this._releaseSet(e))),this._highlights=null}acquireSet(i){let a=new r(i);return n(this._highlights,i,()=>[]).push(a),{set:a,handle:t(()=>{let t=this._highlights?.get(i);t&&(this._releaseSet(a),e(t,a))})}}setFeatureIds(e,t){t.forEach(t=>e.ids.add(t)),this._initializeSet(e)}_initializeSet(e){this._forAllFeatures((t,n,r)=>(e.ids.has(t)&&this._collection.addHighlight(r.objectHandle,n,e.highlightName),0))}_releaseSet(e){this._forAllFeatures((t,n,r)=>(e.ids.has(t)&&this._collection.removeHighlight(r.objectHandle,n,e.highlightName),0))}objectCreated(e){this._highlights.forEach((t,n)=>{t.forEach(t=>{this._forAllFeaturesOfNode(e,(r,i)=>(t.ids.has(r)&&this._collection.addHighlight(e.objectHandle,i,n),0))})})}objectDeleted(e){this._collection.clearHighlights(e.objectHandle)}}export{i as default};
|
|
2
|
+
import{removeUnordered as e}from"../../../../core/arrayUtils.js";import{makeHandle as t}from"../../../../core/handleUtils.js";import{getOrCreateMapValue as n}from"../../../../core/MapUtils.js";class r{constructor(e){this.highlightName=e,this.ids=new Set}}class i{constructor({collection:e,forAllFeatures:t,forAllFeaturesOfNode:n}){this._highlights=new Map,this._collection=e,this._forAllFeatures=t,this._forAllFeaturesOfNode=n}destroy(){this._highlights.forEach(e=>e.forEach(e=>this._releaseSet(e))),this._highlights=null}acquireSet(i){let a=new r(i);return n(this._highlights,i,()=>[]).push(a),{set:a,handle:t(()=>{let t=this._highlights?.get(i);t&&(this._releaseSet(a),e(t,a))})}}setFeatureIds(e,t){t.forEach(t=>e.ids.add(t)),this._initializeSet(e)}updateFeatureIds(e,t){this._forAllFeatures((n,r,i)=>{let a=t.has(n);return a!==e.ids.has(n)&&(a?this._collection.addHighlight(i.objectHandle,r,e.highlightName):this._collection.removeHighlight(i.objectHandle,r,e.highlightName)),0}),e.ids.clear(),t.forEach(t=>e.ids.add(t))}_initializeSet(e){this._forAllFeatures((t,n,r)=>(e.ids.has(t)&&this._collection.addHighlight(r.objectHandle,n,e.highlightName),0))}_releaseSet(e){this._forAllFeatures((t,n,r)=>(e.ids.has(t)&&this._collection.removeHighlight(r.objectHandle,n,e.highlightName),0))}objectCreated(e){this._highlights.forEach((t,n)=>{t.forEach(t=>{this._forAllFeaturesOfNode(e,(r,i)=>(t.ids.has(r)&&this._collection.addHighlight(e.objectHandle,i,n),0))})})}objectDeleted(e){this._collection.clearHighlights(e.objectHandle)}}export{i as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{AsyncUpdateMixin as n}from"../../../../core/AsyncUpdate.js";import r from"../../../../core/Logger.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{fallbackObjectIDAttribute as o}from"../../../../layers/LayerConstants.js";import{fixFields as s,collectLabelingFields as c,collectFilterFields as l}from"../../../../layers/support/fieldUtils.js";let u=class extends n(t){get layer(){return this.layerView.layer}get requiredFields(){let{layerView:{layer:{fieldsIndex:e,objectIdField:t},definitionExpressionFields:n},rendererFields:r,labelingFields:i,viewFilterFields:a}=this;return s(e,[...n??[],...r??[],...i??[],...a??[],t??o])}constructor(e){super(e)}initialize(){this.addHandles([this.autoUpdateAsync(`rendererFields`,async()=>{let{fieldsIndex:e,renderer:t}=this.layer;return t?this._getFieldsAsync(n=>t.collectRequiredFields(n,e)):null}),this.autoUpdateAsync(`labelingFields`,async()=>{let{layer:e}=this;return e.labelsVisible?this._getFieldsAsync(t=>c(t,e)):null}),this.autoUpdateAsync(`viewFilterFields`,()=>{let{layer:e,mergedFilter:t}=this.layerView;return this._getFieldsAsync(n=>l(n,e,t))})])}async _getFieldsAsync(e){let t=new Set;try{return await e(t),Array.from(t).sort()}catch(e){return r.getLogger(this).error(e),null}}};e([i()],u.prototype,`layerView`,void 0),e([i()],u.prototype,`layer`,null),e([i()],u.prototype,`requiredFields`,null),e([i()],u.prototype,`rendererFields`,void 0),e([i()],u.prototype,`labelingFields`,void 0),e([i()],u.prototype,`viewFilterFields`,void 0),u=e([a(`esri.views.3d.layers.support.SceneLayerViewRequiredFields`)],u);export{u as SceneLayerViewRequiredFields};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{AsyncUpdateMixin as n}from"../../../../core/AsyncUpdate.js";import r from"../../../../core/Logger.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{fallbackObjectIDAttribute as o}from"../../../../layers/LayerConstants.js";import{fixFields as s,collectLabelingFields as c,collectFilterFields as l}from"../../../../layers/support/fieldUtils.js";let u=class extends n(t){get layer(){return this.layerView.layer}get requiredFields(){let{layerView:{layer:{fieldsIndex:e,objectIdField:t},definitionExpressionFields:n},rendererFields:r,labelingFields:i,viewFilterFields:a,highlightFields:c}=this;return s(e,[...n??[],...r??[],...i??[],...a??[],...c??[],t??o])}constructor(e){super(e)}initialize(){this.addHandles([this.autoUpdateAsync(`rendererFields`,async()=>{let{fieldsIndex:e,renderer:t}=this.layer;return t?this._getFieldsAsync(n=>t.collectRequiredFields(n,e)):null}),this.autoUpdateAsync(`labelingFields`,async()=>{let{layer:e}=this;return e.labelsVisible?this._getFieldsAsync(t=>c(t,e)):null}),this.autoUpdateAsync(`viewFilterFields`,()=>{let{layer:e,mergedFilter:t}=this.layerView;return this._getFieldsAsync(n=>l(n,e,t))}),this.autoUpdateAsync(`highlightFields`,()=>{let{layer:e,highlightFilters:t}=this.layerView;return this._getFieldsAsync(async n=>{await Promise.all(t.map(t=>l(n,e,t)))})})])}async _getFieldsAsync(e){let t=new Set;try{return await e(t),Array.from(t).sort()}catch(e){return r.getLogger(this).error(e),null}}};e([i()],u.prototype,`layerView`,void 0),e([i()],u.prototype,`layer`,null),e([i()],u.prototype,`requiredFields`,null),e([i()],u.prototype,`rendererFields`,void 0),e([i()],u.prototype,`labelingFields`,void 0),e([i()],u.prototype,`viewFilterFields`,void 0),e([i()],u.prototype,`highlightFields`,void 0),u=e([a(`esri.views.3d.layers.support.SceneLayerViewRequiredFields`)],u);export{u as SceneLayerViewRequiredFields};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{makeHandle as e}from"../../../../core/handleUtils.js";import{debounce as t,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{watch as r,syncAndInitial as i,whenOnce as a}from"../../../../core/reactiveUtils.js";import{collectFilterFields as o}from"../../../../layers/support/fieldUtils.js";import{TaskPriority as s}from"../../../support/Scheduler.js";function c(c){let{owner:l,filter:u,layer:d,scheduler:f,updatingHandles:p,getAvailableFields:m,query:h,apply:g,onChange:_}=c,v=f.registerTask(s.FEATURE_FILTER_HIGHLIGHT),y=new AbortController,{signal:b}=y,x=!1,S=t(async e=>(n(e),v.scheduleGenerator(async function*(){x=!1;let t=new Set;await o(t,d,u),n(e),yield,await a(()=>Array.from(t).every(e=>m().includes(e)),{signal:e}),n(e),yield;let r=await h(e);n(e),yield,g(r)},e))),C=()=>{x||(x=!0,p.consumePromise(S(b)))},w=Symbol();return l.addHandles([r(()=>[u.toJSON(),m()],C,i),e(()=>{y.abort(),v.remove()}),...c.handles,_(C)],w),e(()=>l.removeHandles(w))}export{c as createFeatureFilterHighlight};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Error.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,createAbortError as a}from"../../../../core/promiseUtils.js";import{difference as o}from"../../../../core/SetUtils.js";import{parseWhereClause as s}from"../../../../core/sql.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{fromFeatureSetJSON as u}from"../../../../layers/graphics/dehydratedFeatures.js";import{canConvertSqlRelativeTime as d,sqlRelativeTimeToAbsolute as f}from"../../../../layers/support/relativeTimeQueryUtils.js";import p from"../../../../layers/support/TimeInformation.js";import{queueAutoPriority as m}from"../../../../request/queue.js";import{runQuery as h,executeQuery as g,executeQueryForCount as _}from"../../../../rest/query/operations/query.js";import{PBFDecoder as v}from"../../support/PBFDecoder.js";let y=class extends t{constructor(e){super(e)}get implicitFields(){if(!this.layer.outFields?.includes(`*`))return new Set;let e=new Set(this.layerView.requiredFields),t=new Set(this.layerView.availableFields);return o(t,e)}async queryFeaturesDehydrated(e,t){let{layer:n}=this,r=n.capabilities,o=r?.query?.supportsFormatPBF,c=n.parsedUrl,l=d(e.where)?await f(n.fieldsIndex,e.where,r.query.relativeTimeBinWindow):e.where,p=e.where;l!==e.where&&(e=e.clone(),e.where=l);let m;if(o){this._decoder??=new v(this.controller);let r={sourceSpatialReference:n.spatialReference?.toJSON()??null,applyTransform:!0,maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:C};m=await h(c,e,`pbf`,this._createRequestOptions(t),void 0,this._createLayerMetadata()).then(e=>(i(t),this._decoder==null?Promise.reject(a()):this._decoder.invoke({buffer:e,options:r},t.completeFeatureFromTransfer,t.signal)))}else m=await g(c,e,n.spatialReference,this._createRequestOptions(t),this._createLayerMetadata()).then(e=>u(e,{maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:C}));if(p&&e.where!==p){let e=await this.controller.schedule(()=>s(p,this.layer.fieldsIndex),t.signal);m.features=await this.controller.schedule(()=>m.features.filter(t=>e.testFeatureCompiled(t)),t.signal)}return m}queryFeatureCount(e,t){return _(this.layer.parsedUrl,e,this._createRequestOptions(t),this._createLayerMetadata())}destroy(){this._decoder=r(this._decoder)}_createLayerMetadata(){let{layer:e}=this,{fieldsIndex:t}=e,n=`uniqueIdFields`in e?e.uniqueIdFields:void 0;return{timeInformation:new p({fieldsIndex:t,layer:e}),uniqueIdFields:n}}_createRequestOptions(e){return{...m,...e,query:{...this.layer.customParameters,token:this.layer.apiKey,...e?.query}}}};e([c({constructOnly:!0})],y.prototype,`layer`,void 0),e([c({constructOnly:!0})],y.prototype,`layerView`,void 0),e([c({constructOnly:!0})],y.prototype,`controller`,void 0),e([c({readOnly:!0})],y.prototype,`implicitFields`,null),y=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D`)],y);let b=class extends t{constructor(e){super(e)}queryFeaturesDehydrated(e,t){return this.layer.queryFeatures(e,t)}};e([c({constructOnly:!0})],b.prototype,`layer`,void 0),b=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileOGCServiceQuery3D`)],b);let x=class extends t{constructor(e){super(e)}queryFeaturesDehydrated(e,t){return this.layer.source.queryFeaturesJSON(e,t).then(u,n=>{if(n&&n.name===`query-features-json:unsupported`)return this.layer.queryFeatures(e,t);throw n})}queryFeatureCount(e,t){return this.layer.queryFeatureCount(e,t)}};e([c({constructOnly:!0})],x.prototype,`layer`,void 0),x=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileClientQuery3D`)],x);function S(e,t){let{layer:r}=e;switch(r.type){case`feature`:switch(r.source.type){case`feature-layer`:return new y({layer:r,layerView:e,controller:t});case`memory`:return new x({layer:r});case`csv`:case`geojson`:case`oriented-imagery`:case`wfs`:case`ogc-feature`:case`parquet`:break;default:r.source.type}break;case`catalog-footprint`:return new y({layer:r,layerView:e,controller:t});case`csv`:case`geojson`:case`oriented-imagery`:case`wfs`:return new x({layer:r});case`ogc-feature`:return new b({layer:r})}throw new n(`feature-layer:unsupported`,`Unsupported Feature layer type ${e.layer.type}:${e.layer.source.type}`)}const C=1024;export{S as createFeatureTileQuery3D};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Error.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,createAbortError as a}from"../../../../core/promiseUtils.js";import{difference as o}from"../../../../core/SetUtils.js";import{parseWhereClause as s}from"../../../../core/sql.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{fromFeatureSetJSON as u}from"../../../../layers/graphics/dehydratedFeatures.js";import{canConvertSqlRelativeTime as d,sqlRelativeTimeToAbsolute as f}from"../../../../layers/support/relativeTimeQueryUtils.js";import p from"../../../../layers/support/TimeInformation.js";import{queueAutoPriority as m}from"../../../../request/queue.js";import{runQuery as h,executeQuery as g,executeQueryForCount as _}from"../../../../rest/query/operations/query.js";import{PBFDecoder as v}from"../../support/PBFDecoder.js";let y=class extends t{constructor(e){super(e)}get implicitFields(){if(!this.layer.outFields?.includes(`*`))return new Set;let e=new Set(this.layerView.requiredFields),t=new Set(this.layerView.availableFields);return o(t,e)}async queryFeaturesDehydrated(e,t){let{layer:n}=this,r=n.capabilities,o=r?.query?.supportsFormatPBF,c=n.parsedUrl,l=d(e.where)?await f(n.fieldsIndex,e.where,r.query.relativeTimeBinWindow):e.where,p=e.where;l!==e.where&&(e=e.clone(),e.where=l);let m;if(o){this._decoder??=new v(this.controller);let r={sourceSpatialReference:n.spatialReference?.toJSON()??null,applyTransform:!0,maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:C};m=await h(c,e,`pbf`,this._createRequestOptions(t),void 0,this._createLayerMetadata()).then(e=>(i(t),this._decoder==null?Promise.reject(a()):this._decoder.invoke({buffer:e,options:r},t.completeFeatureFromTransfer,t.signal)))}else m=await g(c,e,n.spatialReference,this._createRequestOptions(t),this._createLayerMetadata()).then(e=>u(e,{maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:C}));if(p&&e.where!==p){let e=await this.controller.schedule(()=>s(p,this.layer.fieldsIndex),t.signal);m.features=await this.controller.schedule(()=>m.features.filter(t=>e.testFeatureCompiled(t)),t.signal)}return m}queryFeatureCount(e,t){return _(this.layer.parsedUrl,e,this._createRequestOptions(t),this._createLayerMetadata())}destroy(){this._decoder=r(this._decoder)}_createLayerMetadata(){let{layer:e}=this,{fieldsIndex:t}=e,n=`uniqueIdFields`in e?e.uniqueIdFields:void 0;return{encodingCapabilities:e.capabilities?.query,timeInformation:new p({fieldsIndex:t,layer:e}),uniqueIdFields:n}}_createRequestOptions(e){return{...m,...e,query:{...this.layer.customParameters,token:this.layer.apiKey,...e?.query}}}};e([c({constructOnly:!0})],y.prototype,`layer`,void 0),e([c({constructOnly:!0})],y.prototype,`layerView`,void 0),e([c({constructOnly:!0})],y.prototype,`controller`,void 0),e([c({readOnly:!0})],y.prototype,`implicitFields`,null),y=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D`)],y);let b=class extends t{constructor(e){super(e)}queryFeaturesDehydrated(e,t){return this.layer.queryFeatures(e,t)}};e([c({constructOnly:!0})],b.prototype,`layer`,void 0),b=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileOGCServiceQuery3D`)],b);let x=class extends t{constructor(e){super(e)}queryFeaturesDehydrated(e,t){return this.layer.source.queryFeaturesJSON(e,t).then(u,n=>{if(n&&n.name===`query-features-json:unsupported`)return this.layer.queryFeatures(e,t);throw n})}queryFeatureCount(e,t){return this.layer.queryFeatureCount(e,t)}};e([c({constructOnly:!0})],x.prototype,`layer`,void 0),x=e([l(`esri.views.3d.layers.support.featureTileQuery3D.FeatureTileClientQuery3D`)],x);function S(e,t){let{layer:r}=e;switch(r.type){case`feature`:switch(r.source.type){case`feature-layer`:return new y({layer:r,layerView:e,controller:t});case`memory`:return new x({layer:r});case`csv`:case`geojson`:case`oriented-imagery`:case`wfs`:case`ogc-feature`:case`parquet`:break;default:r.source.type}break;case`catalog-footprint`:return new y({layer:r,layerView:e,controller:t});case`csv`:case`geojson`:case`oriented-imagery`:case`wfs`:return new x({layer:r});case`ogc-feature`:return new b({layer:r})}throw new n(`feature-layer:unsupported`,`Unsupported Feature layer type ${e.layer.type}:${e.layer.source.type}`)}const C=1024;export{S as createFeatureTileQuery3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Collection.js";import{makeHandle as t}from"../../../../core/handleUtils.js";import{isGraphic as n}from"../../../../support/graphicInstanceUtils.js";function r(t){return e.isCollection(t)?t.toArray():Array.isArray(t)?t:
|
|
2
|
+
import e from"../../../../core/Collection.js";import{makeHandle as t}from"../../../../core/handleUtils.js";import{isGraphic as n}from"../../../../support/graphicInstanceUtils.js";function r(t){return e.isCollection(t)?t.toArray():Array.isArray(t)?t:a(t)||n(t)||c(t)?[t]:o}function i(e){return typeof e==`object`&&`where`in e}function a(e){return typeof e==`number`||typeof e==`string`}const o=[],s=t();function c(e){return e.declaredClass===`esri.views.3d.layers.i3s.PointCloudGraphic`}export{s as emptyHighlightHandle,i as isFeatureFilter,a as isObjectId,r as normalizeHighlightTarget};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{unitFromRESTJSON as e,convertUnit as t}from"../../../../core/units.js";import n from"../../../../geometry/HeightModelInfo.js";import{isCompatible as r}from"../../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as i,isWebMercator as a,equals as o,isGeographic as s}from"../../../../geometry/support/spatialReferenceUtils.js";import c from"../../../../geometry/support/WKIDUnitConversion.js";import{getHeightModelInfoFromVCS as l}from"../../../../layers/support/tiles3DUtils.js";function u({viewingMode:u,renderSpatialReference:d,esriCrsSpatialReference:f,heightModelInfo:p}){if(u===1||i(d)||a(d))return{useEsriCrs:!1,metersPerVCSUnit:1};if(!f||!o(f,d)||f.vcsWkid===115700)return null;let m=l(f);if(!m){let t=f,r=`meters`;!s(t)&&t.wkid&&t.wkid!==-1&&(r=e(c.units[c[t.wkid]])),r&&(m=new n({heightModel:`gravity-related-height`,heightUnit:r}))}return r(m,p,!1)===0?{useEsriCrs:!0,metersPerVCSUnit:m?t(1,m.heightUnit,`meters`):1}:null}export{u as selectTiles3DSpatialReference};
|