@itwin/core-frontend 3.1.0-dev.7 → 3.2.0-dev.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 +163 -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 +8 -4
- package/lib/cjs/IModelApp.d.ts.map +1 -1
- package/lib/cjs/IModelApp.js +20 -10
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/IModelConnection.d.ts +3 -5
- package/lib/cjs/IModelConnection.d.ts.map +1 -1
- package/lib/cjs/IModelConnection.js +4 -10
- 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/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 -99
- 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/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 -2
- package/lib/cjs/tile/map/ImageryProviders/WmsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +1 -1
- 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 +152 -65
- 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/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 +8 -4
- package/lib/esm/IModelApp.d.ts.map +1 -1
- package/lib/esm/IModelApp.js +20 -10
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/IModelConnection.d.ts +3 -5
- package/lib/esm/IModelConnection.d.ts.map +1 -1
- package/lib/esm/IModelConnection.js +5 -11
- 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/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 -100
- 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/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 -2
- package/lib/esm/tile/map/ImageryProviders/WmsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +1 -1
- 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 +154 -67
- 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/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,67 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Tiles
|
|
7
|
+
*/
|
|
8
|
+
import { IModelApp } from "../IModelApp";
|
|
9
|
+
/** Collects geoemtry from a [[GeometryTileTreeReference]] within a specified volume at a specified level of detail.
|
|
10
|
+
* Subclasses can refine the collection criterion.
|
|
11
|
+
* The tile geometry is obtained asynchronously, so successive collections over multiple frames may be required before all of the geometry
|
|
12
|
+
* is collected.
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
export class TileGeometryCollector {
|
|
16
|
+
/** Create a new collector. */
|
|
17
|
+
constructor(options) {
|
|
18
|
+
/** The list of accumulated polyfaces, populated during [[GeometryTileTreeReference.collectTileGeometry]].
|
|
19
|
+
* The polyfaces belong to the [[Tile]]s - they should not be modified.
|
|
20
|
+
* If [[isAllGeometryLoaded]] is `false`, then this list is incomplete - another geometry collection should be performed with a new collector on a subsequent frame.
|
|
21
|
+
*/
|
|
22
|
+
this.polyfaces = [];
|
|
23
|
+
this._missing = new Set();
|
|
24
|
+
this._loading = false;
|
|
25
|
+
this._options = options;
|
|
26
|
+
}
|
|
27
|
+
/** Allows an implementation of [[GeometryTileTreeReference.collectTileGeoemtry]] to indicate that further loading is required before
|
|
28
|
+
* the collection can be completed.
|
|
29
|
+
* This will cause [[isAllGeometryLoaded]] to return `false`.
|
|
30
|
+
*/
|
|
31
|
+
markLoading() {
|
|
32
|
+
this._loading = true;
|
|
33
|
+
}
|
|
34
|
+
/** Enqueues requests to obtain the content of any tiles whose content is required to complete the geometry collection.
|
|
35
|
+
* @see [[isAllGeometryLoaded]] to determine if geometry collection is complete.
|
|
36
|
+
*/
|
|
37
|
+
requestMissingTiles() {
|
|
38
|
+
IModelApp.tileAdmin.requestTiles(this._options.user, this._missing);
|
|
39
|
+
}
|
|
40
|
+
/** Allows an implementation of [[GeometryTileTreeReference.collectTileGeometry]] to indicate that the specified tile's content must be loaded
|
|
41
|
+
* before geometry collection can be completed.
|
|
42
|
+
* This will cause [[isAllGeometryLoaded]] to return `false`.
|
|
43
|
+
*/
|
|
44
|
+
addMissingTile(tile) {
|
|
45
|
+
this._missing.add(tile);
|
|
46
|
+
}
|
|
47
|
+
/** Returns true if [[polyfaces]] has been fully populated with all the geometry satisfying this collector's criteria.
|
|
48
|
+
* If it returns false, another collection using a new collector should be performed on a subsequent frame to load more geometry.
|
|
49
|
+
*/
|
|
50
|
+
get isAllGeometryLoaded() {
|
|
51
|
+
return !this._loading && this._missing.size === 0;
|
|
52
|
+
}
|
|
53
|
+
/** Determine whether to collect the specified tile's geometry, reject it, or to evaluate the geometry of its child tiles for collection.
|
|
54
|
+
* This base implementation makes that determination based on the collector's range and chord tolerance. Subclasses should typically call `super.collectTile` and, if
|
|
55
|
+
* it returns "accept" or "continue", apply their own criteria to the tile.
|
|
56
|
+
*/
|
|
57
|
+
collectTile(tile) {
|
|
58
|
+
const range = this._options.transform ? this._options.transform.multiplyRange(tile.range) : tile.range;
|
|
59
|
+
if (!range.intersectsRange(this._options.range))
|
|
60
|
+
return "reject";
|
|
61
|
+
if (tile.maximumSize === 0 || !tile.isDisplayable)
|
|
62
|
+
return "continue";
|
|
63
|
+
const tolerance = tile.radius / tile.maximumSize;
|
|
64
|
+
return tolerance < this._options.chordTolerance ? "accept" : "continue";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# 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,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AA2BzC;;;;;GAKG;AACH,MAAM,OAAO,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,SAAS,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","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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AAW,GAAG;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,GAAG,SAAS,CAAC;IAE9G;;OAEG;IACH,KAAY,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;IAEpD;;;OAGG;IACH,KAAY,KAAK;QACf,gEAAgE;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"}
|
|
@@ -8,19 +8,24 @@
|
|
|
8
8
|
import { assert, base64StringToUint8Array, IModelStatus } from "@itwin/core-bentley";
|
|
9
9
|
import { ImageSource } from "@itwin/core-common";
|
|
10
10
|
import { IModelApp } from "../IModelApp";
|
|
11
|
+
import { TileUser } from "./internal";
|
|
11
12
|
/** 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
|
|
12
13
|
* [[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.
|
|
13
14
|
* @public
|
|
14
15
|
*/
|
|
15
16
|
export class TileRequest {
|
|
16
17
|
/** Constructor */
|
|
17
|
-
constructor(tile,
|
|
18
|
+
constructor(tile, user) {
|
|
18
19
|
/** 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. */
|
|
19
20
|
this.priority = 0;
|
|
20
21
|
this._state = TileRequest.State.Queued;
|
|
21
22
|
this.tile = tile;
|
|
22
23
|
this.channel = tile.channel;
|
|
23
|
-
this.
|
|
24
|
+
this.users = IModelApp.tileAdmin.getTileUserSetForRequest(user);
|
|
25
|
+
}
|
|
26
|
+
/** 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. */
|
|
27
|
+
get viewports() {
|
|
28
|
+
return TileUser.viewportsFromUsers(this.users);
|
|
24
29
|
}
|
|
25
30
|
/** The request's current state. */
|
|
26
31
|
get state() { return this._state; }
|
|
@@ -34,16 +39,16 @@ export class TileRequest {
|
|
|
34
39
|
// 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).
|
|
35
40
|
if (TileRequest.State.Loading === this._state)
|
|
36
41
|
return false;
|
|
37
|
-
// If no
|
|
38
|
-
return this.
|
|
42
|
+
// If no user cares about this tile any more, we're canceled.
|
|
43
|
+
return this.users.isEmpty;
|
|
39
44
|
}
|
|
40
45
|
/** The tile tree to which the requested [[Tile]] belongs. */
|
|
41
46
|
get tree() { return this.tile.tree; }
|
|
42
|
-
/** Indicate that the specified
|
|
47
|
+
/** Indicate that the specified user is awaiting the result of this request.
|
|
43
48
|
* @internal
|
|
44
49
|
*/
|
|
45
|
-
|
|
46
|
-
this.
|
|
50
|
+
addUser(user) {
|
|
51
|
+
this.users = IModelApp.tileAdmin.getTileUserSetForRequest(user, this.users);
|
|
47
52
|
}
|
|
48
53
|
/** Transition the request from "queued" to "active", kicking off a series of asynchronous operations usually beginning with an http request, and -
|
|
49
54
|
* if the request is not subsequently canceled - resulting in either a successfully-loaded Tile, or a failed ("not found") Tile.
|
|
@@ -95,14 +100,17 @@ export class TileRequest {
|
|
|
95
100
|
this.channel.onActiveRequestCanceled(this);
|
|
96
101
|
this._state = TileRequest.State.Failed;
|
|
97
102
|
}
|
|
98
|
-
/** Invalidates the scene of each [[
|
|
103
|
+
/** Invalidates the scene of each [[TileUser]] interested in this request - typically because the request succeeded, failed, or was canceled. */
|
|
99
104
|
notify() {
|
|
100
|
-
this.
|
|
105
|
+
this.users.forEach((user) => {
|
|
106
|
+
if (user.onRequestStateChanged)
|
|
107
|
+
user.onRequestStateChanged(this);
|
|
108
|
+
});
|
|
101
109
|
}
|
|
102
|
-
/** Invalidates the scene of each [[
|
|
110
|
+
/** Invalidates the scene of each [[TileUser]] interested in this request and clears the set of interested users. */
|
|
103
111
|
notifyAndClear() {
|
|
104
112
|
this.notify();
|
|
105
|
-
this.
|
|
113
|
+
this.users = IModelApp.tileAdmin.emptyTileUserSet;
|
|
106
114
|
this.tile.request = undefined;
|
|
107
115
|
}
|
|
108
116
|
setFailed() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileRequest.js","sourceRoot":"","sources":["../../../src/tile/TileRequest.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC;;;GAGG;AACH,MAAM,OAAO,WAAW;IAWtB,kBAAkB;IAClB,YAAmB,IAAU,EAAE,EAAY;QAJ3C,kLAAkL;QAC3K,aAAQ,GAAG,CAAC,CAAC;QAIlB,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,mCAAmC;IACnC,IAAW,KAAK,KAAwB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7D,oEAAoE;IACpE,IAAW,QAAQ,KAAK,OAAO,WAAW,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAE1E,6CAA6C;IAC7C,IAAW,UAAU;QACnB,2CAA2C;QAC3C,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU;YACnC,OAAO,IAAI,CAAC;QAEd,sLAAsL;QACtL,IAAI,WAAW,CAAC,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC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,OAAO,IAAI,EAAE;YACb,IAAI,CAAC,SAAS,EAAE,CAAC;SAClB;IACH,CAAC;CACF;AAED,cAAc;AACd,WAAiB,WAAW;IAa1B;;;OAGG;IACH,IAAY,KAWX;IAXD,WAAY,KAAK;QACf,gEAAgE;QAChE,qCAAM,CAAA;QACN,qEAAqE;QACrE,6CAAU,CAAA;QACV,mGAAmG;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,KAAX,WAAW,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;;;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AAC;SACnD;QAAC,OAAO,IAAI,EAAE;YACb,IAAI,CAAC,SAAS,EAAE,CAAC;SAClB;IACH,CAAC;CACF;AAED,cAAc;AACd,WAAiB,WAAW;IAa1B;;;OAGG;IACH,IAAY,KAWX;IAXD,WAAY,KAAK;QACf,gEAAgE;QAChE,qCAAM,CAAA;QACN,qEAAqE;QACrE,6CAAU,CAAA;QACV,mGAAmG;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,KAAX,WAAW,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"]}
|
|
@@ -163,18 +163,18 @@ export class TileRequestChannel {
|
|
|
163
163
|
this._statistics.numCanceled = 0;
|
|
164
164
|
// Recompute priority of each request.
|
|
165
165
|
for (const pending of this._pending)
|
|
166
|
-
pending.priority = pending.tile.computeLoadPriority(pending.viewports);
|
|
166
|
+
pending.priority = pending.tile.computeLoadPriority(pending.viewports, pending.users);
|
|
167
167
|
// Sort pending requests by priority.
|
|
168
168
|
this._pending.sort();
|
|
169
169
|
// Cancel any previously pending requests that are no longer needed.
|
|
170
170
|
for (const queued of this._previouslyPending)
|
|
171
|
-
if (queued.
|
|
171
|
+
if (queued.users.isEmpty)
|
|
172
172
|
this.cancel(queued);
|
|
173
173
|
this._previouslyPending.clear();
|
|
174
174
|
// Cancel any active requests that are no longer needed.
|
|
175
175
|
// NB: Do NOT remove them from the active set until their http activity has completed.
|
|
176
176
|
for (const active of this._active)
|
|
177
|
-
if (active.
|
|
177
|
+
if (active.users.isEmpty)
|
|
178
178
|
this.cancel(active);
|
|
179
179
|
// Batch-cancel running requests.
|
|
180
180
|
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,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAI5D,MAAM,gBAAiB,SAAQ,aAA0B;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,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OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE;YACpB,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACb,EAAE;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACO,MAAM,CAAC,OAAoB;QACnC,OAAO,CAAC,MAAM,EAAE,CAAC;QACjB,EAAE,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC;IACjC,CAAC;IAED;;OAEG;IACO,iBAAiB,CAAC,OAAoB;QAC9C,MAAM,CAAC,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","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,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAI5D,MAAM,gBAAiB,SAAQ,aAA0B;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,MAAM,OAAO,4BAA4B;IAAzC;QACE,uEAAuE;QAChE,uBAAkB,GAAG,CAAC,CAAC;QAC9B,8EA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,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACO,MAAM,CAAC,OAAoB;QACnC,OAAO,CAAC,MAAM,EAAE,CAAC;QACjB,EAAE,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC;IACjC,CAAC;IAED;;OAEG;IACO,iBAAiB,CAAC,OAAoB;QAC9C,MAAM,CAAC,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","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"]}
|
|
@@ -7,7 +7,7 @@ import { ElementAlignedBox3d, FrustumPlanes, ViewFlagOverrides } from "@itwin/co
|
|
|
7
7
|
import { IModelConnection } from "../IModelConnection";
|
|
8
8
|
import { RenderClipVolume } from "../render/RenderClipVolume";
|
|
9
9
|
import { RenderMemory } from "../render/RenderMemory";
|
|
10
|
-
import { Tile, TileDrawArgs, TileLoadPriority, TileTreeParams } from "./internal";
|
|
10
|
+
import { Tile, TileDrawArgs, TileGeometryCollector, TileLoadPriority, TileTreeParams } from "./internal";
|
|
11
11
|
/** Describes the current state of a [[TileTree]]. TileTrees are loaded asynchronously and may be unloaded after a period of disuse.
|
|
12
12
|
* @see [[TileTreeOwner]].
|
|
13
13
|
* @public
|
|
@@ -112,5 +112,11 @@ export declare abstract class TileTree {
|
|
|
112
112
|
* @beta
|
|
113
113
|
*/
|
|
114
114
|
getEcefTransform(): Promise<Transform | undefined>;
|
|
115
|
+
/** Populate [[TileGeometryCollector.polyfaces]] with geometry obtained from this tile tree's tiles satisfying the collector's criteria.
|
|
116
|
+
* The base implementation does nothing.
|
|
117
|
+
* @see [[TileTreeReference.createGeometryTreeReference]] to attempt to create a TileTree that can collect geometry.
|
|
118
|
+
* @beta
|
|
119
|
+
*/
|
|
120
|
+
collectTileGeometry(_collector: TileGeometryCollector): void;
|
|
115
121
|
}
|
|
116
122
|
//# sourceMappingURL=TileTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileTree.d.ts","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAW,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"TileTree.d.ts","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAW,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEzG;;;GAGG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AI,IAAI;IAE7B,mDAAmD;IACnD,IAAW,IAAI,IAAI,OAAO,CAAuB;IACjD,gBAAgB;IAChB,IAAW,YAAY,IAAI,OAAO,CAAkB;IACpD,gBAAgB;IAChB,IAAW,UAAU,IAAI,gBAAgB,GAAG,SAAS,CAA6B;IAElF,sDAAsD;IACtD,IAAW,KAAK,IAAI,mBAAmB,CAAgC;IACvE,sEAAsE;IACtE,IAAW,gBAAgB,IAAI,WAAW,CAA+B;IACzE;;OAEG;IACH,IAAW,2BAA2B,IAAI,OAAO,CAAiB;IAElE,kBAAkB;IAClB,SAAS,aAAa,MAAM,EAAE,cAAc;IAc5C;;OAEG;IACI,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,EAAE;IAQ9C,6DAA6D;IAC7D,IAAW,UAAU,IAAI,OAAO,CAA6B;IAE7D,4GAA4G;IACrG,OAAO,IAAI,IAAI;IAQtB,gBAAgB;IACT,iBAAiB,CAAC,KAAK,EAAE,YAAY,CAAC,UAAU,GAAG,IAAI;IAI9D,2GAA2G;IACpG,UAAU,IAAI,MAAM;IAI3B,gBAAgB;IACT,0BAA0B,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI;IAI7H;;;;OAIG;IACU,gBAAgB,IAAI,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAkB/D;;;;OAIG;IACI,mBAAmB,CAAC,UAAU,EAAE,qBAAqB,GAAG,IAAI;CAEpE"}
|
package/lib/esm/tile/TileTree.js
CHANGED
|
@@ -82,7 +82,7 @@ export class TileTree {
|
|
|
82
82
|
selectTiles(args) {
|
|
83
83
|
this._lastSelected = BeTimePoint.now();
|
|
84
84
|
const tiles = this._selectTiles(args);
|
|
85
|
-
IModelApp.tileAdmin.
|
|
85
|
+
IModelApp.tileAdmin.addTilesForUser(args.context.viewport, tiles, args.readyTiles);
|
|
86
86
|
args.processSelectedTiles(tiles);
|
|
87
87
|
return tiles;
|
|
88
88
|
}
|
|
@@ -127,5 +127,12 @@ export class TileTree {
|
|
|
127
127
|
dbToEcef = this.iModel.ecefLocation.getTransform();
|
|
128
128
|
return dbToEcef.multiplyTransformTransform(this.iModelTransform);
|
|
129
129
|
}
|
|
130
|
+
/** Populate [[TileGeometryCollector.polyfaces]] with geometry obtained from this tile tree's tiles satisfying the collector's criteria.
|
|
131
|
+
* The base implementation does nothing.
|
|
132
|
+
* @see [[TileTreeReference.createGeometryTreeReference]] to attempt to create a TileTree that can collect geometry.
|
|
133
|
+
* @beta
|
|
134
|
+
*/
|
|
135
|
+
collectTileGeometry(_collector) {
|
|
136
|
+
}
|
|
130
137
|
}
|
|
131
138
|
//# sourceMappingURL=TileTree.js.map
|