@itwin/core-frontend 5.11.0-dev.9 → 5.11.0
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 +32 -1
- package/lib/cjs/AccuDraw.d.ts +2 -0
- package/lib/cjs/AccuDraw.d.ts.map +1 -1
- package/lib/cjs/AccuDraw.js +9 -1
- package/lib/cjs/AccuDraw.js.map +1 -1
- package/lib/cjs/BingLocation.d.ts +4 -0
- package/lib/cjs/BingLocation.d.ts.map +1 -1
- package/lib/cjs/BingLocation.js +6 -1
- package/lib/cjs/BingLocation.js.map +1 -1
- package/lib/cjs/CesiumAccessClient.d.ts +52 -0
- package/lib/cjs/CesiumAccessClient.d.ts.map +1 -0
- package/lib/cjs/CesiumAccessClient.js +10 -0
- package/lib/cjs/CesiumAccessClient.js.map +1 -0
- package/lib/cjs/DisplayStyleState.js +2 -2
- package/lib/cjs/DisplayStyleState.js.map +1 -1
- package/lib/cjs/GeoProviders.d.ts +45 -0
- package/lib/cjs/GeoProviders.d.ts.map +1 -0
- package/lib/cjs/GeoProviders.js +49 -0
- package/lib/cjs/GeoProviders.js.map +1 -0
- package/lib/cjs/GraphicalEditingScope.d.ts +22 -1
- package/lib/cjs/GraphicalEditingScope.d.ts.map +1 -1
- package/lib/cjs/GraphicalEditingScope.js +27 -1
- package/lib/cjs/GraphicalEditingScope.js.map +1 -1
- package/lib/cjs/HitDetail.d.ts +1 -1
- package/lib/cjs/HitDetail.d.ts.map +1 -1
- package/lib/cjs/HitDetail.js +10 -7
- package/lib/cjs/HitDetail.js.map +1 -1
- package/lib/cjs/IModelApp.d.ts +33 -0
- package/lib/cjs/IModelApp.d.ts.map +1 -1
- package/lib/cjs/IModelApp.js +33 -0
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/IModelConnection.d.ts +9 -9
- package/lib/cjs/IModelConnection.d.ts.map +1 -1
- package/lib/cjs/IModelConnection.js +21 -14
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/IpcApp.d.ts +1 -1
- package/lib/cjs/IpcApp.js +1 -1
- package/lib/cjs/IpcApp.js.map +1 -1
- package/lib/cjs/NativeApp.d.ts.map +1 -1
- package/lib/cjs/NativeApp.js +1 -3
- package/lib/cjs/NativeApp.js.map +1 -1
- package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts +1 -1
- package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -1
- package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js +23 -5
- package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
- package/lib/cjs/SelectionSet.d.ts +7 -7
- package/lib/cjs/SelectionSet.js +3 -3
- package/lib/cjs/SelectionSet.js.map +1 -1
- package/lib/cjs/SubCategoriesCache.d.ts +15 -3
- package/lib/cjs/SubCategoriesCache.d.ts.map +1 -1
- package/lib/cjs/SubCategoriesCache.js +98 -26
- package/lib/cjs/SubCategoriesCache.js.map +1 -1
- package/lib/cjs/ViewGlobalLocation.d.ts +1 -1
- package/lib/cjs/ViewGlobalLocation.d.ts.map +1 -1
- package/lib/cjs/ViewGlobalLocation.js +3 -6
- package/lib/cjs/ViewGlobalLocation.js.map +1 -1
- package/lib/cjs/ViewState.d.ts +1 -1
- package/lib/cjs/ViewState.js +1 -1
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/Viewport.d.ts +5 -4
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +16 -4
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +3 -0
- package/lib/cjs/core-frontend.d.ts.map +1 -1
- package/lib/cjs/core-frontend.js +4 -0
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/internal/render/webgl/AtmosphereUniforms.d.ts +1 -1
- package/lib/cjs/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js +1 -1
- package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/AttributeBuffers.d.ts +2 -2
- package/lib/cjs/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/AttributeBuffers.js +2 -2
- package/lib/cjs/internal/render/webgl/AttributeBuffers.js.map +1 -1
- package/lib/cjs/internal/render/webgl/ClippingProgram.d.ts +1 -1
- package/lib/cjs/internal/render/webgl/ClippingProgram.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/ClippingProgram.js +1 -1
- package/lib/cjs/internal/render/webgl/ClippingProgram.js.map +1 -1
- package/lib/cjs/internal/render/webgl/ShaderProgram.d.ts +2 -2
- package/lib/cjs/internal/render/webgl/ShaderProgram.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/ShaderProgram.js +2 -2
- package/lib/cjs/internal/render/webgl/ShaderProgram.js.map +1 -1
- package/lib/cjs/internal/render/webgl/Technique.d.ts +3 -3
- package/lib/cjs/internal/render/webgl/Technique.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/Technique.js +3 -3
- package/lib/cjs/internal/render/webgl/Technique.js.map +1 -1
- package/lib/cjs/internal/tile/DynamicIModelTile.d.ts +3 -3
- package/lib/cjs/internal/tile/DynamicIModelTile.d.ts.map +1 -1
- package/lib/cjs/internal/tile/DynamicIModelTile.js +26 -6
- package/lib/cjs/internal/tile/DynamicIModelTile.js.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.js +4 -2
- package/lib/cjs/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.js +7 -3
- package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/RealityTileLoader.d.ts +22 -0
- package/lib/cjs/internal/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityTileLoader.js +53 -5
- package/lib/cjs/internal/tile/RealityTileLoader.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts +2 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js +2 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
- package/lib/cjs/properties/AngleDescription.d.ts +2 -1
- package/lib/cjs/properties/AngleDescription.d.ts.map +1 -1
- package/lib/cjs/properties/AngleDescription.js +4 -1
- package/lib/cjs/properties/AngleDescription.js.map +1 -1
- package/lib/cjs/properties/FormattedQuantityDescription.d.ts +29 -1
- package/lib/cjs/properties/FormattedQuantityDescription.d.ts.map +1 -1
- package/lib/cjs/properties/FormattedQuantityDescription.js +35 -0
- package/lib/cjs/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/cjs/properties/LengthDescription.d.ts +6 -3
- package/lib/cjs/properties/LengthDescription.d.ts.map +1 -1
- package/lib/cjs/properties/LengthDescription.js +12 -3
- package/lib/cjs/properties/LengthDescription.js.map +1 -1
- package/lib/cjs/render/Decorations.d.ts +1 -1
- package/lib/cjs/render/Decorations.d.ts.map +1 -1
- package/lib/cjs/render/Decorations.js +1 -1
- package/lib/cjs/render/Decorations.js.map +1 -1
- package/lib/cjs/render/GraphicBranch.d.ts +1 -1
- package/lib/cjs/render/GraphicBranch.d.ts.map +1 -1
- package/lib/cjs/render/GraphicBranch.js +1 -1
- package/lib/cjs/render/GraphicBranch.js.map +1 -1
- package/lib/cjs/render/RenderSystem.d.ts +2 -2
- package/lib/cjs/render/RenderSystem.d.ts.map +1 -1
- package/lib/cjs/render/RenderSystem.js +1 -1
- package/lib/cjs/render/RenderSystem.js.map +1 -1
- package/lib/cjs/render/ScreenSpaceEffectBuilder.d.ts +1 -1
- package/lib/cjs/render/ScreenSpaceEffectBuilder.js.map +1 -1
- package/lib/cjs/request/Request.d.ts +2 -2
- package/lib/cjs/request/Request.js.map +1 -1
- package/lib/cjs/tile/RealityTile.d.ts +5 -0
- package/lib/cjs/tile/RealityTile.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTile.js +4 -0
- package/lib/cjs/tile/RealityTile.js.map +1 -1
- package/lib/cjs/tile/Tile.d.ts +1 -1
- package/lib/cjs/tile/Tile.d.ts.map +1 -1
- package/lib/cjs/tile/Tile.js +1 -1
- package/lib/cjs/tile/Tile.js.map +1 -1
- package/lib/cjs/tile/TileAdmin.d.ts +23 -1
- package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
- package/lib/cjs/tile/TileAdmin.js +17 -1
- package/lib/cjs/tile/TileAdmin.js.map +1 -1
- package/lib/cjs/tile/TileTree.d.ts +1 -1
- package/lib/cjs/tile/TileTree.d.ts.map +1 -1
- package/lib/cjs/tile/TileTree.js +1 -1
- package/lib/cjs/tile/TileTree.js.map +1 -1
- package/lib/cjs/tile/TileTreeReference.d.ts +1 -1
- package/lib/cjs/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/cjs/tile/TileTreeReference.js +1 -1
- package/lib/cjs/tile/TileTreeReference.js.map +1 -1
- package/lib/cjs/tile/map/BingElevation.d.ts +16 -4
- package/lib/cjs/tile/map/BingElevation.d.ts.map +1 -1
- package/lib/cjs/tile/map/BingElevation.js +18 -8
- package/lib/cjs/tile/map/BingElevation.js.map +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.d.ts +16 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.js +58 -18
- package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.d.ts +2 -2
- package/lib/cjs/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js +2 -2
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +6 -1
- 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 +1 -0
- package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.js +3 -0
- package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +20 -9
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tile/map/TerrainMeshProvider.d.ts +7 -1
- package/lib/cjs/tile/map/TerrainMeshProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/TerrainMeshProvider.js +1 -1
- package/lib/cjs/tile/map/TerrainMeshProvider.js.map +1 -1
- package/lib/cjs/tools/AccuDrawShortcutTool.d.ts +29 -0
- package/lib/cjs/tools/AccuDrawShortcutTool.d.ts.map +1 -0
- package/lib/cjs/tools/AccuDrawShortcutTool.js +139 -0
- package/lib/cjs/tools/AccuDrawShortcutTool.js.map +1 -0
- package/lib/cjs/tools/AccuDrawTool.d.ts +13 -68
- package/lib/cjs/tools/AccuDrawTool.d.ts.map +1 -1
- package/lib/cjs/tools/AccuDrawTool.js +103 -129
- package/lib/cjs/tools/AccuDrawTool.js.map +1 -1
- package/lib/cjs/tools/SetupCameraTools.d.ts +89 -0
- package/lib/cjs/tools/SetupCameraTools.d.ts.map +1 -0
- package/lib/cjs/tools/SetupCameraTools.js +444 -0
- package/lib/cjs/tools/SetupCameraTools.js.map +1 -0
- package/lib/cjs/tools/ToolAdmin.d.ts +5 -2
- package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +30 -7
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/cjs/tools/ViewTool.d.ts +1 -81
- package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
- package/lib/cjs/tools/ViewTool.js +13 -410
- package/lib/cjs/tools/ViewTool.js.map +1 -1
- package/lib/esm/AccuDraw.d.ts +2 -0
- package/lib/esm/AccuDraw.d.ts.map +1 -1
- package/lib/esm/AccuDraw.js +9 -1
- package/lib/esm/AccuDraw.js.map +1 -1
- package/lib/esm/BingLocation.d.ts +4 -0
- package/lib/esm/BingLocation.d.ts.map +1 -1
- package/lib/esm/BingLocation.js +6 -1
- package/lib/esm/BingLocation.js.map +1 -1
- package/lib/esm/CesiumAccessClient.d.ts +52 -0
- package/lib/esm/CesiumAccessClient.d.ts.map +1 -0
- package/lib/esm/CesiumAccessClient.js +9 -0
- package/lib/esm/CesiumAccessClient.js.map +1 -0
- package/lib/esm/DisplayStyleState.js +2 -2
- package/lib/esm/DisplayStyleState.js.map +1 -1
- package/lib/esm/GeoProviders.d.ts +45 -0
- package/lib/esm/GeoProviders.d.ts.map +1 -0
- package/lib/esm/GeoProviders.js +45 -0
- package/lib/esm/GeoProviders.js.map +1 -0
- package/lib/esm/GraphicalEditingScope.d.ts +22 -1
- package/lib/esm/GraphicalEditingScope.d.ts.map +1 -1
- package/lib/esm/GraphicalEditingScope.js +27 -1
- package/lib/esm/GraphicalEditingScope.js.map +1 -1
- package/lib/esm/HitDetail.d.ts +1 -1
- package/lib/esm/HitDetail.d.ts.map +1 -1
- package/lib/esm/HitDetail.js +11 -8
- package/lib/esm/HitDetail.js.map +1 -1
- package/lib/esm/IModelApp.d.ts +33 -0
- package/lib/esm/IModelApp.d.ts.map +1 -1
- package/lib/esm/IModelApp.js +34 -1
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/IModelConnection.d.ts +9 -9
- package/lib/esm/IModelConnection.d.ts.map +1 -1
- package/lib/esm/IModelConnection.js +21 -14
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/IpcApp.d.ts +1 -1
- package/lib/esm/IpcApp.js +1 -1
- package/lib/esm/IpcApp.js.map +1 -1
- package/lib/esm/NativeApp.d.ts.map +1 -1
- package/lib/esm/NativeApp.js +1 -3
- package/lib/esm/NativeApp.js.map +1 -1
- package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts +1 -1
- package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -1
- package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js +24 -6
- package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
- package/lib/esm/SelectionSet.d.ts +7 -7
- package/lib/esm/SelectionSet.js +3 -3
- package/lib/esm/SelectionSet.js.map +1 -1
- package/lib/esm/SubCategoriesCache.d.ts +15 -3
- package/lib/esm/SubCategoriesCache.d.ts.map +1 -1
- package/lib/esm/SubCategoriesCache.js +99 -27
- package/lib/esm/SubCategoriesCache.js.map +1 -1
- package/lib/esm/ViewGlobalLocation.d.ts +1 -1
- package/lib/esm/ViewGlobalLocation.d.ts.map +1 -1
- package/lib/esm/ViewGlobalLocation.js +3 -6
- package/lib/esm/ViewGlobalLocation.js.map +1 -1
- package/lib/esm/ViewState.d.ts +1 -1
- package/lib/esm/ViewState.js +1 -1
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/Viewport.d.ts +5 -4
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +16 -4
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +3 -0
- package/lib/esm/core-frontend.d.ts.map +1 -1
- package/lib/esm/core-frontend.js +6 -1
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/internal/render/webgl/AtmosphereUniforms.d.ts +1 -1
- package/lib/esm/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/AtmosphereUniforms.js +1 -1
- package/lib/esm/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/AttributeBuffers.d.ts +2 -2
- package/lib/esm/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/AttributeBuffers.js +2 -2
- package/lib/esm/internal/render/webgl/AttributeBuffers.js.map +1 -1
- package/lib/esm/internal/render/webgl/ClippingProgram.d.ts +1 -1
- package/lib/esm/internal/render/webgl/ClippingProgram.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/ClippingProgram.js +1 -1
- package/lib/esm/internal/render/webgl/ClippingProgram.js.map +1 -1
- package/lib/esm/internal/render/webgl/ShaderProgram.d.ts +2 -2
- package/lib/esm/internal/render/webgl/ShaderProgram.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/ShaderProgram.js +2 -2
- package/lib/esm/internal/render/webgl/ShaderProgram.js.map +1 -1
- package/lib/esm/internal/render/webgl/Technique.d.ts +3 -3
- package/lib/esm/internal/render/webgl/Technique.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/Technique.js +3 -3
- package/lib/esm/internal/render/webgl/Technique.js.map +1 -1
- package/lib/esm/internal/tile/DynamicIModelTile.d.ts +3 -3
- package/lib/esm/internal/tile/DynamicIModelTile.d.ts.map +1 -1
- package/lib/esm/internal/tile/DynamicIModelTile.js +26 -6
- package/lib/esm/internal/tile/DynamicIModelTile.js.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.js +4 -2
- package/lib/esm/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.js +7 -3
- package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/internal/tile/RealityTileLoader.d.ts +22 -0
- package/lib/esm/internal/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityTileLoader.js +54 -6
- package/lib/esm/internal/tile/RealityTileLoader.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts +2 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js +2 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
- package/lib/esm/properties/AngleDescription.d.ts +2 -1
- package/lib/esm/properties/AngleDescription.d.ts.map +1 -1
- package/lib/esm/properties/AngleDescription.js +4 -1
- package/lib/esm/properties/AngleDescription.js.map +1 -1
- package/lib/esm/properties/FormattedQuantityDescription.d.ts +29 -1
- package/lib/esm/properties/FormattedQuantityDescription.d.ts.map +1 -1
- package/lib/esm/properties/FormattedQuantityDescription.js +35 -1
- package/lib/esm/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/esm/properties/LengthDescription.d.ts +6 -3
- package/lib/esm/properties/LengthDescription.d.ts.map +1 -1
- package/lib/esm/properties/LengthDescription.js +12 -3
- package/lib/esm/properties/LengthDescription.js.map +1 -1
- package/lib/esm/render/Decorations.d.ts +1 -1
- package/lib/esm/render/Decorations.d.ts.map +1 -1
- package/lib/esm/render/Decorations.js +1 -1
- package/lib/esm/render/Decorations.js.map +1 -1
- package/lib/esm/render/GraphicBranch.d.ts +1 -1
- package/lib/esm/render/GraphicBranch.d.ts.map +1 -1
- package/lib/esm/render/GraphicBranch.js +1 -1
- package/lib/esm/render/GraphicBranch.js.map +1 -1
- package/lib/esm/render/RenderSystem.d.ts +2 -2
- package/lib/esm/render/RenderSystem.d.ts.map +1 -1
- package/lib/esm/render/RenderSystem.js +1 -1
- package/lib/esm/render/RenderSystem.js.map +1 -1
- package/lib/esm/render/ScreenSpaceEffectBuilder.d.ts +1 -1
- package/lib/esm/render/ScreenSpaceEffectBuilder.js.map +1 -1
- package/lib/esm/request/Request.d.ts +2 -2
- package/lib/esm/request/Request.js.map +1 -1
- package/lib/esm/tile/RealityTile.d.ts +5 -0
- package/lib/esm/tile/RealityTile.d.ts.map +1 -1
- package/lib/esm/tile/RealityTile.js +4 -0
- package/lib/esm/tile/RealityTile.js.map +1 -1
- package/lib/esm/tile/Tile.d.ts +1 -1
- package/lib/esm/tile/Tile.d.ts.map +1 -1
- package/lib/esm/tile/Tile.js +1 -1
- package/lib/esm/tile/Tile.js.map +1 -1
- package/lib/esm/tile/TileAdmin.d.ts +23 -1
- package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
- package/lib/esm/tile/TileAdmin.js +17 -1
- package/lib/esm/tile/TileAdmin.js.map +1 -1
- package/lib/esm/tile/TileTree.d.ts +1 -1
- package/lib/esm/tile/TileTree.d.ts.map +1 -1
- package/lib/esm/tile/TileTree.js +1 -1
- package/lib/esm/tile/TileTree.js.map +1 -1
- package/lib/esm/tile/TileTreeReference.d.ts +1 -1
- package/lib/esm/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/esm/tile/TileTreeReference.js +1 -1
- package/lib/esm/tile/TileTreeReference.js.map +1 -1
- package/lib/esm/tile/map/BingElevation.d.ts +16 -4
- package/lib/esm/tile/map/BingElevation.d.ts.map +1 -1
- package/lib/esm/tile/map/BingElevation.js +18 -8
- package/lib/esm/tile/map/BingElevation.js.map +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.d.ts +16 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.js +56 -18
- package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.d.ts +2 -2
- package/lib/esm/tile/map/ImageryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js +2 -2
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +6 -1
- 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 +1 -0
- package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.js +3 -0
- package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +21 -10
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tile/map/TerrainMeshProvider.d.ts +7 -1
- package/lib/esm/tile/map/TerrainMeshProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/TerrainMeshProvider.js +1 -1
- package/lib/esm/tile/map/TerrainMeshProvider.js.map +1 -1
- package/lib/esm/tools/AccuDrawShortcutTool.d.ts +29 -0
- package/lib/esm/tools/AccuDrawShortcutTool.d.ts.map +1 -0
- package/lib/esm/tools/AccuDrawShortcutTool.js +134 -0
- package/lib/esm/tools/AccuDrawShortcutTool.js.map +1 -0
- package/lib/esm/tools/AccuDrawTool.d.ts +13 -68
- package/lib/esm/tools/AccuDrawTool.d.ts.map +1 -1
- package/lib/esm/tools/AccuDrawTool.js +102 -128
- package/lib/esm/tools/AccuDrawTool.js.map +1 -1
- package/lib/esm/tools/SetupCameraTools.d.ts +89 -0
- package/lib/esm/tools/SetupCameraTools.d.ts.map +1 -0
- package/lib/esm/tools/SetupCameraTools.js +439 -0
- package/lib/esm/tools/SetupCameraTools.js.map +1 -0
- package/lib/esm/tools/ToolAdmin.d.ts +5 -2
- package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +30 -7
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/tools/ViewTool.d.ts +1 -81
- package/lib/esm/tools/ViewTool.d.ts.map +1 -1
- package/lib/esm/tools/ViewTool.js +14 -409
- package/lib/esm/tools/ViewTool.js.map +1 -1
- package/lib/public/locales/en/iModelJs.json +2 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +24 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileTree.js","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmF;AAGnF,oEAAgF;AAChF,4CAAyC;AAMzC;;;;GAIG;AACH,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,0DAA0D;IAC1D,qEAAS,CAAA;IACT,uDAAuD;IACvD,iEAAO,CAAA;IACP,kDAAkD;IAClD,+DAAM,CAAA;IACN,+CAA+C;IAC/C,mEAAQ,CAAA;AACV,CAAC,EATW,kBAAkB,kCAAlB,kBAAkB,QAS7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAsB,QAAQ;IACpB,WAAW,GAAG,KAAK,CAAC;IAC5B,gBAAgB;IACN,aAAa,GAAG,0BAAW,CAAC,GAAG,EAAE,CAAC;IAC5C,gBAAgB;IACN,WAAW,CAAoB;IACzB,MAAM,CAAmB;IACzC,yFAAyF;IACzE,eAAe,CAAY;IAC3C,2FAA2F;IAC3E,EAAE,CAAS;IAC3B;;;OAGG;IACa,OAAO,CAAa;IACpC,qIAAqI;IACrH,cAAc,CAAa;IAC3C,gBAAgB;IAChB,IAAW,YAAY,KAAuB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACzD,aAAa,CAAmB;IACjD,0FAA0F;IAC1E,YAAY,CAAuB;IAYnD,kGAAkG;IAClG,IAAW,kBAAkB;QAC3B,OAAO,KAAK,CAAC;IACf,CA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3B,OAAO,SAAS,CAAC;QAEnB,IAAI,QAA+B,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;QACjE,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACrD,MAAM,QAAQ,GAAG,MAAM,IAAA,4DAAoC,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACjF,QAAQ,GAAG,QAAQ,EAAE,OAAO,EAAE,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,QAAQ;YACX,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;QAErD,OAAO,QAAQ,CAAC,0BAA0B,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,UAAiC;IAC5D,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,wBAAwB,CAAC,QAAyC,IAAkB,CAAC;IAClG;;;;OAIG;IACI,0BAA0B,KAAU,CAAC;CAC7C;AAzKD,4BAyKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\n\nimport { BeDuration, BeTimePoint, dispose, Id64String } from \"@itwin/core-bentley\";\nimport { Matrix4d, Range3d, Transform } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d, FrustumPlanes, RenderSchedule, ViewFlagOverrides } from \"@itwin/core-common\";\nimport { calculateEcefToDbTransformAtLocation } from \"../BackgroundMapGeometry\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\nimport { RenderMemory } from \"../render/RenderMemory\";\nimport { LayerTileTreeHandler, Tile, TileDrawArgs, TileGeometryCollector, TileLoadPriority, TileTreeParams } from \"./internal\";\n\n/** Describes the current state of a [[TileTree]]. TileTrees are loaded asynchronously and may be unloaded after a period of disuse.\n * @see [[TileTreeOwner]].\n * @public\n * @extensions\n */\nexport enum TileTreeLoadStatus {\n /** No attempt to load the tile tree has yet been made. */\n NotLoaded,\n /** The tile tree is in the process of being loaded. */\n Loading,\n /** The tile tree has been successfully loaded. */\n Loaded,\n /** An attempt to load the tile tree failed. */\n NotFound,\n}\n\n/** A hierarchical level-of-detail tree of [3d Tiles](https://github.com/CesiumGS/3d-tiles) to be rendered in a [[Viewport]].\n * Tile trees originate from a variety of sources:\n * - Each [[GeometricModelState]] can supply its graphics as a tile tree;\n * - A [[DisplayStyleState]]'s map settings or reality models;\n * - [ViewAttachment]($backend)s in a [[SheetModelState]];\n * - [[TiledGraphicsProvider]]s associated with a viewport.\n *\n * The same TileTree can be displayed in any number of viewports using multiple [[TileTreeReference]]s.\n * A TileTree's lifetime is managed by a [[TileTreeOwner]].\n *\n * @note Some methods carry a warning that they should **not** be overridden by subclasses; typically a protected method exists that can be\n * overridden instead to customize the behavior. For example, [[selectTiles]] should not be overridden; instead, override the[[_selectTiles]] method\n * that it calls.\n * @public\n * @extensions\n */\nexport abstract class TileTree {\n private _isDisposed = false;\n /** @internal */\n protected _lastSelected = BeTimePoint.now();\n /** @internal */\n protected _clipVolume?: RenderClipVolume;\n public readonly iModel: IModelConnection;\n /** Transform from this tile tree's coordinate space to the iModel's coordinate space. */\n public readonly iModelTransform: Transform;\n /** Uniquely identifies this tree among all other tile trees associated with the iModel. */\n public readonly id: string;\n /** A 64-bit identifier for this tile tree, unique within the context of its [[IModelConnection]].\n * For a tile tree associated with a [[GeometricModelState]], this is the Id of the model. Other types of tile trees\n * typically use a transient Id obtained from [[IModelConnection.transientIds]].\n */\n public readonly modelId: Id64String;\n /** The length of time after which tiles belonging to this tree are considered elegible for disposal if they are no longer in use. */\n public readonly expirationTime: BeDuration;\n /** @internal */\n public get loadPriority(): TileLoadPriority { return this._loadPriority; }\n private readonly _loadPriority: TileLoadPriority;\n /** Optional tight bounding box around the entire contents of all of this tree's tiles. */\n public readonly contentRange?: ElementAlignedBox3d;\n\n /** The lowest-resolution tile in this tree. */\n public abstract get rootTile(): Tile;\n /** True if this tile tree contains 3d graphics. */\n public abstract get is3d(): boolean;\n /** Returns the maximum depth of this tree, if any. */\n public abstract get maxDepth(): number | undefined;\n\n /** The overrides that should be applied to the view's [ViewFlags]($common) when this tile tree is drawn. Can be overridden by individual [[TileTreeReference]]s. */\n public abstract get viewFlagOverrides(): ViewFlagOverrides;\n\n /** True if this tile tree has no bounds - e.g., a tile tree representing a globe is unbounded. */\n public get isContentUnbounded(): boolean {\n return false;\n }\n\n /** Implement this method to select tiles of appropriate resolution. */\n protected abstract _selectTiles(args: TileDrawArgs): Tile[];\n\n /** Produce graphics of appropriate resolution to be drawn in a [[Viewport]]. */\n public abstract draw(args: TileDrawArgs): void;\n\n /** Discard tiles and/or tile contents, presumably based on a least-recently-used and/or least-likely-to-be-needed criterion. */\n public abstract prune(): void;\n\n /** True if this tile tree contains 2d graphics. */\n public get is2d(): boolean { return !this.is3d; }\n /** @internal */\n public get isPointCloud(): boolean { return false; }\n /** @internal */\n public get clipVolume(): RenderClipVolume | undefined { return this._clipVolume; }\n\n /** The volume of space occupied by this tile tree. */\n public get range(): ElementAlignedBox3d { return this.rootTile.range; }\n /** The most recent time at which tiles [[selectTiles]] was called. */\n public get lastSelectedTime(): BeTimePoint { return this._lastSelected; }\n /** True if a tile and its child tiles should not be drawn simultaneously.\n * Default: true.\n */\n public get parentsAndChildrenExclusive(): boolean { return true; }\n\n /** @internal */\n public get layerHandler(): LayerTileTreeHandler | undefined { return undefined; }\n\n /** Constructor */\n protected constructor(params: TileTreeParams) {\n this._lastSelected = BeTimePoint.now();\n this.iModel = params.iModel;\n this.iModelTransform = params.location;\n this._clipVolume = params.clipVolume;\n this.modelId = params.modelId;\n this.id = params.id;\n this.contentRange = params.contentRange;\n\n const admin = IModelApp.tileAdmin;\n this._loadPriority = params.priority;\n this.expirationTime = params.expirationTime ?? admin.tileExpirationTime;\n }\n\n /** Selects tiles of appropriate resolution for some purpose like drawing to the screen, producing a shadow map, etc.\n * @note Do **not** override this method. Implement [[_selectTiles]].\n */\n public selectTiles(args: TileDrawArgs): Tile[] {\n this._lastSelected = BeTimePoint.now();\n const tiles = this._selectTiles(args);\n IModelApp.tileAdmin.addTilesForUser(args.context.viewport, tiles, args.readyTiles, args.touchedTiles);\n args.processSelectedTiles(tiles);\n return tiles;\n }\n\n /** True if [[dispose]] has been called on this tile tree. */\n public get isDisposed(): boolean { return this._isDisposed; }\n\n /** Dispose of this tree and any resources owned by it. This is typically invoked by a [[TileTreeOwner]]. */\n public [Symbol.dispose](): void {\n if (this.isDisposed)\n return;\n\n this._isDisposed = true;\n dispose(this.rootTile);\n }\n\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */\n public dispose() {\n this[Symbol.dispose]();\n }\n\n /** @internal */\n public collectStatistics(stats: RenderMemory.Statistics): void {\n this.rootTile.collectStatistics(stats);\n }\n\n /** Returns the number of [[Tile]]s currently in memory belonging to this tree, primarily for debugging. */\n public countTiles(): number {\n return 1 + this.rootTile.countDescendants();\n }\n\n /** @internal */\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, location: Transform, frustumPlanes?: FrustumPlanes): void {\n this.rootTile.extendRangeForContent(range, matrix, location, frustumPlanes);\n }\n\n /**\n * Return the transform from the tile tree's coordinate space to [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates.\n * If a geographic coordinate system is present then this transform will be calculated at the tile tree center.\n * @beta\n */\n public async getEcefTransform(): Promise<Transform | undefined> {\n if (!this.iModel.ecefLocation)\n return undefined;\n\n let dbToEcef: Transform | undefined;\n const range = this.contentRange ? this.contentRange : this.range;\n const center = range.localXYZToWorld(.5, .5, .5);\n if (center) {\n this.iModelTransform.multiplyPoint3d(center, center);\n const ecefToDb = await calculateEcefToDbTransformAtLocation(center, this.iModel);\n dbToEcef = ecefToDb?.inverse();\n }\n if (!dbToEcef)\n dbToEcef = this.iModel.ecefLocation.getTransform();\n\n return dbToEcef.multiplyTransformTransform(this.iModelTransform);\n }\n\n /** Populate [[TileGeometryCollector.polyfaces]] with geometry obtained from this tile tree's tiles satisfying the collector's criteria.\n * The base implementation does nothing.\n * @see [[TileTreeReference.createGeometryTreeReference]] to attempt to create a TileTree that can collect geometry.\n * @beta\n */\n public collectTileGeometry(_collector: TileGeometryCollector): void {\n }\n\n /**\n * Invoked when a schedule script is edited.\n * Override to handle updates for affected elements or timelines.\n *\n * @internal\n */\n public async onScheduleEditingChanged(_changes: RenderSchedule.EditingChanges[]): Promise<void> {}\n /**\n * Invoked when a schedule script is committed during editing.\n * Override in specific tile tree types to handle the change.\n * @internal\n */\n public onScheduleEditingCommitted(): void {}\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"TileTree.js","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmF;AAGnF,oEAAgF;AAChF,4CAAyC;AAMzC;;;;GAIG;AACH,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,0DAA0D;IAC1D,qEAAS,CAAA;IACT,uDAAuD;IACvD,iEAAO,CAAA;IACP,kDAAkD;IAClD,+DAAM,CAAA;IACN,+CAA+C;IAC/C,mEAAQ,CAAA;AACV,CAAC,EATW,kBAAkB,kCAAlB,kBAAkB,QAS7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAsB,QAAQ;IACpB,WAAW,GAAG,KAAK,CAAC;IA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,wBAAwB,CAAC,QAAyC,IAAkB,CAAC;IAClG;;;;OAIG;IACI,0BAA0B,KAAU,CAAC;CAC7C;AAzKD,4BAyKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\n\nimport { BeDuration, BeTimePoint, dispose, Id64String } from \"@itwin/core-bentley\";\nimport { Matrix4d, Range3d, Transform } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d, FrustumPlanes, RenderSchedule, ViewFlagOverrides } from \"@itwin/core-common\";\nimport { calculateEcefToDbTransformAtLocation } from \"../BackgroundMapGeometry\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\nimport { RenderMemory } from \"../render/RenderMemory\";\nimport { LayerTileTreeHandler, Tile, TileDrawArgs, TileGeometryCollector, TileLoadPriority, TileTreeParams } from \"./internal\";\n\n/** Describes the current state of a [[TileTree]]. TileTrees are loaded asynchronously and may be unloaded after a period of disuse.\n * @see [[TileTreeOwner]].\n * @public\n * @extensions\n */\nexport enum TileTreeLoadStatus {\n /** No attempt to load the tile tree has yet been made. */\n NotLoaded,\n /** The tile tree is in the process of being loaded. */\n Loading,\n /** The tile tree has been successfully loaded. */\n Loaded,\n /** An attempt to load the tile tree failed. */\n NotFound,\n}\n\n/** A hierarchical level-of-detail tree of [3d Tiles](https://github.com/CesiumGS/3d-tiles) to be rendered in a [[Viewport]].\n * Tile trees originate from a variety of sources:\n * - Each [[GeometricModelState]] can supply its graphics as a tile tree;\n * - A [[DisplayStyleState]]'s map settings or reality models;\n * - [ViewAttachment]($backend)s in a [[SheetModelState]];\n * - [[TiledGraphicsProvider]]s associated with a viewport.\n *\n * The same TileTree can be displayed in any number of viewports using multiple [[TileTreeReference]]s.\n * A TileTree's lifetime is managed by a [[TileTreeOwner]].\n *\n * @note Some methods carry a warning that they should **not** be overridden by subclasses; typically a protected method exists that can be\n * overridden instead to customize the behavior. For example, [[selectTiles]] should not be overridden; instead, override the[[_selectTiles]] method\n * that it calls.\n * @public\n * @extensions\n */\nexport abstract class TileTree {\n private _isDisposed = false;\n /** @internal */\n protected _lastSelected = BeTimePoint.now();\n /** @internal */\n protected _clipVolume?: RenderClipVolume;\n public readonly iModel: IModelConnection;\n /** Transform from this tile tree's coordinate space to the iModel's coordinate space. */\n public readonly iModelTransform: Transform;\n /** Uniquely identifies this tree among all other tile trees associated with the iModel. */\n public readonly id: string;\n /** A 64-bit identifier for this tile tree, unique within the context of its [[IModelConnection]].\n * For a tile tree associated with a [[GeometricModelState]], this is the Id of the model. Other types of tile trees\n * typically use a transient Id obtained from [[IModelConnection.transientIds]].\n */\n public readonly modelId: Id64String;\n /** The length of time after which tiles belonging to this tree are considered elegible for disposal if they are no longer in use. */\n public readonly expirationTime: BeDuration;\n /** @internal */\n public get loadPriority(): TileLoadPriority { return this._loadPriority; }\n private readonly _loadPriority: TileLoadPriority;\n /** Optional tight bounding box around the entire contents of all of this tree's tiles. */\n public readonly contentRange?: ElementAlignedBox3d;\n\n /** The lowest-resolution tile in this tree. */\n public abstract get rootTile(): Tile;\n /** True if this tile tree contains 3d graphics. */\n public abstract get is3d(): boolean;\n /** Returns the maximum depth of this tree, if any. */\n public abstract get maxDepth(): number | undefined;\n\n /** The overrides that should be applied to the view's [ViewFlags]($common) when this tile tree is drawn. Can be overridden by individual [[TileTreeReference]]s. */\n public abstract get viewFlagOverrides(): ViewFlagOverrides;\n\n /** True if this tile tree has no bounds - e.g., a tile tree representing a globe is unbounded. */\n public get isContentUnbounded(): boolean {\n return false;\n }\n\n /** Implement this method to select tiles of appropriate resolution. */\n protected abstract _selectTiles(args: TileDrawArgs): Tile[];\n\n /** Produce graphics of appropriate resolution to be drawn in a [[Viewport]]. */\n public abstract draw(args: TileDrawArgs): void;\n\n /** Discard tiles and/or tile contents, presumably based on a least-recently-used and/or least-likely-to-be-needed criterion. */\n public abstract prune(): void;\n\n /** True if this tile tree contains 2d graphics. */\n public get is2d(): boolean { return !this.is3d; }\n /** @internal */\n public get isPointCloud(): boolean { return false; }\n /** @internal */\n public get clipVolume(): RenderClipVolume | undefined { return this._clipVolume; }\n\n /** The volume of space occupied by this tile tree. */\n public get range(): ElementAlignedBox3d { return this.rootTile.range; }\n /** The most recent time at which tiles [[selectTiles]] was called. */\n public get lastSelectedTime(): BeTimePoint { return this._lastSelected; }\n /** True if a tile and its child tiles should not be drawn simultaneously.\n * Default: true.\n */\n public get parentsAndChildrenExclusive(): boolean { return true; }\n\n /** @internal */\n public get layerHandler(): LayerTileTreeHandler | undefined { return undefined; }\n\n /** Constructor */\n protected constructor(params: TileTreeParams) {\n this._lastSelected = BeTimePoint.now();\n this.iModel = params.iModel;\n this.iModelTransform = params.location;\n this._clipVolume = params.clipVolume;\n this.modelId = params.modelId;\n this.id = params.id;\n this.contentRange = params.contentRange;\n\n const admin = IModelApp.tileAdmin;\n this._loadPriority = params.priority;\n this.expirationTime = params.expirationTime ?? admin.tileExpirationTime;\n }\n\n /** Selects tiles of appropriate resolution for some purpose like drawing to the screen, producing a shadow map, etc.\n * @note Do **not** override this method. Implement [[_selectTiles]].\n */\n public selectTiles(args: TileDrawArgs): Tile[] {\n this._lastSelected = BeTimePoint.now();\n const tiles = this._selectTiles(args);\n IModelApp.tileAdmin.addTilesForUser(args.context.viewport, tiles, args.readyTiles, args.touchedTiles);\n args.processSelectedTiles(tiles);\n return tiles;\n }\n\n /** True if [[dispose]] has been called on this tile tree. */\n public get isDisposed(): boolean { return this._isDisposed; }\n\n /** Dispose of this tree and any resources owned by it. This is typically invoked by a [[TileTreeOwner]]. */\n public [Symbol.dispose](): void {\n if (this.isDisposed)\n return;\n\n this._isDisposed = true;\n dispose(this.rootTile);\n }\n\n /** @deprecated in 5.0 - might be removed in next major version. Use [Symbol.dispose] instead. */\n public dispose() {\n this[Symbol.dispose]();\n }\n\n /** @internal */\n public collectStatistics(stats: RenderMemory.Statistics): void {\n this.rootTile.collectStatistics(stats);\n }\n\n /** Returns the number of [[Tile]]s currently in memory belonging to this tree, primarily for debugging. */\n public countTiles(): number {\n return 1 + this.rootTile.countDescendants();\n }\n\n /** @internal */\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, location: Transform, frustumPlanes?: FrustumPlanes): void {\n this.rootTile.extendRangeForContent(range, matrix, location, frustumPlanes);\n }\n\n /**\n * Return the transform from the tile tree's coordinate space to [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates.\n * If a geographic coordinate system is present then this transform will be calculated at the tile tree center.\n * @beta\n */\n public async getEcefTransform(): Promise<Transform | undefined> {\n if (!this.iModel.ecefLocation)\n return undefined;\n\n let dbToEcef: Transform | undefined;\n const range = this.contentRange ? this.contentRange : this.range;\n const center = range.localXYZToWorld(.5, .5, .5);\n if (center) {\n this.iModelTransform.multiplyPoint3d(center, center);\n const ecefToDb = await calculateEcefToDbTransformAtLocation(center, this.iModel);\n dbToEcef = ecefToDb?.inverse();\n }\n if (!dbToEcef)\n dbToEcef = this.iModel.ecefLocation.getTransform();\n\n return dbToEcef.multiplyTransformTransform(this.iModelTransform);\n }\n\n /** Populate [[TileGeometryCollector.polyfaces]] with geometry obtained from this tile tree's tiles satisfying the collector's criteria.\n * The base implementation does nothing.\n * @see [[TileTreeReference.createGeometryTreeReference]] to attempt to create a TileTree that can collect geometry.\n * @beta\n */\n public collectTileGeometry(_collector: TileGeometryCollector): void {\n }\n\n /**\n * Invoked when a schedule script is edited.\n * Override to handle updates for affected elements or timelines.\n *\n * @internal\n */\n public async onScheduleEditingChanged(_changes: RenderSchedule.EditingChanges[]): Promise<void> {}\n /**\n * Invoked when a schedule script is committed during editing.\n * Override in specific tile tree types to handle the change.\n * @internal\n */\n public onScheduleEditingCommitted(): void {}\n}\n\n"]}
|
|
@@ -133,7 +133,7 @@ export declare abstract class TileTreeReference {
|
|
|
133
133
|
* @beta
|
|
134
134
|
*/
|
|
135
135
|
get planarClipMaskPriority(): number;
|
|
136
|
-
/** @deprecated in 5.0 -
|
|
136
|
+
/** @deprecated in 5.0 - might be removed in next major version. Use [addAttributions] instead. */
|
|
137
137
|
addLogoCards(_cards: HTMLTableElement, _vp: ScreenViewport): void;
|
|
138
138
|
/** Add attribution logo cards for the tile tree source logo cards to the viewport's logo div.
|
|
139
139
|
* @beta
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileTreeReference.d.ts","sourceRoot":"","sources":["../../../src/tile/TileTreeReference.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,aAAa,EAAE,UAAU,EAA0B,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1J,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,oBAAoB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,YAAY,EAAE,qBAAqB,EAAE,QAAQ,EAAsB,aAAa,EACzM,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,oBAAY,eAAe;IACzB,wDAAwD;IACxD,aAAa,IAAI;IACjB,2CAA2C;IAC3C,KAAK,IAAI;IACT,+CAA+C;IAC/C,OAAO,IAAI;CACZ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AatE;;;;OAIG;IACI,2BAA2B,CAAC,OAAO,CAAC,EAAE,gCAAgC,GAAG,yBAAyB,GAAG,SAAS;IAWrH;;;;;;;;;;;;;;OAcG;WACW,uBAAuB,CAAC,IAAI,EAAE,yBAAyB,GAAG,iBAAiB;CAG1F;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -223,7 +223,7 @@ class TileTreeReference /* implements RenderMemory.Consumer */ {
|
|
|
223
223
|
* @beta
|
|
224
224
|
*/
|
|
225
225
|
get planarClipMaskPriority() { return core_common_1.PlanarClipMaskPriority.DesignModel; }
|
|
226
|
-
/** @deprecated in 5.0 -
|
|
226
|
+
/** @deprecated in 5.0 - might be removed in next major version. Use [addAttributions] instead. */
|
|
227
227
|
addLogoCards(_cards, _vp) { }
|
|
228
228
|
/** Add attribution logo cards for the tile tree source logo cards to the viewport's logo div.
|
|
229
229
|
* @beta
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileTreeReference.js","sourceRoot":"","sources":["../../../src/tile/TileTreeReference.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA0D;AAC1D,wDAA6E;AAC7E,oDAA0J;AAO1J,yCAEoB;AAEpB;;;GAGG;AACH,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,wDAAwD;IACxD,uEAAiB,CAAA;IACjB,2CAA2C;IAC3C,uDAAS,CAAA;IACT,+CAA+C;IAC/C,2DAAW,CAAA;AACb,CAAC,EAPW,eAAe,+BAAf,eAAe,QAO1B;AAED;;;;;;;;;;GAUG;AACH,MAAsB,iBAAiB,CAAC,sCAAsC;IAI5E;;OAEG;IACI,iBAAiB,CAAW;IAEnC;;OAEG;IACI,cAAc,KAAI,CAAC;IAE1B;;;OAGG;IACI,iBAAiB,CAAC,KAA2B;QAClD,MAAM,IAAI,GAAG,IAAI,CAAC,SA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IACO,oBAAoB,CAAC,SAAgC;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnC,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;YAClC,KAAK,6BAAkB,CAAC,MAAM;gBAC5B,IAAA,qBAAM,EAAC,SAAS,KAAK,IAAI,CAAC,CAAC;gBAC3B,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBACpC,MAAM;YACR,KAAK,6BAAkB,CAAC,OAAO;gBAC7B,SAAS,CAAC,WAAW,EAAE,CAAC;gBACxB,MAAM;QACV,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,2BAA2B,CAAC,OAA0C;QAC3E,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC7B,0KAA0K;YAC1K,MAAM,GAAG,GAAG,IAAiC,CAAC;YAC9C,GAAG,CAAC,iBAAiB,GAAG,OAAO,EAAE,iBAAiB,CAAC;YACnD,OAAO,GAAG,CAAC;QACb,CAAC;QAED,OAAO,IAAI,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACI,MAAM,CAAC,uBAAuB,CAAC,IAA+B;QACnE,OAAO,IAAA,6CAAkC,EAAC,IAAI,CAAC,CAAC;IAClD,CAAC;CACF;AAvSD,8CAuSC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\n\nimport { assert, BeTimePoint } from \"@itwin/core-bentley\";\nimport { Matrix4d, Range1d, Range3d, Transform } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d, FeatureAppearanceProvider, FrustumPlanes, HiddenLine, PlanarClipMaskPriority, ViewFlagOverrides } from \"@itwin/core-common\";\nimport { HitDetail } from \"../HitDetail\";\nimport { FeatureSymbology } from \"../render/FeatureSymbology\";\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\nimport { RenderMemory } from \"../render/RenderMemory\";\nimport { DecorateContext, SceneContext } from \"../ViewContext\";\nimport { ScreenViewport } from \"../Viewport\";\nimport {\n DisclosedTileTreeSet, GeometryTileTreeReference, MapFeatureInfoOptions, MapLayerFeatureInfo, RenderGraphicTileTreeArgs, TileDrawArgs, TileGeometryCollector, TileTree, TileTreeLoadStatus, TileTreeOwner, tileTreeReferenceFromRenderGraphic,\n} from \"./internal\";\n\n/** Describes the type of graphics produced by a [[TileTreeReference]].\n * @public\n * @extensions\n */\nexport enum TileGraphicType {\n /** Rendered behind all other geometry without depth. */\n BackgroundMap = 0,\n /** Rendered with normal scene graphics. */\n Scene = 1,\n /** Rendered in front of all other geometry. */\n Overlay = 2,\n}\n\n/** A reference to a [[TileTree]] suitable for drawing within a [[Viewport]]. The reference does not *own* its tile tree - it merely refers to it by\n * way of the tree's [[TileTreeOwner]].\n * The specific [[TileTree]] referenced by this object may change based on the current state of the Viewport in which it is drawn - for example,\n * as a result of changing the RenderMode, or animation settings, or classification settings, etc.\n * A reference to a TileTree is typically associated with a [[ViewState]], a [[DisplayStyleState]], or a [[Viewport]].\n * Multiple TileTreeReferences can refer to the same TileTree with different parameters and logic - for example, the same background map tiles can be displayed in two viewports with\n * differing levels of transparency.\n * @see [[TiledGraphicsProvider]] to supply custom [[TileTreeReference]]s to be drawn within a [[Viewport]].\n * @public\n * @extensions\n */\nexport abstract class TileTreeReference /* implements RenderMemory.Consumer */ {\n /** The owner of the currently-referenced [[TileTree]]. Do not store a direct reference to it, because it may change or become disposed at any time. */\n public abstract get treeOwner(): TileTreeOwner;\n\n /** If set to true, tile geometry will be reprojected using the tile's reprojection transform when geometry is collected from the referenced TileTree.\n * @internal\n */\n public reprojectGeometry?: boolean;\n\n /** Force a new tree owner / tile tree to be created for the current tile tree reference\n * @internal\n */\n public resetTreeOwner() {}\n\n /** Disclose *all* TileTrees use by this reference. This may include things like map tiles used for draping on terrain.\n * Override this and call super if you have such auxiliary trees.\n * @note Any tree *NOT* disclosed becomes a candidate for *purging* (being unloaded from memory along with all of its tiles and graphics).\n */\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n const tree = this.treeOwner.tileTree;\n if (undefined !== tree)\n trees.add(tree);\n }\n\n /** Adds this reference's graphics to the scene. By default this invokes [[draw]]. */\n public addToScene(context: SceneContext): void {\n const args = this.createDrawArgs(context);\n if (undefined !== args)\n this.draw(args);\n }\n\n /** Adds this reference's graphics to the scene. By default this invokes [[TileTree.draw]] on the referenced TileTree, if it is loaded. */\n public draw(args: TileDrawArgs): void {\n args.tree.draw(args);\n }\n\n /** Return a tooltip describing the hit, or `undefined` if no tooltip can be supplied.\n * If you override this method, make sure to check that `hit` represents an entity belonging to your tile tree, e.g., by checking `hit.modelId` and `hit.sourceId`.\n * If you *don't* override this method, override [[canSupplyToolTip]] to return false.\n * Callers who want to obtain a tooltip should prefer [[getToolTipPromise]].\n */\n public async getToolTip(_hit: HitDetail): Promise<HTMLElement | string | undefined> { return undefined; }\n\n /** Return whether this TileTreeReference can supply a tooltip describing the entity represented by the specified hit.\n * [[getToolTipPromise]] calls [[getToolTip]] if and only if `canSupplyToolTip` returns `true`.\n * If your tile tree never supplies tooltips, override this to return `false`.\n */\n public canSupplyToolTip(_hit: HitDetail): boolean {\n return true;\n }\n\n /** Obtain a tooltip describing the specified `hit`, or `undefined` if this tile tree reference cannot supply a tooltip for the hit. */\n public getToolTipPromise(hit: HitDetail): Promise<HTMLElement | string | undefined> | undefined {\n return this.canSupplyToolTip(hit) ? this.getToolTip(hit).catch(() => undefined) : undefined;\n }\n\n /** Optionally return a MapLayerFeatureInfo object describing the hit.].\n * @alpha\n */\n public async getMapFeatureInfo(_hit: HitDetail, _options?: MapFeatureInfoOptions): Promise<MapLayerFeatureInfo[] | undefined> { return undefined; }\n\n /** Optionally add any decorations specific to this reference. For example, map tile trees may add a logo image and/or copyright attributions.\n * @note This is currently only invoked for background maps and TiledGraphicsProviders - others have no decorations, but if they did implement this it would not be called.\n */\n public decorate(_context: DecorateContext): void { }\n\n /** Unions this reference's range with the supplied range to help compute a volume in world space for fitting a viewport to its contents.\n * Override this function if a reference's range should not be included in the fit range, or a range different from its tile tree's range should be used.\n */\n public unionFitRange(union: Range3d): void {\n const contentRange = this.computeWorldContentRange();\n if (!contentRange.isNull)\n union.extendRange(contentRange);\n }\n\n /** Record graphics memory consumed by this tile tree reference. */\n public collectStatistics(stats: RenderMemory.Statistics): void {\n const tree = this.treeOwner.tileTree;\n if (undefined !== tree)\n tree.collectStatistics(stats);\n }\n\n /** Return true if the tile tree is fully loaded and ready to draw.\n * The default implementation returns true if the tile tree loading process completed (whether it resulted in success or failure).\n * @note Do *not* override this property - override [[_isLoadingComplete]] instead..\n * @public\n */\n public get isLoadingComplete(): boolean {\n switch (this.treeOwner.loadStatus) {\n case TileTreeLoadStatus.NotLoaded:\n case TileTreeLoadStatus.Loading:\n return false;\n case TileTreeLoadStatus.NotFound:\n return true; // we tried, and failed, to load.\n case TileTreeLoadStatus.Loaded:\n return this._isLoadingComplete;\n }\n }\n\n /** Override if additional asynchronous loading is required after the tile tree is successfully loaded, to indicate when that loading has completed.\n * @public\n */\n protected get _isLoadingComplete(): boolean {\n return true;\n }\n\n /** Create context for drawing the tile tree, if it is ready for drawing.\n * TileTreeReferences can override individual portions of the context, e.g. apply their own transform.\n * Returns undefined if, e.g., the tile tree is not yet loaded.\n */\n public createDrawArgs(context: SceneContext): TileDrawArgs | undefined {\n const tree = this.treeOwner.load();\n if (undefined === tree)\n return undefined;\n\n return new TileDrawArgs({\n context,\n tree,\n now: BeTimePoint.now(),\n location: this.computeTransform(tree),\n viewFlagOverrides: this.getViewFlagOverrides(tree),\n clipVolume: this.getClipVolume(tree),\n parentsAndChildrenExclusive: tree.parentsAndChildrenExclusive,\n symbologyOverrides: this.getSymbologyOverrides(tree),\n appearanceProvider: this.getAppearanceProvider(tree),\n hiddenLineSettings: this.getHiddenLineSettings(tree),\n animationTransformNodeId: this.getAnimationTransformNodeId(tree),\n groupNodeId: this.getGroupNodeId(tree),\n transformFromIModel: this.getTransformFromIModel(),\n });\n }\n\n /** @beta */\n public getTransformFromIModel(): Transform | undefined { return undefined; }\n\n /** @internal */\n protected getAnimationTransformNodeId(_tree: TileTree): number | undefined {\n return undefined;\n }\n /** @internal */\n protected getGroupNodeId(_tree: TileTree): number | undefined {\n return undefined;\n }\n\n /** Supply transform from this tile tree reference's location to iModel coordinate space.\n * @returns undefined if the TileTree is not yet loaded.\n */\n public getLocation(): Transform | undefined {\n const tree = this.treeOwner.load();\n return undefined !== tree ? this.computeTransform(tree) : undefined;\n }\n\n /** Compute a transform from this tile tree reference's coordinate space to the [[IModelConnection]]'s coordinate space. */\n protected computeTransform(tree: TileTree): Transform {\n return tree.iModelTransform.clone();\n }\n\n /** Compute the range of this tile tree's contents in world coordinates.\n * @returns The content range in world coodinates, or a null range if the tile tree is not loaded or has a null content range.\n */\n public computeWorldContentRange(): ElementAlignedBox3d {\n const range = new Range3d();\n const tree = this.treeOwner.tileTree;\n if (undefined !== tree && !tree.rootTile.contentRange.isNull)\n this.computeTransform(tree).multiplyRange(tree.rootTile.contentRange, range);\n\n return range;\n }\n\n /** Return the clip volume applied to this reference's tile tree, if any. */\n protected getClipVolume(tree: TileTree): RenderClipVolume | undefined {\n return tree.clipVolume;\n }\n\n /** Supply overrides that should be applied to the [[ViewState]]'s [ViewFlags]($common) when drawing this tile tree reference. */\n protected getViewFlagOverrides(tree: TileTree): ViewFlagOverrides {\n return tree.viewFlagOverrides;\n }\n\n /** Return overrides that *replace* any defined for the view. */\n protected getSymbologyOverrides(_tree: TileTree): FeatureSymbology.Overrides | undefined {\n return undefined;\n }\n\n /** Return a provider that can supplement the view's symbology overrides. */\n protected getAppearanceProvider(_tree: TileTree): FeatureAppearanceProvider | undefined {\n return undefined;\n }\n\n /** Return hidden line settings to replace those defined for the view. */\n protected getHiddenLineSettings(_tree: TileTree): HiddenLine.Settings | undefined {\n return undefined;\n }\n\n /* Extend range to include transformed range of this tile tree.\n * @internal\n */\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, frustumPlanes?: FrustumPlanes) {\n const tree = this.treeOwner.tileTree;\n if (undefined === tree)\n return;\n\n const location = this.computeTransform(tree);\n tree.accumulateTransformedRange(range, matrix, location, frustumPlanes);\n }\n\n /** @internal */\n public getTerrainHeight(_terrainHeights: Range1d): void { }\n\n /** Return whether the geometry exposed by this tile tree reference should cast shadows on other geometry. */\n public get castsShadows(): boolean {\n return true;\n }\n\n /** Return whether this reference has global coverage. Mapping data is global and some non-primary models such as the OSM building layer have global coverage */\n public get isGlobal(): boolean { return false; }\n\n /** The [PlanarClipMaskPriority]($common) of this tile tree used to determine which tile trees contribute to a clip mask when\n * using [PlanarClipMaskMode.Priority]($common).\n * @beta\n */\n public get planarClipMaskPriority(): number { return PlanarClipMaskPriority.DesignModel; }\n\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [addAttributions] instead. */\n public addLogoCards(_cards: HTMLTableElement, _vp: ScreenViewport): void { }\n\n /** Add attribution logo cards for the tile tree source logo cards to the viewport's logo div.\n * @beta\n */\n public async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return Promise.resolve(this.addLogoCards(cards, vp));\n }\n\n /** Create a tile tree reference equivalent to this one that also supplies an implementation of [[GeometryTileTreeReference.collectTileGeometry]].\n * Return `undefined` if geometry collection is not supported.\n * @see [[createGeometryTreeReference]].\n */\n protected _createGeometryTreeReference(_options?: GeometryTileTreeReferenceOptions): GeometryTileTreeReference | undefined {\n return undefined;\n }\n\n /** If defined, supplies the implementation of [[GeometryTileTreeReference.collectTileGeometry]].\n */\n public collectTileGeometry?: (collector: TileGeometryCollector) => void;\n\n /** A function that can be assigned to [[collectTileGeometry]] to enable geometry collection for references to tile trees that support geometry collection.\n */\n protected _collectTileGeometry(collector: TileGeometryCollector): void {\n const tree = this.treeOwner.load();\n switch (this.treeOwner.loadStatus) {\n case TileTreeLoadStatus.Loaded:\n assert(undefined !== tree);\n tree.collectTileGeometry(collector);\n break;\n case TileTreeLoadStatus.Loading:\n collector.markLoading();\n break;\n }\n }\n\n /** Obtain a tile tree reference equivalent to this one that also supplies an implementation of [[GeometryTileTreeReference.collectTileGeometry]], or\n * undefined if geometry collection is not supported.\n * Currently, only terrain and reality model tiles support geometry collection.\n * @note Do not override this method - override [[_createGeometryTreeReference]] instead.\n */\n public createGeometryTreeReference(options?: GeometryTileTreeReferenceOptions): GeometryTileTreeReference | undefined {\n if (this.collectTileGeometry) {\n // Unclear why compiler doesn't detect that `this` satisfies the GeometryTileTreeReference interface...it must be looking only at the types, not this particular instance.\n const ref = this as GeometryTileTreeReference;\n ref.reprojectGeometry = options?.reprojectGeometry;\n return ref;\n }\n\n return this._createGeometryTreeReference(options);\n }\n\n /** Create a [[TileTreeReference]] that displays a pre-defined [[RenderGraphic]].\n * The reference can be used to add dynamic content to a [[Viewport]]'s scene as a [[TiledGraphicsProvider]], as in the following example:\n * ```ts\n * [[include:TileTreeReference_createFromRenderGraphic]]\n *```\n * Or, it can be used as a [[DynamicSpatialClassifier]] to contextualize a reality model, like so:\n * ```ts\n * [[include:TileTreeReference_DynamicClassifier]]\n * ```\n * It can also be used to mask out portions of the background map or terrain via [PlanarClipMaskSettings]($common), as shown below:\n * ```ts\n * [[include:TileTreeReference_DynamicClipMask]]\n * ```\n * @beta\n */\n public static createFromRenderGraphic(args: RenderGraphicTileTreeArgs): TileTreeReference {\n return tileTreeReferenceFromRenderGraphic(args);\n }\n}\n\n/** Options for creating a [[GeometryTileTreeReference]].\n * @public\n */\nexport interface GeometryTileTreeReferenceOptions {\n /** If set to true, tile geometry will be reprojected using the tile's reprojection transform when geometry is collected from the referenced TileTree.\n * Currently only applies to point clouds, reality meshes, and terrain.\n * @beta\n */\n reprojectGeometry?: boolean;\n}\n"]}
|
|
1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ED,OAAO,IAAI,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACI,MAAM,CAAC,uBAAuB,CAAC,IAA+B;QACnE,OAAO,IAAA,6CAAkC,EAAC,IAAI,CAAC,CAAC;IAClD,CAAC;CACF;AAvSD,8CAuSC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\n\nimport { assert, BeTimePoint } from \"@itwin/core-bentley\";\nimport { Matrix4d, Range1d, Range3d, Transform } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d, FeatureAppearanceProvider, FrustumPlanes, HiddenLine, PlanarClipMaskPriority, ViewFlagOverrides } from \"@itwin/core-common\";\nimport { HitDetail } from \"../HitDetail\";\nimport { FeatureSymbology } from \"../render/FeatureSymbology\";\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\nimport { RenderMemory } from \"../render/RenderMemory\";\nimport { DecorateContext, SceneContext } from \"../ViewContext\";\nimport { ScreenViewport } from \"../Viewport\";\nimport {\n DisclosedTileTreeSet, GeometryTileTreeReference, MapFeatureInfoOptions, MapLayerFeatureInfo, RenderGraphicTileTreeArgs, TileDrawArgs, TileGeometryCollector, TileTree, TileTreeLoadStatus, TileTreeOwner, tileTreeReferenceFromRenderGraphic,\n} from \"./internal\";\n\n/** Describes the type of graphics produced by a [[TileTreeReference]].\n * @public\n * @extensions\n */\nexport enum TileGraphicType {\n /** Rendered behind all other geometry without depth. */\n BackgroundMap = 0,\n /** Rendered with normal scene graphics. */\n Scene = 1,\n /** Rendered in front of all other geometry. */\n Overlay = 2,\n}\n\n/** A reference to a [[TileTree]] suitable for drawing within a [[Viewport]]. The reference does not *own* its tile tree - it merely refers to it by\n * way of the tree's [[TileTreeOwner]].\n * The specific [[TileTree]] referenced by this object may change based on the current state of the Viewport in which it is drawn - for example,\n * as a result of changing the RenderMode, or animation settings, or classification settings, etc.\n * A reference to a TileTree is typically associated with a [[ViewState]], a [[DisplayStyleState]], or a [[Viewport]].\n * Multiple TileTreeReferences can refer to the same TileTree with different parameters and logic - for example, the same background map tiles can be displayed in two viewports with\n * differing levels of transparency.\n * @see [[TiledGraphicsProvider]] to supply custom [[TileTreeReference]]s to be drawn within a [[Viewport]].\n * @public\n * @extensions\n */\nexport abstract class TileTreeReference /* implements RenderMemory.Consumer */ {\n /** The owner of the currently-referenced [[TileTree]]. Do not store a direct reference to it, because it may change or become disposed at any time. */\n public abstract get treeOwner(): TileTreeOwner;\n\n /** If set to true, tile geometry will be reprojected using the tile's reprojection transform when geometry is collected from the referenced TileTree.\n * @internal\n */\n public reprojectGeometry?: boolean;\n\n /** Force a new tree owner / tile tree to be created for the current tile tree reference\n * @internal\n */\n public resetTreeOwner() {}\n\n /** Disclose *all* TileTrees use by this reference. This may include things like map tiles used for draping on terrain.\n * Override this and call super if you have such auxiliary trees.\n * @note Any tree *NOT* disclosed becomes a candidate for *purging* (being unloaded from memory along with all of its tiles and graphics).\n */\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n const tree = this.treeOwner.tileTree;\n if (undefined !== tree)\n trees.add(tree);\n }\n\n /** Adds this reference's graphics to the scene. By default this invokes [[draw]]. */\n public addToScene(context: SceneContext): void {\n const args = this.createDrawArgs(context);\n if (undefined !== args)\n this.draw(args);\n }\n\n /** Adds this reference's graphics to the scene. By default this invokes [[TileTree.draw]] on the referenced TileTree, if it is loaded. */\n public draw(args: TileDrawArgs): void {\n args.tree.draw(args);\n }\n\n /** Return a tooltip describing the hit, or `undefined` if no tooltip can be supplied.\n * If you override this method, make sure to check that `hit` represents an entity belonging to your tile tree, e.g., by checking `hit.modelId` and `hit.sourceId`.\n * If you *don't* override this method, override [[canSupplyToolTip]] to return false.\n * Callers who want to obtain a tooltip should prefer [[getToolTipPromise]].\n */\n public async getToolTip(_hit: HitDetail): Promise<HTMLElement | string | undefined> { return undefined; }\n\n /** Return whether this TileTreeReference can supply a tooltip describing the entity represented by the specified hit.\n * [[getToolTipPromise]] calls [[getToolTip]] if and only if `canSupplyToolTip` returns `true`.\n * If your tile tree never supplies tooltips, override this to return `false`.\n */\n public canSupplyToolTip(_hit: HitDetail): boolean {\n return true;\n }\n\n /** Obtain a tooltip describing the specified `hit`, or `undefined` if this tile tree reference cannot supply a tooltip for the hit. */\n public getToolTipPromise(hit: HitDetail): Promise<HTMLElement | string | undefined> | undefined {\n return this.canSupplyToolTip(hit) ? this.getToolTip(hit).catch(() => undefined) : undefined;\n }\n\n /** Optionally return a MapLayerFeatureInfo object describing the hit.].\n * @alpha\n */\n public async getMapFeatureInfo(_hit: HitDetail, _options?: MapFeatureInfoOptions): Promise<MapLayerFeatureInfo[] | undefined> { return undefined; }\n\n /** Optionally add any decorations specific to this reference. For example, map tile trees may add a logo image and/or copyright attributions.\n * @note This is currently only invoked for background maps and TiledGraphicsProviders - others have no decorations, but if they did implement this it would not be called.\n */\n public decorate(_context: DecorateContext): void { }\n\n /** Unions this reference's range with the supplied range to help compute a volume in world space for fitting a viewport to its contents.\n * Override this function if a reference's range should not be included in the fit range, or a range different from its tile tree's range should be used.\n */\n public unionFitRange(union: Range3d): void {\n const contentRange = this.computeWorldContentRange();\n if (!contentRange.isNull)\n union.extendRange(contentRange);\n }\n\n /** Record graphics memory consumed by this tile tree reference. */\n public collectStatistics(stats: RenderMemory.Statistics): void {\n const tree = this.treeOwner.tileTree;\n if (undefined !== tree)\n tree.collectStatistics(stats);\n }\n\n /** Return true if the tile tree is fully loaded and ready to draw.\n * The default implementation returns true if the tile tree loading process completed (whether it resulted in success or failure).\n * @note Do *not* override this property - override [[_isLoadingComplete]] instead..\n * @public\n */\n public get isLoadingComplete(): boolean {\n switch (this.treeOwner.loadStatus) {\n case TileTreeLoadStatus.NotLoaded:\n case TileTreeLoadStatus.Loading:\n return false;\n case TileTreeLoadStatus.NotFound:\n return true; // we tried, and failed, to load.\n case TileTreeLoadStatus.Loaded:\n return this._isLoadingComplete;\n }\n }\n\n /** Override if additional asynchronous loading is required after the tile tree is successfully loaded, to indicate when that loading has completed.\n * @public\n */\n protected get _isLoadingComplete(): boolean {\n return true;\n }\n\n /** Create context for drawing the tile tree, if it is ready for drawing.\n * TileTreeReferences can override individual portions of the context, e.g. apply their own transform.\n * Returns undefined if, e.g., the tile tree is not yet loaded.\n */\n public createDrawArgs(context: SceneContext): TileDrawArgs | undefined {\n const tree = this.treeOwner.load();\n if (undefined === tree)\n return undefined;\n\n return new TileDrawArgs({\n context,\n tree,\n now: BeTimePoint.now(),\n location: this.computeTransform(tree),\n viewFlagOverrides: this.getViewFlagOverrides(tree),\n clipVolume: this.getClipVolume(tree),\n parentsAndChildrenExclusive: tree.parentsAndChildrenExclusive,\n symbologyOverrides: this.getSymbologyOverrides(tree),\n appearanceProvider: this.getAppearanceProvider(tree),\n hiddenLineSettings: this.getHiddenLineSettings(tree),\n animationTransformNodeId: this.getAnimationTransformNodeId(tree),\n groupNodeId: this.getGroupNodeId(tree),\n transformFromIModel: this.getTransformFromIModel(),\n });\n }\n\n /** @beta */\n public getTransformFromIModel(): Transform | undefined { return undefined; }\n\n /** @internal */\n protected getAnimationTransformNodeId(_tree: TileTree): number | undefined {\n return undefined;\n }\n /** @internal */\n protected getGroupNodeId(_tree: TileTree): number | undefined {\n return undefined;\n }\n\n /** Supply transform from this tile tree reference's location to iModel coordinate space.\n * @returns undefined if the TileTree is not yet loaded.\n */\n public getLocation(): Transform | undefined {\n const tree = this.treeOwner.load();\n return undefined !== tree ? this.computeTransform(tree) : undefined;\n }\n\n /** Compute a transform from this tile tree reference's coordinate space to the [[IModelConnection]]'s coordinate space. */\n protected computeTransform(tree: TileTree): Transform {\n return tree.iModelTransform.clone();\n }\n\n /** Compute the range of this tile tree's contents in world coordinates.\n * @returns The content range in world coodinates, or a null range if the tile tree is not loaded or has a null content range.\n */\n public computeWorldContentRange(): ElementAlignedBox3d {\n const range = new Range3d();\n const tree = this.treeOwner.tileTree;\n if (undefined !== tree && !tree.rootTile.contentRange.isNull)\n this.computeTransform(tree).multiplyRange(tree.rootTile.contentRange, range);\n\n return range;\n }\n\n /** Return the clip volume applied to this reference's tile tree, if any. */\n protected getClipVolume(tree: TileTree): RenderClipVolume | undefined {\n return tree.clipVolume;\n }\n\n /** Supply overrides that should be applied to the [[ViewState]]'s [ViewFlags]($common) when drawing this tile tree reference. */\n protected getViewFlagOverrides(tree: TileTree): ViewFlagOverrides {\n return tree.viewFlagOverrides;\n }\n\n /** Return overrides that *replace* any defined for the view. */\n protected getSymbologyOverrides(_tree: TileTree): FeatureSymbology.Overrides | undefined {\n return undefined;\n }\n\n /** Return a provider that can supplement the view's symbology overrides. */\n protected getAppearanceProvider(_tree: TileTree): FeatureAppearanceProvider | undefined {\n return undefined;\n }\n\n /** Return hidden line settings to replace those defined for the view. */\n protected getHiddenLineSettings(_tree: TileTree): HiddenLine.Settings | undefined {\n return undefined;\n }\n\n /* Extend range to include transformed range of this tile tree.\n * @internal\n */\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, frustumPlanes?: FrustumPlanes) {\n const tree = this.treeOwner.tileTree;\n if (undefined === tree)\n return;\n\n const location = this.computeTransform(tree);\n tree.accumulateTransformedRange(range, matrix, location, frustumPlanes);\n }\n\n /** @internal */\n public getTerrainHeight(_terrainHeights: Range1d): void { }\n\n /** Return whether the geometry exposed by this tile tree reference should cast shadows on other geometry. */\n public get castsShadows(): boolean {\n return true;\n }\n\n /** Return whether this reference has global coverage. Mapping data is global and some non-primary models such as the OSM building layer have global coverage */\n public get isGlobal(): boolean { return false; }\n\n /** The [PlanarClipMaskPriority]($common) of this tile tree used to determine which tile trees contribute to a clip mask when\n * using [PlanarClipMaskMode.Priority]($common).\n * @beta\n */\n public get planarClipMaskPriority(): number { return PlanarClipMaskPriority.DesignModel; }\n\n /** @deprecated in 5.0 - might be removed in next major version. Use [addAttributions] instead. */\n public addLogoCards(_cards: HTMLTableElement, _vp: ScreenViewport): void { }\n\n /** Add attribution logo cards for the tile tree source logo cards to the viewport's logo div.\n * @beta\n */\n public async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return Promise.resolve(this.addLogoCards(cards, vp));\n }\n\n /** Create a tile tree reference equivalent to this one that also supplies an implementation of [[GeometryTileTreeReference.collectTileGeometry]].\n * Return `undefined` if geometry collection is not supported.\n * @see [[createGeometryTreeReference]].\n */\n protected _createGeometryTreeReference(_options?: GeometryTileTreeReferenceOptions): GeometryTileTreeReference | undefined {\n return undefined;\n }\n\n /** If defined, supplies the implementation of [[GeometryTileTreeReference.collectTileGeometry]].\n */\n public collectTileGeometry?: (collector: TileGeometryCollector) => void;\n\n /** A function that can be assigned to [[collectTileGeometry]] to enable geometry collection for references to tile trees that support geometry collection.\n */\n protected _collectTileGeometry(collector: TileGeometryCollector): void {\n const tree = this.treeOwner.load();\n switch (this.treeOwner.loadStatus) {\n case TileTreeLoadStatus.Loaded:\n assert(undefined !== tree);\n tree.collectTileGeometry(collector);\n break;\n case TileTreeLoadStatus.Loading:\n collector.markLoading();\n break;\n }\n }\n\n /** Obtain a tile tree reference equivalent to this one that also supplies an implementation of [[GeometryTileTreeReference.collectTileGeometry]], or\n * undefined if geometry collection is not supported.\n * Currently, only terrain and reality model tiles support geometry collection.\n * @note Do not override this method - override [[_createGeometryTreeReference]] instead.\n */\n public createGeometryTreeReference(options?: GeometryTileTreeReferenceOptions): GeometryTileTreeReference | undefined {\n if (this.collectTileGeometry) {\n // Unclear why compiler doesn't detect that `this` satisfies the GeometryTileTreeReference interface...it must be looking only at the types, not this particular instance.\n const ref = this as GeometryTileTreeReference;\n ref.reprojectGeometry = options?.reprojectGeometry;\n return ref;\n }\n\n return this._createGeometryTreeReference(options);\n }\n\n /** Create a [[TileTreeReference]] that displays a pre-defined [[RenderGraphic]].\n * The reference can be used to add dynamic content to a [[Viewport]]'s scene as a [[TiledGraphicsProvider]], as in the following example:\n * ```ts\n * [[include:TileTreeReference_createFromRenderGraphic]]\n *```\n * Or, it can be used as a [[DynamicSpatialClassifier]] to contextualize a reality model, like so:\n * ```ts\n * [[include:TileTreeReference_DynamicClassifier]]\n * ```\n * It can also be used to mask out portions of the background map or terrain via [PlanarClipMaskSettings]($common), as shown below:\n * ```ts\n * [[include:TileTreeReference_DynamicClipMask]]\n * ```\n * @beta\n */\n public static createFromRenderGraphic(args: RenderGraphicTileTreeArgs): TileTreeReference {\n return tileTreeReferenceFromRenderGraphic(args);\n }\n}\n\n/** Options for creating a [[GeometryTileTreeReference]].\n * @public\n */\nexport interface GeometryTileTreeReferenceOptions {\n /** If set to true, tile geometry will be reprojected using the tile's reprojection transform when geometry is collected from the referenced TileTree.\n * Currently only applies to point clouds, reality meshes, and terrain.\n * @beta\n */\n reprojectGeometry?: boolean;\n}\n"]}
|
|
@@ -6,6 +6,9 @@ import { Point3d, Range1d, Range2d } from "@itwin/core-geometry";
|
|
|
6
6
|
* passed to [[IModelApp.startup]].
|
|
7
7
|
* @public
|
|
8
8
|
* @extensions
|
|
9
|
+
* @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Provide an [[ElevationProvider]] and [[GeoidProvider]] implementation via [[IModelAppOptions.geospatialProviders]].
|
|
10
|
+
* @note This class structurally satisfies both [[ElevationProvider]] and [[GeoidProvider]] but does not use an explicit
|
|
11
|
+
* `implements` clause because api-extractor forbids `@public` classes from referencing `@beta` interfaces (ae-incompatible-release-tags).
|
|
9
12
|
*/
|
|
10
13
|
export declare class BingElevationProvider {
|
|
11
14
|
private _heightRangeRequestTemplate;
|
|
@@ -17,25 +20,34 @@ export declare class BingElevationProvider {
|
|
|
17
20
|
* If geodetic is true (the default) then height is returned in the Ellipsoidal WGS84 datum. If geodetic is false then the sea level height id returned using the Earth Gravitational Model 2008 (EGM2008 2.5’).
|
|
18
21
|
* @public
|
|
19
22
|
*/
|
|
20
|
-
getHeight(carto: Cartographic, geodetic?: boolean): Promise<
|
|
23
|
+
getHeight(carto: Cartographic, geodetic?: boolean): Promise<number>;
|
|
21
24
|
/** Returns 256 elevations in the specified range - 16 rows and 16 columns.
|
|
22
25
|
* The elevations are ordered starting with the southwest corner, then proceeding west to east and south to north.
|
|
23
26
|
* @beta
|
|
24
27
|
*/
|
|
25
28
|
getHeights(range: Range2d): Promise<number[] | undefined>;
|
|
26
|
-
/**
|
|
29
|
+
/** Return the offset from geodetic height to sea level height at the given cartographic location.
|
|
30
|
+
* @note Satisfies [[GeoidProvider]] structurally.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
getGeodeticToSeaLevelOffset(carto: Cartographic): Promise<number>;
|
|
34
|
+
/** @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Use the Cartographic overload instead.
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
27
37
|
getGeodeticToSeaLevelOffset(point: Point3d, iModel: IModelConnection): Promise<number>;
|
|
28
38
|
/** Get the height (altitude) at a given iModel coordinate. The height is geodetic (WGS84 ellipsoid)
|
|
29
|
-
* If geodetic is true (the default) then height is returned in the Ellipsoidal WGS84 datum. If geodetic is false then sea level height is returned using the Earth Gravitational Model 2008 (EGM2008 2.5
|
|
30
|
-
*
|
|
39
|
+
* If geodetic is true (the default) then height is returned in the Ellipsoidal WGS84 datum. If geodetic is false then sea level height is returned using the Earth Gravitational Model 2008 (EGM2008 2.5').
|
|
40
|
+
* @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Use [[ElevationProvider.getHeight]] via [[IModelApp.elevationProvider]] instead.
|
|
31
41
|
* @public
|
|
32
42
|
*/
|
|
33
43
|
getHeightValue(point: Point3d, iModel: IModelConnection, geodetic?: boolean): Promise<number>;
|
|
34
44
|
/** Get the height (altitude) range for a given iModel project extents. The height values are geodetic (WGS84 ellipsoid).
|
|
45
|
+
* @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Use standalone [[getHeightRange]] function instead.
|
|
35
46
|
* @public
|
|
36
47
|
*/
|
|
37
48
|
getHeightRange(iModel: IModelConnection): Promise<Range1d>;
|
|
38
49
|
/** Get the average height (altitude) for a given iModel project extents. The height values are geodetic (WGS84 ellipsoid).
|
|
50
|
+
* @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Use standalone [[getHeightAverage]] function instead.
|
|
39
51
|
* @public
|
|
40
52
|
*/
|
|
41
53
|
getHeightAverage(iModel: IModelConnection): Promise<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BingElevation.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/BingElevation.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAIjE
|
|
1
|
+
{"version":3,"file":"BingElevation.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/BingElevation.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAIjE;;;;;;;;GAQG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,2BAA2B,CAAS;IAC5C,OAAO,CAAC,8BAA8B,CAAS;IAC/C,OAAO,CAAC,0BAA0B,CAAS;IAE3C,cAAc;;IAkBd;;;OAGG;IACU,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,UAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAiB7E;;;OAGG;IACU,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC;IAYtE;;;OAGG;IACU,2BAA2B,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9E;;OAEG;IACU,2BAA2B,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAiBnG;;;;OAIG;IACU,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,UAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvG;;;OAGG;IACU,cAAc,CAAC,MAAM,EAAE,gBAAgB;IAepD;;;OAGG;IACU,gBAAgB,CAAC,MAAM,EAAE,gBAAgB;CAiBvD"}
|
|
@@ -10,6 +10,7 @@ exports.BingElevationProvider = void 0;
|
|
|
10
10
|
*/
|
|
11
11
|
const Request_1 = require("../../request/Request");
|
|
12
12
|
const IModelApp_1 = require("../../IModelApp");
|
|
13
|
+
const core_common_1 = require("@itwin/core-common");
|
|
13
14
|
const core_geometry_1 = require("@itwin/core-geometry");
|
|
14
15
|
// cspell:ignore atae qdng uyzv auje sealevel
|
|
15
16
|
/** Provides an interface to the [Bing Maps elevation services](https://docs.microsoft.com/en-us/bingmaps/rest-services/elevations/).
|
|
@@ -17,6 +18,9 @@ const core_geometry_1 = require("@itwin/core-geometry");
|
|
|
17
18
|
* passed to [[IModelApp.startup]].
|
|
18
19
|
* @public
|
|
19
20
|
* @extensions
|
|
21
|
+
* @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Provide an [[ElevationProvider]] and [[GeoidProvider]] implementation via [[IModelAppOptions.geospatialProviders]].
|
|
22
|
+
* @note This class structurally satisfies both [[ElevationProvider]] and [[GeoidProvider]] but does not use an explicit
|
|
23
|
+
* `implements` clause because api-extractor forbids `@public` classes from referencing `@beta` interfaces (ae-incompatible-release-tags).
|
|
20
24
|
*/
|
|
21
25
|
class BingElevationProvider {
|
|
22
26
|
_heightRangeRequestTemplate;
|
|
@@ -25,8 +29,9 @@ class BingElevationProvider {
|
|
|
25
29
|
/** @public */
|
|
26
30
|
constructor() {
|
|
27
31
|
let bingKey = "";
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- this deprecated class reads from the deprecated BingMaps key by design
|
|
28
33
|
if (IModelApp_1.IModelApp.mapLayerFormatRegistry.configOptions.BingMaps)
|
|
29
|
-
bingKey = IModelApp_1.IModelApp.mapLayerFormatRegistry.configOptions.BingMaps.value;
|
|
34
|
+
bingKey = IModelApp_1.IModelApp.mapLayerFormatRegistry.configOptions.BingMaps.value; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
30
35
|
this._heightRangeRequestTemplate =
|
|
31
36
|
"https://dev.virtualearth.net/REST/v1/Elevation/Bounds?bounds={boundingBox}&rows=16&cols=16&heights=ellipsoid&key={BingMapsAPIKey}"
|
|
32
37
|
.replace("{BingMapsAPIKey}", bingKey);
|
|
@@ -70,11 +75,14 @@ class BingElevationProvider {
|
|
|
70
75
|
return undefined;
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
async getGeodeticToSeaLevelOffset(pointOrCarto, iModel) {
|
|
79
|
+
let carto;
|
|
80
|
+
if (pointOrCarto instanceof core_common_1.Cartographic) {
|
|
81
|
+
carto = pointOrCarto;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
carto = iModel.spatialToCartographicFromEcef(pointOrCarto);
|
|
85
|
+
}
|
|
78
86
|
const requestUrl = this._seaLevelOffsetRequestTemplate.replace("{points}", `${carto.latitudeDegrees},${carto.longitudeDegrees}`);
|
|
79
87
|
try {
|
|
80
88
|
const tileResponseBody = await (0, Request_1.request)(requestUrl, "json");
|
|
@@ -85,14 +93,15 @@ class BingElevationProvider {
|
|
|
85
93
|
}
|
|
86
94
|
}
|
|
87
95
|
/** Get the height (altitude) at a given iModel coordinate. The height is geodetic (WGS84 ellipsoid)
|
|
88
|
-
* If geodetic is true (the default) then height is returned in the Ellipsoidal WGS84 datum. If geodetic is false then sea level height is returned using the Earth Gravitational Model 2008 (EGM2008 2.5
|
|
89
|
-
*
|
|
96
|
+
* If geodetic is true (the default) then height is returned in the Ellipsoidal WGS84 datum. If geodetic is false then sea level height is returned using the Earth Gravitational Model 2008 (EGM2008 2.5').
|
|
97
|
+
* @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Use [[ElevationProvider.getHeight]] via [[IModelApp.elevationProvider]] instead.
|
|
90
98
|
* @public
|
|
91
99
|
*/
|
|
92
100
|
async getHeightValue(point, iModel, geodetic = true) {
|
|
93
101
|
return this.getHeight(iModel.spatialToCartographicFromEcef(point), geodetic);
|
|
94
102
|
}
|
|
95
103
|
/** Get the height (altitude) range for a given iModel project extents. The height values are geodetic (WGS84 ellipsoid).
|
|
104
|
+
* @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Use standalone [[getHeightRange]] function instead.
|
|
96
105
|
* @public
|
|
97
106
|
*/
|
|
98
107
|
async getHeightRange(iModel) {
|
|
@@ -108,6 +117,7 @@ class BingElevationProvider {
|
|
|
108
117
|
return heights ? core_geometry_1.Range1d.createArray(heights) : core_geometry_1.Range1d.createNull();
|
|
109
118
|
}
|
|
110
119
|
/** Get the average height (altitude) for a given iModel project extents. The height values are geodetic (WGS84 ellipsoid).
|
|
120
|
+
* @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Use standalone [[getHeightAverage]] function instead.
|
|
111
121
|
* @public
|
|
112
122
|
*/
|
|
113
123
|
async getHeightAverage(iModel) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BingElevation.js","sourceRoot":"","sources":["../../../../src/tile/map/BingElevation.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,mDAAgD;AAChD,+CAA4C;AAG5C,wDAAiE;AAEjE,6CAA6C;AAE7C;;;;;GAKG;AACH,MAAa,qBAAqB;IACxB,2BAA2B,CAAS;IACpC,8BAA8B,CAAS;IACvC,0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I,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM;YAC7B,OAAO,CAAC,CAAC;QAEX,IAAI,KAAK,GAAG,GAAG,CAAC;QAChB,KAAK,MAAM,MAAM,IAAI,OAAO;YAC1B,KAAK,IAAI,MAAM,CAAC;QAElB,OAAO,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;IAChC,CAAC;CACF;AAxHD,sDAwHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Tiles\n */\nimport { request } from \"../../request/Request\";\nimport { IModelApp } from \"../../IModelApp\";\nimport { IModelConnection } from \"../../IModelConnection\";\nimport { Cartographic } from \"@itwin/core-common\";\nimport { Point3d, Range1d, Range2d } from \"@itwin/core-geometry\";\n\n// cspell:ignore atae qdng uyzv auje sealevel\n\n/** Provides an interface to the [Bing Maps elevation services](https://docs.microsoft.com/en-us/bingmaps/rest-services/elevations/).\n * Use of these services requires an API key to be supplied via [[MapLayerOptions.BingMaps]] in the [[IModelAppOptions.mapLayerOptions]]\n * passed to [[IModelApp.startup]].\n * @public\n * @extensions\n */\nexport class BingElevationProvider {\n private _heightRangeRequestTemplate: string;\n private _seaLevelOffsetRequestTemplate: string;\n private _heightListRequestTemplate: string;\n\n /** @public */\n constructor() {\n let bingKey = \"\";\n if (IModelApp.mapLayerFormatRegistry.configOptions.BingMaps)\n bingKey = IModelApp.mapLayerFormatRegistry.configOptions.BingMaps.value;\n\n this._heightRangeRequestTemplate =\n \"https://dev.virtualearth.net/REST/v1/Elevation/Bounds?bounds={boundingBox}&rows=16&cols=16&heights=ellipsoid&key={BingMapsAPIKey}\"\n .replace(\"{BingMapsAPIKey}\", bingKey);\n this._seaLevelOffsetRequestTemplate =\n \"https://dev.virtualearth.net/REST/v1/Elevation/SeaLevel?points={points}&key={BingMapsAPIKey}\"\n .replace(\"{BingMapsAPIKey}\", bingKey);\n this._heightListRequestTemplate =\n \"https://dev.virtualearth.net/REST/v1/Elevation/List?points={points}&heights={heights}&key={BingMapsAPIKey}\"\n .replace(\"{BingMapsAPIKey}\", bingKey);\n }\n\n /** Return the height (altitude) at a given cartographic location.\n * If geodetic is true (the default) then height is returned in the Ellipsoidal WGS84 datum. If geodetic is false then the sea level height id returned using the Earth Gravitational Model 2008 (EGM2008 2.5’).\n * @public\n */\n public async getHeight(carto: Cartographic, geodetic = true) {\n if (undefined === carto)\n return 0.0;\n\n const requestUrl =\n this._heightListRequestTemplate\n .replace(\"{points}\", `${carto.latitudeDegrees},${carto.longitudeDegrees}`)\n .replace(\"{heights}\", geodetic ? \"ellipsoid\" : \"sealevel\");\n\n try {\n const tileResponseBody = await request(requestUrl, \"json\");\n return tileResponseBody.resourceSets[0].resources[0].elevations[0];\n } catch {\n return 0.0;\n }\n }\n\n /** Returns 256 elevations in the specified range - 16 rows and 16 columns.\n * The elevations are ordered starting with the southwest corner, then proceeding west to east and south to north.\n * @beta\n */\n public async getHeights(range: Range2d): Promise<number[] | undefined> {\n const boundingBox = `${range.low.y},${range.low.x},${range.high.y},${range.high.x}`;\n const requestUrl = this._heightRangeRequestTemplate.replace(\"{boundingBox}\", boundingBox);\n\n try {\n const tileResponseBody = await request(requestUrl, \"json\");\n return tileResponseBody.resourceSets[0].resources[0].elevations;\n } catch {\n return undefined;\n }\n }\n\n /** @internal */\n public async getGeodeticToSeaLevelOffset(point: Point3d, iModel: IModelConnection): Promise<number> {\n const carto = iModel.spatialToCartographicFromEcef(point);\n if (carto === undefined)\n return 0.0;\n\n const requestUrl = this._seaLevelOffsetRequestTemplate.replace(\"{points}\", `${carto.latitudeDegrees},${carto.longitudeDegrees}`);\n try {\n const tileResponseBody = await request(requestUrl, \"json\");\n return tileResponseBody.resourceSets[0].resources[0].offsets[0];\n } catch {\n return 0.0;\n }\n }\n /** Get the height (altitude) at a given iModel coordinate. The height is geodetic (WGS84 ellipsoid)\n * If geodetic is true (the default) then height is returned in the Ellipsoidal WGS84 datum. If geodetic is false then sea level height is returned using the Earth Gravitational Model 2008 (EGM2008 2.5’).\n *\n * @public\n */\n public async getHeightValue(point: Point3d, iModel: IModelConnection, geodetic = true): Promise<number> {\n return this.getHeight(iModel.spatialToCartographicFromEcef(point), geodetic);\n }\n\n /** Get the height (altitude) range for a given iModel project extents. The height values are geodetic (WGS84 ellipsoid).\n * @public\n */\n public async getHeightRange(iModel: IModelConnection) {\n const latLongRange = Range2d.createNull();\n const range = iModel.projectExtents.clone();\n\n // Expand for project surroundings.\n range.expandInPlace(1000);\n for (const corner of range.corners()) {\n const carto = iModel.spatialToCartographicFromEcef(corner);\n latLongRange.extendXY(carto.longitudeDegrees, carto.latitudeDegrees);\n }\n\n const heights = await this.getHeights(latLongRange);\n return heights ? Range1d.createArray(heights) : Range1d.createNull();\n }\n\n /** Get the average height (altitude) for a given iModel project extents. The height values are geodetic (WGS84 ellipsoid).\n * @public\n */\n public async getHeightAverage(iModel: IModelConnection) {\n const latLongRange = Range2d.createNull();\n for (const corner of iModel.projectExtents.corners()) {\n const carto = iModel.spatialToCartographicFromEcef(corner);\n latLongRange.extendXY(carto.longitudeDegrees, carto.latitudeDegrees);\n }\n\n const heights = await this.getHeights(latLongRange);\n if (!heights || !heights.length)\n return 0;\n\n let total = 0.0;\n for (const height of heights)\n total += height;\n\n return total / heights.length;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BingElevation.js","sourceRoot":"","sources":["../../../../src/tile/map/BingElevation.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,mDAAgD;AAChD,+CAA4C;AAE5C,oDAAkD;AAClD,wDAAiE;AAEjE,6CAA6C;AAE7C;;;;;;;;GAQG;AACH,MAAa,qBAAqB;IACxB,2BAA2B,CAAS;IACpC,8BAA8B,CAAS;IACvC,0BAA0B,CAAS;IAE3C,cAAc;IACd;QACE,IAAI,OAAO,GAAG,EAAE,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C,YAAY,CAAC,CAAC;QACpD,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM;YAC7B,OAAO,CAAC,CAAC;QAEX,IAAI,KAAK,GAAG,GAAG,CAAC;QAChB,KAAK,MAAM,MAAM,IAAI,OAAO;YAC1B,KAAK,IAAI,MAAM,CAAC;QAElB,OAAO,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;IAChC,CAAC;CACF;AAtID,sDAsIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Tiles\n */\nimport { request } from \"../../request/Request\";\nimport { IModelApp } from \"../../IModelApp\";\nimport { IModelConnection } from \"../../IModelConnection\";\nimport { Cartographic } from \"@itwin/core-common\";\nimport { Point3d, Range1d, Range2d } from \"@itwin/core-geometry\";\n\n// cspell:ignore atae qdng uyzv auje sealevel\n\n/** Provides an interface to the [Bing Maps elevation services](https://docs.microsoft.com/en-us/bingmaps/rest-services/elevations/).\n * Use of these services requires an API key to be supplied via [[MapLayerOptions.BingMaps]] in the [[IModelAppOptions.mapLayerOptions]]\n * passed to [[IModelApp.startup]].\n * @public\n * @extensions\n * @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Provide an [[ElevationProvider]] and [[GeoidProvider]] implementation via [[IModelAppOptions.geospatialProviders]].\n * @note This class structurally satisfies both [[ElevationProvider]] and [[GeoidProvider]] but does not use an explicit\n * `implements` clause because api-extractor forbids `@public` classes from referencing `@beta` interfaces (ae-incompatible-release-tags).\n */\nexport class BingElevationProvider {\n private _heightRangeRequestTemplate: string;\n private _seaLevelOffsetRequestTemplate: string;\n private _heightListRequestTemplate: string;\n\n /** @public */\n constructor() {\n let bingKey = \"\";\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- this deprecated class reads from the deprecated BingMaps key by design\n if (IModelApp.mapLayerFormatRegistry.configOptions.BingMaps)\n bingKey = IModelApp.mapLayerFormatRegistry.configOptions.BingMaps.value; // eslint-disable-line @typescript-eslint/no-deprecated\n\n this._heightRangeRequestTemplate =\n \"https://dev.virtualearth.net/REST/v1/Elevation/Bounds?bounds={boundingBox}&rows=16&cols=16&heights=ellipsoid&key={BingMapsAPIKey}\"\n .replace(\"{BingMapsAPIKey}\", bingKey);\n this._seaLevelOffsetRequestTemplate =\n \"https://dev.virtualearth.net/REST/v1/Elevation/SeaLevel?points={points}&key={BingMapsAPIKey}\"\n .replace(\"{BingMapsAPIKey}\", bingKey);\n this._heightListRequestTemplate =\n \"https://dev.virtualearth.net/REST/v1/Elevation/List?points={points}&heights={heights}&key={BingMapsAPIKey}\"\n .replace(\"{BingMapsAPIKey}\", bingKey);\n }\n\n /** Return the height (altitude) at a given cartographic location.\n * If geodetic is true (the default) then height is returned in the Ellipsoidal WGS84 datum. If geodetic is false then the sea level height id returned using the Earth Gravitational Model 2008 (EGM2008 2.5’).\n * @public\n */\n public async getHeight(carto: Cartographic, geodetic = true): Promise<number> {\n if (undefined === carto)\n return 0.0;\n\n const requestUrl =\n this._heightListRequestTemplate\n .replace(\"{points}\", `${carto.latitudeDegrees},${carto.longitudeDegrees}`)\n .replace(\"{heights}\", geodetic ? \"ellipsoid\" : \"sealevel\");\n\n try {\n const tileResponseBody = await request(requestUrl, \"json\");\n return tileResponseBody.resourceSets[0].resources[0].elevations[0];\n } catch {\n return 0.0;\n }\n }\n\n /** Returns 256 elevations in the specified range - 16 rows and 16 columns.\n * The elevations are ordered starting with the southwest corner, then proceeding west to east and south to north.\n * @beta\n */\n public async getHeights(range: Range2d): Promise<number[] | undefined> {\n const boundingBox = `${range.low.y},${range.low.x},${range.high.y},${range.high.x}`;\n const requestUrl = this._heightRangeRequestTemplate.replace(\"{boundingBox}\", boundingBox);\n\n try {\n const tileResponseBody = await request(requestUrl, \"json\");\n return tileResponseBody.resourceSets[0].resources[0].elevations;\n } catch {\n return undefined;\n }\n }\n\n /** Return the offset from geodetic height to sea level height at the given cartographic location.\n * @note Satisfies [[GeoidProvider]] structurally.\n * @internal\n */\n public async getGeodeticToSeaLevelOffset(carto: Cartographic): Promise<number>;\n /** @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Use the Cartographic overload instead.\n * @internal\n */\n public async getGeodeticToSeaLevelOffset(point: Point3d, iModel: IModelConnection): Promise<number>;\n public async getGeodeticToSeaLevelOffset(pointOrCarto: Point3d | Cartographic, iModel?: IModelConnection): Promise<number> {\n let carto: Cartographic;\n if (pointOrCarto instanceof Cartographic) {\n carto = pointOrCarto;\n } else {\n carto = iModel!.spatialToCartographicFromEcef(pointOrCarto);\n }\n\n const requestUrl = this._seaLevelOffsetRequestTemplate.replace(\"{points}\", `${carto.latitudeDegrees},${carto.longitudeDegrees}`);\n try {\n const tileResponseBody = await request(requestUrl, \"json\");\n return tileResponseBody.resourceSets[0].resources[0].offsets[0];\n } catch {\n return 0.0;\n }\n }\n /** Get the height (altitude) at a given iModel coordinate. The height is geodetic (WGS84 ellipsoid)\n * If geodetic is true (the default) then height is returned in the Ellipsoidal WGS84 datum. If geodetic is false then sea level height is returned using the Earth Gravitational Model 2008 (EGM2008 2.5').\n * @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Use [[ElevationProvider.getHeight]] via [[IModelApp.elevationProvider]] instead.\n * @public\n */\n public async getHeightValue(point: Point3d, iModel: IModelConnection, geodetic = true): Promise<number> {\n return this.getHeight(iModel.spatialToCartographicFromEcef(point), geodetic);\n }\n\n /** Get the height (altitude) range for a given iModel project extents. The height values are geodetic (WGS84 ellipsoid).\n * @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Use standalone [[getHeightRange]] function instead.\n * @public\n */\n public async getHeightRange(iModel: IModelConnection) {\n const latLongRange = Range2d.createNull();\n const range = iModel.projectExtents.clone();\n\n // Expand for project surroundings.\n range.expandInPlace(1000);\n for (const corner of range.corners()) {\n const carto = iModel.spatialToCartographicFromEcef(corner);\n latLongRange.extendXY(carto.longitudeDegrees, carto.latitudeDegrees);\n }\n\n const heights = await this.getHeights(latLongRange);\n return heights ? Range1d.createArray(heights) : Range1d.createNull();\n }\n\n /** Get the average height (altitude) for a given iModel project extents. The height values are geodetic (WGS84 ellipsoid).\n * @deprecated in 5.11.0 - will not be removed until after 2027-07-03. Use standalone [[getHeightAverage]] function instead.\n * @public\n */\n public async getHeightAverage(iModel: IModelConnection) {\n const latLongRange = Range2d.createNull();\n for (const corner of iModel.projectExtents.corners()) {\n const carto = iModel.spatialToCartographicFromEcef(corner);\n latLongRange.extendXY(carto.longitudeDegrees, carto.latitudeDegrees);\n }\n\n const heights = await this.getHeights(latLongRange);\n if (!heights || !heights.length)\n return 0;\n\n let total = 0.0;\n for (const height of heights)\n total += height;\n\n return total / heights.length;\n }\n}\n"]}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Tiles
|
|
3
|
+
*/
|
|
4
|
+
import { BeDuration } from "@itwin/core-bentley";
|
|
5
|
+
import { CesiumAccessClient } from "../../CesiumAccessClient";
|
|
1
6
|
import { TerrainMeshProvider, TerrainMeshProviderOptions } from "../internal";
|
|
2
|
-
/** Return the URL for a Cesium
|
|
7
|
+
/** Return the URL for a Cesium Ion asset from its asset ID and request Key.
|
|
3
8
|
* @public
|
|
4
9
|
*/
|
|
5
10
|
export declare function getCesiumAssetUrl(osmAssetId: number, requestKey: string): string;
|
|
6
11
|
/** @internal */
|
|
7
12
|
export declare function getCesiumOSMBuildingsUrl(): string | undefined;
|
|
13
|
+
/** Returns the registered [[CesiumAccessClient]], or a default [[CesiumIonClient]] if none is registered.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function getCesiumAccessClient(): CesiumAccessClient;
|
|
17
|
+
/** Compute when to next re-resolve a Cesium access token. Honors the endpoint's `expiresAt` when it is a valid
|
|
18
|
+
* future time, but guards against an invalid (NaN) date - which would otherwise disable refresh entirely - and
|
|
19
|
+
* against a past/imminent expiry that would re-resolve the endpoint on essentially every tile read.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function computeCesiumTokenTimeoutInterval(expiresAt: Date | undefined): BeDuration;
|
|
8
23
|
/** @internal */
|
|
9
24
|
export declare function getCesiumAccessTokenAndEndpointUrl(assetId: string, requestKey?: string): Promise<{
|
|
10
25
|
token?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CesiumTerrainProvider.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/CesiumTerrainProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CesiumTerrainProvider.d.ts","sourceRoot":"","sources":["../../../../src/tile/map/CesiumTerrainProvider.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAU,UAAU,EAAgE,MAAM,qBAAqB,CAAC;AAMvH,OAAO,EAAE,kBAAkB,EAAuB,MAAM,0BAA0B,CAAC;AAGnF,OAAO,EACwF,mBAAmB,EAChH,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAUrB;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED,gBAAgB;AAChB,wBAAgB,wBAAwB,IAAI,MAAM,GAAG,SAAS,CAK7D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAE1D;AAKD;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,IAAI,GAAG,SAAS,GAAG,UAAU,CASzF;AAED,gBAAgB;AAChB,wBAAsB,kCAAkC,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAqBxI;AAaD,gBAAgB;AAChB,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAsDzH"}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.getCesiumAssetUrl = getCesiumAssetUrl;
|
|
8
8
|
exports.getCesiumOSMBuildingsUrl = getCesiumOSMBuildingsUrl;
|
|
9
|
+
exports.getCesiumAccessClient = getCesiumAccessClient;
|
|
10
|
+
exports.computeCesiumTokenTimeoutInterval = computeCesiumTokenTimeoutInterval;
|
|
9
11
|
exports.getCesiumAccessTokenAndEndpointUrl = getCesiumAccessTokenAndEndpointUrl;
|
|
10
12
|
exports.getCesiumTerrainProvider = getCesiumTerrainProvider;
|
|
11
13
|
/** @packageDocumentation
|
|
@@ -27,7 +29,7 @@ var QuantizedMeshExtensionIds;
|
|
|
27
29
|
QuantizedMeshExtensionIds[QuantizedMeshExtensionIds["WaterMask"] = 2] = "WaterMask";
|
|
28
30
|
QuantizedMeshExtensionIds[QuantizedMeshExtensionIds["Metadata"] = 4] = "Metadata";
|
|
29
31
|
})(QuantizedMeshExtensionIds || (QuantizedMeshExtensionIds = {}));
|
|
30
|
-
/** Return the URL for a Cesium
|
|
32
|
+
/** Return the URL for a Cesium Ion asset from its asset ID and request Key.
|
|
31
33
|
* @public
|
|
32
34
|
*/
|
|
33
35
|
function getCesiumAssetUrl(osmAssetId, requestKey) {
|
|
@@ -35,10 +37,30 @@ function getCesiumAssetUrl(osmAssetId, requestKey) {
|
|
|
35
37
|
}
|
|
36
38
|
/** @internal */
|
|
37
39
|
function getCesiumOSMBuildingsUrl() {
|
|
38
|
-
|
|
39
|
-
if (undefined === key)
|
|
40
|
+
if (!IModelApp_1.IModelApp.tileAdmin.canAccessCesium)
|
|
40
41
|
return undefined;
|
|
41
|
-
return getCesiumAssetUrl(+core_common_1.CesiumIonAssetId.OSMBuildings,
|
|
42
|
+
return getCesiumAssetUrl(+core_common_1.CesiumIonAssetId.OSMBuildings, "");
|
|
43
|
+
}
|
|
44
|
+
/** Returns the registered [[CesiumAccessClient]], or a default [[CesiumIonClient]] if none is registered.
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
function getCesiumAccessClient() {
|
|
48
|
+
return IModelApp_1.IModelApp.tileAdmin.cesiumAccess ?? new CesiumIonClient();
|
|
49
|
+
}
|
|
50
|
+
const cesiumTokenTimeoutInterval = core_bentley_1.BeDuration.fromSeconds(60 * 30); // Request a new access token every 30 minutes...
|
|
51
|
+
const cesiumMinTokenTimeoutInterval = core_bentley_1.BeDuration.fromSeconds(60); // ...but never re-resolve more often than once per minute.
|
|
52
|
+
/** Compute when to next re-resolve a Cesium access token. Honors the endpoint's `expiresAt` when it is a valid
|
|
53
|
+
* future time, but guards against an invalid (NaN) date - which would otherwise disable refresh entirely - and
|
|
54
|
+
* against a past/imminent expiry that would re-resolve the endpoint on essentially every tile read.
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
function computeCesiumTokenTimeoutInterval(expiresAt) {
|
|
58
|
+
if (undefined === expiresAt)
|
|
59
|
+
return cesiumTokenTimeoutInterval;
|
|
60
|
+
const remainingMs = expiresAt.getTime() - Date.now();
|
|
61
|
+
if (!Number.isFinite(remainingMs))
|
|
62
|
+
return cesiumTokenTimeoutInterval;
|
|
63
|
+
return core_bentley_1.BeDuration.fromMilliseconds(Math.max(remainingMs, cesiumMinTokenTimeoutInterval.milliseconds));
|
|
42
64
|
}
|
|
43
65
|
/** @internal */
|
|
44
66
|
async function getCesiumAccessTokenAndEndpointUrl(assetId, requestKey) {
|
|
@@ -72,15 +94,19 @@ function notifyTerrainError(detailedDescription) {
|
|
|
72
94
|
}
|
|
73
95
|
/** @internal */
|
|
74
96
|
async function getCesiumTerrainProvider(opts) {
|
|
75
|
-
const
|
|
76
|
-
|
|
97
|
+
const assetId = opts.dataSource || core_common_1.CesiumTerrainAssetId.Default;
|
|
98
|
+
const client = getCesiumAccessClient();
|
|
99
|
+
const endpoint = await client.getAssetEndpoint(assetId, opts.iTwinId);
|
|
100
|
+
if (!endpoint) {
|
|
77
101
|
notifyTerrainError(IModelApp_1.IModelApp.localization.getLocalizedString(`iModelJs:BackgroundMap.MissingCesiumToken`));
|
|
78
102
|
return undefined;
|
|
79
103
|
}
|
|
104
|
+
// Resource paths (layer.json, tiles) are appended directly to the base URL, so ensure it ends with a slash.
|
|
105
|
+
const baseUrl = endpoint.url.endsWith("/") ? endpoint.url : `${endpoint.url}/`;
|
|
80
106
|
let layers;
|
|
81
107
|
try {
|
|
82
|
-
const layerRequestOptions = { headers: { authorization: `Bearer ${
|
|
83
|
-
const layerUrl = `${
|
|
108
|
+
const layerRequestOptions = { headers: { authorization: `Bearer ${endpoint.accessToken}` } };
|
|
109
|
+
const layerUrl = `${baseUrl}layer.json`;
|
|
84
110
|
layers = await (0, Request_1.request)(layerUrl, "json", layerRequestOptions);
|
|
85
111
|
}
|
|
86
112
|
catch {
|
|
@@ -109,12 +135,12 @@ async function getCesiumTerrainProvider(opts) {
|
|
|
109
135
|
}
|
|
110
136
|
}
|
|
111
137
|
}
|
|
112
|
-
let tileUrlTemplate =
|
|
138
|
+
let tileUrlTemplate = baseUrl + layers.tiles[0].replace("{version}", layers.version);
|
|
113
139
|
if (opts.wantNormals)
|
|
114
140
|
tileUrlTemplate = tileUrlTemplate.replace("?", "?extensions=octvertexnormals-watermask-metadata&");
|
|
115
141
|
const maxDepth = core_bentley_1.JsonUtils.asInt(layers.maxzoom, 19);
|
|
116
142
|
// TBD -- When we have an API extract the heights for the project from the terrain tiles - for use temporary Bing elevation.
|
|
117
|
-
return new CesiumTerrainProvider(opts,
|
|
143
|
+
return new CesiumTerrainProvider(opts, endpoint.accessToken, endpoint.expiresAt, tileUrlTemplate, maxDepth, tilingScheme, tileAvailability, layers.metadataAvailability);
|
|
118
144
|
}
|
|
119
145
|
function zigZagDecode(value) {
|
|
120
146
|
return (value >> 1) ^ (-(value & 1));
|
|
@@ -149,19 +175,19 @@ class CesiumTerrainProvider extends internal_1.TerrainMeshProvider {
|
|
|
149
175
|
_metaDataAvailableLevel;
|
|
150
176
|
_exaggeration;
|
|
151
177
|
_assetId;
|
|
178
|
+
_iTwinId;
|
|
152
179
|
static _scratchQPoint2d = core_common_1.QPoint2d.fromScalars(0, 0);
|
|
153
180
|
static _scratchPoint2d = core_geometry_1.Point2d.createZero();
|
|
154
181
|
static _scratchPoint = core_geometry_1.Point3d.createZero();
|
|
155
182
|
static _scratchNormal = core_geometry_1.Vector3d.createZero();
|
|
156
183
|
static _scratchHeightRange = core_geometry_1.Range1d.createNull();
|
|
157
|
-
static _tokenTimeoutInterval = core_bentley_1.BeDuration.fromSeconds(60 * 30); // Request a new access token every 30 minutes...
|
|
158
184
|
_tokenTimeOut;
|
|
159
185
|
forceTileLoad(tile) {
|
|
160
186
|
// Force loading of the metadata availability tiles as these are required for determining the availability of descendants.
|
|
161
187
|
const mapTile = tile;
|
|
162
188
|
return undefined !== this._metaDataAvailableLevel && mapTile.quadId.level === this._metaDataAvailableLevel && !mapTile.everLoaded;
|
|
163
189
|
}
|
|
164
|
-
constructor(opts, accessToken, tileUrlTemplate, maxDepth, tilingScheme, tileAvailability, metaDataAvailableLevel) {
|
|
190
|
+
constructor(opts, accessToken, expiresAt, tileUrlTemplate, maxDepth, tilingScheme, tileAvailability, metaDataAvailableLevel) {
|
|
165
191
|
super();
|
|
166
192
|
this._wantSkirts = opts.wantSkirts;
|
|
167
193
|
this._exaggeration = opts.exaggeration;
|
|
@@ -172,9 +198,10 @@ class CesiumTerrainProvider extends internal_1.TerrainMeshProvider {
|
|
|
172
198
|
this._tileAvailability = tileAvailability;
|
|
173
199
|
this._metaDataAvailableLevel = metaDataAvailableLevel;
|
|
174
200
|
this._assetId = opts.dataSource || core_common_1.CesiumTerrainAssetId.Default;
|
|
175
|
-
this.
|
|
201
|
+
this._iTwinId = opts.iTwinId;
|
|
202
|
+
this._tokenTimeOut = core_bentley_1.BeTimePoint.now().plus(computeCesiumTokenTimeoutInterval(expiresAt));
|
|
176
203
|
}
|
|
177
|
-
/** @deprecated in 5.0 -
|
|
204
|
+
/** @deprecated in 5.0 - might be removed in next major version. Use [addAttributions] instead. */
|
|
178
205
|
addLogoCards(cards) {
|
|
179
206
|
if (cards.dataset.cesiumIonLogoCard)
|
|
180
207
|
return;
|
|
@@ -218,11 +245,12 @@ class CesiumTerrainProvider extends internal_1.TerrainMeshProvider {
|
|
|
218
245
|
// ###TODO why does he update the access token when reading the mesh instead of when requesting it?
|
|
219
246
|
// This function only returns undefined if it fails to acquire token - but it doesn't need the token...
|
|
220
247
|
if (core_bentley_1.BeTimePoint.now().milliseconds > this._tokenTimeOut.milliseconds) {
|
|
221
|
-
const
|
|
222
|
-
|
|
248
|
+
const client = getCesiumAccessClient();
|
|
249
|
+
const endpoint = await client.getAssetEndpoint(this._assetId, this._iTwinId);
|
|
250
|
+
if (!endpoint || args.isCanceled())
|
|
223
251
|
return undefined;
|
|
224
|
-
this._accessToken =
|
|
225
|
-
this._tokenTimeOut = core_bentley_1.BeTimePoint.now().plus(
|
|
252
|
+
this._accessToken = endpoint.accessToken;
|
|
253
|
+
this._tokenTimeOut = core_bentley_1.BeTimePoint.now().plus(computeCesiumTokenTimeoutInterval(endpoint.expiresAt));
|
|
226
254
|
}
|
|
227
255
|
const { data, tile } = args;
|
|
228
256
|
(0, core_bentley_1.assert)(data instanceof Uint8Array);
|
|
@@ -409,4 +437,16 @@ class CesiumTerrainProvider extends internal_1.TerrainMeshProvider {
|
|
|
409
437
|
return undefined === heightRange ? parentRange : heightRange;
|
|
410
438
|
}
|
|
411
439
|
}
|
|
440
|
+
/** Default [[CesiumAccessClient]] that authenticates directly with Cesium Ion using [[TileAdmin.cesiumIonKey]].
|
|
441
|
+
* This is used when no custom [[CesiumAccessClient]] is registered via [[TileAdmin.Props.cesiumAccess]].
|
|
442
|
+
* @internal
|
|
443
|
+
*/
|
|
444
|
+
class CesiumIonClient {
|
|
445
|
+
async getAssetEndpoint(assetId, _iTwinId) {
|
|
446
|
+
const result = await getCesiumAccessTokenAndEndpointUrl(assetId);
|
|
447
|
+
if (!result.token || !result.url)
|
|
448
|
+
return undefined;
|
|
449
|
+
return { accessToken: result.token, url: result.url };
|
|
450
|
+
}
|
|
451
|
+
}
|
|
412
452
|
//# sourceMappingURL=CesiumTerrainProvider.js.map
|