@itwin/core-frontend 3.3.0-dev.5 → 3.3.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 +62 -1
- package/lib/cjs/DisplayStyleState.d.ts +80 -31
- package/lib/cjs/DisplayStyleState.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleState.js +150 -89
- package/lib/cjs/DisplayStyleState.js.map +1 -1
- package/lib/cjs/DrawingViewState.js +1 -1
- package/lib/cjs/DrawingViewState.js.map +1 -1
- package/lib/cjs/EntityState.d.ts +5 -5
- package/lib/cjs/EntityState.d.ts.map +1 -1
- package/lib/cjs/EntityState.js.map +1 -1
- package/lib/cjs/IModelApp.d.ts.map +1 -1
- package/lib/cjs/IModelApp.js +1 -1
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/IModelConnection.d.ts +1 -1
- package/lib/cjs/IModelConnection.d.ts.map +1 -1
- package/lib/cjs/IModelConnection.js +2 -2
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/RealityDataSource.d.ts.map +1 -1
- package/lib/cjs/RealityDataSource.js +6 -2
- package/lib/cjs/RealityDataSource.js.map +1 -1
- package/lib/cjs/SheetViewState.js +1 -1
- package/lib/cjs/SheetViewState.js.map +1 -1
- package/lib/cjs/TentativePoint.js +1 -1
- package/lib/cjs/TentativePoint.js.map +1 -1
- package/lib/cjs/ViewRect.d.ts +5 -3
- package/lib/cjs/ViewRect.d.ts.map +1 -1
- package/lib/cjs/ViewRect.js +11 -7
- package/lib/cjs/ViewRect.js.map +1 -1
- package/lib/cjs/ViewState.d.ts +1 -2
- package/lib/cjs/ViewState.d.ts.map +1 -1
- package/lib/cjs/ViewState.js +6 -2
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/Viewport.d.ts +1 -1
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +11 -6
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +0 -2
- package/lib/cjs/core-frontend.d.ts.map +1 -1
- package/lib/cjs/core-frontend.js +0 -2
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/extension/ExtensionAdmin.d.ts +5 -2
- package/lib/cjs/extension/ExtensionAdmin.d.ts.map +1 -1
- package/lib/cjs/extension/ExtensionAdmin.js +24 -6
- package/lib/cjs/extension/ExtensionAdmin.js.map +1 -1
- package/lib/cjs/extension/providers/RemoteExtensionProvider.d.ts +0 -2
- package/lib/cjs/extension/providers/RemoteExtensionProvider.d.ts.map +1 -1
- package/lib/cjs/extension/providers/RemoteExtensionProvider.js +9 -22
- package/lib/cjs/extension/providers/RemoteExtensionProvider.js.map +1 -1
- package/lib/cjs/render/FeatureSymbology.js +2 -2
- package/lib/cjs/render/FeatureSymbology.js.map +1 -1
- package/lib/cjs/render/GraphicBranch.d.ts +15 -9
- package/lib/cjs/render/GraphicBranch.d.ts.map +1 -1
- package/lib/cjs/render/GraphicBranch.js +38 -1
- package/lib/cjs/render/GraphicBranch.js.map +1 -1
- package/lib/cjs/render/RenderSystem.d.ts +5 -0
- package/lib/cjs/render/RenderSystem.d.ts.map +1 -1
- package/lib/cjs/render/RenderSystem.js.map +1 -1
- package/lib/cjs/render/primitives/EdgeParams.d.ts +11 -0
- package/lib/cjs/render/primitives/EdgeParams.d.ts.map +1 -1
- package/lib/cjs/render/primitives/EdgeParams.js +36 -29
- package/lib/cjs/render/primitives/EdgeParams.js.map +1 -1
- package/lib/cjs/render/primitives/VertexTable.d.ts +11 -4
- package/lib/cjs/render/primitives/VertexTable.d.ts.map +1 -1
- package/lib/cjs/render/primitives/VertexTable.js +13 -6
- package/lib/cjs/render/primitives/VertexTable.js.map +1 -1
- package/lib/cjs/render/primitives/VertexTableSplitter.d.ts +41 -0
- package/lib/cjs/render/primitives/VertexTableSplitter.d.ts.map +1 -0
- package/lib/cjs/render/primitives/VertexTableSplitter.js +662 -0
- package/lib/cjs/render/primitives/VertexTableSplitter.js.map +1 -0
- package/lib/cjs/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
- package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js +3 -1
- package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
- package/lib/cjs/render/webgl/ShaderProgram.js +1 -1
- package/lib/cjs/render/webgl/ShaderProgram.js.map +1 -1
- package/lib/cjs/render/webgl/Target.d.ts +1 -1
- package/lib/cjs/render/webgl/Target.js +2 -2
- package/lib/cjs/render/webgl/Target.js.map +1 -1
- package/lib/cjs/render/webgl/UniformHandle.d.ts +2 -1
- package/lib/cjs/render/webgl/UniformHandle.d.ts.map +1 -1
- package/lib/cjs/render/webgl/UniformHandle.js +15 -3
- package/lib/cjs/render/webgl/UniformHandle.js.map +1 -1
- package/lib/cjs/render/webgl/glsl/RealityMesh.d.ts.map +1 -1
- package/lib/cjs/render/webgl/glsl/RealityMesh.js +5 -2
- package/lib/cjs/render/webgl/glsl/RealityMesh.js.map +1 -1
- package/lib/cjs/render-primitives.d.ts +1 -0
- package/lib/cjs/render-primitives.d.ts.map +1 -1
- package/lib/cjs/render-primitives.js +1 -0
- package/lib/cjs/render-primitives.js.map +1 -1
- package/lib/cjs/tile/ClassifierTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/ClassifierTileTree.js +8 -8
- package/lib/cjs/tile/ClassifierTileTree.js.map +1 -1
- package/lib/cjs/tile/IModelTile.d.ts.map +1 -1
- package/lib/cjs/tile/IModelTile.js +1 -0
- package/lib/cjs/tile/IModelTile.js.map +1 -1
- package/lib/cjs/tile/IModelTileTree.d.ts +3 -1
- package/lib/cjs/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/IModelTileTree.js +1 -0
- package/lib/cjs/tile/IModelTileTree.js.map +1 -1
- package/lib/cjs/tile/ImdlReader.d.ts +9 -4
- package/lib/cjs/tile/ImdlReader.d.ts.map +1 -1
- package/lib/cjs/tile/ImdlReader.js +174 -60
- package/lib/cjs/tile/ImdlReader.js.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.d.ts +7 -6
- package/lib/cjs/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.js +30 -25
- package/lib/cjs/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.js +2 -1
- package/lib/cjs/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/tile/TileAdmin.d.ts +21 -2
- package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
- package/lib/cjs/tile/TileAdmin.js +32 -12
- package/lib/cjs/tile/TileAdmin.js.map +1 -1
- package/lib/cjs/tile/map/CesiumTerrainProvider.js +6 -2
- package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +51 -4
- package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts +1 -1
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +5 -2
- package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.d.ts +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js +2 -2
- package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -1
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +5 -2
- package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.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 +6 -2
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapCartoRectangle.d.ts +1 -0
- package/lib/cjs/tile/map/MapCartoRectangle.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapCartoRectangle.js +1 -0
- package/lib/cjs/tile/map/MapCartoRectangle.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +2 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +3 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryProvider.js +24 -10
- package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerSources.d.ts +14 -9
- package/lib/cjs/tile/map/MapLayerSources.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerSources.js +14 -6
- package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +3 -5
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tile/map/TerrainMeshProvider.d.ts +2 -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/PrimitiveTool.js +4 -4
- package/lib/cjs/tools/PrimitiveTool.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +25 -10
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/DisplayStyleState.d.ts +80 -31
- package/lib/esm/DisplayStyleState.d.ts.map +1 -1
- package/lib/esm/DisplayStyleState.js +150 -89
- package/lib/esm/DisplayStyleState.js.map +1 -1
- package/lib/esm/DrawingViewState.js +1 -1
- package/lib/esm/DrawingViewState.js.map +1 -1
- package/lib/esm/EntityState.d.ts +5 -5
- package/lib/esm/EntityState.d.ts.map +1 -1
- package/lib/esm/EntityState.js.map +1 -1
- package/lib/esm/IModelApp.d.ts.map +1 -1
- package/lib/esm/IModelApp.js +2 -2
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/IModelConnection.d.ts +1 -1
- package/lib/esm/IModelConnection.d.ts.map +1 -1
- package/lib/esm/IModelConnection.js +2 -2
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/RealityDataSource.d.ts.map +1 -1
- package/lib/esm/RealityDataSource.js +6 -2
- package/lib/esm/RealityDataSource.js.map +1 -1
- package/lib/esm/SheetViewState.js +1 -1
- package/lib/esm/SheetViewState.js.map +1 -1
- package/lib/esm/TentativePoint.js +1 -1
- package/lib/esm/TentativePoint.js.map +1 -1
- package/lib/esm/ViewRect.d.ts +5 -3
- package/lib/esm/ViewRect.d.ts.map +1 -1
- package/lib/esm/ViewRect.js +11 -7
- package/lib/esm/ViewRect.js.map +1 -1
- package/lib/esm/ViewState.d.ts +1 -2
- package/lib/esm/ViewState.d.ts.map +1 -1
- package/lib/esm/ViewState.js +6 -2
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/Viewport.d.ts +1 -1
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +11 -6
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +0 -2
- package/lib/esm/core-frontend.d.ts.map +1 -1
- package/lib/esm/core-frontend.js +0 -2
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/extension/ExtensionAdmin.d.ts +5 -2
- package/lib/esm/extension/ExtensionAdmin.d.ts.map +1 -1
- package/lib/esm/extension/ExtensionAdmin.js +24 -6
- package/lib/esm/extension/ExtensionAdmin.js.map +1 -1
- package/lib/esm/extension/providers/RemoteExtensionProvider.d.ts +0 -2
- package/lib/esm/extension/providers/RemoteExtensionProvider.d.ts.map +1 -1
- package/lib/esm/extension/providers/RemoteExtensionProvider.js +9 -22
- package/lib/esm/extension/providers/RemoteExtensionProvider.js.map +1 -1
- package/lib/esm/render/FeatureSymbology.js +2 -2
- package/lib/esm/render/FeatureSymbology.js.map +1 -1
- package/lib/esm/render/GraphicBranch.d.ts +15 -9
- package/lib/esm/render/GraphicBranch.d.ts.map +1 -1
- package/lib/esm/render/GraphicBranch.js +36 -0
- package/lib/esm/render/GraphicBranch.js.map +1 -1
- package/lib/esm/render/RenderSystem.d.ts +5 -0
- package/lib/esm/render/RenderSystem.d.ts.map +1 -1
- package/lib/esm/render/RenderSystem.js.map +1 -1
- package/lib/esm/render/primitives/EdgeParams.d.ts +11 -0
- package/lib/esm/render/primitives/EdgeParams.d.ts.map +1 -1
- package/lib/esm/render/primitives/EdgeParams.js +34 -28
- package/lib/esm/render/primitives/EdgeParams.js.map +1 -1
- package/lib/esm/render/primitives/VertexTable.d.ts +11 -4
- package/lib/esm/render/primitives/VertexTable.d.ts.map +1 -1
- package/lib/esm/render/primitives/VertexTable.js +14 -7
- package/lib/esm/render/primitives/VertexTable.js.map +1 -1
- package/lib/esm/render/primitives/VertexTableSplitter.d.ts +41 -0
- package/lib/esm/render/primitives/VertexTableSplitter.d.ts.map +1 -0
- package/lib/esm/render/primitives/VertexTableSplitter.js +655 -0
- package/lib/esm/render/primitives/VertexTableSplitter.js.map +1 -0
- package/lib/esm/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
- package/lib/esm/render/primitives/geometry/GeometryListBuilder.js +3 -1
- package/lib/esm/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
- package/lib/esm/render/webgl/ShaderProgram.js +1 -1
- package/lib/esm/render/webgl/ShaderProgram.js.map +1 -1
- package/lib/esm/render/webgl/Target.d.ts +1 -1
- package/lib/esm/render/webgl/Target.js +2 -2
- package/lib/esm/render/webgl/Target.js.map +1 -1
- package/lib/esm/render/webgl/UniformHandle.d.ts +2 -1
- package/lib/esm/render/webgl/UniformHandle.d.ts.map +1 -1
- package/lib/esm/render/webgl/UniformHandle.js +15 -3
- package/lib/esm/render/webgl/UniformHandle.js.map +1 -1
- package/lib/esm/render/webgl/glsl/RealityMesh.d.ts.map +1 -1
- package/lib/esm/render/webgl/glsl/RealityMesh.js +5 -2
- package/lib/esm/render/webgl/glsl/RealityMesh.js.map +1 -1
- package/lib/esm/render-primitives.d.ts +1 -0
- package/lib/esm/render-primitives.d.ts.map +1 -1
- package/lib/esm/render-primitives.js +1 -0
- package/lib/esm/render-primitives.js.map +1 -1
- package/lib/esm/tile/ClassifierTileTree.d.ts.map +1 -1
- package/lib/esm/tile/ClassifierTileTree.js +10 -10
- package/lib/esm/tile/ClassifierTileTree.js.map +1 -1
- package/lib/esm/tile/IModelTile.d.ts.map +1 -1
- package/lib/esm/tile/IModelTile.js +1 -0
- package/lib/esm/tile/IModelTile.js.map +1 -1
- package/lib/esm/tile/IModelTileTree.d.ts +3 -1
- package/lib/esm/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/esm/tile/IModelTileTree.js +1 -0
- package/lib/esm/tile/IModelTileTree.js.map +1 -1
- package/lib/esm/tile/ImdlReader.d.ts +9 -4
- package/lib/esm/tile/ImdlReader.d.ts.map +1 -1
- package/lib/esm/tile/ImdlReader.js +174 -60
- package/lib/esm/tile/ImdlReader.js.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.d.ts +7 -6
- package/lib/esm/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.js +31 -26
- package/lib/esm/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.js +2 -1
- package/lib/esm/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/tile/TileAdmin.d.ts +21 -2
- package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
- package/lib/esm/tile/TileAdmin.js +33 -13
- package/lib/esm/tile/TileAdmin.js.map +1 -1
- package/lib/esm/tile/map/CesiumTerrainProvider.js +6 -2
- package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +51 -4
- package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts +1 -1
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +5 -2
- package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.d.ts +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js +2 -2
- package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts +1 -1
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js +5 -2
- package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.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 +6 -2
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapCartoRectangle.d.ts +1 -0
- package/lib/esm/tile/map/MapCartoRectangle.d.ts.map +1 -1
- package/lib/esm/tile/map/MapCartoRectangle.js +1 -0
- package/lib/esm/tile/map/MapCartoRectangle.js.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +2 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +3 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryProvider.js +25 -11
- package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
- package/lib/esm/tile/map/MapLayerSources.d.ts +14 -9
- package/lib/esm/tile/map/MapLayerSources.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerSources.js +14 -6
- package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +3 -5
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tile/map/TerrainMeshProvider.d.ts +2 -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/PrimitiveTool.js +4 -4
- package/lib/esm/tools/PrimitiveTool.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +25 -10
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/package.json +25 -25
- package/lib/cjs/RenderScheduleState.d.ts +0 -24
- package/lib/cjs/RenderScheduleState.d.ts.map +0 -1
- package/lib/cjs/RenderScheduleState.js +0 -76
- package/lib/cjs/RenderScheduleState.js.map +0 -1
- package/lib/cjs/extension/providers/ExtensionServiceClient.d.ts +0 -52
- package/lib/cjs/extension/providers/ExtensionServiceClient.d.ts.map +0 -1
- package/lib/cjs/extension/providers/ExtensionServiceClient.js +0 -131
- package/lib/cjs/extension/providers/ExtensionServiceClient.js.map +0 -1
- package/lib/cjs/extension/providers/ServiceExtensionProvider.d.ts +0 -37
- package/lib/cjs/extension/providers/ServiceExtensionProvider.d.ts.map +0 -1
- package/lib/cjs/extension/providers/ServiceExtensionProvider.js +0 -84
- package/lib/cjs/extension/providers/ServiceExtensionProvider.js.map +0 -1
- package/lib/esm/RenderScheduleState.d.ts +0 -24
- package/lib/esm/RenderScheduleState.d.ts.map +0 -1
- package/lib/esm/RenderScheduleState.js +0 -71
- package/lib/esm/RenderScheduleState.js.map +0 -1
- package/lib/esm/extension/providers/ExtensionServiceClient.d.ts +0 -52
- package/lib/esm/extension/providers/ExtensionServiceClient.d.ts.map +0 -1
- package/lib/esm/extension/providers/ExtensionServiceClient.js +0 -127
- package/lib/esm/extension/providers/ExtensionServiceClient.js.map +0 -1
- package/lib/esm/extension/providers/ServiceExtensionProvider.d.ts +0 -37
- package/lib/esm/extension/providers/ServiceExtensionProvider.d.ts.map +0 -1
- package/lib/esm/extension/providers/ServiceExtensionProvider.js +0 -80
- package/lib/esm/extension/providers/ServiceExtensionProvider.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetViewState.js","sourceRoot":"","sources":["../../src/SheetViewState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;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AU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QAEtH,gIAAgI;QAChI,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;QAC5B,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,CAAC,kBAAkB,GAAG,IAAI,mCAAgB,CAAC,SAAS,EAAE,CAAC;QAC7D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE7B,uCAAuC;QACvC,IAAI,UAAU,CAAC;QACf,IAAI,MAAA,IAAI,CAAC,MAAM,CAAC,cAAc,0CAAE,IAAI,EAAE;YACpC,MAAM,UAAU,GAAG,0BAAU,CAAC,QAAQ,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,cAAc,0CAAE,IAAI,CAAC,CAAC;YACzE,IAAI,UAAU,CAAC,OAAO;gBACpB,UAAU,GAAG,qBAAS,CAAC,YAAY,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;SACpE;QAED,OAAO,qBAAS,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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { assert, CompressedId64Set, dispose, Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport { Angle, ClipShape, ClipVector, Constant, Matrix3d, Point2d, Point3d, PolyfaceBuilder, Range2d, Range3d, StrokeOptions, Transform } from \"@itwin/core-geometry\";\r\nimport {\r\n AxisAlignedBox3d, ColorDef, Feature, FeatureTable, Frustum, Gradient, GraphicParams, HiddenLine, HydrateViewStateRequestProps, HydrateViewStateResponseProps, PackedFeatureTable, Placement2d, SheetProps,\r\n TextureTransparency, ViewAttachmentProps, ViewDefinition2dProps, ViewFlagOverrides, ViewStateProps,\r\n} from \"@itwin/core-common\";\r\nimport { CategorySelectorState } from \"./CategorySelectorState\";\r\nimport { DisplayStyle2dState } from \"./DisplayStyleState\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { GraphicBuilder, GraphicType } from \"./render/GraphicBuilder\";\r\nimport { RenderGraphic } from \"./render/RenderGraphic\";\r\nimport { GraphicBranch } from \"./render/GraphicBranch\";\r\nimport { Frustum2d } from \"./Frustum2d\";\r\nimport { Scene } from \"./render/Scene\";\r\nimport { Decorations } from \"./render/Decorations\";\r\nimport { MockRender } from \"./render/MockRender\";\r\nimport { RenderClipVolume } from \"./render/RenderClipVolume\";\r\nimport { RenderMemory } from \"./render/RenderMemory\";\r\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\r\nimport { DecorateContext, SceneContext } from \"./ViewContext\";\r\nimport { ViewRect } from \"./ViewRect\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { CoordSystem } from \"./CoordSystem\";\r\nimport { OffScreenViewport, Viewport } from \"./Viewport\";\r\nimport { AttachToViewportArgs, ViewState, ViewState2d } from \"./ViewState\";\r\nimport { DrawingViewState } from \"./DrawingViewState\";\r\nimport { createDefaultViewFlagOverrides, DisclosedTileTreeSet, TileGraphicType } from \"./tile/internal\";\r\nimport { imageBufferToPngDataUrl, openImageDataUrlInNewWindow } from \"./ImageUtil\";\r\n\r\n// cSpell:ignore ovrs\r\n\r\n/** Describes the geometry and styling of a sheet border decoration.\r\n * The sheet border decoration mimics a sheet of paper with a drop shadow.\r\n */\r\nclass SheetBorder {\r\n private _rect: Point2d[];\r\n private _shadow: Point2d[];\r\n private _gradient: Gradient.Symb;\r\n\r\n private constructor(rect: Point2d[], shadow: Point2d[], gradient: Gradient.Symb) {\r\n this._rect = rect;\r\n this._shadow = shadow;\r\n this._gradient = gradient;\r\n }\r\n\r\n /** Create a new sheet border. If a context is supplied, points are transformed to view coordinates. */\r\n public static create(width: number, height: number, context?: DecorateContext) {\r\n // Rect\r\n const rect: Point3d[] = [\r\n Point3d.create(0, height),\r\n Point3d.create(0, 0),\r\n Point3d.create(width, 0),\r\n Point3d.create(width, height),\r\n Point3d.create(0, height)];\r\n if (context) {\r\n context.viewport.worldToViewArray(rect);\r\n }\r\n\r\n // Shadow\r\n const shadowWidth = .01 * Math.sqrt(width * width + height * height);\r\n const shadow: Point3d[] = [\r\n Point3d.create(shadowWidth, 0),\r\n Point3d.create(shadowWidth, -shadowWidth),\r\n Point3d.create(width + shadowWidth, -shadowWidth),\r\n Point3d.create(width + shadowWidth, height - shadowWidth),\r\n Point3d.create(width, height - shadowWidth),\r\n Point3d.create(width, 0),\r\n Point3d.create(shadowWidth, 0),\r\n ];\r\n if (context) {\r\n context.viewport.worldToViewArray(shadow);\r\n }\r\n\r\n // Gradient\r\n const gradient = new Gradient.Symb();\r\n gradient.mode = Gradient.Mode.Linear;\r\n gradient.angle = Angle.createDegrees(-45);\r\n gradient.keys = [{ value: 0, color: ColorDef.from(25, 25, 25) }, { value: 0.5, color: ColorDef.from(150, 150, 150) }];\r\n\r\n // Copy over points\r\n const rect2d: Point2d[] = [];\r\n for (const point of rect)\r\n rect2d.push(Point2d.createFrom(point));\r\n const shadow2d: Point2d[] = [];\r\n for (const point of shadow)\r\n shadow2d.push(Point2d.createFrom(point));\r\n\r\n return new SheetBorder(rect2d, shadow2d, gradient);\r\n }\r\n\r\n public getRange(): Range2d {\r\n const range = Range2d.createArray(this._rect);\r\n const shadowRange = Range2d.createArray(this._shadow);\r\n range.extendRange(shadowRange);\r\n return range;\r\n }\r\n\r\n /** Add this border to the given GraphicBuilder. */\r\n public addToBuilder(builder: GraphicBuilder) {\r\n const lineColor = ColorDef.black;\r\n const fillColor = ColorDef.black;\r\n\r\n const params = new GraphicParams();\r\n params.fillColor = fillColor;\r\n params.gradient = this._gradient;\r\n\r\n builder.activateGraphicParams(params);\r\n builder.addShape2d(this._shadow, Frustum2d.minimumZDistance);\r\n\r\n builder.setSymbology(lineColor, fillColor, 2);\r\n builder.addLineString2d(this._rect, 0);\r\n }\r\n}\r\n\r\n/** The information required to instantiate an Attachment object. See ViewAttachmentsInfo */\r\ninterface ViewAttachmentInfo extends ViewAttachmentProps {\r\n attachedView: ViewState;\r\n}\r\n\r\n/** The information required to instantiate an ViewAttachments object to draw ViewAttachments into a sheet. The list of view attachment Ids is\r\n * supplied to SheetViewState via the constructor. The corresponding ViewAttachmentProps for each attachment are obtained asynchronously in\r\n * SheetViewState.load(). The Attachments object is created in SheetViewState.attachToViewport and disposed of in SheetViewState.detachFromViewport.\r\n */\r\nclass ViewAttachmentsInfo {\r\n private _attachments: Id64Array | ViewAttachmentInfo[];\r\n\r\n private constructor(attachments: Id64Array | ViewAttachmentInfo[]) {\r\n this._attachments = attachments;\r\n }\r\n\r\n public get isLoaded(): boolean {\r\n return 0 === this._attachments.length || \"string\" !== typeof this._attachments[0];\r\n }\r\n\r\n public get viewAttachmentProps(): Array<Readonly<ViewAttachmentProps>> {\r\n return this.isLoaded ? this._props : [];\r\n }\r\n\r\n private get _props(): ViewAttachmentInfo[] {\r\n assert(this.isLoaded);\r\n return this._attachments as ViewAttachmentInfo[];\r\n }\r\n\r\n private get _ids(): Id64Array {\r\n assert(!this.isLoaded);\r\n return this._attachments as Id64Array;\r\n }\r\n\r\n public static fromJSON(ids: Id64Array = []): ViewAttachmentsInfo {\r\n return new ViewAttachmentsInfo(ids);\r\n }\r\n\r\n public toJSON(): Id64Array {\r\n return this.isLoaded ? this._props.map((x) => x.id!) : [...this._ids];\r\n }\r\n\r\n public clone(): ViewAttachmentsInfo {\r\n // No reason to clone the array.\r\n return new ViewAttachmentsInfo(this._attachments);\r\n }\r\n\r\n public preload(options: HydrateViewStateRequestProps) {\r\n if (this.isLoaded)\r\n return;\r\n options.sheetViewAttachmentIds = CompressedId64Set.sortAndCompress(this._ids);\r\n options.viewStateLoadProps = {\r\n displayStyle: {\r\n omitScheduleScriptElementIds: true,\r\n compressExcludedElementIds: true,\r\n },\r\n };\r\n }\r\n\r\n public async postload(options: HydrateViewStateResponseProps, iModel: IModelConnection) {\r\n if (options.sheetViewViews === undefined)\r\n return;\r\n if (options.sheetViewAttachmentProps === undefined)\r\n return;\r\n\r\n const viewStateProps = options.sheetViewViews; // This is viewstateProps, need to turn this into ViewState\r\n const promises = [];\r\n for (const viewProps of viewStateProps) {\r\n const loadView = async () => {\r\n try {\r\n if (viewProps === undefined)\r\n return undefined;\r\n const view = await iModel.views.convertViewStatePropsToViewState(viewProps);\r\n return view;\r\n } catch {\r\n return undefined;\r\n }\r\n };\r\n promises.push(loadView());\r\n }\r\n const views = await Promise.all(promises);\r\n\r\n const attachmentProps = options.sheetViewAttachmentProps as ViewAttachmentInfo[];\r\n assert (views.length === attachmentProps.length);\r\n const attachments = [];\r\n for (let i = 0; i < views.length; i++) {\r\n const view = views[i];\r\n if (view && !(view instanceof SheetViewState)) {\r\n const props = attachmentProps[i];\r\n props.attachedView = view;\r\n attachments.push(props);\r\n }\r\n }\r\n\r\n this._attachments = attachments;\r\n }\r\n\r\n public async load(iModel: IModelConnection): Promise<void> {\r\n if (this.isLoaded)\r\n return;\r\n\r\n const attachmentProps = await iModel.elements.getProps(this._ids) as ViewAttachmentInfo[];\r\n const promises = [];\r\n for (const attachment of attachmentProps) {\r\n const loadView = async () => {\r\n try {\r\n const view = await iModel.views.load(attachment.view.id);\r\n return view;\r\n } catch {\r\n return undefined;\r\n }\r\n };\r\n\r\n promises.push(loadView());\r\n }\r\n\r\n const views = await Promise.all(promises);\r\n assert(views.length === attachmentProps.length);\r\n\r\n const attachments = [];\r\n for (let i = 0; i < views.length; i++) {\r\n const view = views[i];\r\n if (view && !(view instanceof SheetViewState)) {\r\n const props = attachmentProps[i];\r\n props.attachedView = view;\r\n attachments.push(props);\r\n }\r\n }\r\n\r\n this._attachments = attachments;\r\n }\r\n\r\n public createAttachments(sheetView: SheetViewState): ViewAttachments | undefined {\r\n return this.isLoaded ? new ViewAttachments(this._props, sheetView) : undefined;\r\n }\r\n}\r\n\r\n/** The set of view attachments to be displayed in a Viewport via a SheetViewState. Allocated when the view becomes attached to a Viewport;\r\n * disposed of when it becomes detached from the viewport.\r\n */\r\nclass ViewAttachments {\r\n private readonly _attachments: Attachment[] = [];\r\n public maxDepth = Frustum2d.minimumZDistance;\r\n\r\n public constructor(infos: ViewAttachmentInfo[], sheetView: SheetViewState) {\r\n for (const info of infos) {\r\n const drawAsRaster = info.jsonProperties?.displayOptions?.drawAsRaster || (info.attachedView.is3d() && info.attachedView.isCameraOn);\r\n const ctor = drawAsRaster ? RasterAttachment : OrthographicAttachment;\r\n const attachment = new ctor(info.attachedView, info, sheetView);\r\n this._attachments.push(attachment);\r\n this.maxDepth = Math.max(this.maxDepth, attachment.zDepth);\r\n }\r\n }\r\n\r\n public dispose(): void {\r\n for (const attachment of this._attachments)\r\n attachment.dispose();\r\n\r\n this._attachments.length = 0;\r\n }\r\n\r\n public [Symbol.iterator](): Iterator<Attachment> {\r\n return this._attachments[Symbol.iterator]();\r\n }\r\n\r\n /** For tests. */\r\n public get attachments(): Object[] {\r\n return this._attachments;\r\n }\r\n\r\n public get isEmpty(): boolean {\r\n return 0 === this._attachments.length;\r\n }\r\n\r\n public get areAllTileTreesLoaded(): boolean {\r\n return this._attachments.every((x) => x.areAllTileTreesLoaded);\r\n }\r\n\r\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\r\n for (const attachment of this._attachments)\r\n trees.disclose(attachment);\r\n }\r\n\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n for (const attachment of this._attachments)\r\n attachment.collectStatistics(stats);\r\n }\r\n\r\n public addToScene(context: SceneContext): void {\r\n for (const attachment of this._attachments)\r\n attachment.addToScene(context);\r\n }\r\n}\r\n\r\n/** A view of a [SheetModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SheetViewState extends ViewState2d {\r\n /** The width and height of the sheet in world coordinates. */\r\n public readonly sheetSize: Point2d;\r\n private _attachmentsInfo: ViewAttachmentsInfo;\r\n private _attachments?: ViewAttachments;\r\n private readonly _viewedExtents: AxisAlignedBox3d;\r\n\r\n public get attachmentIds(): Id64Array {\r\n return this._attachmentsInfo.toJSON();\r\n }\r\n\r\n /** @internal */\r\n public static override get className() { return \"SheetViewDefinition\"; }\r\n\r\n public static override createFromProps(viewStateData: ViewStateProps, iModel: IModelConnection): SheetViewState {\r\n const cat = new CategorySelectorState(viewStateData.categorySelectorProps, iModel);\r\n const displayStyleState = new DisplayStyle2dState(viewStateData.displayStyleProps, iModel);\r\n\r\n // use \"new this\" so subclasses are correct\r\n return new this(viewStateData.viewDefinitionProps as ViewDefinition2dProps, iModel, cat, displayStyleState, viewStateData.sheetProps!, viewStateData.sheetAttachments!);\r\n }\r\n\r\n public override toProps(): ViewStateProps {\r\n const props = super.toProps();\r\n\r\n props.sheetAttachments = this._attachmentsInfo.toJSON();\r\n\r\n // For sheetProps all that is actually used is the size, so just null out everything else.\r\n const codeProps = { spec: \"\", scope: \"\", value: \"\" };\r\n props.sheetProps = {\r\n model: \"\",\r\n code: codeProps,\r\n classFullName: \"\",\r\n width: this.sheetSize.x,\r\n height: this.sheetSize.y,\r\n scale: 1,\r\n };\r\n\r\n return props;\r\n }\r\n\r\n /** Strictly for testing. @internal */\r\n public get viewAttachmentProps(): Array<Readonly<ViewAttachmentProps>> {\r\n return this._attachmentsInfo.viewAttachmentProps;\r\n }\r\n\r\n /** Strictly for testing. @internal */\r\n public get attachments(): Object[] | undefined {\r\n return this._attachments?.attachments;\r\n }\r\n\r\n /** @internal */\r\n public override isDrawingView(): this is DrawingViewState { return false; }\r\n /** @internal */\r\n public override isSheetView(): this is SheetViewState { return true; }\r\n\r\n public constructor(props: ViewDefinition2dProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle2dState, sheetProps: SheetProps, attachments: Id64Array) {\r\n super(props, iModel, categories, displayStyle);\r\n if (categories instanceof SheetViewState) {\r\n // we are coming from clone...\r\n this.sheetSize = categories.sheetSize.clone();\r\n this._attachmentsInfo = categories._attachmentsInfo.clone();\r\n this._viewedExtents = categories._viewedExtents.clone();\r\n } else {\r\n this.sheetSize = Point2d.create(sheetProps.width, sheetProps.height);\r\n this._attachmentsInfo = ViewAttachmentsInfo.fromJSON(attachments);\r\n\r\n const extents = new Range3d(0, 0, 0, this.sheetSize.x, this.sheetSize.y, 0);\r\n const margin = 1.1;\r\n extents.scaleAboutCenterInPlace(margin);\r\n this._viewedExtents = extents;\r\n }\r\n }\r\n\r\n public override getOrigin() {\r\n const origin = super.getOrigin();\r\n if (this._attachments)\r\n origin.z = -this._attachments.maxDepth;\r\n\r\n return origin;\r\n }\r\n\r\n public override getExtents() {\r\n const extents = super.getExtents();\r\n if (this._attachments)\r\n extents.z = this._attachments.maxDepth + Frustum2d.minimumZDistance;\r\n\r\n return extents;\r\n }\r\n\r\n /** Disclose *all* TileTrees currently in use by this view. This set may include trees not reported by [[forEachTileTreeRef]] - e.g., those used by view attachments, map-draped terrain, etc.\r\n * @internal override\r\n */\r\n public override discloseTileTrees(trees: DisclosedTileTreeSet): void {\r\n super.discloseTileTrees(trees);\r\n if (this._attachments)\r\n trees.disclose(this._attachments);\r\n }\r\n\r\n /** @internal */\r\n public override collectNonTileTreeStatistics(stats: RenderMemory.Statistics): void {\r\n super.collectNonTileTreeStatistics(stats);\r\n if (this._attachments)\r\n this._attachments.collectStatistics(stats);\r\n }\r\n\r\n /** @internal */\r\n public override get defaultExtentLimits() {\r\n return { min: Constant.oneMillimeter, max: this.sheetSize.magnitude() * 10 };\r\n }\r\n\r\n /** @internal */\r\n public override getViewedExtents(): AxisAlignedBox3d {\r\n return this._viewedExtents;\r\n }\r\n\r\n /** @internal */\r\n protected override preload(hydrateRequest: HydrateViewStateRequestProps): void {\r\n super.preload(hydrateRequest);\r\n this._attachmentsInfo.preload(hydrateRequest);\r\n }\r\n\r\n /** @internal */\r\n protected override async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\r\n const promises = [];\r\n promises.push(super.postload(hydrateResponse));\r\n promises.push(this._attachmentsInfo.postload(hydrateResponse, this.iModel));\r\n await Promise.all(promises);\r\n }\r\n\r\n /** @internal */\r\n public override createScene(context: SceneContext): void {\r\n super.createScene(context);\r\n if (this._attachments)\r\n this._attachments.addToScene(context);\r\n }\r\n\r\n /** @internal */\r\n public override get secondaryViewports(): Iterable<Viewport> {\r\n const attachments = this._attachments;\r\n if (!attachments)\r\n return super.secondaryViewports;\r\n\r\n function* iterator() {\r\n for (const attachment of attachments!) {\r\n const vp = attachment.viewport;\r\n if (vp)\r\n yield vp;\r\n }\r\n }\r\n\r\n return {\r\n [Symbol.iterator]: () => iterator(),\r\n };\r\n }\r\n\r\n /** @internal */\r\n private async queryAttachmentIds(): Promise<Id64Array> {\r\n const ecsql = `SELECT ECInstanceId as attachmentId FROM bis.ViewAttachment WHERE model.Id=${this.baseModelId}`;\r\n const ids: string[] = [];\r\n for await (const row of this.iModel.query(ecsql))\r\n ids.push(row[0]);\r\n\r\n return ids;\r\n }\r\n\r\n /** @internal */\r\n public override async changeViewedModel(modelId: Id64String): Promise<void> {\r\n await super.changeViewedModel(modelId);\r\n const attachmentIds = await this.queryAttachmentIds();\r\n this._attachmentsInfo = ViewAttachmentsInfo.fromJSON(attachmentIds);\r\n\r\n assert(undefined === this._attachments);\r\n }\r\n\r\n /** @internal */\r\n public override attachToViewport(args: AttachToViewportArgs): void {\r\n super.attachToViewport(args);\r\n assert(undefined === this._attachments);\r\n this._attachments = this._attachmentsInfo.createAttachments(this);\r\n }\r\n\r\n /** @internal */\r\n public override detachFromViewport(): void {\r\n super.detachFromViewport();\r\n this._attachments = dispose(this._attachments);\r\n }\r\n\r\n /** @internal */\r\n public override get areAllTileTreesLoaded(): boolean {\r\n return super.areAllTileTreesLoaded && (!this._attachments || this._attachments.areAllTileTreesLoaded);\r\n }\r\n\r\n /** Create a sheet border decoration graphic. */\r\n private createBorder(width: number, height: number, context: DecorateContext): RenderGraphic {\r\n const border = SheetBorder.create(width, height, context);\r\n const builder = context.createGraphicBuilder(GraphicType.ViewBackground);\r\n border.addToBuilder(builder);\r\n return builder.finish();\r\n }\r\n\r\n /** @internal */\r\n public override decorate(context: DecorateContext): void {\r\n super.decorate(context);\r\n if (this.sheetSize !== undefined) {\r\n const border = this.createBorder(this.sheetSize.x, this.sheetSize.y, context);\r\n context.setViewBackground(border);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public override computeFitRange(): Range3d {\r\n const size = this.sheetSize;\r\n if (0 >= size.x || 0 >= size.y)\r\n return super.computeFitRange();\r\n return new Range3d(0, 0, -1, size.x, size.y, 1);\r\n }\r\n}\r\n\r\n/** A mostly no-op RenderTarget for an Attachment.\r\n * its Scene and symbology overrides.\r\n */\r\nclass AttachmentTarget extends MockRender.OffScreenTarget {\r\n private readonly _attachment: OrthographicAttachment;\r\n\r\n public constructor(attachment: OrthographicAttachment) {\r\n // The dimensions don't matter - we're not drawing anything.\r\n const rect = new ViewRect(1, 1);\r\n super(IModelApp.renderSystem, rect);\r\n this._attachment = attachment;\r\n }\r\n\r\n public override changeScene(scene: Scene): void {\r\n this._attachment.scene = scene;\r\n }\r\n\r\n public override overrideFeatureSymbology(ovrs: FeatureSymbology.Overrides): void {\r\n this._attachment.symbologyOverrides = ovrs;\r\n }\r\n}\r\n\r\n/** Draws the contents of a view attachment into a sheet view. */\r\ninterface Attachment {\r\n readonly areAllTileTreesLoaded: boolean;\r\n addToScene: (context: SceneContext) => void;\r\n discloseTileTrees: (trees: DisclosedTileTreeSet) => void;\r\n readonly zDepth: number;\r\n collectStatistics: (stats: RenderMemory.Statistics) => void;\r\n viewAttachmentProps: ViewAttachmentProps;\r\n dispose(): void;\r\n readonly viewport?: Viewport;\r\n}\r\n\r\n/** Draws the contents a 2d or orthographic 3d view directly into a sheet view.\r\n * We select tiles for the view in the context of a light-weight offscreen viewport with a no-op RenderTarget, then\r\n * collect the resultant graphics and add them to the sheet view's scene.\r\n */\r\nclass OrthographicAttachment {\r\n private readonly _viewport: OffScreenViewport;\r\n private readonly _props: ViewAttachmentProps;\r\n private readonly _sheetModelId: Id64String;\r\n private readonly _viewFlagOverrides: ViewFlagOverrides;\r\n private readonly _toSheet: Transform;\r\n private readonly _fromSheet: Transform;\r\n private readonly _sizeInMeters: Point2d;\r\n private readonly _range: Range3d;\r\n private readonly _viewRect = new ViewRect(0, 0, 1, 1);\r\n private readonly _originalFrustum = new Frustum();\r\n private readonly _clipVolume?: RenderClipVolume;\r\n private readonly _hiddenLineSettings?: HiddenLine.Settings;\r\n private readonly _scale: { x: number, y: number };\r\n private _debugFeatureTable?: PackedFeatureTable;\r\n public scene?: Scene;\r\n public symbologyOverrides: FeatureSymbology.Overrides;\r\n public readonly zDepth: number;\r\n\r\n public get view(): ViewState {\r\n return this._viewport.view;\r\n }\r\n\r\n public get viewAttachmentProps() {\r\n return this._props;\r\n }\r\n\r\n public get viewport(): Viewport {\r\n return this._viewport;\r\n }\r\n\r\n public constructor(view: ViewState, props: ViewAttachmentProps, sheetView: SheetViewState) {\r\n this.symbologyOverrides = new FeatureSymbology.Overrides(view);\r\n const target = new AttachmentTarget(this);\r\n this._viewport = OffScreenViewport.createViewport(view, target, true);\r\n\r\n this._props = props;\r\n this._sheetModelId = sheetView.baseModelId;\r\n\r\n const applyClip = true; // set to false for debugging\r\n this._viewFlagOverrides = {\r\n ...view.viewFlags,\r\n clipVolume: applyClip,\r\n lighting: false,\r\n shadows: false,\r\n };\r\n\r\n const placement = Placement2d.fromJSON(props.placement);\r\n const range = placement.calculateRange();\r\n this._range = range;\r\n this._sizeInMeters = new Point2d(range.xLength(), range.yLength());\r\n\r\n // Compute transform from attached view's world coordinates to sheet's world coordinates.\r\n // NB: We obtain the extents and origin from the *viewport* not the *view* - they may have been adjusted by the viewport.\r\n const applySkew = true; // set to false for debugging\r\n const skew = applySkew ? view.getAspectRatioSkew() : 1;\r\n const extents = this._viewport.viewingSpace.viewDelta.clone();\r\n const zDepth = Math.abs(extents.z);\r\n const scaleX = this._sizeInMeters.x / Math.abs(extents.x);\r\n const scaleY = skew * this._sizeInMeters.y / Math.abs(extents.y);\r\n this._scale = { x: 1 / scaleX, y: 1 / scaleY };\r\n\r\n const zBias = Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);\r\n this.zDepth = 1.01 * (zDepth - zBias); // give a little padding so that geometry right up against far plane doesn't get clipped.\r\n\r\n // View origin is at the *back* of the view. Align *front* of view based on display priority.\r\n const viewRot = view.getRotation();\r\n const viewOrg = viewRot.multiplyVector(this._viewport.viewingSpace.viewOrigin);\r\n viewOrg.z += zDepth;\r\n viewRot.multiplyTransposeVectorInPlace(viewOrg);\r\n\r\n const matrix = Matrix3d.createScale(scaleX, scaleY, 1);\r\n matrix.multiplyMatrixMatrix(viewRot, matrix);\r\n const origin = Matrix3d.xyzMinusMatrixTimesXYZ(viewOrg, matrix, viewOrg);\r\n const attachmentOrigin = Point3d.createFrom(placement.origin);\r\n attachmentOrigin.z = zBias;\r\n const viewOrgToAttachment = attachmentOrigin.minus(viewOrg);\r\n origin.addInPlace(viewOrgToAttachment);\r\n this._toSheet = Transform.createRefs(origin, matrix);\r\n this._fromSheet = this._toSheet.inverse()!;\r\n\r\n // If the attached view is a section drawing, it may itself have an attached spatial view with a clip.\r\n // The clip needs to be transformed into sheet space.\r\n if (view.isDrawingView())\r\n this._viewport.drawingToSheetTransform = this._toSheet;\r\n\r\n // ###TODO? If we also apply the attachment's clip to the attached view, we may get additional culling during tile selection.\r\n // However the attached view's frustum is already clipped by intersection with sheet view's frustum, and additional clipping planes\r\n // introduce additional computation, so possibly not worth it.\r\n\r\n // Transform the view's clip (if any) to sheet space\r\n let viewClip = view.viewFlags.clipVolume ? view.getViewClip()?.clone() : undefined;\r\n if (viewClip)\r\n viewClip.transformInPlace(this._toSheet);\r\n else\r\n viewClip = ClipVector.createEmpty();\r\n\r\n let sheetClip;\r\n if (undefined !== props.jsonProperties?.clip)\r\n sheetClip = ClipVector.fromJSON(props.jsonProperties?.clip);\r\n\r\n if (sheetClip && sheetClip.isValid) {\r\n // Clip to view attachment's clip. NB: clip is in sheet coordinate space.\r\n for (const clip of sheetClip.clips)\r\n viewClip.clips.push(clip);\r\n } else {\r\n // Clip to view attachment's bounding box\r\n viewClip.appendShape([\r\n Point3d.create(this._range.low.x, this._range.low.y),\r\n Point3d.create(this._range.high.x, this._range.low.y),\r\n Point3d.create(this._range.high.x, this._range.high.y),\r\n Point3d.create(this._range.low.x, this._range.high.y),\r\n ]);\r\n }\r\n\r\n this._clipVolume = IModelApp.renderSystem.createClipVolume(viewClip);\r\n\r\n // Save off the original frustum (potentially adjusted by viewport).\r\n this._viewport.setupFromView();\r\n this._viewport.viewingSpace.getFrustum(CoordSystem.World, true, this._originalFrustum);\r\n\r\n const applyHiddenLineSettings = true; // for debugging edge display, set to false...\r\n const style = view.displayStyle;\r\n if (style.is3d() && applyHiddenLineSettings)\r\n this._hiddenLineSettings = style.settings.hiddenLineSettings;\r\n }\r\n\r\n public dispose(): void {\r\n this._viewport.dispose();\r\n }\r\n\r\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\r\n trees.disclose(this._viewport);\r\n }\r\n\r\n public addToScene(context: SceneContext): void {\r\n if (context.viewport.freezeScene)\r\n return;\r\n\r\n if (!context.viewport.view.viewsCategory(this._props.category))\r\n return;\r\n\r\n const wantBounds = context.viewport.wantViewAttachmentBoundaries;\r\n const wantClipShapes = context.viewport.wantViewAttachmentClipShapes;\r\n if (wantBounds || wantClipShapes) {\r\n const builder = context.createSceneGraphicBuilder();\r\n if (wantBounds) {\r\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\r\n builder.addRangeBox(this._range);\r\n }\r\n\r\n if (wantClipShapes && this._clipVolume) {\r\n builder.setSymbology(ColorDef.blue, ColorDef.blue, 2);\r\n for (const prim of this._clipVolume.clipVector.clips) {\r\n if (!(prim instanceof ClipShape))\r\n continue; // ###TODO handle non-shape primitives, if any such ever encountered\r\n\r\n const pts = [];\r\n const tf = prim.transformFromClip;\r\n for (const pt of prim.polygon) {\r\n const tfPt = tf ? tf.multiplyPoint3d(pt) : pt;\r\n pts.push(new Point2d(tfPt.x, tfPt.y));\r\n }\r\n\r\n builder.addLineString2d(pts, 0);\r\n }\r\n }\r\n\r\n // Put into a Batch so that we can see tooltip with attachment Id on mouseover.\r\n const batch = context.target.renderSystem.createBatch(builder.finish(), this.getDebugFeatureTable(), this._range);\r\n context.outputGraphic(batch);\r\n }\r\n\r\n if (!context.viewport.wantViewAttachments)\r\n return;\r\n\r\n // Pixel size used to compute size of ViewRect so that tiles of appropriate LOD are selected.\r\n const pixelSize = context.viewport.getPixelSizeAtPoint();\r\n if (0 === pixelSize)\r\n return;\r\n\r\n // Adjust attached view frustum based on intersection with sheet view frustum.\r\n const attachFrustum = this._originalFrustum.transformBy(this._toSheet);\r\n const attachFrustumRange = attachFrustum.toRange();\r\n const sheetFrustum = context.viewport.getWorldFrustum();\r\n const sheetFrustumRange = sheetFrustum.toRange();\r\n const intersect = attachFrustumRange.intersect(sheetFrustumRange);\r\n if (intersect.isNull)\r\n return;\r\n\r\n attachFrustum.initFromRange(intersect);\r\n attachFrustum.transformBy(this._fromSheet, attachFrustum);\r\n this._viewport.setupViewFromFrustum(attachFrustum);\r\n\r\n // Adjust view rect based on size of attachment on screen so that tiles of appropriate LOD are selected.\r\n const width = this._sizeInMeters.x * intersect.xLength() / attachFrustumRange.xLength();\r\n const height = this._sizeInMeters.y * intersect.yLength() / attachFrustumRange.yLength();\r\n this._viewRect.width = Math.max(1, Math.round(width / pixelSize));\r\n this._viewRect.height = Math.max(1, Math.round(height / pixelSize));\r\n this._viewport.setRect(this._viewRect);\r\n\r\n // Propagate settings from on-screen viewport.\r\n this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;\r\n this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);\r\n\r\n // Create the scene.\r\n this._viewport.renderFrame();\r\n\r\n const scene = this.scene;\r\n if (!scene)\r\n return;\r\n\r\n // Extract scene graphics and insert into on-screen scene context.\r\n const options = {\r\n clipVolume: this._clipVolume,\r\n hline: this._hiddenLineSettings,\r\n frustum: {\r\n is3d: this.view.is3d(),\r\n scale: this._scale,\r\n },\r\n };\r\n\r\n const outputGraphics = (source: RenderGraphic[]) => {\r\n if (0 === source.length)\r\n return;\r\n\r\n const graphics = new GraphicBranch();\r\n graphics.setViewFlagOverrides(this._viewFlagOverrides);\r\n graphics.symbologyOverrides = this.symbologyOverrides;\r\n\r\n for (const graphic of source)\r\n graphics.entries.push(graphic);\r\n\r\n const branch = context.createGraphicBranch(graphics, this._toSheet, options);\r\n context.outputGraphic(branch);\r\n };\r\n\r\n outputGraphics(scene.foreground);\r\n context.withGraphicType(TileGraphicType.BackgroundMap, () => outputGraphics(scene.background));\r\n context.withGraphicType(TileGraphicType.Overlay, () => outputGraphics(scene.overlay));\r\n\r\n // Report tile statistics to sheet view's viewport.\r\n const tileAdmin = IModelApp.tileAdmin;\r\n const selectedAndReady = tileAdmin.getTilesForUser(this._viewport);\r\n const requested = tileAdmin.getRequestsForUser(this._viewport);\r\n tileAdmin.addExternalTilesForUser(context.viewport, {\r\n requested: requested?.size ?? 0,\r\n selected: selectedAndReady?.selected.size ?? 0,\r\n ready: selectedAndReady?.ready.size ?? 0,\r\n });\r\n }\r\n\r\n private getDebugFeatureTable(): PackedFeatureTable {\r\n if (this._debugFeatureTable)\r\n return this._debugFeatureTable;\r\n\r\n const featureTable = new FeatureTable(1, this._sheetModelId);\r\n featureTable.insert(new Feature(this._props.id));\r\n this._debugFeatureTable = PackedFeatureTable.pack(featureTable);\r\n return this._debugFeatureTable;\r\n }\r\n\r\n public get areAllTileTreesLoaded(): boolean {\r\n return this.view.areAllTileTreesLoaded;\r\n }\r\n\r\n public collectStatistics(_stats: RenderMemory.Statistics): void {\r\n // Handled by discloseTileTrees()\r\n }\r\n}\r\n\r\nfunction createRasterAttachmentViewport(_view: ViewState, _rect: ViewRect, _attachment: RasterAttachment): OffScreenViewport {\r\n class RasterAttachmentViewport extends OffScreenViewport {\r\n private _sceneContext?: SceneContext;\r\n private _isSceneReady = false;\r\n private readonly _attachment: RasterAttachment;\r\n\r\n public constructor(view: ViewState, rect: ViewRect, attachment: RasterAttachment) {\r\n super(IModelApp.renderSystem.createOffscreenTarget(rect));\r\n this._attachment = attachment;\r\n this._isAspectRatioLocked = true;\r\n this.changeView(view);\r\n }\r\n\r\n public override createSceneContext(): SceneContext {\r\n assert(!this._isSceneReady);\r\n\r\n this._sceneContext = super.createSceneContext();\r\n return this._sceneContext;\r\n }\r\n\r\n public override renderFrame(): void {\r\n assert(!this._isSceneReady);\r\n\r\n this.clearSceneContext();\r\n super.renderFrame();\r\n\r\n if (undefined !== this._sceneContext) {\r\n this._isSceneReady = !this._sceneContext.hasMissingTiles && this.view.areAllTileTreesLoaded;\r\n if (this._isSceneReady)\r\n this._attachment.produceGraphics(this._sceneContext);\r\n\r\n this._sceneContext = undefined;\r\n }\r\n }\r\n\r\n private clearSceneContext(): void {\r\n this._sceneContext = undefined;\r\n }\r\n\r\n public override addDecorations(_decorations: Decorations): void {\r\n // ###TODO: skybox, ground plane, possibly grid. DecorateContext requires a ScreenViewport...\r\n }\r\n }\r\n\r\n return new RasterAttachmentViewport(_view, _rect, _attachment);\r\n}\r\n\r\n/** Draws a 3d view with camera enabled into a sheet view by producing an image of the view's contents offscreen. */\r\nclass RasterAttachment {\r\n private readonly _props: ViewAttachmentProps;\r\n private readonly _placement: Placement2d;\r\n private readonly _transform: Transform;\r\n public readonly zDepth: number;\r\n private _viewport?: OffScreenViewport;\r\n private _graphics?: RenderGraphic;\r\n\r\n public constructor(view: ViewState, props: ViewAttachmentProps, sheetView: SheetViewState) {\r\n // Render to a 2048x2048 view rect. Scale in Y to preserve aspect ratio.\r\n const maxSize = 2048;\r\n const rect = new ViewRect(0, 0, maxSize, maxSize);\r\n const height = maxSize * view.getAspectRatio() * view.getAspectRatioSkew();\r\n const skew = maxSize / height;\r\n view.setAspectRatioSkew(skew);\r\n\r\n if (true !== props.jsonProperties?.displayOptions?.preserveBackground) {\r\n // Make background color 100% transparent so that Viewport.readImageBuffer() will discard transparent pixels.\r\n const bgColor = sheetView.displayStyle.backgroundColor.withAlpha(0);\r\n view.displayStyle.backgroundColor = bgColor;\r\n }\r\n\r\n this._viewport = createRasterAttachmentViewport(view, rect, this);\r\n this._props = props;\r\n this._placement = Placement2d.fromJSON(props.placement);\r\n this._transform = this._placement.transform;\r\n this.zDepth = Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);\r\n }\r\n\r\n public dispose(): void {\r\n this._viewport?.dispose();\r\n }\r\n\r\n public get viewAttachmentProps() {\r\n return this._props;\r\n }\r\n\r\n public get viewport(): Viewport | undefined {\r\n return this._viewport;\r\n }\r\n\r\n public get areAllTileTreesLoaded() {\r\n return this._viewport?.areAllTileTreesLoaded ?? true;\r\n }\r\n\r\n public addToScene(context: SceneContext): void {\r\n // ###TODO: check viewport.wantViewAttachmentClipShapes\r\n if (!context.viewport.view.viewsCategory(this._props.category))\r\n return;\r\n\r\n if (context.viewport.wantViewAttachmentBoundaries) {\r\n const builder = context.createSceneGraphicBuilder(this._transform);\r\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\r\n builder.addRangeBox(Range3d.createRange2d(this._placement.bbox));\r\n context.outputGraphic(builder.finish());\r\n }\r\n\r\n if (!context.viewport.wantViewAttachments)\r\n return;\r\n\r\n if (this._graphics) {\r\n context.outputGraphic(this._graphics);\r\n return;\r\n }\r\n\r\n if (undefined === this._viewport)\r\n return;\r\n\r\n this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;\r\n this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);\r\n\r\n this._viewport.renderFrame();\r\n if (this._graphics)\r\n context.outputGraphic(this._graphics);\r\n }\r\n\r\n public discloseTileTrees(trees: DisclosedTileTreeSet) {\r\n if (this._viewport)\r\n trees.disclose(this._viewport);\r\n }\r\n\r\n public produceGraphics(context: SceneContext): void {\r\n assert(context.viewport === this._viewport);\r\n this._graphics = this.createGraphics(this._viewport);\r\n this._viewport = dispose(this._viewport);\r\n\r\n if (undefined !== this._graphics)\r\n context.outputGraphic(this._graphics);\r\n }\r\n\r\n private createGraphics(vp: Viewport): RenderGraphic | undefined {\r\n // Create a texture from the contents of the view.\r\n const image = vp.readImageBuffer({ upsideDown: true });\r\n if (undefined === image)\r\n return undefined;\r\n\r\n const debugImage = false; // set to true to open a window displaying the captured image.\r\n if (debugImage) {\r\n const url = imageBufferToPngDataUrl(image, false);\r\n if (url)\r\n openImageDataUrlInNewWindow(url, \"Attachment\");\r\n }\r\n\r\n const texture = IModelApp.renderSystem.createTexture({\r\n image: { source: image, transparency: TextureTransparency.Opaque },\r\n });\r\n if (!texture)\r\n return undefined;\r\n\r\n // Create a material for the texture\r\n const graphicParams = new GraphicParams();\r\n graphicParams.material = IModelApp.renderSystem.createRenderMaterial({ textureMapping: { texture } });\r\n\r\n // Apply the texture to a rectangular polyface.\r\n const depth = this.zDepth;\r\n const east = this._placement.bbox.low.x;\r\n const west = this._placement.bbox.high.x;\r\n const north = this._placement.bbox.low.y;\r\n const south = this._placement.bbox.high.y;\r\n const corners = [\r\n Point3d.create(east, north, depth),\r\n Point3d.create(west, north, depth),\r\n Point3d.create(west, south, depth),\r\n Point3d.create(east, south, depth),\r\n ];\r\n const params = [\r\n Point2d.create(0, 0),\r\n Point2d.create(1, 0),\r\n Point2d.create(1, 1),\r\n Point2d.create(0, 1),\r\n ];\r\n\r\n const strokeOptions = new StrokeOptions();\r\n strokeOptions.needParams = strokeOptions.shouldTriangulate = true;\r\n const polyfaceBuilder = PolyfaceBuilder.create(strokeOptions);\r\n polyfaceBuilder.addQuadFacet(corners, params);\r\n const polyface = polyfaceBuilder.claimPolyface();\r\n\r\n const graphicBuilder = IModelApp.renderSystem.createGraphicBuilder(Transform.createIdentity(), GraphicType.Scene, vp, this._props.id);\r\n graphicBuilder.activateGraphicParams(graphicParams);\r\n graphicBuilder.addPolyface(polyface, false);\r\n const graphic = graphicBuilder.finish();\r\n\r\n // Wrap the polyface in a GraphicBranch.\r\n const branch = new GraphicBranch(true);\r\n const vfOvrs = createDefaultViewFlagOverrides({ clipVolume: true, shadows: false, lighting: false, thematic: false });\r\n\r\n // Disable transparency - background pixels are 100% transparent so they will be discarded anyway. Other pixels are 100% opaque.\r\n vfOvrs.transparency = false;\r\n branch.setViewFlagOverrides(vfOvrs);\r\n branch.symbologyOverrides = new FeatureSymbology.Overrides();\r\n branch.entries.push(graphic);\r\n\r\n // Apply the attachment's clip, if any.\r\n let clipVolume;\r\n if (this._props.jsonProperties?.clip) {\r\n const clipVector = ClipVector.fromJSON(this._props.jsonProperties?.clip);\r\n if (clipVector.isValid)\r\n clipVolume = IModelApp.renderSystem.createClipVolume(clipVector);\r\n }\r\n\r\n return IModelApp.renderSystem.createGraphicBranch(branch, this._transform, { clipVolume });\r\n }\r\n\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n if (this._graphics)\r\n this._graphics.collectStatistics(stats);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"SheetViewState.js","sourceRoot":"","sources":["../../src/SheetViewState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgG;AAChG,wDAAuK;AACvK,oDAG4B;AAC5B,mEAAgE;AAChE,2DAA0D;AAE1D,4DAAsE;AAEtE,0DAAuD;AACvD,2CAAwC;AAGxC,oDAAiD;AAGjD,gEAA6D;AAE7D,yCAAsC;AACtC,2CAAwC;AACxC,+CAA4C;AAC5C,yCAAyD;AACzD,2CAA2E;AAE3E,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AAC,CAAC;QACpC,MAAM,CAAC,kBAAkB,GAAG,IAAI,mCAAgB,CAAC,SAAS,EAAE,CAAC;QAC7D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE7B,uCAAuC;QACvC,IAAI,UAAU,CAAC;QACf,IAAI,MAAA,IAAI,CAAC,MAAM,CAAC,cAAc,0CAAE,IAAI,EAAE;YACpC,MAAM,UAAU,GAAG,0BAAU,CAAC,QAAQ,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,cAAc,0CAAE,IAAI,CAAC,CAAC;YACzE,IAAI,UAAU,CAAC,OAAO;gBACpB,UAAU,GAAG,qBAAS,CAAC,YAAY,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;SACpE;QAED,OAAO,qBAAS,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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { assert, CompressedId64Set, dispose, Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport { Angle, ClipShape, ClipVector, Constant, Matrix3d, Point2d, Point3d, PolyfaceBuilder, Range2d, Range3d, StrokeOptions, Transform } from \"@itwin/core-geometry\";\r\nimport {\r\n AxisAlignedBox3d, ColorDef, Feature, FeatureTable, Frustum, Gradient, GraphicParams, HiddenLine, HydrateViewStateRequestProps, HydrateViewStateResponseProps, PackedFeatureTable, Placement2d, SheetProps,\r\n TextureTransparency, ViewAttachmentProps, ViewDefinition2dProps, ViewFlagOverrides, ViewStateProps,\r\n} from \"@itwin/core-common\";\r\nimport { CategorySelectorState } from \"./CategorySelectorState\";\r\nimport { DisplayStyle2dState } from \"./DisplayStyleState\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { GraphicBuilder, GraphicType } from \"./render/GraphicBuilder\";\r\nimport { RenderGraphic } from \"./render/RenderGraphic\";\r\nimport { GraphicBranch } from \"./render/GraphicBranch\";\r\nimport { Frustum2d } from \"./Frustum2d\";\r\nimport { Scene } from \"./render/Scene\";\r\nimport { Decorations } from \"./render/Decorations\";\r\nimport { MockRender } from \"./render/MockRender\";\r\nimport { RenderClipVolume } from \"./render/RenderClipVolume\";\r\nimport { RenderMemory } from \"./render/RenderMemory\";\r\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\r\nimport { DecorateContext, SceneContext } from \"./ViewContext\";\r\nimport { ViewRect } from \"./ViewRect\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { CoordSystem } from \"./CoordSystem\";\r\nimport { OffScreenViewport, Viewport } from \"./Viewport\";\r\nimport { AttachToViewportArgs, ViewState, ViewState2d } from \"./ViewState\";\r\nimport { DrawingViewState } from \"./DrawingViewState\";\r\nimport { createDefaultViewFlagOverrides, DisclosedTileTreeSet, TileGraphicType } from \"./tile/internal\";\r\nimport { imageBufferToPngDataUrl, openImageDataUrlInNewWindow } from \"./ImageUtil\";\r\n\r\n// cSpell:ignore ovrs\r\n\r\n/** Describes the geometry and styling of a sheet border decoration.\r\n * The sheet border decoration mimics a sheet of paper with a drop shadow.\r\n */\r\nclass SheetBorder {\r\n private _rect: Point2d[];\r\n private _shadow: Point2d[];\r\n private _gradient: Gradient.Symb;\r\n\r\n private constructor(rect: Point2d[], shadow: Point2d[], gradient: Gradient.Symb) {\r\n this._rect = rect;\r\n this._shadow = shadow;\r\n this._gradient = gradient;\r\n }\r\n\r\n /** Create a new sheet border. If a context is supplied, points are transformed to view coordinates. */\r\n public static create(width: number, height: number, context?: DecorateContext) {\r\n // Rect\r\n const rect: Point3d[] = [\r\n Point3d.create(0, height),\r\n Point3d.create(0, 0),\r\n Point3d.create(width, 0),\r\n Point3d.create(width, height),\r\n Point3d.create(0, height)];\r\n if (context) {\r\n context.viewport.worldToViewArray(rect);\r\n }\r\n\r\n // Shadow\r\n const shadowWidth = .01 * Math.sqrt(width * width + height * height);\r\n const shadow: Point3d[] = [\r\n Point3d.create(shadowWidth, 0),\r\n Point3d.create(shadowWidth, -shadowWidth),\r\n Point3d.create(width + shadowWidth, -shadowWidth),\r\n Point3d.create(width + shadowWidth, height - shadowWidth),\r\n Point3d.create(width, height - shadowWidth),\r\n Point3d.create(width, 0),\r\n Point3d.create(shadowWidth, 0),\r\n ];\r\n if (context) {\r\n context.viewport.worldToViewArray(shadow);\r\n }\r\n\r\n // Gradient\r\n const gradient = new Gradient.Symb();\r\n gradient.mode = Gradient.Mode.Linear;\r\n gradient.angle = Angle.createDegrees(-45);\r\n gradient.keys = [{ value: 0, color: ColorDef.from(25, 25, 25) }, { value: 0.5, color: ColorDef.from(150, 150, 150) }];\r\n\r\n // Copy over points\r\n const rect2d: Point2d[] = [];\r\n for (const point of rect)\r\n rect2d.push(Point2d.createFrom(point));\r\n const shadow2d: Point2d[] = [];\r\n for (const point of shadow)\r\n shadow2d.push(Point2d.createFrom(point));\r\n\r\n return new SheetBorder(rect2d, shadow2d, gradient);\r\n }\r\n\r\n public getRange(): Range2d {\r\n const range = Range2d.createArray(this._rect);\r\n const shadowRange = Range2d.createArray(this._shadow);\r\n range.extendRange(shadowRange);\r\n return range;\r\n }\r\n\r\n /** Add this border to the given GraphicBuilder. */\r\n public addToBuilder(builder: GraphicBuilder) {\r\n const lineColor = ColorDef.black;\r\n const fillColor = ColorDef.black;\r\n\r\n const params = new GraphicParams();\r\n params.fillColor = fillColor;\r\n params.gradient = this._gradient;\r\n\r\n builder.activateGraphicParams(params);\r\n builder.addShape2d(this._shadow, Frustum2d.minimumZDistance);\r\n\r\n builder.setSymbology(lineColor, fillColor, 2);\r\n builder.addLineString2d(this._rect, 0);\r\n }\r\n}\r\n\r\n/** The information required to instantiate an Attachment object. See ViewAttachmentsInfo */\r\ninterface ViewAttachmentInfo extends ViewAttachmentProps {\r\n attachedView: ViewState;\r\n}\r\n\r\n/** The information required to instantiate an ViewAttachments object to draw ViewAttachments into a sheet. The list of view attachment Ids is\r\n * supplied to SheetViewState via the constructor. The corresponding ViewAttachmentProps for each attachment are obtained asynchronously in\r\n * SheetViewState.load(). The Attachments object is created in SheetViewState.attachToViewport and disposed of in SheetViewState.detachFromViewport.\r\n */\r\nclass ViewAttachmentsInfo {\r\n private _attachments: Id64Array | ViewAttachmentInfo[];\r\n\r\n private constructor(attachments: Id64Array | ViewAttachmentInfo[]) {\r\n this._attachments = attachments;\r\n }\r\n\r\n public get isLoaded(): boolean {\r\n return 0 === this._attachments.length || \"string\" !== typeof this._attachments[0];\r\n }\r\n\r\n public get viewAttachmentProps(): Array<Readonly<ViewAttachmentProps>> {\r\n return this.isLoaded ? this._props : [];\r\n }\r\n\r\n private get _props(): ViewAttachmentInfo[] {\r\n assert(this.isLoaded);\r\n return this._attachments as ViewAttachmentInfo[];\r\n }\r\n\r\n private get _ids(): Id64Array {\r\n assert(!this.isLoaded);\r\n return this._attachments as Id64Array;\r\n }\r\n\r\n public static fromJSON(ids: Id64Array = []): ViewAttachmentsInfo {\r\n return new ViewAttachmentsInfo(ids);\r\n }\r\n\r\n public toJSON(): Id64Array {\r\n return this.isLoaded ? this._props.map((x) => x.id!) : [...this._ids];\r\n }\r\n\r\n public clone(): ViewAttachmentsInfo {\r\n // No reason to clone the array.\r\n return new ViewAttachmentsInfo(this._attachments);\r\n }\r\n\r\n public preload(options: HydrateViewStateRequestProps) {\r\n if (this.isLoaded)\r\n return;\r\n options.sheetViewAttachmentIds = CompressedId64Set.sortAndCompress(this._ids);\r\n options.viewStateLoadProps = {\r\n displayStyle: {\r\n omitScheduleScriptElementIds: !IModelApp.tileAdmin.enableFrontendScheduleScripts,\r\n compressExcludedElementIds: true,\r\n },\r\n };\r\n }\r\n\r\n public async postload(options: HydrateViewStateResponseProps, iModel: IModelConnection) {\r\n if (options.sheetViewViews === undefined)\r\n return;\r\n if (options.sheetViewAttachmentProps === undefined)\r\n return;\r\n\r\n const viewStateProps = options.sheetViewViews; // This is viewstateProps, need to turn this into ViewState\r\n const promises = [];\r\n for (const viewProps of viewStateProps) {\r\n const loadView = async () => {\r\n try {\r\n if (viewProps === undefined)\r\n return undefined;\r\n const view = await iModel.views.convertViewStatePropsToViewState(viewProps);\r\n return view;\r\n } catch {\r\n return undefined;\r\n }\r\n };\r\n promises.push(loadView());\r\n }\r\n const views = await Promise.all(promises);\r\n\r\n const attachmentProps = options.sheetViewAttachmentProps as ViewAttachmentInfo[];\r\n assert (views.length === attachmentProps.length);\r\n const attachments = [];\r\n for (let i = 0; i < views.length; i++) {\r\n const view = views[i];\r\n if (view && !(view instanceof SheetViewState)) {\r\n const props = attachmentProps[i];\r\n props.attachedView = view;\r\n attachments.push(props);\r\n }\r\n }\r\n\r\n this._attachments = attachments;\r\n }\r\n\r\n public async load(iModel: IModelConnection): Promise<void> {\r\n if (this.isLoaded)\r\n return;\r\n\r\n const attachmentProps = await iModel.elements.getProps(this._ids) as ViewAttachmentInfo[];\r\n const promises = [];\r\n for (const attachment of attachmentProps) {\r\n const loadView = async () => {\r\n try {\r\n const view = await iModel.views.load(attachment.view.id);\r\n return view;\r\n } catch {\r\n return undefined;\r\n }\r\n };\r\n\r\n promises.push(loadView());\r\n }\r\n\r\n const views = await Promise.all(promises);\r\n assert(views.length === attachmentProps.length);\r\n\r\n const attachments = [];\r\n for (let i = 0; i < views.length; i++) {\r\n const view = views[i];\r\n if (view && !(view instanceof SheetViewState)) {\r\n const props = attachmentProps[i];\r\n props.attachedView = view;\r\n attachments.push(props);\r\n }\r\n }\r\n\r\n this._attachments = attachments;\r\n }\r\n\r\n public createAttachments(sheetView: SheetViewState): ViewAttachments | undefined {\r\n return this.isLoaded ? new ViewAttachments(this._props, sheetView) : undefined;\r\n }\r\n}\r\n\r\n/** The set of view attachments to be displayed in a Viewport via a SheetViewState. Allocated when the view becomes attached to a Viewport;\r\n * disposed of when it becomes detached from the viewport.\r\n */\r\nclass ViewAttachments {\r\n private readonly _attachments: Attachment[] = [];\r\n public maxDepth = Frustum2d.minimumZDistance;\r\n\r\n public constructor(infos: ViewAttachmentInfo[], sheetView: SheetViewState) {\r\n for (const info of infos) {\r\n const drawAsRaster = info.jsonProperties?.displayOptions?.drawAsRaster || (info.attachedView.is3d() && info.attachedView.isCameraOn);\r\n const ctor = drawAsRaster ? RasterAttachment : OrthographicAttachment;\r\n const attachment = new ctor(info.attachedView, info, sheetView);\r\n this._attachments.push(attachment);\r\n this.maxDepth = Math.max(this.maxDepth, attachment.zDepth);\r\n }\r\n }\r\n\r\n public dispose(): void {\r\n for (const attachment of this._attachments)\r\n attachment.dispose();\r\n\r\n this._attachments.length = 0;\r\n }\r\n\r\n public [Symbol.iterator](): Iterator<Attachment> {\r\n return this._attachments[Symbol.iterator]();\r\n }\r\n\r\n /** For tests. */\r\n public get attachments(): Object[] {\r\n return this._attachments;\r\n }\r\n\r\n public get isEmpty(): boolean {\r\n return 0 === this._attachments.length;\r\n }\r\n\r\n public get areAllTileTreesLoaded(): boolean {\r\n return this._attachments.every((x) => x.areAllTileTreesLoaded);\r\n }\r\n\r\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\r\n for (const attachment of this._attachments)\r\n trees.disclose(attachment);\r\n }\r\n\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n for (const attachment of this._attachments)\r\n attachment.collectStatistics(stats);\r\n }\r\n\r\n public addToScene(context: SceneContext): void {\r\n for (const attachment of this._attachments)\r\n attachment.addToScene(context);\r\n }\r\n}\r\n\r\n/** A view of a [SheetModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SheetViewState extends ViewState2d {\r\n /** The width and height of the sheet in world coordinates. */\r\n public readonly sheetSize: Point2d;\r\n private _attachmentsInfo: ViewAttachmentsInfo;\r\n private _attachments?: ViewAttachments;\r\n private readonly _viewedExtents: AxisAlignedBox3d;\r\n\r\n public get attachmentIds(): Id64Array {\r\n return this._attachmentsInfo.toJSON();\r\n }\r\n\r\n /** @internal */\r\n public static override get className() { return \"SheetViewDefinition\"; }\r\n\r\n public static override createFromProps(viewStateData: ViewStateProps, iModel: IModelConnection): SheetViewState {\r\n const cat = new CategorySelectorState(viewStateData.categorySelectorProps, iModel);\r\n const displayStyleState = new DisplayStyle2dState(viewStateData.displayStyleProps, iModel);\r\n\r\n // use \"new this\" so subclasses are correct\r\n return new this(viewStateData.viewDefinitionProps as ViewDefinition2dProps, iModel, cat, displayStyleState, viewStateData.sheetProps!, viewStateData.sheetAttachments!);\r\n }\r\n\r\n public override toProps(): ViewStateProps {\r\n const props = super.toProps();\r\n\r\n props.sheetAttachments = this._attachmentsInfo.toJSON();\r\n\r\n // For sheetProps all that is actually used is the size, so just null out everything else.\r\n const codeProps = { spec: \"\", scope: \"\", value: \"\" };\r\n props.sheetProps = {\r\n model: \"\",\r\n code: codeProps,\r\n classFullName: \"\",\r\n width: this.sheetSize.x,\r\n height: this.sheetSize.y,\r\n scale: 1,\r\n };\r\n\r\n return props;\r\n }\r\n\r\n /** Strictly for testing. @internal */\r\n public get viewAttachmentProps(): Array<Readonly<ViewAttachmentProps>> {\r\n return this._attachmentsInfo.viewAttachmentProps;\r\n }\r\n\r\n /** Strictly for testing. @internal */\r\n public get attachments(): Object[] | undefined {\r\n return this._attachments?.attachments;\r\n }\r\n\r\n /** @internal */\r\n public override isDrawingView(): this is DrawingViewState { return false; }\r\n /** @internal */\r\n public override isSheetView(): this is SheetViewState { return true; }\r\n\r\n public constructor(props: ViewDefinition2dProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle2dState, sheetProps: SheetProps, attachments: Id64Array) {\r\n super(props, iModel, categories, displayStyle);\r\n if (categories instanceof SheetViewState) {\r\n // we are coming from clone...\r\n this.sheetSize = categories.sheetSize.clone();\r\n this._attachmentsInfo = categories._attachmentsInfo.clone();\r\n this._viewedExtents = categories._viewedExtents.clone();\r\n } else {\r\n this.sheetSize = Point2d.create(sheetProps.width, sheetProps.height);\r\n this._attachmentsInfo = ViewAttachmentsInfo.fromJSON(attachments);\r\n\r\n const extents = new Range3d(0, 0, 0, this.sheetSize.x, this.sheetSize.y, 0);\r\n const margin = 1.1;\r\n extents.scaleAboutCenterInPlace(margin);\r\n this._viewedExtents = extents;\r\n }\r\n }\r\n\r\n public override getOrigin() {\r\n const origin = super.getOrigin();\r\n if (this._attachments)\r\n origin.z = -this._attachments.maxDepth;\r\n\r\n return origin;\r\n }\r\n\r\n public override getExtents() {\r\n const extents = super.getExtents();\r\n if (this._attachments)\r\n extents.z = this._attachments.maxDepth + Frustum2d.minimumZDistance;\r\n\r\n return extents;\r\n }\r\n\r\n /** Disclose *all* TileTrees currently in use by this view. This set may include trees not reported by [[forEachTileTreeRef]] - e.g., those used by view attachments, map-draped terrain, etc.\r\n * @internal override\r\n */\r\n public override discloseTileTrees(trees: DisclosedTileTreeSet): void {\r\n super.discloseTileTrees(trees);\r\n if (this._attachments)\r\n trees.disclose(this._attachments);\r\n }\r\n\r\n /** @internal */\r\n public override collectNonTileTreeStatistics(stats: RenderMemory.Statistics): void {\r\n super.collectNonTileTreeStatistics(stats);\r\n if (this._attachments)\r\n this._attachments.collectStatistics(stats);\r\n }\r\n\r\n /** @internal */\r\n public override get defaultExtentLimits() {\r\n return { min: Constant.oneMillimeter, max: this.sheetSize.magnitude() * 10 };\r\n }\r\n\r\n /** @internal */\r\n public override getViewedExtents(): AxisAlignedBox3d {\r\n return this._viewedExtents;\r\n }\r\n\r\n /** @internal */\r\n protected override preload(hydrateRequest: HydrateViewStateRequestProps): void {\r\n super.preload(hydrateRequest);\r\n this._attachmentsInfo.preload(hydrateRequest);\r\n }\r\n\r\n /** @internal */\r\n protected override async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\r\n const promises = [];\r\n promises.push(super.postload(hydrateResponse));\r\n promises.push(this._attachmentsInfo.postload(hydrateResponse, this.iModel));\r\n await Promise.all(promises);\r\n }\r\n\r\n /** @internal */\r\n public override createScene(context: SceneContext): void {\r\n super.createScene(context);\r\n if (this._attachments)\r\n this._attachments.addToScene(context);\r\n }\r\n\r\n /** @internal */\r\n public override get secondaryViewports(): Iterable<Viewport> {\r\n const attachments = this._attachments;\r\n if (!attachments)\r\n return super.secondaryViewports;\r\n\r\n function* iterator() {\r\n for (const attachment of attachments!) {\r\n const vp = attachment.viewport;\r\n if (vp)\r\n yield vp;\r\n }\r\n }\r\n\r\n return {\r\n [Symbol.iterator]: () => iterator(),\r\n };\r\n }\r\n\r\n /** @internal */\r\n private async queryAttachmentIds(): Promise<Id64Array> {\r\n const ecsql = `SELECT ECInstanceId as attachmentId FROM bis.ViewAttachment WHERE model.Id=${this.baseModelId}`;\r\n const ids: string[] = [];\r\n for await (const row of this.iModel.query(ecsql))\r\n ids.push(row[0]);\r\n\r\n return ids;\r\n }\r\n\r\n /** @internal */\r\n public override async changeViewedModel(modelId: Id64String): Promise<void> {\r\n await super.changeViewedModel(modelId);\r\n const attachmentIds = await this.queryAttachmentIds();\r\n this._attachmentsInfo = ViewAttachmentsInfo.fromJSON(attachmentIds);\r\n\r\n assert(undefined === this._attachments);\r\n }\r\n\r\n /** @internal */\r\n public override attachToViewport(args: AttachToViewportArgs): void {\r\n super.attachToViewport(args);\r\n assert(undefined === this._attachments);\r\n this._attachments = this._attachmentsInfo.createAttachments(this);\r\n }\r\n\r\n /** @internal */\r\n public override detachFromViewport(): void {\r\n super.detachFromViewport();\r\n this._attachments = dispose(this._attachments);\r\n }\r\n\r\n /** @internal */\r\n public override get areAllTileTreesLoaded(): boolean {\r\n return super.areAllTileTreesLoaded && (!this._attachments || this._attachments.areAllTileTreesLoaded);\r\n }\r\n\r\n /** Create a sheet border decoration graphic. */\r\n private createBorder(width: number, height: number, context: DecorateContext): RenderGraphic {\r\n const border = SheetBorder.create(width, height, context);\r\n const builder = context.createGraphicBuilder(GraphicType.ViewBackground);\r\n border.addToBuilder(builder);\r\n return builder.finish();\r\n }\r\n\r\n /** @internal */\r\n public override decorate(context: DecorateContext): void {\r\n super.decorate(context);\r\n if (this.sheetSize !== undefined) {\r\n const border = this.createBorder(this.sheetSize.x, this.sheetSize.y, context);\r\n context.setViewBackground(border);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public override computeFitRange(): Range3d {\r\n const size = this.sheetSize;\r\n if (0 >= size.x || 0 >= size.y)\r\n return super.computeFitRange();\r\n return new Range3d(0, 0, -1, size.x, size.y, 1);\r\n }\r\n}\r\n\r\n/** A mostly no-op RenderTarget for an Attachment.\r\n * its Scene and symbology overrides.\r\n */\r\nclass AttachmentTarget extends MockRender.OffScreenTarget {\r\n private readonly _attachment: OrthographicAttachment;\r\n\r\n public constructor(attachment: OrthographicAttachment) {\r\n // The dimensions don't matter - we're not drawing anything.\r\n const rect = new ViewRect(1, 1);\r\n super(IModelApp.renderSystem, rect);\r\n this._attachment = attachment;\r\n }\r\n\r\n public override changeScene(scene: Scene): void {\r\n this._attachment.scene = scene;\r\n }\r\n\r\n public override overrideFeatureSymbology(ovrs: FeatureSymbology.Overrides): void {\r\n this._attachment.symbologyOverrides = ovrs;\r\n }\r\n}\r\n\r\n/** Draws the contents of a view attachment into a sheet view. */\r\ninterface Attachment {\r\n readonly areAllTileTreesLoaded: boolean;\r\n addToScene: (context: SceneContext) => void;\r\n discloseTileTrees: (trees: DisclosedTileTreeSet) => void;\r\n readonly zDepth: number;\r\n collectStatistics: (stats: RenderMemory.Statistics) => void;\r\n viewAttachmentProps: ViewAttachmentProps;\r\n dispose(): void;\r\n readonly viewport?: Viewport;\r\n}\r\n\r\n/** Draws the contents a 2d or orthographic 3d view directly into a sheet view.\r\n * We select tiles for the view in the context of a light-weight offscreen viewport with a no-op RenderTarget, then\r\n * collect the resultant graphics and add them to the sheet view's scene.\r\n */\r\nclass OrthographicAttachment {\r\n private readonly _viewport: OffScreenViewport;\r\n private readonly _props: ViewAttachmentProps;\r\n private readonly _sheetModelId: Id64String;\r\n private readonly _viewFlagOverrides: ViewFlagOverrides;\r\n private readonly _toSheet: Transform;\r\n private readonly _fromSheet: Transform;\r\n private readonly _sizeInMeters: Point2d;\r\n private readonly _range: Range3d;\r\n private readonly _viewRect = new ViewRect(0, 0, 1, 1);\r\n private readonly _originalFrustum = new Frustum();\r\n private readonly _clipVolume?: RenderClipVolume;\r\n private readonly _hiddenLineSettings?: HiddenLine.Settings;\r\n private readonly _scale: { x: number, y: number };\r\n private _debugFeatureTable?: PackedFeatureTable;\r\n public scene?: Scene;\r\n public symbologyOverrides: FeatureSymbology.Overrides;\r\n public readonly zDepth: number;\r\n\r\n public get view(): ViewState {\r\n return this._viewport.view;\r\n }\r\n\r\n public get viewAttachmentProps() {\r\n return this._props;\r\n }\r\n\r\n public get viewport(): Viewport {\r\n return this._viewport;\r\n }\r\n\r\n public constructor(view: ViewState, props: ViewAttachmentProps, sheetView: SheetViewState) {\r\n this.symbologyOverrides = new FeatureSymbology.Overrides(view);\r\n const target = new AttachmentTarget(this);\r\n this._viewport = OffScreenViewport.createViewport(view, target, true);\r\n\r\n this._props = props;\r\n this._sheetModelId = sheetView.baseModelId;\r\n\r\n const applyClip = true; // set to false for debugging\r\n this._viewFlagOverrides = {\r\n ...view.viewFlags,\r\n clipVolume: applyClip,\r\n lighting: false,\r\n shadows: false,\r\n };\r\n\r\n const placement = Placement2d.fromJSON(props.placement);\r\n const range = placement.calculateRange();\r\n this._range = range;\r\n this._sizeInMeters = new Point2d(range.xLength(), range.yLength());\r\n\r\n // Compute transform from attached view's world coordinates to sheet's world coordinates.\r\n // NB: We obtain the extents and origin from the *viewport* not the *view* - they may have been adjusted by the viewport.\r\n const applySkew = true; // set to false for debugging\r\n const skew = applySkew ? view.getAspectRatioSkew() : 1;\r\n const extents = this._viewport.viewingSpace.viewDelta.clone();\r\n const zDepth = Math.abs(extents.z);\r\n const scaleX = this._sizeInMeters.x / Math.abs(extents.x);\r\n const scaleY = skew * this._sizeInMeters.y / Math.abs(extents.y);\r\n this._scale = { x: 1 / scaleX, y: 1 / scaleY };\r\n\r\n const zBias = Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);\r\n this.zDepth = 1.01 * (zDepth - zBias); // give a little padding so that geometry right up against far plane doesn't get clipped.\r\n\r\n // View origin is at the *back* of the view. Align *front* of view based on display priority.\r\n const viewRot = view.getRotation();\r\n const viewOrg = viewRot.multiplyVector(this._viewport.viewingSpace.viewOrigin);\r\n viewOrg.z += zDepth;\r\n viewRot.multiplyTransposeVectorInPlace(viewOrg);\r\n\r\n const matrix = Matrix3d.createScale(scaleX, scaleY, 1);\r\n matrix.multiplyMatrixMatrix(viewRot, matrix);\r\n const origin = Matrix3d.xyzMinusMatrixTimesXYZ(viewOrg, matrix, viewOrg);\r\n const attachmentOrigin = Point3d.createFrom(placement.origin);\r\n attachmentOrigin.z = zBias;\r\n const viewOrgToAttachment = attachmentOrigin.minus(viewOrg);\r\n origin.addInPlace(viewOrgToAttachment);\r\n this._toSheet = Transform.createRefs(origin, matrix);\r\n this._fromSheet = this._toSheet.inverse()!;\r\n\r\n // If the attached view is a section drawing, it may itself have an attached spatial view with a clip.\r\n // The clip needs to be transformed into sheet space.\r\n if (view.isDrawingView())\r\n this._viewport.drawingToSheetTransform = this._toSheet;\r\n\r\n // ###TODO? If we also apply the attachment's clip to the attached view, we may get additional culling during tile selection.\r\n // However the attached view's frustum is already clipped by intersection with sheet view's frustum, and additional clipping planes\r\n // introduce additional computation, so possibly not worth it.\r\n\r\n // Transform the view's clip (if any) to sheet space\r\n let viewClip = view.viewFlags.clipVolume ? view.getViewClip()?.clone() : undefined;\r\n if (viewClip)\r\n viewClip.transformInPlace(this._toSheet);\r\n else\r\n viewClip = ClipVector.createEmpty();\r\n\r\n let sheetClip;\r\n if (undefined !== props.jsonProperties?.clip)\r\n sheetClip = ClipVector.fromJSON(props.jsonProperties?.clip);\r\n\r\n if (sheetClip && sheetClip.isValid) {\r\n // Clip to view attachment's clip. NB: clip is in sheet coordinate space.\r\n for (const clip of sheetClip.clips)\r\n viewClip.clips.push(clip);\r\n } else {\r\n // Clip to view attachment's bounding box\r\n viewClip.appendShape([\r\n Point3d.create(this._range.low.x, this._range.low.y),\r\n Point3d.create(this._range.high.x, this._range.low.y),\r\n Point3d.create(this._range.high.x, this._range.high.y),\r\n Point3d.create(this._range.low.x, this._range.high.y),\r\n ]);\r\n }\r\n\r\n this._clipVolume = IModelApp.renderSystem.createClipVolume(viewClip);\r\n\r\n // Save off the original frustum (potentially adjusted by viewport).\r\n this._viewport.setupFromView();\r\n this._viewport.viewingSpace.getFrustum(CoordSystem.World, true, this._originalFrustum);\r\n\r\n const applyHiddenLineSettings = true; // for debugging edge display, set to false...\r\n const style = view.displayStyle;\r\n if (style.is3d() && applyHiddenLineSettings)\r\n this._hiddenLineSettings = style.settings.hiddenLineSettings;\r\n }\r\n\r\n public dispose(): void {\r\n this._viewport.dispose();\r\n }\r\n\r\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\r\n trees.disclose(this._viewport);\r\n }\r\n\r\n public addToScene(context: SceneContext): void {\r\n if (context.viewport.freezeScene)\r\n return;\r\n\r\n if (!context.viewport.view.viewsCategory(this._props.category))\r\n return;\r\n\r\n const wantBounds = context.viewport.wantViewAttachmentBoundaries;\r\n const wantClipShapes = context.viewport.wantViewAttachmentClipShapes;\r\n if (wantBounds || wantClipShapes) {\r\n const builder = context.createSceneGraphicBuilder();\r\n if (wantBounds) {\r\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\r\n builder.addRangeBox(this._range);\r\n }\r\n\r\n if (wantClipShapes && this._clipVolume) {\r\n builder.setSymbology(ColorDef.blue, ColorDef.blue, 2);\r\n for (const prim of this._clipVolume.clipVector.clips) {\r\n if (!(prim instanceof ClipShape))\r\n continue; // ###TODO handle non-shape primitives, if any such ever encountered\r\n\r\n const pts = [];\r\n const tf = prim.transformFromClip;\r\n for (const pt of prim.polygon) {\r\n const tfPt = tf ? tf.multiplyPoint3d(pt) : pt;\r\n pts.push(new Point2d(tfPt.x, tfPt.y));\r\n }\r\n\r\n builder.addLineString2d(pts, 0);\r\n }\r\n }\r\n\r\n // Put into a Batch so that we can see tooltip with attachment Id on mouseover.\r\n const batch = context.target.renderSystem.createBatch(builder.finish(), this.getDebugFeatureTable(), this._range);\r\n context.outputGraphic(batch);\r\n }\r\n\r\n if (!context.viewport.wantViewAttachments)\r\n return;\r\n\r\n // Pixel size used to compute size of ViewRect so that tiles of appropriate LOD are selected.\r\n const pixelSize = context.viewport.getPixelSizeAtPoint();\r\n if (0 === pixelSize)\r\n return;\r\n\r\n // Adjust attached view frustum based on intersection with sheet view frustum.\r\n const attachFrustum = this._originalFrustum.transformBy(this._toSheet);\r\n const attachFrustumRange = attachFrustum.toRange();\r\n const sheetFrustum = context.viewport.getWorldFrustum();\r\n const sheetFrustumRange = sheetFrustum.toRange();\r\n const intersect = attachFrustumRange.intersect(sheetFrustumRange);\r\n if (intersect.isNull)\r\n return;\r\n\r\n attachFrustum.initFromRange(intersect);\r\n attachFrustum.transformBy(this._fromSheet, attachFrustum);\r\n this._viewport.setupViewFromFrustum(attachFrustum);\r\n\r\n // Adjust view rect based on size of attachment on screen so that tiles of appropriate LOD are selected.\r\n const width = this._sizeInMeters.x * intersect.xLength() / attachFrustumRange.xLength();\r\n const height = this._sizeInMeters.y * intersect.yLength() / attachFrustumRange.yLength();\r\n this._viewRect.width = Math.max(1, Math.round(width / pixelSize));\r\n this._viewRect.height = Math.max(1, Math.round(height / pixelSize));\r\n this._viewport.setRect(this._viewRect);\r\n\r\n // Propagate settings from on-screen viewport.\r\n this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;\r\n this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);\r\n\r\n // Create the scene.\r\n this._viewport.renderFrame();\r\n\r\n const scene = this.scene;\r\n if (!scene)\r\n return;\r\n\r\n // Extract scene graphics and insert into on-screen scene context.\r\n const options = {\r\n clipVolume: this._clipVolume,\r\n hline: this._hiddenLineSettings,\r\n frustum: {\r\n is3d: this.view.is3d(),\r\n scale: this._scale,\r\n },\r\n };\r\n\r\n const outputGraphics = (source: RenderGraphic[]) => {\r\n if (0 === source.length)\r\n return;\r\n\r\n const graphics = new GraphicBranch();\r\n graphics.setViewFlagOverrides(this._viewFlagOverrides);\r\n graphics.symbologyOverrides = this.symbologyOverrides;\r\n\r\n for (const graphic of source)\r\n graphics.entries.push(graphic);\r\n\r\n const branch = context.createGraphicBranch(graphics, this._toSheet, options);\r\n context.outputGraphic(branch);\r\n };\r\n\r\n outputGraphics(scene.foreground);\r\n context.withGraphicType(TileGraphicType.BackgroundMap, () => outputGraphics(scene.background));\r\n context.withGraphicType(TileGraphicType.Overlay, () => outputGraphics(scene.overlay));\r\n\r\n // Report tile statistics to sheet view's viewport.\r\n const tileAdmin = IModelApp.tileAdmin;\r\n const selectedAndReady = tileAdmin.getTilesForUser(this._viewport);\r\n const requested = tileAdmin.getRequestsForUser(this._viewport);\r\n tileAdmin.addExternalTilesForUser(context.viewport, {\r\n requested: requested?.size ?? 0,\r\n selected: selectedAndReady?.selected.size ?? 0,\r\n ready: selectedAndReady?.ready.size ?? 0,\r\n });\r\n }\r\n\r\n private getDebugFeatureTable(): PackedFeatureTable {\r\n if (this._debugFeatureTable)\r\n return this._debugFeatureTable;\r\n\r\n const featureTable = new FeatureTable(1, this._sheetModelId);\r\n featureTable.insert(new Feature(this._props.id));\r\n this._debugFeatureTable = PackedFeatureTable.pack(featureTable);\r\n return this._debugFeatureTable;\r\n }\r\n\r\n public get areAllTileTreesLoaded(): boolean {\r\n return this.view.areAllTileTreesLoaded;\r\n }\r\n\r\n public collectStatistics(_stats: RenderMemory.Statistics): void {\r\n // Handled by discloseTileTrees()\r\n }\r\n}\r\n\r\nfunction createRasterAttachmentViewport(_view: ViewState, _rect: ViewRect, _attachment: RasterAttachment): OffScreenViewport {\r\n class RasterAttachmentViewport extends OffScreenViewport {\r\n private _sceneContext?: SceneContext;\r\n private _isSceneReady = false;\r\n private readonly _attachment: RasterAttachment;\r\n\r\n public constructor(view: ViewState, rect: ViewRect, attachment: RasterAttachment) {\r\n super(IModelApp.renderSystem.createOffscreenTarget(rect));\r\n this._attachment = attachment;\r\n this._isAspectRatioLocked = true;\r\n this.changeView(view);\r\n }\r\n\r\n public override createSceneContext(): SceneContext {\r\n assert(!this._isSceneReady);\r\n\r\n this._sceneContext = super.createSceneContext();\r\n return this._sceneContext;\r\n }\r\n\r\n public override renderFrame(): void {\r\n assert(!this._isSceneReady);\r\n\r\n this.clearSceneContext();\r\n super.renderFrame();\r\n\r\n if (undefined !== this._sceneContext) {\r\n this._isSceneReady = !this._sceneContext.hasMissingTiles && this.view.areAllTileTreesLoaded;\r\n if (this._isSceneReady)\r\n this._attachment.produceGraphics(this._sceneContext);\r\n\r\n this._sceneContext = undefined;\r\n }\r\n }\r\n\r\n private clearSceneContext(): void {\r\n this._sceneContext = undefined;\r\n }\r\n\r\n public override addDecorations(_decorations: Decorations): void {\r\n // ###TODO: skybox, ground plane, possibly grid. DecorateContext requires a ScreenViewport...\r\n }\r\n }\r\n\r\n return new RasterAttachmentViewport(_view, _rect, _attachment);\r\n}\r\n\r\n/** Draws a 3d view with camera enabled into a sheet view by producing an image of the view's contents offscreen. */\r\nclass RasterAttachment {\r\n private readonly _props: ViewAttachmentProps;\r\n private readonly _placement: Placement2d;\r\n private readonly _transform: Transform;\r\n public readonly zDepth: number;\r\n private _viewport?: OffScreenViewport;\r\n private _graphics?: RenderGraphic;\r\n\r\n public constructor(view: ViewState, props: ViewAttachmentProps, sheetView: SheetViewState) {\r\n // Render to a 2048x2048 view rect. Scale in Y to preserve aspect ratio.\r\n const maxSize = 2048;\r\n const rect = new ViewRect(0, 0, maxSize, maxSize);\r\n const height = maxSize * view.getAspectRatio() * view.getAspectRatioSkew();\r\n const skew = maxSize / height;\r\n view.setAspectRatioSkew(skew);\r\n\r\n if (true !== props.jsonProperties?.displayOptions?.preserveBackground) {\r\n // Make background color 100% transparent so that Viewport.readImageBuffer() will discard transparent pixels.\r\n const bgColor = sheetView.displayStyle.backgroundColor.withAlpha(0);\r\n view.displayStyle.backgroundColor = bgColor;\r\n }\r\n\r\n this._viewport = createRasterAttachmentViewport(view, rect, this);\r\n this._props = props;\r\n this._placement = Placement2d.fromJSON(props.placement);\r\n this._transform = this._placement.transform;\r\n this.zDepth = Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);\r\n }\r\n\r\n public dispose(): void {\r\n this._viewport?.dispose();\r\n }\r\n\r\n public get viewAttachmentProps() {\r\n return this._props;\r\n }\r\n\r\n public get viewport(): Viewport | undefined {\r\n return this._viewport;\r\n }\r\n\r\n public get areAllTileTreesLoaded() {\r\n return this._viewport?.areAllTileTreesLoaded ?? true;\r\n }\r\n\r\n public addToScene(context: SceneContext): void {\r\n // ###TODO: check viewport.wantViewAttachmentClipShapes\r\n if (!context.viewport.view.viewsCategory(this._props.category))\r\n return;\r\n\r\n if (context.viewport.wantViewAttachmentBoundaries) {\r\n const builder = context.createSceneGraphicBuilder(this._transform);\r\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\r\n builder.addRangeBox(Range3d.createRange2d(this._placement.bbox));\r\n context.outputGraphic(builder.finish());\r\n }\r\n\r\n if (!context.viewport.wantViewAttachments)\r\n return;\r\n\r\n if (this._graphics) {\r\n context.outputGraphic(this._graphics);\r\n return;\r\n }\r\n\r\n if (undefined === this._viewport)\r\n return;\r\n\r\n this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;\r\n this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);\r\n\r\n this._viewport.renderFrame();\r\n if (this._graphics)\r\n context.outputGraphic(this._graphics);\r\n }\r\n\r\n public discloseTileTrees(trees: DisclosedTileTreeSet) {\r\n if (this._viewport)\r\n trees.disclose(this._viewport);\r\n }\r\n\r\n public produceGraphics(context: SceneContext): void {\r\n assert(context.viewport === this._viewport);\r\n this._graphics = this.createGraphics(this._viewport);\r\n this._viewport = dispose(this._viewport);\r\n\r\n if (undefined !== this._graphics)\r\n context.outputGraphic(this._graphics);\r\n }\r\n\r\n private createGraphics(vp: Viewport): RenderGraphic | undefined {\r\n // Create a texture from the contents of the view.\r\n const image = vp.readImageBuffer({ upsideDown: true });\r\n if (undefined === image)\r\n return undefined;\r\n\r\n const debugImage = false; // set to true to open a window displaying the captured image.\r\n if (debugImage) {\r\n const url = imageBufferToPngDataUrl(image, false);\r\n if (url)\r\n openImageDataUrlInNewWindow(url, \"Attachment\");\r\n }\r\n\r\n const texture = IModelApp.renderSystem.createTexture({\r\n image: { source: image, transparency: TextureTransparency.Opaque },\r\n });\r\n if (!texture)\r\n return undefined;\r\n\r\n // Create a material for the texture\r\n const graphicParams = new GraphicParams();\r\n graphicParams.material = IModelApp.renderSystem.createRenderMaterial({ textureMapping: { texture } });\r\n\r\n // Apply the texture to a rectangular polyface.\r\n const depth = this.zDepth;\r\n const east = this._placement.bbox.low.x;\r\n const west = this._placement.bbox.high.x;\r\n const north = this._placement.bbox.low.y;\r\n const south = this._placement.bbox.high.y;\r\n const corners = [\r\n Point3d.create(east, north, depth),\r\n Point3d.create(west, north, depth),\r\n Point3d.create(west, south, depth),\r\n Point3d.create(east, south, depth),\r\n ];\r\n const params = [\r\n Point2d.create(0, 0),\r\n Point2d.create(1, 0),\r\n Point2d.create(1, 1),\r\n Point2d.create(0, 1),\r\n ];\r\n\r\n const strokeOptions = new StrokeOptions();\r\n strokeOptions.needParams = strokeOptions.shouldTriangulate = true;\r\n const polyfaceBuilder = PolyfaceBuilder.create(strokeOptions);\r\n polyfaceBuilder.addQuadFacet(corners, params);\r\n const polyface = polyfaceBuilder.claimPolyface();\r\n\r\n const graphicBuilder = IModelApp.renderSystem.createGraphicBuilder(Transform.createIdentity(), GraphicType.Scene, vp, this._props.id);\r\n graphicBuilder.activateGraphicParams(graphicParams);\r\n graphicBuilder.addPolyface(polyface, false);\r\n const graphic = graphicBuilder.finish();\r\n\r\n // Wrap the polyface in a GraphicBranch.\r\n const branch = new GraphicBranch(true);\r\n const vfOvrs = createDefaultViewFlagOverrides({ clipVolume: true, shadows: false, lighting: false, thematic: false });\r\n\r\n // Disable transparency - background pixels are 100% transparent so they will be discarded anyway. Other pixels are 100% opaque.\r\n vfOvrs.transparency = false;\r\n branch.setViewFlagOverrides(vfOvrs);\r\n branch.symbologyOverrides = new FeatureSymbology.Overrides();\r\n branch.entries.push(graphic);\r\n\r\n // Apply the attachment's clip, if any.\r\n let clipVolume;\r\n if (this._props.jsonProperties?.clip) {\r\n const clipVector = ClipVector.fromJSON(this._props.jsonProperties?.clip);\r\n if (clipVector.isValid)\r\n clipVolume = IModelApp.renderSystem.createClipVolume(clipVector);\r\n }\r\n\r\n return IModelApp.renderSystem.createGraphicBranch(branch, this._transform, { clipVolume });\r\n }\r\n\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n if (this._graphics)\r\n this._graphics.collectStatistics(stats);\r\n }\r\n}\r\n"]}
|
|
@@ -227,7 +227,7 @@ class TentativePoint {
|
|
|
227
227
|
if (currTool && currTool instanceof ViewTool_1.ViewManip && currTool.viewHandles.hasHandle(ViewTool_1.ViewHandleType.TargetCenter))
|
|
228
228
|
currTool.updateTargetCenter(); // Change target center to tentative location...
|
|
229
229
|
else
|
|
230
|
-
IModelApp_1.IModelApp.toolAdmin.updateDynamics(); // Don't wait for motion to update
|
|
230
|
+
IModelApp_1.IModelApp.toolAdmin.updateDynamics(undefined, undefined, true); // Don't wait for motion to update dynamics...
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
233
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TentativePoint.js","sourceRoot":"","sources":["../../src/TentativePoint.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAA+C;A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Q,YAAY,oBAAS,IAAI,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,yBAAc,CAAC,YAAY,CAAC;oBAC1G,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC,gDAAgD;;oBAE/E,qBAAS,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,mDAAmD;aAC5F;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAjPD,wCAiPC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module LocatingElements\r\n */\r\n\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\nimport { AccuSnap } from \"./AccuSnap\";\r\nimport { HitListHolder } from \"./ElementLocateManager\";\r\nimport { HitDetail, HitList, HitPriority, HitSource, SnapDetail, SnapHeat, SnapMode } from \"./HitDetail\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { BeButton, BeButtonEvent } from \"./tools/Tool\";\r\nimport { ViewHandleType, ViewManip } from \"./tools/ViewTool\";\r\nimport { DecorateContext } from \"./ViewContext\";\r\nimport { ScreenViewport } from \"./Viewport\";\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport class TentativePoint {\r\n public isActive = false;\r\n public currSnap?: SnapDetail;\r\n public tpHits?: HitList<HitDetail>;\r\n private get _hotDistanceInches(): number { return 0.21; }\r\n private readonly _point: Point3d = new Point3d();\r\n private readonly _rawPoint: Point3d = new Point3d();\r\n private readonly _viewPoint: Point3d = new Point3d();\r\n private _tentativePromise?: Promise<SnapDetail | undefined>;\r\n public viewport?: ScreenViewport;\r\n\r\n public onInitialized() { }\r\n public setHitList(list?: HitList<HitDetail>) { this.tpHits = list; }\r\n\r\n /** @return true if the tentative point is currently active and snapped to an element. */\r\n public get isSnapped(): boolean { return undefined !== this.currSnap; }\r\n\r\n /** @return The current snap path when TentativePoint.isSnapped or undefined. */\r\n public getCurrSnap(): SnapDetail | undefined { return this.currSnap; }\r\n\r\n public getPoint(): Point3d {\r\n const snap = this.currSnap;\r\n return !snap ? this._point : snap.adjustedPoint;\r\n }\r\n\r\n public setPoint(point: Point3d): void {\r\n this.setCurrSnap(undefined);\r\n this.tpHits = undefined;\r\n this._point.setFrom(point);\r\n }\r\n\r\n public clear(doErase: boolean): void {\r\n if (doErase) {\r\n this.removeTentative();\r\n IModelApp.accuSnap.synchSnapMode();\r\n }\r\n IModelApp.accuSnap.destroy();\r\n this.isActive = false;\r\n this.setCurrSnap(undefined);\r\n this.tpHits = undefined;\r\n }\r\n\r\n public removeTentative(): void {\r\n this._tentativePromise = undefined;\r\n if (!this.isActive)\r\n return;\r\n IModelApp.accuSnap.erase();\r\n if (this.getCurrSnap())\r\n IModelApp.viewManager.invalidateDecorationsAllViews();\r\n else\r\n this.viewport!.invalidateDecorations();\r\n this.isActive = false;\r\n }\r\n\r\n public setCurrSnap(newSnap?: SnapDetail): void {\r\n if (newSnap)\r\n newSnap.setSnapPoint(newSnap.snapPoint, SnapHeat.InRange); // Reset adjustedPoint from pre-located snap and set SnapHeat...\r\n this.currSnap = newSnap;\r\n }\r\n\r\n public showTentative(): void {\r\n if (this.isSnapped) {\r\n IModelApp.viewManager.invalidateDecorationsAllViews();\r\n IModelApp.accuSnap.displayToolTip(this._viewPoint, this.viewport!, undefined); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n } else {\r\n this.viewport!.invalidateDecorations();\r\n }\r\n this.isActive = true;\r\n }\r\n\r\n public getHitAndList(holder: HitListHolder): SnapDetail | undefined {\r\n const hit = this.currSnap;\r\n if (hit) {\r\n holder.setHitList(this.tpHits);\r\n this.tpHits = undefined;\r\n }\r\n return hit;\r\n }\r\n\r\n public onButtonEvent(ev: BeButtonEvent): void {\r\n switch (ev.button) {\r\n case BeButton.Data:\r\n if (!ev.isDown)\r\n return; // cleared on down...\r\n break;\r\n case BeButton.Reset:\r\n if (ev.isDown)\r\n return; // cleared on up...\r\n break;\r\n case BeButton.Middle:\r\n return;\r\n }\r\n\r\n this.removeTentative();\r\n IModelApp.accuSnap.synchSnapMode();\r\n this.setCurrSnap(undefined);\r\n this.tpHits = undefined;\r\n }\r\n\r\n public decorate(context: DecorateContext): void {\r\n const viewport = context.viewport;\r\n if (!this.isActive || !viewport)\r\n return;\r\n\r\n const tpSize = Math.floor(viewport.pixelsPerInch * 0.4) + 0.5;\r\n const toSizeOutline = tpSize + 1;\r\n const position = context.viewport.worldToView(this._point); position.x = Math.floor(position.x) + 0.5; position.y = Math.floor(position.y) + 0.5;\r\n const drawDecoration = (ctx: CanvasRenderingContext2D) => {\r\n ctx.beginPath();\r\n ctx.strokeStyle = \"rgba(0,0,0,.5)\";\r\n ctx.lineWidth = 3;\r\n ctx.moveTo(-toSizeOutline, 0);\r\n ctx.lineTo(toSizeOutline, 0);\r\n ctx.moveTo(0, -toSizeOutline);\r\n ctx.lineTo(0, toSizeOutline);\r\n ctx.stroke();\r\n\r\n ctx.beginPath();\r\n ctx.strokeStyle = \"white\";\r\n ctx.lineWidth = 1;\r\n if (!this.isSnapped) ctx.setLineDash([4, 1]);\r\n ctx.shadowColor = \"black\";\r\n ctx.shadowBlur = 5;\r\n ctx.moveTo(-tpSize, 0);\r\n ctx.lineTo(tpSize, 0);\r\n ctx.moveTo(0, -tpSize);\r\n ctx.lineTo(0, tpSize);\r\n ctx.stroke();\r\n };\r\n context.addCanvasDecoration({ position, drawDecoration });\r\n }\r\n\r\n private async getSnap(newSearch: boolean): Promise<SnapDetail | undefined> {\r\n // Use next hit from previous search when using tentative to cycle through hits...\r\n let thisHit = (!newSearch && undefined !== this.tpHits ? this.tpHits.getNextHit() : undefined);\r\n\r\n // Use existing AccuSnap hit list if one exists...\r\n if (undefined === thisHit) {\r\n this.tpHits = undefined;\r\n thisHit = IModelApp.accuSnap.getHitAndList(this);\r\n }\r\n\r\n if (undefined === thisHit) {\r\n // search for elements around the current raw point (search should not be affected by locks!)\r\n const aperture = (2.0 * this.viewport!.pixelsFromInches(IModelApp.locateManager.apertureInches) / 2.0) + 1.5;\r\n const options = IModelApp.locateManager.options.clone(); // Copy to avoid changing out from under active Tool...\r\n const picker = IModelApp.locateManager.picker;\r\n\r\n options.hitSource = HitSource.TentativeSnap;\r\n if (0 === picker.doPick(this.viewport!, this._rawPoint, aperture, options))\r\n return undefined;\r\n\r\n this.tpHits = picker.getHitList(true);\r\n thisHit = (undefined !== this.tpHits ? this.tpHits.getNextHit() : undefined);\r\n } else if (thisHit instanceof SnapDetail) {\r\n // Make the current AccuSnap the TentativePoint snap...\r\n return thisHit;\r\n }\r\n\r\n if (undefined === thisHit)\r\n return undefined;\r\n\r\n const snapModes = IModelApp.accuSnap.getActiveSnapModes(); // Get the list of point snap modes to consider\r\n if (1 === snapModes.length && SnapMode.Intersection === snapModes[0])\r\n snapModes.push(SnapMode.Nearest); // Add nearest when doing intersection by itself to support finding extended intersections...\r\n\r\n const thisSnap = await AccuSnap.requestSnap(thisHit, snapModes, this._hotDistanceInches, IModelApp.accuSnap.keypointDivisor, this.tpHits);\r\n\r\n if (undefined !== thisSnap)\r\n IModelApp.accuDraw.onSnap(thisSnap); // AccuDraw can adjust nearest snap to intersection of circle (polar distance lock) or line (axis lock) with snapped to curve...\r\n\r\n return thisSnap;\r\n }\r\n\r\n private static arePointsCloseEnough(pt1: Point3d, pt2: Point3d, pixelDistance: number): boolean { return pt1.distance(pt2) < (pixelDistance + 1.5); }\r\n\r\n public process(ev: BeButtonEvent): void {\r\n if (undefined !== this._tentativePromise)\r\n return;\r\n\r\n const currTool = IModelApp.toolAdmin.viewTool;\r\n if (currTool && currTool.inDynamicUpdate)\r\n return; // trying to tentative snap while view is changing isn't useful...\r\n\r\n const wasActive = this.isActive;\r\n this.removeTentative(); // remove the TP cross if it is already on the screen\r\n const lastPtView = this._viewPoint.clone();\r\n\r\n this.viewport = ev.viewport!;\r\n this._point.setFrom(ev.point);\r\n this._rawPoint.setFrom(ev.rawPoint);\r\n this._viewPoint.setFrom(ev.viewPoint);\r\n\r\n const newSearch = (!this.isSnapped || !TentativePoint.arePointsCloseEnough(lastPtView, this._viewPoint, this.viewport.pixelsFromInches(IModelApp.locateManager.apertureInches)));\r\n const promise = this.getSnap(newSearch);\r\n this._tentativePromise = promise;\r\n\r\n promise.then((newSnap) => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n // Ignore response if we're no longer interested in this tentative.\r\n if (this._tentativePromise === promise) {\r\n this._tentativePromise = undefined;\r\n this.setCurrSnap(newSnap); // Adopt the snap as current\r\n IModelApp.accuSnap.clear(); // make sure there's no AccuSnap active after a tentative point (otherwise we continually snap to it).\r\n if (this.isSnapped)\r\n this._point.setFrom(this.currSnap!.snapPoint);\r\n else if (wasActive && newSearch)\r\n this._point.setFrom(ev.rawPoint);\r\n this.showTentative(); // show the TP cross\r\n\r\n if (this.isSnapped) {\r\n IModelApp.toolAdmin.adjustSnapPoint();\r\n } else if (IModelApp.accuDraw.isActive) {\r\n const point = this.getPoint().clone();\r\n const vp = ev.viewport!;\r\n if (vp.isSnapAdjustmentRequired) {\r\n IModelApp.toolAdmin.adjustPointToACS(point, vp, false);\r\n const hit = new HitDetail(point, vp, HitSource.TentativeSnap, point, \"\", HitPriority.Unknown, 0, 0);\r\n const snap = new SnapDetail(hit);\r\n this.setCurrSnap(snap);\r\n IModelApp.toolAdmin.adjustSnapPoint();\r\n this.setPoint(this.getPoint());\r\n } else {\r\n IModelApp.accuDraw.adjustPoint(point, vp, false);\r\n const savePoint = point.clone();\r\n IModelApp.toolAdmin.adjustPointToGrid(point, vp);\r\n if (!point.isExactEqual(savePoint))\r\n IModelApp.accuDraw.adjustPoint(point, vp, false);\r\n this.setPoint(point);\r\n }\r\n } else {\r\n IModelApp.toolAdmin.adjustPoint(this.getPoint(), ev.viewport!);\r\n }\r\n\r\n IModelApp.accuDraw.onTentative();\r\n if (currTool && currTool instanceof ViewManip && currTool.viewHandles.hasHandle(ViewHandleType.TargetCenter))\r\n currTool.updateTargetCenter(); // Change target center to tentative location...\r\n else\r\n IModelApp.toolAdmin.updateDynamics(); // Don't wait for motion to update tool dynamics...\r\n }\r\n });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TentativePoint.js","sourceRoot":"","sources":["../../src/TentativePoint.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAA+C;AAC/C,yCAAsC;AAEtC,2CAAyG;AACzG,2CAAwC;AACxC,uCAAuD;AACvD,+CAA6D;AAI7D;;;GAGG;AACH,MAAa,cAAc;IAA3B;QACS,aAAQ,GAAG,KAAK,CAAC;QAIP,WAAM,GAAY,IAAI,uBAAO,EAAE,CAAC;QAChC,cAAS,GAAY,IAAI,uBAAO,EAAE,CAAC;QACnC,eAAU,GAAY,IAAI,uBAAO,EAAE,CAAC;IA0OvD,CAAC;IA7OC,IAAY,kBAAkB,KAAa,OAAO,IAAI,CAAC,CAAC,CAAC;IAOlD,aAAa,KAAK,CAAC;IACnB,UAAU,CAAC,IAAyB,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAEpE,yFAAyF;IACzF,IAAW,SAAS,KAAc,OAAO,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEvE,gFAAgF;IACzE,WAAW,KAA6B,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/D,QAAQ;QACb,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;IAClD,CAAC;IAEM,QAAQ,CAAC,KAAc;QAC5B,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,OAAO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K,CAAC,CAAC;wBACnD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;qBACtB;iBACF;qBAAM;oBACL,qBAAS,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAS,CAAC,CAAC;iBAChE;gBAED,qBAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;gBACjC,IAAI,QAAQ,IAAI,QAAQ,YAAY,oBAAS,IAAI,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,yBAAc,CAAC,YAAY,CAAC;oBAC1G,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC,gDAAgD;;oBAE/E,qBAAS,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,8CAA8C;aACjH;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAjPD,wCAiPC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module LocatingElements\r\n */\r\n\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\nimport { AccuSnap } from \"./AccuSnap\";\r\nimport { HitListHolder } from \"./ElementLocateManager\";\r\nimport { HitDetail, HitList, HitPriority, HitSource, SnapDetail, SnapHeat, SnapMode } from \"./HitDetail\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { BeButton, BeButtonEvent } from \"./tools/Tool\";\r\nimport { ViewHandleType, ViewManip } from \"./tools/ViewTool\";\r\nimport { DecorateContext } from \"./ViewContext\";\r\nimport { ScreenViewport } from \"./Viewport\";\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport class TentativePoint {\r\n public isActive = false;\r\n public currSnap?: SnapDetail;\r\n public tpHits?: HitList<HitDetail>;\r\n private get _hotDistanceInches(): number { return 0.21; }\r\n private readonly _point: Point3d = new Point3d();\r\n private readonly _rawPoint: Point3d = new Point3d();\r\n private readonly _viewPoint: Point3d = new Point3d();\r\n private _tentativePromise?: Promise<SnapDetail | undefined>;\r\n public viewport?: ScreenViewport;\r\n\r\n public onInitialized() { }\r\n public setHitList(list?: HitList<HitDetail>) { this.tpHits = list; }\r\n\r\n /** @return true if the tentative point is currently active and snapped to an element. */\r\n public get isSnapped(): boolean { return undefined !== this.currSnap; }\r\n\r\n /** @return The current snap path when TentativePoint.isSnapped or undefined. */\r\n public getCurrSnap(): SnapDetail | undefined { return this.currSnap; }\r\n\r\n public getPoint(): Point3d {\r\n const snap = this.currSnap;\r\n return !snap ? this._point : snap.adjustedPoint;\r\n }\r\n\r\n public setPoint(point: Point3d): void {\r\n this.setCurrSnap(undefined);\r\n this.tpHits = undefined;\r\n this._point.setFrom(point);\r\n }\r\n\r\n public clear(doErase: boolean): void {\r\n if (doErase) {\r\n this.removeTentative();\r\n IModelApp.accuSnap.synchSnapMode();\r\n }\r\n IModelApp.accuSnap.destroy();\r\n this.isActive = false;\r\n this.setCurrSnap(undefined);\r\n this.tpHits = undefined;\r\n }\r\n\r\n public removeTentative(): void {\r\n this._tentativePromise = undefined;\r\n if (!this.isActive)\r\n return;\r\n IModelApp.accuSnap.erase();\r\n if (this.getCurrSnap())\r\n IModelApp.viewManager.invalidateDecorationsAllViews();\r\n else\r\n this.viewport!.invalidateDecorations();\r\n this.isActive = false;\r\n }\r\n\r\n public setCurrSnap(newSnap?: SnapDetail): void {\r\n if (newSnap)\r\n newSnap.setSnapPoint(newSnap.snapPoint, SnapHeat.InRange); // Reset adjustedPoint from pre-located snap and set SnapHeat...\r\n this.currSnap = newSnap;\r\n }\r\n\r\n public showTentative(): void {\r\n if (this.isSnapped) {\r\n IModelApp.viewManager.invalidateDecorationsAllViews();\r\n IModelApp.accuSnap.displayToolTip(this._viewPoint, this.viewport!, undefined); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n } else {\r\n this.viewport!.invalidateDecorations();\r\n }\r\n this.isActive = true;\r\n }\r\n\r\n public getHitAndList(holder: HitListHolder): SnapDetail | undefined {\r\n const hit = this.currSnap;\r\n if (hit) {\r\n holder.setHitList(this.tpHits);\r\n this.tpHits = undefined;\r\n }\r\n return hit;\r\n }\r\n\r\n public onButtonEvent(ev: BeButtonEvent): void {\r\n switch (ev.button) {\r\n case BeButton.Data:\r\n if (!ev.isDown)\r\n return; // cleared on down...\r\n break;\r\n case BeButton.Reset:\r\n if (ev.isDown)\r\n return; // cleared on up...\r\n break;\r\n case BeButton.Middle:\r\n return;\r\n }\r\n\r\n this.removeTentative();\r\n IModelApp.accuSnap.synchSnapMode();\r\n this.setCurrSnap(undefined);\r\n this.tpHits = undefined;\r\n }\r\n\r\n public decorate(context: DecorateContext): void {\r\n const viewport = context.viewport;\r\n if (!this.isActive || !viewport)\r\n return;\r\n\r\n const tpSize = Math.floor(viewport.pixelsPerInch * 0.4) + 0.5;\r\n const toSizeOutline = tpSize + 1;\r\n const position = context.viewport.worldToView(this._point); position.x = Math.floor(position.x) + 0.5; position.y = Math.floor(position.y) + 0.5;\r\n const drawDecoration = (ctx: CanvasRenderingContext2D) => {\r\n ctx.beginPath();\r\n ctx.strokeStyle = \"rgba(0,0,0,.5)\";\r\n ctx.lineWidth = 3;\r\n ctx.moveTo(-toSizeOutline, 0);\r\n ctx.lineTo(toSizeOutline, 0);\r\n ctx.moveTo(0, -toSizeOutline);\r\n ctx.lineTo(0, toSizeOutline);\r\n ctx.stroke();\r\n\r\n ctx.beginPath();\r\n ctx.strokeStyle = \"white\";\r\n ctx.lineWidth = 1;\r\n if (!this.isSnapped) ctx.setLineDash([4, 1]);\r\n ctx.shadowColor = \"black\";\r\n ctx.shadowBlur = 5;\r\n ctx.moveTo(-tpSize, 0);\r\n ctx.lineTo(tpSize, 0);\r\n ctx.moveTo(0, -tpSize);\r\n ctx.lineTo(0, tpSize);\r\n ctx.stroke();\r\n };\r\n context.addCanvasDecoration({ position, drawDecoration });\r\n }\r\n\r\n private async getSnap(newSearch: boolean): Promise<SnapDetail | undefined> {\r\n // Use next hit from previous search when using tentative to cycle through hits...\r\n let thisHit = (!newSearch && undefined !== this.tpHits ? this.tpHits.getNextHit() : undefined);\r\n\r\n // Use existing AccuSnap hit list if one exists...\r\n if (undefined === thisHit) {\r\n this.tpHits = undefined;\r\n thisHit = IModelApp.accuSnap.getHitAndList(this);\r\n }\r\n\r\n if (undefined === thisHit) {\r\n // search for elements around the current raw point (search should not be affected by locks!)\r\n const aperture = (2.0 * this.viewport!.pixelsFromInches(IModelApp.locateManager.apertureInches) / 2.0) + 1.5;\r\n const options = IModelApp.locateManager.options.clone(); // Copy to avoid changing out from under active Tool...\r\n const picker = IModelApp.locateManager.picker;\r\n\r\n options.hitSource = HitSource.TentativeSnap;\r\n if (0 === picker.doPick(this.viewport!, this._rawPoint, aperture, options))\r\n return undefined;\r\n\r\n this.tpHits = picker.getHitList(true);\r\n thisHit = (undefined !== this.tpHits ? this.tpHits.getNextHit() : undefined);\r\n } else if (thisHit instanceof SnapDetail) {\r\n // Make the current AccuSnap the TentativePoint snap...\r\n return thisHit;\r\n }\r\n\r\n if (undefined === thisHit)\r\n return undefined;\r\n\r\n const snapModes = IModelApp.accuSnap.getActiveSnapModes(); // Get the list of point snap modes to consider\r\n if (1 === snapModes.length && SnapMode.Intersection === snapModes[0])\r\n snapModes.push(SnapMode.Nearest); // Add nearest when doing intersection by itself to support finding extended intersections...\r\n\r\n const thisSnap = await AccuSnap.requestSnap(thisHit, snapModes, this._hotDistanceInches, IModelApp.accuSnap.keypointDivisor, this.tpHits);\r\n\r\n if (undefined !== thisSnap)\r\n IModelApp.accuDraw.onSnap(thisSnap); // AccuDraw can adjust nearest snap to intersection of circle (polar distance lock) or line (axis lock) with snapped to curve...\r\n\r\n return thisSnap;\r\n }\r\n\r\n private static arePointsCloseEnough(pt1: Point3d, pt2: Point3d, pixelDistance: number): boolean { return pt1.distance(pt2) < (pixelDistance + 1.5); }\r\n\r\n public process(ev: BeButtonEvent): void {\r\n if (undefined !== this._tentativePromise)\r\n return;\r\n\r\n const currTool = IModelApp.toolAdmin.viewTool;\r\n if (currTool && currTool.inDynamicUpdate)\r\n return; // trying to tentative snap while view is changing isn't useful...\r\n\r\n const wasActive = this.isActive;\r\n this.removeTentative(); // remove the TP cross if it is already on the screen\r\n const lastPtView = this._viewPoint.clone();\r\n\r\n this.viewport = ev.viewport!;\r\n this._point.setFrom(ev.point);\r\n this._rawPoint.setFrom(ev.rawPoint);\r\n this._viewPoint.setFrom(ev.viewPoint);\r\n\r\n const newSearch = (!this.isSnapped || !TentativePoint.arePointsCloseEnough(lastPtView, this._viewPoint, this.viewport.pixelsFromInches(IModelApp.locateManager.apertureInches)));\r\n const promise = this.getSnap(newSearch);\r\n this._tentativePromise = promise;\r\n\r\n promise.then((newSnap) => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n // Ignore response if we're no longer interested in this tentative.\r\n if (this._tentativePromise === promise) {\r\n this._tentativePromise = undefined;\r\n this.setCurrSnap(newSnap); // Adopt the snap as current\r\n IModelApp.accuSnap.clear(); // make sure there's no AccuSnap active after a tentative point (otherwise we continually snap to it).\r\n if (this.isSnapped)\r\n this._point.setFrom(this.currSnap!.snapPoint);\r\n else if (wasActive && newSearch)\r\n this._point.setFrom(ev.rawPoint);\r\n this.showTentative(); // show the TP cross\r\n\r\n if (this.isSnapped) {\r\n IModelApp.toolAdmin.adjustSnapPoint();\r\n } else if (IModelApp.accuDraw.isActive) {\r\n const point = this.getPoint().clone();\r\n const vp = ev.viewport!;\r\n if (vp.isSnapAdjustmentRequired) {\r\n IModelApp.toolAdmin.adjustPointToACS(point, vp, false);\r\n const hit = new HitDetail(point, vp, HitSource.TentativeSnap, point, \"\", HitPriority.Unknown, 0, 0);\r\n const snap = new SnapDetail(hit);\r\n this.setCurrSnap(snap);\r\n IModelApp.toolAdmin.adjustSnapPoint();\r\n this.setPoint(this.getPoint());\r\n } else {\r\n IModelApp.accuDraw.adjustPoint(point, vp, false);\r\n const savePoint = point.clone();\r\n IModelApp.toolAdmin.adjustPointToGrid(point, vp);\r\n if (!point.isExactEqual(savePoint))\r\n IModelApp.accuDraw.adjustPoint(point, vp, false);\r\n this.setPoint(point);\r\n }\r\n } else {\r\n IModelApp.toolAdmin.adjustPoint(this.getPoint(), ev.viewport!);\r\n }\r\n\r\n IModelApp.accuDraw.onTentative();\r\n if (currTool && currTool instanceof ViewManip && currTool.viewHandles.hasHandle(ViewHandleType.TargetCenter))\r\n currTool.updateTargetCenter(); // Change target center to tentative location...\r\n else\r\n IModelApp.toolAdmin.updateDynamics(undefined, undefined, true); // Don't wait for motion to update dynamics...\r\n }\r\n });\r\n }\r\n}\r\n"]}
|
package/lib/cjs/ViewRect.d.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* @module Views
|
|
3
3
|
*/
|
|
4
4
|
import { LowAndHighXY, XAndY } from "@itwin/core-geometry";
|
|
5
|
-
/** A rectangle in integer view coordinates with (0,0) corresponding to the top-left corner of the view.
|
|
6
|
-
*
|
|
5
|
+
/** A rectangle in unsigned integer view coordinates with (0,0) corresponding to the top-left corner of the view.
|
|
7
6
|
* Increasing **x** moves from left to right, and increasing **y** moves from top to bottom.
|
|
7
|
+
* [[left]], [[top]], [[right]], and [[bottom]] are required to be non-negative integers; any negative inputs are treated as
|
|
8
|
+
* zero and any non-integer inputs are rounded down to the nearest integer.
|
|
8
9
|
* @public
|
|
9
10
|
* @extensions
|
|
10
11
|
*/
|
|
@@ -13,9 +14,10 @@ export declare class ViewRect {
|
|
|
13
14
|
private _top;
|
|
14
15
|
private _right;
|
|
15
16
|
private _bottom;
|
|
17
|
+
private _set;
|
|
16
18
|
/** Construct a new ViewRect. */
|
|
17
19
|
constructor(left?: number, top?: number, right?: number, bottom?: number);
|
|
18
|
-
/** The leftmost side of this ViewRect.
|
|
20
|
+
/** The leftmost side of this ViewRect. */
|
|
19
21
|
get left(): number;
|
|
20
22
|
set left(val: number);
|
|
21
23
|
/** The topmost side of this ViewRect. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewRect.d.ts","sourceRoot":"","sources":["../../src/ViewRect.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"ViewRect.d.ts","sourceRoot":"","sources":["../../src/ViewRect.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;;GAMG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,KAAK,CAAU;IACvB,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,OAAO,CAAU;IAEzB,OAAO,CAAC,IAAI;IAIZ,gCAAgC;gBACb,IAAI,SAAI,EAAE,GAAG,SAAI,EAAE,KAAK,SAAI,EAAE,MAAM,SAAI;IAC3D,0CAA0C;IAC1C,IAAW,IAAI,IAAI,MAAM,CAAuB;IAChD,IAAW,IAAI,CAAC,GAAG,EAAE,MAAM,EAA8B;IACzD,yCAAyC;IACzC,IAAW,GAAG,IAAI,MAAM,CAAsB;IAC9C,IAAW,GAAG,CAAC,GAAG,EAAE,MAAM,EAA6B;IACvD,2CAA2C;IAC3C,IAAW,KAAK,IAAI,MAAM,CAAwB;IAClD,IAAW,KAAK,CAAC,GAAG,EAAE,MAAM,EAA+B;IAC3D,4CAA4C;IAC5C,IAAW,MAAM,IAAI,MAAM,CAAyB;IACpD,IAAW,MAAM,CAAC,GAAG,EAAE,MAAM,EAAgC;IAC7D,6CAA6C;IAC7C,IAAW,MAAM,IAAI,OAAO,CAA+D;IAC3F,wBAAwB;IACxB,IAAW,OAAO,IAAI,OAAO,CAAyB;IACtD,+CAA+C;IAC/C,IAAW,KAAK,IACQ,MAA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OAAO;IAEzC;;OAEG;IACI,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS;CAgB7E"}
|
package/lib/cjs/ViewRect.js
CHANGED
|
@@ -8,27 +8,31 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.ViewRect = void 0;
|
|
11
|
-
/** A rectangle in integer view coordinates with (0,0) corresponding to the top-left corner of the view.
|
|
12
|
-
*
|
|
11
|
+
/** A rectangle in unsigned integer view coordinates with (0,0) corresponding to the top-left corner of the view.
|
|
13
12
|
* Increasing **x** moves from left to right, and increasing **y** moves from top to bottom.
|
|
13
|
+
* [[left]], [[top]], [[right]], and [[bottom]] are required to be non-negative integers; any negative inputs are treated as
|
|
14
|
+
* zero and any non-integer inputs are rounded down to the nearest integer.
|
|
14
15
|
* @public
|
|
15
16
|
* @extensions
|
|
16
17
|
*/
|
|
17
18
|
class ViewRect {
|
|
18
19
|
/** Construct a new ViewRect. */
|
|
19
20
|
constructor(left = 0, top = 0, right = 0, bottom = 0) { this.init(left, top, right, bottom); }
|
|
20
|
-
|
|
21
|
+
_set(key, value) {
|
|
22
|
+
this[key] = Math.max(0, Math.floor(value));
|
|
23
|
+
}
|
|
24
|
+
/** The leftmost side of this ViewRect. */
|
|
21
25
|
get left() { return this._left; }
|
|
22
|
-
set left(val) { this._left
|
|
26
|
+
set left(val) { this._set("_left", val); }
|
|
23
27
|
/** The topmost side of this ViewRect. */
|
|
24
28
|
get top() { return this._top; }
|
|
25
|
-
set top(val) { this._top
|
|
29
|
+
set top(val) { this._set("_top", val); }
|
|
26
30
|
/** The rightmost side of this ViewRect. */
|
|
27
31
|
get right() { return this._right; }
|
|
28
|
-
set right(val) { this._right
|
|
32
|
+
set right(val) { this._set("_right", val); }
|
|
29
33
|
/** The bottommost side of this ViewRect. */
|
|
30
34
|
get bottom() { return this._bottom; }
|
|
31
|
-
set bottom(val) { this._bottom
|
|
35
|
+
set bottom(val) { this._set("_bottom", val); }
|
|
32
36
|
/** True if this ViewRect has an area > 0. */
|
|
33
37
|
get isNull() { return this.right <= this.left || this.bottom <= this.top; }
|
|
34
38
|
/** True if `!isNull` */
|
package/lib/cjs/ViewRect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewRect.js","sourceRoot":"","sources":["../../src/ViewRect.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH;;;;;GAKG;AACH,MAAa,QAAQ;IAMnB,gCAAgC;IAChC,YAAmB,IAAI,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACrG,2CAA2C;IAC3C,IAAW,IAAI,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,IAAW,IAAI,CAAC,GAAW,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC9D,yCAAyC;IACzC,IAAW,GAAG,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,IAAW,GAAG,CAAC,GAAW,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5D,2CAA2C;IAC3C,IAAW,KAAK,KAAa,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAClD,IAAW,KAAK,CAAC,GAAW,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAChE,4CAA4C;IAC5C,IAAW,MAAM,KAAa,OAAO,IAAI,CAAC,OAAO,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IACI,cAAc,CAAC,KAAe,EAAE,GAAc;QACnD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEpD,IAAI,OAAO,GAAG,OAAO,IAAI,OAAO,GAAG,OAAO;YACxC,OAAO,SAAS,CAAC;QAEnB,MAAM,MAAM,GAAG,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC;QACxD,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;QACtB,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC;QACvB,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC;QACrB,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC;QACxB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA1ID,4BA0IC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { LowAndHighXY, XAndY } from \"@itwin/core-geometry\";\r\n\r\n/** A rectangle in integer view coordinates with (0,0) corresponding to the top-left corner of the view.\r\n *\r\n * Increasing **x** moves from left to right, and increasing **y** moves from top to bottom.\r\n * @public\r\n * @extensions\r\n */\r\nexport class ViewRect {\r\n private _left!: number;\r\n private _top!: number;\r\n private _right!: number;\r\n private _bottom!: number;\r\n\r\n /** Construct a new ViewRect. */\r\n public constructor(left = 0, top = 0, right = 0, bottom = 0) { this.init(left, top, right, bottom); }\r\n /** The leftmost side of this ViewRect. */\r\n public get left(): number { return this._left; }\r\n public set left(val: number) { this._left = Math.floor(val); }\r\n /** The topmost side of this ViewRect. */\r\n public get top(): number { return this._top; }\r\n public set top(val: number) { this._top = Math.floor(val); }\r\n /** The rightmost side of this ViewRect. */\r\n public get right(): number { return this._right; }\r\n public set right(val: number) { this._right = Math.floor(val); }\r\n /** The bottommost side of this ViewRect. */\r\n public get bottom(): number { return this._bottom; }\r\n public set bottom(val: number) { this._bottom = Math.floor(val); }\r\n /** True if this ViewRect has an area > 0. */\r\n public get isNull(): boolean { return this.right <= this.left || this.bottom <= this.top; }\r\n /** True if `!isNull` */\r\n public get isValid(): boolean { return !this.isNull; }\r\n /** The width (right-left) of this ViewRect. */\r\n public get width() { return this.right - this.left; }\r\n public set width(width: number) { this.right = this.left + width; }\r\n /** The height (bottom-top) of this ViewRect. */\r\n public get height() { return this.bottom - this.top; }\r\n public set height(height: number) { this.bottom = this.top + height; }\r\n /** The aspect ratio (width/height) of this ViewRect. */\r\n public get aspect() { return this.isNull ? 1.0 : this.width / this.height; }\r\n /** The area (width*height) of this ViewRect. */\r\n public get area() { return this.isNull ? 0 : this.width * this.height; }\r\n /** Initialize this ViewRect from its left/top/right/bottom parameters. */\r\n public init(left: number, top: number, right: number, bottom: number) { this.left = left; this.bottom = bottom, this.right = right; this.top = top; }\r\n /** Initialize this ViewRect from two points.\r\n * @param topLeft The top-left corner.\r\n * @param bottomRight The bottom-right corner.\r\n */\r\n public initFromPoints(topLeft: XAndY, bottomRight: XAndY): void { this.init(topLeft.x, topLeft.y, bottomRight.x, bottomRight.y); }\r\n /** Initialize this ViewRect from a range.\r\n * @param input The Range to use. `input.low` defines the top-left and `input.high` defines the bottom-right.\r\n */\r\n public initFromRange(input: LowAndHighXY): void { this.initFromPoints(input.low, input.high); }\r\n /** Return true is this ViewRect is exactly equal to another ViewRect.\r\n * @param other The other ViewRect to compare\r\n */\r\n public equals(other: ViewRect): boolean { return this.left === other.left && this.right === other.right && this.bottom === other.bottom && this.top === other.top; }\r\n /** Initialize this ViewRect from another ViewRect. */\r\n public setFrom(other: ViewRect): void { this.init(other.left, other.top, other.right, other.bottom); }\r\n /** Duplicate this ViewRect.\r\n * @param result Optional ViewRect for result. If undefined, a new ViewRect is created.\r\n */\r\n public clone(result?: ViewRect): ViewRect {\r\n if (undefined !== result) {\r\n result.setFrom(this);\r\n return result;\r\n }\r\n return new ViewRect(this.left, this.top, this.right, this.bottom);\r\n }\r\n public extend(other: ViewRect) {\r\n if (this.left > other.left) this.left = other.left;\r\n if (this.top > other.top) this.top = other.top;\r\n if (this.right < other.right) this.right = other.right;\r\n if (this.bottom < other.bottom) this.bottom = other.bottom;\r\n }\r\n\r\n /** Inset this ViewRect by values in the x and y directions. Positive values make the ViewRect smaller, and negative values will make it larger.\r\n * @param deltaX The distance to inset the ViewRect in the x direction.\r\n * @param deltaY The distance to inset the ViewRect in the y direction.\r\n */\r\n public inset(deltaX: number, deltaY: number): void {\r\n deltaX = Math.floor(deltaX);\r\n deltaY = Math.floor(deltaY);\r\n if (this.width - 2 * deltaX <= 0 || this.height - 2 * deltaY <= 0) {\r\n this.init(0, 0, 0, 0);\r\n return;\r\n }\r\n this._left += deltaX;\r\n this._right -= deltaX;\r\n this._top += deltaY;\r\n this._bottom -= deltaY;\r\n }\r\n\r\n /** Inset this ViewRect by the same value in all directions.\r\n * @param offset The distance to inset this ViewRect. Positive values will make this ViewRect smaller and negative values will make it larger.\r\n * @note The inset operation can cause a previously valid ViewRect to become invalid.\r\n */\r\n public insetUniform(offset: number): void { this.inset(offset, offset); }\r\n\r\n /** Scale this ViewRect about its center by the supplied scale factors. */\r\n public scaleAboutCenter(xScale: number, yScale: number): void {\r\n const w = this.width;\r\n const h = this.height;\r\n const xDelta = (w - (w * xScale)) * 0.5;\r\n const yDelta = (h - (h * yScale)) * 0.5;\r\n this.inset(xDelta, yDelta);\r\n }\r\n\r\n /** Inset this ViewRect by a percentage of its current width.\r\n * @param percent The percentage of this ViewRect's width to inset in all directions.\r\n * @note The ViewRect will become smaller (or larger, if percent is negative) by `percent * width * 2` in each direction, since each side is moved by that distance.\r\n * @see [[inset]]\r\n */\r\n public insetByPercent(percent: number): void { this.insetUniform(this.width * percent); }\r\n\r\n /** Determine if this ViewRect is entirely contained within the bounds of another ViewRect. */\r\n public isContained(other: ViewRect): boolean { return this.left >= other.left && this.right <= other.right && this.bottom <= other.bottom && this.top >= other.top; }\r\n\r\n /** Return true if the supplied point is contained in this ViewRect.\r\n * @param point The point to test.\r\n * @note if the point is exactly on the left or top edges, this method returns true. If the point is exactly on the right or bottom edge, it returns false.\r\n */\r\n public containsPoint(point: XAndY): boolean { return point.x >= this.left && point.x < this.right && point.y >= this.top && point.y < this.bottom; }\r\n\r\n /** Determine whether this ViewRect overlaps another. */\r\n public overlaps(other: ViewRect): boolean { return this.left <= other.right && this.top <= other.bottom && this.right >= other.left && this.bottom >= other.top; }\r\n\r\n /** Return a ViewRect that is the overlap (intersection) of this ViewRect and another ViewRect.\r\n * If the two ViewRects are equal, their value is the result. Otherwise, the result will always be smaller than either of them.\r\n */\r\n public computeOverlap(other: ViewRect, out?: ViewRect): ViewRect | undefined {\r\n const maxOrgX = Math.max(this.left, other.left);\r\n const maxOrgY = Math.max(this.top, other.top);\r\n const minCrnX = Math.min(this.right, other.right);\r\n const minCrnY = Math.min(this.bottom, other.bottom);\r\n\r\n if (maxOrgX > minCrnX || maxOrgY > minCrnY)\r\n return undefined;\r\n\r\n const result = undefined !== out ? out : new ViewRect();\r\n result.left = maxOrgX;\r\n result.right = minCrnX;\r\n result.top = maxOrgY;\r\n result.bottom = minCrnY;\r\n return result;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ViewRect.js","sourceRoot":"","sources":["../../src/ViewRect.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AO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEpD,IAAI,OAAO,GAAG,OAAO,IAAI,OAAO,GAAG,OAAO;YACxC,OAAO,SAAS,CAAC;QAEnB,MAAM,MAAM,GAAG,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC;QACxD,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC;QACtB,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC;QACvB,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC;QACrB,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC;QACxB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA9ID,4BA8IC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { LowAndHighXY, XAndY } from \"@itwin/core-geometry\";\r\n\r\n/** A rectangle in unsigned integer view coordinates with (0,0) corresponding to the top-left corner of the view.\r\n * Increasing **x** moves from left to right, and increasing **y** moves from top to bottom.\r\n * [[left]], [[top]], [[right]], and [[bottom]] are required to be non-negative integers; any negative inputs are treated as\r\n * zero and any non-integer inputs are rounded down to the nearest integer.\r\n * @public\r\n * @extensions\r\n */\r\nexport class ViewRect {\r\n private _left!: number;\r\n private _top!: number;\r\n private _right!: number;\r\n private _bottom!: number;\r\n\r\n private _set(key: \"_left\" | \"_right\" | \"_top\" | \"_bottom\", value: number): void {\r\n this[key] = Math.max(0, Math.floor(value));\r\n }\r\n\r\n /** Construct a new ViewRect. */\r\n public constructor(left = 0, top = 0, right = 0, bottom = 0) { this.init(left, top, right, bottom); }\r\n /** The leftmost side of this ViewRect. */\r\n public get left(): number { return this._left; }\r\n public set left(val: number) { this._set(\"_left\", val); }\r\n /** The topmost side of this ViewRect. */\r\n public get top(): number { return this._top; }\r\n public set top(val: number) { this._set(\"_top\", val); }\r\n /** The rightmost side of this ViewRect. */\r\n public get right(): number { return this._right; }\r\n public set right(val: number) { this._set(\"_right\", val); }\r\n /** The bottommost side of this ViewRect. */\r\n public get bottom(): number { return this._bottom; }\r\n public set bottom(val: number) { this._set(\"_bottom\", val); }\r\n /** True if this ViewRect has an area > 0. */\r\n public get isNull(): boolean { return this.right <= this.left || this.bottom <= this.top; }\r\n /** True if `!isNull` */\r\n public get isValid(): boolean { return !this.isNull; }\r\n /** The width (right-left) of this ViewRect. */\r\n public get width() { return this.right - this.left; }\r\n public set width(width: number) { this.right = this.left + width; }\r\n /** The height (bottom-top) of this ViewRect. */\r\n public get height() { return this.bottom - this.top; }\r\n public set height(height: number) { this.bottom = this.top + height; }\r\n /** The aspect ratio (width/height) of this ViewRect. */\r\n public get aspect() { return this.isNull ? 1.0 : this.width / this.height; }\r\n /** The area (width*height) of this ViewRect. */\r\n public get area() { return this.isNull ? 0 : this.width * this.height; }\r\n /** Initialize this ViewRect from its left/top/right/bottom parameters. */\r\n public init(left: number, top: number, right: number, bottom: number) { this.left = left; this.bottom = bottom, this.right = right; this.top = top; }\r\n /** Initialize this ViewRect from two points.\r\n * @param topLeft The top-left corner.\r\n * @param bottomRight The bottom-right corner.\r\n */\r\n public initFromPoints(topLeft: XAndY, bottomRight: XAndY): void { this.init(topLeft.x, topLeft.y, bottomRight.x, bottomRight.y); }\r\n /** Initialize this ViewRect from a range.\r\n * @param input The Range to use. `input.low` defines the top-left and `input.high` defines the bottom-right.\r\n */\r\n public initFromRange(input: LowAndHighXY): void { this.initFromPoints(input.low, input.high); }\r\n /** Return true is this ViewRect is exactly equal to another ViewRect.\r\n * @param other The other ViewRect to compare\r\n */\r\n public equals(other: ViewRect): boolean { return this.left === other.left && this.right === other.right && this.bottom === other.bottom && this.top === other.top; }\r\n /** Initialize this ViewRect from another ViewRect. */\r\n public setFrom(other: ViewRect): void { this.init(other.left, other.top, other.right, other.bottom); }\r\n /** Duplicate this ViewRect.\r\n * @param result Optional ViewRect for result. If undefined, a new ViewRect is created.\r\n */\r\n public clone(result?: ViewRect): ViewRect {\r\n if (undefined !== result) {\r\n result.setFrom(this);\r\n return result;\r\n }\r\n return new ViewRect(this.left, this.top, this.right, this.bottom);\r\n }\r\n public extend(other: ViewRect) {\r\n if (this.left > other.left) this.left = other.left;\r\n if (this.top > other.top) this.top = other.top;\r\n if (this.right < other.right) this.right = other.right;\r\n if (this.bottom < other.bottom) this.bottom = other.bottom;\r\n }\r\n\r\n /** Inset this ViewRect by values in the x and y directions. Positive values make the ViewRect smaller, and negative values will make it larger.\r\n * @param deltaX The distance to inset the ViewRect in the x direction.\r\n * @param deltaY The distance to inset the ViewRect in the y direction.\r\n */\r\n public inset(deltaX: number, deltaY: number): void {\r\n deltaX = Math.floor(deltaX);\r\n deltaY = Math.floor(deltaY);\r\n if (this.width - 2 * deltaX <= 0 || this.height - 2 * deltaY <= 0) {\r\n this.init(0, 0, 0, 0);\r\n return;\r\n }\r\n this._left += deltaX;\r\n this._right -= deltaX;\r\n this._top += deltaY;\r\n this._bottom -= deltaY;\r\n }\r\n\r\n /** Inset this ViewRect by the same value in all directions.\r\n * @param offset The distance to inset this ViewRect. Positive values will make this ViewRect smaller and negative values will make it larger.\r\n * @note The inset operation can cause a previously valid ViewRect to become invalid.\r\n */\r\n public insetUniform(offset: number): void { this.inset(offset, offset); }\r\n\r\n /** Scale this ViewRect about its center by the supplied scale factors. */\r\n public scaleAboutCenter(xScale: number, yScale: number): void {\r\n const w = this.width;\r\n const h = this.height;\r\n const xDelta = (w - (w * xScale)) * 0.5;\r\n const yDelta = (h - (h * yScale)) * 0.5;\r\n this.inset(xDelta, yDelta);\r\n }\r\n\r\n /** Inset this ViewRect by a percentage of its current width.\r\n * @param percent The percentage of this ViewRect's width to inset in all directions.\r\n * @note The ViewRect will become smaller (or larger, if percent is negative) by `percent * width * 2` in each direction, since each side is moved by that distance.\r\n * @see [[inset]]\r\n */\r\n public insetByPercent(percent: number): void { this.insetUniform(this.width * percent); }\r\n\r\n /** Determine if this ViewRect is entirely contained within the bounds of another ViewRect. */\r\n public isContained(other: ViewRect): boolean { return this.left >= other.left && this.right <= other.right && this.bottom <= other.bottom && this.top >= other.top; }\r\n\r\n /** Return true if the supplied point is contained in this ViewRect.\r\n * @param point The point to test.\r\n * @note if the point is exactly on the left or top edges, this method returns true. If the point is exactly on the right or bottom edge, it returns false.\r\n */\r\n public containsPoint(point: XAndY): boolean { return point.x >= this.left && point.x < this.right && point.y >= this.top && point.y < this.bottom; }\r\n\r\n /** Determine whether this ViewRect overlaps another. */\r\n public overlaps(other: ViewRect): boolean { return this.left <= other.right && this.top <= other.bottom && this.right >= other.left && this.bottom >= other.top; }\r\n\r\n /** Return a ViewRect that is the overlap (intersection) of this ViewRect and another ViewRect.\r\n * If the two ViewRects are equal, their value is the result. Otherwise, the result will always be smaller than either of them.\r\n */\r\n public computeOverlap(other: ViewRect, out?: ViewRect): ViewRect | undefined {\r\n const maxOrgX = Math.max(this.left, other.left);\r\n const maxOrgY = Math.max(this.top, other.top);\r\n const minCrnX = Math.min(this.right, other.right);\r\n const minCrnY = Math.min(this.bottom, other.bottom);\r\n\r\n if (maxOrgX > minCrnX || maxOrgY > minCrnY)\r\n return undefined;\r\n\r\n const result = undefined !== out ? out : new ViewRect();\r\n result.left = maxOrgX;\r\n result.right = minCrnX;\r\n result.top = maxOrgY;\r\n result.bottom = minCrnY;\r\n return result;\r\n }\r\n}\r\n"]}
|