@itwin/core-frontend 3.1.0-dev.7 → 3.1.1
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/CHANGELOG.md +210 -35
- package/lib/cjs/AccuSnap.js +2 -2
- package/lib/cjs/AccuSnap.js.map +1 -1
- package/lib/cjs/ApproximateTerrainHeights.d.ts +1 -1
- package/lib/cjs/ApproximateTerrainHeights.d.ts.map +1 -1
- package/lib/cjs/ApproximateTerrainHeights.js +21 -9
- package/lib/cjs/ApproximateTerrainHeights.js.map +1 -1
- package/lib/cjs/ApproximateTerrainHeightsProps.d.ts +12 -0
- package/lib/cjs/ApproximateTerrainHeightsProps.d.ts.map +1 -0
- package/lib/cjs/ApproximateTerrainHeightsProps.js +13 -0
- package/lib/cjs/ApproximateTerrainHeightsProps.js.map +1 -0
- package/lib/cjs/BriefcaseConnection.d.ts.map +1 -1
- package/lib/cjs/BriefcaseConnection.js +6 -5
- package/lib/cjs/BriefcaseConnection.js.map +1 -1
- package/lib/cjs/CategorySelectorState.js +1 -1
- package/lib/cjs/CategorySelectorState.js.map +1 -1
- package/lib/cjs/DisplayStyleState.d.ts +4 -3
- package/lib/cjs/DisplayStyleState.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleState.js +32 -8
- package/lib/cjs/DisplayStyleState.js.map +1 -1
- package/lib/cjs/DrawingViewState.d.ts.map +1 -1
- package/lib/cjs/DrawingViewState.js +9 -8
- package/lib/cjs/DrawingViewState.js.map +1 -1
- package/lib/cjs/FrontendLoggerCategory.d.ts +3 -1
- package/lib/cjs/FrontendLoggerCategory.d.ts.map +1 -1
- package/lib/cjs/FrontendLoggerCategory.js +2 -0
- package/lib/cjs/FrontendLoggerCategory.js.map +1 -1
- package/lib/cjs/IModelApp.d.ts +10 -4
- package/lib/cjs/IModelApp.d.ts.map +1 -1
- package/lib/cjs/IModelApp.js +26 -13
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/IModelConnection.d.ts +3 -2
- package/lib/cjs/IModelConnection.d.ts.map +1 -1
- package/lib/cjs/IModelConnection.js +6 -4
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/ImageUtil.d.ts.map +1 -1
- package/lib/cjs/ImageUtil.js +8 -14
- package/lib/cjs/ImageUtil.js.map +1 -1
- package/lib/cjs/LocalhostIpcApp.d.ts +2 -0
- package/lib/cjs/LocalhostIpcApp.d.ts.map +1 -1
- package/lib/cjs/LocalhostIpcApp.js +10 -4
- package/lib/cjs/LocalhostIpcApp.js.map +1 -1
- package/lib/cjs/RealityDataSource.d.ts +60 -14
- package/lib/cjs/RealityDataSource.d.ts.map +1 -1
- package/lib/cjs/RealityDataSource.js +36 -235
- package/lib/cjs/RealityDataSource.js.map +1 -1
- package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts +67 -0
- package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -0
- package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js +166 -0
- package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js.map +1 -0
- package/lib/cjs/RealityDataSourceContextShareImpl.d.ts +83 -0
- package/lib/cjs/RealityDataSourceContextShareImpl.d.ts.map +1 -0
- package/lib/cjs/RealityDataSourceContextShareImpl.js +234 -0
- package/lib/cjs/RealityDataSourceContextShareImpl.js.map +1 -0
- package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts +65 -0
- package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -0
- package/lib/cjs/RealityDataSourceTilesetUrlImpl.js +135 -0
- package/lib/cjs/RealityDataSourceTilesetUrlImpl.js.map +1 -0
- package/lib/cjs/SheetViewState.js +7 -3
- package/lib/cjs/SheetViewState.js.map +1 -1
- package/lib/cjs/ViewState.d.ts +8 -0
- package/lib/cjs/ViewState.d.ts.map +1 -1
- package/lib/cjs/ViewState.js +1 -1
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/Viewport.d.ts +35 -14
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +59 -10
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +6 -4
- package/lib/cjs/core-frontend.d.ts.map +1 -1
- package/lib/cjs/core-frontend.js +6 -4
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/extension/Extension.d.ts +48 -0
- package/lib/cjs/extension/Extension.d.ts.map +1 -0
- package/lib/cjs/extension/Extension.js +18 -0
- package/lib/cjs/extension/Extension.js.map +1 -0
- package/lib/cjs/extension/ExtensionAdmin.d.ts +64 -0
- package/lib/cjs/extension/ExtensionAdmin.d.ts.map +1 -0
- package/lib/cjs/extension/ExtensionAdmin.js +106 -0
- package/lib/cjs/extension/ExtensionAdmin.js.map +1 -0
- package/lib/cjs/extension/ExtensionHost.d.ts +23 -0
- package/lib/cjs/extension/ExtensionHost.d.ts.map +1 -0
- package/lib/cjs/extension/ExtensionHost.js +26 -0
- package/lib/cjs/extension/ExtensionHost.js.map +1 -0
- package/lib/cjs/extension/ExtensionImpl.d.ts +21 -0
- package/lib/cjs/extension/ExtensionImpl.d.ts.map +1 -0
- package/lib/cjs/extension/ExtensionImpl.js +45 -0
- package/lib/cjs/extension/ExtensionImpl.js.map +1 -0
- package/lib/cjs/extension/ExtensionLoader.d.ts +26 -0
- package/lib/cjs/extension/ExtensionLoader.d.ts.map +1 -0
- package/lib/cjs/extension/ExtensionLoader.js +10 -0
- package/lib/cjs/extension/ExtensionLoader.js.map +1 -0
- package/lib/cjs/extension/ExtensionRuntime.d.ts +5 -0
- package/lib/cjs/extension/ExtensionRuntime.d.ts.map +1 -0
- package/lib/cjs/extension/ExtensionRuntime.js +86 -0
- package/lib/cjs/extension/ExtensionRuntime.js.map +1 -0
- package/lib/cjs/extension/extensions.d.ts +19 -0
- package/lib/cjs/extension/extensions.d.ts.map +1 -0
- package/lib/cjs/extension/extensions.js +36 -0
- package/lib/cjs/extension/extensions.js.map +1 -0
- package/lib/cjs/quantity-formatting/BasicUnitsProvider.d.ts +2 -2
- package/lib/cjs/quantity-formatting/BasicUnitsProvider.d.ts.map +1 -1
- package/lib/cjs/quantity-formatting/BasicUnitsProvider.js +48 -44
- package/lib/cjs/quantity-formatting/BasicUnitsProvider.js.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts +90 -80
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.js +85 -45
- package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityTypesEditorSpecs.d.ts +54 -0
- package/lib/cjs/quantity-formatting/QuantityTypesEditorSpecs.d.ts.map +1 -0
- package/lib/cjs/quantity-formatting/QuantityTypesEditorSpecs.js +32 -0
- package/lib/cjs/quantity-formatting/QuantityTypesEditorSpecs.js.map +1 -0
- package/lib/cjs/quantity-formatting/UnitsData.d.ts +11 -0
- package/lib/cjs/quantity-formatting/UnitsData.d.ts.map +1 -0
- package/lib/cjs/quantity-formatting/UnitsData.js +59 -0
- package/lib/cjs/quantity-formatting/UnitsData.js.map +1 -0
- package/lib/cjs/render/GraphicBranch.d.ts +2 -0
- package/lib/cjs/render/GraphicBranch.d.ts.map +1 -1
- package/lib/cjs/render/GraphicBranch.js.map +1 -1
- package/lib/cjs/render/RenderPlanarClassifier.d.ts +1 -1
- package/lib/cjs/render/RenderPlanarClassifier.d.ts.map +1 -1
- package/lib/cjs/render/RenderPlanarClassifier.js.map +1 -1
- package/lib/cjs/render/RenderSystem.d.ts +12 -7
- package/lib/cjs/render/RenderSystem.d.ts.map +1 -1
- package/lib/cjs/render/RenderSystem.js +8 -5
- package/lib/cjs/render/RenderSystem.js.map +1 -1
- package/lib/cjs/render/RenderTarget.d.ts +4 -4
- package/lib/cjs/render/RenderTarget.d.ts.map +1 -1
- package/lib/cjs/render/RenderTarget.js.map +1 -1
- package/lib/cjs/render/Scene.d.ts.map +1 -1
- package/lib/cjs/render/Scene.js.map +1 -1
- package/lib/cjs/render/primitives/mesh/RealityMeshPrimitive.d.ts +17 -2
- package/lib/cjs/render/primitives/mesh/RealityMeshPrimitive.d.ts.map +1 -1
- package/lib/cjs/render/primitives/mesh/RealityMeshPrimitive.js +39 -2
- package/lib/cjs/render/primitives/mesh/RealityMeshPrimitive.js.map +1 -1
- package/lib/cjs/render/webgl/BackgroundMapDrape.js +1 -1
- package/lib/cjs/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/cjs/render/webgl/BranchState.d.ts +2 -0
- package/lib/cjs/render/webgl/BranchState.d.ts.map +1 -1
- package/lib/cjs/render/webgl/BranchState.js +5 -3
- package/lib/cjs/render/webgl/BranchState.js.map +1 -1
- package/lib/cjs/render/webgl/DrawCommand.js +1 -1
- package/lib/cjs/render/webgl/DrawCommand.js.map +1 -1
- package/lib/cjs/render/webgl/Graphic.d.ts +5 -3
- package/lib/cjs/render/webgl/Graphic.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Graphic.js +7 -2
- package/lib/cjs/render/webgl/Graphic.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.d.ts +4 -1
- package/lib/cjs/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/cjs/render/webgl/PlanarClassifier.js +22 -9
- package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/cjs/render/webgl/PlanarTextureProjection.d.ts +2 -2
- package/lib/cjs/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
- package/lib/cjs/render/webgl/PlanarTextureProjection.js +5 -3
- package/lib/cjs/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/cjs/render/webgl/RealityMesh.d.ts +31 -11
- package/lib/cjs/render/webgl/RealityMesh.d.ts.map +1 -1
- package/lib/cjs/render/webgl/RealityMesh.js +155 -52
- package/lib/cjs/render/webgl/RealityMesh.js.map +1 -1
- package/lib/cjs/render/webgl/RenderCommands.d.ts.map +1 -1
- package/lib/cjs/render/webgl/RenderCommands.js +4 -0
- package/lib/cjs/render/webgl/RenderCommands.js.map +1 -1
- package/lib/cjs/render/webgl/SceneCompositor.d.ts +3 -0
- package/lib/cjs/render/webgl/SceneCompositor.d.ts.map +1 -1
- package/lib/cjs/render/webgl/SceneCompositor.js +45 -19
- package/lib/cjs/render/webgl/SceneCompositor.js.map +1 -1
- package/lib/cjs/render/webgl/ShaderProgram.d.ts +1 -0
- package/lib/cjs/render/webgl/ShaderProgram.d.ts.map +1 -1
- package/lib/cjs/render/webgl/ShaderProgram.js +1 -0
- package/lib/cjs/render/webgl/ShaderProgram.js.map +1 -1
- package/lib/cjs/render/webgl/System.d.ts +9 -9
- package/lib/cjs/render/webgl/System.d.ts.map +1 -1
- package/lib/cjs/render/webgl/System.js +5 -5
- package/lib/cjs/render/webgl/System.js.map +1 -1
- package/lib/cjs/render/webgl/Target.d.ts.map +1 -1
- package/lib/cjs/render/webgl/Target.js.map +1 -1
- package/lib/cjs/render/webgl/glsl/PlanarClassification.js +1 -1
- package/lib/cjs/render/webgl/glsl/PlanarClassification.js.map +1 -1
- package/lib/cjs/render/webgl/glsl/RealityMesh.d.ts.map +1 -1
- package/lib/cjs/render/webgl/glsl/RealityMesh.js +102 -27
- package/lib/cjs/render/webgl/glsl/RealityMesh.js.map +1 -1
- package/lib/cjs/tile/ClassifierTileTree.d.ts +4 -2
- package/lib/cjs/tile/ClassifierTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/ClassifierTileTree.js +31 -16
- package/lib/cjs/tile/ClassifierTileTree.js.map +1 -1
- package/lib/cjs/tile/DynamicIModelTile.d.ts.map +1 -1
- package/lib/cjs/tile/DynamicIModelTile.js +1 -1
- package/lib/cjs/tile/DynamicIModelTile.js.map +1 -1
- package/lib/cjs/tile/GltfReader.d.ts +22 -3
- package/lib/cjs/tile/GltfReader.d.ts.map +1 -1
- package/lib/cjs/tile/GltfReader.js +224 -40
- package/lib/cjs/tile/GltfReader.js.map +1 -1
- package/lib/cjs/tile/IModelTileRequestChannels.d.ts +3 -3
- package/lib/cjs/tile/IModelTileRequestChannels.d.ts.map +1 -1
- package/lib/cjs/tile/IModelTileRequestChannels.js +7 -11
- package/lib/cjs/tile/IModelTileRequestChannels.js.map +1 -1
- package/lib/cjs/tile/LRUTileList.d.ts +29 -29
- package/lib/cjs/tile/LRUTileList.d.ts.map +1 -1
- package/lib/cjs/tile/LRUTileList.js +50 -50
- package/lib/cjs/tile/LRUTileList.js.map +1 -1
- package/lib/cjs/tile/OPCFormatInterpreter.d.ts +22 -0
- package/lib/cjs/tile/OPCFormatInterpreter.d.ts.map +1 -0
- package/lib/cjs/tile/OPCFormatInterpreter.js +92 -0
- package/lib/cjs/tile/OPCFormatInterpreter.js.map +1 -0
- package/lib/cjs/tile/OrbitGtTileTree.js +1 -1
- package/lib/cjs/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/cjs/tile/PntsReader.d.ts +1 -1
- package/lib/cjs/tile/PntsReader.d.ts.map +1 -1
- package/lib/cjs/tile/PntsReader.js +170 -36
- package/lib/cjs/tile/PntsReader.js.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.d.ts +18 -2
- package/lib/cjs/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.js +53 -2
- package/lib/cjs/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.d.ts +24 -3
- package/lib/cjs/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.js +37 -12
- package/lib/cjs/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/tile/RealityTile.d.ts +17 -3
- package/lib/cjs/tile/RealityTile.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTile.js +34 -2
- package/lib/cjs/tile/RealityTile.js.map +1 -1
- package/lib/cjs/tile/RealityTileDrawArgs.d.ts +4 -1
- package/lib/cjs/tile/RealityTileDrawArgs.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTileDrawArgs.js +3 -1
- package/lib/cjs/tile/RealityTileDrawArgs.js.map +1 -1
- package/lib/cjs/tile/RealityTileLoader.d.ts +8 -5
- package/lib/cjs/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTileLoader.js +20 -6
- package/lib/cjs/tile/RealityTileLoader.js.map +1 -1
- package/lib/cjs/tile/RealityTileTree.d.ts +4 -1
- package/lib/cjs/tile/RealityTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTileTree.js +12 -4
- package/lib/cjs/tile/RealityTileTree.js.map +1 -1
- package/lib/cjs/tile/ThreeDTileFormatInterpreter.d.ts +52 -0
- package/lib/cjs/tile/ThreeDTileFormatInterpreter.d.ts.map +1 -0
- package/lib/cjs/tile/ThreeDTileFormatInterpreter.js +179 -0
- package/lib/cjs/tile/ThreeDTileFormatInterpreter.js.map +1 -0
- package/lib/cjs/tile/Tile.d.ts +5 -4
- package/lib/cjs/tile/Tile.d.ts.map +1 -1
- package/lib/cjs/tile/Tile.js +3 -2
- package/lib/cjs/tile/Tile.js.map +1 -1
- package/lib/cjs/tile/TileAdmin.d.ts +43 -45
- package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
- package/lib/cjs/tile/TileAdmin.js +104 -104
- package/lib/cjs/tile/TileAdmin.js.map +1 -1
- package/lib/cjs/tile/TileDrawArgs.d.ts +2 -0
- package/lib/cjs/tile/TileDrawArgs.d.ts.map +1 -1
- package/lib/cjs/tile/TileDrawArgs.js +5 -0
- package/lib/cjs/tile/TileDrawArgs.js.map +1 -1
- package/lib/cjs/tile/TileGeometryCollector.d.ts +80 -0
- package/lib/cjs/tile/TileGeometryCollector.d.ts.map +1 -0
- package/lib/cjs/tile/TileGeometryCollector.js +71 -0
- package/lib/cjs/tile/TileGeometryCollector.js.map +1 -0
- package/lib/cjs/tile/TileRequest.d.ts +12 -9
- package/lib/cjs/tile/TileRequest.d.ts.map +1 -1
- package/lib/cjs/tile/TileRequest.js +19 -11
- package/lib/cjs/tile/TileRequest.js.map +1 -1
- package/lib/cjs/tile/TileRequestChannel.js +3 -3
- package/lib/cjs/tile/TileRequestChannel.js.map +1 -1
- package/lib/cjs/tile/TileRequestChannels.d.ts +0 -4
- package/lib/cjs/tile/TileRequestChannels.d.ts.map +1 -1
- package/lib/cjs/tile/TileRequestChannels.js +1 -6
- package/lib/cjs/tile/TileRequestChannels.js.map +1 -1
- package/lib/cjs/tile/TileTree.d.ts +7 -1
- package/lib/cjs/tile/TileTree.d.ts.map +1 -1
- package/lib/cjs/tile/TileTree.js +8 -1
- package/lib/cjs/tile/TileTree.js.map +1 -1
- package/lib/cjs/tile/TileTreeReference.d.ts +27 -2
- package/lib/cjs/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/cjs/tile/TileTreeReference.js +41 -1
- package/lib/cjs/tile/TileTreeReference.js.map +1 -1
- package/lib/cjs/tile/TileUsageMarker.d.ts +9 -9
- package/lib/cjs/tile/TileUsageMarker.d.ts.map +1 -1
- package/lib/cjs/tile/TileUsageMarker.js +9 -9
- package/lib/cjs/tile/TileUsageMarker.js.map +1 -1
- package/lib/cjs/tile/TileUser.d.ts +33 -0
- package/lib/cjs/tile/TileUser.d.ts.map +1 -0
- package/lib/cjs/tile/TileUser.js +28 -0
- package/lib/cjs/tile/TileUser.js.map +1 -0
- package/lib/cjs/tile/TileUserSet.d.ts +28 -0
- package/lib/cjs/tile/TileUserSet.d.ts.map +1 -0
- package/lib/cjs/tile/TileUserSet.js +123 -0
- package/lib/cjs/tile/TileUserSet.js.map +1 -0
- package/lib/cjs/tile/internal.d.ts +6 -0
- package/lib/cjs/tile/internal.d.ts.map +1 -1
- package/lib/cjs/tile/internal.js +6 -0
- package/lib/cjs/tile/internal.js.map +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.js +2 -2
- package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +6 -5
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +46 -13
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts +3 -4
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +1 -1
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.d.ts +2 -2
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +3 -4
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +5 -4
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/TileUrlImageryProvider.d.ts +2 -2
- package/lib/cjs/tile/map/ImageryProviders/TileUrlImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/TileUrlImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/WmsMapLayerImageryProvider.d.ts +2 -3
- package/lib/cjs/tile/map/ImageryProviders/WmsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +13 -11
- package/lib/cjs/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts +2 -2
- package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.d.ts +4 -5
- package/lib/cjs/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js +5 -4
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapFeatureInfo.d.ts +26 -0
- package/lib/cjs/tile/map/MapFeatureInfo.d.ts.map +1 -0
- package/lib/cjs/tile/map/MapFeatureInfo.js +19 -0
- package/lib/cjs/tile/map/MapFeatureInfo.js.map +1 -0
- package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +4 -4
- package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts +3 -3
- package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +5 -4
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js +5 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerSources.d.ts +2 -2
- package/lib/cjs/tile/map/MapLayerSources.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerSources.js +6 -4
- package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerTileTreeReference.d.ts +10 -2
- package/lib/cjs/tile/map/MapLayerTileTreeReference.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerTileTreeReference.js +26 -3
- package/lib/cjs/tile/map/MapLayerTileTreeReference.js.map +1 -1
- package/lib/cjs/tile/map/MapTile.d.ts +12 -10
- package/lib/cjs/tile/map/MapTile.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTile.js +60 -39
- package/lib/cjs/tile/map/MapTile.js.map +1 -1
- package/lib/cjs/tile/map/MapTileLoader.d.ts +2 -1
- package/lib/cjs/tile/map/MapTileLoader.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTileLoader.js +4 -1
- package/lib/cjs/tile/map/MapTileLoader.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts +21 -11
- package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +154 -67
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapTiledGraphicsProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTiledGraphicsProvider.js +1 -1
- package/lib/cjs/tile/map/MapTiledGraphicsProvider.js.map +1 -1
- package/lib/cjs/tile/map/WmsCapabilities.d.ts +3 -2
- package/lib/cjs/tile/map/WmsCapabilities.d.ts.map +1 -1
- package/lib/cjs/tile/map/WmsCapabilities.js +11 -10
- package/lib/cjs/tile/map/WmsCapabilities.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.d.ts +2 -3
- package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +7 -2
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/cjs/tools/ViewTool.d.ts +4 -4
- package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
- package/lib/cjs/tools/ViewTool.js +1 -1
- package/lib/cjs/tools/ViewTool.js.map +1 -1
- package/lib/esm/AccuSnap.js +2 -2
- package/lib/esm/AccuSnap.js.map +1 -1
- package/lib/esm/ApproximateTerrainHeights.d.ts +1 -1
- package/lib/esm/ApproximateTerrainHeights.d.ts.map +1 -1
- package/lib/esm/ApproximateTerrainHeights.js +2 -9
- package/lib/esm/ApproximateTerrainHeights.js.map +1 -1
- package/lib/esm/ApproximateTerrainHeightsProps.d.ts +12 -0
- package/lib/esm/ApproximateTerrainHeightsProps.d.ts.map +1 -0
- package/lib/esm/ApproximateTerrainHeightsProps.js +10 -0
- package/lib/esm/ApproximateTerrainHeightsProps.js.map +1 -0
- package/lib/esm/BriefcaseConnection.d.ts.map +1 -1
- package/lib/esm/BriefcaseConnection.js +6 -5
- package/lib/esm/BriefcaseConnection.js.map +1 -1
- package/lib/esm/CategorySelectorState.js +1 -1
- package/lib/esm/CategorySelectorState.js.map +1 -1
- package/lib/esm/DisplayStyleState.d.ts +4 -3
- package/lib/esm/DisplayStyleState.d.ts.map +1 -1
- package/lib/esm/DisplayStyleState.js +34 -10
- package/lib/esm/DisplayStyleState.js.map +1 -1
- package/lib/esm/DrawingViewState.d.ts.map +1 -1
- package/lib/esm/DrawingViewState.js +9 -8
- package/lib/esm/DrawingViewState.js.map +1 -1
- package/lib/esm/FrontendLoggerCategory.d.ts +3 -1
- package/lib/esm/FrontendLoggerCategory.d.ts.map +1 -1
- package/lib/esm/FrontendLoggerCategory.js +2 -0
- package/lib/esm/FrontendLoggerCategory.js.map +1 -1
- package/lib/esm/IModelApp.d.ts +10 -4
- package/lib/esm/IModelApp.d.ts.map +1 -1
- package/lib/esm/IModelApp.js +25 -12
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/IModelConnection.d.ts +3 -2
- package/lib/esm/IModelConnection.d.ts.map +1 -1
- package/lib/esm/IModelConnection.js +7 -5
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/ImageUtil.d.ts.map +1 -1
- package/lib/esm/ImageUtil.js +8 -14
- package/lib/esm/ImageUtil.js.map +1 -1
- package/lib/esm/LocalhostIpcApp.d.ts +2 -0
- package/lib/esm/LocalhostIpcApp.d.ts.map +1 -1
- package/lib/esm/LocalhostIpcApp.js +10 -4
- package/lib/esm/LocalhostIpcApp.js.map +1 -1
- package/lib/esm/RealityDataSource.d.ts +60 -14
- package/lib/esm/RealityDataSource.d.ts.map +1 -1
- package/lib/esm/RealityDataSource.js +37 -237
- package/lib/esm/RealityDataSource.js.map +1 -1
- package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts +67 -0
- package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -0
- package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js +162 -0
- package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js.map +1 -0
- package/lib/esm/RealityDataSourceContextShareImpl.d.ts +83 -0
- package/lib/esm/RealityDataSourceContextShareImpl.d.ts.map +1 -0
- package/lib/esm/RealityDataSourceContextShareImpl.js +230 -0
- package/lib/esm/RealityDataSourceContextShareImpl.js.map +1 -0
- package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts +65 -0
- package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -0
- package/lib/esm/RealityDataSourceTilesetUrlImpl.js +131 -0
- package/lib/esm/RealityDataSourceTilesetUrlImpl.js.map +1 -0
- package/lib/esm/SheetViewState.js +7 -3
- package/lib/esm/SheetViewState.js.map +1 -1
- package/lib/esm/ViewState.d.ts +8 -0
- package/lib/esm/ViewState.d.ts.map +1 -1
- package/lib/esm/ViewState.js +1 -1
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/Viewport.d.ts +35 -14
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +60 -11
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +6 -4
- package/lib/esm/core-frontend.d.ts.map +1 -1
- package/lib/esm/core-frontend.js +6 -4
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/extension/Extension.d.ts +48 -0
- package/lib/esm/extension/Extension.d.ts.map +1 -0
- package/lib/esm/extension/Extension.js +15 -0
- package/lib/esm/extension/Extension.js.map +1 -0
- package/lib/esm/extension/ExtensionAdmin.d.ts +64 -0
- package/lib/esm/extension/ExtensionAdmin.d.ts.map +1 -0
- package/lib/esm/extension/ExtensionAdmin.js +102 -0
- package/lib/esm/extension/ExtensionAdmin.js.map +1 -0
- package/lib/esm/extension/ExtensionHost.d.ts +23 -0
- package/lib/esm/extension/ExtensionHost.d.ts.map +1 -0
- package/lib/esm/extension/ExtensionHost.js +22 -0
- package/lib/esm/extension/ExtensionHost.js.map +1 -0
- package/lib/esm/extension/ExtensionImpl.d.ts +21 -0
- package/lib/esm/extension/ExtensionImpl.d.ts.map +1 -0
- package/lib/esm/extension/ExtensionImpl.js +40 -0
- package/lib/esm/extension/ExtensionImpl.js.map +1 -0
- package/lib/esm/extension/ExtensionLoader.d.ts +26 -0
- package/lib/esm/extension/ExtensionLoader.d.ts.map +1 -0
- package/lib/esm/extension/ExtensionLoader.js +9 -0
- package/lib/esm/extension/ExtensionLoader.js.map +1 -0
- package/lib/esm/extension/ExtensionRuntime.d.ts +5 -0
- package/lib/esm/extension/ExtensionRuntime.d.ts.map +1 -0
- package/lib/esm/extension/ExtensionRuntime.js +84 -0
- package/lib/esm/extension/ExtensionRuntime.js.map +1 -0
- package/lib/esm/extension/extensions.d.ts +19 -0
- package/lib/esm/extension/extensions.d.ts.map +1 -0
- package/lib/esm/extension/extensions.js +24 -0
- package/lib/esm/extension/extensions.js.map +1 -0
- package/lib/esm/quantity-formatting/BasicUnitsProvider.d.ts +2 -2
- package/lib/esm/quantity-formatting/BasicUnitsProvider.d.ts.map +1 -1
- package/lib/esm/quantity-formatting/BasicUnitsProvider.js +48 -44
- package/lib/esm/quantity-formatting/BasicUnitsProvider.js.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts +90 -80
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.js +85 -42
- package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/esm/quantity-formatting/QuantityTypesEditorSpecs.d.ts +54 -0
- package/lib/esm/quantity-formatting/QuantityTypesEditorSpecs.d.ts.map +1 -0
- package/lib/esm/quantity-formatting/QuantityTypesEditorSpecs.js +26 -0
- package/lib/esm/quantity-formatting/QuantityTypesEditorSpecs.js.map +1 -0
- package/lib/esm/quantity-formatting/UnitsData.d.ts +11 -0
- package/lib/esm/quantity-formatting/UnitsData.d.ts.map +1 -0
- package/lib/esm/quantity-formatting/UnitsData.js +56 -0
- package/lib/esm/quantity-formatting/UnitsData.js.map +1 -0
- package/lib/esm/render/GraphicBranch.d.ts +2 -0
- package/lib/esm/render/GraphicBranch.d.ts.map +1 -1
- package/lib/esm/render/GraphicBranch.js.map +1 -1
- package/lib/esm/render/RenderPlanarClassifier.d.ts +1 -1
- package/lib/esm/render/RenderPlanarClassifier.d.ts.map +1 -1
- package/lib/esm/render/RenderPlanarClassifier.js.map +1 -1
- package/lib/esm/render/RenderSystem.d.ts +12 -7
- package/lib/esm/render/RenderSystem.d.ts.map +1 -1
- package/lib/esm/render/RenderSystem.js +6 -3
- package/lib/esm/render/RenderSystem.js.map +1 -1
- package/lib/esm/render/RenderTarget.d.ts +4 -4
- package/lib/esm/render/RenderTarget.d.ts.map +1 -1
- package/lib/esm/render/RenderTarget.js.map +1 -1
- package/lib/esm/render/Scene.d.ts.map +1 -1
- package/lib/esm/render/Scene.js.map +1 -1
- package/lib/esm/render/primitives/mesh/RealityMeshPrimitive.d.ts +17 -2
- package/lib/esm/render/primitives/mesh/RealityMeshPrimitive.d.ts.map +1 -1
- package/lib/esm/render/primitives/mesh/RealityMeshPrimitive.js +39 -2
- package/lib/esm/render/primitives/mesh/RealityMeshPrimitive.js.map +1 -1
- package/lib/esm/render/webgl/BackgroundMapDrape.js +1 -1
- package/lib/esm/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/esm/render/webgl/BranchState.d.ts +2 -0
- package/lib/esm/render/webgl/BranchState.d.ts.map +1 -1
- package/lib/esm/render/webgl/BranchState.js +5 -3
- package/lib/esm/render/webgl/BranchState.js.map +1 -1
- package/lib/esm/render/webgl/DrawCommand.js +1 -1
- package/lib/esm/render/webgl/DrawCommand.js.map +1 -1
- package/lib/esm/render/webgl/Graphic.d.ts +5 -3
- package/lib/esm/render/webgl/Graphic.d.ts.map +1 -1
- package/lib/esm/render/webgl/Graphic.js +7 -2
- package/lib/esm/render/webgl/Graphic.js.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.d.ts +4 -1
- package/lib/esm/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/esm/render/webgl/PlanarClassifier.js +22 -9
- package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/esm/render/webgl/PlanarTextureProjection.d.ts +2 -2
- package/lib/esm/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
- package/lib/esm/render/webgl/PlanarTextureProjection.js +5 -3
- package/lib/esm/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/esm/render/webgl/RealityMesh.d.ts +31 -11
- package/lib/esm/render/webgl/RealityMesh.d.ts.map +1 -1
- package/lib/esm/render/webgl/RealityMesh.js +155 -52
- package/lib/esm/render/webgl/RealityMesh.js.map +1 -1
- package/lib/esm/render/webgl/RenderCommands.d.ts.map +1 -1
- package/lib/esm/render/webgl/RenderCommands.js +4 -0
- package/lib/esm/render/webgl/RenderCommands.js.map +1 -1
- package/lib/esm/render/webgl/SceneCompositor.d.ts +3 -0
- package/lib/esm/render/webgl/SceneCompositor.d.ts.map +1 -1
- package/lib/esm/render/webgl/SceneCompositor.js +45 -19
- package/lib/esm/render/webgl/SceneCompositor.js.map +1 -1
- package/lib/esm/render/webgl/ShaderProgram.d.ts +1 -0
- package/lib/esm/render/webgl/ShaderProgram.d.ts.map +1 -1
- package/lib/esm/render/webgl/ShaderProgram.js +1 -0
- package/lib/esm/render/webgl/ShaderProgram.js.map +1 -1
- package/lib/esm/render/webgl/System.d.ts +9 -9
- package/lib/esm/render/webgl/System.d.ts.map +1 -1
- package/lib/esm/render/webgl/System.js +6 -6
- package/lib/esm/render/webgl/System.js.map +1 -1
- package/lib/esm/render/webgl/Target.d.ts.map +1 -1
- package/lib/esm/render/webgl/Target.js.map +1 -1
- package/lib/esm/render/webgl/glsl/PlanarClassification.js +1 -1
- package/lib/esm/render/webgl/glsl/PlanarClassification.js.map +1 -1
- package/lib/esm/render/webgl/glsl/RealityMesh.d.ts.map +1 -1
- package/lib/esm/render/webgl/glsl/RealityMesh.js +103 -28
- package/lib/esm/render/webgl/glsl/RealityMesh.js.map +1 -1
- package/lib/esm/tile/ClassifierTileTree.d.ts +4 -2
- package/lib/esm/tile/ClassifierTileTree.d.ts.map +1 -1
- package/lib/esm/tile/ClassifierTileTree.js +32 -17
- package/lib/esm/tile/ClassifierTileTree.js.map +1 -1
- package/lib/esm/tile/DynamicIModelTile.d.ts.map +1 -1
- package/lib/esm/tile/DynamicIModelTile.js +1 -1
- package/lib/esm/tile/DynamicIModelTile.js.map +1 -1
- package/lib/esm/tile/GltfReader.d.ts +22 -3
- package/lib/esm/tile/GltfReader.d.ts.map +1 -1
- package/lib/esm/tile/GltfReader.js +207 -42
- package/lib/esm/tile/GltfReader.js.map +1 -1
- package/lib/esm/tile/IModelTileRequestChannels.d.ts +3 -3
- package/lib/esm/tile/IModelTileRequestChannels.d.ts.map +1 -1
- package/lib/esm/tile/IModelTileRequestChannels.js +7 -11
- package/lib/esm/tile/IModelTileRequestChannels.js.map +1 -1
- package/lib/esm/tile/LRUTileList.d.ts +29 -29
- package/lib/esm/tile/LRUTileList.d.ts.map +1 -1
- package/lib/esm/tile/LRUTileList.js +47 -47
- package/lib/esm/tile/LRUTileList.js.map +1 -1
- package/lib/esm/tile/OPCFormatInterpreter.d.ts +22 -0
- package/lib/esm/tile/OPCFormatInterpreter.d.ts.map +1 -0
- package/lib/esm/tile/OPCFormatInterpreter.js +88 -0
- package/lib/esm/tile/OPCFormatInterpreter.js.map +1 -0
- package/lib/esm/tile/OrbitGtTileTree.js +1 -1
- package/lib/esm/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/esm/tile/PntsReader.d.ts +1 -1
- package/lib/esm/tile/PntsReader.d.ts.map +1 -1
- package/lib/esm/tile/PntsReader.js +154 -39
- package/lib/esm/tile/PntsReader.js.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.d.ts +18 -2
- package/lib/esm/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.js +51 -2
- package/lib/esm/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.d.ts +24 -3
- package/lib/esm/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.js +37 -13
- package/lib/esm/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/tile/RealityTile.d.ts +17 -3
- package/lib/esm/tile/RealityTile.d.ts.map +1 -1
- package/lib/esm/tile/RealityTile.js +34 -2
- package/lib/esm/tile/RealityTile.js.map +1 -1
- package/lib/esm/tile/RealityTileDrawArgs.d.ts +4 -1
- package/lib/esm/tile/RealityTileDrawArgs.d.ts.map +1 -1
- package/lib/esm/tile/RealityTileDrawArgs.js +3 -1
- package/lib/esm/tile/RealityTileDrawArgs.js.map +1 -1
- package/lib/esm/tile/RealityTileLoader.d.ts +8 -5
- package/lib/esm/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/esm/tile/RealityTileLoader.js +20 -6
- package/lib/esm/tile/RealityTileLoader.js.map +1 -1
- package/lib/esm/tile/RealityTileTree.d.ts +4 -1
- package/lib/esm/tile/RealityTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityTileTree.js +14 -6
- package/lib/esm/tile/RealityTileTree.js.map +1 -1
- package/lib/esm/tile/ThreeDTileFormatInterpreter.d.ts +52 -0
- package/lib/esm/tile/ThreeDTileFormatInterpreter.d.ts.map +1 -0
- package/lib/esm/tile/ThreeDTileFormatInterpreter.js +175 -0
- package/lib/esm/tile/ThreeDTileFormatInterpreter.js.map +1 -0
- package/lib/esm/tile/Tile.d.ts +5 -4
- package/lib/esm/tile/Tile.d.ts.map +1 -1
- package/lib/esm/tile/Tile.js +3 -2
- package/lib/esm/tile/Tile.js.map +1 -1
- package/lib/esm/tile/TileAdmin.d.ts +43 -45
- package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
- package/lib/esm/tile/TileAdmin.js +105 -105
- package/lib/esm/tile/TileAdmin.js.map +1 -1
- package/lib/esm/tile/TileDrawArgs.d.ts +2 -0
- package/lib/esm/tile/TileDrawArgs.d.ts.map +1 -1
- package/lib/esm/tile/TileDrawArgs.js +5 -0
- package/lib/esm/tile/TileDrawArgs.js.map +1 -1
- package/lib/esm/tile/TileGeometryCollector.d.ts +80 -0
- package/lib/esm/tile/TileGeometryCollector.d.ts.map +1 -0
- package/lib/esm/tile/TileGeometryCollector.js +67 -0
- package/lib/esm/tile/TileGeometryCollector.js.map +1 -0
- package/lib/esm/tile/TileRequest.d.ts +12 -9
- package/lib/esm/tile/TileRequest.d.ts.map +1 -1
- package/lib/esm/tile/TileRequest.js +19 -11
- package/lib/esm/tile/TileRequest.js.map +1 -1
- package/lib/esm/tile/TileRequestChannel.js +3 -3
- package/lib/esm/tile/TileRequestChannel.js.map +1 -1
- package/lib/esm/tile/TileRequestChannels.d.ts +0 -4
- package/lib/esm/tile/TileRequestChannels.d.ts.map +1 -1
- package/lib/esm/tile/TileRequestChannels.js +1 -6
- package/lib/esm/tile/TileRequestChannels.js.map +1 -1
- package/lib/esm/tile/TileTree.d.ts +7 -1
- package/lib/esm/tile/TileTree.d.ts.map +1 -1
- package/lib/esm/tile/TileTree.js +8 -1
- package/lib/esm/tile/TileTree.js.map +1 -1
- package/lib/esm/tile/TileTreeReference.d.ts +27 -2
- package/lib/esm/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/esm/tile/TileTreeReference.js +43 -3
- package/lib/esm/tile/TileTreeReference.js.map +1 -1
- package/lib/esm/tile/TileUsageMarker.d.ts +9 -9
- package/lib/esm/tile/TileUsageMarker.d.ts.map +1 -1
- package/lib/esm/tile/TileUsageMarker.js +9 -9
- package/lib/esm/tile/TileUsageMarker.js.map +1 -1
- package/lib/esm/tile/TileUser.d.ts +33 -0
- package/lib/esm/tile/TileUser.d.ts.map +1 -0
- package/lib/esm/tile/TileUser.js +25 -0
- package/lib/esm/tile/TileUser.js.map +1 -0
- package/lib/esm/tile/TileUserSet.d.ts +28 -0
- package/lib/esm/tile/TileUserSet.d.ts.map +1 -0
- package/lib/esm/tile/TileUserSet.js +118 -0
- package/lib/esm/tile/TileUserSet.js.map +1 -0
- package/lib/esm/tile/internal.d.ts +6 -0
- package/lib/esm/tile/internal.d.ts.map +1 -1
- package/lib/esm/tile/internal.js +6 -0
- package/lib/esm/tile/internal.js.map +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.js +2 -2
- package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +6 -5
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +47 -14
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts +3 -4
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +1 -1
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.d.ts +2 -2
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +3 -4
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +5 -4
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/TileUrlImageryProvider.d.ts +2 -2
- package/lib/esm/tile/map/ImageryProviders/TileUrlImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/TileUrlImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/WmsMapLayerImageryProvider.d.ts +2 -3
- package/lib/esm/tile/map/ImageryProviders/WmsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +13 -11
- package/lib/esm/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts +2 -2
- package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.d.ts +4 -5
- package/lib/esm/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js +5 -4
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapFeatureInfo.d.ts +26 -0
- package/lib/esm/tile/map/MapFeatureInfo.d.ts.map +1 -0
- package/lib/esm/tile/map/MapFeatureInfo.js +15 -0
- package/lib/esm/tile/map/MapFeatureInfo.js.map +1 -0
- package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +4 -4
- package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.d.ts +3 -3
- package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +5 -4
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js +5 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/MapLayerSources.d.ts +2 -2
- package/lib/esm/tile/map/MapLayerSources.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerSources.js +6 -4
- package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
- package/lib/esm/tile/map/MapLayerTileTreeReference.d.ts +10 -2
- package/lib/esm/tile/map/MapLayerTileTreeReference.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerTileTreeReference.js +25 -3
- package/lib/esm/tile/map/MapLayerTileTreeReference.js.map +1 -1
- package/lib/esm/tile/map/MapTile.d.ts +12 -10
- package/lib/esm/tile/map/MapTile.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTile.js +60 -39
- package/lib/esm/tile/map/MapTile.js.map +1 -1
- package/lib/esm/tile/map/MapTileLoader.d.ts +2 -1
- package/lib/esm/tile/map/MapTileLoader.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTileLoader.js +4 -1
- package/lib/esm/tile/map/MapTileLoader.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts +21 -11
- package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +156 -69
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapTiledGraphicsProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTiledGraphicsProvider.js +2 -2
- package/lib/esm/tile/map/MapTiledGraphicsProvider.js.map +1 -1
- package/lib/esm/tile/map/WmsCapabilities.d.ts +3 -2
- package/lib/esm/tile/map/WmsCapabilities.d.ts.map +1 -1
- package/lib/esm/tile/map/WmsCapabilities.js +11 -10
- package/lib/esm/tile/map/WmsCapabilities.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.d.ts +2 -3
- package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +8 -3
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/tools/ViewTool.d.ts +4 -4
- package/lib/esm/tools/ViewTool.d.ts.map +1 -1
- package/lib/esm/tools/ViewTool.js +1 -1
- package/lib/esm/tools/ViewTool.js.map +1 -1
- package/package.json +22 -20
- package/lib/cjs/ViewportSet.d.ts +0 -28
- package/lib/cjs/ViewportSet.d.ts.map +0 -1
- package/lib/cjs/ViewportSet.js +0 -126
- package/lib/cjs/ViewportSet.js.map +0 -1
- package/lib/cjs/tile/DracoDecoder.d.ts +0 -20
- package/lib/cjs/tile/DracoDecoder.d.ts.map +0 -1
- package/lib/cjs/tile/DracoDecoder.js +0 -169
- package/lib/cjs/tile/DracoDecoder.js.map +0 -1
- package/lib/esm/ViewportSet.d.ts +0 -28
- package/lib/esm/ViewportSet.d.ts.map +0 -1
- package/lib/esm/ViewportSet.js +0 -121
- package/lib/esm/ViewportSet.js.map +0 -1
- package/lib/esm/tile/DracoDecoder.d.ts +0 -20
- package/lib/esm/tile/DracoDecoder.d.ts.map +0 -1
- package/lib/esm/tile/DracoDecoder.js +0 -165
- package/lib/esm/tile/DracoDecoder.js.map +0 -1
- package/lib/public/assets/approximateTerrainHeights.json +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Tiles
|
|
3
|
+
*/
|
|
4
|
+
import { Polyface, Range3d, Transform } from "@itwin/core-geometry";
|
|
5
|
+
import { Tile, TileTreeReference, TileUser } from "./internal";
|
|
6
|
+
/** Enumerates the statuses returned by [[TileGeometryCollector.collectTile]].
|
|
7
|
+
* - "accept": The tile's geometry should be collected.
|
|
8
|
+
* - "reject": The tile's geometry (and that of all of its child tiles) should be omitted.
|
|
9
|
+
* - "continue": The tile's geometry should be omitted, but that of its child tiles should be evaluated for collection.
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export declare type CollectTileStatus = "accept" | "reject" | "continue";
|
|
13
|
+
/** Options for creating a [[TileGeometryCollector]].
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
export interface TileGeometryCollectorOptions {
|
|
17
|
+
/** The chord tolerance in meters describing the minimum level of detail desired of the tile geometry. */
|
|
18
|
+
chordTolerance: number;
|
|
19
|
+
/** The volume in which to collect tiles. Geometry of tiles that do not intersect this volume will not be collected. */
|
|
20
|
+
range: Range3d;
|
|
21
|
+
/** The [[TileUser]] that will make use of the tiles. */
|
|
22
|
+
user: TileUser;
|
|
23
|
+
/** An optional transform to be applied to the tile ranges before testing intersection with [[range]]. Typically this is obtained from [[TileTree.iModelTransform]]. */
|
|
24
|
+
transform?: Transform;
|
|
25
|
+
}
|
|
26
|
+
/** Collects geoemtry from a [[GeometryTileTreeReference]] within a specified volume at a specified level of detail.
|
|
27
|
+
* Subclasses can refine the collection criterion.
|
|
28
|
+
* The tile geometry is obtained asynchronously, so successive collections over multiple frames may be required before all of the geometry
|
|
29
|
+
* is collected.
|
|
30
|
+
* @beta
|
|
31
|
+
*/
|
|
32
|
+
export declare class TileGeometryCollector {
|
|
33
|
+
/** The list of accumulated polyfaces, populated during [[GeometryTileTreeReference.collectTileGeometry]].
|
|
34
|
+
* The polyfaces belong to the [[Tile]]s - they should not be modified.
|
|
35
|
+
* If [[isAllGeometryLoaded]] is `false`, then this list is incomplete - another geometry collection should be performed with a new collector on a subsequent frame.
|
|
36
|
+
*/
|
|
37
|
+
readonly polyfaces: Polyface[];
|
|
38
|
+
private readonly _missing;
|
|
39
|
+
private _loading;
|
|
40
|
+
/** The options used to construct this collector. */
|
|
41
|
+
protected readonly _options: TileGeometryCollectorOptions;
|
|
42
|
+
/** Create a new collector. */
|
|
43
|
+
constructor(options: TileGeometryCollectorOptions);
|
|
44
|
+
/** Allows an implementation of [[GeometryTileTreeReference.collectTileGeoemtry]] to indicate that further loading is required before
|
|
45
|
+
* the collection can be completed.
|
|
46
|
+
* This will cause [[isAllGeometryLoaded]] to return `false`.
|
|
47
|
+
*/
|
|
48
|
+
markLoading(): void;
|
|
49
|
+
/** Enqueues requests to obtain the content of any tiles whose content is required to complete the geometry collection.
|
|
50
|
+
* @see [[isAllGeometryLoaded]] to determine if geometry collection is complete.
|
|
51
|
+
*/
|
|
52
|
+
requestMissingTiles(): void;
|
|
53
|
+
/** Allows an implementation of [[GeometryTileTreeReference.collectTileGeometry]] to indicate that the specified tile's content must be loaded
|
|
54
|
+
* before geometry collection can be completed.
|
|
55
|
+
* This will cause [[isAllGeometryLoaded]] to return `false`.
|
|
56
|
+
*/
|
|
57
|
+
addMissingTile(tile: Tile): void;
|
|
58
|
+
/** Returns true if [[polyfaces]] has been fully populated with all the geometry satisfying this collector's criteria.
|
|
59
|
+
* If it returns false, another collection using a new collector should be performed on a subsequent frame to load more geometry.
|
|
60
|
+
*/
|
|
61
|
+
get isAllGeometryLoaded(): boolean;
|
|
62
|
+
/** Determine whether to collect the specified tile's geometry, reject it, or to evaluate the geometry of its child tiles for collection.
|
|
63
|
+
* This base implementation makes that determination based on the collector's range and chord tolerance. Subclasses should typically call `super.collectTile` and, if
|
|
64
|
+
* it returns "accept" or "continue", apply their own criteria to the tile.
|
|
65
|
+
*/
|
|
66
|
+
collectTile(tile: Tile): CollectTileStatus;
|
|
67
|
+
}
|
|
68
|
+
/** A [[TileTreeReference]] that can supply geometry in the form of [Polyface]($core-geometry)s from [[Tile]]s belonging to its [[TileTree]] and satisfying the criteria defined
|
|
69
|
+
* by a [[TileGeometryCollector]].
|
|
70
|
+
* Use [[TileTreeReference.createGeometryTreeReference]] to obtain a GeometryTileTreeReference from an existing TileTreeReference.
|
|
71
|
+
* @beta
|
|
72
|
+
*/
|
|
73
|
+
export interface GeometryTileTreeReference extends TileTreeReference {
|
|
74
|
+
/** Populate [[TileGeometryCollector.polyfaces]] with geometry satisfying `collector`'s criteria.
|
|
75
|
+
* Because tile geometry is obtained asynchronously, successive collections over multiple frames may be required before the list of polyfaces is fully populated.
|
|
76
|
+
* @see [[TileGeometryCollector.isAllGeometryLoaded]] to determine if the list of polyfaces is fully populated.
|
|
77
|
+
*/
|
|
78
|
+
collectTileGeometry: (collector: TileGeometryCollector) => void;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=TileGeometryCollector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TileGeometryCollector.d.ts","sourceRoot":"","sources":["../../../src/tile/TileGeometryCollector.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EACL,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAClC,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,oBAAY,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,yGAAyG;IACzG,cAAc,EAAE,MAAM,CAAC;IACvB,uHAAuH;IACvH,KAAK,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,IAAI,EAAE,QAAQ,CAAC;IACf,uKAAuK;IACvK,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;;;;GAKG;AACH,qBAAa,qBAAqB;IAChC;;;OAGG;IACH,SAAgB,SAAS,EAAE,QAAQ,EAAE,CAAM;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAS;IACzB,oDAAoD;IACpD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,4BAA4B,CAAC;IAE1D,8BAA8B;gBACX,OAAO,EAAE,4BAA4B;IAIxD;;;OAGG;IACI,WAAW,IAAI,IAAI;IAI1B;;OAEG;IACI,mBAAmB,IAAI,IAAI;IAIlC;;;OAGG;IACI,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAIvC;;OAEG;IACH,IAAW,mBAAmB,IAAI,OAAO,CAExC;IAED;;;OAGG;IACI,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,iBAAiB;CAWlD;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE;;;OAGG;IACH,mBAAmB,EAAE,CAAC,SAAS,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACjE"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Tiles
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TileGeometryCollector = void 0;
|
|
11
|
+
const IModelApp_1 = require("../IModelApp");
|
|
12
|
+
/** Collects geoemtry from a [[GeometryTileTreeReference]] within a specified volume at a specified level of detail.
|
|
13
|
+
* Subclasses can refine the collection criterion.
|
|
14
|
+
* The tile geometry is obtained asynchronously, so successive collections over multiple frames may be required before all of the geometry
|
|
15
|
+
* is collected.
|
|
16
|
+
* @beta
|
|
17
|
+
*/
|
|
18
|
+
class TileGeometryCollector {
|
|
19
|
+
/** Create a new collector. */
|
|
20
|
+
constructor(options) {
|
|
21
|
+
/** The list of accumulated polyfaces, populated during [[GeometryTileTreeReference.collectTileGeometry]].
|
|
22
|
+
* The polyfaces belong to the [[Tile]]s - they should not be modified.
|
|
23
|
+
* If [[isAllGeometryLoaded]] is `false`, then this list is incomplete - another geometry collection should be performed with a new collector on a subsequent frame.
|
|
24
|
+
*/
|
|
25
|
+
this.polyfaces = [];
|
|
26
|
+
this._missing = new Set();
|
|
27
|
+
this._loading = false;
|
|
28
|
+
this._options = options;
|
|
29
|
+
}
|
|
30
|
+
/** Allows an implementation of [[GeometryTileTreeReference.collectTileGeoemtry]] to indicate that further loading is required before
|
|
31
|
+
* the collection can be completed.
|
|
32
|
+
* This will cause [[isAllGeometryLoaded]] to return `false`.
|
|
33
|
+
*/
|
|
34
|
+
markLoading() {
|
|
35
|
+
this._loading = true;
|
|
36
|
+
}
|
|
37
|
+
/** Enqueues requests to obtain the content of any tiles whose content is required to complete the geometry collection.
|
|
38
|
+
* @see [[isAllGeometryLoaded]] to determine if geometry collection is complete.
|
|
39
|
+
*/
|
|
40
|
+
requestMissingTiles() {
|
|
41
|
+
IModelApp_1.IModelApp.tileAdmin.requestTiles(this._options.user, this._missing);
|
|
42
|
+
}
|
|
43
|
+
/** Allows an implementation of [[GeometryTileTreeReference.collectTileGeometry]] to indicate that the specified tile's content must be loaded
|
|
44
|
+
* before geometry collection can be completed.
|
|
45
|
+
* This will cause [[isAllGeometryLoaded]] to return `false`.
|
|
46
|
+
*/
|
|
47
|
+
addMissingTile(tile) {
|
|
48
|
+
this._missing.add(tile);
|
|
49
|
+
}
|
|
50
|
+
/** Returns true if [[polyfaces]] has been fully populated with all the geometry satisfying this collector's criteria.
|
|
51
|
+
* If it returns false, another collection using a new collector should be performed on a subsequent frame to load more geometry.
|
|
52
|
+
*/
|
|
53
|
+
get isAllGeometryLoaded() {
|
|
54
|
+
return !this._loading && this._missing.size === 0;
|
|
55
|
+
}
|
|
56
|
+
/** Determine whether to collect the specified tile's geometry, reject it, or to evaluate the geometry of its child tiles for collection.
|
|
57
|
+
* This base implementation makes that determination based on the collector's range and chord tolerance. Subclasses should typically call `super.collectTile` and, if
|
|
58
|
+
* it returns "accept" or "continue", apply their own criteria to the tile.
|
|
59
|
+
*/
|
|
60
|
+
collectTile(tile) {
|
|
61
|
+
const range = this._options.transform ? this._options.transform.multiplyRange(tile.range) : tile.range;
|
|
62
|
+
if (!range.intersectsRange(this._options.range))
|
|
63
|
+
return "reject";
|
|
64
|
+
if (tile.maximumSize === 0 || !tile.isDisplayable)
|
|
65
|
+
return "continue";
|
|
66
|
+
const tolerance = tile.radius / tile.maximumSize;
|
|
67
|
+
return tolerance < this._options.chordTolerance ? "accept" : "continue";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.TileGeometryCollector = TileGeometryCollector;
|
|
71
|
+
//# sourceMappingURL=TileGeometryCollector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TileGeometryCollector.js","sourceRoot":"","sources":["../../../src/tile/TileGeometryCollector.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,4CAAyC;AA2BzC;;;;;GAKG;AACH,MAAa,qBAAqB;IAWhC,8BAA8B;IAC9B,YAAmB,OAAqC;QAXxD;;;WAGG;QACa,cAAS,GAAe,EAAE,CAAC;QAC1B,aAAQ,GAAG,IAAI,GAAG,EAAQ,CAAC;QACpC,aAAQ,GAAG,KAAK,CAAC;QAMvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,WAAW;QAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,mBAAmB;QACxB,qBAAS,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,IAAU;QAC9B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAW,mBAAmB;QAC5B,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAC;IACpD,CAAC;IAED;;;OAGG;IACI,WAAW,CAAC,IAAU;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;QACvG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAC7C,OAAO,QAAQ,CAAC;QAElB,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa;YAC/C,OAAO,UAAU,CAAC;QAEpB,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;QACjD,OAAO,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC;IAC1E,CAAC;CACF;AA7DD,sDA6DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { Polyface, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport {\r\n Tile, TileTreeReference, TileUser,\r\n} from \"./internal\";\r\n\r\n/** Enumerates the statuses returned by [[TileGeometryCollector.collectTile]].\r\n * - \"accept\": The tile's geometry should be collected.\r\n * - \"reject\": The tile's geometry (and that of all of its child tiles) should be omitted.\r\n * - \"continue\": The tile's geometry should be omitted, but that of its child tiles should be evaluated for collection.\r\n * @beta\r\n */\r\nexport type CollectTileStatus = \"accept\" | \"reject\" | \"continue\";\r\n\r\n/** Options for creating a [[TileGeometryCollector]].\r\n * @beta\r\n */\r\nexport interface TileGeometryCollectorOptions {\r\n /** The chord tolerance in meters describing the minimum level of detail desired of the tile geometry. */\r\n chordTolerance: number;\r\n /** The volume in which to collect tiles. Geometry of tiles that do not intersect this volume will not be collected. */\r\n range: Range3d;\r\n /** The [[TileUser]] that will make use of the tiles. */\r\n user: TileUser;\r\n /** An optional transform to be applied to the tile ranges before testing intersection with [[range]]. Typically this is obtained from [[TileTree.iModelTransform]]. */\r\n transform?: Transform;\r\n}\r\n\r\n/** Collects geoemtry from a [[GeometryTileTreeReference]] within a specified volume at a specified level of detail.\r\n * Subclasses can refine the collection criterion.\r\n * The tile geometry is obtained asynchronously, so successive collections over multiple frames may be required before all of the geometry\r\n * is collected.\r\n * @beta\r\n */\r\nexport class TileGeometryCollector {\r\n /** The list of accumulated polyfaces, populated during [[GeometryTileTreeReference.collectTileGeometry]].\r\n * The polyfaces belong to the [[Tile]]s - they should not be modified.\r\n * If [[isAllGeometryLoaded]] is `false`, then this list is incomplete - another geometry collection should be performed with a new collector on a subsequent frame.\r\n */\r\n public readonly polyfaces: Polyface[] = [];\r\n private readonly _missing = new Set<Tile>();\r\n private _loading = false;\r\n /** The options used to construct this collector. */\r\n protected readonly _options: TileGeometryCollectorOptions;\r\n\r\n /** Create a new collector. */\r\n public constructor(options: TileGeometryCollectorOptions) {\r\n this._options = options;\r\n }\r\n\r\n /** Allows an implementation of [[GeometryTileTreeReference.collectTileGeoemtry]] to indicate that further loading is required before\r\n * the collection can be completed.\r\n * This will cause [[isAllGeometryLoaded]] to return `false`.\r\n */\r\n public markLoading(): void {\r\n this._loading = true;\r\n }\r\n\r\n /** Enqueues requests to obtain the content of any tiles whose content is required to complete the geometry collection.\r\n * @see [[isAllGeometryLoaded]] to determine if geometry collection is complete.\r\n */\r\n public requestMissingTiles(): void {\r\n IModelApp.tileAdmin.requestTiles(this._options.user, this._missing);\r\n }\r\n\r\n /** Allows an implementation of [[GeometryTileTreeReference.collectTileGeometry]] to indicate that the specified tile's content must be loaded\r\n * before geometry collection can be completed.\r\n * This will cause [[isAllGeometryLoaded]] to return `false`.\r\n */\r\n public addMissingTile(tile: Tile): void {\r\n this._missing.add(tile);\r\n }\r\n\r\n /** Returns true if [[polyfaces]] has been fully populated with all the geometry satisfying this collector's criteria.\r\n * If it returns false, another collection using a new collector should be performed on a subsequent frame to load more geometry.\r\n */\r\n public get isAllGeometryLoaded(): boolean {\r\n return !this._loading && this._missing.size === 0;\r\n }\r\n\r\n /** Determine whether to collect the specified tile's geometry, reject it, or to evaluate the geometry of its child tiles for collection.\r\n * This base implementation makes that determination based on the collector's range and chord tolerance. Subclasses should typically call `super.collectTile` and, if\r\n * it returns \"accept\" or \"continue\", apply their own criteria to the tile.\r\n */\r\n public collectTile(tile: Tile): CollectTileStatus {\r\n const range = this._options.transform ? this._options.transform.multiplyRange(tile.range) : tile.range;\r\n if (!range.intersectsRange(this._options.range))\r\n return \"reject\";\r\n\r\n if (tile.maximumSize === 0 || !tile.isDisplayable)\r\n return \"continue\";\r\n\r\n const tolerance = tile.radius / tile.maximumSize;\r\n return tolerance < this._options.chordTolerance ? \"accept\" : \"continue\";\r\n }\r\n}\r\n\r\n/** A [[TileTreeReference]] that can supply geometry in the form of [Polyface]($core-geometry)s from [[Tile]]s belonging to its [[TileTree]] and satisfying the criteria defined\r\n * by a [[TileGeometryCollector]].\r\n * Use [[TileTreeReference.createGeometryTreeReference]] to obtain a GeometryTileTreeReference from an existing TileTreeReference.\r\n * @beta\r\n */\r\nexport interface GeometryTileTreeReference extends TileTreeReference {\r\n /** Populate [[TileGeometryCollector.polyfaces]] with geometry satisfying `collector`'s criteria.\r\n * Because tile geometry is obtained asynchronously, successive collections over multiple frames may be required before the list of polyfaces is fully populated.\r\n * @see [[TileGeometryCollector.isAllGeometryLoaded]] to determine if the list of polyfaces is fully populated.\r\n */\r\n collectTileGeometry: (collector: TileGeometryCollector) => void;\r\n}\r\n"]}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { ImageSource } from "@itwin/core-common";
|
|
5
5
|
import { Viewport } from "../Viewport";
|
|
6
|
-
import {
|
|
7
|
-
import { Tile, TileContent, TileRequestChannel, TileTree } from "./internal";
|
|
6
|
+
import { ReadonlyTileUserSet, Tile, TileContent, TileRequestChannel, TileTree, TileUser } from "./internal";
|
|
8
7
|
/** Represents a pending or active request to load the contents of a [[Tile]]. The request coordinates with the [[Tile.requestContent]] to obtain the raw content and
|
|
9
8
|
* [[Tile.readContent]] to convert the result into a [[RenderGraphic]]. TileRequests are created internally as needed; it is never necessary or useful for external code to create them.
|
|
10
9
|
* @public
|
|
@@ -14,13 +13,17 @@ export declare class TileRequest {
|
|
|
14
13
|
readonly tile: Tile;
|
|
15
14
|
/** The channel via which the request will be executed. */
|
|
16
15
|
readonly channel: TileRequestChannel;
|
|
17
|
-
/** The set of [[
|
|
18
|
-
|
|
16
|
+
/** The set of [[TileUser]]s that are awaiting the result of this request. When this becomes empty, the request is canceled because no user cares about it.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
users: ReadonlyTileUserSet;
|
|
19
20
|
private _state;
|
|
20
21
|
/** Determines the order in which pending requests are pulled off the queue to become active. A tile with a lower priority value takes precedence over one with a higher value. */
|
|
21
22
|
priority: number;
|
|
22
23
|
/** Constructor */
|
|
23
|
-
constructor(tile: Tile,
|
|
24
|
+
constructor(tile: Tile, user: TileUser);
|
|
25
|
+
/** The set of [[Viewport]]s that are awaiting the result of this request. When this becomes empty, the request is canceled because no user cares about it. */
|
|
26
|
+
get viewports(): Iterable<Viewport>;
|
|
24
27
|
/** The request's current state. */
|
|
25
28
|
get state(): TileRequest.State;
|
|
26
29
|
/** True if the request has been enqueued but not yet dispatched. */
|
|
@@ -29,10 +32,10 @@ export declare class TileRequest {
|
|
|
29
32
|
get isCanceled(): boolean;
|
|
30
33
|
/** The tile tree to which the requested [[Tile]] belongs. */
|
|
31
34
|
get tree(): TileTree;
|
|
32
|
-
/** Indicate that the specified
|
|
35
|
+
/** Indicate that the specified user is awaiting the result of this request.
|
|
33
36
|
* @internal
|
|
34
37
|
*/
|
|
35
|
-
|
|
38
|
+
addUser(user: TileUser): void;
|
|
36
39
|
/** Transition the request from "queued" to "active", kicking off a series of asynchronous operations usually beginning with an http request, and -
|
|
37
40
|
* if the request is not subsequently canceled - resulting in either a successfully-loaded Tile, or a failed ("not found") Tile.
|
|
38
41
|
* @internal
|
|
@@ -42,9 +45,9 @@ export declare class TileRequest {
|
|
|
42
45
|
* @internal
|
|
43
46
|
*/
|
|
44
47
|
cancel(): void;
|
|
45
|
-
/** Invalidates the scene of each [[
|
|
48
|
+
/** Invalidates the scene of each [[TileUser]] interested in this request - typically because the request succeeded, failed, or was canceled. */
|
|
46
49
|
private notify;
|
|
47
|
-
/** Invalidates the scene of each [[
|
|
50
|
+
/** Invalidates the scene of each [[TileUser]] interested in this request and clears the set of interested users. */
|
|
48
51
|
private notifyAndClear;
|
|
49
52
|
private setFailed;
|
|
50
53
|
/** Invoked when the raw tile content becomes available, to convert it into a tile graphic. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileRequest.d.ts","sourceRoot":"","sources":["../../../src/tile/TileRequest.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"TileRequest.d.ts","sourceRoot":"","sources":["../../../src/tile/TileRequest.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,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E;QAChE,MAAM,IAAA;QACN,qEAAqE;QACrE,UAAU,IAAA;QACV,mGAAmG;QACnG,OAAO,IAAA;QACP,0EAA0E;QAC1E,SAAS,IAAA;QACT,0GAA0G;QAC1G,MAAM,IAAA;KACP;CACF"}
|
|
@@ -11,19 +11,24 @@ exports.TileRequest = void 0;
|
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const core_common_1 = require("@itwin/core-common");
|
|
13
13
|
const IModelApp_1 = require("../IModelApp");
|
|
14
|
+
const internal_1 = require("./internal");
|
|
14
15
|
/** Represents a pending or active request to load the contents of a [[Tile]]. The request coordinates with the [[Tile.requestContent]] to obtain the raw content and
|
|
15
16
|
* [[Tile.readContent]] to convert the result into a [[RenderGraphic]]. TileRequests are created internally as needed; it is never necessary or useful for external code to create them.
|
|
16
17
|
* @public
|
|
17
18
|
*/
|
|
18
19
|
class TileRequest {
|
|
19
20
|
/** Constructor */
|
|
20
|
-
constructor(tile,
|
|
21
|
+
constructor(tile, user) {
|
|
21
22
|
/** Determines the order in which pending requests are pulled off the queue to become active. A tile with a lower priority value takes precedence over one with a higher value. */
|
|
22
23
|
this.priority = 0;
|
|
23
24
|
this._state = TileRequest.State.Queued;
|
|
24
25
|
this.tile = tile;
|
|
25
26
|
this.channel = tile.channel;
|
|
26
|
-
this.
|
|
27
|
+
this.users = IModelApp_1.IModelApp.tileAdmin.getTileUserSetForRequest(user);
|
|
28
|
+
}
|
|
29
|
+
/** The set of [[Viewport]]s that are awaiting the result of this request. When this becomes empty, the request is canceled because no user cares about it. */
|
|
30
|
+
get viewports() {
|
|
31
|
+
return internal_1.TileUser.viewportsFromUsers(this.users);
|
|
27
32
|
}
|
|
28
33
|
/** The request's current state. */
|
|
29
34
|
get state() { return this._state; }
|
|
@@ -37,16 +42,16 @@ class TileRequest {
|
|
|
37
42
|
// After we've received the raw tile data, always finish processing it - otherwise tile may end up in limbo (and producing tile content should be faster than re-requesting raw data).
|
|
38
43
|
if (TileRequest.State.Loading === this._state)
|
|
39
44
|
return false;
|
|
40
|
-
// If no
|
|
41
|
-
return this.
|
|
45
|
+
// If no user cares about this tile any more, we're canceled.
|
|
46
|
+
return this.users.isEmpty;
|
|
42
47
|
}
|
|
43
48
|
/** The tile tree to which the requested [[Tile]] belongs. */
|
|
44
49
|
get tree() { return this.tile.tree; }
|
|
45
|
-
/** Indicate that the specified
|
|
50
|
+
/** Indicate that the specified user is awaiting the result of this request.
|
|
46
51
|
* @internal
|
|
47
52
|
*/
|
|
48
|
-
|
|
49
|
-
this.
|
|
53
|
+
addUser(user) {
|
|
54
|
+
this.users = IModelApp_1.IModelApp.tileAdmin.getTileUserSetForRequest(user, this.users);
|
|
50
55
|
}
|
|
51
56
|
/** Transition the request from "queued" to "active", kicking off a series of asynchronous operations usually beginning with an http request, and -
|
|
52
57
|
* if the request is not subsequently canceled - resulting in either a successfully-loaded Tile, or a failed ("not found") Tile.
|
|
@@ -98,14 +103,17 @@ class TileRequest {
|
|
|
98
103
|
this.channel.onActiveRequestCanceled(this);
|
|
99
104
|
this._state = TileRequest.State.Failed;
|
|
100
105
|
}
|
|
101
|
-
/** Invalidates the scene of each [[
|
|
106
|
+
/** Invalidates the scene of each [[TileUser]] interested in this request - typically because the request succeeded, failed, or was canceled. */
|
|
102
107
|
notify() {
|
|
103
|
-
this.
|
|
108
|
+
this.users.forEach((user) => {
|
|
109
|
+
if (user.onRequestStateChanged)
|
|
110
|
+
user.onRequestStateChanged(this);
|
|
111
|
+
});
|
|
104
112
|
}
|
|
105
|
-
/** Invalidates the scene of each [[
|
|
113
|
+
/** Invalidates the scene of each [[TileUser]] interested in this request and clears the set of interested users. */
|
|
106
114
|
notifyAndClear() {
|
|
107
115
|
this.notify();
|
|
108
|
-
this.
|
|
116
|
+
this.users = IModelApp_1.IModelApp.tileAdmin.emptyTileUserSet;
|
|
109
117
|
this.tile.request = undefined;
|
|
110
118
|
}
|
|
111
119
|
setFailed() {
|
|
@@ -1 +1 @@
|
|
|
1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AAmG;QACnG,uCAAO,CAAA;QACP,0EAA0E;QAC1E,2CAAS,CAAA;QACT,0GAA0G;QAC1G,qCAAM,CAAA;IACR,CAAC,EAXW,KAAK,GAAL,iBAAK,KAAL,iBAAK,QAWhB;AACH,CAAC,EA7BgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA6B3B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, base64StringToUint8Array, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { ImageSource } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { Viewport } from \"../Viewport\";\r\nimport { ReadonlyViewportSet } from \"../ViewportSet\";\r\nimport { Tile, TileContent, TileRequestChannel, TileTree } from \"./internal\";\r\n\r\n/** Represents a pending or active request to load the contents of a [[Tile]]. The request coordinates with the [[Tile.requestContent]] to obtain the raw content and\r\n * [[Tile.readContent]] to convert the result into a [[RenderGraphic]]. TileRequests are created internally as needed; it is never necessary or useful for external code to create them.\r\n * @public\r\n */\r\nexport class TileRequest {\r\n /** The requested tile. While the request is pending or active, `tile.request` points back to this TileRequest. */\r\n public readonly tile: Tile;\r\n /** The channel via which the request will be executed. */\r\n public readonly channel: TileRequestChannel;\r\n /** The set of [[Viewport]]s that are awaiting the result of this request. When this becomes empty, the request is canceled because no viewport cares about it. */\r\n public viewports: ReadonlyViewportSet;\r\n private _state: TileRequest.State;\r\n /** Determines the order in which pending requests are pulled off the queue to become active. A tile with a lower priority value takes precedence over one with a higher value. */\r\n public priority = 0;\r\n\r\n /** Constructor */\r\n public constructor(tile: Tile, vp: Viewport) {\r\n this._state = TileRequest.State.Queued;\r\n this.tile = tile;\r\n this.channel = tile.channel;\r\n this.viewports = IModelApp.tileAdmin.getViewportSetForRequest(vp);\r\n }\r\n\r\n /** The request's current state. */\r\n public get state(): TileRequest.State { return this._state; }\r\n\r\n /** True if the request has been enqueued but not yet dispatched. */\r\n public get isQueued() { return TileRequest.State.Queued === this._state; }\r\n\r\n /** True if the request has been canceled. */\r\n public get isCanceled(): boolean {\r\n // If iModel was closed, cancel immediately\r\n if (this.tile.iModel.tiles.isDisposed)\r\n return true;\r\n\r\n // After we've received the raw tile data, always finish processing it - otherwise tile may end up in limbo (and producing tile content should be faster than re-requesting raw data).\r\n if (TileRequest.State.Loading === this._state)\r\n return false;\r\n\r\n // If no viewport cares about this tile any more, we're canceled.\r\n return this.viewports.isEmpty;\r\n }\r\n\r\n /** The tile tree to which the requested [[Tile]] belongs. */\r\n public get tree(): TileTree { return this.tile.tree; }\r\n\r\n /** Indicate that the specified viewport is awaiting the result of this request.\r\n * @internal\r\n */\r\n public addViewport(vp: Viewport): void {\r\n this.viewports = IModelApp.tileAdmin.getViewportSetForRequest(vp, this.viewports);\r\n }\r\n\r\n /** Transition the request from \"queued\" to \"active\", kicking off a series of asynchronous operations usually beginning with an http request, and -\r\n * if the request is not subsequently canceled - resulting in either a successfully-loaded Tile, or a failed (\"not found\") Tile.\r\n * @internal\r\n */\r\n public async dispatch(onHttpResponse: () => void): Promise<void> {\r\n if (this.isCanceled)\r\n return;\r\n\r\n assert(this._state === TileRequest.State.Queued);\r\n this._state = TileRequest.State.Dispatched;\r\n let response;\r\n let gotResponse = false;\r\n try {\r\n response = await this.channel.requestContent(this.tile, () => this.isCanceled);\r\n gotResponse = true;\r\n\r\n // Set this now, so our `isCanceled` check can see it.\r\n this._state = TileRequest.State.Loading;\r\n } catch (err: any) {\r\n if (err.errorNumber && err.errorNumber === IModelStatus.ServerTimeout) {\r\n // Invalidate scene - if tile is re-selected, it will be re-requested.\r\n this.notifyAndClear();\r\n this._state = TileRequest.State.Failed;\r\n this.channel.recordTimeout();\r\n } else {\r\n // Unknown error - not retryable\r\n this.setFailed();\r\n }\r\n }\r\n\r\n // Notify caller that we have finished http activity.\r\n onHttpResponse();\r\n\r\n if (!gotResponse || this.isCanceled)\r\n return;\r\n\r\n if (undefined === response && this.channel.onNoContent(this)) {\r\n // Invalidate scene - if tile is re-selected, it will be re-requested - presumably via a different channel.\r\n this.notifyAndClear();\r\n this._state = TileRequest.State.Failed;\r\n return;\r\n }\r\n\r\n return this.handleResponse(response);\r\n }\r\n\r\n /** Cancels this request. This leaves the associated Tile's state untouched.\r\n * @internal\r\n */\r\n public cancel(): void {\r\n this.notifyAndClear();\r\n if (TileRequest.State.Dispatched === this._state)\r\n this.channel.onActiveRequestCanceled(this);\r\n\r\n this._state = TileRequest.State.Failed;\r\n }\r\n\r\n /** Invalidates the scene of each [[Viewport]] interested in this request - typically because the request succeeded, failed, or was canceled. */\r\n private notify(): void {\r\n this.viewports.forEach((vp) => vp.invalidateScene());\r\n }\r\n\r\n /** Invalidates the scene of each [[Viewport]] interested in this request and clears the set of interested viewports. */\r\n private notifyAndClear(): void {\r\n this.notify();\r\n this.viewports = IModelApp.tileAdmin.emptyViewportSet;\r\n this.tile.request = undefined;\r\n }\r\n\r\n private setFailed() {\r\n this.notifyAndClear();\r\n this._state = TileRequest.State.Failed;\r\n this.tile.setNotFound();\r\n this.channel.recordFailure();\r\n }\r\n\r\n /** Invoked when the raw tile content becomes available, to convert it into a tile graphic. */\r\n private async handleResponse(response: TileRequest.Response): Promise<void> {\r\n let content: TileContent | undefined;\r\n let data: TileRequest.ResponseData | undefined;\r\n if (undefined !== response) {\r\n if (typeof response === \"string\")\r\n data = base64StringToUint8Array(response);\r\n else if (response instanceof Uint8Array || response instanceof ImageSource)\r\n data = response;\r\n else if (response instanceof ArrayBuffer)\r\n data = new Uint8Array(response);\r\n else if (typeof response === \"object\" && undefined !== response.content)\r\n content = response.content;\r\n }\r\n\r\n if (!content && !data) {\r\n this.setFailed();\r\n return;\r\n }\r\n\r\n try {\r\n if (!content) {\r\n assert(undefined !== data);\r\n content = await this.tile.readContent(data, IModelApp.renderSystem, () => this.isCanceled);\r\n if (this.isCanceled)\r\n return;\r\n }\r\n\r\n this._state = TileRequest.State.Completed;\r\n this.tile.setContent(content);\r\n this.notifyAndClear();\r\n this.channel.recordCompletion(this.tile, content);\r\n } catch (_err) {\r\n this.setFailed();\r\n }\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace TileRequest { // eslint-disable-line no-redeclare\r\n /** The type of a raw response to a request for tile content. Processed upon receipt into a [[TileRequest.Response]] type.\r\n * [[Tile.requestContent]] produces a response of this type; it is then converted to a [[Tile.ResponseData]] from which [[Tile.readContent]]\r\n * can produce a [[RenderGraphic]].\r\n * @public\r\n */\r\n export type Response = Uint8Array | ArrayBuffer | string | ImageSource | { content: TileContent } | undefined;\r\n\r\n /** The input to [[Tile.readContent]], to be converted into a [[RenderGraphic]].\r\n * @public\r\n */\r\n export type ResponseData = Uint8Array | ImageSource;\r\n\r\n /** The states through which a [[TileRequest]] proceeds. During the first 3 states, the [[Tile]]'s `request` member is defined,\r\n * and its [[Tile.LoadStatus]] is computed based on the state of its request.\r\n *@ public\r\n */\r\n export enum State {\r\n /** Initial state. Request is pending but not yet dispatched. */\r\n Queued,\r\n /** Follows `Queued` when request begins to be actively processed. */\r\n Dispatched,\r\n /** Follows `Dispatched` when the response to the request is being converted into tile graphics. */\r\n Loading,\r\n /** Follows `Loading` when tile graphic has successfully been produced. */\r\n Completed,\r\n /** Follows any state in which an error prevents progression, or during which the request was canceled. */\r\n Failed,\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TileRequest.js","sourceRoot":"","sources":["../../../src/tile/TileRequest.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAqF;AACrF,oDAAiD;AACjD,4CAAyC;AAEzC,yCAA4G;AAE5G;;;GAGG;AACH,MAAa,WAAW;IAatB,kBAAkB;IAClB,YAAmB,IAAU,EAAE,IAAc;QAJ7C,kLAAkL;QAC3K,aAAQ,GAAG,CAAC,CAAC;Q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CAAC,EAXW,KAAK,GAAL,iBAAK,KAAL,iBAAK,QAWhB;AACH,CAAC,EA7BgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA6B3B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, base64StringToUint8Array, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { ImageSource } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { Viewport } from \"../Viewport\";\r\nimport { ReadonlyTileUserSet, Tile, TileContent, TileRequestChannel, TileTree, TileUser } from \"./internal\";\r\n\r\n/** Represents a pending or active request to load the contents of a [[Tile]]. The request coordinates with the [[Tile.requestContent]] to obtain the raw content and\r\n * [[Tile.readContent]] to convert the result into a [[RenderGraphic]]. TileRequests are created internally as needed; it is never necessary or useful for external code to create them.\r\n * @public\r\n */\r\nexport class TileRequest {\r\n /** The requested tile. While the request is pending or active, `tile.request` points back to this TileRequest. */\r\n public readonly tile: Tile;\r\n /** The channel via which the request will be executed. */\r\n public readonly channel: TileRequestChannel;\r\n /** The set of [[TileUser]]s that are awaiting the result of this request. When this becomes empty, the request is canceled because no user cares about it.\r\n * @internal\r\n */\r\n public users: ReadonlyTileUserSet;\r\n private _state: TileRequest.State;\r\n /** Determines the order in which pending requests are pulled off the queue to become active. A tile with a lower priority value takes precedence over one with a higher value. */\r\n public priority = 0;\r\n\r\n /** Constructor */\r\n public constructor(tile: Tile, user: TileUser) {\r\n this._state = TileRequest.State.Queued;\r\n this.tile = tile;\r\n this.channel = tile.channel;\r\n this.users = IModelApp.tileAdmin.getTileUserSetForRequest(user);\r\n }\r\n\r\n /** The set of [[Viewport]]s that are awaiting the result of this request. When this becomes empty, the request is canceled because no user cares about it. */\r\n public get viewports(): Iterable<Viewport> {\r\n return TileUser.viewportsFromUsers(this.users);\r\n }\r\n\r\n /** The request's current state. */\r\n public get state(): TileRequest.State { return this._state; }\r\n\r\n /** True if the request has been enqueued but not yet dispatched. */\r\n public get isQueued() { return TileRequest.State.Queued === this._state; }\r\n\r\n /** True if the request has been canceled. */\r\n public get isCanceled(): boolean {\r\n // If iModel was closed, cancel immediately\r\n if (this.tile.iModel.tiles.isDisposed)\r\n return true;\r\n\r\n // After we've received the raw tile data, always finish processing it - otherwise tile may end up in limbo (and producing tile content should be faster than re-requesting raw data).\r\n if (TileRequest.State.Loading === this._state)\r\n return false;\r\n\r\n // If no user cares about this tile any more, we're canceled.\r\n return this.users.isEmpty;\r\n }\r\n\r\n /** The tile tree to which the requested [[Tile]] belongs. */\r\n public get tree(): TileTree { return this.tile.tree; }\r\n\r\n /** Indicate that the specified user is awaiting the result of this request.\r\n * @internal\r\n */\r\n public addUser(user: TileUser): void {\r\n this.users = IModelApp.tileAdmin.getTileUserSetForRequest(user, this.users);\r\n }\r\n\r\n /** Transition the request from \"queued\" to \"active\", kicking off a series of asynchronous operations usually beginning with an http request, and -\r\n * if the request is not subsequently canceled - resulting in either a successfully-loaded Tile, or a failed (\"not found\") Tile.\r\n * @internal\r\n */\r\n public async dispatch(onHttpResponse: () => void): Promise<void> {\r\n if (this.isCanceled)\r\n return;\r\n\r\n assert(this._state === TileRequest.State.Queued);\r\n this._state = TileRequest.State.Dispatched;\r\n let response;\r\n let gotResponse = false;\r\n try {\r\n response = await this.channel.requestContent(this.tile, () => this.isCanceled);\r\n gotResponse = true;\r\n\r\n // Set this now, so our `isCanceled` check can see it.\r\n this._state = TileRequest.State.Loading;\r\n } catch (err: any) {\r\n if (err.errorNumber && err.errorNumber === IModelStatus.ServerTimeout) {\r\n // Invalidate scene - if tile is re-selected, it will be re-requested.\r\n this.notifyAndClear();\r\n this._state = TileRequest.State.Failed;\r\n this.channel.recordTimeout();\r\n } else {\r\n // Unknown error - not retryable\r\n this.setFailed();\r\n }\r\n }\r\n\r\n // Notify caller that we have finished http activity.\r\n onHttpResponse();\r\n\r\n if (!gotResponse || this.isCanceled)\r\n return;\r\n\r\n if (undefined === response && this.channel.onNoContent(this)) {\r\n // Invalidate scene - if tile is re-selected, it will be re-requested - presumably via a different channel.\r\n this.notifyAndClear();\r\n this._state = TileRequest.State.Failed;\r\n return;\r\n }\r\n\r\n return this.handleResponse(response);\r\n }\r\n\r\n /** Cancels this request. This leaves the associated Tile's state untouched.\r\n * @internal\r\n */\r\n public cancel(): void {\r\n this.notifyAndClear();\r\n if (TileRequest.State.Dispatched === this._state)\r\n this.channel.onActiveRequestCanceled(this);\r\n\r\n this._state = TileRequest.State.Failed;\r\n }\r\n\r\n /** Invalidates the scene of each [[TileUser]] interested in this request - typically because the request succeeded, failed, or was canceled. */\r\n private notify(): void {\r\n this.users.forEach((user) => {\r\n if (user.onRequestStateChanged)\r\n user.onRequestStateChanged(this);\r\n });\r\n }\r\n\r\n /** Invalidates the scene of each [[TileUser]] interested in this request and clears the set of interested users. */\r\n private notifyAndClear(): void {\r\n this.notify();\r\n this.users = IModelApp.tileAdmin.emptyTileUserSet;\r\n this.tile.request = undefined;\r\n }\r\n\r\n private setFailed() {\r\n this.notifyAndClear();\r\n this._state = TileRequest.State.Failed;\r\n this.tile.setNotFound();\r\n this.channel.recordFailure();\r\n }\r\n\r\n /** Invoked when the raw tile content becomes available, to convert it into a tile graphic. */\r\n private async handleResponse(response: TileRequest.Response): Promise<void> {\r\n let content: TileContent | undefined;\r\n let data: TileRequest.ResponseData | undefined;\r\n if (undefined !== response) {\r\n if (typeof response === \"string\")\r\n data = base64StringToUint8Array(response);\r\n else if (response instanceof Uint8Array || response instanceof ImageSource)\r\n data = response;\r\n else if (response instanceof ArrayBuffer)\r\n data = new Uint8Array(response);\r\n else if (typeof response === \"object\" && undefined !== response.content)\r\n content = response.content;\r\n }\r\n\r\n if (!content && !data) {\r\n this.setFailed();\r\n return;\r\n }\r\n\r\n try {\r\n if (!content) {\r\n assert(undefined !== data);\r\n content = await this.tile.readContent(data, IModelApp.renderSystem, () => this.isCanceled);\r\n if (this.isCanceled)\r\n return;\r\n }\r\n\r\n this._state = TileRequest.State.Completed;\r\n this.tile.setContent(content);\r\n this.notifyAndClear();\r\n this.channel.recordCompletion(this.tile, content);\r\n } catch (_err) {\r\n this.setFailed();\r\n }\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace TileRequest { // eslint-disable-line no-redeclare\r\n /** The type of a raw response to a request for tile content. Processed upon receipt into a [[TileRequest.Response]] type.\r\n * [[Tile.requestContent]] produces a response of this type; it is then converted to a [[Tile.ResponseData]] from which [[Tile.readContent]]\r\n * can produce a [[RenderGraphic]].\r\n * @public\r\n */\r\n export type Response = Uint8Array | ArrayBuffer | string | ImageSource | { content: TileContent } | undefined;\r\n\r\n /** The input to [[Tile.readContent]], to be converted into a [[RenderGraphic]].\r\n * @public\r\n */\r\n export type ResponseData = Uint8Array | ImageSource;\r\n\r\n /** The states through which a [[TileRequest]] proceeds. During the first 3 states, the [[Tile]]'s `request` member is defined,\r\n * and its [[Tile.LoadStatus]] is computed based on the state of its request.\r\n *@ public\r\n */\r\n export enum State {\r\n /** Initial state. Request is pending but not yet dispatched. */\r\n Queued,\r\n /** Follows `Queued` when request begins to be actively processed. */\r\n Dispatched,\r\n /** Follows `Dispatched` when the response to the request is being converted into tile graphics. */\r\n Loading,\r\n /** Follows `Loading` when tile graphic has successfully been produced. */\r\n Completed,\r\n /** Follows any state in which an error prevents progression, or during which the request was canceled. */\r\n Failed,\r\n }\r\n}\r\n"]}
|
|
@@ -167,18 +167,18 @@ class TileRequestChannel {
|
|
|
167
167
|
this._statistics.numCanceled = 0;
|
|
168
168
|
// Recompute priority of each request.
|
|
169
169
|
for (const pending of this._pending)
|
|
170
|
-
pending.priority = pending.tile.computeLoadPriority(pending.viewports);
|
|
170
|
+
pending.priority = pending.tile.computeLoadPriority(pending.viewports, pending.users);
|
|
171
171
|
// Sort pending requests by priority.
|
|
172
172
|
this._pending.sort();
|
|
173
173
|
// Cancel any previously pending requests that are no longer needed.
|
|
174
174
|
for (const queued of this._previouslyPending)
|
|
175
|
-
if (queued.
|
|
175
|
+
if (queued.users.isEmpty)
|
|
176
176
|
this.cancel(queued);
|
|
177
177
|
this._previouslyPending.clear();
|
|
178
178
|
// Cancel any active requests that are no longer needed.
|
|
179
179
|
// NB: Do NOT remove them from the active set until their http activity has completed.
|
|
180
180
|
for (const active of this._active)
|
|
181
|
-
if (active.
|
|
181
|
+
if (active.users.isEmpty)
|
|
182
182
|
this.cancel(active);
|
|
183
183
|
// Batch-cancel running requests.
|
|
184
184
|
this.processCancellations();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileRequestChannel.js","sourceRoot":"","sources":["../../../src/tile/TileRequestChannel.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAI5D,MAAM,gBAAiB,SAAQ,4BAA0B;IACvD;QACE,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACjB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;YACrE,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QACzD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAa,4BAA4B;IAAzC;QACE,uEAAuE;QAChE,uBAAkB,GAAG,CAAC,CAAC;QAC9B,8EAA8E;QACvE,sBAAiB,GAAG,CAAC,CAAC;QAC7B,qEAAqE;QAC9D,gBAAW,GAAG,CAAC,CAAC;QACvB,kEAAkE;QAC3D,2BAAsB,GAAG,CAAC,CAAC;QAClC,+DAA+D;QACxD,wBAAmB,GAAG,CAAC,CAAC;QAC/B,kEAAkE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AC,OAAoB;QAC9C,IAAA,qBAAM,EAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF;AAtND,gDAsNC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, PriorityQueue } from \"@itwin/core-bentley\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { Tile, TileContent, TileRequest } from \"./internal\";\r\n\r\nclass TileRequestQueue extends PriorityQueue<TileRequest> {\r\n public constructor() {\r\n super((lhs, rhs) => {\r\n const diff = lhs.tile.tree.loadPriority - rhs.tile.tree.loadPriority;\r\n return 0 !== diff ? diff : lhs.priority - rhs.priority;\r\n });\r\n }\r\n}\r\n\r\n/** Statistics regarding the current and cumulative state of one or more [[TileRequestChannel]]s. Useful for monitoring performance and diagnosing problems.\r\n * @see [[TileRequestChannel.statistics]] for a specific channel's statistics.\r\n * @see [[TileRequestChannels.statistics]] for statistics from all channels.\r\n * @see [[TileAdmin.statistics]] for additional statistics.\r\n * @public\r\n */\r\nexport class TileRequestChannelStatistics {\r\n /** The number of queued requests that have not yet been dispatched. */\r\n public numPendingRequests = 0;\r\n /** The number of requests that have been dispatched but not yet completed. */\r\n public numActiveRequests = 0;\r\n /** The number of requests canceled during the most recent update. */\r\n public numCanceled = 0;\r\n /** The total number of completed requests during this session. */\r\n public totalCompletedRequests = 0;\r\n /** The total number of failed requests during this session. */\r\n public totalFailedRequests = 0;\r\n /** The total number of timed-out requests during this session. */\r\n public totalTimedOutRequests = 0;\r\n /** The total number of completed requests during this session which produced an empty tile.\r\n * These tiles also contribute to [[totalCompletedRequests]], but not to [[totalUndisplayableTiles]].\r\n */\r\n public totalEmptyTiles = 0;\r\n /** The total number of completed requests during this session that produced an undisplayable tile.\r\n * These tiles also contribute to [[totalCompletedRequests]], but not to [[totalEmptyTiles]].\r\n */\r\n public totalUndisplayableTiles = 0;\r\n /** The total number of tiles whose contents were not found in cloud storage cache and therefore resulted in a backend request to generate the tile content. */\r\n public totalCacheMisses = 0;\r\n /** The total number of tiles for which content requests were dispatched. */\r\n public totalDispatchedRequests = 0;\r\n /** The total number of tiles for which content requests were dispatched and then canceled on the backend before completion. */\r\n public totalAbortedRequests = 0;\r\n\r\n /** @internal */\r\n public addTo(stats: TileRequestChannelStatistics): void {\r\n for (const propName in this) { // eslint-disable-line guard-for-in\r\n const key = propName as keyof TileRequestChannelStatistics;\r\n const val = this[key];\r\n if (typeof val === \"number\") {\r\n // This type guard ought to suffice but doesn't.\r\n assert(typeof stats[key] === \"number\");\r\n (stats[key] as number) += val;\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** A channel over which requests for tile content can be made. The channel may request content over HTTP, calls to the backend via IPC or RPC, or any other method like generating the content\r\n * on the frontend. The channel consists of a queue of pending requests and a set of \"active\" requests (dispatched and awaiting a response). Incoming requests are placed onto the queue. Requests are popped of the queue in order of priority and dispatched, until the maximum number of simultaneously-active requests is reached.\r\n * The maximum number of active requests depends on the transport mechanism. For HTTP 1.1, browsers impose a limit of 6 simultaneous connections to a given domain, so ideally each unique domain will use its own unique channel with a limit of 6 active requests. Even for requests satisfied entirely by the frontend, imposing a limit is important for throttling the amount of work done at one time, especially because as the user navigates the view, tiles that were previously requested may no longer be of interest and we shouldn't waste resources producing their content.\r\n * A channel must be registered with [[TileRequestChannels]] and must have a unique name among all registered channels.\r\n * @see [[TileRequestChannels.getForHttp]] to obtain (and register if not already registered) an HTTP-based channel.\r\n * @see [[TileAdmin.channels]] for the channels configured for use with the iTwin.js display system.\r\n * @see [[Tile.channel]] to specify the channel to be used to request a given tile's content.\r\n * @public\r\n */\r\nexport class TileRequestChannel {\r\n /** The channel's name. It must be unique among all registered [[TileRequestChannels]]. */\r\n public readonly name: string;\r\n private _concurrency: number;\r\n /** Protected strictly for tests. @internal */\r\n protected readonly _active = new Set<TileRequest>();\r\n private _pending = new TileRequestQueue();\r\n private _previouslyPending = new TileRequestQueue();\r\n protected _statistics = new TileRequestChannelStatistics();\r\n /** Callback invoked by recordCompletion. See IModelTileMetadataCacheChannel.\r\n * @internal\r\n */\r\n public contentCallback?: (tile: Tile, content: TileContent) => void;\r\n\r\n /** Create a new channel.\r\n * @param name The unique name of the channel.\r\n * @param concurrency The maximum number of requests that can be dispatched and awaiting a response at any given time. Requests beyond this maximum are enqueued for deferred dispatch.\r\n * @see [[TileRequestChannels.getForHttp]] to create an HTTP-based channel.\r\n */\r\n public constructor(name: string, concurrency: number) {\r\n this.name = name;\r\n this._concurrency = concurrency;\r\n }\r\n\r\n /** The maximum number of active requests. This is generally only modified for debugging purposes.\r\n * @note When reducing `concurrency`, the number of active requests ([[numActive]]) will only decrease to the new value after a sufficient number of dispatched requests are resolved.\r\n */\r\n public get concurrency(): number {\r\n return this._concurrency;\r\n }\r\n public set concurrency(max: number) {\r\n this._concurrency = max;\r\n }\r\n\r\n /** The number of requests that have been dispatched and are awaiting a response. */\r\n public get numActive(): number {\r\n return this._active.size;\r\n }\r\n\r\n /** The number of requests that have been enqueued for later dispatch. */\r\n public get numPending(): number {\r\n return this._pending.length;\r\n }\r\n\r\n /** The total number of requests in this channel, whether dispatched or enqueued. */\r\n public get size(): number {\r\n return this.numActive + this.numPending;\r\n }\r\n\r\n /** Statistics intended primarily for debugging. */\r\n public get statistics(): Readonly<TileRequestChannelStatistics> {\r\n this._statistics.numPendingRequests = this.numPending;\r\n this._statistics.numActiveRequests = this.numActive;\r\n return this._statistics;\r\n }\r\n\r\n /** Reset all of this channel's [[statistics]] to zero. */\r\n public resetStatistics(): void {\r\n this._statistics = new TileRequestChannelStatistics();\r\n }\r\n\r\n /** Invoked by [[TileRequest]] when a request times out.\r\n * @internal\r\n */\r\n public recordTimeout(): void {\r\n ++this._statistics.totalTimedOutRequests;\r\n }\r\n\r\n /** Invoked by [[TileRequest]] when a request fails to produce a response.\r\n * @internal\r\n */\r\n public recordFailure(): void {\r\n ++this._statistics.totalFailedRequests;\r\n }\r\n\r\n /** Invoked by [[TileRequest]] after a request completes.\r\n * @internal\r\n */\r\n public recordCompletion(tile: Tile, content: TileContent): void {\r\n ++this._statistics.totalCompletedRequests;\r\n if (tile.isEmpty)\r\n ++this._statistics.totalEmptyTiles;\r\n else if (!tile.isDisplayable)\r\n ++this._statistics.totalUndisplayableTiles;\r\n\r\n if (this.contentCallback)\r\n this.contentCallback(tile, content);\r\n }\r\n\r\n /** Invoked by [[TileRequestChannels.swapPending]] when [[TileAdmin]] is about to start enqueuing new requests.\r\n * @internal\r\n */\r\n public swapPending(): void {\r\n const previouslyPending = this._pending;\r\n this._pending = this._previouslyPending;\r\n this._previouslyPending = previouslyPending;\r\n }\r\n\r\n /** Invoked by [[TileAdmin.processRequests]] to enqueue a request. Ordering is ignored - the queue will be re-sorted later.\r\n * @internal\r\n */\r\n public append(request: TileRequest): void {\r\n assert(request.channel === this);\r\n this._pending.append(request);\r\n }\r\n\r\n /** Invoked by [[TileRequestChannels.process]] to process the active and pending requests.\r\n * @internal\r\n */\r\n public process(): void {\r\n this._statistics.numCanceled = 0;\r\n\r\n // Recompute priority of each request.\r\n for (const pending of this._pending)\r\n pending.priority = pending.tile.computeLoadPriority(pending.viewports);\r\n\r\n // Sort pending requests by priority.\r\n this._pending.sort();\r\n\r\n // Cancel any previously pending requests that are no longer needed.\r\n for (const queued of this._previouslyPending)\r\n if (queued.viewports.isEmpty)\r\n this.cancel(queued);\r\n\r\n this._previouslyPending.clear();\r\n\r\n // Cancel any active requests that are no longer needed.\r\n // NB: Do NOT remove them from the active set until their http activity has completed.\r\n for (const active of this._active)\r\n if (active.viewports.isEmpty)\r\n this.cancel(active);\r\n\r\n // Batch-cancel running requests.\r\n this.processCancellations();\r\n\r\n // Dispatch requests from the queue up to our maximum.\r\n while (this._active.size < this._concurrency) {\r\n const request = this._pending.pop();\r\n if (!request)\r\n break;\r\n\r\n this.dispatch(request);\r\n }\r\n }\r\n\r\n /** Cancel all active and queued requests and clear the active set and queue.\r\n * @internal\r\n */\r\n public cancelAndClearAll(): void {\r\n for (const active of this._active)\r\n active.cancel();\r\n\r\n for (const queued of this._pending)\r\n queued.cancel();\r\n\r\n this._active.clear();\r\n this._pending.clear();\r\n }\r\n\r\n /** Invoked when [[Tile.requestContent]] returns `undefined`. Return true if the request can be retried, e.g., via different channel.\r\n * If so, the tile will remain marked as \"not loaded\" and, if re-selected for display, a new [[TileRequest]] will be enqueued for it.\r\n * Otherwise, the tile will be marked as \"failed to load\" and no further requests will be made for its content.\r\n * The default implementation always returns `false`.\r\n */\r\n public onNoContent(_request: TileRequest): boolean {\r\n return false;\r\n }\r\n\r\n /** Invoked when a request that was previously dispatched is canceled before a response is received.\r\n * Some channels accumulate such requests for later cancellation in [[processCancellations]].\r\n */\r\n public onActiveRequestCanceled(_request: TileRequest): void { }\r\n\r\n /** Invoked to do any additional work to cancel tiles accumulated by [[onActiveRequestCanceled]]. For example, a channel that requests tile content\r\n * over IPC may signal to the tile generation process that it should cease generating content for those tiles.\r\n */\r\n public processCancellations(): void { }\r\n\r\n /** Invoked when an iModel is closed, to clean up any state associated with that iModel. */\r\n public onIModelClosed(_iModel: IModelConnection): void { }\r\n\r\n /** Request content for the specified tile. The default implementation simply forwards to [[Tile.requestContent]]. */\r\n public async requestContent(tile: Tile, isCanceled: () => boolean): Promise<TileRequest.Response> {\r\n return tile.requestContent(isCanceled);\r\n }\r\n\r\n /** Protected only for tests - do not override.\r\n * @internal\r\n */\r\n protected dispatch(request: TileRequest): void {\r\n ++this._statistics.totalDispatchedRequests;\r\n this._active.add(request);\r\n request.dispatch(() => {\r\n this.dropActiveRequest(request);\r\n }).catch((_) => {\r\n //\r\n });\r\n }\r\n\r\n /** Protected only for tests - do not override.\r\n * @internal\r\n */\r\n protected cancel(request: TileRequest): void {\r\n request.cancel();\r\n ++this._statistics.numCanceled;\r\n }\r\n\r\n /** Protected only for tests - do not override.\r\n * @internal\r\n */\r\n protected dropActiveRequest(request: TileRequest): void {\r\n assert(this._active.has(request) || request.isCanceled);\r\n this._active.delete(request);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TileRequestChannel.js","sourceRoot":"","sources":["../../../src/tile/TileRequestChannel.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAI5D,MAAM,gBAAiB,SAAQ,4BAA0B;IACvD;QACE,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACjB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;YACrE,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QACzD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAa,4BAA4B;IAAzC;QACE,uEAAuE;QAChE,uBAAkB,GAAG,CAAC,CAAC;QAC9B,8EAA8E;QACvE,sBAAiB,GAAG,CAAC,CAAC;QAC7B,qEAAqE;QAC9D,gBAAW,GAAG,CAAC,CAAC;QACvB,kEAAkE;QAC3D,2BAAsB,GAAG,CAAC,CAAC;QAClC,+DAA+D;QACxD,wBAAmB,GAAG,CAAC,CAAC;QAC/B,kEAAkE;QAC3D,0BAAqB,GAAG,CAAC,CAAC;QACjC;;WAEG;QACI,oBAAe,GAAG,CAAC,CAAC;QAC3B;;WAEG;QACI,4BAAuB,GAAG,CAAC,CAAC;QACnC,+JAA+J;QACxJ,qBAAgB,GAAG,CAAC,CAAC;QAC5B,4EAA4E;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O,CAAC,CAAC;IAC/B,CAAC;CACF;AAtND,gDAsNC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, PriorityQueue } from \"@itwin/core-bentley\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { Tile, TileContent, TileRequest } from \"./internal\";\r\n\r\nclass TileRequestQueue extends PriorityQueue<TileRequest> {\r\n public constructor() {\r\n super((lhs, rhs) => {\r\n const diff = lhs.tile.tree.loadPriority - rhs.tile.tree.loadPriority;\r\n return 0 !== diff ? diff : lhs.priority - rhs.priority;\r\n });\r\n }\r\n}\r\n\r\n/** Statistics regarding the current and cumulative state of one or more [[TileRequestChannel]]s. Useful for monitoring performance and diagnosing problems.\r\n * @see [[TileRequestChannel.statistics]] for a specific channel's statistics.\r\n * @see [[TileRequestChannels.statistics]] for statistics from all channels.\r\n * @see [[TileAdmin.statistics]] for additional statistics.\r\n * @public\r\n */\r\nexport class TileRequestChannelStatistics {\r\n /** The number of queued requests that have not yet been dispatched. */\r\n public numPendingRequests = 0;\r\n /** The number of requests that have been dispatched but not yet completed. */\r\n public numActiveRequests = 0;\r\n /** The number of requests canceled during the most recent update. */\r\n public numCanceled = 0;\r\n /** The total number of completed requests during this session. */\r\n public totalCompletedRequests = 0;\r\n /** The total number of failed requests during this session. */\r\n public totalFailedRequests = 0;\r\n /** The total number of timed-out requests during this session. */\r\n public totalTimedOutRequests = 0;\r\n /** The total number of completed requests during this session which produced an empty tile.\r\n * These tiles also contribute to [[totalCompletedRequests]], but not to [[totalUndisplayableTiles]].\r\n */\r\n public totalEmptyTiles = 0;\r\n /** The total number of completed requests during this session that produced an undisplayable tile.\r\n * These tiles also contribute to [[totalCompletedRequests]], but not to [[totalEmptyTiles]].\r\n */\r\n public totalUndisplayableTiles = 0;\r\n /** The total number of tiles whose contents were not found in cloud storage cache and therefore resulted in a backend request to generate the tile content. */\r\n public totalCacheMisses = 0;\r\n /** The total number of tiles for which content requests were dispatched. */\r\n public totalDispatchedRequests = 0;\r\n /** The total number of tiles for which content requests were dispatched and then canceled on the backend before completion. */\r\n public totalAbortedRequests = 0;\r\n\r\n /** @internal */\r\n public addTo(stats: TileRequestChannelStatistics): void {\r\n for (const propName in this) { // eslint-disable-line guard-for-in\r\n const key = propName as keyof TileRequestChannelStatistics;\r\n const val = this[key];\r\n if (typeof val === \"number\") {\r\n // This type guard ought to suffice but doesn't.\r\n assert(typeof stats[key] === \"number\");\r\n (stats[key] as number) += val;\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** A channel over which requests for tile content can be made. The channel may request content over HTTP, calls to the backend via IPC or RPC, or any other method like generating the content\r\n * on the frontend. The channel consists of a queue of pending requests and a set of \"active\" requests (dispatched and awaiting a response). Incoming requests are placed onto the queue. Requests are popped of the queue in order of priority and dispatched, until the maximum number of simultaneously-active requests is reached.\r\n * The maximum number of active requests depends on the transport mechanism. For HTTP 1.1, browsers impose a limit of 6 simultaneous connections to a given domain, so ideally each unique domain will use its own unique channel with a limit of 6 active requests. Even for requests satisfied entirely by the frontend, imposing a limit is important for throttling the amount of work done at one time, especially because as the user navigates the view, tiles that were previously requested may no longer be of interest and we shouldn't waste resources producing their content.\r\n * A channel must be registered with [[TileRequestChannels]] and must have a unique name among all registered channels.\r\n * @see [[TileRequestChannels.getForHttp]] to obtain (and register if not already registered) an HTTP-based channel.\r\n * @see [[TileAdmin.channels]] for the channels configured for use with the iTwin.js display system.\r\n * @see [[Tile.channel]] to specify the channel to be used to request a given tile's content.\r\n * @public\r\n */\r\nexport class TileRequestChannel {\r\n /** The channel's name. It must be unique among all registered [[TileRequestChannels]]. */\r\n public readonly name: string;\r\n private _concurrency: number;\r\n /** Protected strictly for tests. @internal */\r\n protected readonly _active = new Set<TileRequest>();\r\n private _pending = new TileRequestQueue();\r\n private _previouslyPending = new TileRequestQueue();\r\n protected _statistics = new TileRequestChannelStatistics();\r\n /** Callback invoked by recordCompletion. See IModelTileMetadataCacheChannel.\r\n * @internal\r\n */\r\n public contentCallback?: (tile: Tile, content: TileContent) => void;\r\n\r\n /** Create a new channel.\r\n * @param name The unique name of the channel.\r\n * @param concurrency The maximum number of requests that can be dispatched and awaiting a response at any given time. Requests beyond this maximum are enqueued for deferred dispatch.\r\n * @see [[TileRequestChannels.getForHttp]] to create an HTTP-based channel.\r\n */\r\n public constructor(name: string, concurrency: number) {\r\n this.name = name;\r\n this._concurrency = concurrency;\r\n }\r\n\r\n /** The maximum number of active requests. This is generally only modified for debugging purposes.\r\n * @note When reducing `concurrency`, the number of active requests ([[numActive]]) will only decrease to the new value after a sufficient number of dispatched requests are resolved.\r\n */\r\n public get concurrency(): number {\r\n return this._concurrency;\r\n }\r\n public set concurrency(max: number) {\r\n this._concurrency = max;\r\n }\r\n\r\n /** The number of requests that have been dispatched and are awaiting a response. */\r\n public get numActive(): number {\r\n return this._active.size;\r\n }\r\n\r\n /** The number of requests that have been enqueued for later dispatch. */\r\n public get numPending(): number {\r\n return this._pending.length;\r\n }\r\n\r\n /** The total number of requests in this channel, whether dispatched or enqueued. */\r\n public get size(): number {\r\n return this.numActive + this.numPending;\r\n }\r\n\r\n /** Statistics intended primarily for debugging. */\r\n public get statistics(): Readonly<TileRequestChannelStatistics> {\r\n this._statistics.numPendingRequests = this.numPending;\r\n this._statistics.numActiveRequests = this.numActive;\r\n return this._statistics;\r\n }\r\n\r\n /** Reset all of this channel's [[statistics]] to zero. */\r\n public resetStatistics(): void {\r\n this._statistics = new TileRequestChannelStatistics();\r\n }\r\n\r\n /** Invoked by [[TileRequest]] when a request times out.\r\n * @internal\r\n */\r\n public recordTimeout(): void {\r\n ++this._statistics.totalTimedOutRequests;\r\n }\r\n\r\n /** Invoked by [[TileRequest]] when a request fails to produce a response.\r\n * @internal\r\n */\r\n public recordFailure(): void {\r\n ++this._statistics.totalFailedRequests;\r\n }\r\n\r\n /** Invoked by [[TileRequest]] after a request completes.\r\n * @internal\r\n */\r\n public recordCompletion(tile: Tile, content: TileContent): void {\r\n ++this._statistics.totalCompletedRequests;\r\n if (tile.isEmpty)\r\n ++this._statistics.totalEmptyTiles;\r\n else if (!tile.isDisplayable)\r\n ++this._statistics.totalUndisplayableTiles;\r\n\r\n if (this.contentCallback)\r\n this.contentCallback(tile, content);\r\n }\r\n\r\n /** Invoked by [[TileRequestChannels.swapPending]] when [[TileAdmin]] is about to start enqueuing new requests.\r\n * @internal\r\n */\r\n public swapPending(): void {\r\n const previouslyPending = this._pending;\r\n this._pending = this._previouslyPending;\r\n this._previouslyPending = previouslyPending;\r\n }\r\n\r\n /** Invoked by [[TileAdmin.processRequests]] to enqueue a request. Ordering is ignored - the queue will be re-sorted later.\r\n * @internal\r\n */\r\n public append(request: TileRequest): void {\r\n assert(request.channel === this);\r\n this._pending.append(request);\r\n }\r\n\r\n /** Invoked by [[TileRequestChannels.process]] to process the active and pending requests.\r\n * @internal\r\n */\r\n public process(): void {\r\n this._statistics.numCanceled = 0;\r\n\r\n // Recompute priority of each request.\r\n for (const pending of this._pending)\r\n pending.priority = pending.tile.computeLoadPriority(pending.viewports, pending.users);\r\n\r\n // Sort pending requests by priority.\r\n this._pending.sort();\r\n\r\n // Cancel any previously pending requests that are no longer needed.\r\n for (const queued of this._previouslyPending)\r\n if (queued.users.isEmpty)\r\n this.cancel(queued);\r\n\r\n this._previouslyPending.clear();\r\n\r\n // Cancel any active requests that are no longer needed.\r\n // NB: Do NOT remove them from the active set until their http activity has completed.\r\n for (const active of this._active)\r\n if (active.users.isEmpty)\r\n this.cancel(active);\r\n\r\n // Batch-cancel running requests.\r\n this.processCancellations();\r\n\r\n // Dispatch requests from the queue up to our maximum.\r\n while (this._active.size < this._concurrency) {\r\n const request = this._pending.pop();\r\n if (!request)\r\n break;\r\n\r\n this.dispatch(request);\r\n }\r\n }\r\n\r\n /** Cancel all active and queued requests and clear the active set and queue.\r\n * @internal\r\n */\r\n public cancelAndClearAll(): void {\r\n for (const active of this._active)\r\n active.cancel();\r\n\r\n for (const queued of this._pending)\r\n queued.cancel();\r\n\r\n this._active.clear();\r\n this._pending.clear();\r\n }\r\n\r\n /** Invoked when [[Tile.requestContent]] returns `undefined`. Return true if the request can be retried, e.g., via different channel.\r\n * If so, the tile will remain marked as \"not loaded\" and, if re-selected for display, a new [[TileRequest]] will be enqueued for it.\r\n * Otherwise, the tile will be marked as \"failed to load\" and no further requests will be made for its content.\r\n * The default implementation always returns `false`.\r\n */\r\n public onNoContent(_request: TileRequest): boolean {\r\n return false;\r\n }\r\n\r\n /** Invoked when a request that was previously dispatched is canceled before a response is received.\r\n * Some channels accumulate such requests for later cancellation in [[processCancellations]].\r\n */\r\n public onActiveRequestCanceled(_request: TileRequest): void { }\r\n\r\n /** Invoked to do any additional work to cancel tiles accumulated by [[onActiveRequestCanceled]]. For example, a channel that requests tile content\r\n * over IPC may signal to the tile generation process that it should cease generating content for those tiles.\r\n */\r\n public processCancellations(): void { }\r\n\r\n /** Invoked when an iModel is closed, to clean up any state associated with that iModel. */\r\n public onIModelClosed(_iModel: IModelConnection): void { }\r\n\r\n /** Request content for the specified tile. The default implementation simply forwards to [[Tile.requestContent]]. */\r\n public async requestContent(tile: Tile, isCanceled: () => boolean): Promise<TileRequest.Response> {\r\n return tile.requestContent(isCanceled);\r\n }\r\n\r\n /** Protected only for tests - do not override.\r\n * @internal\r\n */\r\n protected dispatch(request: TileRequest): void {\r\n ++this._statistics.totalDispatchedRequests;\r\n this._active.add(request);\r\n request.dispatch(() => {\r\n this.dropActiveRequest(request);\r\n }).catch((_) => {\r\n //\r\n });\r\n }\r\n\r\n /** Protected only for tests - do not override.\r\n * @internal\r\n */\r\n protected cancel(request: TileRequest): void {\r\n request.cancel();\r\n ++this._statistics.numCanceled;\r\n }\r\n\r\n /** Protected only for tests - do not override.\r\n * @internal\r\n */\r\n protected dropActiveRequest(request: TileRequest): void {\r\n assert(this._active.has(request) || request.isCanceled);\r\n this._active.delete(request);\r\n }\r\n}\r\n"]}
|
|
@@ -23,10 +23,6 @@ export declare class TileRequestChannels {
|
|
|
23
23
|
* @internal
|
|
24
24
|
*/
|
|
25
25
|
constructor(rpcConcurrency: number | undefined, cacheMetadata: boolean);
|
|
26
|
-
/** Lazily called by [[TileAdmin]] once it can determine whether a cloud storage cache is configured.
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
enableCloudStorageCache(): void;
|
|
30
26
|
/** The number of registered channels. */
|
|
31
27
|
get size(): number;
|
|
32
28
|
/** Look up a registered channel by its name. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileRequestChannels.d.ts","sourceRoot":"","sources":["../../../src/tile/TileRequestChannels.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,UAAU,EAAE,yBAAyB,EAAe,kBAAkB,EAAE,4BAA4B,EACrG,MAAM,YAAY,CAAC;AA8BpB;;;;GAIG;AACH,qBAAa,mBAAmB;IAC9B,gBAAgB;IAChB,SAAgB,cAAc,EAAE,yBAAyB,CAAC;IAC1D;;OAEG;IACH,SAAgB,kBAAkB,EAAE,kBAAkB,CAAC;IACvD,6FAA6F;IAC7F,SAAgB,eAAe,KAAK;IACpC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyC;IAEnE;;OAEG;gBACgB,cAAc,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"TileRequestChannels.d.ts","sourceRoot":"","sources":["../../../src/tile/TileRequestChannels.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,UAAU,EAAE,yBAAyB,EAAe,kBAAkB,EAAE,4BAA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AM,EAAE,gBAAgB,GAAG,IAAI;IAKrD;;OAEG;IACI,UAAU,IAAI,IAAI;CAM1B"}
|
|
@@ -59,16 +59,11 @@ class TileRequestChannels {
|
|
|
59
59
|
concurrency: this.rpcConcurrency,
|
|
60
60
|
usesHttp: undefined === rpcConcurrency,
|
|
61
61
|
cacheMetadata,
|
|
62
|
+
cacheConcurrency: this.httpConcurrency,
|
|
62
63
|
});
|
|
63
64
|
for (const channel of this.iModelChannels)
|
|
64
65
|
this.add(channel);
|
|
65
66
|
}
|
|
66
|
-
/** Lazily called by [[TileAdmin]] once it can determine whether a cloud storage cache is configured.
|
|
67
|
-
* @internal
|
|
68
|
-
*/
|
|
69
|
-
enableCloudStorageCache() {
|
|
70
|
-
this.add(this.iModelChannels.enableCloudStorageCache(this.httpConcurrency));
|
|
71
|
-
}
|
|
72
67
|
/** The number of registered channels. */
|
|
73
68
|
get size() {
|
|
74
69
|
return this._channels.size;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileRequestChannels.js","sourceRoot":"","sources":["../../../src/tile/TileRequestChannels.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sCAAmC;AAEnC,yCAEoB;AAEpB,8FAA8F;AAC9F,MAAM,sBAAuB,SAAQ,6BAAkB;IAAvD;;QACmB,cAAS,GAAG,IAAI,GAAG,EAA8B,CAAC;IAwBrE,CAAC;IAtBiB,uBAAuB,CAAC,OAAoB;QAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QACxC,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,GAAG;YACN,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;QAEvC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC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EG;IACI,cAAc,CAAC,MAAwB;QAC5C,KAAK,MAAM,OAAO,IAAI,IAAI;YACxB,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,UAAU;QACf,KAAK,MAAM,OAAO,IAAI,IAAI;YACxB,OAAO,CAAC,iBAAiB,EAAE,CAAC;QAE9B,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACF;AAtKD,kDAsKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { IpcApp } from \"../IpcApp\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport {\r\n IModelTile, IModelTileRequestChannels, TileRequest, TileRequestChannel, TileRequestChannelStatistics,\r\n} from \"./internal\";\r\n\r\n/** For an [[IpcApp]], allows backend element graphics requests in progress to be canceled. */\r\nclass ElementGraphicsChannel extends TileRequestChannel {\r\n private readonly _canceled = new Map<IModelConnection, string[]>();\r\n\r\n public override onActiveRequestCanceled(request: TileRequest): void {\r\n const imodel = request.tile.tree.iModel;\r\n let ids = this._canceled.get(imodel);\r\n if (!ids)\r\n this._canceled.set(imodel, ids = []);\r\n\r\n ids.push(request.tile.contentId);\r\n }\r\n\r\n public override processCancellations(): void {\r\n for (const [imodel, requestIds] of this._canceled) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n IpcApp.callIpcHost(\"cancelElementGraphicsRequests\", imodel.key, requestIds);\r\n this._statistics.totalAbortedRequests += requestIds.length;\r\n }\r\n\r\n this._canceled.clear();\r\n }\r\n\r\n public override onIModelClosed(imodel: IModelConnection): void {\r\n this._canceled.delete(imodel);\r\n }\r\n}\r\n\r\n/** A set of named [[TileRequestChannel]]s via which content for [[Tile]]s can be requested.\r\n * @see [[TileAdmin.channels]] for the channels configured for use with the iTwin.js display system.\r\n * @see [[TileRequestChannels.getForHttp]] for the most typical way of obtaining or registering a channel.\r\n * @public\r\n */\r\nexport class TileRequestChannels {\r\n /** @internal */\r\n public readonly iModelChannels: IModelTileRequestChannels;\r\n /** The channel over which [[TileAdmin.requestElementGraphics]] executes. If you implement a [[TiledGraphicsProvider]] or [[TileTree]] that obtains its\r\n * content from `requestElementGraphics`, use this channel.\r\n */\r\n public readonly elementGraphicsRpc: TileRequestChannel;\r\n /** The maximum number of active requests for a channel that uses HTTP to request content. */\r\n public readonly httpConcurrency = 6;\r\n private _rpcConcurrency: number;\r\n private readonly _channels = new Map<string, TileRequestChannel>();\r\n\r\n /** `rpcConcurrency` is defined if [[IpcApp.isValid]]; otherwise RPC requests are made over HTTP and use the same limits.\r\n * @internal\r\n */\r\n public constructor(rpcConcurrency: number | undefined, cacheMetadata: boolean) {\r\n this._rpcConcurrency = rpcConcurrency ?? this.httpConcurrency;\r\n\r\n const elementGraphicsChannelName = \"itwinjs-elem-rpc\";\r\n if (undefined !== rpcConcurrency)\r\n this.elementGraphicsRpc = new ElementGraphicsChannel(elementGraphicsChannelName, rpcConcurrency);\r\n else\r\n this.elementGraphicsRpc = new TileRequestChannel(elementGraphicsChannelName, this.rpcConcurrency);\r\n\r\n this.add(this.elementGraphicsRpc);\r\n\r\n this.iModelChannels = new IModelTileRequestChannels({\r\n concurrency: this.rpcConcurrency,\r\n usesHttp: undefined === rpcConcurrency,\r\n cacheMetadata,\r\n });\r\n\r\n for (const channel of this.iModelChannels)\r\n this.add(channel);\r\n }\r\n\r\n /** Lazily called by [[TileAdmin]] once it can determine whether a cloud storage cache is configured.\r\n * @internal\r\n */\r\n public enableCloudStorageCache(): void {\r\n this.add(this.iModelChannels.enableCloudStorageCache(this.httpConcurrency));\r\n }\r\n\r\n /** The number of registered channels. */\r\n public get size(): number {\r\n return this._channels.size;\r\n }\r\n\r\n /** Look up a registered channel by its name. */\r\n public get(name: string): TileRequestChannel | undefined {\r\n return this._channels.get(name);\r\n }\r\n\r\n /** Return whether the specified channel has been registered. Primarily for debugging. */\r\n public has(channel: TileRequestChannel): boolean {\r\n const existing = this.get(channel.name);\r\n return existing !== undefined && existing === channel;\r\n }\r\n\r\n /** Add a new channel.\r\n * @throws Error if a channel by the same name has already been registered.\r\n */\r\n public add(channel: TileRequestChannel): void {\r\n if (this.get(channel.name))\r\n throw new Error(`Tile request channel ${channel.name} is already registered.`);\r\n\r\n this._channels.set(channel.name, channel);\r\n }\r\n\r\n /** Extract the host name from a URL for use as the name of the corresponding [[TileRequestChannel]].\r\n * @throws TypeError if `url` is a string and does not represent a valid URL.\r\n * @see [[getForHttp]] to obtain or register a channel for the host name.\r\n */\r\n public static getNameFromUrl(url: URL | string): string {\r\n if (typeof url === \"string\")\r\n url = new URL(url);\r\n\r\n return url.hostname;\r\n }\r\n\r\n /** Obtain a channel that requests content over HTTP using HTTP 1.1 limits on simultaneous connections.\r\n * If a channel with the specified name does not already exist, it will be created and registered.\r\n * @see [[getNameFromUrl]] to obtain a channel name corresponding to a hostname.\r\n */\r\n public getForHttp(name: string): TileRequestChannel {\r\n let channel = this.get(name);\r\n if (!channel)\r\n this.add(channel = new TileRequestChannel(name, this.httpConcurrency));\r\n\r\n return channel;\r\n }\r\n\r\n /** Iterator over all of the channels. */\r\n public [Symbol.iterator](): Iterator<TileRequestChannel> {\r\n return this._channels.values()[Symbol.iterator]();\r\n }\r\n\r\n /** The maximum number of active requests for a channel that uses an RpcInterface to satisfy its requests.\r\n * For web-based applications, this is the same as [[httpConcurrency]], but for [[IpcApp]]s it is determined by the number of workers threads allocated by the backend.\r\n */\r\n public get rpcConcurrency(): number {\r\n return this._rpcConcurrency;\r\n }\r\n\r\n /** @internal */\r\n public getIModelTileChannel(tile: IModelTile): TileRequestChannel {\r\n return this.iModelChannels.getChannelForTile(tile);\r\n }\r\n\r\n /** Chiefly for debugging.\r\n * @internal\r\n */\r\n public setRpcConcurrency(concurrency: number): void {\r\n this._rpcConcurrency = concurrency;\r\n this.iModelChannels.setRpcConcurrency(concurrency);\r\n this.elementGraphicsRpc.concurrency = concurrency;\r\n }\r\n\r\n /** Statistics intended primarily for debugging. */\r\n public get statistics(): TileRequestChannelStatistics {\r\n const stats = new TileRequestChannelStatistics();\r\n for (const channel of this)\r\n channel.statistics.addTo(stats);\r\n\r\n return stats;\r\n }\r\n\r\n /** Reset all [[statistics]] to zero. */\r\n public resetStatistics(): void {\r\n for (const channel of this)\r\n channel.resetStatistics();\r\n }\r\n\r\n /** Invoked by [[TileAdmin.processQueue]] when it is about to start enqueuing new requests.\r\n * @internal\r\n */\r\n public swapPending(): void {\r\n for (const channel of this)\r\n channel.swapPending();\r\n }\r\n\r\n /** Invoked by [[TileAdmin.processQueue]] when it is about to start enqueuing new requests.\r\n * @internal\r\n */\r\n public process(): void {\r\n for (const channel of this)\r\n channel.process();\r\n }\r\n\r\n /** Invoked by [[TileAdmin.onIModelClosed]].\r\n * @internal\r\n */\r\n public onIModelClosed(iModel: IModelConnection): void {\r\n for (const channel of this)\r\n channel.onIModelClosed(iModel);\r\n }\r\n\r\n /** Invoked by [[TileAdmin.onShutDown]].\r\n * @internal\r\n */\r\n public onShutDown(): void {\r\n for (const channel of this)\r\n channel.cancelAndClearAll();\r\n\r\n this._channels.clear();\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TileRequestChannels.js","sourceRoot":"","sources":["../../../src/tile/TileRequestChannels.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sCAAmC;AAEnC,yCAEoB;AAEpB,8FAA8F;AAC9F,MAAM,sBAAuB,SAAQ,6BAAkB;IAAvD;;QACmB,cAAS,GAAG,IAAI,GAAG,EAA8B,CAAC;IAwBrE,CAAC;IAtBiB,uBAAuB,CAAC,OAAoB;QAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QACxC,IAAI,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AAC;IAC1B,CAAC;IAED;;OAEG;IACI,OAAO;QACZ,KAAK,MAAM,OAAO,IAAI,IAAI;YACxB,OAAO,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,MAAwB;QAC5C,KAAK,MAAM,OAAO,IAAI,IAAI;YACxB,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,UAAU;QACf,KAAK,MAAM,OAAO,IAAI,IAAI;YACxB,OAAO,CAAC,iBAAiB,EAAE,CAAC;QAE9B,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACF;AAhKD,kDAgKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { IpcApp } from \"../IpcApp\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport {\r\n IModelTile, IModelTileRequestChannels, TileRequest, TileRequestChannel, TileRequestChannelStatistics,\r\n} from \"./internal\";\r\n\r\n/** For an [[IpcApp]], allows backend element graphics requests in progress to be canceled. */\r\nclass ElementGraphicsChannel extends TileRequestChannel {\r\n private readonly _canceled = new Map<IModelConnection, string[]>();\r\n\r\n public override onActiveRequestCanceled(request: TileRequest): void {\r\n const imodel = request.tile.tree.iModel;\r\n let ids = this._canceled.get(imodel);\r\n if (!ids)\r\n this._canceled.set(imodel, ids = []);\r\n\r\n ids.push(request.tile.contentId);\r\n }\r\n\r\n public override processCancellations(): void {\r\n for (const [imodel, requestIds] of this._canceled) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n IpcApp.callIpcHost(\"cancelElementGraphicsRequests\", imodel.key, requestIds);\r\n this._statistics.totalAbortedRequests += requestIds.length;\r\n }\r\n\r\n this._canceled.clear();\r\n }\r\n\r\n public override onIModelClosed(imodel: IModelConnection): void {\r\n this._canceled.delete(imodel);\r\n }\r\n}\r\n\r\n/** A set of named [[TileRequestChannel]]s via which content for [[Tile]]s can be requested.\r\n * @see [[TileAdmin.channels]] for the channels configured for use with the iTwin.js display system.\r\n * @see [[TileRequestChannels.getForHttp]] for the most typical way of obtaining or registering a channel.\r\n * @public\r\n */\r\nexport class TileRequestChannels {\r\n /** @internal */\r\n public readonly iModelChannels: IModelTileRequestChannels;\r\n /** The channel over which [[TileAdmin.requestElementGraphics]] executes. If you implement a [[TiledGraphicsProvider]] or [[TileTree]] that obtains its\r\n * content from `requestElementGraphics`, use this channel.\r\n */\r\n public readonly elementGraphicsRpc: TileRequestChannel;\r\n /** The maximum number of active requests for a channel that uses HTTP to request content. */\r\n public readonly httpConcurrency = 6;\r\n private _rpcConcurrency: number;\r\n private readonly _channels = new Map<string, TileRequestChannel>();\r\n\r\n /** `rpcConcurrency` is defined if [[IpcApp.isValid]]; otherwise RPC requests are made over HTTP and use the same limits.\r\n * @internal\r\n */\r\n public constructor(rpcConcurrency: number | undefined, cacheMetadata: boolean) {\r\n this._rpcConcurrency = rpcConcurrency ?? this.httpConcurrency;\r\n\r\n const elementGraphicsChannelName = \"itwinjs-elem-rpc\";\r\n if (undefined !== rpcConcurrency)\r\n this.elementGraphicsRpc = new ElementGraphicsChannel(elementGraphicsChannelName, rpcConcurrency);\r\n else\r\n this.elementGraphicsRpc = new TileRequestChannel(elementGraphicsChannelName, this.rpcConcurrency);\r\n\r\n this.add(this.elementGraphicsRpc);\r\n\r\n this.iModelChannels = new IModelTileRequestChannels({\r\n concurrency: this.rpcConcurrency,\r\n usesHttp: undefined === rpcConcurrency,\r\n cacheMetadata,\r\n cacheConcurrency: this.httpConcurrency,\r\n });\r\n\r\n for (const channel of this.iModelChannels)\r\n this.add(channel);\r\n }\r\n\r\n /** The number of registered channels. */\r\n public get size(): number {\r\n return this._channels.size;\r\n }\r\n\r\n /** Look up a registered channel by its name. */\r\n public get(name: string): TileRequestChannel | undefined {\r\n return this._channels.get(name);\r\n }\r\n\r\n /** Return whether the specified channel has been registered. Primarily for debugging. */\r\n public has(channel: TileRequestChannel): boolean {\r\n const existing = this.get(channel.name);\r\n return existing !== undefined && existing === channel;\r\n }\r\n\r\n /** Add a new channel.\r\n * @throws Error if a channel by the same name has already been registered.\r\n */\r\n public add(channel: TileRequestChannel): void {\r\n if (this.get(channel.name))\r\n throw new Error(`Tile request channel ${channel.name} is already registered.`);\r\n\r\n this._channels.set(channel.name, channel);\r\n }\r\n\r\n /** Extract the host name from a URL for use as the name of the corresponding [[TileRequestChannel]].\r\n * @throws TypeError if `url` is a string and does not represent a valid URL.\r\n * @see [[getForHttp]] to obtain or register a channel for the host name.\r\n */\r\n public static getNameFromUrl(url: URL | string): string {\r\n if (typeof url === \"string\")\r\n url = new URL(url);\r\n\r\n return url.hostname;\r\n }\r\n\r\n /** Obtain a channel that requests content over HTTP using HTTP 1.1 limits on simultaneous connections.\r\n * If a channel with the specified name does not already exist, it will be created and registered.\r\n * @see [[getNameFromUrl]] to obtain a channel name corresponding to a hostname.\r\n */\r\n public getForHttp(name: string): TileRequestChannel {\r\n let channel = this.get(name);\r\n if (!channel)\r\n this.add(channel = new TileRequestChannel(name, this.httpConcurrency));\r\n\r\n return channel;\r\n }\r\n\r\n /** Iterator over all of the channels. */\r\n public [Symbol.iterator](): Iterator<TileRequestChannel> {\r\n return this._channels.values()[Symbol.iterator]();\r\n }\r\n\r\n /** The maximum number of active requests for a channel that uses an RpcInterface to satisfy its requests.\r\n * For web-based applications, this is the same as [[httpConcurrency]], but for [[IpcApp]]s it is determined by the number of workers threads allocated by the backend.\r\n */\r\n public get rpcConcurrency(): number {\r\n return this._rpcConcurrency;\r\n }\r\n\r\n /** @internal */\r\n public getIModelTileChannel(tile: IModelTile): TileRequestChannel {\r\n return this.iModelChannels.getChannelForTile(tile);\r\n }\r\n\r\n /** Chiefly for debugging.\r\n * @internal\r\n */\r\n public setRpcConcurrency(concurrency: number): void {\r\n this._rpcConcurrency = concurrency;\r\n this.iModelChannels.setRpcConcurrency(concurrency);\r\n this.elementGraphicsRpc.concurrency = concurrency;\r\n }\r\n\r\n /** Statistics intended primarily for debugging. */\r\n public get statistics(): TileRequestChannelStatistics {\r\n const stats = new TileRequestChannelStatistics();\r\n for (const channel of this)\r\n channel.statistics.addTo(stats);\r\n\r\n return stats;\r\n }\r\n\r\n /** Reset all [[statistics]] to zero. */\r\n public resetStatistics(): void {\r\n for (const channel of this)\r\n channel.resetStatistics();\r\n }\r\n\r\n /** Invoked by [[TileAdmin.processQueue]] when it is about to start enqueuing new requests.\r\n * @internal\r\n */\r\n public swapPending(): void {\r\n for (const channel of this)\r\n channel.swapPending();\r\n }\r\n\r\n /** Invoked by [[TileAdmin.processQueue]] when it is about to start enqueuing new requests.\r\n * @internal\r\n */\r\n public process(): void {\r\n for (const channel of this)\r\n channel.process();\r\n }\r\n\r\n /** Invoked by [[TileAdmin.onIModelClosed]].\r\n * @internal\r\n */\r\n public onIModelClosed(iModel: IModelConnection): void {\r\n for (const channel of this)\r\n channel.onIModelClosed(iModel);\r\n }\r\n\r\n /** Invoked by [[TileAdmin.onShutDown]].\r\n * @internal\r\n */\r\n public onShutDown(): void {\r\n for (const channel of this)\r\n channel.cancelAndClearAll();\r\n\r\n this._channels.clear();\r\n }\r\n}\r\n"]}
|