@itwin/core-frontend 5.1.0-dev.5 → 5.1.0-dev.52
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 +101 -1
- package/lib/cjs/AccuDraw.d.ts +2 -0
- package/lib/cjs/AccuDraw.d.ts.map +1 -1
- package/lib/cjs/AccuDraw.js +2 -0
- package/lib/cjs/AccuDraw.js.map +1 -1
- package/lib/cjs/AccuSnap.js +2 -2
- package/lib/cjs/AccuSnap.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 +6 -6
- package/lib/cjs/IModelConnection.js +6 -6
- 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/ViewContext.d.ts +4 -1
- package/lib/cjs/ViewContext.d.ts.map +1 -1
- package/lib/cjs/ViewContext.js +10 -5
- package/lib/cjs/ViewContext.js.map +1 -1
- package/lib/cjs/ViewManager.js +2 -2
- package/lib/cjs/ViewManager.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 +7 -5
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +9 -5
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +1 -1
- package/lib/cjs/core-frontend.d.ts.map +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/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/MockRender.d.ts +1 -1
- package/lib/cjs/internal/render/MockRender.d.ts.map +1 -1
- package/lib/cjs/internal/render/MockRender.js +1 -1
- package/lib/cjs/internal/render/MockRender.js.map +1 -1
- package/lib/cjs/internal/render/webgl/AtmosphereUniforms.d.ts +1 -1
- package/lib/cjs/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js +1 -1
- package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/AttributeBuffers.d.ts +2 -2
- package/lib/cjs/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/AttributeBuffers.js +2 -2
- package/lib/cjs/internal/render/webgl/AttributeBuffers.js.map +1 -1
- package/lib/cjs/internal/render/webgl/ClippingProgram.d.ts +1 -1
- package/lib/cjs/internal/render/webgl/ClippingProgram.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/ClippingProgram.js +1 -1
- package/lib/cjs/internal/render/webgl/ClippingProgram.js.map +1 -1
- package/lib/cjs/internal/render/webgl/RenderCommands.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/RenderCommands.js +2 -3
- package/lib/cjs/internal/render/webgl/RenderCommands.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 +1 -1
- package/lib/cjs/internal/render/webgl/Target.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/Target.js +2 -2
- package/lib/cjs/internal/render/webgl/Target.js.map +1 -1
- package/lib/cjs/internal/render/webgl/TargetGraphics.d.ts +3 -3
- package/lib/cjs/internal/render/webgl/TargetGraphics.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/TargetGraphics.js +10 -7
- package/lib/cjs/internal/render/webgl/TargetGraphics.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/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 +4 -3
- package/lib/cjs/internal/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts +20 -3
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.js +39 -14
- package/lib/cjs/internal/tile/RealityModelTileTree.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/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 +212 -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 +1 -1
- package/lib/cjs/render/GraphicBranch.d.ts.map +1 -1
- package/lib/cjs/render/GraphicBranch.js +1 -1
- package/lib/cjs/render/GraphicBranch.js.map +1 -1
- package/lib/cjs/render/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/RenderTarget.d.ts +1 -1
- package/lib/cjs/render/RenderTarget.d.ts.map +1 -1
- package/lib/cjs/render/RenderTarget.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 +1 -0
- package/lib/cjs/tile/GltfReader.d.ts.map +1 -1
- package/lib/cjs/tile/GltfReader.js +1 -0
- package/lib/cjs/tile/GltfReader.js.map +1 -1
- package/lib/cjs/tile/RealityTile.d.ts +5 -0
- package/lib/cjs/tile/RealityTile.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTile.js +5 -0
- package/lib/cjs/tile/RealityTile.js.map +1 -1
- package/lib/cjs/tile/Tile.d.ts +1 -1
- package/lib/cjs/tile/Tile.d.ts.map +1 -1
- package/lib/cjs/tile/Tile.js +1 -1
- package/lib/cjs/tile/Tile.js.map +1 -1
- package/lib/cjs/tile/TileAdmin.d.ts +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/TileTree.d.ts +1 -1
- package/lib/cjs/tile/TileTree.d.ts.map +1 -1
- package/lib/cjs/tile/TileTree.js +1 -1
- package/lib/cjs/tile/TileTree.js.map +1 -1
- package/lib/cjs/tile/TileTreeReference.d.ts +1 -1
- package/lib/cjs/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/cjs/tile/TileTreeReference.js +1 -1
- package/lib/cjs/tile/TileTreeReference.js.map +1 -1
- package/lib/cjs/tile/map/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/ElementSetTool.d.ts +9 -1
- package/lib/cjs/tools/ElementSetTool.d.ts.map +1 -1
- package/lib/cjs/tools/ElementSetTool.js +128 -7
- package/lib/cjs/tools/ElementSetTool.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 +53 -22
- 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 +2 -2
- 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 +8 -2
- package/lib/cjs/tools/ToolAdmin.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 +10 -47
- 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 +2 -0
- package/lib/esm/AccuDraw.js.map +1 -1
- package/lib/esm/AccuSnap.js +2 -2
- package/lib/esm/AccuSnap.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 +6 -6
- package/lib/esm/IModelConnection.js +6 -6
- 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/ViewContext.d.ts +4 -1
- package/lib/esm/ViewContext.d.ts.map +1 -1
- package/lib/esm/ViewContext.js +10 -5
- package/lib/esm/ViewContext.js.map +1 -1
- package/lib/esm/ViewManager.js +2 -2
- package/lib/esm/ViewManager.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 +7 -5
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +9 -5
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +1 -1
- package/lib/esm/core-frontend.d.ts.map +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/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/MockRender.d.ts +1 -1
- package/lib/esm/internal/render/MockRender.d.ts.map +1 -1
- package/lib/esm/internal/render/MockRender.js +1 -1
- package/lib/esm/internal/render/MockRender.js.map +1 -1
- package/lib/esm/internal/render/webgl/AtmosphereUniforms.d.ts +1 -1
- package/lib/esm/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/AtmosphereUniforms.js +1 -1
- package/lib/esm/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/AttributeBuffers.d.ts +2 -2
- package/lib/esm/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/AttributeBuffers.js +2 -2
- package/lib/esm/internal/render/webgl/AttributeBuffers.js.map +1 -1
- package/lib/esm/internal/render/webgl/ClippingProgram.d.ts +1 -1
- package/lib/esm/internal/render/webgl/ClippingProgram.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/ClippingProgram.js +1 -1
- package/lib/esm/internal/render/webgl/ClippingProgram.js.map +1 -1
- package/lib/esm/internal/render/webgl/RenderCommands.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/RenderCommands.js +2 -3
- package/lib/esm/internal/render/webgl/RenderCommands.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 +1 -1
- package/lib/esm/internal/render/webgl/Target.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/Target.js +2 -2
- package/lib/esm/internal/render/webgl/Target.js.map +1 -1
- package/lib/esm/internal/render/webgl/TargetGraphics.d.ts +3 -3
- package/lib/esm/internal/render/webgl/TargetGraphics.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/TargetGraphics.js +10 -7
- package/lib/esm/internal/render/webgl/TargetGraphics.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/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 +4 -3
- package/lib/esm/internal/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts +20 -3
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.js +38 -14
- package/lib/esm/internal/tile/RealityModelTileTree.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/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 +210 -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 +1 -1
- package/lib/esm/render/GraphicBranch.d.ts.map +1 -1
- package/lib/esm/render/GraphicBranch.js +1 -1
- package/lib/esm/render/GraphicBranch.js.map +1 -1
- package/lib/esm/render/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/RenderTarget.d.ts +1 -1
- package/lib/esm/render/RenderTarget.d.ts.map +1 -1
- package/lib/esm/render/RenderTarget.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 +1 -0
- package/lib/esm/tile/GltfReader.d.ts.map +1 -1
- package/lib/esm/tile/GltfReader.js +1 -0
- package/lib/esm/tile/GltfReader.js.map +1 -1
- package/lib/esm/tile/RealityTile.d.ts +5 -0
- package/lib/esm/tile/RealityTile.d.ts.map +1 -1
- package/lib/esm/tile/RealityTile.js +5 -0
- package/lib/esm/tile/RealityTile.js.map +1 -1
- package/lib/esm/tile/Tile.d.ts +1 -1
- package/lib/esm/tile/Tile.d.ts.map +1 -1
- package/lib/esm/tile/Tile.js +1 -1
- package/lib/esm/tile/Tile.js.map +1 -1
- package/lib/esm/tile/TileAdmin.d.ts +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/TileTree.d.ts +1 -1
- package/lib/esm/tile/TileTree.d.ts.map +1 -1
- package/lib/esm/tile/TileTree.js +1 -1
- package/lib/esm/tile/TileTree.js.map +1 -1
- package/lib/esm/tile/TileTreeReference.d.ts +1 -1
- package/lib/esm/tile/TileTreeReference.d.ts.map +1 -1
- package/lib/esm/tile/TileTreeReference.js +1 -1
- package/lib/esm/tile/TileTreeReference.js.map +1 -1
- package/lib/esm/tile/map/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/ElementSetTool.d.ts +9 -1
- package/lib/esm/tools/ElementSetTool.d.ts.map +1 -1
- package/lib/esm/tools/ElementSetTool.js +130 -9
- package/lib/esm/tools/ElementSetTool.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 +53 -22
- 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 +2 -2
- 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 +8 -2
- package/lib/esm/tools/ToolAdmin.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 +10 -47
- 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 +22 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetViewState.js","sourceRoot":"","sources":["../../src/SheetViewState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAyB,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACvK,OAAO,EACa,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAA2E,kBAAkB,EAAE,WAAW,EAC7L,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI1D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC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YAChB,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;CACF","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 Views\n */\n\nimport { assert, CompressedId64Set, dispose, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport { Angle, ClipShape, ClipVector, Constant, Matrix3d, Point2d, Point3d, PolyfaceBuilder, Range2d, Range3d, StrokeOptions, Transform } from \"@itwin/core-geometry\";\nimport {\n AxisAlignedBox3d, ColorDef, Feature, FeatureTable, Frustum, Gradient, GraphicParams, HiddenLine, HydrateViewStateRequestProps, HydrateViewStateResponseProps, PackedFeatureTable, Placement2d, SheetProps,\n TextureTransparency, ViewAttachmentProps, ViewDefinition2dProps, ViewFlagOverrides, ViewStateProps,\n} from \"@itwin/core-common\";\nimport { CategorySelectorState } from \"./CategorySelectorState\";\nimport { DisplayStyle2dState } from \"./DisplayStyleState\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { GraphicBuilder } from \"./render/GraphicBuilder\";\nimport { RenderGraphic } from \"./render/RenderGraphic\";\nimport { GraphicBranch } from \"./render/GraphicBranch\";\nimport { Frustum2d } from \"./Frustum2d\";\nimport { Scene } from \"./render/Scene\";\nimport { Decorations } from \"./render/Decorations\";\nimport { MockRender } from \"./internal/render/MockRender\";\nimport { RenderClipVolume } from \"./render/RenderClipVolume\";\nimport { RenderMemory } from \"./render/RenderMemory\";\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\nimport { DecorateContext, SceneContext } from \"./ViewContext\";\nimport { IModelApp } from \"./IModelApp\";\nimport { CoordSystem } from \"./CoordSystem\";\nimport { OffScreenViewport, Viewport } from \"./Viewport\";\nimport { AttachToViewportArgs, ComputeDisplayTransformArgs, GetAttachmentViewportArgs, ViewState, ViewState2d } from \"./ViewState\";\nimport { DrawingViewState } from \"./DrawingViewState\";\nimport { createDefaultViewFlagOverrides, DisclosedTileTreeSet, TileGraphicType } from \"./tile/internal\";\nimport { imageBufferToPngDataUrl, openImageDataUrlInNewWindow } from \"./common/ImageUtil\";\nimport { ViewRect } from \"./common/ViewRect\";\nimport { GraphicType } from \"./common/render/GraphicType\";\n\n// cSpell:ignore ovrs\n\n/** Describes the geometry and styling of a sheet border decoration.\n * The sheet border decoration mimics a sheet of paper with a drop shadow.\n */\nclass SheetBorder {\n private _rect: Point2d[];\n private _shadow: Point2d[];\n private _gradient: Gradient.Symb;\n\n private constructor(rect: Point2d[], shadow: Point2d[], gradient: Gradient.Symb) {\n this._rect = rect;\n this._shadow = shadow;\n this._gradient = gradient;\n }\n\n /** Create a new sheet border. If a context is supplied, points are transformed to view coordinates. */\n public static create(width: number, height: number, context?: DecorateContext) {\n // Rect\n const rect: Point3d[] = [\n Point3d.create(0, height),\n Point3d.create(0, 0),\n Point3d.create(width, 0),\n Point3d.create(width, height),\n Point3d.create(0, height)];\n if (context) {\n context.viewport.worldToViewArray(rect);\n }\n\n // Shadow\n const shadowWidth = .01 * Math.sqrt(width * width + height * height);\n const shadow: Point3d[] = [\n Point3d.create(shadowWidth, 0),\n Point3d.create(shadowWidth, -shadowWidth),\n Point3d.create(width + shadowWidth, -shadowWidth),\n Point3d.create(width + shadowWidth, height - shadowWidth),\n Point3d.create(width, height - shadowWidth),\n Point3d.create(width, 0),\n Point3d.create(shadowWidth, 0),\n ];\n if (context) {\n context.viewport.worldToViewArray(shadow);\n }\n\n // Gradient\n const gradient = new Gradient.Symb();\n gradient.mode = Gradient.Mode.Linear;\n gradient.angle = Angle.createDegrees(-45);\n gradient.keys = [{ value: 0, color: ColorDef.from(25, 25, 25) }, { value: 0.5, color: ColorDef.from(150, 150, 150) }];\n\n // Copy over points\n const rect2d: Point2d[] = [];\n for (const point of rect)\n rect2d.push(Point2d.createFrom(point));\n const shadow2d: Point2d[] = [];\n for (const point of shadow)\n shadow2d.push(Point2d.createFrom(point));\n\n return new SheetBorder(rect2d, shadow2d, gradient);\n }\n\n public getRange(): Range2d {\n const range = Range2d.createArray(this._rect);\n const shadowRange = Range2d.createArray(this._shadow);\n range.extendRange(shadowRange);\n return range;\n }\n\n /** Add this border to the given GraphicBuilder. */\n public addToBuilder(builder: GraphicBuilder) {\n const lineColor = ColorDef.black;\n const fillColor = ColorDef.black;\n\n const params = new GraphicParams();\n params.fillColor = fillColor;\n params.gradient = this._gradient;\n\n builder.activateGraphicParams(params);\n builder.addShape2d(this._shadow, Frustum2d.minimumZDistance);\n\n builder.setSymbology(lineColor, fillColor, 2);\n builder.addLineString2d(this._rect, 0);\n }\n}\n\n/** The information required to instantiate an Attachment object. See ViewAttachmentsInfo */\ninterface ViewAttachmentInfo extends ViewAttachmentProps {\n attachedView: ViewState;\n}\n\n/** The information required to instantiate an ViewAttachments object to draw ViewAttachments into a sheet. The list of view attachment Ids is\n * supplied to SheetViewState via the constructor. The corresponding ViewAttachmentProps for each attachment are obtained asynchronously in\n * SheetViewState.load(). The Attachments object is created in SheetViewState.attachToViewport and disposed of in SheetViewState.detachFromViewport.\n */\nclass ViewAttachmentsInfo {\n private _attachments: Id64Array | ViewAttachmentInfo[];\n\n public get attachments() { return this._attachments; }\n\n private constructor(attachments: Id64Array | ViewAttachmentInfo[]) {\n this._attachments = attachments;\n }\n\n public get isLoaded(): boolean {\n return 0 === this._attachments.length || \"string\" !== typeof this._attachments[0];\n }\n\n public get viewAttachmentProps(): Array<Readonly<ViewAttachmentProps>> {\n return this.isLoaded ? this._props : [];\n }\n\n private get _props(): ViewAttachmentInfo[] {\n assert(this.isLoaded);\n return this._attachments as ViewAttachmentInfo[];\n }\n\n private get _ids(): Id64Array {\n assert(!this.isLoaded);\n return this._attachments as Id64Array;\n }\n\n public static fromJSON(ids: Id64Array = []): ViewAttachmentsInfo {\n return new ViewAttachmentsInfo(ids);\n }\n\n public toJSON(): Id64Array {\n return this.isLoaded ? this._props.map((x) => x.id!) : [...this._ids];\n }\n\n public clone(iModel: IModelConnection): ViewAttachmentsInfo {\n let attachments = this._attachments;\n if (this.isLoaded) {\n // Need to clone the attached ViewStates.\n attachments = attachments.map((attachment) => {\n assert(typeof attachment !== \"string\");\n return {\n ...attachment,\n attachedView: attachment.attachedView.clone(iModel),\n };\n });\n }\n\n return new ViewAttachmentsInfo(attachments);\n }\n\n public preload(options: HydrateViewStateRequestProps) {\n if (this.isLoaded)\n return;\n options.sheetViewAttachmentIds = CompressedId64Set.sortAndCompress(this._ids);\n options.viewStateLoadProps = {\n displayStyle: {\n omitScheduleScriptElementIds: !IModelApp.tileAdmin.enableFrontendScheduleScripts,\n compressExcludedElementIds: true,\n },\n };\n }\n\n public async postload(options: HydrateViewStateResponseProps, iModel: IModelConnection) {\n if (options.sheetViewViews === undefined)\n return;\n if (options.sheetViewAttachmentProps === undefined)\n return;\n\n const viewStateProps = options.sheetViewViews; // This is viewstateProps, need to turn this into ViewState\n const promises = [];\n for (const viewProps of viewStateProps) {\n const loadView = async () => {\n try {\n if (viewProps === undefined)\n return undefined;\n const view = await iModel.views.convertViewStatePropsToViewState(viewProps);\n return view;\n } catch {\n return undefined;\n }\n };\n promises.push(loadView());\n }\n const views = await Promise.all(promises);\n\n const attachmentProps = options.sheetViewAttachmentProps as ViewAttachmentInfo[];\n assert(views.length === attachmentProps.length);\n const attachments = [];\n for (let i = 0; i < views.length; i++) {\n const view = views[i];\n if (view && !(view instanceof SheetViewState)) {\n const props = attachmentProps[i];\n props.attachedView = view;\n attachments.push(props);\n }\n }\n\n this._attachments = attachments;\n }\n\n public async load(iModel: IModelConnection): Promise<void> {\n if (this.isLoaded)\n return;\n\n const attachmentProps = await iModel.elements.getProps(this._ids) as ViewAttachmentInfo[];\n const promises = [];\n for (const attachment of attachmentProps) {\n const loadView = async () => {\n try {\n const view = await iModel.views.load(attachment.view.id);\n return view;\n } catch {\n return undefined;\n }\n };\n\n promises.push(loadView());\n }\n\n const views = await Promise.all(promises);\n assert(views.length === attachmentProps.length);\n\n const attachments = [];\n for (let i = 0; i < views.length; i++) {\n const view = views[i];\n if (view && !(view instanceof SheetViewState)) {\n const props = attachmentProps[i];\n props.attachedView = view;\n attachments.push(props);\n }\n }\n\n this._attachments = attachments;\n }\n\n public createAttachments(sheetView: SheetViewState): ViewAttachments | undefined {\n return this.isLoaded ? new ViewAttachments(this._props, sheetView) : undefined;\n }\n}\n\n/** The set of view attachments to be displayed in a Viewport via a SheetViewState. Allocated when the view becomes attached to a Viewport;\n * disposed of when it becomes detached from the viewport.\n */\nclass ViewAttachments {\n private readonly _attachments: Attachment[] = [];\n public maxDepth = Frustum2d.minimumZDistance;\n\n public constructor(infos: ViewAttachmentInfo[], sheetView: SheetViewState) {\n for (const info of infos) {\n const drawAsRaster = info.jsonProperties?.displayOptions?.drawAsRaster || (info.attachedView.is3d() && info.attachedView.isCameraOn);\n const ctor = drawAsRaster ? RasterAttachment : OrthographicAttachment;\n const attachment = new ctor(info.attachedView, info, sheetView);\n this._attachments.push(attachment);\n this.maxDepth = Math.max(this.maxDepth, attachment.zDepth);\n }\n }\n\n public [Symbol.dispose](): void {\n for (const attachment of this._attachments)\n attachment[Symbol.dispose]();\n\n this._attachments.length = 0;\n }\n\n public [Symbol.iterator](): Iterator<Attachment> {\n return this._attachments[Symbol.iterator]();\n }\n\n /** For tests. */\n public get attachments(): object[] {\n return this._attachments;\n }\n\n public get isEmpty(): boolean {\n return 0 === this._attachments.length;\n }\n\n public get areAllTileTreesLoaded(): boolean {\n return this._attachments.every((x) => x.areAllTileTreesLoaded);\n }\n\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n for (const attachment of this._attachments)\n trees.disclose(attachment);\n }\n\n public collectStatistics(stats: RenderMemory.Statistics): void {\n for (const attachment of this._attachments)\n attachment.collectStatistics(stats);\n }\n\n public addToScene(context: SceneContext): void {\n for (const attachment of this._attachments)\n attachment.addToScene(context);\n }\n\n public findById(attachmentId: Id64String): Attachment | undefined {\n return this._attachments.find((attachment: Attachment) => attachment.viewAttachmentProps.id === attachmentId);\n }\n}\n\n/** A view of a [SheetModel]($backend).\n * @public\n * @extensions\n */\nexport class SheetViewState extends ViewState2d {\n /** The width and height of the sheet in world coordinates. */\n public readonly sheetSize: Point2d;\n private _attachmentsInfo: ViewAttachmentsInfo;\n private _attachments?: ViewAttachments;\n private readonly _viewedExtents: AxisAlignedBox3d;\n\n public get attachmentIds(): Id64Array {\n return this._attachmentsInfo.toJSON();\n }\n\n public static override get className() { return \"SheetViewDefinition\"; }\n\n public static override createFromProps(viewStateData: ViewStateProps, iModel: IModelConnection): SheetViewState {\n const cat = new CategorySelectorState(viewStateData.categorySelectorProps, iModel);\n const displayStyleState = new DisplayStyle2dState(viewStateData.displayStyleProps, iModel);\n\n // use \"new this\" so subclasses are correct\n return new this(viewStateData.viewDefinitionProps as ViewDefinition2dProps, iModel, cat, displayStyleState, viewStateData.sheetProps!, viewStateData.sheetAttachments!);\n }\n\n public override toProps(): ViewStateProps {\n const props = super.toProps();\n\n props.sheetAttachments = this._attachmentsInfo.toJSON();\n\n // For sheetProps all that is actually used is the size, so just null out everything else.\n const codeProps = { spec: \"\", scope: \"\", value: \"\" };\n props.sheetProps = {\n model: \"\",\n code: codeProps,\n classFullName: \"\",\n width: this.sheetSize.x,\n height: this.sheetSize.y,\n scale: 1,\n };\n\n return props;\n }\n\n /** Strictly for testing. @internal */\n public get viewAttachmentProps(): Array<Readonly<ViewAttachmentProps>> {\n return this._attachmentsInfo.viewAttachmentProps.map((x) => {\n return {\n ...x,\n attachedView: undefined,\n };\n });\n }\n\n /** Strictly for testing. @internal */\n public get viewAttachmentInfos(): Id64Array | Array<{ attachedView: ViewState }> {\n return this._attachmentsInfo.attachments;\n }\n\n /** Strictly for testing. @internal */\n public get attachments(): object[] | undefined {\n return this._attachments?.attachments;\n }\n\n public override isDrawingView(): this is DrawingViewState { return false; }\n public override isSheetView(): this is SheetViewState { return true; }\n\n public constructor(props: ViewDefinition2dProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle2dState, sheetProps: SheetProps, attachments: Id64Array) {\n super(props, iModel, categories, displayStyle);\n if (categories instanceof SheetViewState) {\n // we are coming from clone...\n this.sheetSize = categories.sheetSize.clone();\n this._attachmentsInfo = categories._attachmentsInfo.clone(iModel);\n this._viewedExtents = categories._viewedExtents.clone();\n } else {\n this.sheetSize = Point2d.create(sheetProps.width, sheetProps.height);\n this._attachmentsInfo = ViewAttachmentsInfo.fromJSON(attachments);\n\n const extents = new Range3d(0, 0, 0, this.sheetSize.x, this.sheetSize.y, 0);\n const margin = 1.1;\n extents.scaleAboutCenterInPlace(margin);\n this._viewedExtents = extents;\n }\n }\n\n public override getOrigin() {\n const origin = super.getOrigin();\n if (this._attachments)\n origin.z = -this._attachments.maxDepth;\n\n return origin;\n }\n\n public override getExtents() {\n const extents = super.getExtents();\n if (this._attachments)\n extents.z = this._attachments.maxDepth + Frustum2d.minimumZDistance;\n\n return extents;\n }\n\n /** Overrides [[ViewState.discloseTileTrees]] to include tile trees associated with [ViewAttachment]($backend)s displayed on this sheet. */\n public override discloseTileTrees(trees: DisclosedTileTreeSet): void {\n super.discloseTileTrees(trees);\n if (this._attachments)\n trees.disclose(this._attachments);\n }\n\n /** @internal */\n public override collectNonTileTreeStatistics(stats: RenderMemory.Statistics): void {\n super.collectNonTileTreeStatistics(stats);\n if (this._attachments)\n this._attachments.collectStatistics(stats);\n }\n\n public override get defaultExtentLimits() {\n return { min: Constant.oneMillimeter, max: this.sheetSize.magnitude() * 10 };\n }\n\n public override getViewedExtents(): AxisAlignedBox3d {\n return this._viewedExtents;\n }\n\n /** @internal */\n protected override preload(hydrateRequest: HydrateViewStateRequestProps): void {\n super.preload(hydrateRequest);\n this._attachmentsInfo.preload(hydrateRequest);\n }\n\n /** @internal */\n protected override async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\n const promises = [];\n promises.push(super.postload(hydrateResponse));\n promises.push(this._attachmentsInfo.postload(hydrateResponse, this.iModel));\n await Promise.all(promises);\n }\n\n /** @internal */\n public override createScene(context: SceneContext): void {\n super.createScene(context);\n if (this._attachments)\n this._attachments.addToScene(context);\n }\n\n /** @internal */\n public override get secondaryViewports(): Iterable<Viewport> {\n const attachments = this._attachments;\n if (!attachments)\n return super.secondaryViewports;\n\n function* iterator() {\n for (const attachment of attachments!) {\n const vp = attachment.viewport;\n if (vp)\n yield vp;\n }\n }\n\n return {\n [Symbol.iterator]: () => iterator(),\n };\n }\n\n /** @internal */\n private async queryAttachmentIds(): Promise<Id64Array> {\n const ecsql = `SELECT ECInstanceId as attachmentId FROM bis.ViewAttachment WHERE model.Id=${this.baseModelId}`;\n const ids: string[] = [];\n for await (const row of this.iModel.createQueryReader(ecsql))\n ids.push(row[0]);\n\n return ids;\n }\n\n public override async changeViewedModel(modelId: Id64String): Promise<void> {\n await super.changeViewedModel(modelId);\n const attachmentIds = await this.queryAttachmentIds();\n this._attachmentsInfo = ViewAttachmentsInfo.fromJSON(attachmentIds);\n\n assert(undefined === this._attachments);\n }\n\n /** See [[ViewState.attachToViewport]]. */\n public override attachToViewport(args: AttachToViewportArgs): void {\n super.attachToViewport(args);\n assert(undefined === this._attachments);\n this._attachments = this._attachmentsInfo.createAttachments(this);\n }\n\n /** See [[ViewState.detachFromViewport]]. */\n public override detachFromViewport(): void {\n super.detachFromViewport();\n this._attachments = dispose(this._attachments);\n }\n\n public override get areAllTileTreesLoaded(): boolean {\n return super.areAllTileTreesLoaded && (!this._attachments || this._attachments.areAllTileTreesLoaded);\n }\n\n /** Create a sheet border decoration graphic. */\n private createBorder(width: number, height: number, context: DecorateContext): RenderGraphic {\n const border = SheetBorder.create(width, height, context);\n const builder = context.createGraphicBuilder(GraphicType.ViewBackground);\n border.addToBuilder(builder);\n return builder.finish();\n }\n\n /** @internal */\n public override decorate(context: DecorateContext): void {\n super.decorate(context);\n if (this.sheetSize !== undefined) {\n const border = this.createBorder(this.sheetSize.x, this.sheetSize.y, context);\n context.setViewBackground(border);\n }\n }\n\n public override computeFitRange(): Range3d {\n const size = this.sheetSize;\n if (0 >= size.x || 0 >= size.y)\n return super.computeFitRange();\n return new Range3d(0, 0, -1, size.x, size.y, 1);\n }\n\n /** @internal */\n public override getAttachmentViewport(args: GetAttachmentViewportArgs): Viewport | undefined {\n const attachment = args.viewAttachmentId ? this._attachments?.findById(args.viewAttachmentId) : undefined;\n if (!attachment) {\n return undefined;\n }\n\n return args.inSectionDrawingAttachment ? attachment.viewport?.view.getAttachmentViewport({ inSectionDrawingAttachment: true }) : attachment.viewport;\n }\n\n /** @beta */\n public override computeDisplayTransform(args: ComputeDisplayTransformArgs): Transform | undefined {\n // ###TODO we're currently ignoring model and element Id in args, assuming irrelevant for sheets.\n // Should probably call super or have super call us.\n const attachment = undefined !== args.viewAttachmentId ? this._attachments?.findById(args.viewAttachmentId) : undefined;\n if (!attachment || !(attachment instanceof OrthographicAttachment)) {\n return undefined;\n }\n\n const sheetTransform = attachment.toSheet;\n const sectionTransform = args.inSectionDrawingAttachment ? attachment.view.computeDisplayTransform(args) : undefined;\n if (!sectionTransform) {\n return sheetTransform.clone(args.output);\n }\n\n return sheetTransform.multiplyTransformTransform(sectionTransform, args.output);\n }\n}\n\n/** A mostly no-op RenderTarget for an Attachment.\n * its Scene and symbology overrides.\n */\nclass AttachmentTarget extends MockRender.OffScreenTarget {\n private readonly _attachment: OrthographicAttachment;\n\n public constructor(attachment: OrthographicAttachment) {\n // The dimensions don't matter - we're not drawing anything.\n const rect = new ViewRect(1, 1);\n super(IModelApp.renderSystem, rect);\n this._attachment = attachment;\n }\n\n public override changeScene(scene: Scene): void {\n this._attachment.scene = scene;\n }\n\n public override overrideFeatureSymbology(ovrs: FeatureSymbology.Overrides): void {\n this._attachment.symbologyOverrides = ovrs;\n }\n}\n\n/** Draws the contents of a view attachment into a sheet view. */\ninterface Attachment extends Disposable {\n readonly areAllTileTreesLoaded: boolean;\n addToScene: (context: SceneContext) => void;\n discloseTileTrees: (trees: DisclosedTileTreeSet) => void;\n readonly zDepth: number;\n collectStatistics: (stats: RenderMemory.Statistics) => void;\n viewAttachmentProps: ViewAttachmentProps;\n readonly viewport?: Viewport;\n}\n\n/** Draws the contents a 2d or orthographic 3d view directly into a sheet view.\n * We select tiles for the view in the context of a light-weight offscreen viewport with a no-op RenderTarget, then\n * collect the resultant graphics and add them to the sheet view's scene.\n */\nclass OrthographicAttachment {\n private readonly _viewport: OffScreenViewport;\n private readonly _props: ViewAttachmentProps;\n private readonly _sheetModelId: Id64String;\n private readonly _viewFlagOverrides: ViewFlagOverrides;\n private readonly _toSheet: Transform;\n private readonly _fromSheet: Transform;\n private readonly _sizeInMeters: Point2d;\n private readonly _range: Range3d;\n private readonly _viewRect = new ViewRect(0, 0, 1, 1);\n private readonly _originalFrustum = new Frustum();\n private readonly _clipVolume?: RenderClipVolume;\n private readonly _hiddenLineSettings?: HiddenLine.Settings;\n private readonly _scale: { x: number, y: number };\n private _debugFeatureTable?: PackedFeatureTable;\n public scene?: Scene;\n public symbologyOverrides: FeatureSymbology.Overrides;\n public readonly zDepth: number;\n\n public get view(): ViewState {\n return this._viewport.view;\n }\n\n public get viewAttachmentProps() {\n return this._props;\n }\n\n public get viewport(): Viewport {\n return this._viewport;\n }\n\n public constructor(view: ViewState, props: ViewAttachmentProps, sheetView: SheetViewState) {\n this.symbologyOverrides = new FeatureSymbology.Overrides(view);\n const target = new AttachmentTarget(this);\n this._viewport = OffScreenViewport.createViewport(view, target, true);\n\n this._props = props;\n this._sheetModelId = sheetView.baseModelId;\n\n const applyClip = true; // set to false for debugging\n this._viewFlagOverrides = {\n ...view.viewFlags,\n clipVolume: applyClip,\n lighting: false,\n shadows: false,\n };\n\n const placement = Placement2d.fromJSON(props.placement);\n const range = placement.calculateRange();\n this._range = range;\n this._sizeInMeters = new Point2d(range.xLength(), range.yLength());\n\n // Compute transform from attached view's world coordinates to sheet's world coordinates.\n // NB: We obtain the extents and origin from the *viewport* not the *view* - they may have been adjusted by the viewport.\n const applySkew = true; // set to false for debugging\n const skew = applySkew ? view.getAspectRatioSkew() : 1;\n const extents = this._viewport.viewingSpace.viewDelta.clone();\n const zDepth = Math.abs(extents.z);\n const scaleX = this._sizeInMeters.x / Math.abs(extents.x);\n const scaleY = skew * this._sizeInMeters.y / Math.abs(extents.y);\n this._scale = { x: 1 / scaleX, y: 1 / scaleY };\n\n const zBias = Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);\n this.zDepth = 1.01 * (zDepth - zBias); // give a little padding so that geometry right up against far plane doesn't get clipped.\n\n // View origin is at the *back* of the view. Align *front* of view based on display priority.\n const viewRot = view.getRotation();\n const viewOrg = viewRot.multiplyVector(this._viewport.viewingSpace.viewOrigin);\n viewOrg.z += zDepth;\n viewRot.multiplyTransposeVectorInPlace(viewOrg);\n\n const matrix = Matrix3d.createScale(scaleX, scaleY, 1);\n matrix.multiplyMatrixMatrix(viewRot, matrix);\n const origin = Matrix3d.xyzMinusMatrixTimesXYZ(viewOrg, matrix, viewOrg);\n const attachmentOrigin = Point3d.createFrom(placement.origin);\n attachmentOrigin.z = zBias;\n const viewOrgToAttachment = attachmentOrigin.minus(viewOrg);\n origin.addInPlace(viewOrgToAttachment);\n this._toSheet = Transform.createRefs(origin, matrix);\n this._fromSheet = this._toSheet.inverse()!;\n\n // If the attached view is a section drawing, it may itself have an attached spatial view with a clip.\n // The clip needs to be transformed into sheet space.\n if (view.isDrawingView())\n this._viewport.drawingToSheetTransform = this._toSheet;\n\n // ###TODO? If we also apply the attachment's clip to the attached view, we may get additional culling during tile selection.\n // However the attached view's frustum is already clipped by intersection with sheet view's frustum, and additional clipping planes\n // introduce additional computation, so possibly not worth it.\n\n // Transform the view's clip (if any) to sheet space\n let viewClip = view.viewFlags.clipVolume ? view.getViewClip()?.clone() : undefined;\n if (viewClip)\n viewClip.transformInPlace(this._toSheet);\n else\n viewClip = ClipVector.createEmpty();\n\n let sheetClip;\n if (undefined !== props.jsonProperties?.clip)\n sheetClip = ClipVector.fromJSON(props.jsonProperties?.clip);\n\n if (sheetClip && sheetClip.isValid) {\n // Clip to view attachment's clip. NB: clip is in sheet coordinate space.\n for (const clip of sheetClip.clips)\n viewClip.clips.push(clip);\n } else {\n // Clip to view attachment's bounding box\n viewClip.appendShape([\n Point3d.create(this._range.low.x, this._range.low.y),\n Point3d.create(this._range.high.x, this._range.low.y),\n Point3d.create(this._range.high.x, this._range.high.y),\n Point3d.create(this._range.low.x, this._range.high.y),\n ]);\n }\n\n this._clipVolume = IModelApp.renderSystem.createClipVolume(viewClip);\n\n // Save off the original frustum (potentially adjusted by viewport).\n this._viewport.setupFromView();\n this._viewport.viewingSpace.getFrustum(CoordSystem.World, true, this._originalFrustum);\n\n const applyHiddenLineSettings = true; // for debugging edge display, set to false...\n const style = view.displayStyle;\n if (style.is3d() && applyHiddenLineSettings)\n this._hiddenLineSettings = style.settings.hiddenLineSettings;\n }\n\n public [Symbol.dispose](): void {\n this._viewport[Symbol.dispose]();\n }\n\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n trees.disclose(this._viewport);\n }\n\n public addToScene(context: SceneContext): void {\n if (context.viewport.freezeScene)\n return;\n\n if (!context.viewport.view.viewsCategory(this._props.category))\n return;\n\n const wantBounds = context.viewport.wantViewAttachmentBoundaries;\n const wantClipShapes = context.viewport.wantViewAttachmentClipShapes;\n if (wantBounds || wantClipShapes) {\n const builder = context.createSceneGraphicBuilder();\n if (wantBounds) {\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\n builder.addRangeBox(this._range);\n }\n\n if (wantClipShapes && this._clipVolume) {\n builder.setSymbology(ColorDef.blue, ColorDef.blue, 2);\n for (const prim of this._clipVolume.clipVector.clips) {\n if (!(prim instanceof ClipShape))\n continue; // ###TODO handle non-shape primitives, if any such ever encountered\n\n const pts = [];\n const tf = prim.transformFromClip;\n for (const pt of prim.polygon) {\n const tfPt = tf ? tf.multiplyPoint3d(pt) : pt;\n pts.push(new Point2d(tfPt.x, tfPt.y));\n }\n\n builder.addLineString2d(pts, 0);\n }\n }\n\n // Put into a Batch so that we can see tooltip with attachment Id on mouseover.\n const batch = context.target.renderSystem.createBatch(builder.finish(), this.getDebugFeatureTable(), this._range);\n context.outputGraphic(batch);\n }\n\n if (!context.viewport.wantViewAttachments)\n return;\n\n // Pixel size used to compute size of ViewRect so that tiles of appropriate LOD are selected.\n const pixelSize = context.viewport.getPixelSizeAtPoint();\n if (0 === pixelSize)\n return;\n\n // Adjust attached view frustum based on intersection with sheet view frustum.\n const attachFrustum = this._originalFrustum.transformBy(this._toSheet);\n const attachFrustumRange = attachFrustum.toRange();\n const sheetFrustum = context.viewport.getWorldFrustum();\n const sheetFrustumRange = sheetFrustum.toRange();\n const intersect = attachFrustumRange.intersect(sheetFrustumRange);\n if (intersect.isNull)\n return;\n\n attachFrustum.initFromRange(intersect);\n attachFrustum.transformBy(this._fromSheet, attachFrustum);\n this._viewport.setupViewFromFrustum(attachFrustum);\n\n // Adjust view rect based on size of attachment on screen so that tiles of appropriate LOD are selected.\n const width = this._sizeInMeters.x * intersect.xLength() / attachFrustumRange.xLength();\n const height = this._sizeInMeters.y * intersect.yLength() / attachFrustumRange.yLength();\n this._viewRect.width = Math.max(1, Math.round(width / pixelSize));\n this._viewRect.height = Math.max(1, Math.round(height / pixelSize));\n this._viewport.setRect(this._viewRect);\n\n // Propagate settings from on-screen viewport.\n this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;\n this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);\n\n // Create the scene.\n this._viewport.renderFrame();\n\n const scene = this.scene;\n if (!scene)\n return;\n\n // Extract scene graphics and insert into on-screen scene context.\n const options = {\n viewAttachmentId: this._props.id,\n clipVolume: this._clipVolume,\n hline: this._hiddenLineSettings,\n frustum: {\n is3d: this.view.is3d(),\n scale: this._scale,\n },\n };\n\n const outputGraphics = (source: RenderGraphic[]) => {\n if (0 === source.length)\n return;\n\n const graphics = new GraphicBranch();\n graphics.setViewFlagOverrides(this._viewFlagOverrides);\n graphics.symbologyOverrides = this.symbologyOverrides;\n\n for (const graphic of source)\n graphics.entries.push(graphic);\n\n const branch = context.createGraphicBranch(graphics, this._toSheet, options);\n context.outputGraphic(branch);\n };\n\n outputGraphics(scene.foreground);\n context.withGraphicType(TileGraphicType.BackgroundMap, () => outputGraphics(scene.background));\n context.withGraphicType(TileGraphicType.Overlay, () => outputGraphics(scene.overlay));\n\n // Report tile statistics to sheet view's viewport.\n const tileAdmin = IModelApp.tileAdmin;\n const selectedAndReady = tileAdmin.getTilesForUser(this._viewport);\n const requested = tileAdmin.getRequestsForUser(this._viewport);\n tileAdmin.addExternalTilesForUser(context.viewport, {\n requested: requested?.size ?? 0,\n selected: selectedAndReady?.selected.size ?? 0,\n ready: selectedAndReady?.ready.size ?? 0,\n });\n }\n\n private getDebugFeatureTable(): PackedFeatureTable {\n if (this._debugFeatureTable)\n return this._debugFeatureTable;\n\n const featureTable = new FeatureTable(1, this._sheetModelId);\n featureTable.insert(new Feature(this._props.id));\n this._debugFeatureTable = PackedFeatureTable.pack(featureTable);\n return this._debugFeatureTable;\n }\n\n public get areAllTileTreesLoaded(): boolean {\n return this.view.areAllTileTreesLoaded;\n }\n\n public collectStatistics(_stats: RenderMemory.Statistics): void {\n // Handled by discloseTileTrees()\n }\n\n public get toSheet(): Transform {\n return this._toSheet;\n }\n}\n\nfunction createRasterAttachmentViewport(_view: ViewState, _rect: ViewRect, _attachment: RasterAttachment): OffScreenViewport {\n class RasterAttachmentViewport extends OffScreenViewport {\n private _sceneContext?: SceneContext;\n private _isSceneReady = false;\n private readonly _attachment: RasterAttachment;\n\n public constructor(view: ViewState, rect: ViewRect, attachment: RasterAttachment) {\n super(IModelApp.renderSystem.createOffscreenTarget(rect));\n this._attachment = attachment;\n this._isAspectRatioLocked = true;\n this.changeView(view);\n }\n\n public override createSceneContext(): SceneContext {\n assert(!this._isSceneReady);\n\n this._sceneContext = super.createSceneContext();\n return this._sceneContext;\n }\n\n public override renderFrame(): void {\n assert(!this._isSceneReady);\n\n this.clearSceneContext();\n super.renderFrame();\n\n if (undefined !== this._sceneContext) {\n this._isSceneReady = !this._sceneContext.hasMissingTiles && this.view.areAllTileTreesLoaded;\n if (this._isSceneReady)\n this._attachment.produceGraphics(this._sceneContext);\n\n this._sceneContext = undefined;\n }\n }\n\n private clearSceneContext(): void {\n this._sceneContext = undefined;\n }\n\n public override addDecorations(_decorations: Decorations): void {\n // ###TODO: skybox, ground plane, possibly grid. DecorateContext requires a ScreenViewport...\n }\n }\n\n return new RasterAttachmentViewport(_view, _rect, _attachment);\n}\n\n/** Draws a 3d view with camera enabled into a sheet view by producing an image of the view's contents offscreen. */\nclass RasterAttachment {\n private readonly _props: ViewAttachmentProps;\n private readonly _placement: Placement2d;\n private readonly _transform: Transform;\n public readonly zDepth: number;\n private _viewport?: OffScreenViewport;\n private _graphics?: RenderGraphic;\n\n public constructor(view: ViewState, props: ViewAttachmentProps, sheetView: SheetViewState) {\n // Render to a 2048x2048 view rect. Scale in Y to preserve aspect ratio.\n const maxSize = 2048;\n const rect = new ViewRect(0, 0, maxSize, maxSize);\n const height = maxSize * view.getAspectRatio() * view.getAspectRatioSkew();\n const skew = maxSize / height;\n view.setAspectRatioSkew(skew);\n\n if (true !== props.jsonProperties?.displayOptions?.preserveBackground) {\n // Make background color 100% transparent so that Viewport.readImageBuffer() will discard transparent pixels.\n const bgColor = sheetView.displayStyle.backgroundColor.withAlpha(0);\n view.displayStyle.backgroundColor = bgColor;\n }\n\n this._viewport = createRasterAttachmentViewport(view, rect, this);\n this._props = props;\n this._placement = Placement2d.fromJSON(props.placement);\n this._transform = this._placement.transform;\n this.zDepth = Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);\n }\n\n public [Symbol.dispose](): void {\n this._viewport?.[Symbol.dispose]();\n }\n\n public get viewAttachmentProps() {\n return this._props;\n }\n\n public get viewport(): Viewport | undefined {\n return this._viewport;\n }\n\n public get areAllTileTreesLoaded() {\n return this._viewport?.areAllTileTreesLoaded ?? true;\n }\n\n public addToScene(context: SceneContext): void {\n // ###TODO: check viewport.wantViewAttachmentClipShapes\n if (!context.viewport.view.viewsCategory(this._props.category))\n return;\n\n if (context.viewport.wantViewAttachmentBoundaries) {\n const builder = context.createSceneGraphicBuilder(this._transform);\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\n builder.addRangeBox(Range3d.createRange2d(this._placement.bbox));\n context.outputGraphic(builder.finish());\n }\n\n if (!context.viewport.wantViewAttachments)\n return;\n\n if (this._graphics) {\n context.outputGraphic(this._graphics);\n return;\n }\n\n if (undefined === this._viewport)\n return;\n\n this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;\n this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);\n\n this._viewport.renderFrame();\n if (this._graphics)\n context.outputGraphic(this._graphics);\n }\n\n public discloseTileTrees(trees: DisclosedTileTreeSet) {\n if (this._viewport)\n trees.disclose(this._viewport);\n }\n\n public produceGraphics(context: SceneContext): void {\n assert(context.viewport === this._viewport);\n this._graphics = this.createGraphics(this._viewport);\n this._viewport = dispose(this._viewport);\n\n if (undefined !== this._graphics)\n context.outputGraphic(this._graphics);\n }\n\n private createGraphics(vp: Viewport): RenderGraphic | undefined {\n // Create a texture from the contents of the view.\n const image = vp.readImageBuffer({ upsideDown: true });\n if (undefined === image)\n return undefined;\n\n const debugImage = false; // set to true to open a window displaying the captured image.\n if (debugImage) {\n const url = imageBufferToPngDataUrl(image, false);\n if (url)\n openImageDataUrlInNewWindow(url, \"Attachment\");\n }\n\n const texture = IModelApp.renderSystem.createTexture({\n image: { source: image, transparency: TextureTransparency.Opaque },\n });\n if (!texture)\n return undefined;\n\n // Create a material for the texture\n const graphicParams = new GraphicParams();\n graphicParams.material = IModelApp.renderSystem.createRenderMaterial({ textureMapping: { texture } });\n\n // Apply the texture to a rectangular polyface.\n const depth = this.zDepth;\n const east = this._placement.bbox.low.x;\n const west = this._placement.bbox.high.x;\n const north = this._placement.bbox.low.y;\n const south = this._placement.bbox.high.y;\n const corners = [\n Point3d.create(east, north, depth),\n Point3d.create(west, north, depth),\n Point3d.create(west, south, depth),\n Point3d.create(east, south, depth),\n ];\n const params = [\n Point2d.create(0, 0),\n Point2d.create(1, 0),\n Point2d.create(1, 1),\n Point2d.create(0, 1),\n ];\n\n const strokeOptions = new StrokeOptions();\n strokeOptions.needParams = strokeOptions.shouldTriangulate = true;\n const polyfaceBuilder = PolyfaceBuilder.create(strokeOptions);\n polyfaceBuilder.addQuadFacet(corners, params);\n const polyface = polyfaceBuilder.claimPolyface();\n\n const graphicBuilder = IModelApp.renderSystem.createGraphicBuilder(Transform.createIdentity(), GraphicType.Scene, vp, this._props.id);\n graphicBuilder.activateGraphicParams(graphicParams);\n graphicBuilder.addPolyface(polyface, false);\n const graphic = graphicBuilder.finish();\n\n // Wrap the polyface in a GraphicBranch.\n const branch = new GraphicBranch(true);\n const vfOvrs = createDefaultViewFlagOverrides({ clipVolume: true, shadows: false, lighting: false, thematic: false });\n\n // Disable transparency - background pixels are 100% transparent so they will be discarded anyway. Other pixels are 100% opaque.\n vfOvrs.transparency = false;\n branch.setViewFlagOverrides(vfOvrs);\n branch.symbologyOverrides = new FeatureSymbology.Overrides();\n branch.entries.push(graphic);\n\n // Apply the attachment's clip, if any.\n let clipVolume;\n if (this._props.jsonProperties?.clip) {\n const clipVector = ClipVector.fromJSON(this._props.jsonProperties?.clip);\n if (clipVector.isValid)\n clipVolume = IModelApp.renderSystem.createClipVolume(clipVector);\n }\n\n return IModelApp.renderSystem.createGraphicBranch(branch, this._transform, { clipVolume });\n }\n\n public collectStatistics(stats: RenderMemory.Statistics): void {\n if (this._graphics)\n this._graphics.collectStatistics(stats);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SheetViewState.js","sourceRoot":"","sources":["../../src/SheetViewState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAyB,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AI,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;YACzE,IAAI,UAAU,CAAC,OAAO;gBACpB,UAAU,GAAG,SAAS,CAAC,YAAY,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACrE,CAAC;QAED,OAAO,SAAS,CAAC,YAAY,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;IAC7F,CAAC;IAEM,iBAAiB,CAAC,KAA8B;QACrD,IAAI,IAAI,CAAC,SAAS;YAChB,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;CACF","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 Views\n */\n\nimport { assert, CompressedId64Set, dispose, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport { Angle, ClipShape, ClipVector, Constant, Matrix3d, Point2d, Point3d, PolyfaceBuilder, Range2d, Range3d, StrokeOptions, Transform } from \"@itwin/core-geometry\";\nimport {\n AxisAlignedBox3d, ColorDef, Feature, FeatureTable, Frustum, Gradient, GraphicParams, HiddenLine, HydrateViewStateRequestProps, HydrateViewStateResponseProps, PackedFeatureTable, Placement2d, SheetProps,\n TextureTransparency, ViewAttachmentProps, ViewDefinition2dProps, ViewFlagOverrides, ViewStateProps,\n} from \"@itwin/core-common\";\nimport { CategorySelectorState } from \"./CategorySelectorState\";\nimport { DisplayStyle2dState } from \"./DisplayStyleState\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { GraphicBuilder } from \"./render/GraphicBuilder\";\nimport { RenderGraphic } from \"./render/RenderGraphic\";\nimport { GraphicBranch } from \"./render/GraphicBranch\";\nimport { Frustum2d } from \"./Frustum2d\";\nimport { Scene } from \"./render/Scene\";\nimport { Decorations } from \"./render/Decorations\";\nimport { MockRender } from \"./internal/render/MockRender\";\nimport { RenderClipVolume } from \"./render/RenderClipVolume\";\nimport { RenderMemory } from \"./render/RenderMemory\";\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\nimport { DecorateContext, SceneContext } from \"./ViewContext\";\nimport { IModelApp } from \"./IModelApp\";\nimport { CoordSystem } from \"./CoordSystem\";\nimport { OffScreenViewport, Viewport } from \"./Viewport\";\nimport { AttachToViewportArgs, ComputeDisplayTransformArgs, GetAttachmentViewportArgs, ViewState, ViewState2d } from \"./ViewState\";\nimport { DrawingViewState } from \"./DrawingViewState\";\nimport { createDefaultViewFlagOverrides, DisclosedTileTreeSet, TileGraphicType } from \"./tile/internal\";\nimport { imageBufferToPngDataUrl, openImageDataUrlInNewWindow } from \"./common/ImageUtil\";\nimport { ViewRect } from \"./common/ViewRect\";\nimport { GraphicType } from \"./common/render/GraphicType\";\n\n// cSpell:ignore ovrs\n\n/** Describes the geometry and styling of a sheet border decoration.\n * The sheet border decoration mimics a sheet of paper with a drop shadow.\n */\nclass SheetBorder {\n private _rect: Point2d[];\n private _shadow: Point2d[];\n private _gradient: Gradient.Symb;\n\n private constructor(rect: Point2d[], shadow: Point2d[], gradient: Gradient.Symb) {\n this._rect = rect;\n this._shadow = shadow;\n this._gradient = gradient;\n }\n\n /** Create a new sheet border. If a context is supplied, points are transformed to view coordinates. */\n public static create(width: number, height: number, context?: DecorateContext) {\n // Rect\n const rect: Point3d[] = [\n Point3d.create(0, height),\n Point3d.create(0, 0),\n Point3d.create(width, 0),\n Point3d.create(width, height),\n Point3d.create(0, height)];\n if (context) {\n context.viewport.worldToViewArray(rect);\n }\n\n // Shadow\n const shadowWidth = .01 * Math.sqrt(width * width + height * height);\n const shadow: Point3d[] = [\n Point3d.create(shadowWidth, 0),\n Point3d.create(shadowWidth, -shadowWidth),\n Point3d.create(width + shadowWidth, -shadowWidth),\n Point3d.create(width + shadowWidth, height - shadowWidth),\n Point3d.create(width, height - shadowWidth),\n Point3d.create(width, 0),\n Point3d.create(shadowWidth, 0),\n ];\n if (context) {\n context.viewport.worldToViewArray(shadow);\n }\n\n // Gradient\n const gradient = new Gradient.Symb();\n gradient.mode = Gradient.Mode.Linear;\n gradient.angle = Angle.createDegrees(-45);\n gradient.keys = [{ value: 0, color: ColorDef.from(25, 25, 25) }, { value: 0.5, color: ColorDef.from(150, 150, 150) }];\n\n // Copy over points\n const rect2d: Point2d[] = [];\n for (const point of rect)\n rect2d.push(Point2d.createFrom(point));\n const shadow2d: Point2d[] = [];\n for (const point of shadow)\n shadow2d.push(Point2d.createFrom(point));\n\n return new SheetBorder(rect2d, shadow2d, gradient);\n }\n\n public getRange(): Range2d {\n const range = Range2d.createArray(this._rect);\n const shadowRange = Range2d.createArray(this._shadow);\n range.extendRange(shadowRange);\n return range;\n }\n\n /** Add this border to the given GraphicBuilder. */\n public addToBuilder(builder: GraphicBuilder) {\n const lineColor = ColorDef.black;\n const fillColor = ColorDef.black;\n\n const params = new GraphicParams();\n params.fillColor = fillColor;\n params.gradient = this._gradient;\n\n builder.activateGraphicParams(params);\n builder.addShape2d(this._shadow, Frustum2d.minimumZDistance);\n\n builder.setSymbology(lineColor, fillColor, 2);\n builder.addLineString2d(this._rect, 0);\n }\n}\n\n/** The information required to instantiate an Attachment object. See ViewAttachmentsInfo */\ninterface ViewAttachmentInfo extends ViewAttachmentProps {\n attachedView: ViewState;\n}\n\n/** The information required to instantiate an ViewAttachments object to draw ViewAttachments into a sheet. The list of view attachment Ids is\n * supplied to SheetViewState via the constructor. The corresponding ViewAttachmentProps for each attachment are obtained asynchronously in\n * SheetViewState.load(). The Attachments object is created in SheetViewState.attachToViewport and disposed of in SheetViewState.detachFromViewport.\n */\nclass ViewAttachmentsInfo {\n private _attachments: Id64Array | ViewAttachmentInfo[];\n\n public get attachments() { return this._attachments; }\n\n private constructor(attachments: Id64Array | ViewAttachmentInfo[]) {\n this._attachments = attachments;\n }\n\n public get isLoaded(): boolean {\n return 0 === this._attachments.length || \"string\" !== typeof this._attachments[0];\n }\n\n public get viewAttachmentProps(): Array<Readonly<ViewAttachmentProps>> {\n return this.isLoaded ? this._props : [];\n }\n\n private get _props(): ViewAttachmentInfo[] {\n assert(this.isLoaded);\n return this._attachments as ViewAttachmentInfo[];\n }\n\n private get _ids(): Id64Array {\n assert(!this.isLoaded);\n return this._attachments as Id64Array;\n }\n\n public static fromJSON(ids: Id64Array = []): ViewAttachmentsInfo {\n return new ViewAttachmentsInfo(ids);\n }\n\n public toJSON(): Id64Array {\n return this.isLoaded ? this._props.map((x) => x.id!) : [...this._ids];\n }\n\n public clone(iModel: IModelConnection): ViewAttachmentsInfo {\n let attachments = this._attachments;\n if (this.isLoaded) {\n // Need to clone the attached ViewStates.\n attachments = attachments.map((attachment) => {\n assert(typeof attachment !== \"string\");\n return {\n ...attachment,\n attachedView: attachment.attachedView.clone(iModel),\n };\n });\n }\n\n return new ViewAttachmentsInfo(attachments);\n }\n\n public preload(options: HydrateViewStateRequestProps) {\n if (this.isLoaded)\n return;\n options.sheetViewAttachmentIds = CompressedId64Set.sortAndCompress(this._ids);\n options.viewStateLoadProps = {\n displayStyle: {\n omitScheduleScriptElementIds: !IModelApp.tileAdmin.enableFrontendScheduleScripts,\n compressExcludedElementIds: true,\n },\n };\n }\n\n public async postload(options: HydrateViewStateResponseProps, iModel: IModelConnection) {\n if (options.sheetViewViews === undefined)\n return;\n if (options.sheetViewAttachmentProps === undefined)\n return;\n\n const viewStateProps = options.sheetViewViews; // This is viewstateProps, need to turn this into ViewState\n const promises = [];\n for (const viewProps of viewStateProps) {\n const loadView = async () => {\n try {\n if (viewProps === undefined)\n return undefined;\n const view = await iModel.views.convertViewStatePropsToViewState(viewProps);\n return view;\n } catch {\n return undefined;\n }\n };\n promises.push(loadView());\n }\n const views = await Promise.all(promises);\n\n const attachmentProps = options.sheetViewAttachmentProps as ViewAttachmentInfo[];\n assert(views.length === attachmentProps.length);\n const attachments = [];\n for (let i = 0; i < views.length; i++) {\n const view = views[i];\n if (view && !(view instanceof SheetViewState)) {\n const props = attachmentProps[i];\n props.attachedView = view;\n attachments.push(props);\n }\n }\n\n this._attachments = attachments;\n }\n\n public async load(iModel: IModelConnection): Promise<void> {\n if (this.isLoaded)\n return;\n\n const attachmentProps = await iModel.elements.getProps(this._ids) as ViewAttachmentInfo[];\n const promises = [];\n for (const attachment of attachmentProps) {\n const loadView = async () => {\n try {\n const view = await iModel.views.load(attachment.view.id);\n return view;\n } catch {\n return undefined;\n }\n };\n\n promises.push(loadView());\n }\n\n const views = await Promise.all(promises);\n assert(views.length === attachmentProps.length);\n\n const attachments = [];\n for (let i = 0; i < views.length; i++) {\n const view = views[i];\n if (view && !(view instanceof SheetViewState)) {\n const props = attachmentProps[i];\n props.attachedView = view;\n attachments.push(props);\n }\n }\n\n this._attachments = attachments;\n }\n\n public createAttachments(sheetView: SheetViewState): ViewAttachments | undefined {\n return this.isLoaded ? new ViewAttachments(this._props, sheetView) : undefined;\n }\n}\n\n/** The set of view attachments to be displayed in a Viewport via a SheetViewState. Allocated when the view becomes attached to a Viewport;\n * disposed of when it becomes detached from the viewport.\n */\nclass ViewAttachments {\n private readonly _attachments: Attachment[] = [];\n public maxDepth = Frustum2d.minimumZDistance;\n\n public constructor(infos: ViewAttachmentInfo[], sheetView: SheetViewState) {\n for (const info of infos) {\n const drawAsRaster = info.jsonProperties?.displayOptions?.drawAsRaster || (info.attachedView.is3d() && info.attachedView.isCameraOn);\n const ctor = drawAsRaster ? RasterAttachment : OrthographicAttachment;\n const attachment = new ctor(info.attachedView, info, sheetView);\n this._attachments.push(attachment);\n this.maxDepth = Math.max(this.maxDepth, attachment.zDepth);\n }\n }\n\n public [Symbol.dispose](): void {\n for (const attachment of this._attachments)\n attachment[Symbol.dispose]();\n\n this._attachments.length = 0;\n }\n\n public [Symbol.iterator](): Iterator<Attachment> {\n return this._attachments[Symbol.iterator]();\n }\n\n /** For tests. */\n public get attachments(): object[] {\n return this._attachments;\n }\n\n public get isEmpty(): boolean {\n return 0 === this._attachments.length;\n }\n\n public areAllTileTreesLoaded(displayedExtents: Range3d): boolean {\n return this._attachments.every((x) => {\n const placement = Placement2d.fromJSON(x.viewAttachmentProps.placement);\n const attachmentRange = placement.calculateRange();\n if (!attachmentRange.intersectsRangeXY(displayedExtents))\n return true;\n\n return x.areAllTileTreesLoaded});\n }\n\n /** Strictly for testing purposes */\n public areAllAttachmentsLoaded(): boolean {\n return this._attachments.every((attachment) => attachment.areAllTileTreesLoaded);\n }\n\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n for (const attachment of this._attachments)\n trees.disclose(attachment);\n }\n\n public collectStatistics(stats: RenderMemory.Statistics): void {\n for (const attachment of this._attachments)\n attachment.collectStatistics(stats);\n }\n\n public addToScene(context: SceneContext): void {\n for (const attachment of this._attachments)\n attachment.addToScene(context);\n }\n\n public findById(attachmentId: Id64String): Attachment | undefined {\n return this._attachments.find((attachment: Attachment) => attachment.viewAttachmentProps.id === attachmentId);\n }\n}\n\n/** A view of a [SheetModel]($backend).\n * @public\n * @extensions\n */\nexport class SheetViewState extends ViewState2d {\n /** The width and height of the sheet in world coordinates. */\n public readonly sheetSize: Point2d;\n private _attachmentsInfo: ViewAttachmentsInfo;\n private _attachments?: ViewAttachments;\n private readonly _viewedExtents: AxisAlignedBox3d;\n\n public get attachmentIds(): Id64Array {\n return this._attachmentsInfo.toJSON();\n }\n\n public static override get className() { return \"SheetViewDefinition\"; }\n\n public static override createFromProps(viewStateData: ViewStateProps, iModel: IModelConnection): SheetViewState {\n const cat = new CategorySelectorState(viewStateData.categorySelectorProps, iModel);\n const displayStyleState = new DisplayStyle2dState(viewStateData.displayStyleProps, iModel);\n\n // use \"new this\" so subclasses are correct\n return new this(viewStateData.viewDefinitionProps as ViewDefinition2dProps, iModel, cat, displayStyleState, viewStateData.sheetProps!, viewStateData.sheetAttachments!);\n }\n\n public override toProps(): ViewStateProps {\n const props = super.toProps();\n\n props.sheetAttachments = this._attachmentsInfo.toJSON();\n\n // For sheetProps all that is actually used is the size, so just null out everything else.\n const codeProps = { spec: \"\", scope: \"\", value: \"\" };\n props.sheetProps = {\n model: \"\",\n code: codeProps,\n classFullName: \"\",\n width: this.sheetSize.x,\n height: this.sheetSize.y,\n scale: 1,\n };\n\n return props;\n }\n\n /** Strictly for testing. @internal */\n public get viewAttachmentProps(): Array<Readonly<ViewAttachmentProps>> {\n return this._attachmentsInfo.viewAttachmentProps.map((x) => {\n return {\n ...x,\n attachedView: undefined,\n };\n });\n }\n\n /** Strictly for testing. @internal */\n public get viewAttachmentInfos(): Id64Array | Array<{ attachedView: ViewState }> {\n return this._attachmentsInfo.attachments;\n }\n\n /** Strictly for testing. @internal */\n public get attachments(): object[] | undefined {\n return this._attachments?.attachments;\n }\n\n public override isDrawingView(): this is DrawingViewState { return false; }\n public override isSheetView(): this is SheetViewState { return true; }\n\n public constructor(props: ViewDefinition2dProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle2dState, sheetProps: SheetProps, attachments: Id64Array) {\n super(props, iModel, categories, displayStyle);\n if (categories instanceof SheetViewState) {\n // we are coming from clone...\n this.sheetSize = categories.sheetSize.clone();\n this._attachmentsInfo = categories._attachmentsInfo.clone(iModel);\n this._viewedExtents = categories._viewedExtents.clone();\n } else {\n this.sheetSize = Point2d.create(sheetProps.width, sheetProps.height);\n this._attachmentsInfo = ViewAttachmentsInfo.fromJSON(attachments);\n\n const extents = new Range3d(0, 0, 0, this.sheetSize.x, this.sheetSize.y, 0);\n const margin = 1.1;\n extents.scaleAboutCenterInPlace(margin);\n this._viewedExtents = extents;\n }\n }\n\n public override getOrigin() {\n const origin = super.getOrigin();\n if (this._attachments)\n origin.z = -this._attachments.maxDepth;\n\n return origin;\n }\n\n public override getExtents() {\n const extents = super.getExtents();\n if (this._attachments)\n extents.z = this._attachments.maxDepth + Frustum2d.minimumZDistance;\n\n return extents;\n }\n\n /** Overrides [[ViewState.discloseTileTrees]] to include tile trees associated with [ViewAttachment]($backend)s displayed on this sheet. */\n public override discloseTileTrees(trees: DisclosedTileTreeSet): void {\n super.discloseTileTrees(trees);\n if (this._attachments)\n trees.disclose(this._attachments);\n }\n\n /** @internal */\n public override collectNonTileTreeStatistics(stats: RenderMemory.Statistics): void {\n super.collectNonTileTreeStatistics(stats);\n if (this._attachments)\n this._attachments.collectStatistics(stats);\n }\n\n public override get defaultExtentLimits() {\n return { min: Constant.oneMillimeter, max: this.sheetSize.magnitude() * 10 };\n }\n\n public override getViewedExtents(): AxisAlignedBox3d {\n return this._viewedExtents;\n }\n\n /** @internal */\n protected override preload(hydrateRequest: HydrateViewStateRequestProps): void {\n super.preload(hydrateRequest);\n this._attachmentsInfo.preload(hydrateRequest);\n }\n\n /** @internal */\n protected override async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\n const promises = [];\n promises.push(super.postload(hydrateResponse));\n promises.push(this._attachmentsInfo.postload(hydrateResponse, this.iModel));\n await Promise.all(promises);\n }\n\n /** @internal */\n public override createScene(context: SceneContext): void {\n super.createScene(context);\n if (this._attachments)\n this._attachments.addToScene(context);\n }\n\n /** @internal */\n public override get secondaryViewports(): Iterable<Viewport> {\n const attachments = this._attachments;\n if (!attachments)\n return super.secondaryViewports;\n\n function* iterator() {\n for (const attachment of attachments!) {\n const vp = attachment.viewport;\n if (vp)\n yield vp;\n }\n }\n\n return {\n [Symbol.iterator]: () => iterator(),\n };\n }\n\n /** @internal */\n private async queryAttachmentIds(): Promise<Id64Array> {\n const ecsql = `SELECT ECInstanceId as attachmentId FROM bis.ViewAttachment WHERE model.Id=${this.baseModelId}`;\n const ids: string[] = [];\n for await (const row of this.iModel.createQueryReader(ecsql))\n ids.push(row[0]);\n\n return ids;\n }\n\n public override async changeViewedModel(modelId: Id64String): Promise<void> {\n await super.changeViewedModel(modelId);\n const attachmentIds = await this.queryAttachmentIds();\n this._attachmentsInfo = ViewAttachmentsInfo.fromJSON(attachmentIds);\n\n assert(undefined === this._attachments);\n }\n\n /** See [[ViewState.attachToViewport]]. */\n public override attachToViewport(args: AttachToViewportArgs): void {\n super.attachToViewport(args);\n assert(undefined === this._attachments);\n this._attachments = this._attachmentsInfo.createAttachments(this);\n }\n\n /** See [[ViewState.detachFromViewport]]. */\n public override detachFromViewport(): void {\n super.detachFromViewport();\n this._attachments = dispose(this._attachments);\n }\n\n public override get areAllTileTreesLoaded(): boolean {\n let displayedExtents = this._viewedExtents;\n const frustum = this.calculateFrustum();\n if (frustum) {\n displayedExtents = frustum.toRange();\n }\n\n return super.areAllTileTreesLoaded && (!this._attachments || this._attachments.areAllTileTreesLoaded(displayedExtents));\n }\n\n /** @internal Strictly for testing */\n public areAllAttachmentsLoaded(): boolean {\n if (this._attachments) {\n return this._attachments.areAllAttachmentsLoaded();\n }\n return true;\n }\n\n /** Create a sheet border decoration graphic. */\n private createBorder(width: number, height: number, context: DecorateContext): RenderGraphic {\n const border = SheetBorder.create(width, height, context);\n const builder = context.createGraphicBuilder(GraphicType.ViewBackground);\n border.addToBuilder(builder);\n return builder.finish();\n }\n\n /** @internal */\n public override decorate(context: DecorateContext): void {\n super.decorate(context);\n if (this.sheetSize !== undefined) {\n const border = this.createBorder(this.sheetSize.x, this.sheetSize.y, context);\n context.setViewBackground(border);\n }\n }\n\n public override computeFitRange(): Range3d {\n const size = this.sheetSize;\n if (0 >= size.x || 0 >= size.y)\n return super.computeFitRange();\n return new Range3d(0, 0, -1, size.x, size.y, 1);\n }\n\n /** @internal */\n public override getAttachmentViewport(args: GetAttachmentViewportArgs): Viewport | undefined {\n const attachment = args.viewAttachmentId ? this._attachments?.findById(args.viewAttachmentId) : undefined;\n if (!attachment) {\n return undefined;\n }\n\n return args.inSectionDrawingAttachment ? attachment.viewport?.view.getAttachmentViewport({ inSectionDrawingAttachment: true }) : attachment.viewport;\n }\n\n /** @beta */\n public override computeDisplayTransform(args: ComputeDisplayTransformArgs): Transform | undefined {\n // ###TODO we're currently ignoring model and element Id in args, assuming irrelevant for sheets.\n // Should probably call super or have super call us.\n const attachment = undefined !== args.viewAttachmentId ? this._attachments?.findById(args.viewAttachmentId) : undefined;\n if (!attachment || !(attachment instanceof OrthographicAttachment)) {\n return undefined;\n }\n\n const sheetTransform = attachment.toSheet;\n const sectionTransform = args.inSectionDrawingAttachment ? attachment.view.computeDisplayTransform(args) : undefined;\n if (!sectionTransform) {\n return sheetTransform.clone(args.output);\n }\n\n return sheetTransform.multiplyTransformTransform(sectionTransform, args.output);\n }\n}\n\n/** A mostly no-op RenderTarget for an Attachment.\n * its Scene and symbology overrides.\n */\nclass AttachmentTarget extends MockRender.OffScreenTarget {\n private readonly _attachment: OrthographicAttachment;\n\n public constructor(attachment: OrthographicAttachment) {\n // The dimensions don't matter - we're not drawing anything.\n const rect = new ViewRect(1, 1);\n super(IModelApp.renderSystem, rect);\n this._attachment = attachment;\n }\n\n public override changeScene(scene: Scene): void {\n this._attachment.scene = scene;\n }\n\n public override overrideFeatureSymbology(ovrs: FeatureSymbology.Overrides): void {\n this._attachment.symbologyOverrides = ovrs;\n }\n}\n\n/** Draws the contents of a view attachment into a sheet view. */\ninterface Attachment extends Disposable {\n readonly areAllTileTreesLoaded: boolean;\n addToScene: (context: SceneContext) => void;\n discloseTileTrees: (trees: DisclosedTileTreeSet) => void;\n readonly zDepth: number;\n collectStatistics: (stats: RenderMemory.Statistics) => void;\n viewAttachmentProps: ViewAttachmentProps;\n readonly viewport?: Viewport;\n}\n\n/** Draws the contents a 2d or orthographic 3d view directly into a sheet view.\n * We select tiles for the view in the context of a light-weight offscreen viewport with a no-op RenderTarget, then\n * collect the resultant graphics and add them to the sheet view's scene.\n */\nclass OrthographicAttachment {\n private readonly _viewport: OffScreenViewport;\n private readonly _props: ViewAttachmentProps;\n private readonly _sheetModelId: Id64String;\n private readonly _viewFlagOverrides: ViewFlagOverrides;\n private readonly _toSheet: Transform;\n private readonly _fromSheet: Transform;\n private readonly _sizeInMeters: Point2d;\n private readonly _range: Range3d;\n private readonly _viewRect = new ViewRect(0, 0, 1, 1);\n private readonly _originalFrustum = new Frustum();\n private readonly _clipVolume?: RenderClipVolume;\n private readonly _hiddenLineSettings?: HiddenLine.Settings;\n private readonly _scale: { x: number, y: number };\n private _debugFeatureTable?: PackedFeatureTable;\n public scene?: Scene;\n public symbologyOverrides: FeatureSymbology.Overrides;\n public readonly zDepth: number;\n\n public get view(): ViewState {\n return this._viewport.view;\n }\n\n public get viewAttachmentProps() {\n return this._props;\n }\n\n public get viewport(): Viewport {\n return this._viewport;\n }\n\n public constructor(view: ViewState, props: ViewAttachmentProps, sheetView: SheetViewState) {\n this.symbologyOverrides = new FeatureSymbology.Overrides(view);\n const target = new AttachmentTarget(this);\n this._viewport = OffScreenViewport.createViewport(view, target, true);\n\n this._props = props;\n this._sheetModelId = sheetView.baseModelId;\n\n const applyClip = true; // set to false for debugging\n this._viewFlagOverrides = {\n ...view.viewFlags,\n clipVolume: applyClip,\n lighting: false,\n shadows: false,\n };\n\n const placement = Placement2d.fromJSON(props.placement);\n const range = placement.calculateRange();\n this._range = range;\n this._sizeInMeters = new Point2d(range.xLength(), range.yLength());\n\n // Compute transform from attached view's world coordinates to sheet's world coordinates.\n // NB: We obtain the extents and origin from the *viewport* not the *view* - they may have been adjusted by the viewport.\n const applySkew = true; // set to false for debugging\n const skew = applySkew ? view.getAspectRatioSkew() : 1;\n const extents = this._viewport.viewingSpace.viewDelta.clone();\n const zDepth = Math.abs(extents.z);\n const scaleX = this._sizeInMeters.x / Math.abs(extents.x);\n const scaleY = skew * this._sizeInMeters.y / Math.abs(extents.y);\n this._scale = { x: 1 / scaleX, y: 1 / scaleY };\n\n const zBias = Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);\n this.zDepth = 1.01 * (zDepth - zBias); // give a little padding so that geometry right up against far plane doesn't get clipped.\n\n // View origin is at the *back* of the view. Align *front* of view based on display priority.\n const viewRot = view.getRotation();\n const viewOrg = viewRot.multiplyVector(this._viewport.viewingSpace.viewOrigin);\n viewOrg.z += zDepth;\n viewRot.multiplyTransposeVectorInPlace(viewOrg);\n\n const matrix = Matrix3d.createScale(scaleX, scaleY, 1);\n matrix.multiplyMatrixMatrix(viewRot, matrix);\n const origin = Matrix3d.xyzMinusMatrixTimesXYZ(viewOrg, matrix, viewOrg);\n const attachmentOrigin = Point3d.createFrom(placement.origin);\n attachmentOrigin.z = zBias;\n const viewOrgToAttachment = attachmentOrigin.minus(viewOrg);\n origin.addInPlace(viewOrgToAttachment);\n this._toSheet = Transform.createRefs(origin, matrix);\n this._fromSheet = this._toSheet.inverse()!;\n\n // If the attached view is a section drawing, it may itself have an attached spatial view with a clip.\n // The clip needs to be transformed into sheet space.\n if (view.isDrawingView())\n this._viewport.drawingToSheetTransform = this._toSheet;\n\n // ###TODO? If we also apply the attachment's clip to the attached view, we may get additional culling during tile selection.\n // However the attached view's frustum is already clipped by intersection with sheet view's frustum, and additional clipping planes\n // introduce additional computation, so possibly not worth it.\n\n // Transform the view's clip (if any) to sheet space\n let viewClip = view.viewFlags.clipVolume ? view.getViewClip()?.clone() : undefined;\n if (viewClip)\n viewClip.transformInPlace(this._toSheet);\n else\n viewClip = ClipVector.createEmpty();\n\n let sheetClip;\n if (undefined !== props.jsonProperties?.clip)\n sheetClip = ClipVector.fromJSON(props.jsonProperties?.clip);\n\n if (sheetClip && sheetClip.isValid) {\n // Clip to view attachment's clip. NB: clip is in sheet coordinate space.\n for (const clip of sheetClip.clips)\n viewClip.clips.push(clip);\n } else {\n // Clip to view attachment's bounding box\n viewClip.appendShape([\n Point3d.create(this._range.low.x, this._range.low.y),\n Point3d.create(this._range.high.x, this._range.low.y),\n Point3d.create(this._range.high.x, this._range.high.y),\n Point3d.create(this._range.low.x, this._range.high.y),\n ]);\n }\n\n this._clipVolume = IModelApp.renderSystem.createClipVolume(viewClip);\n\n // Save off the original frustum (potentially adjusted by viewport).\n this._viewport.setupFromView();\n this._viewport.viewingSpace.getFrustum(CoordSystem.World, true, this._originalFrustum);\n\n const applyHiddenLineSettings = true; // for debugging edge display, set to false...\n const style = view.displayStyle;\n if (style.is3d() && applyHiddenLineSettings)\n this._hiddenLineSettings = style.settings.hiddenLineSettings;\n }\n\n public [Symbol.dispose](): void {\n this._viewport[Symbol.dispose]();\n }\n\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n trees.disclose(this._viewport);\n }\n\n public addToScene(context: SceneContext): void {\n if (context.viewport.freezeScene)\n return;\n\n if (!context.viewport.view.viewsCategory(this._props.category))\n return;\n\n const wantBounds = context.viewport.wantViewAttachmentBoundaries;\n const wantClipShapes = context.viewport.wantViewAttachmentClipShapes;\n if (wantBounds || wantClipShapes) {\n const builder = context.createSceneGraphicBuilder();\n if (wantBounds) {\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\n builder.addRangeBox(this._range);\n }\n\n if (wantClipShapes && this._clipVolume) {\n builder.setSymbology(ColorDef.blue, ColorDef.blue, 2);\n for (const prim of this._clipVolume.clipVector.clips) {\n if (!(prim instanceof ClipShape))\n continue; // ###TODO handle non-shape primitives, if any such ever encountered\n\n const pts = [];\n const tf = prim.transformFromClip;\n for (const pt of prim.polygon) {\n const tfPt = tf ? tf.multiplyPoint3d(pt) : pt;\n pts.push(new Point2d(tfPt.x, tfPt.y));\n }\n\n builder.addLineString2d(pts, 0);\n }\n }\n\n // Put into a Batch so that we can see tooltip with attachment Id on mouseover.\n const batch = context.target.renderSystem.createBatch(builder.finish(), this.getDebugFeatureTable(), this._range);\n context.outputGraphic(batch);\n }\n\n if (!context.viewport.wantViewAttachments)\n return;\n\n // Pixel size used to compute size of ViewRect so that tiles of appropriate LOD are selected.\n const pixelSize = context.viewport.getPixelSizeAtPoint();\n if (0 === pixelSize)\n return;\n\n // Adjust attached view frustum based on intersection with sheet view frustum.\n const attachFrustum = this._originalFrustum.transformBy(this._toSheet);\n const attachFrustumRange = attachFrustum.toRange();\n const sheetFrustum = context.viewport.getWorldFrustum();\n const sheetFrustumRange = sheetFrustum.toRange();\n const intersect = attachFrustumRange.intersect(sheetFrustumRange);\n if (intersect.isNull)\n return;\n\n attachFrustum.initFromRange(intersect);\n attachFrustum.transformBy(this._fromSheet, attachFrustum);\n this._viewport.setupViewFromFrustum(attachFrustum);\n\n // Adjust view rect based on size of attachment on screen so that tiles of appropriate LOD are selected.\n const width = this._sizeInMeters.x * intersect.xLength() / attachFrustumRange.xLength();\n const height = this._sizeInMeters.y * intersect.yLength() / attachFrustumRange.yLength();\n this._viewRect.width = Math.max(1, Math.round(width / pixelSize));\n this._viewRect.height = Math.max(1, Math.round(height / pixelSize));\n this._viewport.setRect(this._viewRect);\n\n // Propagate settings from on-screen viewport.\n this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;\n this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);\n\n // Create the scene.\n this._viewport.renderFrame();\n\n const scene = this.scene;\n if (!scene)\n return;\n\n // Extract scene graphics and insert into on-screen scene context.\n const options = {\n viewAttachmentId: this._props.id,\n clipVolume: this._clipVolume,\n hline: this._hiddenLineSettings,\n frustum: {\n is3d: this.view.is3d(),\n scale: this._scale,\n },\n };\n\n const outputGraphics = (source: RenderGraphic[]) => {\n if (0 === source.length)\n return;\n\n const graphics = new GraphicBranch();\n graphics.setViewFlagOverrides(this._viewFlagOverrides);\n graphics.symbologyOverrides = this.symbologyOverrides;\n\n for (const graphic of source)\n graphics.entries.push(graphic);\n\n const branch = context.createGraphicBranch(graphics, this._toSheet, options);\n context.outputGraphic(branch);\n };\n\n outputGraphics(scene.foreground);\n context.withGraphicType(TileGraphicType.BackgroundMap, () => outputGraphics(scene.background));\n context.withGraphicType(TileGraphicType.Overlay, () => outputGraphics(scene.overlay));\n\n // Report tile statistics to sheet view's viewport.\n const tileAdmin = IModelApp.tileAdmin;\n const selectedAndReady = tileAdmin.getTilesForUser(this._viewport);\n const requested = tileAdmin.getRequestsForUser(this._viewport);\n tileAdmin.addExternalTilesForUser(context.viewport, {\n requested: requested?.size ?? 0,\n selected: selectedAndReady?.selected.size ?? 0,\n ready: selectedAndReady?.ready.size ?? 0,\n });\n }\n\n private getDebugFeatureTable(): PackedFeatureTable {\n if (this._debugFeatureTable)\n return this._debugFeatureTable;\n\n const featureTable = new FeatureTable(1, this._sheetModelId);\n featureTable.insert(new Feature(this._props.id));\n this._debugFeatureTable = PackedFeatureTable.pack(featureTable);\n return this._debugFeatureTable;\n }\n\n public get areAllTileTreesLoaded(): boolean {\n return this.view.areAllTileTreesLoaded;\n }\n\n public collectStatistics(_stats: RenderMemory.Statistics): void {\n // Handled by discloseTileTrees()\n }\n\n public get toSheet(): Transform {\n return this._toSheet;\n }\n}\n\nfunction createRasterAttachmentViewport(_view: ViewState, _rect: ViewRect, _attachment: RasterAttachment): OffScreenViewport {\n class RasterAttachmentViewport extends OffScreenViewport {\n private _sceneContext?: SceneContext;\n private _isSceneReady = false;\n private readonly _attachment: RasterAttachment;\n\n public constructor(view: ViewState, rect: ViewRect, attachment: RasterAttachment) {\n super(IModelApp.renderSystem.createOffscreenTarget(rect));\n this._attachment = attachment;\n this._isAspectRatioLocked = true;\n this.changeView(view);\n }\n\n public override createSceneContext(): SceneContext {\n assert(!this._isSceneReady);\n\n this._sceneContext = super.createSceneContext();\n return this._sceneContext;\n }\n\n public override renderFrame(): void {\n assert(!this._isSceneReady);\n\n this.clearSceneContext();\n super.renderFrame();\n\n if (undefined !== this._sceneContext) {\n this._isSceneReady = !this._sceneContext.hasMissingTiles && this.view.areAllTileTreesLoaded;\n if (this._isSceneReady)\n this._attachment.produceGraphics(this._sceneContext);\n\n this._sceneContext = undefined;\n }\n }\n\n private clearSceneContext(): void {\n this._sceneContext = undefined;\n }\n\n public override addDecorations(_decorations: Decorations): void {\n // ###TODO: skybox, ground plane, possibly grid. DecorateContext requires a ScreenViewport...\n }\n }\n\n return new RasterAttachmentViewport(_view, _rect, _attachment);\n}\n\n/** Draws a 3d view with camera enabled into a sheet view by producing an image of the view's contents offscreen. */\nclass RasterAttachment {\n private readonly _props: ViewAttachmentProps;\n private readonly _placement: Placement2d;\n private readonly _transform: Transform;\n public readonly zDepth: number;\n private _viewport?: OffScreenViewport;\n private _graphics?: RenderGraphic;\n\n public constructor(view: ViewState, props: ViewAttachmentProps, sheetView: SheetViewState) {\n // Render to a 2048x2048 view rect. Scale in Y to preserve aspect ratio.\n const maxSize = 2048;\n const rect = new ViewRect(0, 0, maxSize, maxSize);\n const height = maxSize * view.getAspectRatio() * view.getAspectRatioSkew();\n const skew = maxSize / height;\n view.setAspectRatioSkew(skew);\n\n if (true !== props.jsonProperties?.displayOptions?.preserveBackground) {\n // Make background color 100% transparent so that Viewport.readImageBuffer() will discard transparent pixels.\n const bgColor = sheetView.displayStyle.backgroundColor.withAlpha(0);\n view.displayStyle.backgroundColor = bgColor;\n }\n\n this._viewport = createRasterAttachmentViewport(view, rect, this);\n this._props = props;\n this._placement = Placement2d.fromJSON(props.placement);\n this._transform = this._placement.transform;\n this.zDepth = Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);\n }\n\n public [Symbol.dispose](): void {\n this._viewport?.[Symbol.dispose]();\n }\n\n public get viewAttachmentProps() {\n return this._props;\n }\n\n public get viewport(): Viewport | undefined {\n return this._viewport;\n }\n\n public get areAllTileTreesLoaded() {\n return this._viewport?.areAllTileTreesLoaded ?? true;\n }\n\n public addToScene(context: SceneContext): void {\n // ###TODO: check viewport.wantViewAttachmentClipShapes\n if (!context.viewport.view.viewsCategory(this._props.category))\n return;\n\n if (context.viewport.wantViewAttachmentBoundaries) {\n const builder = context.createSceneGraphicBuilder(this._transform);\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\n builder.addRangeBox(Range3d.createRange2d(this._placement.bbox));\n context.outputGraphic(builder.finish());\n }\n\n if (!context.viewport.wantViewAttachments)\n return;\n\n if (this._graphics) {\n context.outputGraphic(this._graphics);\n return;\n }\n\n if (undefined === this._viewport)\n return;\n\n this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;\n this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);\n\n this._viewport.renderFrame();\n if (this._graphics)\n context.outputGraphic(this._graphics);\n }\n\n public discloseTileTrees(trees: DisclosedTileTreeSet) {\n if (this._viewport)\n trees.disclose(this._viewport);\n }\n\n public produceGraphics(context: SceneContext): void {\n assert(context.viewport === this._viewport);\n this._graphics = this.createGraphics(this._viewport);\n this._viewport = dispose(this._viewport);\n\n if (undefined !== this._graphics)\n context.outputGraphic(this._graphics);\n }\n\n private createGraphics(vp: Viewport): RenderGraphic | undefined {\n // Create a texture from the contents of the view.\n const image = vp.readImageBuffer({ upsideDown: true });\n if (undefined === image)\n return undefined;\n\n const debugImage = false; // set to true to open a window displaying the captured image.\n if (debugImage) {\n const url = imageBufferToPngDataUrl(image, false);\n if (url)\n openImageDataUrlInNewWindow(url, \"Attachment\");\n }\n\n const texture = IModelApp.renderSystem.createTexture({\n image: { source: image, transparency: TextureTransparency.Opaque },\n });\n if (!texture)\n return undefined;\n\n // Create a material for the texture\n const graphicParams = new GraphicParams();\n graphicParams.material = IModelApp.renderSystem.createRenderMaterial({ textureMapping: { texture } });\n\n // Apply the texture to a rectangular polyface.\n const depth = this.zDepth;\n const east = this._placement.bbox.low.x;\n const west = this._placement.bbox.high.x;\n const north = this._placement.bbox.low.y;\n const south = this._placement.bbox.high.y;\n const corners = [\n Point3d.create(east, north, depth),\n Point3d.create(west, north, depth),\n Point3d.create(west, south, depth),\n Point3d.create(east, south, depth),\n ];\n const params = [\n Point2d.create(0, 0),\n Point2d.create(1, 0),\n Point2d.create(1, 1),\n Point2d.create(0, 1),\n ];\n\n const strokeOptions = new StrokeOptions();\n strokeOptions.needParams = strokeOptions.shouldTriangulate = true;\n const polyfaceBuilder = PolyfaceBuilder.create(strokeOptions);\n polyfaceBuilder.addQuadFacet(corners, params);\n const polyface = polyfaceBuilder.claimPolyface();\n\n const graphicBuilder = IModelApp.renderSystem.createGraphicBuilder(Transform.createIdentity(), GraphicType.Scene, vp, this._props.id);\n graphicBuilder.activateGraphicParams(graphicParams);\n graphicBuilder.addPolyface(polyface, false);\n const graphic = graphicBuilder.finish();\n\n // Wrap the polyface in a GraphicBranch.\n const branch = new GraphicBranch(true);\n const vfOvrs = createDefaultViewFlagOverrides({ clipVolume: true, shadows: false, lighting: false, thematic: false });\n\n // Disable transparency - background pixels are 100% transparent so they will be discarded anyway. Other pixels are 100% opaque.\n vfOvrs.transparency = false;\n branch.setViewFlagOverrides(vfOvrs);\n branch.symbologyOverrides = new FeatureSymbology.Overrides();\n branch.entries.push(graphic);\n\n // Apply the attachment's clip, if any.\n let clipVolume;\n if (this._props.jsonProperties?.clip) {\n const clipVector = ClipVector.fromJSON(this._props.jsonProperties?.clip);\n if (clipVector.isValid)\n clipVolume = IModelApp.renderSystem.createClipVolume(clipVector);\n }\n\n return IModelApp.renderSystem.createGraphicBranch(branch, this._transform, { clipVolume });\n }\n\n public collectStatistics(stats: RenderMemory.Statistics): void {\n if (this._graphics)\n this._graphics.collectStatistics(stats);\n }\n}\n"]}
|
package/lib/esm/ViewContext.d.ts
CHANGED
|
@@ -69,10 +69,13 @@ export declare class RenderContext {
|
|
|
69
69
|
* @public
|
|
70
70
|
*/
|
|
71
71
|
export declare class DynamicsContext extends RenderContext {
|
|
72
|
-
private
|
|
72
|
+
private _foreground?;
|
|
73
|
+
private _overlay?;
|
|
73
74
|
/** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */
|
|
74
75
|
addGraphic(graphic: RenderGraphic): void;
|
|
75
76
|
/** @internal */
|
|
77
|
+
add(graphic: RenderGraphic, isOverlay: boolean): void;
|
|
78
|
+
/** @internal */
|
|
76
79
|
changeDynamics(): void;
|
|
77
80
|
/** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].
|
|
78
81
|
* @param options Options describing how to create the builder.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewContext.d.ts","sourceRoot":"","sources":["../../src/ViewContext.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,UAAU,EAA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,SAAS;IAoBpI,gBAAgB;IACT,uBAAuB,CAAC,OAAO,EAAE,UAAU;IAIlD,gBAAgB;IACT,eAAe,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI;IASrE,+DAA+D;IAC/D,IAAW,QAAQ,oBAAoC;IACvD,2EAA2E;IAC3E,IAAW,kBAAkB,oBAAoC;IACjE,gFAAgF;IAChF,IAAW,eAAe,oBAAiC;IAC3D,gBAAgB;IAChB,IAAW,iBAAiB,wCAA2C;IACvE,gBAAgB;IAChB,IAAW,aAAa,oCAAuC;IAE/D,gBAAgB;IACT,mBAAmB,CAAC,UAAU,EAAE,uBAAuB,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI;CAG3F"}
|
package/lib/esm/ViewContext.js
CHANGED
|
@@ -80,16 +80,21 @@ export class RenderContext {
|
|
|
80
80
|
* @public
|
|
81
81
|
*/
|
|
82
82
|
export class DynamicsContext extends RenderContext {
|
|
83
|
-
|
|
83
|
+
_foreground;
|
|
84
|
+
_overlay;
|
|
84
85
|
/** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */
|
|
85
86
|
addGraphic(graphic) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
this.add(graphic, false);
|
|
88
|
+
}
|
|
89
|
+
/** @internal */
|
|
90
|
+
add(graphic, isOverlay) {
|
|
91
|
+
const key = isOverlay ? "_overlay" : "_foreground";
|
|
92
|
+
const list = this[key] ?? (this[key] = []);
|
|
93
|
+
list.push(graphic);
|
|
89
94
|
}
|
|
90
95
|
/** @internal */
|
|
91
96
|
changeDynamics() {
|
|
92
|
-
this.viewport.changeDynamics(this.
|
|
97
|
+
this.viewport.changeDynamics(this._foreground, this._overlay);
|
|
93
98
|
}
|
|
94
99
|
/** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].
|
|
95
100
|
* @param options Options describing how to create the builder.
|
|
@@ -1 +1 @@
|
|
|
1
|
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AAmC,EAAE,OAAmB;QACjF,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;IACxD,CAAC;CACF","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 Rendering\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport {\n Matrix3d, Point2d,\n Point3d, Range1d, Transform, XAndY,\n} from \"@itwin/core-geometry\";\nimport { Frustum, FrustumPlanes, ViewFlags } from \"@itwin/core-common\";\nimport { CachedDecoration, DecorationsCache } from \"./DecorationsCache\";\nimport { IModelApp } from \"./IModelApp\";\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\nimport { CanvasDecoration } from \"./render/CanvasDecoration\";\nimport { Decorations } from \"./render/Decorations\";\nimport { GraphicBranch, GraphicBranchOptions } from \"./render/GraphicBranch\";\nimport { GraphicBuilder, ViewportGraphicBuilderOptions } from \"./render/GraphicBuilder\";\nimport { GraphicList, RenderGraphic } from \"./render/RenderGraphic\";\nimport { RenderPlanarClassifier } from \"./internal/render/RenderPlanarClassifier\";\nimport { RenderSystem, } from \"./render/RenderSystem\";\nimport { RenderTarget } from \"./render/RenderTarget\";\nimport { Scene } from \"./render/Scene\";\nimport { SpatialClassifierTileTreeReference, Tile, TileGraphicType, TileLoadStatus, TileTreeReference } from \"./tile/internal\";\nimport { ViewingSpace } from \"./ViewingSpace\";\nimport { ELEMENT_MARKED_FOR_REMOVAL, ScreenViewport, Viewport, ViewportDecorator } from \"./Viewport\";\nimport { ActiveSpatialClassifier } from \"./SpatialClassifiersState\";\nimport { GraphicType } from \"./common/render/GraphicType\";\nimport { RenderTextureDrape } from \"./internal/render/RenderTextureDrape\";\n\n/** Provides context for producing [[RenderGraphic]]s for drawing within a [[Viewport]].\n * @public\n * @extensions\n */\nexport class RenderContext {\n /** ViewFlags extracted from the context's [[Viewport]]. */\n public readonly viewFlags: ViewFlags;\n private readonly _viewport: Viewport;\n /** Frustum extracted from the context's [[Viewport]]. */\n public readonly frustum: Frustum;\n /** Frustum planes extracted from the context's [[Viewport]]. */\n public readonly frustumPlanes: FrustumPlanes;\n\n constructor(vp: Viewport, frustum?: Frustum) {\n this._viewport = vp;\n this.viewFlags = vp.viewFlags;\n this.frustum = frustum ? frustum : vp.getFrustum();\n this.frustumPlanes = FrustumPlanes.fromFrustum(this.frustum);\n }\n\n /** Given a point in world coordinates, determine approximately how many pixels it occupies on screen based on this context's frustum. */\n public getPixelSizeAtPoint(inPoint?: Point3d): number {\n return this.viewport.viewingSpace.getPixelSizeAtPoint(inPoint);\n }\n\n /** The [[Viewport]] associated with this context. */\n public get viewport(): Viewport {\n return this._viewport;\n }\n\n /** The [[RenderSystem]] being used to produce graphics for this context. */\n public get renderSystem(): RenderSystem {\n return this.target.renderSystem;\n }\n\n /** @internal */\n public get target(): RenderTarget { return this.viewport.target; }\n\n /** @internal */\n protected _createGraphicBuilder(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this.target.createGraphicBuilder({ ...options, viewport: this.viewport });\n }\n\n /** Create a builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\n * @returns A builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\n */\n public createSceneGraphicBuilder(transform?: Transform): GraphicBuilder {\n return this._createGraphicBuilder({ type: GraphicType.Scene, placement: transform });\n }\n\n /** Create a graphic from a [[GraphicBranch]]. */\n public createGraphicBranch(branch: GraphicBranch, location: Transform, opts?: GraphicBranchOptions): RenderGraphic {\n return this.target.renderSystem.createGraphicBranch(branch, location, opts);\n }\n\n /** Create a [[RenderGraphic]] which groups a set of graphics into a node in a scene graph, applying to each a transform and optional clip volume and symbology overrides.\n * @param branch Contains the group of graphics and the symbology overrides.\n * @param location the local-to-world transform applied to the grouped graphics.\n * @returns A RenderGraphic suitable for drawing the scene graph node within this context's [[Viewport]].\n * @see [[RenderSystem.createBranch]]\n */\n public createBranch(branch: GraphicBranch, location: Transform): RenderGraphic { return this.createGraphicBranch(branch, location); }\n\n /** Given the size of a logical pixel in meters, convert it to the size of a physical pixel in meters, if [[RenderSystem.dpiAwareLOD]] is `true`.\n * Used when computing LOD for graphics.\n * @internal\n */\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\n return this.viewport.target.adjustPixelSizeForLOD(cssPixelSize);\n }\n}\n\n/** Provides context for an [[InteractiveTool]] to display decorations representing its current state.\n * @see [[InteractiveTool.onDynamicFrame]]\n * @public\n */\nexport class DynamicsContext extends RenderContext {\n private _dynamics?: GraphicList;\n\n /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */\n public addGraphic(graphic: RenderGraphic) {\n if (undefined === this._dynamics)\n this._dynamics = [];\n this._dynamics.push(graphic);\n }\n\n /** @internal */\n public changeDynamics(): void {\n this.viewport.changeDynamics(this._dynamics);\n }\n\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\n * @param options Options describing how to create the builder.\n * @returns A builder that produces a [[RenderGraphic]].\n */\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this._createGraphicBuilder(options);\n }\n}\n\n/** Arguments supplied to [[DecorateContext.create]].\n * @public\n */\nexport interface DecorateContextCreateArgs {\n /** The viewport to be decorated. */\n viewport: ScreenViewport;\n /** The set of decoration graphics to be populated by the context. */\n output: Decorations;\n /** Optional cache. If omitted, one will be created.\n * @internal\n */\n cache?: DecorationsCache;\n}\n\n/** Provides context for a [[ViewportDecorator]] to add [[Decorations]] to be rendered within a [[Viewport]].\n * @public\n * @extensions\n */\nexport class DecorateContext extends RenderContext {\n private readonly _decorations: Decorations;\n private readonly _cache: DecorationsCache;\n private _curCacheableDecorator?: ViewportDecorator;\n\n /** The [[ScreenViewport]] in which this context's [[Decorations]] will be drawn. */\n public override get viewport(): ScreenViewport {\n return super.viewport as ScreenViewport;\n }\n\n /** @internal */\n constructor(vp: ScreenViewport, decorations: Decorations, cache: DecorationsCache) {\n super(vp);\n this._decorations = decorations;\n this._cache = cache;\n }\n\n /** Create a new DecorateContext.\n * @param args Describes the inputs to the context.\n * @note Typically the [[ScreenViewport]] takes care of creating the context for you.\n * @public\n */\n public static create(args: DecorateContextCreateArgs): DecorateContext {\n return new DecorateContext(args.viewport, args.output, args.cache ?? new DecorationsCache());\n }\n\n /** Create a builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\n * @param type The type of builder to create.\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\n * @param id If the decoration is to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\n * @returns A builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\n * @see [[IModelConnection.transientIds]] for obtaining an ID for a pickable decoration.\n * @see [[createGraphic]] for more options.\n */\n public createGraphicBuilder(type: GraphicType, transform?: Transform, id?: Id64String): GraphicBuilder {\n return this.createGraphic({ type, placement: transform, pickable: undefined !== id ? { id } : undefined });\n }\n\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\n * @param options Options describing how to create the builder.\n * @returns A builder that produces a [[RenderGraphic]].\n */\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this._createGraphicBuilder(options);\n }\n\n /** @internal */\n public addFromDecorator(decorator: ViewportDecorator): void {\n assert(undefined === this._curCacheableDecorator);\n try {\n if (decorator.useCachedDecorations) {\n const cached = this._cache.get(decorator);\n if (cached) {\n this.restoreCache(cached);\n return;\n }\n\n this._curCacheableDecorator = decorator;\n }\n\n decorator.decorate(this);\n } finally {\n this._curCacheableDecorator = undefined;\n }\n }\n\n /** Restores decorations onto this context from the specified array of cached decorations. */\n private restoreCache(cachedDecorations: CachedDecoration[]) {\n cachedDecorations.forEach((cachedDecoration) => {\n switch (cachedDecoration.type) {\n case \"graphic\":\n this.addDecoration(cachedDecoration.graphicType, cachedDecoration.graphicOwner);\n break;\n case \"canvas\":\n this.addCanvasDecoration(cachedDecoration.canvasDecoration, cachedDecoration.atFront);\n break;\n case \"html\":\n this.addHtmlDecoration(cachedDecoration.htmlElement);\n break;\n }\n });\n }\n\n private _appendToCache(decoration: CachedDecoration) {\n assert(undefined !== this._curCacheableDecorator);\n this._cache.add(this._curCacheableDecorator, decoration);\n }\n\n /** Calls [[GraphicBuilder.finish]] on the supplied builder to obtain a [[RenderGraphic]], then adds the graphic to the appropriate list of\n * [[Decorations]].\n * @param builder The builder from which to extract the graphic.\n * @note The builder should not be used after calling this method.\n */\n public addDecorationFromBuilder(builder: GraphicBuilder) {\n this.addDecoration(builder.type, builder.finish());\n }\n\n /** Adds a graphic to the set of [[Decorations]] to be drawn in this context's [[ScreenViewport]].\n * @param The type of the graphic, which determines to which list of decorations it is added.\n * @param decoration The decoration graphic to add.\n * @note The type must match the type with which the [[RenderGraphic]]'s [[GraphicBuilder]] was constructed.\n * @see [[DecorateContext.addDecorationFromBuilder]] for a more convenient API.\n */\n public addDecoration(type: GraphicType, decoration: RenderGraphic) {\n if (this._curCacheableDecorator) {\n const graphicOwner = this.target.renderSystem.createGraphicOwner(decoration);\n this._appendToCache({ type: \"graphic\", graphicOwner, graphicType: type });\n decoration = graphicOwner;\n }\n\n switch (type) {\n case GraphicType.Scene:\n if (undefined === this._decorations.normal)\n this._decorations.normal = [];\n this._decorations.normal.push(decoration);\n break;\n\n case GraphicType.WorldDecoration:\n if (!this._decorations.world)\n this._decorations.world = [];\n this._decorations.world.push(decoration);\n break;\n\n case GraphicType.WorldOverlay:\n if (!this._decorations.worldOverlay)\n this._decorations.worldOverlay = [];\n this._decorations.worldOverlay.push(decoration);\n break;\n\n case GraphicType.ViewOverlay:\n if (!this._decorations.viewOverlay)\n this._decorations.viewOverlay = [];\n this._decorations.viewOverlay.push(decoration);\n break;\n\n case GraphicType.ViewBackground:\n this.setViewBackground(decoration);\n break;\n }\n }\n\n /** Add a [[CanvasDecoration]] to be drawn in this context's [[ScreenViewport]]. */\n public addCanvasDecoration(decoration: CanvasDecoration, atFront = false) {\n if (this._curCacheableDecorator)\n this._appendToCache({ type: \"canvas\", canvasDecoration: decoration, atFront });\n\n if (undefined === this._decorations.canvasDecorations)\n this._decorations.canvasDecorations = [];\n\n const list = this._decorations.canvasDecorations;\n if (0 === list.length || true === atFront)\n list.push(decoration);\n else\n list.unshift(decoration);\n }\n\n /** Add an HTMLElement to be drawn as a decoration in this context's [[ScreenViewport]]. */\n public addHtmlDecoration(decoration: HTMLElement) {\n if (this._curCacheableDecorator)\n this._appendToCache({ type: \"html\", htmlElement: decoration });\n\n // an element decoration being added might already be on the decorationDiv, just marked for removal\n if (decoration[ELEMENT_MARKED_FOR_REMOVAL]) {\n decoration[ELEMENT_MARKED_FOR_REMOVAL] = false;\n } else if (decoration.parentElement !== this.viewport.decorationDiv) {\n this.viewport.decorationDiv.appendChild(decoration);\n }\n }\n\n /** @internal */\n public drawStandardGrid(gridOrigin: Point3d, rMatrix: Matrix3d, spacing: XAndY, gridsPerRef: number, _isoGrid: boolean = false, _fixedRepetitions?: Point2d): void {\n const vp = this.viewport;\n\n if (vp.viewingGlobe)\n return;\n\n const color = vp.getContrastToBackgroundColor();\n const planarGrid = this.viewport.target.renderSystem.createPlanarGrid(vp.getFrustum(), { origin: gridOrigin, rMatrix, spacing, gridsPerRef, color });\n if (planarGrid) {\n this.addDecoration(GraphicType.WorldDecoration, planarGrid);\n }\n }\n\n /** Display skyBox graphic that encompasses entire scene and rotates with camera.\n * @see [[RenderSystem.createSkyBox]].\n */\n public setSkyBox(graphic: RenderGraphic) {\n this._decorations.skyBox = graphic;\n }\n\n /** Set the graphic to be displayed behind all other geometry as the background of this context's [[ScreenViewport]]. */\n public setViewBackground(graphic: RenderGraphic) {\n this._decorations.viewBackground = graphic;\n }\n}\n\n/** Context used to create the scene to be drawn in a [[Viewport]]. The scene consists of a set of [[RenderGraphic]]s produced by the\n * [[TileTree]]s visible within the viewport. Creating the scene may result in the enqueueing of requests for [[Tile]] content which\n * should be displayed in the viewport but are not yet loaded.\n * @public\n */\nexport class SceneContext extends RenderContext {\n private _missingChildTiles = false;\n /** The graphics comprising the scene. */\n public readonly scene = new Scene();\n\n /** @internal */\n public readonly missingTiles = new Set<Tile>();\n\n /** @internal */\n public markChildrenLoading(): void {\n this._missingChildTiles = true;\n }\n\n /** @internal */\n public get hasMissingTiles(): boolean {\n return this._missingChildTiles || this.missingTiles.size > 0;\n }\n\n private _viewingSpace?: ViewingSpace;\n private _graphicType: TileGraphicType = TileGraphicType.Scene;\n\n public constructor(vp: Viewport, frustum?: Frustum) {\n super(vp, frustum);\n }\n\n /** The viewed volume containing the scene. */\n public get viewingSpace(): ViewingSpace {\n return undefined !== this._viewingSpace ? this._viewingSpace : this.viewport.viewingSpace;\n }\n\n /** @internal */\n public get graphicType() { return this._graphicType; }\n\n /** Add the specified graphic to the scene. */\n public outputGraphic(graphic: RenderGraphic): void {\n switch (this._graphicType) {\n case TileGraphicType.BackgroundMap:\n this.backgroundGraphics.push(graphic);\n break;\n case TileGraphicType.Overlay:\n this.overlayGraphics.push(graphic);\n break;\n default:\n this.graphics.push(graphic);\n break;\n }\n }\n\n /** Indicate that the specified tile is desired for the scene but is not yet ready. A request to load its contents will later be enqueued. */\n public insertMissingTile(tile: Tile): void {\n switch (tile.loadStatus) {\n case TileLoadStatus.NotLoaded:\n case TileLoadStatus.Queued:\n case TileLoadStatus.Loading:\n this.missingTiles.add(tile);\n break;\n }\n }\n\n /** @internal */\n public requestMissingTiles(): void {\n IModelApp.tileAdmin.requestTiles(this.viewport, this.missingTiles);\n }\n\n /** @internal */\n public addPlanarClassifier(classifiedModelId: Id64String, classifierTree?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState): RenderPlanarClassifier | undefined {\n // Target may have the classifier from a previous frame; if not we must create one.\n let classifier = this.viewport.target.getPlanarClassifier(classifiedModelId);\n if (undefined === classifier)\n classifier = this.viewport.target.createPlanarClassifier(classifierTree?.activeClassifier);\n\n // Either way, we need to collect the graphics to draw for this frame, and record that we did so.\n if (undefined !== classifier) {\n this.planarClassifiers.set(classifiedModelId, classifier);\n classifier.setSource(classifierTree, planarClipMask);\n }\n\n return classifier;\n }\n\n /** @internal */\n public getPlanarClassifierForModel(modelId: Id64String) {\n return this.planarClassifiers.get(modelId);\n }\n\n /** @internal */\n public addBackgroundDrapedModel(drapedTreeRef: TileTreeReference, _heightRange: Range1d | undefined): RenderTextureDrape | undefined {\n const drapedTree = drapedTreeRef.treeOwner.tileTree;\n if (undefined === drapedTree)\n return undefined;\n\n const id = drapedTree.modelId;\n let drape = this.getTextureDrapeForModel(id);\n if (undefined !== drape)\n return drape;\n\n drape = this.viewport.target.getTextureDrape(id);\n if (undefined === drape && this.viewport.backgroundDrapeMap)\n drape = this.viewport.target.renderSystem.createBackgroundMapDrape(drapedTreeRef, this.viewport.backgroundDrapeMap);\n\n if (undefined !== drape)\n this.textureDrapes.set(id, drape);\n\n return drape;\n }\n\n /** @internal */\n public getTextureDrapeForModel(modelId: Id64String) {\n return this.textureDrapes.get(modelId);\n }\n\n /** @internal */\n public withGraphicType(type: TileGraphicType, func: () => void): void {\n const prevType = this._graphicType;\n this._graphicType = type;\n\n func();\n\n this._graphicType = prevType;\n }\n\n /** The graphics in the scene that will be drawn with depth. */\n public get graphics() { return this.scene.foreground; }\n /** The graphics that will be drawn behind everything else in the scene. */\n public get backgroundGraphics() { return this.scene.background; }\n /** The graphics that will be drawn in front of everything else in the scene. */\n public get overlayGraphics() { return this.scene.overlay; }\n /** @internal */\n public get planarClassifiers() { return this.scene.planarClassifiers; }\n /** @internal */\n public get textureDrapes() { return this.scene.textureDrapes; }\n\n /** @internal */\n public setVolumeClassifier(classifier: ActiveSpatialClassifier, modelId: Id64String): void {\n this.scene.volumeClassifier = { classifier, modelId };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ViewContext.js","sourceRoot":"","sources":["../../src/ViewContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AAKzD,OAAO,EAAW,aAAa,EAAa,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAoB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAA4C,eAAe,EAAE,cAAc,EAAqB,MAAM,iBAAiB,CAAC;AAE/H,OAAO,EAAE,0BAA0B,EAA+C,MAAM,YAAY,CAAC;AAErG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D;;;GAGG;AACH,MAAM,OAAO,aAAa;IACxB,2DAA2D;IAC3C,SAAS,CAAY;IACpB,SAAS,CAAW;IACrC,yDAAyD;IACzC,OAAO,CAAU;IACjC,gEAAgE;IAChD,aAAa,CAAgB;IAE7C,YAAY,EAAY,EAAE,OAAiB;QACzC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;QACnD,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED,yIAAyI;IAClI,mBAAmB,CAAC,OAAiB;QAC1C,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;IAED,qDAAqD;IACrD,IAAW,QAA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FAAgF;IAChF,IAAW,eAAe,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,gBAAgB;IAChB,IAAW,iBAAiB,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACvE,gBAAgB;IAChB,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAE/D,gBAAgB;IACT,mBAAmB,CAAC,UAAmC,EAAE,OAAmB;QACjF,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;IACxD,CAAC;CACF","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 Rendering\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport {\n Matrix3d, Point2d,\n Point3d, Range1d, Transform, XAndY,\n} from \"@itwin/core-geometry\";\nimport { Frustum, FrustumPlanes, ViewFlags } from \"@itwin/core-common\";\nimport { CachedDecoration, DecorationsCache } from \"./DecorationsCache\";\nimport { IModelApp } from \"./IModelApp\";\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\nimport { CanvasDecoration } from \"./render/CanvasDecoration\";\nimport { Decorations } from \"./render/Decorations\";\nimport { GraphicBranch, GraphicBranchOptions } from \"./render/GraphicBranch\";\nimport { GraphicBuilder, ViewportGraphicBuilderOptions } from \"./render/GraphicBuilder\";\nimport { GraphicList, RenderGraphic } from \"./render/RenderGraphic\";\nimport { RenderPlanarClassifier } from \"./internal/render/RenderPlanarClassifier\";\nimport { RenderSystem, } from \"./render/RenderSystem\";\nimport { RenderTarget } from \"./render/RenderTarget\";\nimport { Scene } from \"./render/Scene\";\nimport { SpatialClassifierTileTreeReference, Tile, TileGraphicType, TileLoadStatus, TileTreeReference } from \"./tile/internal\";\nimport { ViewingSpace } from \"./ViewingSpace\";\nimport { ELEMENT_MARKED_FOR_REMOVAL, ScreenViewport, Viewport, ViewportDecorator } from \"./Viewport\";\nimport { ActiveSpatialClassifier } from \"./SpatialClassifiersState\";\nimport { GraphicType } from \"./common/render/GraphicType\";\nimport { RenderTextureDrape } from \"./internal/render/RenderTextureDrape\";\n\n/** Provides context for producing [[RenderGraphic]]s for drawing within a [[Viewport]].\n * @public\n * @extensions\n */\nexport class RenderContext {\n /** ViewFlags extracted from the context's [[Viewport]]. */\n public readonly viewFlags: ViewFlags;\n private readonly _viewport: Viewport;\n /** Frustum extracted from the context's [[Viewport]]. */\n public readonly frustum: Frustum;\n /** Frustum planes extracted from the context's [[Viewport]]. */\n public readonly frustumPlanes: FrustumPlanes;\n\n constructor(vp: Viewport, frustum?: Frustum) {\n this._viewport = vp;\n this.viewFlags = vp.viewFlags;\n this.frustum = frustum ? frustum : vp.getFrustum();\n this.frustumPlanes = FrustumPlanes.fromFrustum(this.frustum);\n }\n\n /** Given a point in world coordinates, determine approximately how many pixels it occupies on screen based on this context's frustum. */\n public getPixelSizeAtPoint(inPoint?: Point3d): number {\n return this.viewport.viewingSpace.getPixelSizeAtPoint(inPoint);\n }\n\n /** The [[Viewport]] associated with this context. */\n public get viewport(): Viewport {\n return this._viewport;\n }\n\n /** The [[RenderSystem]] being used to produce graphics for this context. */\n public get renderSystem(): RenderSystem {\n return this.target.renderSystem;\n }\n\n /** @internal */\n public get target(): RenderTarget { return this.viewport.target; }\n\n /** @internal */\n protected _createGraphicBuilder(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this.target.createGraphicBuilder({ ...options, viewport: this.viewport });\n }\n\n /** Create a builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\n * @returns A builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\n */\n public createSceneGraphicBuilder(transform?: Transform): GraphicBuilder {\n return this._createGraphicBuilder({ type: GraphicType.Scene, placement: transform });\n }\n\n /** Create a graphic from a [[GraphicBranch]]. */\n public createGraphicBranch(branch: GraphicBranch, location: Transform, opts?: GraphicBranchOptions): RenderGraphic {\n return this.target.renderSystem.createGraphicBranch(branch, location, opts);\n }\n\n /** Create a [[RenderGraphic]] which groups a set of graphics into a node in a scene graph, applying to each a transform and optional clip volume and symbology overrides.\n * @param branch Contains the group of graphics and the symbology overrides.\n * @param location the local-to-world transform applied to the grouped graphics.\n * @returns A RenderGraphic suitable for drawing the scene graph node within this context's [[Viewport]].\n * @see [[RenderSystem.createBranch]]\n */\n public createBranch(branch: GraphicBranch, location: Transform): RenderGraphic { return this.createGraphicBranch(branch, location); }\n\n /** Given the size of a logical pixel in meters, convert it to the size of a physical pixel in meters, if [[RenderSystem.dpiAwareLOD]] is `true`.\n * Used when computing LOD for graphics.\n * @internal\n */\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\n return this.viewport.target.adjustPixelSizeForLOD(cssPixelSize);\n }\n}\n\n/** Provides context for an [[InteractiveTool]] to display decorations representing its current state.\n * @see [[InteractiveTool.onDynamicFrame]]\n * @public\n */\nexport class DynamicsContext extends RenderContext {\n private _foreground?: GraphicList;\n private _overlay?: GraphicList;\n\n /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */\n public addGraphic(graphic: RenderGraphic): void {\n this.add(graphic, false);\n }\n\n /** @internal */\n public add(graphic: RenderGraphic, isOverlay: boolean) {\n const key = isOverlay ? \"_overlay\" : \"_foreground\";\n const list = this[key] ?? (this[key] = []);\n list.push(graphic);\n }\n\n /** @internal */\n public changeDynamics(): void {\n this.viewport.changeDynamics(this._foreground, this._overlay);\n }\n\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\n * @param options Options describing how to create the builder.\n * @returns A builder that produces a [[RenderGraphic]].\n */\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this._createGraphicBuilder(options);\n }\n}\n\n/** Arguments supplied to [[DecorateContext.create]].\n * @public\n */\nexport interface DecorateContextCreateArgs {\n /** The viewport to be decorated. */\n viewport: ScreenViewport;\n /** The set of decoration graphics to be populated by the context. */\n output: Decorations;\n /** Optional cache. If omitted, one will be created.\n * @internal\n */\n cache?: DecorationsCache;\n}\n\n/** Provides context for a [[ViewportDecorator]] to add [[Decorations]] to be rendered within a [[Viewport]].\n * @public\n * @extensions\n */\nexport class DecorateContext extends RenderContext {\n private readonly _decorations: Decorations;\n private readonly _cache: DecorationsCache;\n private _curCacheableDecorator?: ViewportDecorator;\n\n /** The [[ScreenViewport]] in which this context's [[Decorations]] will be drawn. */\n public override get viewport(): ScreenViewport {\n return super.viewport as ScreenViewport;\n }\n\n /** @internal */\n constructor(vp: ScreenViewport, decorations: Decorations, cache: DecorationsCache) {\n super(vp);\n this._decorations = decorations;\n this._cache = cache;\n }\n\n /** Create a new DecorateContext.\n * @param args Describes the inputs to the context.\n * @note Typically the [[ScreenViewport]] takes care of creating the context for you.\n * @public\n */\n public static create(args: DecorateContextCreateArgs): DecorateContext {\n return new DecorateContext(args.viewport, args.output, args.cache ?? new DecorationsCache());\n }\n\n /** Create a builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\n * @param type The type of builder to create.\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\n * @param id If the decoration is to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\n * @returns A builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\n * @see [[IModelConnection.transientIds]] for obtaining an ID for a pickable decoration.\n * @see [[createGraphic]] for more options.\n */\n public createGraphicBuilder(type: GraphicType, transform?: Transform, id?: Id64String): GraphicBuilder {\n return this.createGraphic({ type, placement: transform, pickable: undefined !== id ? { id } : undefined });\n }\n\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\n * @param options Options describing how to create the builder.\n * @returns A builder that produces a [[RenderGraphic]].\n */\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this._createGraphicBuilder(options);\n }\n\n /** @internal */\n public addFromDecorator(decorator: ViewportDecorator): void {\n assert(undefined === this._curCacheableDecorator);\n try {\n if (decorator.useCachedDecorations) {\n const cached = this._cache.get(decorator);\n if (cached) {\n this.restoreCache(cached);\n return;\n }\n\n this._curCacheableDecorator = decorator;\n }\n\n decorator.decorate(this);\n } finally {\n this._curCacheableDecorator = undefined;\n }\n }\n\n /** Restores decorations onto this context from the specified array of cached decorations. */\n private restoreCache(cachedDecorations: CachedDecoration[]) {\n cachedDecorations.forEach((cachedDecoration) => {\n switch (cachedDecoration.type) {\n case \"graphic\":\n this.addDecoration(cachedDecoration.graphicType, cachedDecoration.graphicOwner);\n break;\n case \"canvas\":\n this.addCanvasDecoration(cachedDecoration.canvasDecoration, cachedDecoration.atFront);\n break;\n case \"html\":\n this.addHtmlDecoration(cachedDecoration.htmlElement);\n break;\n }\n });\n }\n\n private _appendToCache(decoration: CachedDecoration) {\n assert(undefined !== this._curCacheableDecorator);\n this._cache.add(this._curCacheableDecorator, decoration);\n }\n\n /** Calls [[GraphicBuilder.finish]] on the supplied builder to obtain a [[RenderGraphic]], then adds the graphic to the appropriate list of\n * [[Decorations]].\n * @param builder The builder from which to extract the graphic.\n * @note The builder should not be used after calling this method.\n */\n public addDecorationFromBuilder(builder: GraphicBuilder) {\n this.addDecoration(builder.type, builder.finish());\n }\n\n /** Adds a graphic to the set of [[Decorations]] to be drawn in this context's [[ScreenViewport]].\n * @param The type of the graphic, which determines to which list of decorations it is added.\n * @param decoration The decoration graphic to add.\n * @note The type must match the type with which the [[RenderGraphic]]'s [[GraphicBuilder]] was constructed.\n * @see [[DecorateContext.addDecorationFromBuilder]] for a more convenient API.\n */\n public addDecoration(type: GraphicType, decoration: RenderGraphic) {\n if (this._curCacheableDecorator) {\n const graphicOwner = this.target.renderSystem.createGraphicOwner(decoration);\n this._appendToCache({ type: \"graphic\", graphicOwner, graphicType: type });\n decoration = graphicOwner;\n }\n\n switch (type) {\n case GraphicType.Scene:\n if (undefined === this._decorations.normal)\n this._decorations.normal = [];\n this._decorations.normal.push(decoration);\n break;\n\n case GraphicType.WorldDecoration:\n if (!this._decorations.world)\n this._decorations.world = [];\n this._decorations.world.push(decoration);\n break;\n\n case GraphicType.WorldOverlay:\n if (!this._decorations.worldOverlay)\n this._decorations.worldOverlay = [];\n this._decorations.worldOverlay.push(decoration);\n break;\n\n case GraphicType.ViewOverlay:\n if (!this._decorations.viewOverlay)\n this._decorations.viewOverlay = [];\n this._decorations.viewOverlay.push(decoration);\n break;\n\n case GraphicType.ViewBackground:\n this.setViewBackground(decoration);\n break;\n }\n }\n\n /** Add a [[CanvasDecoration]] to be drawn in this context's [[ScreenViewport]]. */\n public addCanvasDecoration(decoration: CanvasDecoration, atFront = false) {\n if (this._curCacheableDecorator)\n this._appendToCache({ type: \"canvas\", canvasDecoration: decoration, atFront });\n\n if (undefined === this._decorations.canvasDecorations)\n this._decorations.canvasDecorations = [];\n\n const list = this._decorations.canvasDecorations;\n if (0 === list.length || true === atFront)\n list.push(decoration);\n else\n list.unshift(decoration);\n }\n\n /** Add an HTMLElement to be drawn as a decoration in this context's [[ScreenViewport]]. */\n public addHtmlDecoration(decoration: HTMLElement) {\n if (this._curCacheableDecorator)\n this._appendToCache({ type: \"html\", htmlElement: decoration });\n\n // an element decoration being added might already be on the decorationDiv, just marked for removal\n if (decoration[ELEMENT_MARKED_FOR_REMOVAL]) {\n decoration[ELEMENT_MARKED_FOR_REMOVAL] = false;\n } else if (decoration.parentElement !== this.viewport.decorationDiv) {\n this.viewport.decorationDiv.appendChild(decoration);\n }\n }\n\n /** @internal */\n public drawStandardGrid(gridOrigin: Point3d, rMatrix: Matrix3d, spacing: XAndY, gridsPerRef: number, _isoGrid: boolean = false, _fixedRepetitions?: Point2d): void {\n const vp = this.viewport;\n\n if (vp.viewingGlobe)\n return;\n\n const color = vp.getContrastToBackgroundColor();\n const planarGrid = this.viewport.target.renderSystem.createPlanarGrid(vp.getFrustum(), { origin: gridOrigin, rMatrix, spacing, gridsPerRef, color });\n if (planarGrid) {\n this.addDecoration(GraphicType.WorldDecoration, planarGrid);\n }\n }\n\n /** Display skyBox graphic that encompasses entire scene and rotates with camera.\n * @see [[RenderSystem.createSkyBox]].\n */\n public setSkyBox(graphic: RenderGraphic) {\n this._decorations.skyBox = graphic;\n }\n\n /** Set the graphic to be displayed behind all other geometry as the background of this context's [[ScreenViewport]]. */\n public setViewBackground(graphic: RenderGraphic) {\n this._decorations.viewBackground = graphic;\n }\n}\n\n/** Context used to create the scene to be drawn in a [[Viewport]]. The scene consists of a set of [[RenderGraphic]]s produced by the\n * [[TileTree]]s visible within the viewport. Creating the scene may result in the enqueueing of requests for [[Tile]] content which\n * should be displayed in the viewport but are not yet loaded.\n * @public\n */\nexport class SceneContext extends RenderContext {\n private _missingChildTiles = false;\n /** The graphics comprising the scene. */\n public readonly scene = new Scene();\n\n /** @internal */\n public readonly missingTiles = new Set<Tile>();\n\n /** @internal */\n public markChildrenLoading(): void {\n this._missingChildTiles = true;\n }\n\n /** @internal */\n public get hasMissingTiles(): boolean {\n return this._missingChildTiles || this.missingTiles.size > 0;\n }\n\n private _viewingSpace?: ViewingSpace;\n private _graphicType: TileGraphicType = TileGraphicType.Scene;\n\n public constructor(vp: Viewport, frustum?: Frustum) {\n super(vp, frustum);\n }\n\n /** The viewed volume containing the scene. */\n public get viewingSpace(): ViewingSpace {\n return undefined !== this._viewingSpace ? this._viewingSpace : this.viewport.viewingSpace;\n }\n\n /** @internal */\n public get graphicType() { return this._graphicType; }\n\n /** Add the specified graphic to the scene. */\n public outputGraphic(graphic: RenderGraphic): void {\n switch (this._graphicType) {\n case TileGraphicType.BackgroundMap:\n this.backgroundGraphics.push(graphic);\n break;\n case TileGraphicType.Overlay:\n this.overlayGraphics.push(graphic);\n break;\n default:\n this.graphics.push(graphic);\n break;\n }\n }\n\n /** Indicate that the specified tile is desired for the scene but is not yet ready. A request to load its contents will later be enqueued. */\n public insertMissingTile(tile: Tile): void {\n switch (tile.loadStatus) {\n case TileLoadStatus.NotLoaded:\n case TileLoadStatus.Queued:\n case TileLoadStatus.Loading:\n this.missingTiles.add(tile);\n break;\n }\n }\n\n /** @internal */\n public requestMissingTiles(): void {\n IModelApp.tileAdmin.requestTiles(this.viewport, this.missingTiles);\n }\n\n /** @internal */\n public addPlanarClassifier(classifiedModelId: Id64String, classifierTree?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState): RenderPlanarClassifier | undefined {\n // Target may have the classifier from a previous frame; if not we must create one.\n let classifier = this.viewport.target.getPlanarClassifier(classifiedModelId);\n if (undefined === classifier)\n classifier = this.viewport.target.createPlanarClassifier(classifierTree?.activeClassifier);\n\n // Either way, we need to collect the graphics to draw for this frame, and record that we did so.\n if (undefined !== classifier) {\n this.planarClassifiers.set(classifiedModelId, classifier);\n classifier.setSource(classifierTree, planarClipMask);\n }\n\n return classifier;\n }\n\n /** @internal */\n public getPlanarClassifierForModel(modelId: Id64String) {\n return this.planarClassifiers.get(modelId);\n }\n\n /** @internal */\n public addBackgroundDrapedModel(drapedTreeRef: TileTreeReference, _heightRange: Range1d | undefined): RenderTextureDrape | undefined {\n const drapedTree = drapedTreeRef.treeOwner.tileTree;\n if (undefined === drapedTree)\n return undefined;\n\n const id = drapedTree.modelId;\n let drape = this.getTextureDrapeForModel(id);\n if (undefined !== drape)\n return drape;\n\n drape = this.viewport.target.getTextureDrape(id);\n if (undefined === drape && this.viewport.backgroundDrapeMap)\n drape = this.viewport.target.renderSystem.createBackgroundMapDrape(drapedTreeRef, this.viewport.backgroundDrapeMap);\n\n if (undefined !== drape)\n this.textureDrapes.set(id, drape);\n\n return drape;\n }\n\n /** @internal */\n public getTextureDrapeForModel(modelId: Id64String) {\n return this.textureDrapes.get(modelId);\n }\n\n /** @internal */\n public withGraphicType(type: TileGraphicType, func: () => void): void {\n const prevType = this._graphicType;\n this._graphicType = type;\n\n func();\n\n this._graphicType = prevType;\n }\n\n /** The graphics in the scene that will be drawn with depth. */\n public get graphics() { return this.scene.foreground; }\n /** The graphics that will be drawn behind everything else in the scene. */\n public get backgroundGraphics() { return this.scene.background; }\n /** The graphics that will be drawn in front of everything else in the scene. */\n public get overlayGraphics() { return this.scene.overlay; }\n /** @internal */\n public get planarClassifiers() { return this.scene.planarClassifiers; }\n /** @internal */\n public get textureDrapes() { return this.scene.textureDrapes; }\n\n /** @internal */\n public setVolumeClassifier(classifier: ActiveSpatialClassifier, modelId: Id64String): void {\n this.scene.volumeClassifier = { classifier, modelId };\n }\n}\n"]}
|
package/lib/esm/ViewManager.js
CHANGED
|
@@ -116,10 +116,10 @@ export class ViewManager {
|
|
|
116
116
|
this.inDynamicsMode = false;
|
|
117
117
|
const cursorVp = IModelApp.toolAdmin.cursorView;
|
|
118
118
|
if (cursorVp)
|
|
119
|
-
cursorVp.changeDynamics(undefined);
|
|
119
|
+
cursorVp.changeDynamics(undefined, undefined);
|
|
120
120
|
for (const vp of this._viewports) {
|
|
121
121
|
if (vp !== cursorVp)
|
|
122
|
-
vp.changeDynamics(undefined);
|
|
122
|
+
vp.changeDynamics(undefined, undefined);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
/** @internal */
|