@itwin/core-frontend 5.1.0-dev.7 → 5.1.0-dev.71
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 +92 -1
- package/lib/cjs/AccuDraw.d.ts +2 -0
- package/lib/cjs/AccuDraw.d.ts.map +1 -1
- package/lib/cjs/AccuDraw.js +4 -2
- package/lib/cjs/AccuDraw.js.map +1 -1
- package/lib/cjs/AccuSnap.d.ts.map +1 -1
- package/lib/cjs/AccuSnap.js +15 -6
- package/lib/cjs/AccuSnap.js.map +1 -1
- package/lib/cjs/AuxCoordSys.js +1 -1
- package/lib/cjs/AuxCoordSys.js.map +1 -1
- package/lib/cjs/DisplayStyleState.d.ts +37 -0
- package/lib/cjs/DisplayStyleState.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleState.js +65 -0
- package/lib/cjs/DisplayStyleState.js.map +1 -1
- package/lib/cjs/DrawingViewState.d.ts.map +1 -1
- package/lib/cjs/DrawingViewState.js +1 -0
- package/lib/cjs/DrawingViewState.js.map +1 -1
- package/lib/cjs/GraphicalEditingScope.d.ts +1 -1
- package/lib/cjs/GraphicalEditingScope.d.ts.map +1 -1
- package/lib/cjs/GraphicalEditingScope.js +1 -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.map +1 -1
- package/lib/cjs/IModelApp.d.ts +19 -4
- package/lib/cjs/IModelApp.d.ts.map +1 -1
- package/lib/cjs/IModelApp.js +21 -2
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/IModelConnection.d.ts +8 -9
- package/lib/cjs/IModelConnection.d.ts.map +1 -1
- package/lib/cjs/IModelConnection.js +52 -24
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/IpcApp.d.ts +2 -1
- package/lib/cjs/IpcApp.d.ts.map +1 -1
- package/lib/cjs/IpcApp.js +4 -2
- package/lib/cjs/IpcApp.js.map +1 -1
- package/lib/cjs/RealityDataSource.d.ts +65 -3
- package/lib/cjs/RealityDataSource.d.ts.map +1 -1
- package/lib/cjs/RealityDataSource.js +79 -3
- package/lib/cjs/RealityDataSource.js.map +1 -1
- package/lib/cjs/RealityDataSourceTilesetUrlImpl.js +1 -1
- package/lib/cjs/RealityDataSourceTilesetUrlImpl.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/SheetViewState.d.ts +2 -0
- package/lib/cjs/SheetViewState.d.ts.map +1 -1
- package/lib/cjs/SheetViewState.js +25 -3
- package/lib/cjs/SheetViewState.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 +6 -4
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +23 -3
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/common/gltf/GltfSchema.d.ts +18 -0
- package/lib/cjs/common/gltf/GltfSchema.d.ts.map +1 -1
- package/lib/cjs/common/gltf/GltfSchema.js +1 -0
- package/lib/cjs/common/gltf/GltfSchema.js.map +1 -1
- package/lib/cjs/common/imdl/CompactEdges.d.ts +11 -0
- package/lib/cjs/common/imdl/CompactEdges.d.ts.map +1 -1
- package/lib/cjs/common/imdl/CompactEdges.js +9 -6
- package/lib/cjs/common/imdl/CompactEdges.js.map +1 -1
- package/lib/cjs/common/imdl/ImdlSchema.d.ts +5 -1
- package/lib/cjs/common/imdl/ImdlSchema.d.ts.map +1 -1
- package/lib/cjs/common/imdl/ImdlSchema.js +4 -0
- package/lib/cjs/common/imdl/ImdlSchema.js.map +1 -1
- package/lib/cjs/common/imdl/ParseImdlDocument.d.ts.map +1 -1
- package/lib/cjs/common/imdl/ParseImdlDocument.js +11 -9
- package/lib/cjs/common/imdl/ParseImdlDocument.js.map +1 -1
- package/lib/cjs/common/internal/render/EdgeParams.d.ts +7 -2
- package/lib/cjs/common/internal/render/EdgeParams.d.ts.map +1 -1
- package/lib/cjs/common/internal/render/EdgeParams.js +30 -8
- package/lib/cjs/common/internal/render/EdgeParams.js.map +1 -1
- package/lib/cjs/common/internal/render/MeshPrimitives.d.ts +2 -1
- package/lib/cjs/common/internal/render/MeshPrimitives.d.ts.map +1 -1
- package/lib/cjs/common/internal/render/MeshPrimitives.js +5 -7
- package/lib/cjs/common/internal/render/MeshPrimitives.js.map +1 -1
- package/lib/cjs/common/internal/render/PolylineParams.d.ts +8 -3
- package/lib/cjs/common/internal/render/PolylineParams.d.ts.map +1 -1
- package/lib/cjs/common/internal/render/PolylineParams.js +6 -9
- package/lib/cjs/common/internal/render/PolylineParams.js.map +1 -1
- package/lib/cjs/common/internal/render/VertexTableSplitter.d.ts.map +1 -1
- package/lib/cjs/common/internal/render/VertexTableSplitter.js +9 -7
- package/lib/cjs/common/internal/render/VertexTableSplitter.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +2 -2
- package/lib/cjs/core-frontend.d.ts.map +1 -1
- package/lib/cjs/core-frontend.js +1 -1
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/extension/ExtensionRuntime.js +15 -2
- package/lib/cjs/extension/ExtensionRuntime.js.map +1 -1
- package/lib/cjs/extension/providers/ExtensionLoadScript.js.map +1 -1
- package/lib/cjs/internal/GoogleMapsDecorator.d.ts +53 -0
- package/lib/cjs/internal/GoogleMapsDecorator.d.ts.map +1 -0
- package/lib/cjs/internal/GoogleMapsDecorator.js +132 -0
- package/lib/cjs/internal/GoogleMapsDecorator.js.map +1 -0
- package/lib/cjs/internal/RealityDataSourceGoogle3dTilesImpl.d.ts +83 -0
- package/lib/cjs/internal/RealityDataSourceGoogle3dTilesImpl.d.ts.map +1 -0
- package/lib/cjs/internal/RealityDataSourceGoogle3dTilesImpl.js +201 -0
- package/lib/cjs/internal/RealityDataSourceGoogle3dTilesImpl.js.map +1 -0
- package/lib/cjs/internal/ScriptUtils.d.ts +5 -0
- package/lib/cjs/internal/ScriptUtils.d.ts.map +1 -0
- package/lib/cjs/internal/ScriptUtils.js +120 -0
- package/lib/cjs/internal/ScriptUtils.js.map +1 -0
- package/lib/cjs/internal/cross-package.d.ts +1 -0
- package/lib/cjs/internal/cross-package.d.ts.map +1 -1
- package/lib/cjs/internal/cross-package.js +4 -1
- package/lib/cjs/internal/cross-package.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/BatchUniforms.js +1 -1
- package/lib/cjs/internal/render/webgl/BatchUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/BranchStack.d.ts +2 -2
- package/lib/cjs/internal/render/webgl/BranchStack.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/BranchStack.js +3 -2
- package/lib/cjs/internal/render/webgl/BranchStack.js.map +1 -1
- package/lib/cjs/internal/render/webgl/BranchState.d.ts +4 -2
- package/lib/cjs/internal/render/webgl/BranchState.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/BranchState.js +4 -1
- package/lib/cjs/internal/render/webgl/BranchState.js.map +1 -1
- package/lib/cjs/internal/render/webgl/BranchUniforms.d.ts +2 -2
- package/lib/cjs/internal/render/webgl/BranchUniforms.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/BranchUniforms.js +2 -2
- package/lib/cjs/internal/render/webgl/BranchUniforms.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/ContourUniforms.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/ContourUniforms.js +2 -3
- package/lib/cjs/internal/render/webgl/ContourUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/Contours.js +8 -8
- package/lib/cjs/internal/render/webgl/Contours.js.map +1 -1
- package/lib/cjs/internal/render/webgl/EdgeGeometry.d.ts +8 -6
- package/lib/cjs/internal/render/webgl/EdgeGeometry.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/EdgeGeometry.js +21 -7
- package/lib/cjs/internal/render/webgl/EdgeGeometry.js.map +1 -1
- package/lib/cjs/internal/render/webgl/Graphic.d.ts +2 -1
- package/lib/cjs/internal/render/webgl/Graphic.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/Graphic.js +2 -0
- package/lib/cjs/internal/render/webgl/Graphic.js.map +1 -1
- package/lib/cjs/internal/render/webgl/IndexedEdgeGeometry.d.ts +6 -1
- package/lib/cjs/internal/render/webgl/IndexedEdgeGeometry.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/IndexedEdgeGeometry.js +19 -4
- package/lib/cjs/internal/render/webgl/IndexedEdgeGeometry.js.map +1 -1
- package/lib/cjs/internal/render/webgl/Mesh.d.ts +1 -1
- package/lib/cjs/internal/render/webgl/Mesh.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/Mesh.js +13 -6
- package/lib/cjs/internal/render/webgl/Mesh.js.map +1 -1
- package/lib/cjs/internal/render/webgl/SceneCompositor.js +2 -1
- package/lib/cjs/internal/render/webgl/SceneCompositor.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/Target.d.ts +2 -1
- package/lib/cjs/internal/render/webgl/Target.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/Target.js +3 -1
- package/lib/cjs/internal/render/webgl/Target.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/ClassifierTileTree.js +3 -1
- package/lib/cjs/internal/tile/ClassifierTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/IModelTile.d.ts +1 -0
- package/lib/cjs/internal/tile/IModelTile.d.ts.map +1 -1
- package/lib/cjs/internal/tile/IModelTile.js +4 -0
- package/lib/cjs/internal/tile/IModelTile.js.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.d.ts +4 -2
- package/lib/cjs/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.js +58 -0
- package/lib/cjs/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js +8 -0
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
- package/lib/cjs/internal/tile/OrbitGtTileTree.d.ts +4 -1
- package/lib/cjs/internal/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/OrbitGtTileTree.js +4 -0
- package/lib/cjs/internal/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/PrimaryTileTree.js +5 -4
- package/lib/cjs/internal/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts +26 -7
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.js +48 -21
- package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/RealityTileLoader.d.ts +2 -2
- package/lib/cjs/internal/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityTileLoader.js +10 -2
- 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/AzureMapsLayerImageryProvider.d.ts +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js +1 -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/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts +4 -0
- package/lib/cjs/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js +52 -11
- package/lib/cjs/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/WmtsCapabilities.d.ts +7 -0
- package/lib/cjs/internal/tile/map/WmtsCapabilities.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/WmtsCapabilities.js +17 -0
- package/lib/cjs/internal/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/cjs/internal/webgl.d.ts +1 -1
- package/lib/cjs/internal/webgl.d.ts.map +1 -1
- package/lib/cjs/internal/webgl.js.map +1 -1
- package/lib/cjs/properties/AngleDescription.d.ts +4 -1
- package/lib/cjs/properties/AngleDescription.d.ts.map +1 -1
- package/lib/cjs/properties/AngleDescription.js +10 -2
- package/lib/cjs/properties/AngleDescription.js.map +1 -1
- package/lib/cjs/properties/FormattedQuantityDescription.d.ts +11 -1
- package/lib/cjs/properties/FormattedQuantityDescription.d.ts.map +1 -1
- package/lib/cjs/properties/FormattedQuantityDescription.js +7 -2
- package/lib/cjs/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/cjs/properties/LengthDescription.d.ts +12 -3
- package/lib/cjs/properties/LengthDescription.d.ts.map +1 -1
- package/lib/cjs/properties/LengthDescription.js +30 -6
- package/lib/cjs/properties/LengthDescription.js.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts +103 -7
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.js +210 -23
- package/lib/cjs/quantity-formatting/QuantityFormatter.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 +4 -2
- 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/MeshArgs.d.ts +8 -3
- package/lib/cjs/render/MeshArgs.d.ts.map +1 -1
- package/lib/cjs/render/MeshArgs.js.map +1 -1
- package/lib/cjs/render/RenderGraphic.d.ts +1 -1
- package/lib/cjs/render/RenderGraphic.d.ts.map +1 -1
- package/lib/cjs/render/RenderGraphic.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.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/GltfReader.d.ts +6 -2
- package/lib/cjs/tile/GltfReader.d.ts.map +1 -1
- package/lib/cjs/tile/GltfReader.js +154 -18
- package/lib/cjs/tile/GltfReader.js.map +1 -1
- package/lib/cjs/tile/ImdlReader.js.map +1 -1
- package/lib/cjs/tile/RealityTile.d.ts +9 -0
- package/lib/cjs/tile/RealityTile.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTile.js +12 -0
- package/lib/cjs/tile/RealityTile.js.map +1 -1
- package/lib/cjs/tile/RealityTileTree.d.ts +4 -0
- package/lib/cjs/tile/RealityTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTileTree.js +4 -0
- package/lib/cjs/tile/RealityTileTree.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 +10 -0
- package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
- package/lib/cjs/tile/TileAdmin.js +3 -0
- package/lib/cjs/tile/TileAdmin.js.map +1 -1
- package/lib/cjs/tile/TileGeometryCollector.d.ts +5 -0
- package/lib/cjs/tile/TileGeometryCollector.d.ts.map +1 -1
- package/lib/cjs/tile/TileGeometryCollector.js.map +1 -1
- package/lib/cjs/tile/TileTree.d.ts +15 -2
- package/lib/cjs/tile/TileTree.d.ts.map +1 -1
- package/lib/cjs/tile/TileTree.js +14 -1
- package/lib/cjs/tile/TileTree.js.map +1 -1
- package/lib/cjs/tile/TileTreeReference.d.ts +17 -3
- package/lib/cjs/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/cjs/tile/TileTreeReference.js +11 -5
- package/lib/cjs/tile/TileTreeReference.js.map +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.js +1 -1
- 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/MapCartoRectangle.d.ts +10 -0
- package/lib/cjs/tile/map/MapCartoRectangle.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapCartoRectangle.js +12 -0
- package/lib/cjs/tile/map/MapCartoRectangle.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +3 -3
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js +9 -5
- 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 +1 -1
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tile/map/QuadId.d.ts +15 -0
- package/lib/cjs/tile/map/QuadId.d.ts.map +1 -1
- package/lib/cjs/tile/map/QuadId.js +12 -0
- package/lib/cjs/tile/map/QuadId.js.map +1 -1
- package/lib/cjs/tile/map/TerrainMeshProvider.d.ts +1 -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/AccuDrawViewportUI.d.ts +7 -0
- package/lib/cjs/tools/AccuDrawViewportUI.d.ts.map +1 -1
- package/lib/cjs/tools/AccuDrawViewportUI.js +14 -0
- package/lib/cjs/tools/AccuDrawViewportUI.js.map +1 -1
- package/lib/cjs/tools/ClipViewTool.d.ts.map +1 -1
- package/lib/cjs/tools/ClipViewTool.js +18 -7
- package/lib/cjs/tools/ClipViewTool.js.map +1 -1
- package/lib/cjs/tools/ElementSetTool.d.ts +9 -1
- package/lib/cjs/tools/ElementSetTool.d.ts.map +1 -1
- package/lib/cjs/tools/ElementSetTool.js +130 -7
- package/lib/cjs/tools/ElementSetTool.js.map +1 -1
- package/lib/cjs/tools/IdleTool.d.ts.map +1 -1
- package/lib/cjs/tools/IdleTool.js +4 -1
- package/lib/cjs/tools/IdleTool.js.map +1 -1
- package/lib/cjs/tools/MeasureTool.d.ts +9 -0
- package/lib/cjs/tools/MeasureTool.d.ts.map +1 -1
- package/lib/cjs/tools/MeasureTool.js +57 -24
- package/lib/cjs/tools/MeasureTool.js.map +1 -1
- package/lib/cjs/tools/PrimitiveTool.d.ts +1 -1
- package/lib/cjs/tools/PrimitiveTool.d.ts.map +1 -1
- package/lib/cjs/tools/PrimitiveTool.js +4 -3
- package/lib/cjs/tools/PrimitiveTool.js.map +1 -1
- package/lib/cjs/tools/SelectTool.d.ts +2 -2
- package/lib/cjs/tools/SelectTool.d.ts.map +1 -1
- package/lib/cjs/tools/SelectTool.js +26 -97
- package/lib/cjs/tools/SelectTool.js.map +1 -1
- package/lib/cjs/tools/Tool.d.ts +10 -1
- package/lib/cjs/tools/Tool.d.ts.map +1 -1
- package/lib/cjs/tools/Tool.js +27 -4
- package/lib/cjs/tools/Tool.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.d.ts +1 -0
- package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +59 -18
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/cjs/tools/ToolAssistance.d.ts +1 -1
- package/lib/cjs/tools/ToolAssistance.js.map +1 -1
- package/lib/cjs/tools/ToolSettings.d.ts +5 -0
- package/lib/cjs/tools/ToolSettings.d.ts.map +1 -1
- package/lib/cjs/tools/ToolSettings.js +5 -0
- package/lib/cjs/tools/ToolSettings.js.map +1 -1
- package/lib/cjs/tools/ViewTool.d.ts +1 -2
- package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
- package/lib/cjs/tools/ViewTool.js +143 -84
- 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 +4 -2
- package/lib/esm/AccuDraw.js.map +1 -1
- package/lib/esm/AccuSnap.d.ts.map +1 -1
- package/lib/esm/AccuSnap.js +15 -6
- package/lib/esm/AccuSnap.js.map +1 -1
- package/lib/esm/AuxCoordSys.js +1 -1
- package/lib/esm/AuxCoordSys.js.map +1 -1
- package/lib/esm/DisplayStyleState.d.ts +37 -0
- package/lib/esm/DisplayStyleState.d.ts.map +1 -1
- package/lib/esm/DisplayStyleState.js +65 -0
- package/lib/esm/DisplayStyleState.js.map +1 -1
- package/lib/esm/DrawingViewState.d.ts.map +1 -1
- package/lib/esm/DrawingViewState.js +1 -0
- package/lib/esm/DrawingViewState.js.map +1 -1
- package/lib/esm/GraphicalEditingScope.d.ts +1 -1
- package/lib/esm/GraphicalEditingScope.d.ts.map +1 -1
- package/lib/esm/GraphicalEditingScope.js +1 -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.map +1 -1
- package/lib/esm/IModelApp.d.ts +19 -4
- package/lib/esm/IModelApp.d.ts.map +1 -1
- package/lib/esm/IModelApp.js +22 -3
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/IModelConnection.d.ts +8 -9
- package/lib/esm/IModelConnection.d.ts.map +1 -1
- package/lib/esm/IModelConnection.js +53 -25
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/IpcApp.d.ts +2 -1
- package/lib/esm/IpcApp.d.ts.map +1 -1
- package/lib/esm/IpcApp.js +4 -2
- package/lib/esm/IpcApp.js.map +1 -1
- package/lib/esm/RealityDataSource.d.ts +65 -3
- package/lib/esm/RealityDataSource.d.ts.map +1 -1
- package/lib/esm/RealityDataSource.js +77 -3
- package/lib/esm/RealityDataSource.js.map +1 -1
- package/lib/esm/RealityDataSourceTilesetUrlImpl.js +1 -1
- package/lib/esm/RealityDataSourceTilesetUrlImpl.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/SheetViewState.d.ts +2 -0
- package/lib/esm/SheetViewState.d.ts.map +1 -1
- package/lib/esm/SheetViewState.js +25 -3
- package/lib/esm/SheetViewState.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 +6 -4
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +23 -3
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/common/gltf/GltfSchema.d.ts +18 -0
- package/lib/esm/common/gltf/GltfSchema.d.ts.map +1 -1
- package/lib/esm/common/gltf/GltfSchema.js +1 -0
- package/lib/esm/common/gltf/GltfSchema.js.map +1 -1
- package/lib/esm/common/imdl/CompactEdges.d.ts +11 -0
- package/lib/esm/common/imdl/CompactEdges.d.ts.map +1 -1
- package/lib/esm/common/imdl/CompactEdges.js +8 -6
- package/lib/esm/common/imdl/CompactEdges.js.map +1 -1
- package/lib/esm/common/imdl/ImdlSchema.d.ts +5 -1
- package/lib/esm/common/imdl/ImdlSchema.d.ts.map +1 -1
- package/lib/esm/common/imdl/ImdlSchema.js +4 -0
- package/lib/esm/common/imdl/ImdlSchema.js.map +1 -1
- package/lib/esm/common/imdl/ParseImdlDocument.d.ts.map +1 -1
- package/lib/esm/common/imdl/ParseImdlDocument.js +11 -9
- package/lib/esm/common/imdl/ParseImdlDocument.js.map +1 -1
- package/lib/esm/common/internal/render/EdgeParams.d.ts +7 -2
- package/lib/esm/common/internal/render/EdgeParams.d.ts.map +1 -1
- package/lib/esm/common/internal/render/EdgeParams.js +31 -9
- package/lib/esm/common/internal/render/EdgeParams.js.map +1 -1
- package/lib/esm/common/internal/render/MeshPrimitives.d.ts +2 -1
- package/lib/esm/common/internal/render/MeshPrimitives.d.ts.map +1 -1
- package/lib/esm/common/internal/render/MeshPrimitives.js +5 -7
- package/lib/esm/common/internal/render/MeshPrimitives.js.map +1 -1
- package/lib/esm/common/internal/render/PolylineParams.d.ts +8 -3
- package/lib/esm/common/internal/render/PolylineParams.d.ts.map +1 -1
- package/lib/esm/common/internal/render/PolylineParams.js +5 -8
- package/lib/esm/common/internal/render/PolylineParams.js.map +1 -1
- package/lib/esm/common/internal/render/VertexTableSplitter.d.ts.map +1 -1
- package/lib/esm/common/internal/render/VertexTableSplitter.js +9 -7
- package/lib/esm/common/internal/render/VertexTableSplitter.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +2 -2
- package/lib/esm/core-frontend.d.ts.map +1 -1
- package/lib/esm/core-frontend.js +1 -1
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/extension/ExtensionRuntime.js +15 -2
- package/lib/esm/extension/ExtensionRuntime.js.map +1 -1
- package/lib/esm/extension/providers/ExtensionLoadScript.js +1 -1
- package/lib/esm/extension/providers/ExtensionLoadScript.js.map +1 -1
- package/lib/esm/internal/GoogleMapsDecorator.d.ts +53 -0
- package/lib/esm/internal/GoogleMapsDecorator.d.ts.map +1 -0
- package/lib/esm/internal/GoogleMapsDecorator.js +126 -0
- package/lib/esm/internal/GoogleMapsDecorator.js.map +1 -0
- package/lib/esm/internal/RealityDataSourceGoogle3dTilesImpl.d.ts +83 -0
- package/lib/esm/internal/RealityDataSourceGoogle3dTilesImpl.d.ts.map +1 -0
- package/lib/esm/internal/RealityDataSourceGoogle3dTilesImpl.js +197 -0
- package/lib/esm/internal/RealityDataSourceGoogle3dTilesImpl.js.map +1 -0
- package/lib/esm/internal/ScriptUtils.d.ts +5 -0
- package/lib/esm/internal/ScriptUtils.d.ts.map +1 -0
- package/lib/esm/internal/ScriptUtils.js +117 -0
- package/lib/esm/internal/ScriptUtils.js.map +1 -0
- package/lib/esm/internal/cross-package.d.ts +1 -0
- package/lib/esm/internal/cross-package.d.ts.map +1 -1
- package/lib/esm/internal/cross-package.js +1 -0
- package/lib/esm/internal/cross-package.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/BatchUniforms.js +1 -1
- package/lib/esm/internal/render/webgl/BatchUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/BranchStack.d.ts +2 -2
- package/lib/esm/internal/render/webgl/BranchStack.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/BranchStack.js +3 -2
- package/lib/esm/internal/render/webgl/BranchStack.js.map +1 -1
- package/lib/esm/internal/render/webgl/BranchState.d.ts +4 -2
- package/lib/esm/internal/render/webgl/BranchState.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/BranchState.js +4 -1
- package/lib/esm/internal/render/webgl/BranchState.js.map +1 -1
- package/lib/esm/internal/render/webgl/BranchUniforms.d.ts +2 -2
- package/lib/esm/internal/render/webgl/BranchUniforms.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/BranchUniforms.js +2 -2
- package/lib/esm/internal/render/webgl/BranchUniforms.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/ContourUniforms.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/ContourUniforms.js +2 -3
- package/lib/esm/internal/render/webgl/ContourUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/Contours.js +8 -8
- package/lib/esm/internal/render/webgl/Contours.js.map +1 -1
- package/lib/esm/internal/render/webgl/EdgeGeometry.d.ts +8 -6
- package/lib/esm/internal/render/webgl/EdgeGeometry.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/EdgeGeometry.js +21 -7
- package/lib/esm/internal/render/webgl/EdgeGeometry.js.map +1 -1
- package/lib/esm/internal/render/webgl/Graphic.d.ts +2 -1
- package/lib/esm/internal/render/webgl/Graphic.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/Graphic.js +2 -0
- package/lib/esm/internal/render/webgl/Graphic.js.map +1 -1
- package/lib/esm/internal/render/webgl/IndexedEdgeGeometry.d.ts +6 -1
- package/lib/esm/internal/render/webgl/IndexedEdgeGeometry.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/IndexedEdgeGeometry.js +19 -4
- package/lib/esm/internal/render/webgl/IndexedEdgeGeometry.js.map +1 -1
- package/lib/esm/internal/render/webgl/Mesh.d.ts +1 -1
- package/lib/esm/internal/render/webgl/Mesh.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/Mesh.js +14 -7
- package/lib/esm/internal/render/webgl/Mesh.js.map +1 -1
- package/lib/esm/internal/render/webgl/SceneCompositor.js +2 -1
- package/lib/esm/internal/render/webgl/SceneCompositor.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/Target.d.ts +2 -1
- package/lib/esm/internal/render/webgl/Target.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/Target.js +3 -1
- package/lib/esm/internal/render/webgl/Target.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/ClassifierTileTree.js +3 -1
- package/lib/esm/internal/tile/ClassifierTileTree.js.map +1 -1
- package/lib/esm/internal/tile/IModelTile.d.ts +1 -0
- package/lib/esm/internal/tile/IModelTile.d.ts.map +1 -1
- package/lib/esm/internal/tile/IModelTile.js +4 -0
- package/lib/esm/internal/tile/IModelTile.js.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.d.ts +4 -2
- package/lib/esm/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.js +60 -2
- package/lib/esm/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js +8 -0
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
- package/lib/esm/internal/tile/OrbitGtTileTree.d.ts +4 -1
- package/lib/esm/internal/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/OrbitGtTileTree.js +5 -1
- package/lib/esm/internal/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/esm/internal/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/PrimaryTileTree.js +5 -4
- package/lib/esm/internal/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts +26 -7
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.js +48 -22
- package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/internal/tile/RealityTileLoader.d.ts +2 -2
- package/lib/esm/internal/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityTileLoader.js +10 -2
- 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/AzureMapsLayerImageryProvider.d.ts +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js +1 -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/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts +4 -0
- package/lib/esm/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js +52 -11
- package/lib/esm/internal/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/WmtsCapabilities.d.ts +7 -0
- package/lib/esm/internal/tile/map/WmtsCapabilities.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/WmtsCapabilities.js +17 -0
- package/lib/esm/internal/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/esm/internal/webgl.d.ts +1 -1
- package/lib/esm/internal/webgl.d.ts.map +1 -1
- package/lib/esm/internal/webgl.js.map +1 -1
- package/lib/esm/properties/AngleDescription.d.ts +4 -1
- package/lib/esm/properties/AngleDescription.d.ts.map +1 -1
- package/lib/esm/properties/AngleDescription.js +10 -2
- package/lib/esm/properties/AngleDescription.js.map +1 -1
- package/lib/esm/properties/FormattedQuantityDescription.d.ts +11 -1
- package/lib/esm/properties/FormattedQuantityDescription.d.ts.map +1 -1
- package/lib/esm/properties/FormattedQuantityDescription.js +7 -2
- package/lib/esm/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/esm/properties/LengthDescription.d.ts +12 -3
- package/lib/esm/properties/LengthDescription.d.ts.map +1 -1
- package/lib/esm/properties/LengthDescription.js +30 -6
- package/lib/esm/properties/LengthDescription.js.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts +103 -7
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.js +208 -23
- package/lib/esm/quantity-formatting/QuantityFormatter.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 +4 -2
- 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/MeshArgs.d.ts +8 -3
- package/lib/esm/render/MeshArgs.d.ts.map +1 -1
- package/lib/esm/render/MeshArgs.js.map +1 -1
- package/lib/esm/render/RenderGraphic.d.ts +1 -1
- package/lib/esm/render/RenderGraphic.d.ts.map +1 -1
- package/lib/esm/render/RenderGraphic.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.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/GltfReader.d.ts +6 -2
- package/lib/esm/tile/GltfReader.d.ts.map +1 -1
- package/lib/esm/tile/GltfReader.js +154 -19
- package/lib/esm/tile/GltfReader.js.map +1 -1
- package/lib/esm/tile/ImdlReader.js.map +1 -1
- package/lib/esm/tile/RealityTile.d.ts +9 -0
- package/lib/esm/tile/RealityTile.d.ts.map +1 -1
- package/lib/esm/tile/RealityTile.js +12 -0
- package/lib/esm/tile/RealityTile.js.map +1 -1
- package/lib/esm/tile/RealityTileTree.d.ts +4 -0
- package/lib/esm/tile/RealityTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityTileTree.js +4 -0
- package/lib/esm/tile/RealityTileTree.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 +10 -0
- package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
- package/lib/esm/tile/TileAdmin.js +3 -0
- package/lib/esm/tile/TileAdmin.js.map +1 -1
- package/lib/esm/tile/TileGeometryCollector.d.ts +5 -0
- package/lib/esm/tile/TileGeometryCollector.d.ts.map +1 -1
- package/lib/esm/tile/TileGeometryCollector.js.map +1 -1
- package/lib/esm/tile/TileTree.d.ts +15 -2
- package/lib/esm/tile/TileTree.d.ts.map +1 -1
- package/lib/esm/tile/TileTree.js +14 -1
- package/lib/esm/tile/TileTree.js.map +1 -1
- package/lib/esm/tile/TileTreeReference.d.ts +17 -3
- package/lib/esm/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/esm/tile/TileTreeReference.js +11 -5
- package/lib/esm/tile/TileTreeReference.js.map +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.js +1 -1
- 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/MapCartoRectangle.d.ts +10 -0
- package/lib/esm/tile/map/MapCartoRectangle.d.ts.map +1 -1
- package/lib/esm/tile/map/MapCartoRectangle.js +12 -0
- package/lib/esm/tile/map/MapCartoRectangle.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +3 -3
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js +9 -5
- 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 +1 -1
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tile/map/QuadId.d.ts +15 -0
- package/lib/esm/tile/map/QuadId.d.ts.map +1 -1
- package/lib/esm/tile/map/QuadId.js +12 -0
- package/lib/esm/tile/map/QuadId.js.map +1 -1
- package/lib/esm/tile/map/TerrainMeshProvider.d.ts +1 -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/AccuDrawViewportUI.d.ts +7 -0
- package/lib/esm/tools/AccuDrawViewportUI.d.ts.map +1 -1
- package/lib/esm/tools/AccuDrawViewportUI.js +14 -0
- package/lib/esm/tools/AccuDrawViewportUI.js.map +1 -1
- package/lib/esm/tools/ClipViewTool.d.ts.map +1 -1
- package/lib/esm/tools/ClipViewTool.js +18 -7
- package/lib/esm/tools/ClipViewTool.js.map +1 -1
- package/lib/esm/tools/ElementSetTool.d.ts +9 -1
- package/lib/esm/tools/ElementSetTool.d.ts.map +1 -1
- package/lib/esm/tools/ElementSetTool.js +132 -9
- package/lib/esm/tools/ElementSetTool.js.map +1 -1
- package/lib/esm/tools/IdleTool.d.ts.map +1 -1
- package/lib/esm/tools/IdleTool.js +4 -1
- package/lib/esm/tools/IdleTool.js.map +1 -1
- package/lib/esm/tools/MeasureTool.d.ts +9 -0
- package/lib/esm/tools/MeasureTool.d.ts.map +1 -1
- package/lib/esm/tools/MeasureTool.js +57 -24
- package/lib/esm/tools/MeasureTool.js.map +1 -1
- package/lib/esm/tools/PrimitiveTool.d.ts +1 -1
- package/lib/esm/tools/PrimitiveTool.d.ts.map +1 -1
- package/lib/esm/tools/PrimitiveTool.js +4 -3
- package/lib/esm/tools/PrimitiveTool.js.map +1 -1
- package/lib/esm/tools/SelectTool.d.ts +2 -2
- package/lib/esm/tools/SelectTool.d.ts.map +1 -1
- package/lib/esm/tools/SelectTool.js +26 -97
- package/lib/esm/tools/SelectTool.js.map +1 -1
- package/lib/esm/tools/Tool.d.ts +10 -1
- package/lib/esm/tools/Tool.d.ts.map +1 -1
- package/lib/esm/tools/Tool.js +27 -4
- package/lib/esm/tools/Tool.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.d.ts +1 -0
- package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +59 -18
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/tools/ToolAssistance.d.ts +1 -1
- package/lib/esm/tools/ToolAssistance.js.map +1 -1
- package/lib/esm/tools/ToolSettings.d.ts +5 -0
- package/lib/esm/tools/ToolSettings.d.ts.map +1 -1
- package/lib/esm/tools/ToolSettings.js +5 -0
- package/lib/esm/tools/ToolSettings.js.map +1 -1
- package/lib/esm/tools/ViewTool.d.ts +1 -2
- package/lib/esm/tools/ViewTool.d.ts.map +1 -1
- package/lib/esm/tools/ViewTool.js +143 -84
- package/lib/esm/tools/ViewTool.js.map +1 -1
- package/lib/public/images/google_on_non_white.png +0 -0
- package/lib/public/images/google_on_non_white_hdpi.png +0 -0
- package/lib/public/images/google_on_white.png +0 -0
- package/lib/public/images/google_on_white_hdpi.png +0 -0
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +25 -22
package/lib/cjs/IpcApp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcApp.js","sourceRoot":"","sources":["../../src/IpcApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8F;AAC9F,oDAG4B;AAC5B,uDAA4D;AAC5D,2CAA0D;AAU1D;;;GAGG;AACH,MAAa,MAAM;IACT,MAAM,CAAC,IAAI,CAAgC;IACnD,qEAAqE;IAE7D,MAAM,KAAK,GAAG,KAAwB,OAAO,IAAI,CAAC,IAAK,CAAC,CAAC,CAAC;IAElE,iIAAiI;IAC1H,MAAM,KAAK,OAAO,KAAc,OAAO,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAExE;;;;;;;OAOG;IACI,MAAM,CAAC,WAAW,CAAC,OAAe,EAAE,OAAoB;QAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAA,0BAAY,EAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,cAAc,CAAC,OAAe,EAAE,QAAqB;QACjE,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,IAAA,0BAAY,EAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;;;OASG;IACI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,GAAG,IAAW;QACxD,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAA,0BAAY,EAAC,OAAO,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CAAC,CAAC,sCAAsC;QACtE,MAAM,qBAAS,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC3C,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,KAAK,CAAC,QAAQ;QAC1B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,MAAM,qBAAS,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;;AAtIH,wBAuIC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAsB,mBAAmB;IAIhC,YAAY;QACjB,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAW,EAAE,QAAgB,EAAE,GAAG,IAAW,EAAE,EAAE;YAC5F,MAAM,IAAI,GAAI,IAAY,CAAC,QAAQ,CAAC,CAAC;YACrC,IAAI,OAAO,IAAI,KAAK,UAAU;gBAC5B,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,gBAAgB,EAAE,WAAW,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,QAAQ,8DAA8D,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YAErL,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,QAAQ;QACpB,OAAQ,IAAK,IAAY,EAA0B,CAAC,YAAY,EAAE,CAAC,CAAC,uFAAuF;IAC7J,CAAC;CACF;AAvBD,kDAuBC;AAED,wCAAwC;AACxC,MAAM,mBAAoB,SAAQ,mBAAmB;IACnD,IAAW,WAAW,KAAK,OAAO,4BAAc,CAAC,SAAS,CAAC,CAAC,CAAC;IACtD,SAAS,KAAK,CAAC;CACvB","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 NativeApp\n */\n\nimport { BentleyError, IModelStatus, JsonUtils, PickAsyncMethods } from \"@itwin/core-bentley\";\nimport {\n BackendError, IModelError, ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketFrontend, iTwinChannel,\n RemoveFunction,\n} from \"@itwin/core-common\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\n\n/**\n * Options for [[IpcApp.startup]]\n * @public\n */\nexport interface IpcAppOptions {\n iModelApp?: IModelAppOptions;\n}\n\n/**\n * The frontend of apps with a dedicated backend that can use [Ipc]($docs/learning/IpcInterface.md).\n * @public\n */\nexport class IpcApp {\n private static _ipc: IpcSocketFrontend | undefined;\n /** Get the implementation of the [[IpcSocketFrontend]] interface. */\n\n private static get ipc(): IpcSocketFrontend { return this._ipc!; }\n\n /** Determine whether Ipc is available for this frontend. This will only be true if [[startup]] has been called on this class. */\n public static get isValid(): boolean { return undefined !== this._ipc; }\n\n /**\n * Establish a message handler function for the supplied channel over Ipc. The handler will be called when messages are sent for\n * the channel via [[BackendIpc.send]].\n * @param channel the name of the channel\n * @param handler the message handler\n * @returns A function to remove the handler\n * @note Ipc is only supported if [[isValid]] is true.\n */\n public static addListener(channel: string, handler: IpcListener): RemoveFunction {\n return this.ipc.addListener(iTwinChannel(channel), handler);\n }\n\n /**\n * Remove a previously registered listener\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\n * @param listener The function passed to [[addListener]]\n */\n public static removeListener(channel: string, listener: IpcListener) {\n this.ipc.removeListener(iTwinChannel(channel), listener);\n }\n\n /**\n * Send a message to the backend via `channel` and expect a result asynchronously. The handler must be established on the backend via [[BackendIpc.handle]]\n * @param channel The name of the channel for the method.\n * @see Electron [ipcRenderer.invoke](https://www.electronjs.org/docs/api/ipc-renderer) documentation for details.\n * Note that this interface may be implemented via Electron for desktop apps, or via\n * [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for mobile or web-based\n * Ipc connections. In either case, the Electron documentation provides the specifications for how it works.\n * @note `args` are serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static async invoke(channel: string, ...args: any[]): Promise<any> {\n return this.ipc.invoke(iTwinChannel(channel), ...args);\n }\n\n /**\n * Send a message over the socket.\n * @param channel The name of the channel for the message.\n * @param data The optional data of the message.\n * @note `data` is serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static send(channel: string, ...data: any[]) {\n return this.ipc.send(iTwinChannel(channel), ...data);\n }\n\n /**\n * Call a method on the backend through an Ipc channel.\n * @param channelName the channel registered by the backend handler.\n * @param methodName the name of a method implemented by the backend handler.\n * @param args arguments to `methodName`\n * @return a Promise with the return value from `methodName`\n * @note If the backend implementation throws an exception, this method will throw an exception with its contents\n * @internal Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async [_callIpcChannel](channelName: string, methodName: string, ...args: any[]): Promise<any> {\n const retVal = (await this.invoke(channelName, methodName, ...args)) as IpcInvokeReturn;\n\n if (retVal.error === undefined)\n return retVal.result; // method was successful\n\n // backend threw an exception, rethrow one on frontend\n const err = retVal.error;\n if (!JsonUtils.isObject(err)) {\n // Exception wasn't an object?\n throw retVal.error; // eslint-disable-line @typescript-eslint/only-throw-error\n }\n\n // Note: for backwards compatibility, if the exception was from a BentleyError on the backend, throw an exception of type `BackendError`.\n if (!BentleyError.isError(err))\n throw Object.assign(new Error(typeof err.message === \"string\" ? err.message : \"unknown error\"), err);\n\n const trimErr = { ...err } as any;\n delete trimErr.iTwinErrorId // these are methods on BackendError and will cause Object.assign to fail.\n delete trimErr.loggingMetadata;\n throw Object.assign(new BackendError(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);\n }\n\n /** @internal\n * @deprecated in 4.8. Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async callIpcChannel(channelName: string, methodName: string, ...args: any[]): Promise<any> {\n return this[_callIpcChannel](channelName, methodName, ...args);\n }\n\n /** Create a type safe Proxy object to make IPC calls to a registered backend interface.\n * @param channelName the channel registered by the backend handler.\n */\n public static makeIpcProxy<K, C extends string = string>(channelName: C): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, methodName, ...args);\n },\n });\n }\n\n /** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a \"methodName\" argument followed by optional arguments\n * @param channelName the channel registered by the backend handler.\n * @param functionName the function to call on the handler.\n */\n public static makeIpcFunctionProxy<K>(channelName: string, functionName: string): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, functionName, methodName, ...args);\n },\n });\n }\n\n /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */\n public static appFunctionIpc = IpcApp.makeIpcProxy<IpcAppFunctions>(ipcAppChannels.functions);\n\n /** start an IpcApp.\n * @note this should not be called directly. It is called by NativeApp.startup */\n public static async startup(ipc: IpcSocketFrontend, opts?: IpcAppOptions) {\n this._ipc = ipc;\n IpcAppNotifyHandler.register(); // receives notifications from backend\n await IModelApp.startup(opts?.iModelApp);\n }\n\n /** @internal */\n public static async shutdown() {\n this._ipc = undefined;\n await IModelApp.shutdown();\n }\n}\n\n/**\n * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply\n * methods to receive notifications from your backend.\n *\n * Create a subclass to implement your Ipc response interface. Your class should be declared like this:\n * ```ts\n * class MyNotificationHandler extends NotificationHandler implements MyNotifications\n * ```\n * to ensure all method names and signatures are correct. Your methods cannot have a return value.\n *\n * Then, call `MyNotificationHandler.register` at startup to connect your class to your channel.\n * @public\n * @extensions\n */\nexport abstract class NotificationHandler {\n /** All subclasses must implement this method to specify their response channel name. */\n public abstract get channelName(): string;\n\n public registerImpl(): RemoveFunction {\n return IpcApp.addListener(this.channelName, (_evt: Event, funcName: string, ...args: any[]) => {\n const func = (this as any)[funcName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${this.constructor.name}.${funcName}\" not found on NotificationHandler registered for channel: ${this.channelName}`);\n\n func.call(this, ...args);\n });\n }\n\n /**\n * Register this class as the handler for notifications on its channel. This static method creates a new instance\n * that becomes the notification handler and is `this` when its methods are called.\n * @returns A function that can be called to remove the handler.\n * @note this method should only be called once per channel. If it is called multiple times, multiple handlers are established.\n */\n public static register(): RemoveFunction {\n return (new (this as any)() as NotificationHandler).registerImpl(); // create an instance of subclass. \"as any\" is necessary because base class is abstract\n }\n}\n\n/** IpcApp notifications from backend */\nclass IpcAppNotifyHandler extends NotificationHandler implements IpcAppNotifications {\n public get channelName() { return ipcAppChannels.appNotify; }\n public notifyApp() { }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IpcApp.js","sourceRoot":"","sources":["../../src/IpcApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8F;AAC9F,oDAG4B;AAC5B,uDAA4D;AAC5D,2CAA0D;AAU1D;;;GAGG;AACH,MAAa,MAAM;IACT,MAAM,CAAC,IAAI,CAAgC;IAC3C,MAAM,CAAC,gBAAgB,CAA6B;IAC5D,qEAAqE;IAE7D,MAAM,KAAK,GAAG,KAAwB,OAAO,IAAI,CAAC,IAAK,CAAC,CAAC,CAAC;IAElE,iIAAiI;IAC1H,MAAM,KAAK,OAAO,KAAc,OAAO,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAExE;;;;;;;OAOG;IACI,MAAM,CAAC,WAAW,CAAC,OAAe,EAAE,OAAoB;QAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,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AC3B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,QAAQ;QACpB,OAAQ,IAAK,IAAY,EAA0B,CAAC,YAAY,EAAE,CAAC,CAAC,uFAAuF;IAC7J,CAAC;CACF;AAvBD,kDAuBC;AAED,wCAAwC;AACxC,MAAM,mBAAoB,SAAQ,mBAAmB;IACnD,IAAW,WAAW,KAAK,OAAO,4BAAc,CAAC,SAAS,CAAC,CAAC,CAAC;IACtD,SAAS,KAAK,CAAC;CACvB","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 NativeApp\n */\n\nimport { BentleyError, IModelStatus, JsonUtils, PickAsyncMethods } from \"@itwin/core-bentley\";\nimport {\n BackendError, IModelError, ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketFrontend, iTwinChannel,\n RemoveFunction,\n} from \"@itwin/core-common\";\nimport { _callIpcChannel } from \"./common/internal/Symbols\";\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\n\n/**\n * Options for [[IpcApp.startup]]\n * @public\n */\nexport interface IpcAppOptions {\n iModelApp?: IModelAppOptions;\n}\n\n/**\n * The frontend of apps with a dedicated backend that can use [Ipc]($docs/learning/IpcInterface.md).\n * @public\n */\nexport class IpcApp {\n private static _ipc: IpcSocketFrontend | undefined;\n private static _removeAppNotify: RemoveFunction | undefined;\n /** Get the implementation of the [[IpcSocketFrontend]] interface. */\n\n private static get ipc(): IpcSocketFrontend { return this._ipc!; }\n\n /** Determine whether Ipc is available for this frontend. This will only be true if [[startup]] has been called on this class. */\n public static get isValid(): boolean { return undefined !== this._ipc; }\n\n /**\n * Establish a message handler function for the supplied channel over Ipc. The handler will be called when messages are sent for\n * the channel via [[BackendIpc.send]].\n * @param channel the name of the channel\n * @param handler the message handler\n * @returns A function to remove the handler\n * @note Ipc is only supported if [[isValid]] is true.\n */\n public static addListener(channel: string, handler: IpcListener): RemoveFunction {\n return this.ipc.addListener(iTwinChannel(channel), handler);\n }\n\n /**\n * Remove a previously registered listener\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\n * @param listener The function passed to [[addListener]]\n */\n public static removeListener(channel: string, listener: IpcListener) {\n this.ipc.removeListener(iTwinChannel(channel), listener);\n }\n\n /**\n * Send a message to the backend via `channel` and expect a result asynchronously. The handler must be established on the backend via [[BackendIpc.handle]]\n * @param channel The name of the channel for the method.\n * @see Electron [ipcRenderer.invoke](https://www.electronjs.org/docs/api/ipc-renderer) documentation for details.\n * Note that this interface may be implemented via Electron for desktop apps, or via\n * [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) for mobile or web-based\n * Ipc connections. In either case, the Electron documentation provides the specifications for how it works.\n * @note `args` are serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static async invoke(channel: string, ...args: any[]): Promise<any> {\n return this.ipc.invoke(iTwinChannel(channel), ...args);\n }\n\n /**\n * Send a message over the socket.\n * @param channel The name of the channel for the message.\n * @param data The optional data of the message.\n * @note `data` is serialized with the [Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), so only\n * primitive types and `ArrayBuffers` are allowed.\n */\n public static send(channel: string, ...data: any[]) {\n return this.ipc.send(iTwinChannel(channel), ...data);\n }\n\n /**\n * Call a method on the backend through an Ipc channel.\n * @param channelName the channel registered by the backend handler.\n * @param methodName the name of a method implemented by the backend handler.\n * @param args arguments to `methodName`\n * @return a Promise with the return value from `methodName`\n * @note If the backend implementation throws an exception, this method will throw an exception with its contents\n * @internal Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async [_callIpcChannel](channelName: string, methodName: string, ...args: any[]): Promise<any> {\n const retVal = (await this.invoke(channelName, methodName, ...args)) as IpcInvokeReturn;\n\n if (retVal.error === undefined)\n return retVal.result; // method was successful\n\n // backend threw an exception, rethrow one on frontend\n const err = retVal.error;\n if (!JsonUtils.isObject(err)) {\n // Exception wasn't an object?\n throw retVal.error; // eslint-disable-line @typescript-eslint/only-throw-error\n }\n\n // Note: for backwards compatibility, if the exception was from a BentleyError on the backend, throw an exception of type `BackendError`.\n if (!BentleyError.isError(err))\n throw Object.assign(new Error(typeof err.message === \"string\" ? err.message : \"unknown error\"), err);\n\n const trimErr = { ...err } as any;\n delete trimErr.iTwinErrorId // these are methods on BackendError and will cause Object.assign to fail.\n delete trimErr.loggingMetadata;\n throw Object.assign(new BackendError(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);\n }\n\n /** @internal\n * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[makeIpcProxy]] for a type-safe interface.\n */\n public static async callIpcChannel(channelName: string, methodName: string, ...args: any[]): Promise<any> {\n return this[_callIpcChannel](channelName, methodName, ...args);\n }\n\n /** Create a type safe Proxy object to make IPC calls to a registered backend interface.\n * @param channelName the channel registered by the backend handler.\n */\n public static makeIpcProxy<K, C extends string = string>(channelName: C): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, methodName, ...args);\n },\n });\n }\n\n /** Create a type safe Proxy object to call an IPC function on a of registered backend handler that accepts a \"methodName\" argument followed by optional arguments\n * @param channelName the channel registered by the backend handler.\n * @param functionName the function to call on the handler.\n */\n public static makeIpcFunctionProxy<K>(channelName: string, functionName: string): PickAsyncMethods<K> {\n return new Proxy({} as PickAsyncMethods<K>, {\n get(_target, methodName: string) {\n return async (...args: any[]) =>\n IpcApp[_callIpcChannel](channelName, functionName, methodName, ...args);\n },\n });\n }\n\n /** A Proxy to call one of the [IpcAppFunctions]($common) functions via IPC. */\n public static appFunctionIpc = IpcApp.makeIpcProxy<IpcAppFunctions>(ipcAppChannels.functions);\n\n /** start an IpcApp.\n * @note this should not be called directly. It is called by NativeApp.startup */\n public static async startup(ipc: IpcSocketFrontend, opts?: IpcAppOptions) {\n this._ipc = ipc;\n this._removeAppNotify = IpcAppNotifyHandler.register(); // receives notifications from backend\n await IModelApp.startup(opts?.iModelApp);\n }\n\n /** @internal */\n public static async shutdown() {\n this._removeAppNotify?.();\n this._ipc = undefined;\n await IModelApp.shutdown();\n }\n}\n\n/**\n * Base class for all implementations of an Ipc notification response interface. This class is implemented on your frontend to supply\n * methods to receive notifications from your backend.\n *\n * Create a subclass to implement your Ipc response interface. Your class should be declared like this:\n * ```ts\n * class MyNotificationHandler extends NotificationHandler implements MyNotifications\n * ```\n * to ensure all method names and signatures are correct. Your methods cannot have a return value.\n *\n * Then, call `MyNotificationHandler.register` at startup to connect your class to your channel.\n * @public\n * @extensions\n */\nexport abstract class NotificationHandler {\n /** All subclasses must implement this method to specify their response channel name. */\n public abstract get channelName(): string;\n\n public registerImpl(): RemoveFunction {\n return IpcApp.addListener(this.channelName, (_evt: Event, funcName: string, ...args: any[]) => {\n const func = (this as any)[funcName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${this.constructor.name}.${funcName}\" not found on NotificationHandler registered for channel: ${this.channelName}`);\n\n func.call(this, ...args);\n });\n }\n\n /**\n * Register this class as the handler for notifications on its channel. This static method creates a new instance\n * that becomes the notification handler and is `this` when its methods are called.\n * @returns A function that can be called to remove the handler.\n * @note this method should only be called once per channel. If it is called multiple times, multiple handlers are established.\n */\n public static register(): RemoveFunction {\n return (new (this as any)() as NotificationHandler).registerImpl(); // create an instance of subclass. \"as any\" is necessary because base class is abstract\n }\n}\n\n/** IpcApp notifications from backend */\nclass IpcAppNotifyHandler extends NotificationHandler implements IpcAppNotifications {\n public get channelName() { return ipcAppChannels.appNotify; }\n public notifyApp() { }\n}\n"]}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import { BentleyError, GuidString, LoggingMetaData, RealityDataStatus } from "@itwin/core-bentley";
|
|
5
5
|
import { Cartographic, EcefLocation, OrbitGtBlobProps, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey } from "@itwin/core-common";
|
|
6
6
|
import { Range3d } from "@itwin/core-geometry";
|
|
7
|
+
import { DecorateContext } from "./ViewContext";
|
|
8
|
+
import { ScreenViewport } from "./Viewport";
|
|
7
9
|
/**
|
|
8
10
|
* Reality Data Operation error
|
|
9
11
|
* @alpha
|
|
@@ -133,7 +135,7 @@ export declare namespace RealityDataSource {
|
|
|
133
135
|
* The provider's name is stored in a [RealityDataSourceKey]($common). When the [[RealityDataSource]] is requested from the key,
|
|
134
136
|
* the provider is looked up in [[IModelApp.realityDataSourceProviders]] by its name and, if found, its [[createRealityDataSource]] method
|
|
135
137
|
* is invoked to produce the reality data source.
|
|
136
|
-
* @
|
|
138
|
+
* @beta
|
|
137
139
|
*/
|
|
138
140
|
export interface RealityDataSourceProvider {
|
|
139
141
|
/** Produce a RealityDataSource for the specified `key`.
|
|
@@ -142,11 +144,19 @@ export interface RealityDataSourceProvider {
|
|
|
142
144
|
* @returns the requested reality data source, or `undefined` if it could not be produced.
|
|
143
145
|
*/
|
|
144
146
|
createRealityDataSource(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;
|
|
147
|
+
/** Optionally add any decorations specific to this reality data source provider.
|
|
148
|
+
* For example, the Google Photorealistic 3D Tiles reality data source provider will add the Google logo.
|
|
149
|
+
*/
|
|
150
|
+
decorate?(_context: DecorateContext): void;
|
|
151
|
+
/** Optionally add attribution logo cards to the viewport's logo div. */
|
|
152
|
+
addAttributions?(cards: HTMLTableElement, vp: ScreenViewport): Promise<void>;
|
|
153
|
+
/** Enables cached decorations for this provider. @see [[ViewportDecorator.useCachedDecorations]] */
|
|
154
|
+
useCachedDecorations?: true | undefined;
|
|
145
155
|
}
|
|
146
156
|
/** A registry of [[RealityDataSourceProvider]]s identified by their unique names. The registry can be accessed via [[IModelApp.realityDataSourceProviders]].
|
|
147
157
|
* It includes a handful of built-in providers for sources like Cesium ION, ContextShare, OrbitGT, and arbitrary public-accessible URLs.
|
|
148
|
-
* Any number of additional providers can be registered. They should typically be registered just after [[
|
|
149
|
-
* @
|
|
158
|
+
* Any number of additional providers can be registered. They should typically be registered just after [[IModelApp.startup]].
|
|
159
|
+
* @beta
|
|
150
160
|
*/
|
|
151
161
|
export declare class RealityDataSourceProviderRegistry {
|
|
152
162
|
private readonly _providers;
|
|
@@ -157,4 +167,56 @@ export declare class RealityDataSourceProviderRegistry {
|
|
|
157
167
|
/** Look up the provider registered by the specified `name`. */
|
|
158
168
|
find(name: string): RealityDataSourceProvider | undefined;
|
|
159
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Options for creating a Google Photorealistic 3D Tiles reality data source provider.
|
|
172
|
+
* The caller must provide either an API key or a function that returns an auth token.
|
|
173
|
+
* @beta
|
|
174
|
+
*/
|
|
175
|
+
export type Google3dTilesProviderOptions = {
|
|
176
|
+
/** Google Map Tiles API Key used to access Google 3D Tiles. */
|
|
177
|
+
apiKey: string;
|
|
178
|
+
getAuthToken?: never;
|
|
179
|
+
/** If true, the data attributions/copyrights from the Google 3D Tiles will be displayed on screen. The Google Maps logo will always be displayed. Defaults to `true`. */
|
|
180
|
+
showCreditsOnScreen?: boolean;
|
|
181
|
+
} | {
|
|
182
|
+
apiKey?: never;
|
|
183
|
+
/** Function that returns an OAuth token for authenticating with Google 3D Tiles. This token is expected to not contain the "Bearer" prefix. */
|
|
184
|
+
getAuthToken: () => Promise<string>;
|
|
185
|
+
/** If true, the data attributions/copyrights from the Google 3D Tiles will be displayed on screen. The Google Maps logo will always be displayed. Defaults to `true`. */
|
|
186
|
+
showCreditsOnScreen?: boolean;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Will provide Google Photorealistic 3D Tiles (in 3dTile format).
|
|
190
|
+
* A valid API key or getAuthToken fuction must be supplied when creating this provider.
|
|
191
|
+
* To use this provider, you must register it with [[IModelApp.realityDataSourceProviders]].
|
|
192
|
+
* Example usage:
|
|
193
|
+
* ```ts
|
|
194
|
+
* [[include:GooglePhotorealistic3dTiles_providerApiKey]]
|
|
195
|
+
* ```
|
|
196
|
+
* @see [Google Photorealistic 3D Tiles]($docs/learning/frontend/GooglePhotorealistic3dTiles.md)
|
|
197
|
+
* @beta
|
|
198
|
+
*/
|
|
199
|
+
export declare class Google3dTilesProvider implements RealityDataSourceProvider {
|
|
200
|
+
/** Google Map Tiles API Key used to access Google 3D Tiles. */
|
|
201
|
+
private _apiKey?;
|
|
202
|
+
/** Function that returns an OAuth token for authenticating with Google 3D Tiles. This token is expected to not contain the "Bearer" prefix. */
|
|
203
|
+
private _getAuthToken?;
|
|
204
|
+
/** Decorator for Google Maps logos. */
|
|
205
|
+
private _decorator;
|
|
206
|
+
/** Enables cached decorations for this provider. @see [[ViewportDecorator.useCachedDecorations]] */
|
|
207
|
+
readonly useCachedDecorations = true;
|
|
208
|
+
createRealityDataSource(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;
|
|
209
|
+
constructor(options: Google3dTilesProviderOptions);
|
|
210
|
+
/**
|
|
211
|
+
* Initialize the Google 3D Tiles reality data source provider by activating its decorator, which consists of loading the correct Google Maps logo.
|
|
212
|
+
* @returns `true` if the decorator was successfully activated, otherwise `false`.
|
|
213
|
+
*/
|
|
214
|
+
initialize(): Promise<boolean>;
|
|
215
|
+
decorate(_context: DecorateContext): void;
|
|
216
|
+
addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void>;
|
|
217
|
+
}
|
|
218
|
+
/** Returns the URL used for retrieving Google Photorealistic 3D Tiles.
|
|
219
|
+
* @beta
|
|
220
|
+
*/
|
|
221
|
+
export declare function getGoogle3dTilesUrl(): string;
|
|
160
222
|
//# sourceMappingURL=RealityDataSource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealityDataSource.d.ts","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"RealityDataSource.d.ts","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAiB,UAAU,EAAU,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC1H,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7J,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAS/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAI5C;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;gBAC7B,WAAW,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe;CAGlG;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,6DAA6D;IAC7D,QAAQ,EAAE,YAAY,GAAG,YAAY,CAAC;IACtC,4CAA4C;IAC5C,UAAU,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,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|
-
exports.RealityDataSourceProviderRegistry = exports.RealityDataSource = exports.RealityDataError = void 0;
|
|
3
|
+
exports.Google3dTilesProvider = exports.RealityDataSourceProviderRegistry = exports.RealityDataSource = exports.RealityDataError = void 0;
|
|
4
|
+
exports.getGoogle3dTilesUrl = getGoogle3dTilesUrl;
|
|
4
5
|
/*---------------------------------------------------------------------------------------------
|
|
5
6
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
7
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -15,7 +16,9 @@ const internal_1 = require("./tile/internal");
|
|
|
15
16
|
const RealityDataSourceTilesetUrlImpl_1 = require("./RealityDataSourceTilesetUrlImpl");
|
|
16
17
|
const RealityDataSourceContextShareImpl_1 = require("./RealityDataSourceContextShareImpl");
|
|
17
18
|
const RealityDataSourceCesiumIonAssetImpl_1 = require("./RealityDataSourceCesiumIonAssetImpl");
|
|
19
|
+
const RealityDataSourceGoogle3dTilesImpl_1 = require("./internal/RealityDataSourceGoogle3dTilesImpl");
|
|
18
20
|
const IModelApp_1 = require("./IModelApp");
|
|
21
|
+
const GoogleMapsDecorator_1 = require("./internal/GoogleMapsDecorator");
|
|
19
22
|
const loggerCategory = FrontendLoggerCategory_1.FrontendLoggerCategory.RealityData;
|
|
20
23
|
/**
|
|
21
24
|
* Reality Data Operation error
|
|
@@ -125,8 +128,8 @@ var RealityDataSource;
|
|
|
125
128
|
})(RealityDataSource || (exports.RealityDataSource = RealityDataSource = {}));
|
|
126
129
|
/** A registry of [[RealityDataSourceProvider]]s identified by their unique names. The registry can be accessed via [[IModelApp.realityDataSourceProviders]].
|
|
127
130
|
* It includes a handful of built-in providers for sources like Cesium ION, ContextShare, OrbitGT, and arbitrary public-accessible URLs.
|
|
128
|
-
* Any number of additional providers can be registered. They should typically be registered just after [[
|
|
129
|
-
* @
|
|
131
|
+
* Any number of additional providers can be registered. They should typically be registered just after [[IModelApp.startup]].
|
|
132
|
+
* @beta
|
|
130
133
|
*/
|
|
131
134
|
class RealityDataSourceProviderRegistry {
|
|
132
135
|
_providers = new Map();
|
|
@@ -156,4 +159,77 @@ class RealityDataSourceProviderRegistry {
|
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
exports.RealityDataSourceProviderRegistry = RealityDataSourceProviderRegistry;
|
|
162
|
+
/**
|
|
163
|
+
* Will provide Google Photorealistic 3D Tiles (in 3dTile format).
|
|
164
|
+
* A valid API key or getAuthToken fuction must be supplied when creating this provider.
|
|
165
|
+
* To use this provider, you must register it with [[IModelApp.realityDataSourceProviders]].
|
|
166
|
+
* Example usage:
|
|
167
|
+
* ```ts
|
|
168
|
+
* [[include:GooglePhotorealistic3dTiles_providerApiKey]]
|
|
169
|
+
* ```
|
|
170
|
+
* @see [Google Photorealistic 3D Tiles]($docs/learning/frontend/GooglePhotorealistic3dTiles.md)
|
|
171
|
+
* @beta
|
|
172
|
+
*/
|
|
173
|
+
class Google3dTilesProvider {
|
|
174
|
+
/** Google Map Tiles API Key used to access Google 3D Tiles. */
|
|
175
|
+
_apiKey;
|
|
176
|
+
/** Function that returns an OAuth token for authenticating with Google 3D Tiles. This token is expected to not contain the "Bearer" prefix. */
|
|
177
|
+
_getAuthToken;
|
|
178
|
+
/** Decorator for Google Maps logos. */
|
|
179
|
+
_decorator;
|
|
180
|
+
/** Enables cached decorations for this provider. @see [[ViewportDecorator.useCachedDecorations]] */
|
|
181
|
+
useCachedDecorations = true;
|
|
182
|
+
async createRealityDataSource(key, iTwinId) {
|
|
183
|
+
if (!this._apiKey && !this._getAuthToken) {
|
|
184
|
+
core_bentley_1.Logger.logError(loggerCategory, "Either an API key or getAuthToken function are required to create a Google3dTilesProvider.");
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
return RealityDataSourceGoogle3dTilesImpl_1.RealityDataSourceGoogle3dTilesImpl.createFromKey(key, iTwinId, this._apiKey, this._getAuthToken);
|
|
188
|
+
}
|
|
189
|
+
constructor(options) {
|
|
190
|
+
this._apiKey = options.apiKey;
|
|
191
|
+
this._getAuthToken = options.getAuthToken;
|
|
192
|
+
this._decorator = new GoogleMapsDecorator_1.GoogleMapsDecorator(options.showCreditsOnScreen ?? true);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Initialize the Google 3D Tiles reality data source provider by activating its decorator, which consists of loading the correct Google Maps logo.
|
|
196
|
+
* @returns `true` if the decorator was successfully activated, otherwise `false`.
|
|
197
|
+
*/
|
|
198
|
+
async initialize() {
|
|
199
|
+
const isActivated = await this._decorator.activate("satellite");
|
|
200
|
+
if (!isActivated) {
|
|
201
|
+
const msg = "Failed to activate decorator";
|
|
202
|
+
core_bentley_1.Logger.logError(loggerCategory, msg);
|
|
203
|
+
throw new core_bentley_1.BentleyError(core_bentley_1.BentleyStatus.ERROR, msg);
|
|
204
|
+
}
|
|
205
|
+
return isActivated;
|
|
206
|
+
}
|
|
207
|
+
decorate(_context) {
|
|
208
|
+
this._decorator.decorate(_context);
|
|
209
|
+
}
|
|
210
|
+
async addAttributions(cards, vp) {
|
|
211
|
+
const copyrightMap = (0, GoogleMapsDecorator_1.getCopyrights)(vp);
|
|
212
|
+
// Only add another logo card if the tiles have copyright
|
|
213
|
+
if (copyrightMap.size > 0) {
|
|
214
|
+
// Order by most occurances to least
|
|
215
|
+
// See https://developers.google.com/maps/documentation/tile/create-renderer#display-attributions
|
|
216
|
+
const sortedCopyrights = [...copyrightMap.entries()].sort((a, b) => b[1] - a[1]);
|
|
217
|
+
let copyrightMsg = "Data provided by:<br><ul>";
|
|
218
|
+
copyrightMsg += sortedCopyrights.map(([key]) => `<li>${key}</li>`).join("");
|
|
219
|
+
copyrightMsg += "</ul>";
|
|
220
|
+
cards.appendChild(IModelApp_1.IModelApp.makeLogoCard({
|
|
221
|
+
iconSrc: `${IModelApp_1.IModelApp.publicPath}images/google_on_white_hdpi.png`,
|
|
222
|
+
heading: "Google Photorealistic 3D Tiles",
|
|
223
|
+
notice: copyrightMsg
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
exports.Google3dTilesProvider = Google3dTilesProvider;
|
|
229
|
+
/** Returns the URL used for retrieving Google Photorealistic 3D Tiles.
|
|
230
|
+
* @beta
|
|
231
|
+
*/
|
|
232
|
+
function getGoogle3dTilesUrl() {
|
|
233
|
+
return "https://tile.googleapis.com/v1/3dtiles/root.json";
|
|
234
|
+
}
|
|
159
235
|
//# sourceMappingURL=RealityDataSource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealityDataSource.js","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAA2G;AAC3G,oDAA6J;AAC7J,4EAAyE;AACzE,8CAAkG;AAClG,uFAAoF;AACpF,2FAAwF;AACxF,+FAA4F;AAC5F,2CAAwC;AAGxC,MAAM,cAAc,GAAW,+CAAsB,CAAC,WAAW,CAAC;AAElE;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,2BAAY;IAChD,YAAmB,WAA8B,EAAE,OAAe,EAAE,WAA6B;QAC/F,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;CACF;AAJD,4CAIC;AAkGD;;GAEG;AACH,IAAiB,iBAAiB,CAuFjC;AAvFD,WAAiB,iBAAiB;IAChC;;;;;OAKG;IACH,SAAgB,gBAAgB,CAAC,UAAkB,EAAE,aAAmC,EAAE,WAA+B;QACvH,IAAI,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,+BAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC/E,IAAI,iCAAsB,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC;YACrD,MAAM,QAAQ,GAAG,iCAAmB,CAAC,cAAc,CAAC;YACpD,IAAI,iBAAiB,GAAyB,EAAE,QAAQ,EAAE,MAAM,EAAE,E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CAAC,CAAC;IACtC,CAAC;IAED,+DAA+D;IACxD,IAAI,CAAC,IAAY;QACtB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;CACF;AA7BD,8EA6BC","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 */\nimport { BentleyError, GuidString, Logger, LoggingMetaData, RealityDataStatus } from \"@itwin/core-bentley\";\nimport { Cartographic, EcefLocation, OrbitGtBlobProps, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey } from \"@itwin/core-common\";\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\nimport { CesiumIonAssetProvider, ContextShareProvider, getCesiumAssetUrl } from \"./tile/internal\";\nimport { RealityDataSourceTilesetUrlImpl } from \"./RealityDataSourceTilesetUrlImpl\";\nimport { RealityDataSourceContextShareImpl } from \"./RealityDataSourceContextShareImpl\";\nimport { RealityDataSourceCesiumIonAssetImpl } from \"./RealityDataSourceCesiumIonAssetImpl\";\nimport { IModelApp } from \"./IModelApp\";\nimport { Range3d } from \"@itwin/core-geometry\";\n\nconst loggerCategory: string = FrontendLoggerCategory.RealityData;\n\n/**\n * Reality Data Operation error\n * @alpha\n */\nexport class RealityDataError extends BentleyError {\n public constructor(errorNumber: RealityDataStatus, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n }\n}\n\n/** This interface provide spatial location and volume of interest, in meters, centered around `spatial location`\n * @alpha\n */\nexport interface SpatialLocationAndExtents {\n /** location of the point at the center of the reaity data */\n location: Cartographic | EcefLocation;\n /** extents of the volume around location */\n worldRange: Range3d;\n /** true if this reality data is geolocated\n * A reality data is geolocated when we can compute a valid position relative to the earth surface.\n * Note that some reality data contains custom coordinate system without any information on the relative position on earth.\n * These reality data will have a location and worldRange but will be identified by the isGeoLocated set to false.\n */\n isGeolocated: boolean;\n}\n\n/** This interface provides information to identify the product and engine that create this reality data\n * @alpha\n */\nexport interface PublisherProductInfo {\n /** product that create this reality data */\n product: string;\n /** engine that create this reality data */\n engine: string;\n /** the version of the engine that create this reality data */\n version: string;\n}\n\n/** This interface provide methods used to access a reality data from a reality data provider\n * @beta\n */\nexport interface RealityDataSource {\n readonly key: RealityDataSourceKey;\n readonly isContextShare: boolean;\n readonly realityDataId: string | undefined;\n /** Metatdata on the reality data source */\n readonly realityData: RealityData | undefined;\n /** The reality data type (e.g.: \"RealityMesh3DTiles\", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/\n readonly realityDataType: string | undefined;\n /** This method returns the URL to obtain the Reality Data properties.\n * @param iTwinId id of associated iTwin project\n * @returns string containing the URL to reality data.\n */\n getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;\n /** If true, the geometricError property of the tiles will be used to compute screen-space error.\n * @alpha\n */\n readonly usesGeometricError?: boolean;\n /** If [[usesGeometricError]] is `true`, optionally specifies the maximum error, in pixels, to permit for a tile before requiring refinement of that tile.\n * Default: 16\n * @alpha\n */\n readonly maximumScreenSpaceError?: number;\n /** Given the URL of a tile's content, return the type of that content.\n * \"tileset\" indicates the content points to a JSON tileset describing the structure of the tile tree below the tile.\n * \"tile\" indicates the content points to a binary representation of the tile's graphics.\n * @alpha\n */\n getTileContentType(url: string): \"tile\" | \"tileset\";\n\n /** Gets a reality data root document json\n * @returns tile data json\n * @internal\n */\n getRootDocument(iTwinId: GuidString | undefined): Promise<any>;\n /** Gets tile content\n * @param name name or path of tile\n * @returns array buffer of tile content\n * @internal\n */\n getTileContent(name: string): Promise<any>;\n /** Gets a tileset's app data json\n * @param name name or path of tile\n * @returns app data json object\n * @internal\n */\n getTileJson(name: string): Promise<any>;\n /** Gets spatial location and extents of this reality data source.\n * Will return undefined if cannot be resolved or is unbounded (cover entire earth eg: Open Street Map Building from Ion Asset)\n * @returns spatial location and extents\n * @throws [[RealityDataError]] if source is invalid or cannot be read\n * @alpha\n */\n getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined>;\n /** Gets information to identify the product and engine that create this reality data\n * Will return undefined if cannot be resolved\n * @returns information to identify the product and engine that create this reality data\n * @alpha\n */\n getPublisherProductInfo(): Promise<PublisherProductInfo | undefined>;\n /** Optional, gets the tileset url associated with the reality data source\n * @returns tileset url\n * @internal\n */\n getTilesetUrl?(): string | undefined;\n}\n/** Utility functions for RealityDataSource\n * @beta\n */\nexport namespace RealityDataSource {\n /** Create a RealityDataSourceKey from a tilesetUrl.\n * @param tilesetUrl the reality data attachment url\n * @param inputProvider identify the RealityDataProvider if known, otherwise function will try to extract it from the tilesetUrl\n * @param inputFormat identify the RealityDataFormat if known, otherwise function will try to extract it from the tilesetUrl\n * @returns the RealityDataSourceKey that uniquely identify a reality data for a provider\n */\n export function createKeyFromUrl(tilesetUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\n let format = inputFormat ? inputFormat : RealityDataFormat.fromUrl(tilesetUrl);\n if (CesiumIonAssetProvider.isProviderUrl(tilesetUrl)) {\n const provider = RealityDataProvider.CesiumIonAsset;\n let cesiumIonAssetKey: RealityDataSourceKey = { provider, format, id: CesiumIonAssetProvider.osmBuildingId }; // default OSM building\n // Parse URL to extract possible asset id and key if provided\n const cesiumAsset = CesiumIonAssetProvider.parseCesiumUrl(tilesetUrl);\n if (cesiumAsset) {\n cesiumIonAssetKey = RealityDataSource.createCesiumIonAssetKey(cesiumAsset.id, cesiumAsset.key);\n }\n return cesiumIonAssetKey;\n }\n\n // Try to extract realityDataId from URL and if not possible, use the url as the key\n if (ContextShareProvider.isProviderUrl(tilesetUrl)) {\n const info = ContextShareProvider.getInfoFromUrl(tilesetUrl);\n const provider = inputProvider ? inputProvider : info.provider;\n format = inputFormat ? inputFormat : info.format;\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id, iTwinId: info.iTwinId };\n return contextShareKey;\n }\n\n // default to tileSetUrl\n const provider2 = inputProvider ? inputProvider : RealityDataProvider.TilesetUrl;\n const urlKey: RealityDataSourceKey = { provider: provider2, format, id: tilesetUrl };\n return urlKey;\n }\n /** @alpha - was used for a very specific case of point cloud (opc) attachment that should not be made public */\n export function createKeyFromBlobUrl(blobUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\n const info = ContextShareProvider.getInfoFromBlobUrl(blobUrl);\n const format = inputFormat ? inputFormat : info.format;\n const provider = inputProvider ? inputProvider : info.provider;\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id };\n return contextShareKey;\n }\n /** @alpha - OrbitGtBlobProps is alpha */\n export function createKeyFromOrbitGtBlobProps(orbitGtBlob: OrbitGtBlobProps, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\n const format = inputFormat ? inputFormat : RealityDataFormat.OPC;\n if (orbitGtBlob.blobFileName && orbitGtBlob.blobFileName.toLowerCase().startsWith(\"http\")) {\n return RealityDataSource.createKeyFromBlobUrl(orbitGtBlob.blobFileName, inputProvider, format);\n } else if (orbitGtBlob.rdsUrl) {\n return RealityDataSource.createKeyFromUrl(orbitGtBlob.rdsUrl, inputProvider, format);\n }\n const provider = inputProvider ? inputProvider : RealityDataProvider.OrbitGtBlob;\n const id = `${orbitGtBlob.accountName}:${orbitGtBlob.containerName}:${orbitGtBlob.blobFileName}:?${orbitGtBlob.sasToken}`;\n return { provider, format, id };\n }\n /** @alpha - OrbitGtBlobProps is alpha */\n export function createOrbitGtBlobPropsFromKey(rdSourceKey: RealityDataSourceKey): OrbitGtBlobProps | undefined {\n if (rdSourceKey.provider !== RealityDataProvider.OrbitGtBlob)\n return undefined;\n const splitIds = rdSourceKey.id.split(\":\");\n const sasTokenIndex = rdSourceKey.id.indexOf(\":?\");\n const sasToken = rdSourceKey.id.substring(sasTokenIndex + 2);\n const orbitGtBlob: OrbitGtBlobProps = {\n accountName: splitIds[0],\n containerName: splitIds[1],\n blobFileName: splitIds[2],\n sasToken,\n };\n return orbitGtBlob;\n }\n /** @internal - Is used by \"fdt attach cesium asset\" keyin*/\n export function createCesiumIonAssetKey(osmAssetId: number, requestKey: string): RealityDataSourceKey {\n const id = getCesiumAssetUrl(osmAssetId,requestKey);\n return {provider: RealityDataProvider.CesiumIonAsset, format: RealityDataFormat.ThreeDTile, id};\n }\n /** Return an instance of a RealityDataSource from a source key.\n * There will aways be only one reality data RealityDataSource for a corresponding reality data source key.\n * @alpha\n */\n export async function fromKey(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\n const provider = IModelApp.realityDataSourceProviders.find(key.provider);\n if (!provider) {\n Logger.logWarning(loggerCategory, `RealityDataSourceProvider \"${key.provider}\" is not registered`);\n return undefined;\n }\n\n return provider.createRealityDataSource(key, iTwinId);\n }\n}\n\n/** A named supplier of [RealityDataSource]]s.\n * The provider's name is stored in a [RealityDataSourceKey]($common). When the [[RealityDataSource]] is requested from the key,\n * the provider is looked up in [[IModelApp.realityDataSourceProviders]] by its name and, if found, its [[createRealityDataSource]] method\n * is invoked to produce the reality data source.\n * @alpha\n */\nexport interface RealityDataSourceProvider {\n /** Produce a RealityDataSource for the specified `key`.\n * @param key Identifies the reality data source.\n * @param iTwinId A default iTwinId to use.\n * @returns the requested reality data source, or `undefined` if it could not be produced.\n */\n createRealityDataSource(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;\n}\n\n/** A registry of [[RealityDataSourceProvider]]s identified by their unique names. The registry can be accessed via [[IModelApp.realityDataSourceProviders]].\n * It includes a handful of built-in providers for sources like Cesium ION, ContextShare, OrbitGT, and arbitrary public-accessible URLs.\n * Any number of additional providers can be registered. They should typically be registered just after [[IModelAp.startup]].\n * @alpha\n */\nexport class RealityDataSourceProviderRegistry {\n private readonly _providers = new Map<string, RealityDataSourceProvider>();\n\n /** @internal */\n public constructor() {\n this.register(RealityDataProvider.CesiumIonAsset, {\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceCesiumIonAssetImpl.createFromKey(key, iTwinId),\n });\n this.register(RealityDataProvider.TilesetUrl, {\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceTilesetUrlImpl.createFromKey(key, iTwinId),\n });\n this.register(RealityDataProvider.ContextShare, {\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceContextShareImpl.createFromKey(key, iTwinId),\n });\n this.register(RealityDataProvider.OrbitGtBlob, {\n // ###TODO separate TilesetUrlImpl\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceTilesetUrlImpl.createFromKey(key, iTwinId),\n });\n }\n\n /** Register `provider` to produce [[RealityDataSource]]s for the specified provider `name`. */\n public register(name: string, provider: RealityDataSourceProvider): void {\n this._providers.set(name, provider);\n }\n\n /** Look up the provider registered by the specified `name`. */\n public find(name: string): RealityDataSourceProvider | undefined {\n return this._providers.get(name);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RealityDataSource.js","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":";;;AA0XA,kDAEC;AA5XD;;;+FAG+F;AAC/F;;GAEG;AACH,sDAA0H;AAC1H,oDAA6J;AAE7J,4EAAyE;AACzE,8CAAkG;AAClG,uFAAoF;AACpF,2FAAwF;AACxF,+FAA4F;AAC5F,sGAAmG;AACnG,2CAAwC;AACxC,wEAAoF;AAIpF,MAAM,cAAc,GAAW,+CAAsB,CAAC,WAAW,CAAC;AAElE;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,2BAAY;IAChD,YAAmB,WAA8B,EAAE,OAAe,EAAE,WAA6B;QAC/F,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;CACF;AAJD,4CAIC;AAkGD;;GAEG;AACH,IAAiB,iBAAiB,CAuFjC;AAvFD,WAAiB,iBAAiB;IAChC;;;;;OAKG;IACH,SAAgB,gBAAgB,CAAC,UAAkB,EAA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CAAC,UAAU,iCAAiC;gBACjE,OAAO,EAAE,gCAAgC;gBACzC,MAAM,EAAE,YAAY;aACrB,CAAC,CAAC,CAAC;QACN,CAAC;IACH,CAAC;CACF;AA9DD,sDA8DC;AAED;;GAEG;AACH,SAAgB,mBAAmB;IACjC,OAAO,kDAAkD,CAAC;AAC5D,CAAC","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 */\nimport { BentleyError, BentleyStatus, GuidString, Logger, LoggingMetaData, RealityDataStatus } from \"@itwin/core-bentley\";\nimport { Cartographic, EcefLocation, OrbitGtBlobProps, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey } from \"@itwin/core-common\";\nimport { Range3d } from \"@itwin/core-geometry\";\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\nimport { CesiumIonAssetProvider, ContextShareProvider, getCesiumAssetUrl } from \"./tile/internal\";\nimport { RealityDataSourceTilesetUrlImpl } from \"./RealityDataSourceTilesetUrlImpl\";\nimport { RealityDataSourceContextShareImpl } from \"./RealityDataSourceContextShareImpl\";\nimport { RealityDataSourceCesiumIonAssetImpl } from \"./RealityDataSourceCesiumIonAssetImpl\";\nimport { RealityDataSourceGoogle3dTilesImpl } from \"./internal/RealityDataSourceGoogle3dTilesImpl\";\nimport { IModelApp } from \"./IModelApp\";\nimport { getCopyrights, GoogleMapsDecorator } from \"./internal/GoogleMapsDecorator\";\nimport { DecorateContext } from \"./ViewContext\";\nimport { ScreenViewport } from \"./Viewport\";\n\nconst loggerCategory: string = FrontendLoggerCategory.RealityData;\n\n/**\n * Reality Data Operation error\n * @alpha\n */\nexport class RealityDataError extends BentleyError {\n public constructor(errorNumber: RealityDataStatus, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n }\n}\n\n/** This interface provide spatial location and volume of interest, in meters, centered around `spatial location`\n * @alpha\n */\nexport interface SpatialLocationAndExtents {\n /** location of the point at the center of the reaity data */\n location: Cartographic | EcefLocation;\n /** extents of the volume around location */\n worldRange: Range3d;\n /** true if this reality data is geolocated\n * A reality data is geolocated when we can compute a valid position relative to the earth surface.\n * Note that some reality data contains custom coordinate system without any information on the relative position on earth.\n * These reality data will have a location and worldRange but will be identified by the isGeoLocated set to false.\n */\n isGeolocated: boolean;\n}\n\n/** This interface provides information to identify the product and engine that create this reality data\n * @alpha\n */\nexport interface PublisherProductInfo {\n /** product that create this reality data */\n product: string;\n /** engine that create this reality data */\n engine: string;\n /** the version of the engine that create this reality data */\n version: string;\n}\n\n/** This interface provide methods used to access a reality data from a reality data provider\n * @beta\n */\nexport interface RealityDataSource {\n readonly key: RealityDataSourceKey;\n readonly isContextShare: boolean;\n readonly realityDataId: string | undefined;\n /** Metatdata on the reality data source */\n readonly realityData: RealityData | undefined;\n /** The reality data type (e.g.: \"RealityMesh3DTiles\", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/\n readonly realityDataType: string | undefined;\n /** This method returns the URL to obtain the Reality Data properties.\n * @param iTwinId id of associated iTwin project\n * @returns string containing the URL to reality data.\n */\n getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;\n /** If true, the geometricError property of the tiles will be used to compute screen-space error.\n * @alpha\n */\n readonly usesGeometricError?: boolean;\n /** If [[usesGeometricError]] is `true`, optionally specifies the maximum error, in pixels, to permit for a tile before requiring refinement of that tile.\n * Default: 16\n * @alpha\n */\n readonly maximumScreenSpaceError?: number;\n /** Given the URL of a tile's content, return the type of that content.\n * \"tileset\" indicates the content points to a JSON tileset describing the structure of the tile tree below the tile.\n * \"tile\" indicates the content points to a binary representation of the tile's graphics.\n * @alpha\n */\n getTileContentType(url: string): \"tile\" | \"tileset\";\n\n /** Gets a reality data root document json\n * @returns tile data json\n * @internal\n */\n getRootDocument(iTwinId: GuidString | undefined): Promise<any>;\n /** Gets tile content\n * @param name name or path of tile\n * @returns array buffer of tile content\n * @internal\n */\n getTileContent(name: string): Promise<any>;\n /** Gets a tileset's app data json\n * @param name name or path of tile\n * @returns app data json object\n * @internal\n */\n getTileJson(name: string): Promise<any>;\n /** Gets spatial location and extents of this reality data source.\n * Will return undefined if cannot be resolved or is unbounded (cover entire earth eg: Open Street Map Building from Ion Asset)\n * @returns spatial location and extents\n * @throws [[RealityDataError]] if source is invalid or cannot be read\n * @alpha\n */\n getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined>;\n /** Gets information to identify the product and engine that create this reality data\n * Will return undefined if cannot be resolved\n * @returns information to identify the product and engine that create this reality data\n * @alpha\n */\n getPublisherProductInfo(): Promise<PublisherProductInfo | undefined>;\n /** Optional, gets the tileset url associated with the reality data source\n * @returns tileset url\n * @internal\n */\n getTilesetUrl?(): string | undefined;\n}\n/** Utility functions for RealityDataSource\n * @beta\n */\nexport namespace RealityDataSource {\n /** Create a RealityDataSourceKey from a tilesetUrl.\n * @param tilesetUrl the reality data attachment url\n * @param inputProvider identify the RealityDataProvider if known, otherwise function will try to extract it from the tilesetUrl\n * @param inputFormat identify the RealityDataFormat if known, otherwise function will try to extract it from the tilesetUrl\n * @returns the RealityDataSourceKey that uniquely identify a reality data for a provider\n */\n export function createKeyFromUrl(tilesetUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\n let format = inputFormat ? inputFormat : RealityDataFormat.fromUrl(tilesetUrl);\n if (CesiumIonAssetProvider.isProviderUrl(tilesetUrl)) {\n const provider = RealityDataProvider.CesiumIonAsset;\n let cesiumIonAssetKey: RealityDataSourceKey = { provider, format, id: CesiumIonAssetProvider.osmBuildingId }; // default OSM building\n // Parse URL to extract possible asset id and key if provided\n const cesiumAsset = CesiumIonAssetProvider.parseCesiumUrl(tilesetUrl);\n if (cesiumAsset) {\n cesiumIonAssetKey = RealityDataSource.createCesiumIonAssetKey(cesiumAsset.id, cesiumAsset.key);\n }\n return cesiumIonAssetKey;\n }\n\n // Try to extract realityDataId from URL and if not possible, use the url as the key\n if (ContextShareProvider.isProviderUrl(tilesetUrl)) {\n const info = ContextShareProvider.getInfoFromUrl(tilesetUrl);\n const provider = inputProvider ? inputProvider : info.provider;\n format = inputFormat ? inputFormat : info.format;\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id, iTwinId: info.iTwinId };\n return contextShareKey;\n }\n\n // default to tileSetUrl\n const provider2 = inputProvider ? inputProvider : RealityDataProvider.TilesetUrl;\n const urlKey: RealityDataSourceKey = { provider: provider2, format, id: tilesetUrl };\n return urlKey;\n }\n /** @alpha - was used for a very specific case of point cloud (opc) attachment that should not be made public */\n export function createKeyFromBlobUrl(blobUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\n const info = ContextShareProvider.getInfoFromBlobUrl(blobUrl);\n const format = inputFormat ? inputFormat : info.format;\n const provider = inputProvider ? inputProvider : info.provider;\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id };\n return contextShareKey;\n }\n /** @alpha - OrbitGtBlobProps is alpha */\n export function createKeyFromOrbitGtBlobProps(orbitGtBlob: OrbitGtBlobProps, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\n const format = inputFormat ? inputFormat : RealityDataFormat.OPC;\n if (orbitGtBlob.blobFileName && orbitGtBlob.blobFileName.toLowerCase().startsWith(\"http\")) {\n return RealityDataSource.createKeyFromBlobUrl(orbitGtBlob.blobFileName, inputProvider, format);\n } else if (orbitGtBlob.rdsUrl) {\n return RealityDataSource.createKeyFromUrl(orbitGtBlob.rdsUrl, inputProvider, format);\n }\n const provider = inputProvider ? inputProvider : RealityDataProvider.OrbitGtBlob;\n const id = `${orbitGtBlob.accountName}:${orbitGtBlob.containerName}:${orbitGtBlob.blobFileName}:?${orbitGtBlob.sasToken}`;\n return { provider, format, id };\n }\n /** @alpha - OrbitGtBlobProps is alpha */\n export function createOrbitGtBlobPropsFromKey(rdSourceKey: RealityDataSourceKey): OrbitGtBlobProps | undefined {\n if (rdSourceKey.provider !== RealityDataProvider.OrbitGtBlob)\n return undefined;\n const splitIds = rdSourceKey.id.split(\":\");\n const sasTokenIndex = rdSourceKey.id.indexOf(\":?\");\n const sasToken = rdSourceKey.id.substring(sasTokenIndex + 2);\n const orbitGtBlob: OrbitGtBlobProps = {\n accountName: splitIds[0],\n containerName: splitIds[1],\n blobFileName: splitIds[2],\n sasToken,\n };\n return orbitGtBlob;\n }\n /** @internal - Is used by \"fdt attach cesium asset\" keyin*/\n export function createCesiumIonAssetKey(osmAssetId: number, requestKey: string): RealityDataSourceKey {\n const id = getCesiumAssetUrl(osmAssetId,requestKey);\n return {provider: RealityDataProvider.CesiumIonAsset, format: RealityDataFormat.ThreeDTile, id};\n }\n /** Return an instance of a RealityDataSource from a source key.\n * There will aways be only one reality data RealityDataSource for a corresponding reality data source key.\n * @alpha\n */\n export async function fromKey(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\n const provider = IModelApp.realityDataSourceProviders.find(key.provider);\n if (!provider) {\n Logger.logWarning(loggerCategory, `RealityDataSourceProvider \"${key.provider}\" is not registered`);\n return undefined;\n }\n\n return provider.createRealityDataSource(key, iTwinId);\n }\n}\n\n/** A named supplier of [RealityDataSource]]s.\n * The provider's name is stored in a [RealityDataSourceKey]($common). When the [[RealityDataSource]] is requested from the key,\n * the provider is looked up in [[IModelApp.realityDataSourceProviders]] by its name and, if found, its [[createRealityDataSource]] method\n * is invoked to produce the reality data source.\n * @beta\n */\n\nexport interface RealityDataSourceProvider {\n /** Produce a RealityDataSource for the specified `key`.\n * @param key Identifies the reality data source.\n * @param iTwinId A default iTwinId to use.\n * @returns the requested reality data source, or `undefined` if it could not be produced.\n */\n createRealityDataSource(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;\n /** Optionally add any decorations specific to this reality data source provider.\n * For example, the Google Photorealistic 3D Tiles reality data source provider will add the Google logo.\n */\n decorate?(_context: DecorateContext): void;\n /** Optionally add attribution logo cards to the viewport's logo div. */\n addAttributions?(cards: HTMLTableElement, vp: ScreenViewport): Promise<void>;\n /** Enables cached decorations for this provider. @see [[ViewportDecorator.useCachedDecorations]] */\n useCachedDecorations?: true | undefined;\n}\n\n/** A registry of [[RealityDataSourceProvider]]s identified by their unique names. The registry can be accessed via [[IModelApp.realityDataSourceProviders]].\n * It includes a handful of built-in providers for sources like Cesium ION, ContextShare, OrbitGT, and arbitrary public-accessible URLs.\n * Any number of additional providers can be registered. They should typically be registered just after [[IModelApp.startup]].\n * @beta\n */\nexport class RealityDataSourceProviderRegistry {\n private readonly _providers = new Map<string, RealityDataSourceProvider>();\n\n /** @internal */\n public constructor() {\n this.register(RealityDataProvider.CesiumIonAsset, {\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceCesiumIonAssetImpl.createFromKey(key, iTwinId),\n });\n this.register(RealityDataProvider.TilesetUrl, {\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceTilesetUrlImpl.createFromKey(key, iTwinId),\n });\n this.register(RealityDataProvider.ContextShare, {\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceContextShareImpl.createFromKey(key, iTwinId),\n });\n this.register(RealityDataProvider.OrbitGtBlob, {\n // ###TODO separate TilesetUrlImpl\n createRealityDataSource: async (key, iTwinId) => RealityDataSourceTilesetUrlImpl.createFromKey(key, iTwinId),\n });\n }\n\n /** Register `provider` to produce [[RealityDataSource]]s for the specified provider `name`. */\n public register(name: string, provider: RealityDataSourceProvider): void {\n this._providers.set(name, provider);\n }\n\n /** Look up the provider registered by the specified `name`. */\n public find(name: string): RealityDataSourceProvider | undefined {\n return this._providers.get(name);\n }\n}\n\n/**\n * Options for creating a Google Photorealistic 3D Tiles reality data source provider.\n * The caller must provide either an API key or a function that returns an auth token.\n * @beta\n */\nexport type Google3dTilesProviderOptions = {\n /** Google Map Tiles API Key used to access Google 3D Tiles. */\n apiKey: string;\n getAuthToken?: never;\n /** If true, the data attributions/copyrights from the Google 3D Tiles will be displayed on screen. The Google Maps logo will always be displayed. Defaults to `true`. */\n showCreditsOnScreen?: boolean\n} | {\n apiKey?: never;\n /** Function that returns an OAuth token for authenticating with Google 3D Tiles. This token is expected to not contain the \"Bearer\" prefix. */\n getAuthToken: () => Promise<string>;\n /** If true, the data attributions/copyrights from the Google 3D Tiles will be displayed on screen. The Google Maps logo will always be displayed. Defaults to `true`. */\n showCreditsOnScreen?: boolean;\n};\n\n/**\n * Will provide Google Photorealistic 3D Tiles (in 3dTile format).\n * A valid API key or getAuthToken fuction must be supplied when creating this provider.\n * To use this provider, you must register it with [[IModelApp.realityDataSourceProviders]].\n * Example usage:\n * ```ts\n * [[include:GooglePhotorealistic3dTiles_providerApiKey]]\n * ```\n * @see [Google Photorealistic 3D Tiles]($docs/learning/frontend/GooglePhotorealistic3dTiles.md)\n * @beta\n */\nexport class Google3dTilesProvider implements RealityDataSourceProvider {\n /** Google Map Tiles API Key used to access Google 3D Tiles. */\n private _apiKey?: string;\n /** Function that returns an OAuth token for authenticating with Google 3D Tiles. This token is expected to not contain the \"Bearer\" prefix. */\n private _getAuthToken?: () => Promise<string | undefined>;\n /** Decorator for Google Maps logos. */\n private _decorator: GoogleMapsDecorator;\n /** Enables cached decorations for this provider. @see [[ViewportDecorator.useCachedDecorations]] */\n public readonly useCachedDecorations = true;\n\n public async createRealityDataSource(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\n if (!this._apiKey && !this._getAuthToken) {\n Logger.logError(loggerCategory, \"Either an API key or getAuthToken function are required to create a Google3dTilesProvider.\");\n return undefined;\n }\n return RealityDataSourceGoogle3dTilesImpl.createFromKey(key, iTwinId, this._apiKey, this._getAuthToken);\n }\n\n public constructor(options: Google3dTilesProviderOptions) {\n this._apiKey = options.apiKey;\n this._getAuthToken = options.getAuthToken;\n this._decorator = new GoogleMapsDecorator(options.showCreditsOnScreen ?? true);\n }\n\n /**\n * Initialize the Google 3D Tiles reality data source provider by activating its decorator, which consists of loading the correct Google Maps logo.\n * @returns `true` if the decorator was successfully activated, otherwise `false`.\n */\n public async initialize(): Promise<boolean> {\n const isActivated = await this._decorator.activate(\"satellite\");\n if (!isActivated) {\n const msg = \"Failed to activate decorator\";\n Logger.logError(loggerCategory, msg);\n throw new BentleyError(BentleyStatus.ERROR, msg);\n }\n return isActivated;\n }\n\n public decorate(_context: DecorateContext): void {\n this._decorator.decorate(_context);\n }\n\n public async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\n const copyrightMap = getCopyrights(vp);\n\n // Only add another logo card if the tiles have copyright\n if (copyrightMap.size > 0) {\n // Order by most occurances to least\n // See https://developers.google.com/maps/documentation/tile/create-renderer#display-attributions\n const sortedCopyrights = [...copyrightMap.entries()].sort((a, b) => b[1] - a[1]);\n\n let copyrightMsg = \"Data provided by:<br><ul>\";\n copyrightMsg += sortedCopyrights.map(([key]) => `<li>${key}</li>`).join(\"\");\n copyrightMsg += \"</ul>\";\n\n cards.appendChild(IModelApp.makeLogoCard({\n iconSrc: `${IModelApp.publicPath}images/google_on_white_hdpi.png`,\n heading: \"Google Photorealistic 3D Tiles\",\n notice: copyrightMsg\n }));\n }\n }\n}\n\n/** Returns the URL used for retrieving Google Photorealistic 3D Tiles.\n * @beta\n */\nexport function getGoogle3dTilesUrl() {\n return \"https://tile.googleapis.com/v1/3dtiles/root.json\";\n}\n"]}
|
|
@@ -70,7 +70,7 @@ class RealityDataSourceTilesetUrlImpl {
|
|
|
70
70
|
// otherwise the full path to root document is given.
|
|
71
71
|
// The base URL contains the base URL from which tile relative path are constructed.
|
|
72
72
|
// The tile's path root will need to be reinserted for child tiles to return a 200
|
|
73
|
-
// If the original url includes search paramaters, they are stored in _searchParams to be reinserted into child tile requests.
|
|
73
|
+
// If the original root tileset url includes search paramaters, they are stored in _searchParams to be reinserted into child tile requests.
|
|
74
74
|
setBaseUrl(url) {
|
|
75
75
|
const urlParts = url.split("/");
|
|
76
76
|
const newUrl = new URL(url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealityDataSourceTilesetUrlImpl.js","sourceRoot":"","sources":["../../src/RealityDataSourceTilesetUrlImpl.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAwE;AACxE,oDAAoJ;AAEpJ,+CAA4C;AAE5C,8CAA8D;AAE9D;;;;;;EAME;AACF,MAAa,+BAA+B;IAC1B,GAAG,CAAuB;IAC1C,2EAA2E;IACnE,WAAW,CAAqB;IACxC,sIAAsI;IAC9H,QAAQ,GAAW,EAAE,CAAC;IAC9B,wIAAwI;IAChI,aAAa,GAAW,EAAE,CAAC;IAEnC;;OAEG;IACH,YAAsB,KAA6B;QACjD,IAAA,qBAAM,EAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,KAAK,iCAAmB,CAAC,UAAU,IAAI,KAAK,CAAC,SAAS,CAAC,QAAQ,KAAK,iCAAmB,CAAC,WAAW,CAAC,CAAC;QACpI,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,SAA+B,EAAE,QAAgC;QACjG,IAAI,SAAS,CAAC,QAAQ,KAAK,iCAAmB,CAAC,UAAU;YACvD,OAAO,SAAS,CAAC;QACnB,MAAM,QAAQ,GAAG,IAAI,+BAA+B,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QACpE,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAW,cAAc;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IACD;;MAEE;IACF,IAAW,WAAW;QACpB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAW,aAAa;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;OAEG;IACH,IAAW,eAAe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IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;YAC3D,eAAe,GAAG,sCAA2B,CAAC,4BAA4B,CAAC,YAAY,CAAC,CAAC;QAC3F,CAAC;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;IACD;;;;;OAKG;IACI,KAAK,CAAC,uBAAuB;QAClC,IAAI,aAA+C,CAAC;QACpD,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAnJD,0EAmJC","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 */\nimport { assert, BentleyStatus, GuidString } from \"@itwin/core-bentley\";\nimport { IModelError, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\n\nimport { request } from \"./request/Request\";\nimport { PublisherProductInfo, RealityDataSource, SpatialLocationAndExtents } from \"./RealityDataSource\";\nimport { ThreeDTileFormatInterpreter } from \"./tile/internal\";\n\n/** This class provides access to the reality data provider services.\n * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.\n * The key provided at the creation determines if this is ProjectWise Context Share reference.\n * If not then it is considered local (ex: C:\\temp\\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)\n * There is a one to one relationship between a reality data and the instances of present class.\n* @internal\n*/\nexport class RealityDataSourceTilesetUrlImpl implements RealityDataSource {\n public readonly key: RealityDataSourceKey;\n /** The URL that supplies the 3d tiles for displaying the reality model. */\n private _tilesetUrl: string | undefined;\n /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/\n private _baseUrl: string = \"\";\n /** Need to be passed down to child tile requests when requesting from blob storage, e.g. a Cesium export from the Mesh Export Service*/\n private _searchParams: string = \"\";\n\n /** Construct a new reality data source.\n * @param props JSON representation of the reality data source\n */\n protected constructor(props: RealityDataSourceProps) {\n assert(props.sourceKey.provider === RealityDataProvider.TilesetUrl || props.sourceKey.provider === RealityDataProvider.OrbitGtBlob);\n this.key = props.sourceKey;\n this._tilesetUrl = this.key.id;\n }\n\n /**\n * Create an instance of this class from a source key and iTwin context/\n */\n public static async createFromKey(sourceKey: RealityDataSourceKey, _iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\n if (sourceKey.provider !== RealityDataProvider.TilesetUrl)\n return undefined;\n const rdSource = new RealityDataSourceTilesetUrlImpl({ sourceKey });\n return rdSource;\n }\n\n public get isContextShare(): boolean {\n return false;\n }\n /**\n * Returns Reality Data if available\n */\n public get realityData(): RealityData | undefined {\n return undefined;\n }\n public get realityDataId(): string | undefined {\n return undefined;\n }\n /**\n * Returns Reality Data type if available\n */\n public get realityDataType(): string | undefined {\n return undefined;\n }\n\n public getTilesetUrl(): string | undefined {\n return this._tilesetUrl;\n }\n // This is to set the root url from the provided root document path.\n // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,\n // otherwise the full path to root document is given.\n // The base URL contains the base URL from which tile relative path are constructed.\n // The tile's path root will need to be reinserted for child tiles to return a 200\n // If the original url includes search paramaters, they are stored in _searchParams to be reinserted into child tile requests.\n private setBaseUrl(url: string): void {\n const urlParts = url.split(\"/\");\n const newUrl = new URL(url);\n this._searchParams = newUrl.search;\n urlParts.pop();\n if (urlParts.length === 0)\n this._baseUrl = \"\";\n else\n this._baseUrl = `${urlParts.join(\"/\")}/`;\n }\n\n /**\n * This method returns the URL to access the actual 3d tiles from the service provider.\n * @returns string containing the URL to reality data.\n */\n public async getServiceUrl(_iTwinId: GuidString | undefined): Promise<string | undefined> {\n return this._tilesetUrl;\n }\n\n public async getRootDocument(iTwinId: GuidString | undefined): Promise<any> {\n const url = await this.getServiceUrl(iTwinId);\n if (!url)\n throw new IModelError(BentleyStatus.ERROR, \"Unable to get service url\");\n\n // The following is only if the reality data is not stored on PW Context Share.\n this.setBaseUrl(url);\n return request(url, \"json\");\n }\n\n private isValidURL(url: string){\n try {\n new URL(url);\n } catch {\n return false;\n }\n return true;\n }\n\n /** Returns the tile URL.\n * If the tile path is a relative URL, the base URL is prepended to it.\n * For both absolute and relative tile path URLs, the search parameters are checked. If the search params are empty, the base URL's search params are appended to the tile path.\n */\n private getTileUrl(tilePath: string){\n if (this.isValidURL(tilePath)) {\n const url = new URL(tilePath);\n return url.search === \"\" ? `${tilePath}${this._searchParams}` : tilePath;\n }\n return tilePath.includes(\"?\") ? `${this._baseUrl}${tilePath}` : `${this._baseUrl}${tilePath}${this._searchParams}`;\n }\n\n /**\n * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.\n */\n public async getTileContent(name: string): Promise<ArrayBuffer> {\n return request(this.getTileUrl(name), \"arraybuffer\");\n }\n\n /**\n * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.\n */\n public async getTileJson(name: string): Promise<any> {\n return request(this.getTileUrl(name), \"json\");\n }\n\n public getTileContentType(url: string): \"tile\" | \"tileset\" {\n return new URL(url, \"https://localhost/\").pathname.toLowerCase().endsWith(\"json\") ? \"tileset\" : \"tile\";\n }\n\n /**\n * Gets spatial location and extents of this reality data source\n * @returns spatial location and extents\n * @internal\n */\n public async getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined> {\n let spatialLocation: SpatialLocationAndExtents | undefined;\n if (this.key.format === RealityDataFormat.ThreeDTile) {\n const rootDocument = await this.getRootDocument(undefined);\n spatialLocation = ThreeDTileFormatInterpreter.getSpatialLocationAndExtents(rootDocument);\n }\n return spatialLocation;\n }\n /**\n * Gets information to identify the product and engine that create this reality data\n * Will return undefined if cannot be resolved\n * @returns information to identify the product and engine that create this reality data\n * @alpha\n */\n public async getPublisherProductInfo(): Promise<PublisherProductInfo | undefined> {\n let publisherInfo: PublisherProductInfo | undefined;\n return publisherInfo;\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"RealityDataSourceTilesetUrlImpl.js","sourceRoot":"","sources":["../../src/RealityDataSourceTilesetUr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e,CAAC;IACzB,CAAC;IACD;;;;;OAKG;IACI,KAAK,CAAC,uBAAuB;QAClC,IAAI,aAA+C,CAAC;QACpD,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAnJD,0EAmJC","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 */\nimport { assert, BentleyStatus, GuidString } from \"@itwin/core-bentley\";\nimport { IModelError, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\n\nimport { request } from \"./request/Request\";\nimport { PublisherProductInfo, RealityDataSource, SpatialLocationAndExtents } from \"./RealityDataSource\";\nimport { ThreeDTileFormatInterpreter } from \"./tile/internal\";\n\n/** This class provides access to the reality data provider services.\n * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.\n * The key provided at the creation determines if this is ProjectWise Context Share reference.\n * If not then it is considered local (ex: C:\\temp\\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)\n * There is a one to one relationship between a reality data and the instances of present class.\n* @internal\n*/\nexport class RealityDataSourceTilesetUrlImpl implements RealityDataSource {\n public readonly key: RealityDataSourceKey;\n /** The URL that supplies the 3d tiles for displaying the reality model. */\n private _tilesetUrl: string | undefined;\n /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/\n private _baseUrl: string = \"\";\n /** Need to be passed down to child tile requests when requesting from blob storage, e.g. a Cesium export from the Mesh Export Service*/\n private _searchParams: string = \"\";\n\n /** Construct a new reality data source.\n * @param props JSON representation of the reality data source\n */\n protected constructor(props: RealityDataSourceProps) {\n assert(props.sourceKey.provider === RealityDataProvider.TilesetUrl || props.sourceKey.provider === RealityDataProvider.OrbitGtBlob);\n this.key = props.sourceKey;\n this._tilesetUrl = this.key.id;\n }\n\n /**\n * Create an instance of this class from a source key and iTwin context/\n */\n public static async createFromKey(sourceKey: RealityDataSourceKey, _iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\n if (sourceKey.provider !== RealityDataProvider.TilesetUrl)\n return undefined;\n const rdSource = new RealityDataSourceTilesetUrlImpl({ sourceKey });\n return rdSource;\n }\n\n public get isContextShare(): boolean {\n return false;\n }\n /**\n * Returns Reality Data if available\n */\n public get realityData(): RealityData | undefined {\n return undefined;\n }\n public get realityDataId(): string | undefined {\n return undefined;\n }\n /**\n * Returns Reality Data type if available\n */\n public get realityDataType(): string | undefined {\n return undefined;\n }\n\n public getTilesetUrl(): string | undefined {\n return this._tilesetUrl;\n }\n // This is to set the root url from the provided root document path.\n // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,\n // otherwise the full path to root document is given.\n // The base URL contains the base URL from which tile relative path are constructed.\n // The tile's path root will need to be reinserted for child tiles to return a 200\n // If the original root tileset url includes search paramaters, they are stored in _searchParams to be reinserted into child tile requests.\n private setBaseUrl(url: string): void {\n const urlParts = url.split(\"/\");\n const newUrl = new URL(url);\n this._searchParams = newUrl.search;\n urlParts.pop();\n if (urlParts.length === 0)\n this._baseUrl = \"\";\n else\n this._baseUrl = `${urlParts.join(\"/\")}/`;\n }\n\n /**\n * This method returns the URL to access the actual 3d tiles from the service provider.\n * @returns string containing the URL to reality data.\n */\n public async getServiceUrl(_iTwinId: GuidString | undefined): Promise<string | undefined> {\n return this._tilesetUrl;\n }\n\n public async getRootDocument(iTwinId: GuidString | undefined): Promise<any> {\n const url = await this.getServiceUrl(iTwinId);\n if (!url)\n throw new IModelError(BentleyStatus.ERROR, \"Unable to get service url\");\n\n // The following is only if the reality data is not stored on PW Context Share.\n this.setBaseUrl(url);\n return request(url, \"json\");\n }\n\n private isValidURL(url: string){\n try {\n new URL(url);\n } catch {\n return false;\n }\n return true;\n }\n\n /** Returns the tile URL.\n * If the tile path is a relative URL, the base URL is prepended to it.\n * For both absolute and relative tile path URLs, the search parameters are checked. If the search params are empty, the base URL's search params are appended to the tile path.\n */\n private getTileUrl(tilePath: string){\n if (this.isValidURL(tilePath)) {\n const url = new URL(tilePath);\n return url.search === \"\" ? `${tilePath}${this._searchParams}` : tilePath;\n }\n return tilePath.includes(\"?\") ? `${this._baseUrl}${tilePath}` : `${this._baseUrl}${tilePath}${this._searchParams}`;\n }\n\n /**\n * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.\n */\n public async getTileContent(name: string): Promise<ArrayBuffer> {\n return request(this.getTileUrl(name), \"arraybuffer\");\n }\n\n /**\n * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.\n */\n public async getTileJson(name: string): Promise<any> {\n return request(this.getTileUrl(name), \"json\");\n }\n\n public getTileContentType(url: string): \"tile\" | \"tileset\" {\n return new URL(url, \"https://localhost/\").pathname.toLowerCase().endsWith(\"json\") ? \"tileset\" : \"tile\";\n }\n\n /**\n * Gets spatial location and extents of this reality data source\n * @returns spatial location and extents\n * @internal\n */\n public async getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined> {\n let spatialLocation: SpatialLocationAndExtents | undefined;\n if (this.key.format === RealityDataFormat.ThreeDTile) {\n const rootDocument = await this.getRootDocument(undefined);\n spatialLocation = ThreeDTileFormatInterpreter.getSpatialLocationAndExtents(rootDocument);\n }\n return spatialLocation;\n }\n /**\n * Gets information to identify the product and engine that create this reality data\n * Will return undefined if cannot be resolved\n * @returns information to identify the product and engine that create this reality data\n * @alpha\n */\n public async getPublisherProductInfo(): Promise<PublisherProductInfo | undefined> {\n let publisherInfo: PublisherProductInfo | undefined;\n return publisherInfo;\n }\n}\n\n"]}
|
|
@@ -25,7 +25,7 @@ export interface SelectAddEvent {
|
|
|
25
25
|
type: SelectionSetEventType.Add;
|
|
26
26
|
/**
|
|
27
27
|
* The Ids of the elements added to the set.
|
|
28
|
-
* @deprecated in 5.0. Use the [[additions]] attribute instead.
|
|
28
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[additions]] attribute instead.
|
|
29
29
|
*/
|
|
30
30
|
added: Id64Arg;
|
|
31
31
|
/** A collection of geometric element, model and subcategory ids that have been added to selection set. */
|
|
@@ -42,7 +42,7 @@ export interface SelectRemoveEvent {
|
|
|
42
42
|
type: SelectionSetEventType.Remove | SelectionSetEventType.Clear;
|
|
43
43
|
/**
|
|
44
44
|
* The element Ids removed from the set.
|
|
45
|
-
* @deprecated in 5.0. Use the [[removals]] attribute instead.
|
|
45
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[removals]] attribute instead.
|
|
46
46
|
*/
|
|
47
47
|
removed: Id64Arg;
|
|
48
48
|
/** A collection of geometric element, model and subcategory ids that have been removed from selection set. */
|
|
@@ -58,14 +58,14 @@ export interface SelectReplaceEvent {
|
|
|
58
58
|
type: SelectionSetEventType.Replace;
|
|
59
59
|
/**
|
|
60
60
|
* The element Ids added to the set.
|
|
61
|
-
* @deprecated in 5.0. Use the [[additions]] attribute instead.
|
|
61
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[additions]] attribute instead.
|
|
62
62
|
*/
|
|
63
63
|
added: Id64Arg;
|
|
64
64
|
/** A collection of geometric element, model and subcategory ids that have been added to selection set. */
|
|
65
65
|
additions: SelectableIds;
|
|
66
66
|
/**
|
|
67
67
|
* The element Ids removed from the set.
|
|
68
|
-
* @deprecated in 5.0. Use the [[removals]] attribute instead.
|
|
68
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the [[removals]] attribute instead.
|
|
69
69
|
*/
|
|
70
70
|
removed: Id64Arg;
|
|
71
71
|
/** A collection of geometric element, model and subcategory ids that have been removed from selection set. */
|
|
@@ -163,7 +163,7 @@ export declare class HiliteSet {
|
|
|
163
163
|
/** Toggle the hilited state of one or more elements.
|
|
164
164
|
* @param arg the ID(s) of the elements whose state is to be toggled.
|
|
165
165
|
* @param onOff True to add the elements to the hilited set, false to remove them.
|
|
166
|
-
* @deprecated in 5.0. Use [[add]], [[remove]], [[replace]] instead.
|
|
166
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[add]], [[remove]], [[replace]] instead.
|
|
167
167
|
*/
|
|
168
168
|
setHilite(arg: Id64Arg, onOff: boolean): void;
|
|
169
169
|
}
|
|
@@ -203,12 +203,12 @@ export declare class SelectionSet {
|
|
|
203
203
|
get isActive(): boolean;
|
|
204
204
|
/** Return true if elemId is in this `SelectionSet`.
|
|
205
205
|
* @see [[isSelected]]
|
|
206
|
-
* @deprecated in 5.0. Use `SelectionSet.elements.has(elemId)` instead.
|
|
206
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.
|
|
207
207
|
*/
|
|
208
208
|
has(elemId?: string): boolean;
|
|
209
209
|
/** Query whether an Id is in the selection set.
|
|
210
210
|
* @see [[has]]
|
|
211
|
-
* @deprecated in 5.0. Use `SelectionSet.elements.has(elemId)` instead.
|
|
211
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.
|
|
212
212
|
*/
|
|
213
213
|
isSelected(elemId?: Id64String): boolean;
|
|
214
214
|
/** Clear current selection set.
|
package/lib/cjs/SelectionSet.js
CHANGED
|
@@ -204,7 +204,7 @@ class HiliteSet {
|
|
|
204
204
|
/** Toggle the hilited state of one or more elements.
|
|
205
205
|
* @param arg the ID(s) of the elements whose state is to be toggled.
|
|
206
206
|
* @param onOff True to add the elements to the hilited set, false to remove them.
|
|
207
|
-
* @deprecated in 5.0. Use [[add]], [[remove]], [[replace]] instead.
|
|
207
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[add]], [[remove]], [[replace]] instead.
|
|
208
208
|
*/
|
|
209
209
|
setHilite(arg, onOff) {
|
|
210
210
|
if (onOff) {
|
|
@@ -273,14 +273,14 @@ class SelectionSet {
|
|
|
273
273
|
}
|
|
274
274
|
/** Return true if elemId is in this `SelectionSet`.
|
|
275
275
|
* @see [[isSelected]]
|
|
276
|
-
* @deprecated in 5.0. Use `SelectionSet.elements.has(elemId)` instead.
|
|
276
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.
|
|
277
277
|
*/
|
|
278
278
|
has(elemId) {
|
|
279
279
|
return !!elemId && this.elements.has(elemId);
|
|
280
280
|
}
|
|
281
281
|
/** Query whether an Id is in the selection set.
|
|
282
282
|
* @see [[has]]
|
|
283
|
-
* @deprecated in 5.0. Use `SelectionSet.elements.has(elemId)` instead.
|
|
283
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `SelectionSet.elements.has(elemId)` instead.
|
|
284
284
|
*/
|
|
285
285
|
isSelected(elemId) {
|
|
286
286
|
return !!elemId && this.elements.has(elemId);
|