@itwin/core-frontend 5.1.2 → 5.2.0-dev.10
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 +1 -1
- package/lib/cjs/BackgroundMapGeometry.js +13 -13
- package/lib/cjs/BackgroundMapGeometry.js.map +1 -1
- package/lib/cjs/BriefcaseConnection.d.ts.map +1 -1
- package/lib/cjs/BriefcaseConnection.js +2 -2
- package/lib/cjs/BriefcaseConnection.js.map +1 -1
- package/lib/cjs/CheckpointConnection.d.ts.map +1 -1
- package/lib/cjs/CheckpointConnection.js +3 -3
- package/lib/cjs/CheckpointConnection.js.map +1 -1
- package/lib/cjs/ContextRealityModelState.js.map +1 -1
- package/lib/cjs/ElementLocateManager.d.ts.map +1 -1
- package/lib/cjs/ElementLocateManager.js +7 -6
- package/lib/cjs/ElementLocateManager.js.map +1 -1
- package/lib/cjs/EmphasizeElements.d.ts.map +1 -1
- package/lib/cjs/EmphasizeElements.js +3 -1
- package/lib/cjs/EmphasizeElements.js.map +1 -1
- package/lib/cjs/EnvironmentDecorations.d.ts.map +1 -1
- package/lib/cjs/EnvironmentDecorations.js +4 -0
- package/lib/cjs/EnvironmentDecorations.js.map +1 -1
- package/lib/cjs/FrustumAnimator.d.ts.map +1 -1
- package/lib/cjs/FrustumAnimator.js +3 -2
- package/lib/cjs/FrustumAnimator.js.map +1 -1
- package/lib/cjs/GlobeAnimator.d.ts.map +1 -1
- package/lib/cjs/GlobeAnimator.js +7 -6
- package/lib/cjs/GlobeAnimator.js.map +1 -1
- package/lib/cjs/HitDetail.d.ts.map +1 -1
- package/lib/cjs/HitDetail.js +12 -7
- package/lib/cjs/HitDetail.js.map +1 -1
- package/lib/cjs/IModelApp.d.ts.map +1 -1
- package/lib/cjs/IModelApp.js +2 -1
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/IModelConnection.d.ts +4 -0
- package/lib/cjs/IModelConnection.d.ts.map +1 -1
- package/lib/cjs/IModelConnection.js +156 -14
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/IpcApp.d.ts.map +1 -1
- package/lib/cjs/IpcApp.js +1 -1
- package/lib/cjs/IpcApp.js.map +1 -1
- package/lib/cjs/LinePlaneIntersect.d.ts.map +1 -1
- package/lib/cjs/LinePlaneIntersect.js +2 -0
- package/lib/cjs/LinePlaneIntersect.js.map +1 -1
- package/lib/cjs/LocalhostIpcApp.d.ts.map +1 -1
- package/lib/cjs/LocalhostIpcApp.js +2 -1
- package/lib/cjs/LocalhostIpcApp.js.map +1 -1
- package/lib/cjs/Marker.d.ts.map +1 -1
- package/lib/cjs/Marker.js +4 -3
- package/lib/cjs/Marker.js.map +1 -1
- package/lib/cjs/ModelState.d.ts.map +1 -1
- package/lib/cjs/ModelState.js +2 -2
- package/lib/cjs/ModelState.js.map +1 -1
- package/lib/cjs/NativeApp.d.ts.map +1 -1
- package/lib/cjs/NativeApp.js +5 -4
- package/lib/cjs/NativeApp.js.map +1 -1
- package/lib/cjs/NativeAppLogger.d.ts.map +1 -1
- package/lib/cjs/NativeAppLogger.js +1 -0
- package/lib/cjs/NativeAppLogger.js.map +1 -1
- package/lib/cjs/PlanarClipMaskState.js +3 -3
- package/lib/cjs/PlanarClipMaskState.js.map +1 -1
- package/lib/cjs/SelectionSet.d.ts.map +1 -1
- package/lib/cjs/SelectionSet.js +1 -0
- package/lib/cjs/SelectionSet.js.map +1 -1
- package/lib/cjs/SheetViewState.d.ts.map +1 -1
- package/lib/cjs/SheetViewState.js +5 -5
- package/lib/cjs/SheetViewState.js.map +1 -1
- package/lib/cjs/SpatialViewState.d.ts.map +1 -1
- package/lib/cjs/SpatialViewState.js +1 -1
- package/lib/cjs/SpatialViewState.js.map +1 -1
- package/lib/cjs/Sprites.js +2 -2
- package/lib/cjs/Sprites.js.map +1 -1
- package/lib/cjs/TentativePoint.d.ts.map +1 -1
- package/lib/cjs/TentativePoint.js +10 -9
- package/lib/cjs/TentativePoint.js.map +1 -1
- package/lib/cjs/ViewCreator2d.js +1 -1
- package/lib/cjs/ViewCreator2d.js.map +1 -1
- package/lib/cjs/ViewCreator3d.js +1 -1
- package/lib/cjs/ViewCreator3d.js.map +1 -1
- package/lib/cjs/ViewPose.d.ts.map +1 -1
- package/lib/cjs/ViewPose.js +4 -1
- package/lib/cjs/ViewPose.js.map +1 -1
- package/lib/cjs/ViewState.d.ts.map +1 -1
- package/lib/cjs/ViewState.js +17 -12
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/ViewingSpace.d.ts.map +1 -1
- package/lib/cjs/ViewingSpace.js +2 -0
- package/lib/cjs/ViewingSpace.js.map +1 -1
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +17 -10
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/common/ImageUtil.d.ts.map +1 -1
- package/lib/cjs/common/ImageUtil.js +2 -1
- package/lib/cjs/common/ImageUtil.js.map +1 -1
- package/lib/cjs/common/internal/render/GeometryAccumulator.d.ts.map +1 -1
- package/lib/cjs/common/internal/render/GeometryAccumulator.js +4 -3
- package/lib/cjs/common/internal/render/GeometryAccumulator.js.map +1 -1
- package/lib/cjs/common/internal/render/InstancedGraphicPropsBuilder.d.ts.map +1 -1
- package/lib/cjs/common/internal/render/InstancedGraphicPropsBuilder.js +2 -0
- package/lib/cjs/common/internal/render/InstancedGraphicPropsBuilder.js.map +1 -1
- package/lib/cjs/common/internal/render/MeshBuilder.js +1 -1
- package/lib/cjs/common/internal/render/MeshBuilder.js.map +1 -1
- package/lib/cjs/common/internal/render/VertexTableBuilder.d.ts.map +1 -1
- package/lib/cjs/common/internal/render/VertexTableBuilder.js +16 -7
- package/lib/cjs/common/internal/render/VertexTableBuilder.js.map +1 -1
- package/lib/cjs/extension/ExtensionAdmin.js +2 -2
- package/lib/cjs/extension/ExtensionAdmin.js.map +1 -1
- package/lib/cjs/internal/GoogleMapsDecorator.js +1 -1
- package/lib/cjs/internal/GoogleMapsDecorator.js.map +1 -1
- package/lib/cjs/internal/ScriptUtils.js +1 -0
- package/lib/cjs/internal/ScriptUtils.js.map +1 -1
- package/lib/cjs/internal/render/UpsampleRealityMeshParams.d.ts.map +1 -1
- package/lib/cjs/internal/render/UpsampleRealityMeshParams.js +2 -1
- package/lib/cjs/internal/render/UpsampleRealityMeshParams.js.map +1 -1
- package/lib/cjs/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js +7 -2
- package/lib/cjs/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/AttributeBuffers.js +5 -3
- package/lib/cjs/internal/render/webgl/AttributeBuffers.js.map +1 -1
- package/lib/cjs/internal/render/webgl/AttributeMap.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/AttributeMap.js +2 -0
- package/lib/cjs/internal/render/webgl/AttributeMap.js.map +1 -1
- package/lib/cjs/internal/render/webgl/BackgroundMapDrape.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/BackgroundMapDrape.js +2 -2
- package/lib/cjs/internal/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/cjs/internal/render/webgl/BatchUniforms.js +1 -1
- package/lib/cjs/internal/render/webgl/BatchUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/BranchState.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/BranchState.js +2 -1
- package/lib/cjs/internal/render/webgl/BranchState.js.map +1 -1
- package/lib/cjs/internal/render/webgl/BranchUniforms.js +2 -2
- package/lib/cjs/internal/render/webgl/BranchUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/CachedGeometry.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/CachedGeometry.js +2 -2
- package/lib/cjs/internal/render/webgl/CachedGeometry.js.map +1 -1
- package/lib/cjs/internal/render/webgl/ClipStack.js +1 -1
- package/lib/cjs/internal/render/webgl/ClipStack.js.map +1 -1
- package/lib/cjs/internal/render/webgl/ColorInfo.js +1 -1
- package/lib/cjs/internal/render/webgl/ColorInfo.js.map +1 -1
- package/lib/cjs/internal/render/webgl/Contours.js +3 -3
- package/lib/cjs/internal/render/webgl/Contours.js.map +1 -1
- package/lib/cjs/internal/render/webgl/EDL.js +18 -18
- package/lib/cjs/internal/render/webgl/EDL.js.map +1 -1
- package/lib/cjs/internal/render/webgl/FeatureOverrides.js +4 -4
- package/lib/cjs/internal/render/webgl/FeatureOverrides.js.map +1 -1
- package/lib/cjs/internal/render/webgl/FrameBuffer.js +3 -3
- package/lib/cjs/internal/render/webgl/FrameBuffer.js.map +1 -1
- package/lib/cjs/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/FrustumUniforms.js +2 -1
- package/lib/cjs/internal/render/webgl/FrustumUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/GLTimer.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/GLTimer.js +2 -0
- package/lib/cjs/internal/render/webgl/GLTimer.js.map +1 -1
- package/lib/cjs/internal/render/webgl/MapLayerParams.js +2 -2
- package/lib/cjs/internal/render/webgl/MapLayerParams.js.map +1 -1
- package/lib/cjs/internal/render/webgl/MeshData.js +2 -2
- package/lib/cjs/internal/render/webgl/MeshData.js.map +1 -1
- package/lib/cjs/internal/render/webgl/PerformanceMetrics.js +1 -1
- package/lib/cjs/internal/render/webgl/PerformanceMetrics.js.map +1 -1
- package/lib/cjs/internal/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/PlanarClassifier.js +7 -7
- package/lib/cjs/internal/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/cjs/internal/render/webgl/PlanarGrid.js +1 -1
- package/lib/cjs/internal/render/webgl/PlanarGrid.js.map +1 -1
- package/lib/cjs/internal/render/webgl/PlanarTextureProjection.d.ts +0 -3
- package/lib/cjs/internal/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/PlanarTextureProjection.js +6 -5
- package/lib/cjs/internal/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/cjs/internal/render/webgl/PointCloud.js +1 -1
- package/lib/cjs/internal/render/webgl/PointCloud.js.map +1 -1
- package/lib/cjs/internal/render/webgl/RealityMesh.js +1 -1
- package/lib/cjs/internal/render/webgl/RealityMesh.js.map +1 -1
- package/lib/cjs/internal/render/webgl/RenderBuffer.js +2 -2
- package/lib/cjs/internal/render/webgl/RenderBuffer.js.map +1 -1
- package/lib/cjs/internal/render/webgl/SceneCompositor.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/SceneCompositor.js +115 -85
- package/lib/cjs/internal/render/webgl/SceneCompositor.js.map +1 -1
- package/lib/cjs/internal/render/webgl/ScratchDrawParams.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/ScratchDrawParams.js +11 -10
- package/lib/cjs/internal/render/webgl/ScratchDrawParams.js.map +1 -1
- package/lib/cjs/internal/render/webgl/ScreenSpaceEffect.js +3 -3
- package/lib/cjs/internal/render/webgl/ScreenSpaceEffect.js.map +1 -1
- package/lib/cjs/internal/render/webgl/ShaderProgram.js +3 -3
- package/lib/cjs/internal/render/webgl/ShaderProgram.js.map +1 -1
- package/lib/cjs/internal/render/webgl/ShadowUniforms.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/ShadowUniforms.js +2 -1
- package/lib/cjs/internal/render/webgl/ShadowUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/SolarShadowMap.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/SolarShadowMap.js +6 -4
- package/lib/cjs/internal/render/webgl/SolarShadowMap.js.map +1 -1
- package/lib/cjs/internal/render/webgl/System.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/System.js +1 -1
- package/lib/cjs/internal/render/webgl/System.js.map +1 -1
- package/lib/cjs/internal/render/webgl/Target.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/Target.js +10 -7
- package/lib/cjs/internal/render/webgl/Target.js.map +1 -1
- package/lib/cjs/internal/render/webgl/Texture.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/Texture.js +10 -8
- package/lib/cjs/internal/render/webgl/Texture.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Animation.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Animation.js +4 -2
- package/lib/cjs/internal/render/webgl/glsl/Animation.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Color.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Color.js +2 -1
- package/lib/cjs/internal/render/webgl/glsl/Color.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Composite.js +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Composite.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/CopyStencil.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/CopyStencil.js +3 -2
- package/lib/cjs/internal/render/webgl/glsl/CopyStencil.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/PlanarClassification.js +3 -3
- package/lib/cjs/internal/render/webgl/glsl/PlanarClassification.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/PlanarGrid.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/PlanarGrid.js +4 -3
- package/lib/cjs/internal/render/webgl/glsl/PlanarGrid.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/RealityMesh.js +8 -8
- package/lib/cjs/internal/render/webgl/glsl/RealityMesh.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Surface.js +10 -10
- package/lib/cjs/internal/render/webgl/glsl/Surface.js.map +1 -1
- package/lib/cjs/internal/render/webgl/glsl/Vertex.js +2 -2
- package/lib/cjs/internal/render/webgl/glsl/Vertex.js.map +1 -1
- package/lib/cjs/internal/tile/B3dmReader.d.ts.map +1 -1
- package/lib/cjs/internal/tile/B3dmReader.js +1 -1
- package/lib/cjs/internal/tile/B3dmReader.js.map +1 -1
- package/lib/cjs/internal/tile/FetchCloudStorage.js +1 -1
- package/lib/cjs/internal/tile/FetchCloudStorage.js.map +1 -1
- package/lib/cjs/internal/tile/LRUTileList.d.ts.map +1 -1
- package/lib/cjs/internal/tile/LRUTileList.js +4 -0
- package/lib/cjs/internal/tile/LRUTileList.js.map +1 -1
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js +2 -1
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
- package/lib/cjs/internal/tile/OPCFormatInterpreter.js +4 -4
- package/lib/cjs/internal/tile/OPCFormatInterpreter.js.map +1 -1
- package/lib/cjs/internal/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/OrbitGtTileTree.js +2 -2
- package/lib/cjs/internal/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.js +3 -3
- package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityTileLoader.js +3 -0
- package/lib/cjs/internal/tile/RealityTileLoader.js.map +1 -1
- package/lib/cjs/internal/tile/ThreeDTileFormatInterpreter.js +3 -3
- package/lib/cjs/internal/tile/ThreeDTileFormatInterpreter.js.map +1 -1
- package/lib/cjs/internal/tile/TileUserSet.d.ts.map +1 -1
- package/lib/cjs/internal/tile/TileUserSet.js +4 -0
- package/lib/cjs/internal/tile/TileUserSet.js.map +1 -1
- package/lib/cjs/internal/tile/map/ArcGISTileMap.js +1 -1
- package/lib/cjs/internal/tile/map/ArcGISTileMap.js.map +1 -1
- package/lib/cjs/internal/tile/map/ArcGisUtilities.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ArcGisUtilities.js +4 -0
- package/lib/cjs/internal/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js +2 -2
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
- package/lib/cjs/internal/tile/map/MapTileAvailability.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/MapTileAvailability.js +5 -2
- package/lib/cjs/internal/tile/map/MapTileAvailability.js.map +1 -1
- package/lib/cjs/internal/tile/map/WmtsCapabilities.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/WmtsCapabilities.js +3 -2
- package/lib/cjs/internal/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/cjs/properties/FormattedQuantityDescription.d.ts.map +1 -1
- package/lib/cjs/properties/FormattedQuantityDescription.js +2 -0
- package/lib/cjs/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/cjs/quantity-formatting/BaseUnitFormattingSettingsProvider.d.ts.map +1 -1
- package/lib/cjs/quantity-formatting/BaseUnitFormattingSettingsProvider.js +2 -0
- package/lib/cjs/quantity-formatting/BaseUnitFormattingSettingsProvider.js.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.js +5 -3
- package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/cjs/tile/GltfReader.d.ts +5 -2
- package/lib/cjs/tile/GltfReader.d.ts.map +1 -1
- package/lib/cjs/tile/GltfReader.js +54 -16
- package/lib/cjs/tile/GltfReader.js.map +1 -1
- package/lib/cjs/tile/RealityTile.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTile.js +2 -2
- package/lib/cjs/tile/RealityTile.js.map +1 -1
- package/lib/cjs/tile/RealityTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTileTree.js +5 -5
- package/lib/cjs/tile/RealityTileTree.js.map +1 -1
- package/lib/cjs/tile/TileAdmin.js.map +1 -1
- package/lib/cjs/tile/TileDrawArgs.d.ts.map +1 -1
- package/lib/cjs/tile/TileDrawArgs.js +2 -1
- package/lib/cjs/tile/TileDrawArgs.js.map +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js +1 -1
- package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.js +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerSources.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerSources.js +9 -1
- package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
- package/lib/cjs/tile/map/MapTile.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTile.js +10 -8
- package/lib/cjs/tile/map/MapTile.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +8 -7
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tile/map/MapTilingScheme.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTilingScheme.js +2 -1
- package/lib/cjs/tile/map/MapTilingScheme.js.map +1 -1
- package/lib/cjs/tools/Tool.js +1 -1
- package/lib/cjs/tools/Tool.js.map +1 -1
- package/lib/esm/BackgroundMapGeometry.js +14 -14
- package/lib/esm/BackgroundMapGeometry.js.map +1 -1
- package/lib/esm/BriefcaseConnection.d.ts.map +1 -1
- package/lib/esm/BriefcaseConnection.js +2 -2
- package/lib/esm/BriefcaseConnection.js.map +1 -1
- package/lib/esm/CheckpointConnection.d.ts.map +1 -1
- package/lib/esm/CheckpointConnection.js +4 -4
- package/lib/esm/CheckpointConnection.js.map +1 -1
- package/lib/esm/ContextRealityModelState.js.map +1 -1
- package/lib/esm/ElementLocateManager.d.ts.map +1 -1
- package/lib/esm/ElementLocateManager.js +8 -7
- package/lib/esm/ElementLocateManager.js.map +1 -1
- package/lib/esm/EmphasizeElements.d.ts.map +1 -1
- package/lib/esm/EmphasizeElements.js +3 -1
- package/lib/esm/EmphasizeElements.js.map +1 -1
- package/lib/esm/EnvironmentDecorations.d.ts.map +1 -1
- package/lib/esm/EnvironmentDecorations.js +4 -0
- package/lib/esm/EnvironmentDecorations.js.map +1 -1
- package/lib/esm/FrustumAnimator.d.ts.map +1 -1
- package/lib/esm/FrustumAnimator.js +3 -2
- package/lib/esm/FrustumAnimator.js.map +1 -1
- package/lib/esm/GlobeAnimator.d.ts.map +1 -1
- package/lib/esm/GlobeAnimator.js +7 -6
- package/lib/esm/GlobeAnimator.js.map +1 -1
- package/lib/esm/HitDetail.d.ts.map +1 -1
- package/lib/esm/HitDetail.js +12 -7
- package/lib/esm/HitDetail.js.map +1 -1
- package/lib/esm/IModelApp.d.ts.map +1 -1
- package/lib/esm/IModelApp.js +4 -3
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/IModelConnection.d.ts +4 -0
- package/lib/esm/IModelConnection.d.ts.map +1 -1
- package/lib/esm/IModelConnection.js +158 -16
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/IpcApp.d.ts.map +1 -1
- package/lib/esm/IpcApp.js +2 -2
- package/lib/esm/IpcApp.js.map +1 -1
- package/lib/esm/LinePlaneIntersect.d.ts.map +1 -1
- package/lib/esm/LinePlaneIntersect.js +2 -0
- package/lib/esm/LinePlaneIntersect.js.map +1 -1
- package/lib/esm/LocalhostIpcApp.d.ts.map +1 -1
- package/lib/esm/LocalhostIpcApp.js +2 -1
- package/lib/esm/LocalhostIpcApp.js.map +1 -1
- package/lib/esm/Marker.d.ts.map +1 -1
- package/lib/esm/Marker.js +5 -4
- package/lib/esm/Marker.js.map +1 -1
- package/lib/esm/ModelState.d.ts.map +1 -1
- package/lib/esm/ModelState.js +3 -3
- package/lib/esm/ModelState.js.map +1 -1
- package/lib/esm/NativeApp.d.ts.map +1 -1
- package/lib/esm/NativeApp.js +5 -4
- package/lib/esm/NativeApp.js.map +1 -1
- package/lib/esm/NativeAppLogger.d.ts.map +1 -1
- package/lib/esm/NativeAppLogger.js +1 -0
- package/lib/esm/NativeAppLogger.js.map +1 -1
- package/lib/esm/PlanarClipMaskState.js +3 -3
- package/lib/esm/PlanarClipMaskState.js.map +1 -1
- package/lib/esm/SelectionSet.d.ts.map +1 -1
- package/lib/esm/SelectionSet.js +2 -1
- package/lib/esm/SelectionSet.js.map +1 -1
- package/lib/esm/SheetViewState.d.ts.map +1 -1
- package/lib/esm/SheetViewState.js +6 -6
- package/lib/esm/SheetViewState.js.map +1 -1
- package/lib/esm/SpatialViewState.d.ts.map +1 -1
- package/lib/esm/SpatialViewState.js +2 -2
- package/lib/esm/SpatialViewState.js.map +1 -1
- package/lib/esm/Sprites.js +2 -2
- package/lib/esm/Sprites.js.map +1 -1
- package/lib/esm/TentativePoint.d.ts.map +1 -1
- package/lib/esm/TentativePoint.js +10 -9
- package/lib/esm/TentativePoint.js.map +1 -1
- package/lib/esm/ViewCreator2d.js +1 -1
- package/lib/esm/ViewCreator2d.js.map +1 -1
- package/lib/esm/ViewCreator3d.js +1 -1
- package/lib/esm/ViewCreator3d.js.map +1 -1
- package/lib/esm/ViewPose.d.ts.map +1 -1
- package/lib/esm/ViewPose.js +4 -1
- package/lib/esm/ViewPose.js.map +1 -1
- package/lib/esm/ViewState.d.ts.map +1 -1
- package/lib/esm/ViewState.js +18 -13
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/ViewingSpace.d.ts.map +1 -1
- package/lib/esm/ViewingSpace.js +2 -0
- package/lib/esm/ViewingSpace.js.map +1 -1
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +18 -11
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/common/ImageUtil.d.ts.map +1 -1
- package/lib/esm/common/ImageUtil.js +2 -1
- package/lib/esm/common/ImageUtil.js.map +1 -1
- package/lib/esm/common/internal/render/GeometryAccumulator.d.ts.map +1 -1
- package/lib/esm/common/internal/render/GeometryAccumulator.js +4 -3
- package/lib/esm/common/internal/render/GeometryAccumulator.js.map +1 -1
- package/lib/esm/common/internal/render/InstancedGraphicPropsBuilder.d.ts.map +1 -1
- package/lib/esm/common/internal/render/InstancedGraphicPropsBuilder.js +2 -0
- package/lib/esm/common/internal/render/InstancedGraphicPropsBuilder.js.map +1 -1
- package/lib/esm/common/internal/render/MeshBuilder.js +2 -2
- package/lib/esm/common/internal/render/MeshBuilder.js.map +1 -1
- package/lib/esm/common/internal/render/VertexTableBuilder.d.ts.map +1 -1
- package/lib/esm/common/internal/render/VertexTableBuilder.js +17 -8
- package/lib/esm/common/internal/render/VertexTableBuilder.js.map +1 -1
- package/lib/esm/extension/ExtensionAdmin.js +2 -2
- package/lib/esm/extension/ExtensionAdmin.js.map +1 -1
- package/lib/esm/internal/GoogleMapsDecorator.js +1 -1
- package/lib/esm/internal/GoogleMapsDecorator.js.map +1 -1
- package/lib/esm/internal/ScriptUtils.js +1 -0
- package/lib/esm/internal/ScriptUtils.js.map +1 -1
- package/lib/esm/internal/render/UpsampleRealityMeshParams.d.ts.map +1 -1
- package/lib/esm/internal/render/UpsampleRealityMeshParams.js +2 -1
- package/lib/esm/internal/render/UpsampleRealityMeshParams.js.map +1 -1
- package/lib/esm/internal/render/webgl/AtmosphereUniforms.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/AtmosphereUniforms.js +7 -2
- package/lib/esm/internal/render/webgl/AtmosphereUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/AttributeBuffers.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/AttributeBuffers.js +5 -3
- package/lib/esm/internal/render/webgl/AttributeBuffers.js.map +1 -1
- package/lib/esm/internal/render/webgl/AttributeMap.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/AttributeMap.js +2 -0
- package/lib/esm/internal/render/webgl/AttributeMap.js.map +1 -1
- package/lib/esm/internal/render/webgl/BackgroundMapDrape.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/BackgroundMapDrape.js +3 -3
- package/lib/esm/internal/render/webgl/BackgroundMapDrape.js.map +1 -1
- package/lib/esm/internal/render/webgl/BatchUniforms.js +1 -1
- package/lib/esm/internal/render/webgl/BatchUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/BranchState.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/BranchState.js +2 -1
- package/lib/esm/internal/render/webgl/BranchState.js.map +1 -1
- package/lib/esm/internal/render/webgl/BranchUniforms.js +3 -3
- package/lib/esm/internal/render/webgl/BranchUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/CachedGeometry.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/CachedGeometry.js +3 -3
- package/lib/esm/internal/render/webgl/CachedGeometry.js.map +1 -1
- package/lib/esm/internal/render/webgl/ClipStack.js +1 -1
- package/lib/esm/internal/render/webgl/ClipStack.js.map +1 -1
- package/lib/esm/internal/render/webgl/ColorInfo.js +2 -2
- package/lib/esm/internal/render/webgl/ColorInfo.js.map +1 -1
- package/lib/esm/internal/render/webgl/Contours.js +4 -4
- package/lib/esm/internal/render/webgl/Contours.js.map +1 -1
- package/lib/esm/internal/render/webgl/EDL.js +19 -19
- package/lib/esm/internal/render/webgl/EDL.js.map +1 -1
- package/lib/esm/internal/render/webgl/FeatureOverrides.js +5 -5
- package/lib/esm/internal/render/webgl/FeatureOverrides.js.map +1 -1
- package/lib/esm/internal/render/webgl/FrameBuffer.js +4 -4
- package/lib/esm/internal/render/webgl/FrameBuffer.js.map +1 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.js +2 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/GLTimer.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/GLTimer.js +2 -0
- package/lib/esm/internal/render/webgl/GLTimer.js.map +1 -1
- package/lib/esm/internal/render/webgl/MapLayerParams.js +3 -3
- package/lib/esm/internal/render/webgl/MapLayerParams.js.map +1 -1
- package/lib/esm/internal/render/webgl/MeshData.js +3 -3
- package/lib/esm/internal/render/webgl/MeshData.js.map +1 -1
- package/lib/esm/internal/render/webgl/PerformanceMetrics.js +1 -1
- package/lib/esm/internal/render/webgl/PerformanceMetrics.js.map +1 -1
- package/lib/esm/internal/render/webgl/PlanarClassifier.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/PlanarClassifier.js +8 -8
- package/lib/esm/internal/render/webgl/PlanarClassifier.js.map +1 -1
- package/lib/esm/internal/render/webgl/PlanarGrid.js +2 -2
- package/lib/esm/internal/render/webgl/PlanarGrid.js.map +1 -1
- package/lib/esm/internal/render/webgl/PlanarTextureProjection.d.ts +0 -3
- package/lib/esm/internal/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/PlanarTextureProjection.js +6 -5
- package/lib/esm/internal/render/webgl/PlanarTextureProjection.js.map +1 -1
- package/lib/esm/internal/render/webgl/PointCloud.js +2 -2
- package/lib/esm/internal/render/webgl/PointCloud.js.map +1 -1
- package/lib/esm/internal/render/webgl/RealityMesh.js +2 -2
- package/lib/esm/internal/render/webgl/RealityMesh.js.map +1 -1
- package/lib/esm/internal/render/webgl/RenderBuffer.js +3 -3
- package/lib/esm/internal/render/webgl/RenderBuffer.js.map +1 -1
- package/lib/esm/internal/render/webgl/SceneCompositor.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/SceneCompositor.js +116 -86
- package/lib/esm/internal/render/webgl/SceneCompositor.js.map +1 -1
- package/lib/esm/internal/render/webgl/ScratchDrawParams.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/ScratchDrawParams.js +11 -10
- package/lib/esm/internal/render/webgl/ScratchDrawParams.js.map +1 -1
- package/lib/esm/internal/render/webgl/ScreenSpaceEffect.js +4 -4
- package/lib/esm/internal/render/webgl/ScreenSpaceEffect.js.map +1 -1
- package/lib/esm/internal/render/webgl/ShaderProgram.js +4 -4
- package/lib/esm/internal/render/webgl/ShaderProgram.js.map +1 -1
- package/lib/esm/internal/render/webgl/ShadowUniforms.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/ShadowUniforms.js +2 -1
- package/lib/esm/internal/render/webgl/ShadowUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/SolarShadowMap.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/SolarShadowMap.js +7 -5
- package/lib/esm/internal/render/webgl/SolarShadowMap.js.map +1 -1
- package/lib/esm/internal/render/webgl/System.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/System.js +2 -2
- package/lib/esm/internal/render/webgl/System.js.map +1 -1
- package/lib/esm/internal/render/webgl/Target.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/Target.js +11 -8
- package/lib/esm/internal/render/webgl/Target.js.map +1 -1
- package/lib/esm/internal/render/webgl/Texture.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/Texture.js +11 -9
- package/lib/esm/internal/render/webgl/Texture.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Animation.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Animation.js +5 -3
- package/lib/esm/internal/render/webgl/glsl/Animation.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Color.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Color.js +2 -1
- package/lib/esm/internal/render/webgl/glsl/Color.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Composite.js +2 -2
- package/lib/esm/internal/render/webgl/glsl/Composite.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/CopyStencil.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/CopyStencil.js +3 -2
- package/lib/esm/internal/render/webgl/glsl/CopyStencil.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/PlanarClassification.js +4 -4
- package/lib/esm/internal/render/webgl/glsl/PlanarClassification.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/PlanarGrid.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/PlanarGrid.js +4 -3
- package/lib/esm/internal/render/webgl/glsl/PlanarGrid.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/RealityMesh.js +9 -9
- package/lib/esm/internal/render/webgl/glsl/RealityMesh.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Surface.js +11 -11
- package/lib/esm/internal/render/webgl/glsl/Surface.js.map +1 -1
- package/lib/esm/internal/render/webgl/glsl/Vertex.js +3 -3
- package/lib/esm/internal/render/webgl/glsl/Vertex.js.map +1 -1
- package/lib/esm/internal/tile/B3dmReader.d.ts.map +1 -1
- package/lib/esm/internal/tile/B3dmReader.js +2 -2
- package/lib/esm/internal/tile/B3dmReader.js.map +1 -1
- package/lib/esm/internal/tile/FetchCloudStorage.js +1 -1
- package/lib/esm/internal/tile/FetchCloudStorage.js.map +1 -1
- package/lib/esm/internal/tile/LRUTileList.d.ts.map +1 -1
- package/lib/esm/internal/tile/LRUTileList.js +4 -0
- package/lib/esm/internal/tile/LRUTileList.js.map +1 -1
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -1
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js +2 -1
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -1
- package/lib/esm/internal/tile/OPCFormatInterpreter.js +5 -5
- package/lib/esm/internal/tile/OPCFormatInterpreter.js.map +1 -1
- package/lib/esm/internal/tile/OrbitGtTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/OrbitGtTileTree.js +3 -3
- package/lib/esm/internal/tile/OrbitGtTileTree.js.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.js +4 -4
- package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/internal/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityTileLoader.js +3 -0
- package/lib/esm/internal/tile/RealityTileLoader.js.map +1 -1
- package/lib/esm/internal/tile/ThreeDTileFormatInterpreter.js +4 -4
- package/lib/esm/internal/tile/ThreeDTileFormatInterpreter.js.map +1 -1
- package/lib/esm/internal/tile/TileUserSet.d.ts.map +1 -1
- package/lib/esm/internal/tile/TileUserSet.js +4 -0
- package/lib/esm/internal/tile/TileUserSet.js.map +1 -1
- package/lib/esm/internal/tile/map/ArcGISTileMap.js +1 -1
- package/lib/esm/internal/tile/map/ArcGISTileMap.js.map +1 -1
- package/lib/esm/internal/tile/map/ArcGisUtilities.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ArcGisUtilities.js +4 -0
- package/lib/esm/internal/tile/map/ArcGisUtilities.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
- package/lib/esm/internal/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js +3 -3
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js +2 -2
- package/lib/esm/internal/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
- package/lib/esm/internal/tile/map/MapTileAvailability.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/MapTileAvailability.js +6 -3
- package/lib/esm/internal/tile/map/MapTileAvailability.js.map +1 -1
- package/lib/esm/internal/tile/map/WmtsCapabilities.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/WmtsCapabilities.js +3 -2
- package/lib/esm/internal/tile/map/WmtsCapabilities.js.map +1 -1
- package/lib/esm/properties/FormattedQuantityDescription.d.ts.map +1 -1
- package/lib/esm/properties/FormattedQuantityDescription.js +2 -0
- package/lib/esm/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/esm/quantity-formatting/BaseUnitFormattingSettingsProvider.d.ts.map +1 -1
- package/lib/esm/quantity-formatting/BaseUnitFormattingSettingsProvider.js +2 -0
- package/lib/esm/quantity-formatting/BaseUnitFormattingSettingsProvider.js.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.js +5 -3
- package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/esm/tile/GltfReader.d.ts +5 -2
- package/lib/esm/tile/GltfReader.d.ts.map +1 -1
- package/lib/esm/tile/GltfReader.js +55 -17
- package/lib/esm/tile/GltfReader.js.map +1 -1
- package/lib/esm/tile/RealityTile.d.ts.map +1 -1
- package/lib/esm/tile/RealityTile.js +3 -3
- package/lib/esm/tile/RealityTile.js.map +1 -1
- package/lib/esm/tile/RealityTileTree.d.ts.map +1 -1
- package/lib/esm/tile/RealityTileTree.js +6 -6
- package/lib/esm/tile/RealityTileTree.js.map +1 -1
- package/lib/esm/tile/TileAdmin.js.map +1 -1
- package/lib/esm/tile/TileDrawArgs.d.ts.map +1 -1
- package/lib/esm/tile/TileDrawArgs.js +2 -1
- package/lib/esm/tile/TileDrawArgs.js.map +1 -1
- package/lib/esm/tile/map/ImageryTileTree.js +2 -2
- package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.js +2 -2
- package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/esm/tile/map/MapLayerSources.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerSources.js +10 -2
- package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
- package/lib/esm/tile/map/MapTile.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTile.js +11 -9
- package/lib/esm/tile/map/MapTile.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +9 -8
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tile/map/MapTilingScheme.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTilingScheme.js +2 -1
- package/lib/esm/tile/map/MapTilingScheme.js.map +1 -1
- package/lib/esm/tools/Tool.js +2 -2
- package/lib/esm/tools/Tool.js.map +1 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +20 -20
package/lib/cjs/ViewState.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewState.js","sourceRoot":"","sources":["../../src/ViewState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAqG;AACrG,wDAI8B;AAC9B,oDAK4B;AAC5B,+CAAkG;AAElG,2DAAkG;AAElG,+CAA6C;AAC7C,2CAAwC;AACxC,2CAAwC;AAExC,6CAA0E;AAC1E,+DAAoF;AAKpF,iDAA8D;AAC9D,8CAA0E;AAG1E,6DAA+F;AAC/F,iDAA8C;AAE9C,yCAA8D;AAC9D,6CAA0C;AAC1C,qEAAkE;AAClE,uDAAqE;AAkHrE,uGAAuG;AACvG,MAAM,aAAa;IACmB;IAApC,YAAoC,KAAgB;QAAhB,UAAK,GAAL,KAAK,CAAW;IAAI,CAAC;IAEzC,oBAAoB,GAAG,IAAI,CAAC;IAErC,QAAQ,CAAC,OAAwB;QACtC,MAAM,EAAE,GAAG,OAAO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IACA,CAAE,gBAAgB;QAChC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,MAAM,IAAI,CAAC,YAAY,CAAC;QAC1B,CAAC;IACH,CAAC;IAEM,oBAAoB,CAAC,OAAe,IAAyB,OAAO,mCAAqB,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CACpI;AAvID,kCAuIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { assert, BeEvent, dispose, Id64, Id64Arg, Id64String, JsonUtils } from \"@itwin/core-bentley\";\nimport {\n Angle, AxisOrder, ClipVector, Constant, Geometry, LongitudeLatitudeNumber, LowAndHighXY, LowAndHighXYZ, Map4d, Matrix3d,\n Plane3dByOriginAndUnitNormal, Point2d, Point3d, Range2d, Range3d, Ray3d, Transform, Vector2d, Vector3d, XAndY,\n XYAndZ, XYZ, YawPitchRollAngles,\n} from \"@itwin/core-geometry\";\nimport {\n AnalysisStyle, AxisAlignedBox3d, Camera, Cartographic, ColorDef, FeatureAppearance, Frustum, GlobeMode, GridOrientationType,\n HydrateViewStateRequestProps, HydrateViewStateResponseProps, IModelReadRpcInterface,\n ModelClipGroups, Npc, RenderSchedule, SubCategoryOverride,\n ViewDefinition2dProps, ViewDefinition3dProps, ViewDefinitionProps, ViewDetails, ViewDetails3d, ViewFlags, ViewStateProps,\n} from \"@itwin/core-common\";\nimport { AuxCoordSystem2dState, AuxCoordSystem3dState, AuxCoordSystemState } from \"./AuxCoordSys\";\nimport { CategorySelectorState } from \"./CategorySelectorState\";\nimport { DisplayStyle2dState, DisplayStyle3dState, DisplayStyleState } from \"./DisplayStyleState\";\nimport { DrawingViewState } from \"./DrawingViewState\";\nimport { ElementState } from \"./EntityState\";\nimport { Frustum2d } from \"./Frustum2d\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { GeometricModel2dState, GeometricModelState } from \"./ModelState\";\nimport { NotifyMessageDetails, OutputMessagePriority } from \"./NotificationManager\";\nimport { RenderClipVolume } from \"./render/RenderClipVolume\";\nimport { RenderMemory } from \"./render/RenderMemory\";\nimport { SheetViewState } from \"./SheetViewState\";\nimport { SpatialViewState } from \"./SpatialViewState\";\nimport { StandardView, StandardViewId } from \"./StandardView\";\nimport { DisclosedTileTreeSet, TileTreeReference } from \"./tile/internal\";\nimport { MarginOptions, OnViewExtentsError } from \"./ViewAnimation\";\nimport { DecorateContext, SceneContext } from \"./ViewContext\";\nimport { areaToEyeHeight, areaToEyeHeightFromGcs, GlobalLocation } from \"./ViewGlobalLocation\";\nimport { ViewingSpace } from \"./ViewingSpace\";\nimport { Viewport } from \"./Viewport\";\nimport { ViewPose, ViewPose2d, ViewPose3d } from \"./ViewPose\";\nimport { ViewStatus } from \"./ViewStatus\";\nimport { EnvironmentDecorations } from \"./EnvironmentDecorations\";\nimport { _scheduleScriptReference } from \"./common/internal/Symbols\";\n\n/** Describes the largest and smallest values allowed for the extents of a [[ViewState]].\n * Attempts to exceed these limits in any dimension will fail, preserving the previous extents.\n * @public\n * @extensions\n */\nexport interface ExtentLimits {\n /** The smallest allowed extent in any dimension. */\n min: number;\n /** The largest allowed extent in any dimension. */\n max: number;\n}\n\n/** A [Transform]($core-geometry) supplied by a [[ModelDisplayTransformProvider]] to be applied to a model when displaying it in a [[Viewport]].\n * @beta\n */\nexport interface ModelDisplayTransform {\n /** The transform to be applied to the model. */\n transform: Transform;\n /** If `true`, [[transform]] is pre-multiplied with (i.e., appled before) the model's base transform.\n * Otherwise, the display transform will instead be post-multiplied with (i.e., applied after) the base transform.\n */\n premultiply?: boolean;\n}\n\n/** Interface adopted by an object that wants to apply a [[ModelDisplayTransform]] to one or more models within a [[Viewport]].\n * @see [[ViewState.modelDisplayTransformProvider]] to get or set the transform provider for a view.\n * @see [[ViewState.computeDisplayTransform]] to compute a full display transform for a model or an element within it, which may include a transform supplied by a ModelDisplayTransformProvider.\n * @beta\n */\nexport interface ModelDisplayTransformProvider {\n /** Return the transform to be applied to the specified model, if any. */\n getModelDisplayTransform(modelId: Id64String): ModelDisplayTransform | undefined;\n}\n\n/** Arguments supplied to [[ViewState.computeDisplayTransform]].\n * @beta\n */\nexport interface ComputeDisplayTransformArgs {\n /** The Id of the model for which to compute the display transform. */\n modelId: Id64String;\n /** The Id of a specific element belonging to the model identified by [[modelId]] for which to compute the display transform. */\n elementId?: Id64String;\n /** The point in time, expressed in [Unix seconds](https://en.wikipedia.org/wiki/Unix_time), at which to evaluate the display transform.\n * Defaults to the [DisplayStyleSettings.timePoint]($common) specified by the view's display style.\n */\n timePoint?: number;\n /** The element Id of the [ViewAttachment]($backend) through which the element or model is drawn.\n * @beta\n */\n viewAttachmentId?: Id64String;\n /** True if the element or model was drawn through a [[SpatialViewState]] attached to a [SectionDrawing]($backend).\n * @beta\n */\n inSectionDrawingAttachment?: boolean;\n /** If supplied, [[ViewState.computeDisplayTransform]] will modify and return this Transform to hold the result instead of allocating a new Transform.\n * @note If [[ViewState.computeDisplayTransform]] returns `undefined`, this Transform will be unmodified.\n */\n output?: Transform;\n}\n\n/** Arguments to [[ViewState3d.lookAt]] for either a perspective or orthographic view\n * @public\n */\nexport interface LookAtArgs {\n /** The new location of the camera/eye. */\n readonly eyePoint: XYAndZ;\n /** A vector that orients the camera's \"up\" (view y). This vector must not be parallel to the view direction. */\n readonly upVector: Vector3d;\n /** The new size (width and height) of the view rectangle on the focus plane centered on the targetPoint. If undefined, the existing size is unchanged. */\n readonly newExtents?: XAndY;\n /** The distance from the eyePoint to the front plane. If undefined, the existing front distance is used. */\n readonly frontDistance?: number;\n /** The distance from the eyePoint to the back plane. If undefined, the existing back distance is used. */\n readonly backDistance?: number;\n /** Used for providing onExtentsError. */\n readonly opts?: OnViewExtentsError;\n}\n\n/** Arguments to [[ViewState3d.lookAt]] to set up a perspective view\n * @public\n */\nexport interface LookAtPerspectiveArgs extends LookAtArgs {\n /** The new location to which the camera should point. This becomes the center of the view on the focus plane. */\n readonly targetPoint: XYAndZ;\n\n readonly viewDirection?: never;\n readonly lensAngle?: never;\n}\n\n/** Arguments to [[ViewState3d.lookAt]] to set up an orthographic view\n * @public\n */\nexport interface LookAtOrthoArgs extends LookAtArgs {\n /** The direction in which the view should look. */\n readonly viewDirection: XYAndZ;\n\n readonly targetPoint?: never;\n readonly lensAngle?: never;\n}\n\n/** Arguments to [[ViewState3d.lookAt]] to set up an perspective view using a (field-of-view) lens angle.\n * @public\n */\nexport interface LookAtUsingLensAngle extends LookAtArgs {\n /** The new location to which the camera should point. This becomes the center of the view on the focus plane. */\n readonly targetPoint: XYAndZ;\n /** The angle that defines the field-of-view for the camera. Must be between .0001 and pi. */\n readonly lensAngle: Angle;\n\n readonly viewDirection?: never;\n}\n\n/** Decorates the viewport with the view's grid. Graphics are cached as long as scene remains valid. */\nclass GridDecorator {\n public constructor(private readonly _view: ViewState) { }\n\n public readonly useCachedDecorations = true;\n\n public decorate(context: DecorateContext): void {\n const vp = context.viewport;\n if (!vp.isGridOn)\n return;\n\n const orientation = this._view.getGridOrientation();\n if (GridOrientationType.AuxCoord < orientation) {\n return; // NEEDSWORK...\n }\n if (GridOrientationType.AuxCoord === orientation) {\n this._view.auxiliaryCoordinateSystem.drawGrid(context);\n return;\n }\n\n const isoGrid = false;\n const gridsPerRef = this._view.getGridsPerRef();\n const spacing = Point2d.createFrom(this._view.getGridSpacing());\n const origin = Point3d.create();\n const matrix = Matrix3d.createIdentity();\n const fixedRepsAuto = Point2d.create();\n\n this._view.getGridSettings(vp, origin, matrix, orientation);\n context.drawStandardGrid(origin, matrix, spacing, gridsPerRef, isoGrid, orientation !== GridOrientationType.View ? fixedRepsAuto : undefined);\n }\n}\n\nconst scratchCorners = Range3d.createNull().corners();\nconst scratchRay = Ray3d.createZero();\nconst unitRange2d = Range2d.createXYXY(0, 0, 1, 1);\nconst scratchRange2d = Range2d.createNull();\nconst scratchRange2dIntersect = Range2d.createNull();\n\n/** Arguments to [[ViewState.attachToViewport]].\n * @note The [[Viewport]] has a dependency upon and control over the [[ViewState]]. Do not use `attachToViewport` to introduce a dependency in\n * the opposite direction.\n * @public\n */\nexport type AttachToViewportArgs = Viewport;\n\n/** Arguments to [[ViewState.getAttachmentViewport]].\n * @internal\n */\nexport interface GetAttachmentViewportArgs {\n viewAttachmentId?: Id64String;\n inSectionDrawingAttachment?: boolean;\n}\n\n/** The front-end state of a [[ViewDefinition]] element.\n * A ViewState is typically associated with a [[Viewport]] to display the contents of the view on the screen. A ViewState being displayed by a Viewport is considered to be\n * \"attached\" to that viewport; a \"detached\" viewport is not being displayed by any viewport. Because the Viewport modifies the state of its attached ViewState, a ViewState\n * can only be attached to one Viewport at a time. Technically, two Viewports can display two different ViewStates that both use the same [[DisplayStyleState]], but this is\n * discouraged - changes made to the style by one Viewport will affect the contents of the other Viewport.\n * * @see [Views]($docs/learning/frontend/Views.md)\n * @public\n * @extensions\n */\nexport abstract class ViewState extends ElementState {\n public static override get className() { return \"ViewDefinition\"; }\n\n private _auxCoordSystem?: AuxCoordSystemState;\n private _extentLimits?: ExtentLimits;\n private _modelDisplayTransformProvider?: ModelDisplayTransformProvider;\n public description?: string;\n public isPrivate?: boolean;\n private readonly _gridDecorator: GridDecorator;\n private _categorySelector: CategorySelectorState;\n private _displayStyle: DisplayStyleState;\n private readonly _unregisterCategorySelectorListeners: VoidFunction[] = [];\n\n /** An event raised when the set of categories viewed by this view changes, *only* if the view is attached to a [[Viewport]]. */\n public readonly onViewedCategoriesChanged = new BeEvent<() => void>();\n\n /** An event raised just before assignment to the [[displayStyle]] property, *only* if the view is attached to a [[Viewport]].\n * @see [[DisplayStyleSettings]] for events raised when properties of the display style change.\n */\n public readonly onDisplayStyleChanged = new BeEvent<(newStyle: DisplayStyleState) => void>();\n\n /** Event raised just before assignment to the [[modelDisplayTransformProvider]] property, *only* if the view is attached to a [[Viewport]].\n * @beta\n */\n public readonly onModelDisplayTransformProviderChanged = new BeEvent<(newProvider: ModelDisplayTransformProvider | undefined) => void>();\n\n /** Selects the categories that are display by this ViewState. */\n public get categorySelector(): CategorySelectorState {\n return this._categorySelector;\n }\n\n public set categorySelector(selector: CategorySelectorState) {\n if (selector === this._categorySelector)\n return;\n\n const isAttached = this.isAttachedToViewport;\n this.unregisterCategorySelectorListeners();\n\n this._categorySelector = selector;\n\n if (isAttached) {\n this.registerCategorySelectorListeners();\n this.onViewedCategoriesChanged.raiseEvent();\n }\n }\n\n /** The style that controls how the contents of the view are displayed. */\n public get displayStyle(): DisplayStyleState {\n return this._displayStyle;\n }\n\n public set displayStyle(style: DisplayStyleState) {\n if (style === this.displayStyle)\n return;\n\n if (this.isAttachedToViewport)\n this.onDisplayStyleChanged.raiseEvent(style);\n\n this._displayStyle = style;\n }\n\n /** @internal */\n protected constructor(props: ViewDefinitionProps, iModel: IModelConnection, categoryOrClone: CategorySelectorState, displayStyle: DisplayStyleState) {\n super(props, iModel);\n this.description = props.description;\n this.isPrivate = props.isPrivate;\n this._displayStyle = displayStyle;\n this._categorySelector = categoryOrClone;\n this._gridDecorator = new GridDecorator(this);\n if (!(categoryOrClone instanceof ViewState)) // is this from the clone method?\n return; // not from clone\n\n // from clone, 3rd argument is source ViewState\n const source = categoryOrClone as ViewState;\n this._categorySelector = source.categorySelector.clone();\n this._displayStyle = source.displayStyle.clone();\n this._extentLimits = source._extentLimits;\n this._auxCoordSystem = source._auxCoordSystem;\n this._modelDisplayTransformProvider = source._modelDisplayTransformProvider;\n }\n\n /** Create a new ViewState object from a set of properties. Generally this is called internally by [[IModelConnection.Views.load]] after the properties\n * have been read from an iModel. But, it can also be used to create a ViewState in memory, from scratch or from properties stored elsewhere.\n */\n public static createFromProps(_props: ViewStateProps, _iModel: IModelConnection): ViewState | undefined { return undefined; }\n\n /** Serialize this ViewState as a set of properties that can be used to recreate it via [[ViewState.createFromProps]]. */\n public toProps(): ViewStateProps {\n return {\n viewDefinitionProps: this.toJSON(),\n categorySelectorProps: this.categorySelector.toJSON(),\n displayStyleProps: this.displayStyle.toJSON(),\n };\n }\n\n /** Flags controlling various aspects of this view's [[DisplayStyleState]].\n * @see [DisplayStyleSettings.viewFlags]($common)\n */\n public get viewFlags(): ViewFlags {\n return this.displayStyle.viewFlags;\n }\n public set viewFlags(flags: ViewFlags) {\n this.displayStyle.viewFlags = flags;\n }\n\n /** See [DisplayStyleSettings.analysisStyle]($common). */\n public get analysisStyle(): AnalysisStyle | undefined {\n return this.displayStyle.settings.analysisStyle;\n }\n\n /** The [RenderSchedule.Script]($common) that animates the contents of the view, if any.\n * @see [[DisplayStyleState.scheduleScript]].\n */\n public get scheduleScript(): RenderSchedule.Script | undefined {\n return this.displayStyle.scheduleScript;\n }\n\n /** @internal */\n public get [_scheduleScriptReference](): RenderSchedule.ScriptReference | undefined {\n return this.displayStyle[_scheduleScriptReference];\n }\n\n /** Get the globe projection mode.\n * @internal\n */\n public get globeMode(): GlobeMode { return this.displayStyle.globeMode; }\n\n /** Determine whether this ViewState exactly matches another. */\n public override equals(other: this): boolean { return super.equals(other) && this.categorySelector.equals(other.categorySelector) && this.displayStyle.equals(other.displayStyle); }\n\n /** Convert to JSON representation. */\n public override toJSON(): ViewDefinitionProps {\n const json = super.toJSON() as ViewDefinitionProps;\n json.categorySelectorId = this.categorySelector.id;\n json.displayStyleId = this.displayStyle.id;\n json.isPrivate = this.isPrivate;\n json.description = this.description;\n return json;\n }\n\n /**\n * Populates the hydrateRequest object stored on the ViewState with:\n * not loaded categoryIds based off of the ViewStates categorySelector.\n * Auxiliary coordinate system id if valid.\n */\n protected preload(hydrateRequest: HydrateViewStateRequestProps): void {\n const acsId = this.getAuxiliaryCoordinateSystemId();\n if (Id64.isValid(acsId))\n hydrateRequest.acsId = acsId;\n }\n\n /** Asynchronously load any required data for this ViewState from the backend.\n * FINAL, No subclass should override load. If additional load behavior is needed, see preload and postload.\n * @note callers should await the Promise returned by this method before using this ViewState.\n * @see [Views]($docs/learning/frontend/Views.md)\n */\n public async load(): Promise<void> {\n // If the iModel associated with the viewState is a blankConnection,\n // then no data can be retrieved from the backend.\n if (this.iModel.isBlank)\n return;\n\n const hydrateRequest: HydrateViewStateRequestProps = {};\n this.preload(hydrateRequest);\n const promises: Promise<void>[] = [\n IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).hydrateViewState(this.iModel.getRpcProps(), hydrateRequest).\n then(async (hydrateResponse) => this.postload(hydrateResponse)),\n this.displayStyle.load(),\n ];\n\n const subcategories = this.iModel.subcategories.load(this.categorySelector.categories);\n if (undefined !== subcategories)\n promises.push(subcategories.promise.then((_) => { }));\n\n await Promise.all(promises);\n }\n\n protected async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\n if (hydrateResponse.acsElementProps)\n this._auxCoordSystem = AuxCoordSystemState.fromProps(hydrateResponse.acsElementProps, this.iModel);\n }\n\n /** Returns true if all [[TileTree]]s required by this view have been loaded.\n * Note that the map tile trees associated to the viewport rather than the view, to check the\n * map tiles as well call [[Viewport.areAreAllTileTreesLoaded]].\n */\n public get areAllTileTreesLoaded(): boolean {\n for (const ref of this.getTileTreeRefs()) {\n if (!ref.isLoadingComplete) {\n return false;\n }\n }\n\n return true;\n }\n\n /** Get the name of the [[ViewDefinition]] from which this ViewState originated. */\n public get name(): string {\n return this.code.value;\n }\n\n /** Get this view's background color. */\n public get backgroundColor(): ColorDef {\n return this.displayStyle.backgroundColor;\n }\n\n /** Query the symbology overrides applied to geometry belonging to a specific subcategory when rendered using this ViewState.\n * @param id The Id of the subcategory.\n * @return The symbology overrides applied to all geometry belonging to the specified subcategory, or undefined if no such overrides exist.\n */\n public getSubCategoryOverride(id: Id64String): SubCategoryOverride | undefined {\n return this.displayStyle.getSubCategoryOverride(id);\n }\n\n /** Query the symbology overrides applied to a model when rendered using this ViewState.\n * @param id The Id of the model.\n * @return The symbology overrides applied to the model, or undefined if no such overrides exist.\n */\n public getModelAppearanceOverride(id: Id64String): FeatureAppearance | undefined {\n return this.displayStyle.settings.getModelAppearanceOverride(id);\n }\n\n /** @internal */\n public isSubCategoryVisible(id: Id64String): boolean {\n const app = this.iModel.subcategories.getSubCategoryAppearance(id);\n if (undefined === app)\n return false;\n\n const ovr = this.getSubCategoryOverride(id);\n if (undefined === ovr || undefined === ovr.invisible)\n return !app.invisible;\n\n return !ovr.invisible;\n }\n\n /** Provides access to optional detail settings for this view. */\n public abstract get details(): ViewDetails;\n\n /** Returns true if this ViewState is-a [[ViewState3d]] */\n public abstract is3d(): this is ViewState3d;\n /** Returns true if this ViewState is-a [[ViewState2d]] */\n public is2d(): this is ViewState2d { return !this.is3d(); }\n /** Returns true if this ViewState is-a [[SpatialViewState]] */\n public abstract isSpatialView(): this is SpatialViewState;\n /** Returns true if this ViewState is-a [[DrawingViewState]] */\n public abstract isDrawingView(): this is DrawingViewState;\n /** Returns true if this ViewState is-a [[SheetViewState]] */\n public isSheetView(): this is SheetViewState { return false; }\n /** Returns true if [[ViewTool]]s are allowed to operate in three dimensions on this view. */\n public abstract allow3dManipulations(): boolean;\n /** @internal */\n public abstract createAuxCoordSystem(acsName: string): AuxCoordSystemState;\n /** Get the extents of this view in [[CoordSystem.World]] coordinates. */\n public abstract getViewedExtents(): AxisAlignedBox3d;\n /** Compute a range in [[CoordSystem.World]] coordinates that tightly encloses the contents of this view.\n * @see [[FitViewTool]].\n */\n public abstract computeFitRange(): Range3d;\n\n /** Returns true if this view displays the contents of a [[Model]] specified by Id. */\n public abstract viewsModel(modelId: Id64String): boolean;\n\n /** Get the origin of this view in [[CoordSystem.World]] coordinates. */\n public abstract getOrigin(): Point3d;\n\n /** Get the extents of this view in [[CoordSystem.World]] coordinates. */\n public abstract getExtents(): Vector3d;\n\n /** Get the 3x3 ortho-normal Matrix3d for this view. */\n public abstract getRotation(): Matrix3d;\n\n /** Set the origin of this view in [[CoordSystem.World]] coordinates. */\n public abstract setOrigin(viewOrg: XYAndZ): void;\n\n /** Set the extents of this view in [[CoordSystem.World]] coordinates. */\n public abstract setExtents(viewDelta: Vector3d): void;\n\n /** set the center of this view to a new position. */\n public setCenter(center: Point3d) {\n const diff = center.minus(this.getCenter());\n this.setOrigin(this.getOrigin().plus(diff));\n }\n\n /** Change the rotation of the view.\n * @note viewRot must be ortho-normal. For 2d views, only the rotation angle about the z axis is used.\n */\n public abstract setRotation(viewRot: Matrix3d): void;\n\n /** Execute a function on each viewed model */\n public abstract forEachModel(func: (model: GeometricModelState) => void): void;\n\n /** @internal */\n public abstract getModelTreeRefs(): Iterable<TileTreeReference>;\n\n /** Execute a function against each [[TileTreeReference]] associated with this view.\n * This may include tile trees not associated with any [[GeometricModelState]] - e.g., context reality data.\n * @note This method is inefficient (iteration cannot be aborted) and awkward (callback cannot be async nor return a value). Prefer to iterate using [[getTileTreeRefs]].\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[getTileTreeRefs]] instead.\n */\n public forEachTileTreeRef(func: (treeRef: TileTreeReference) => void): void {\n for (const ref of this.getModelTreeRefs()) {\n func(ref);\n }\n\n for (const ref of this.displayStyle.getTileTreeRefs()) {\n func(ref);\n }\n }\n\n public * getTileTreeRefs(): Iterable<TileTreeReference> {\n yield * this.getModelTreeRefs();\n yield * this.displayStyle.getTileTreeRefs();\n }\n\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.\n * @internal\n */\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n for (const ref of this.getTileTreeRefs()) {\n trees.disclose(ref);\n }\n }\n\n /** Discloses graphics memory consumed by viewed tile trees and other consumers like view attachments.\n * @internal\n */\n public collectStatistics(stats: RenderMemory.Statistics): void {\n const trees = new DisclosedTileTreeSet();\n this.discloseTileTrees(trees);\n for (const tree of trees)\n tree.collectStatistics(stats);\n\n this.collectNonTileTreeStatistics(stats);\n }\n\n /** Discloses graphics memory consumed by any consumers *other* than viewed tile trees, like view attachments.\n * @internal\n */\n public collectNonTileTreeStatistics(_stats: RenderMemory.Statistics): void {\n //\n }\n\n /** Capture a copy of this view's viewed volume.\n * @see [[applyPose]] to apply the pose to this or another view.\n * @public\n * @extensions\n */\n public abstract savePose(): ViewPose;\n\n /** Apply a pose to this view to change the viewed volume.\n * @see [[savePose]] to capture the view's pose.\n * @public\n * @extensions\n */\n public abstract applyPose(props: ViewPose): this;\n\n /** @internal */\n public createScene(context: SceneContext): void {\n for (const ref of this.getTileTreeRefs()) {\n ref.addToScene(context);\n }\n }\n\n /** Add view-specific decorations. The base implementation draws the grid. Subclasses must invoke super.decorate()\n * @internal\n */\n public decorate(context: DecorateContext): void {\n this.drawGrid(context);\n }\n\n /** @internal */\n public static getStandardViewMatrix(id: StandardViewId): Matrix3d {\n return StandardView.getStandardRotation(id);\n }\n\n /** Orient this view to one of the [[StandardView]] rotations. */\n public setStandardRotation(id: StandardViewId) { this.setRotation(ViewState.getStandardViewMatrix(id)); }\n\n /** Orient this view to one of the [[StandardView]] rotations, if the the view is not viewing the project then the\n * standard rotation is relative to the global position rather than the project.\n */\n public setStandardGlobalRotation(id: StandardViewId) {\n const worldToView = ViewState.getStandardViewMatrix(id);\n const globeToWorld = this.getGlobeRotation();\n if (globeToWorld)\n return this.setRotation(worldToView.multiplyMatrixMatrix(globeToWorld));\n else\n this.setRotation(worldToView);\n }\n\n /** Get the target point of the view. If there is no camera, center is returned. */\n public getTargetPoint(result?: Point3d): Point3d { return this.getCenter(result); }\n\n /** Get the point at the geometric center of the view. */\n public getCenter(result?: Point3d): Point3d {\n const delta = this.getRotation().multiplyTransposeVector(this.getExtents());\n return this.getOrigin().plusScaled(delta, 0.5, result);\n }\n\n /** @internal */\n public drawGrid(context: DecorateContext): void {\n context.addFromDecorator(this._gridDecorator);\n }\n\n /** @internal */\n public computeWorldToNpc(viewRot?: Matrix3d, inOrigin?: Point3d, delta?: Vector3d, enforceFrontToBackRatio = true): { map: Map4d | undefined, frustFraction: number } {\n if (viewRot === undefined)\n viewRot = this.getRotation();\n\n const xVector = viewRot.rowX();\n const yVector = viewRot.rowY();\n const zVector = viewRot.rowZ();\n\n if (delta === undefined)\n delta = this.getExtents();\n if (inOrigin === undefined)\n inOrigin = this.getOrigin();\n\n let frustFraction = 1.0;\n let xExtent: Vector3d;\n let yExtent: Vector3d;\n let zExtent: Vector3d;\n let origin: Point3d;\n\n // Compute root vectors along edges of view frustum.\n if (this.is3d() && this.isCameraOn) {\n const camera = this.camera;\n const eyeToOrigin = Vector3d.createStartEnd(camera.eye, inOrigin); // vector from origin on backplane to eye\n viewRot.multiplyVectorInPlace(eyeToOrigin); // align with view coordinates.\n\n const focusDistance = camera.focusDist;\n let zDelta = delta.z;\n let zBack = eyeToOrigin.z; // Distance from eye to backplane.\n let zFront = zBack + zDelta; // Distance from eye to frontplane.\n\n const nearScale = IModelApp.renderSystem.supportsLogZBuffer ? ViewingSpace.nearScaleLog24 : ViewingSpace.nearScaleNonLog24;\n if (enforceFrontToBackRatio && zFront / zBack < nearScale) {\n // In this case we are running up against the zBuffer resolution limitation (currently 24 bits).\n // Set back clipping plane at 10 kilometer which gives us a front clipping plane about 3 meters.\n // Decreasing the maximumBackClip (MicroStation uses 1 kilometer) will reduce the minimum front\n // clip, but also reduce the back clip (so far geometry may not be visible).\n const maximumBackClip = 10 * Constant.oneKilometer;\n if (-zBack > maximumBackClip) {\n zBack = -maximumBackClip;\n eyeToOrigin.z = zBack;\n }\n\n zFront = zBack * nearScale;\n zDelta = zFront - eyeToOrigin.z;\n }\n\n // z out back of eye ===> origin z coordinates are negative. (Back plane more negative than front plane)\n const backFraction = -zBack / focusDistance; // Perspective fraction at back clip plane.\n const frontFraction = -zFront / focusDistance; // Perspective fraction at front clip plane.\n frustFraction = frontFraction / backFraction;\n\n // delta.x,delta.y are view rectangle sizes at focus distance. Scale to back plane:\n xExtent = xVector.scale(delta.x * backFraction); // xExtent at back == delta.x * backFraction.\n yExtent = yVector.scale(delta.y * backFraction); // yExtent at back == delta.y * backFraction.\n\n // Calculate the zExtent in the View coordinate system.\n zExtent = new Vector3d(eyeToOrigin.x * (frontFraction - backFraction), eyeToOrigin.y * (frontFraction - backFraction), zDelta);\n viewRot.multiplyTransposeVectorInPlace(zExtent); // rotate back to root coordinates.\n\n origin = new Point3d(\n eyeToOrigin.x * backFraction, // Calculate origin in eye coordinates\n eyeToOrigin.y * backFraction,\n eyeToOrigin.z);\n\n viewRot.multiplyTransposeVectorInPlace(origin); // Rotate back to root coordinates\n origin.plus(camera.eye, origin); // Add the eye point.\n } else {\n origin = inOrigin;\n xExtent = xVector.scale(delta.x);\n yExtent = yVector.scale(delta.y);\n zExtent = zVector.scale(delta.z ? delta.z : 1.0);\n }\n\n // calculate the root-to-npc mapping (using expanded frustum)\n return { map: Map4d.createVectorFrustum(origin, xExtent, yExtent, zExtent, frustFraction), frustFraction };\n }\n\n /** Calculate the world coordinate Frustum from the parameters of this ViewState.\n * @param result Optional Frustum to hold result. If undefined a new Frustum is created.\n * @returns The 8-point Frustum with the corners of this ViewState, or undefined if the parameters are invalid.\n */\n public calculateFrustum(result?: Frustum): Frustum | undefined {\n const val = this.computeWorldToNpc();\n if (undefined === val.map)\n return undefined;\n\n const box = result ? result.initNpc() : new Frustum();\n val.map.transform1.multiplyPoint3dArrayQuietNormalize(box.points);\n return box;\n }\n\n public calculateFocusCorners() {\n const map = this.computeWorldToNpc().map!;\n const focusNpcZ = Geometry.clamp(map.transform0.multiplyPoint3dQuietNormalize(this.getTargetPoint()).z, 0, 1.0);\n const pts = [new Point3d(0.0, 0.0, focusNpcZ), new Point3d(1.0, 0.0, focusNpcZ), new Point3d(0.0, 1.0, focusNpcZ), new Point3d(1.0, 1.0, focusNpcZ)];\n map.transform1.multiplyPoint3dArrayQuietNormalize(pts);\n return pts;\n }\n\n /** Initialize the origin, extents, and rotation from an existing Frustum\n * This function is commonly used in the implementation of [[ViewTool]]s as follows:\n * 1. Obtain the ViewState's initial frustum.\n * 2. Modify the frustum based on user input.\n * 3. Update the ViewState to match the modified frustum.\n * @param frustum the input Frustum.\n * @param opts for providing onExtentsError\n * @return Success if the frustum was successfully updated, or an appropriate error code.\n */\n public setupFromFrustum(inFrustum: Frustum, opts?: OnViewExtentsError): ViewStatus {\n const frustum = inFrustum.clone(); // make sure we don't modify input frustum\n frustum.fixPointOrder();\n const frustPts = frustum.points;\n const viewOrg = frustPts[Npc.LeftBottomRear];\n\n // frustumX, frustumY, frustumZ are vectors along edges of the frustum. They are NOT unit vectors.\n // X and Y should be perpendicular, and Z should be right handed.\n const frustumX = Vector3d.createFrom(frustPts[Npc.RightBottomRear].minus(viewOrg));\n const frustumY = Vector3d.createFrom(frustPts[Npc.LeftTopRear].minus(viewOrg));\n const frustumZ = Vector3d.createFrom(frustPts[Npc.LeftBottomFront].minus(viewOrg));\n\n const frustMatrix = Matrix3d.createRigidFromColumns(frustumX, frustumY, AxisOrder.XYZ);\n if (!frustMatrix)\n return ViewStatus.InvalidWindow;\n\n // if we're close to one of the standard views, adjust to it to remove any \"fuzz\"\n StandardView.adjustToStandardRotation(frustMatrix);\n\n const xDir = frustMatrix.getColumn(0);\n const yDir = frustMatrix.getColumn(1);\n const zDir = frustMatrix.getColumn(2);\n\n // set up view Rotation matrix as rows of frustum matrix.\n const viewRot = frustMatrix.inverse();\n if (!viewRot)\n return ViewStatus.InvalidWindow;\n\n // Left handed frustum?\n const zSize = zDir.dotProduct(frustumZ);\n if (zSize < 0.0)\n return ViewStatus.InvalidWindow;\n\n const viewDiagRoot = new Vector3d();\n viewDiagRoot.plus2Scaled(xDir, xDir.dotProduct(frustumX), yDir, yDir.dotProduct(frustumY), viewDiagRoot); // vectors on the back plane\n viewDiagRoot.plusScaled(zDir, zSize, viewDiagRoot); // add in z vector perpendicular to x,y\n\n // use center of frustum and view diagonal for origin. Original frustum may not have been orthogonal\n frustum.getCenter().plusScaled(viewDiagRoot, -0.5, viewOrg);\n\n // delta is in view coordinates\n const viewDelta = viewRot.multiplyVector(viewDiagRoot);\n const status = this.adjustViewDelta(viewDelta, viewOrg, viewRot, undefined, opts);\n if (ViewStatus.Success !== status)\n return status;\n\n this.setOrigin(viewOrg);\n this.setExtents(viewDelta);\n this.setRotation(viewRot);\n this._updateMaxGlobalScopeFactor();\n return ViewStatus.Success;\n }\n\n /** Get or set the largest and smallest values allowed for the extents for this ViewState\n * The default limits vary based on the type of view:\n * - Spatial and drawing view extents cannot exceed the diameter of the earth.\n * - Sheet view extents cannot exceed ten times the paper size of the sheet.\n * Explicitly setting the extent limits overrides the default limits.\n * @see [[resetExtentLimits]] to restore the default limits.\n */\n public get extentLimits(): ExtentLimits { return undefined !== this._extentLimits ? this._extentLimits : this.defaultExtentLimits; }\n public set extentLimits(limits: ExtentLimits) { this._extentLimits = limits; }\n\n /** Resets the largest and smallest values allowed for the extents of this ViewState to their default values.\n * @see [[extentLimits]].\n */\n public resetExtentLimits(): void { this._extentLimits = undefined; }\n\n /** Returns the default extent limits for this ViewState. These limits are used if the [[extentLimits]] have not been explicitly overridden.\n */\n public abstract get defaultExtentLimits(): ExtentLimits;\n\n public setDisplayStyle(style: DisplayStyleState) { this.displayStyle = style; }\n\n /** Adjust the y dimension of this ViewState so that its aspect ratio matches the supplied value.\n * @internal\n */\n public fixAspectRatio(windowAspect: number): void {\n const origExtents = this.getExtents();\n const extents = origExtents.clone();\n extents.y = extents.x / (windowAspect * this.getAspectRatioSkew());\n if (extents.isAlmostEqual(origExtents))\n return;\n\n // adjust origin by half of the distance we modified extents to keep centered\n const origin = this.getOrigin().clone();\n origin.addScaledInPlace(this.getRotation().multiplyTransposeVector(extents.vectorTo(origExtents, origExtents)), .5);\n this.setOrigin(origin);\n this.setExtents(extents);\n }\n\n /** @internal */\n public outputStatusMessage(status: ViewStatus): ViewStatus {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, IModelApp.localization.getLocalizedString(`iModelJs:Viewing.${ViewStatus[status]}`)));\n return status;\n }\n\n /** @internal */\n public adjustViewDelta(delta: Vector3d, origin: XYZ, rot: Matrix3d, aspect?: number, opts?: OnViewExtentsError): ViewStatus {\n const origDelta = delta.clone();\n\n let status = ViewStatus.Success;\n const limit = this.extentLimits;\n const limitDelta = (val: number) => {\n if (val < limit.min) {\n val = limit.min;\n status = ViewStatus.MinWindow;\n } else if (val > limit.max) {\n val = limit.max;\n status = ViewStatus.MaxWindow;\n }\n return val;\n };\n\n delta.x = limitDelta(delta.x);\n delta.y = limitDelta(delta.y);\n\n if (aspect) { // skip if either undefined or 0\n aspect *= this.getAspectRatioSkew();\n if (delta.x > (aspect * delta.y))\n delta.y = delta.x / aspect;\n else\n delta.x = delta.y * aspect;\n }\n\n if (!delta.isAlmostEqual(origDelta))\n origin.addScaledInPlace(rot.multiplyTransposeVector(delta.vectorTo(origDelta, origDelta)), .5);\n\n return (status !== ViewStatus.Success && opts?.onExtentsError) ? opts.onExtentsError(status) : status;\n }\n\n /** Adjust the aspect ratio of this ViewState so it matches the supplied value. The adjustment is accomplished by increasing one dimension\n * and leaving the other unchanged, depending on the ratio of this ViewState's current aspect ratio to the supplied one. This means the result\n * always shows everything in the current volume, plus potentially more.\n * @note The *automatic* adjustment that happens when ViewStates are used in Viewports **always** adjusts the Y axis (making\n * it potentially smaller). That's so that process can be reversible if the view's aspect ratio changes repeatedly (as happens when panels slide in/out, etc.)\n */\n public adjustAspectRatio(aspect: number) {\n const extents = this.getExtents();\n const origin = this.getOrigin();\n this.adjustViewDelta(extents, origin, this.getRotation(), aspect);\n this.setExtents(extents);\n this.setOrigin(origin);\n }\n\n /** Set the CategorySelector for this view. */\n public setCategorySelector(categories: CategorySelectorState) { this.categorySelector = categories; }\n\n /** get the auxiliary coordinate system state object for this ViewState. */\n public get auxiliaryCoordinateSystem(): AuxCoordSystemState {\n if (!this._auxCoordSystem)\n this._auxCoordSystem = this.createAuxCoordSystem(\"\");\n return this._auxCoordSystem;\n }\n\n /** Get the Id of the auxiliary coordinate system for this ViewState */\n public getAuxiliaryCoordinateSystemId(): Id64String {\n return this.details.auxiliaryCoordinateSystemId;\n }\n\n /** Set or clear the AuxiliaryCoordinateSystem for this view.\n * @param acs the new AuxiliaryCoordinateSystem for this view. If undefined, no AuxiliaryCoordinateSystem will be used.\n */\n public setAuxiliaryCoordinateSystem(acs?: AuxCoordSystemState) {\n this._auxCoordSystem = acs;\n this.details.auxiliaryCoordinateSystemId = undefined !== acs ? acs.id : Id64.invalid;\n }\n\n /** Determine whether the specified Category is displayed in this view */\n public viewsCategory(id: Id64String): boolean {\n return this.categorySelector.isCategoryViewed(id);\n }\n\n /** Get the aspect ratio (width/height) of this view */\n public getAspectRatio(): number {\n const extents = this.getExtents();\n return extents.x / extents.y;\n }\n\n /** Get the aspect ratio skew (x/y, usually 1.0) that is used to exaggerate the y axis of the view. */\n public getAspectRatioSkew(): number {\n return this.details.aspectRatioSkew;\n }\n\n /** Set the aspect ratio skew (x/y) for this view. To remove aspect ratio skew, pass 1.0 for val. */\n public setAspectRatioSkew(val: number) {\n this.details.aspectRatioSkew = val;\n }\n\n /** Get the unit vector that points in the view X (left-to-right) direction.\n * @param result optional Vector3d to be used for output. If undefined, a new object is created.\n */\n public getXVector(result?: Vector3d): Vector3d { return this.getRotation().getRow(0, result); }\n\n /** Get the unit vector that points in the view Y (bottom-to-top) direction.\n * @param result optional Vector3d to be used for output. If undefined, a new object is created.\n */\n public getYVector(result?: Vector3d): Vector3d { return this.getRotation().getRow(1, result); }\n\n /** Get the unit vector that points in the view Z (front-to-back) direction.\n * @param result optional Vector3d to be used for output. If undefined, a new object is created.\n */\n public getZVector(result?: Vector3d): Vector3d { return this.getRotation().getRow(2, result); }\n\n /** Set or clear the clipping volume for this view.\n * @param clip the new clipping volume. If undefined, clipping is removed from view.\n * @note The ViewState takes ownership of the supplied ClipVector - it should not be modified after passing it to this function.\n */\n public setViewClip(clip?: ClipVector) {\n this.details.clipVector = clip;\n }\n\n /** Get the clipping volume for this view, if defined\n * @note Do *not* modify the returned ClipVector. If you wish to change the ClipVector, clone the returned ClipVector, modify it as desired, and pass the clone to [[setViewClip]].\n */\n public getViewClip(): ClipVector | undefined {\n return this.details.clipVector;\n }\n\n /** Set the grid settings for this view */\n public setGridSettings(orientation: GridOrientationType, spacing: Point2d, gridsPerRef: number): void {\n switch (orientation) {\n case GridOrientationType.WorldYZ:\n case GridOrientationType.WorldXZ:\n if (!this.is3d())\n return;\n break;\n }\n\n this.details.gridOrientation = orientation;\n this.details.gridsPerRef = gridsPerRef;\n this.details.gridSpacing = spacing;\n }\n\n /** Populate the given origin and rotation with information from the grid settings from the grid orientation. */\n public getGridSettings(vp: Viewport, origin: Point3d, rMatrix: Matrix3d, orientation: GridOrientationType) {\n // start with global origin (for spatial views) and identity matrix\n rMatrix.setIdentity();\n origin.setFrom(vp.view.isSpatialView() ? vp.view.iModel.globalOrigin : Point3d.create());\n\n switch (orientation) {\n case GridOrientationType.View: {\n const centerWorld = Point3d.create(0.5, 0.5, 0.5);\n vp.npcToWorld(centerWorld, centerWorld);\n\n rMatrix.setFrom(vp.rotation);\n rMatrix.multiplyXYZtoXYZ(origin, origin);\n origin.z = centerWorld.z;\n rMatrix.multiplyTransposeVectorInPlace(origin);\n break;\n }\n case GridOrientationType.WorldXY:\n break;\n case GridOrientationType.WorldYZ: {\n const rowX = rMatrix.getRow(0);\n const rowY = rMatrix.getRow(1);\n const rowZ = rMatrix.getRow(2);\n rMatrix.setRow(0, rowY);\n rMatrix.setRow(1, rowZ);\n rMatrix.setRow(2, rowX);\n break;\n }\n case GridOrientationType.WorldXZ: {\n const rowX = rMatrix.getRow(0);\n const rowY = rMatrix.getRow(1);\n const rowZ = rMatrix.getRow(2);\n rMatrix.setRow(0, rowX);\n rMatrix.setRow(1, rowZ);\n rMatrix.setRow(2, rowY);\n break;\n }\n }\n }\n\n /** Get the grid settings for this view */\n public getGridOrientation(): GridOrientationType {\n return this.details.gridOrientation;\n }\n public getGridsPerRef(): number {\n return this.details.gridsPerRef;\n }\n public getGridSpacing(): XAndY {\n return this.details.gridSpacing;\n }\n\n /** Change the volume that this view displays, keeping its current rotation.\n * @param volume The new volume, in world-coordinates, for the view. The resulting view will show all of worldVolume, by fitting a\n * view-axis-aligned bounding box around it. For views that are not aligned with the world coordinate system, this will sometimes\n * result in a much larger volume than worldVolume.\n * @param aspect The X/Y aspect ratio of the view into which the result will be displayed. If the aspect ratio of the volume does not\n * match aspect, the shorter axis is lengthened and the volume is centered. If aspect is undefined, no adjustment is made.\n * @param options for providing MarginPercent and onExtentsError\n * @note for 2d views, only the X and Y values of volume are used.\n */\n public lookAtVolume(volume: LowAndHighXYZ | LowAndHighXY, aspect?: number, options?: MarginOptions & OnViewExtentsError) {\n const rangeBox = Frustum.fromRange(volume).points;\n this.getRotation().multiplyVectorArrayInPlace(rangeBox);\n return this.lookAtViewAlignedVolume(Range3d.createArray(rangeBox), aspect, options);\n }\n\n /** Look at a volume of space defined by a range in view local coordinates, keeping its current rotation.\n * @param volume The new volume, in view-aligned coordinates. The resulting view will show all of the volume.\n * @param aspect The X/Y aspect ratio of the view into which the result will be displayed. If the aspect ratio of the volume does not\n * match aspect, the shorter axis is lengthened and the volume is centered. If aspect is undefined, no adjustment is made.\n * @param options for providing MarginPercent and onExtentsError\n * @see lookAtVolume\n */\n public lookAtViewAlignedVolume(volume: Range3d, aspect?: number, options?: MarginOptions & OnViewExtentsError) {\n if (volume.isNull) // make sure volume is valid\n return;\n\n const viewRot = this.getRotation();\n const newOrigin = volume.low.clone();\n const newDelta = volume.diagonal();\n\n const minimumDepth = Constant.oneMillimeter;\n if (newDelta.z < minimumDepth) {\n newOrigin.z -= (minimumDepth - newDelta.z) / 2.0;\n newDelta.z = minimumDepth;\n }\n\n if (this.is3d() && this.isCameraOn) {\n // If the camera is on, the only way to guarantee we can see the entire volume is to set delta at the front plane, not focus plane.\n // That generally causes the view to be too large (objects in it are too small), since we can't tell whether the objects are at\n // the front or back of the view. For this reason, don't attempt to add any \"margin\" to camera views.\n } else if (undefined !== options?.paddingPercent) {\n let left, right, top, bottom;\n const padding = options.paddingPercent;\n if (typeof padding === \"number\") {\n left = right = top = bottom = padding;\n } else {\n left = padding.left ?? 0;\n right = padding.right ?? 0;\n top = padding.top ?? 0;\n bottom = padding.bottom ?? 0;\n }\n\n const width = newDelta.x;\n const height = newDelta.y;\n\n newOrigin.x -= left * width;\n newDelta.x += (right + left) * width;\n newOrigin.y -= bottom * height;\n newDelta.y += (top + bottom) * height;\n } else if (options?.marginPercent) {\n // compute how much space we'll need for both of X and Y margins in root coordinates\n const margin = options.marginPercent;\n const wPercent = margin.left + margin.right;\n const hPercent = margin.top + margin.bottom;\n\n const marginHorizontal = wPercent / (1 - wPercent) * newDelta.x;\n const marginVert = hPercent / (1 - hPercent) * newDelta.y;\n\n // compute left and bottom margins in root coordinates\n const marginLeft = margin.left / (1 - wPercent) * newDelta.x;\n const marginBottom = margin.bottom / (1 - hPercent) * newDelta.y;\n\n // add the margins to the range\n newOrigin.x -= marginLeft;\n newOrigin.y -= marginBottom;\n newDelta.x += marginHorizontal;\n newDelta.y += marginVert;\n } else {\n const origDelta = newDelta.clone();\n newDelta.scale(1.04, newDelta); // default \"dilation\"\n newOrigin.addScaledInPlace(origDelta.minus(newDelta, origDelta), .5);\n }\n\n viewRot.multiplyTransposeVectorInPlace(newOrigin);\n\n if (ViewStatus.Success !== this.adjustViewDelta(newDelta, newOrigin, viewRot, aspect, options))\n return;\n\n this.setExtents(newDelta);\n this.setOrigin(newOrigin);\n\n if (!this.is3d())\n return;\n\n const cameraDef = this.camera;\n cameraDef.validateLens();\n // move the camera back so the entire x,y range is visible at front plane\n const frontDist = newDelta.x / (2.0 * Math.tan(cameraDef.getLensAngle().radians / 2.0));\n const backDist = frontDist + newDelta.z;\n\n cameraDef.setFocusDistance(frontDist); // do this even if the camera isn't currently on.\n this.centerEyePoint(backDist); // do this even if the camera isn't currently on.\n this.verifyFocusPlane(); // changes delta/origin\n }\n\n /** Set the rotation of this ViewState to the supplied rotation, by rotating it about a point.\n * @param rotation The new rotation matrix for this ViewState.\n * @param point The point to rotate about. If undefined, use the [[getTargetPoint]].\n */\n public setRotationAboutPoint(rotation: Matrix3d, point?: Point3d): void {\n if (undefined === point)\n point = this.getTargetPoint();\n\n const inverse = rotation.clone().inverse();\n if (undefined === inverse)\n return;\n\n const targetMatrix = inverse.multiplyMatrixMatrix(this.getRotation());\n const worldTransform = Transform.createFixedPointAndMatrix(point, targetMatrix);\n const frustum = this.calculateFrustum();\n if (undefined !== frustum) {\n frustum.multiply(worldTransform);\n this.setupFromFrustum(frustum);\n }\n }\n\n /** Intended strictly as a temporary solution for interactive editing applications, until official support for such apps is implemented.\n * Invalidates tile trees for all specified models (or all viewed models, if none specified), causing subsequent requests for tiles to make new requests to back-end for updated tiles.\n * Returns true if any tile tree was invalidated.\n * @internal\n */\n public refreshForModifiedModels(modelIds: Id64Arg | undefined): boolean {\n let refreshed = false;\n for (const ref of this.getModelTreeRefs()) {\n const tree = ref.treeOwner.tileTree;\n if (undefined !== tree && (undefined === modelIds || Id64.has(modelIds, tree.modelId))) {\n ref.treeOwner[Symbol.dispose]();\n refreshed = true;\n }\n }\n\n return refreshed;\n }\n\n /** Determine whether this ViewState has the same coordinate system as another one.\n * They must be from the same iModel, and view a model in common.\n */\n public hasSameCoordinates(other: ViewState): boolean {\n if (this.iModel !== other.iModel)\n return false;\n\n // Spatial views view any number of spatial models all sharing one coordinate system.\n if (this.isSpatialView() && other.isSpatialView())\n return true;\n\n // People sometimes mistakenly stick 2d models into spatial views' model selectors.\n if (this.isSpatialView() || other.isSpatialView())\n return false;\n\n // Non-spatial views view exactly one model. If they view the same model, they share a coordinate system.\n let allowView = false;\n this.forEachModel((model) => {\n allowView ||= other.viewsModel(model.id);\n });\n\n return allowView;\n }\n\n /** Compute the vector in the \"up\" direction of a specific point in world space.\n * This is typically a unit Z vector. However, if the point is outside of the iModel's project extents and using ellipsoid [[globeMode]], an up-vector\n * will be computed relative to the surface of the ellipsoid at that point.\n */\n public getUpVector(point: Point3d): Vector3d {\n if (!this.iModel.isGeoLocated || this.globeMode !== GlobeMode.Ellipsoid || this.iModel.projectExtents.containsPoint(point))\n return Vector3d.unitZ();\n\n const earthCenter = this.iModel.getMapEcefToDb(0).origin;\n const normal = Vector3d.createStartEnd(earthCenter, point);\n normal.normalizeInPlace();\n\n return normal;\n }\n\n /** Return true if the view is looking at the current iModel project extents or\n * false if the viewed area do does not include more than one percent of the project.\n */\n public getIsViewingProject(): boolean {\n if (!this.isSpatialView())\n return false;\n\n const worldToNpc = this.computeWorldToNpc();\n if (!worldToNpc || !worldToNpc.map)\n return false;\n\n const expandedRange = this.iModel.projectExtents.clone();\n expandedRange.expandInPlace(10E3);\n const corners = expandedRange.corners(scratchCorners);\n worldToNpc.map.transform0.multiplyPoint3dArrayQuietNormalize(corners);\n scratchRange2d.setNull();\n corners.forEach((corner) => scratchRange2d.extendXY(corner.x, corner.y));\n const intersection = scratchRange2d.intersect(unitRange2d, scratchRange2dIntersect);\n if (!intersection || intersection.isNull)\n return false;\n\n const area = (intersection.high.x - intersection.low.x) * (intersection.high.y - intersection.low.y);\n return area > 1.0E-2;\n }\n\n /** If the view is not of the project as determined by [[getIsViewingProject]] then return\n * the rotation from a global reference frame to world coordinates. The global reference frame includes\n * Y vector towards true north, X parallel to the equator and Z perpendicular to the ellipsoid surface\n */\n public getGlobeRotation(): Matrix3d | undefined {\n if (!this.iModel.isGeoLocated || this.globeMode !== GlobeMode.Ellipsoid || this.getIsViewingProject())\n return undefined;\n\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n if (!backgroundMapGeometry)\n return undefined;\n\n const targetRay = Ray3d.create(this.getCenter(), this.getRotation().rowZ().negate(), scratchRay);\n const earthEllipsoid = backgroundMapGeometry.getEarthEllipsoid();\n const intersectFractions = new Array<number>(), intersectAngles = new Array<LongitudeLatitudeNumber>();\n if (earthEllipsoid.intersectRay(targetRay, intersectFractions, undefined, intersectAngles) < 2)\n return undefined;\n\n let minIndex = 0, minFraction = -1.0E10;\n for (let i = 0; i < intersectFractions.length; i++) {\n const fraction = intersectFractions[i];\n if (fraction < minFraction) {\n minFraction = fraction;\n minIndex = i;\n }\n }\n const angles = intersectAngles[minIndex];\n const pointAndDeriv = earthEllipsoid.radiansToPointAndDerivatives(angles.longitudeRadians, angles.latitudeRadians, false);\n return Matrix3d.createRigidFromColumns(pointAndDeriv.vectorU, pointAndDeriv.vectorV, AxisOrder.XYZ)?.transpose();\n\n }\n\n /** A value that represents the global scope of the view -- a value greater than one indicates that the scope of this view is global (viewing most of Earth). */\n public get globalScopeFactor(): number {\n return this.getExtents().magnitudeXY() / Constant.earthRadiusWGS84.equator;\n }\n\n private _maxGlobalScopeFactor = 0;\n /** The maximum global scope is not persistent, but maintained as highest global scope factor. This can be used to determine\n * if the view is of a limited area or if it has ever viewed the entire globe and therefore may be assumed to view it again\n * and therefore may warrant resources for displaying the globe, such as an expanded viewing frustum and preloading globe map tiles.\n * A value greater than one indicates that the viewport has been used to view globally at least once.\n * @internal\n */\n public get maxGlobalScopeFactor() { return this._maxGlobalScopeFactor; }\n\n protected _updateMaxGlobalScopeFactor() { this._maxGlobalScopeFactor = Math.max(this._maxGlobalScopeFactor, this.globalScopeFactor); }\n\n /** Return elevation applied to model when displayed. This is strictly relevant to plan projection models.\n * @internal\n */\n public getModelElevation(_modelId: Id64String): number { return 0; }\n\n /** An object that can provide per-model transforms to be applied at display time.\n * @note The transform is used for display purposes only. Operations upon geometry within the model may not take the display transform into account.\n * @see [[computeDisplayTransform]] to compute a full display transform for a model or an element within it, which may include a transform supplied by this provider.\n * @beta\n */\n public get modelDisplayTransformProvider(): ModelDisplayTransformProvider | undefined {\n return this._modelDisplayTransformProvider;\n }\n\n public set modelDisplayTransformProvider(provider: ModelDisplayTransformProvider | undefined) {\n if (provider === this.modelDisplayTransformProvider)\n return;\n\n if (this.isAttachedToViewport)\n this.onModelDisplayTransformProviderChanged.raiseEvent(provider);\n\n this._modelDisplayTransformProvider = provider;\n }\n\n /** Compute the transform applied to a model or element at display time, if any.\n * The display transform may be constructed from any combination of the following:\n * - [PlanProjectionSettings.elevation]($common) applied to plan projection models by [DisplayStyle3dSettings.planProjectionSettings]($common);\n * - A per-model transform supplied by this view's [[modelDisplayTransformProvider]]; and/or\n * - A transform applied to an element by an [RenderSchedule.ElementTimeline]($common) defined by this view's [[scheduleScript]].\n * - A transform from the coordinate space of a [ViewAttachment]($backend)'s view to that of the [[SheetViewState]] in which it is displayed.\n * - A transform from the coordinate space of a [[SpatialViewState]] to that of the [[DrawingViewState]] in which it is displayed, where the spatial view is attached via a [SectionDrawing]($backend).\n * @param args A description of how to compute the transform.\n * @returns The computed transform, or `undefined` if no display transform is to be applied.\n * @beta\n */\n public computeDisplayTransform(args: ComputeDisplayTransformArgs): Transform | undefined {\n const elevation = this.getModelElevation(args.modelId);\n const modelTransform = this.modelDisplayTransformProvider?.getModelDisplayTransform(args.modelId);\n\n // NB: A ModelTimeline can apply a transform to all elements in the model, but no code exists which actually applies that at display time.\n // So for now we continue to only consider the ElementTimeline transform.\n let scriptTransform;\n if (this.scheduleScript && args.elementId) {\n const idPair = Id64.getUint32Pair(args.elementId);\n const modelTimeline = this.scheduleScript.find(args.modelId);\n const elementTimeline = modelTimeline?.getTimelineForElement(idPair.lower, idPair.upper);\n scriptTransform = elementTimeline?.getAnimationTransform(args.timePoint ?? this.displayStyle.settings.timePoint ?? 0);\n }\n\n if (0 === elevation && !modelTransform && !scriptTransform)\n return undefined;\n\n const transform = Transform.createTranslationXYZ(0, 0, elevation);\n if (modelTransform?.premultiply)\n modelTransform.transform.multiplyTransformTransform(transform, transform);\n\n if (modelTransform && !modelTransform.premultiply)\n transform.multiplyTransformTransform(modelTransform.transform, transform);\n\n if (scriptTransform)\n transform.multiplyTransformTransform(scriptTransform as Transform, transform);\n\n return transform;\n }\n\n /** Invoked when this view becomes the view displayed by the specified [[Viewport]].\n * A ViewState can be attached to at most **one** Viewport at any given time.\n * This method is invoked automatically by the viewport - there is generally no reason for applications to invoke it directly.\n * @note If you override this method you **must** call `super.attachToViewport`.\n * @throws Error if the view is already attached to any Viewport.\n * @see [[detachFromViewport]] from the inverse operation.\n */\n public attachToViewport(_args: AttachToViewportArgs): void {\n if (this.isAttachedToViewport)\n throw new Error(\"Attempting to attach a ViewState that is already attached to a Viewport\");\n\n this.registerCategorySelectorListeners();\n }\n\n private registerCategorySelectorListeners(): void {\n const cats = this.categorySelector.observableCategories;\n const event = () => this.onViewedCategoriesChanged.raiseEvent();\n this._unregisterCategorySelectorListeners.push(cats.onAdded.addListener(event));\n this._unregisterCategorySelectorListeners.push(cats.onDeleted.addListener(event));\n this._unregisterCategorySelectorListeners.push(cats.onCleared.addListener(event));\n }\n\n /** Invoked when this view, previously attached to the specified [[Viewport]] via [[attachToViewport]], is no longer the view displayed by that Viewport.\n * This method is invoked automatically by the viewport - there is generally no reason for applications to invoke it directly.\n * @note If you override this method you **must** call `super.detachFromViewport`.\n * @throws Error if the view is not attached to any Viewport.\n */\n public detachFromViewport(): void {\n if (!this.isAttachedToViewport)\n throw new Error(\"Attempting to detach a ViewState from a Viewport to which it is not attached.\");\n\n this.unregisterCategorySelectorListeners();\n }\n\n private unregisterCategorySelectorListeners(): void {\n this._unregisterCategorySelectorListeners.forEach((f) => f());\n this._unregisterCategorySelectorListeners.length = 0;\n }\n\n /** Returns whether this view is currently being displayed by a [[Viewport]].\n * @public\n */\n public get isAttachedToViewport(): boolean {\n // In attachToViewport, we register event listeners on the category selector. We remove them in detachFromViewport.\n // So a non-empty list of event listener removal functions indicates we are currently attached to a viewport.\n return this._unregisterCategorySelectorListeners.length > 0;\n }\n\n /** Returns an iterator over additional Viewports used to construct this view's scene. e.g., those used for ViewAttachments and section drawings.\n * This exists chiefly for display-performance-test-app to determine when all tiles required for the view have been loaded.\n * @internal\n */\n public get secondaryViewports(): Iterable<Viewport> {\n return [];\n }\n\n /** Find the viewport that renders the contents of the view attachment with the specified element Id into this view.\n * @internal\n */\n public getAttachmentViewport(_args: GetAttachmentViewportArgs): Viewport | undefined {\n return undefined;\n }\n}\n\n/** Defines the state of a view of 3d models.\n * @see [ViewState Parameters]($docs/learning/frontend/views#viewstate-parameters)\n * @public\n * @extensions\n */\nexport abstract class ViewState3d extends ViewState {\n private readonly _details: ViewDetails3d;\n private readonly _modelClips: Array<RenderClipVolume | undefined> = [];\n private _environmentDecorations?: EnvironmentDecorations;\n public static override get className() { return \"ViewDefinition3d\"; }\n /** True if the camera is valid. */\n protected _cameraOn: boolean;\n /** The lower left back corner of the view frustum. */\n public readonly origin: Point3d;\n /** The extent of the view frustum. */\n public readonly extents: Vector3d;\n /** Rotation of the view frustum. */\n public readonly rotation: Matrix3d;\n /** The camera used for this view. */\n public readonly camera: Camera;\n /** Minimum distance for front plane */\n public forceMinFrontDist = 0.0;\n /** Provides access to optional detail settings for this view. */\n public get details(): ViewDetails3d {\n return this._details;\n }\n\n public allow3dManipulations(): boolean {\n return this.details.allow3dManipulations;\n }\n\n /** Set whether [[ViewTool]]s are allowed to operate in 3 dimensions on this view. */\n public setAllow3dManipulations(allow: boolean) {\n this.details.allow3dManipulations = allow;\n }\n\n public constructor(props: ViewDefinition3dProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle3dState) {\n super(props, iModel, categories, displayStyle);\n this._cameraOn = JsonUtils.asBool(props.cameraOn);\n this.origin = Point3d.fromJSON(props.origin);\n this.extents = Vector3d.fromJSON(props.extents);\n this.rotation = YawPitchRollAngles.fromJSON(props.angles).toMatrix3d();\n assert(this.rotation.isRigid());\n this.camera = new Camera(props.camera);\n\n // if the camera is on, make sure the eyepoint is centered.\n if (this.is3d() && this.isCameraOn)\n this.centerEyePoint();\n\n this._details = new ViewDetails3d(this.jsonProperties);\n this._details.onModelClipGroupsChanged.addListener((newGroups) => this.updateModelClips(newGroups));\n this.updateModelClips(this._details.modelClipGroups);\n\n this._updateMaxGlobalScopeFactor();\n }\n\n private updateModelClips(groups: ModelClipGroups): void {\n this._modelClips.length = 0;\n for (const group of groups.groups) {\n const clip = group.clip ? IModelApp.renderSystem.createClipVolume(group.clip) : undefined;\n this._modelClips.push(clip);\n }\n }\n\n /** @internal */\n public getModelClip(modelId: Id64String): RenderClipVolume | undefined {\n // ###TODO: ViewFlags.clipVolume is for the *view clip* only. Some tiles will want to ignore *all* clips (i.e., section-cut tiles).\n const index = this.details.modelClipGroups.findGroupIndex(modelId);\n return -1 !== index ? this._modelClips[index] : undefined;\n }\n\n /** Capture a copy of the viewed volume and camera parameters. */\n public savePose(): ViewPose3d { return new ViewPose3d(this); }\n\n /** See [[ViewState.applyPose]]. */\n public applyPose(val: ViewPose): this {\n if (val instanceof ViewPose3d) {\n this._cameraOn = val.cameraOn;\n this.setOrigin(val.origin);\n this.setExtents(val.extents);\n this.rotation.setFrom(val.rotation);\n this.camera.setFrom(val.camera);\n this._updateMaxGlobalScopeFactor();\n }\n\n return this;\n }\n\n public override toJSON(): ViewDefinition3dProps {\n const val = super.toJSON() as ViewDefinition3dProps;\n val.cameraOn = this._cameraOn;\n val.origin = this.origin;\n val.extents = this.extents;\n val.angles = YawPitchRollAngles.createFromMatrix3d(this.rotation)!.toJSON();\n val.camera = this.camera;\n return val;\n }\n\n /** See [[ViewState.is3d]]. */\n public is3d(): this is ViewState3d { return true; }\n\n /** @internal */\n public isDrawingView(): this is DrawingViewState { return false; }\n\n public get isCameraOn(): boolean { return this._cameraOn; }\n\n private static _minGlobeEyeHeight = Constant.earthRadiusWGS84.equator / 4; // View as globe if more than a quarter of earth radius from surface.\n private static _scratchGlobeCarto = Cartographic.createZero();\n\n public get isGlobalView() {\n if (undefined === this.iModel.ecefLocation)\n return false;\n\n return this.globalScopeFactor >= 1;\n }\n\n /** A value that represents the global scope of the view -- a value greater than one indicates that the scope of this view is global.\n * @see [[isGlobalView]].\n */\n public override get globalScopeFactor(): number {\n const eyeHeight = this.getEyeCartographicHeight();\n return (undefined === eyeHeight) ? (this.extents.magnitudeXY() / Constant.earthRadiusWGS84.equator) : (eyeHeight / ViewState3d._minGlobeEyeHeight);\n }\n\n /** A value representing the degree to which a view is viewing the globe as opposed to a specific location\n * a value of zero or less indicates that the view is not global, a value between zero and one represent a semi\n * global view. Values greater than one indicate a global view.\n *\n * A Global view is arbitrarily designated as a camera view with the camera height greater than one fourth of the globe\n * radius or an orthographic view with view diagonal greater than one fourth of the globe radius.\n */\n public globalViewTransition(): number {\n if (undefined === this.iModel.ecefLocation)\n return 0.0;\n\n let h = 0.0;\n if (this.isCameraOn) {\n const carto = this.rootToCartographic(this.getEyePoint(), ViewState3d._scratchGlobeCarto);\n h = (undefined === carto ? 0.0 : carto.height);\n } else\n h = this.extents.magnitudeXY();\n\n const startTransition = 0.33333 * ViewState3d._minGlobeEyeHeight;\n if (h > ViewState3d._minGlobeEyeHeight)\n return 1.0;\n else if (h < startTransition)\n return 0.0;\n else\n return (h - startTransition) / (ViewState3d._minGlobeEyeHeight - startTransition);\n }\n\n public getCartographicHeight(point: XYAndZ): number | undefined {\n const ecefLocation = this.iModel.ecefLocation;\n if (undefined === ecefLocation)\n return undefined;\n\n const carto = this.rootToCartographic(point, ViewState3d._scratchGlobeCarto);\n return carto === undefined ? undefined : carto.height;\n }\n public getEyeCartographicHeight(): number | undefined {\n return this.isCameraOn ? this.getCartographicHeight(this.getEyePoint()) : undefined;\n }\n\n public isEyePointGlobalView(eyePoint: XYAndZ) {\n const cartoHeight = this.getCartographicHeight(eyePoint);\n return undefined === cartoHeight ? false : cartoHeight > ViewState3d._minGlobeEyeHeight;\n }\n\n /** Look at a global location, placing the camera's eye at the specified eye height above a viewed location.\n * If location is defined, its center position will be viewed using the specified eye height.\n * If location also has an area specified, the eye height will be adjusted to view the specified location based on that area.\n * Otherwise, this function views a point on the earth as if the current eye point was placed on the earth. If the eyePoint parameter is defined, instead this point will be placed on the earth and viewed.\n * Specify pitchAngleRadians to tilt the final view; this defaults to 0.\n * Returns the distance from original eye point to new eye point.\n * @public\n */\n public lookAtGlobalLocation(eyeHeight: number, pitchAngleRadians = 0, location?: GlobalLocation, eyePoint?: Point3d): number {\n if (!this.iModel.isGeoLocated)\n return 0;\n\n if (location !== undefined && location.area !== undefined)\n eyeHeight = areaToEyeHeight(this, location.area, location.center.height);\n\n const origEyePoint = eyePoint !== undefined ? eyePoint.clone() : this.getEyeOrOrthographicViewPoint().clone();\n\n let targetPoint = origEyePoint;\n const targetPointCartographic = location !== undefined ? location.center.clone() : this.rootToCartographic(targetPoint)!;\n targetPointCartographic.height = 0.0;\n targetPoint = this.cartographicToRoot(targetPointCartographic)!;\n\n targetPointCartographic.height = eyeHeight;\n const lEyePoint = this.cartographicToRoot(targetPointCartographic)!;\n return this.finishLookAtGlobalLocation(targetPointCartographic, origEyePoint, lEyePoint, targetPoint, pitchAngleRadians);\n }\n\n /** Look at a global location, placing the camera's eye at the specified eye height above a viewed location using the GCS.\n * If location is defined, its center position will be viewed using the specified eye height.\n * If location also has an area specified, the eye height will be adjusted to view the specified location based on that area.\n * Otherwise, this function views a point on the earth as if the current eye point was placed on the earth. If the eyePoint parameter is defined, instead this point will be placed on the earth and viewed.\n * Specify pitchAngleRadians to tilt the final view; this defaults to 0.\n * Returns the distance from original eye point to new eye point.\n * @public\n */\n public async lookAtGlobalLocationFromGcs(eyeHeight: number, pitchAngleRadians = 0, location?: GlobalLocation, eyePoint?: Point3d): Promise<number> {\n if (!this.iModel.isGeoLocated)\n return 0;\n\n if (location !== undefined && location.area !== undefined)\n eyeHeight = await areaToEyeHeightFromGcs(this, location.area, location.center.height);\n\n const origEyePoint = eyePoint !== undefined ? eyePoint.clone() : this.getEyeOrOrthographicViewPoint().clone();\n\n let targetPoint = origEyePoint;\n const targetPointCartographic = location !== undefined ? location.center.clone() : this.rootToCartographic(targetPoint)!;\n targetPointCartographic.height = 0.0;\n targetPoint = (await this.cartographicToRootFromGcs(targetPointCartographic))!;\n\n targetPointCartographic.height = eyeHeight;\n const lEyePoint = (await this.cartographicToRootFromGcs(targetPointCartographic))!;\n return this.finishLookAtGlobalLocation(targetPointCartographic, origEyePoint, lEyePoint, targetPoint, pitchAngleRadians);\n }\n\n private finishLookAtGlobalLocation(targetPointCartographic: Cartographic, origEyePoint: Point3d, eyePoint: Point3d, targetPoint: Point3d, pitchAngleRadians: number): number {\n targetPointCartographic.latitude += .001;\n const northOfEyePoint = this.cartographicToRoot(targetPointCartographic)!;\n let upVector = targetPoint.unitVectorTo(northOfEyePoint)!;\n if (this.globeMode === GlobeMode.Plane)\n upVector = Vector3d.create(Math.abs(upVector.x), Math.abs(upVector.y), Math.abs(upVector.z));\n\n if (0 !== pitchAngleRadians) {\n const pitchAxis = upVector.unitCrossProduct(Vector3d.createStartEnd(targetPoint, eyePoint));\n if (undefined !== pitchAxis) {\n const pitchMatrix = Matrix3d.createRotationAroundVector(pitchAxis, Angle.createRadians(pitchAngleRadians))!;\n const pitchTransform = Transform.createFixedPointAndMatrix(targetPoint, pitchMatrix);\n eyePoint = pitchTransform.multiplyPoint3d(eyePoint);\n pitchMatrix.multiplyVector(upVector, upVector);\n }\n }\n\n const isCameraEnabled = this.isCameraOn;\n this.lookAt({ eyePoint, targetPoint, upVector, lensAngle: this.camera.getLensAngle() });\n if (!isCameraEnabled && this.isCameraOn)\n this.turnCameraOff();\n\n return eyePoint.distance(origEyePoint);\n }\n\n /** Convert a point in spatial coordinates to a cartographic coordinate. */\n public rootToCartographic(root: XYAndZ, result?: Cartographic): Cartographic | undefined {\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n return backgroundMapGeometry ? backgroundMapGeometry.dbToCartographic(root, result) : undefined;\n }\n\n /** Convert a cartographic coordinate to a point in spatial coordinates. */\n public cartographicToRoot(cartographic: Cartographic, result?: Point3d): Point3d | undefined {\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n return backgroundMapGeometry ? backgroundMapGeometry.cartographicToDb(cartographic, result) : undefined;\n }\n\n /** Convert a point in spatial coordinates to a cartographic coordinate using the GCS reprojection.\n * @see [[rootToCartographicUsingGcs]] to convert multiple points at once.\n * @see [[cartographicToRootFromGcs]] for the inverse conversion.\n */\n public async rootToCartographicFromGcs(root: XYAndZ, result?: Cartographic): Promise<Cartographic | undefined> {\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n if (!backgroundMapGeometry)\n return undefined;\n\n const carto = (await backgroundMapGeometry.dbToCartographicFromGcs([root]))[0];\n return carto.clone(result);\n }\n\n /** Convert spatial coordinates to cartographic coordinates using the GCS reprojection.\n * @param root Spatial coordinates to be converted\n * @returns the converted coordinates of the same length and order as `root`, or `undefined` if the conversion cannot be performed.\n * @see [[cartographicToRootUsingGcs]] for the inverse conversion.\n */\n public async rootToCartographicUsingGcs(root: XYAndZ[]): Promise<Cartographic[] | undefined> {\n const bgmap = this.displayStyle.getBackgroundMapGeometry();\n return bgmap?.dbToCartographicFromGcs(root);\n }\n\n /** Convert a cartographic coordinate to a point in spatial coordinates using the GCS reprojection.\n * @see [[cartographicToRootUsingGcs]] to convert multiple points at once.\n * @see [[rootToCartographicFromGcs]] for the inverse conversion.\n */\n public async cartographicToRootFromGcs(cartographic: Cartographic, result?: Point3d): Promise<Point3d | undefined> {\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n if (!backgroundMapGeometry)\n return undefined;\n\n const root = (await backgroundMapGeometry.cartographicToDbFromGcs([cartographic]))[0];\n return root.clone(result);\n }\n\n /** Convert cartographic coordinates to spatial coordinates using the GCS reprojection.\n * @param cartographic Cartographic coordinates to be converted\n * @returns the converted coordinates of the same length and order as `cartographic`, or `undefined` if the conversion cannot be performed.\n * @see [[rootToCartographicUsingGcs]] for the inverse conversion.\n */\n public async cartographicToRootUsingGcs(cartographic: Cartographic[]): Promise<Point3d[] | undefined> {\n const bgmap = this.displayStyle.getBackgroundMapGeometry();\n return bgmap?.cartographicToDbFromGcs(cartographic);\n }\n\n public override setupFromFrustum(frustum: Frustum, opts?: OnViewExtentsError): ViewStatus {\n const stat = super.setupFromFrustum(frustum, opts);\n if (ViewStatus.Success !== stat)\n return stat;\n\n this.turnCameraOff();\n const frustPts = frustum.points;\n\n // use comparison of back, front plane X sizes to indicate camera or flat view ...\n const xBack = frustPts[Npc.LeftBottomRear].distance(frustPts[Npc.RightBottomRear]);\n const xFront = frustPts[Npc.LeftBottomFront].distance(frustPts[Npc.RightBottomFront]);\n\n const flatViewFractionTolerance = 1.0e-6;\n if (xFront > xBack * (1.0 + flatViewFractionTolerance))\n return ViewStatus.InvalidWindow;\n\n // see if the frustum is tapered, and if so, set up camera eyepoint and adjust viewOrg and delta.\n const compression = xFront / xBack;\n if (compression >= (1.0 - flatViewFractionTolerance))\n return ViewStatus.Success;\n\n // the frustum has perspective, turn camera on\n let viewOrg = frustPts[Npc.LeftBottomRear];\n const viewDelta = this.getExtents().clone();\n const zDir = this.getZVector();\n const frustumZ = viewOrg.vectorTo(frustPts[Npc.LeftBottomFront]);\n const frustOrgToEye = frustumZ.scale(1.0 / (1.0 - compression));\n const eyePoint = viewOrg.plus(frustOrgToEye);\n\n const backDistance = frustOrgToEye.dotProduct(zDir); // distance from eye to back plane of frustum\n const focusDistance = this.camera.isFocusValid ? this.camera.focusDist : (backDistance - (viewDelta.z / 2.0));\n const focalFraction = focusDistance / backDistance; // ratio of focus plane distance to back plane distance\n\n viewOrg = eyePoint.plus2Scaled(frustOrgToEye, -focalFraction, zDir, focusDistance - backDistance); // now project that point onto back plane\n viewDelta.x *= focalFraction; // adjust view delta for x and y so they are also at focus plane\n viewDelta.y *= focalFraction;\n\n this.setEyePoint(eyePoint);\n this.setFocusDistance(focusDistance);\n this.setOrigin(viewOrg);\n this.setExtents(viewDelta);\n this.setLensAngle(this.calcLensAngle());\n this.enableCamera();\n this._updateMaxGlobalScopeFactor();\n return ViewStatus.Success;\n }\n\n protected static calculateMaxDepth(delta: Vector3d, zVec: Vector3d): number {\n const depthRatioLimit = 1.0E8; // Limit for depth Ratio.\n const maxTransformRowRatio = 1.0E5;\n const minXYComponent = Math.min(Math.abs(zVec.x), Math.abs(zVec.y));\n const maxDepthRatio = (0.0 === minXYComponent) ? depthRatioLimit : Math.min((maxTransformRowRatio / minXYComponent), depthRatioLimit);\n return Math.max(delta.x, delta.y) * maxDepthRatio;\n }\n\n public getOrigin(): Point3d { return this.origin; }\n public getExtents(): Vector3d { return this.extents; }\n public getRotation(): Matrix3d { return this.rotation; }\n public setOrigin(origin: XYAndZ) { this.origin.setFrom(origin); }\n public setExtents(extents: XYAndZ) { this.extents.setFrom(extents); }\n public setRotation(rot: Matrix3d) { this.rotation.setFrom(rot); }\n /** @internal */\n protected enableCamera(): void {\n if (this.supportsCamera())\n this._cameraOn = true;\n }\n\n public supportsCamera(): boolean {\n return this.allow3dManipulations();\n }\n\n public minimumFrontDistance() {\n return Math.max(15.2 * Constant.oneCentimeter, this.forceMinFrontDist);\n }\n\n public isEyePointAbove(elevation: number): boolean {\n return !this._cameraOn ? (this.getZVector().z > 0) : (this.getEyePoint().z > elevation);\n }\n\n /** The style that controls how the contents of the view are displayed. */\n public override get displayStyle(): DisplayStyle3dState {\n return this.getDisplayStyle3d();\n }\n\n public override set displayStyle(style: DisplayStyle3dState) {\n assert(style instanceof DisplayStyle3dState);\n super.displayStyle = style;\n }\n\n /** The style that controls how the contents of the view are displayed.\n * @see [[ViewState3d.displayStyle]].\n */\n public getDisplayStyle3d() {\n return super.displayStyle as DisplayStyle3dState;\n }\n\n /** Turn the camera off for this view. After this call, the camera parameters in this view definition are ignored and views that use it will\n * display with an orthographic (infinite focal length) projection of the view volume from the view direction.\n * @note To turn the camera back on, call #lookAt\n */\n public turnCameraOff() { this._cameraOn = false; }\n\n /** Determine whether the camera is valid for this view */\n public get isCameraValid() { return this.camera.isValid; }\n\n /** Calculate the lens angle formed by the current delta and focus distance */\n public calcLensAngle(): Angle {\n return Angle.createRadians(2.0 * Math.atan2(this.extents.x * 0.5, this.camera.getFocusDistance()));\n }\n\n /** Get the target point of the view. If there is no camera, view center is returned. */\n public override getTargetPoint(result?: Point3d): Point3d {\n if (!this._cameraOn) {\n const earthFocalPoint = this.getEarthFocalPoint();\n return earthFocalPoint ? earthFocalPoint : super.getTargetPoint(result);\n }\n\n return this.getEyePoint().plusScaled(this.getZVector(), -1.0 * this.getFocusDistance(), result);\n }\n\n /** Setup view state for either perspective or orthographic view.\n * @returns A [[ViewStatus]] indicating whether the camera was successfully positioned.\n * @note If the aspect ratio of viewDelta does not match the aspect ratio of a Viewport into which this view is displayed, it will be\n * adjusted when the [[Viewport]] is synchronized from this view.\n */\n public lookAt(args: LookAtPerspectiveArgs | LookAtOrthoArgs | LookAtUsingLensAngle): ViewStatus {\n if (args.lensAngle) {\n const lensAngle = args.lensAngle;\n const eyePoint = Vector3d.createFrom(args.eyePoint);\n const focus = eyePoint.vectorTo(args.targetPoint).magnitude(); // Set focus at target point\n\n if (focus <= Constant.oneMillimeter) // eye and target are too close together\n return ViewStatus.InvalidTargetPoint;\n\n if (lensAngle.radians < .0001 || lensAngle.radians > Math.PI)\n return ViewStatus.InvalidLens;\n\n const width = 2.0 * Math.tan(lensAngle.radians / 2.0) * focus;\n const newExtents = Vector2d.createFrom(args.newExtents ?? this.extents);\n newExtents.scale(width / newExtents.x, newExtents);\n args = { ...args, newExtents };\n }\n\n const isPerspective = undefined !== args.targetPoint;\n if (isPerspective && !this.supportsCamera())\n return ViewStatus.NotCameraView;\n\n const eye = new Point3d(args.eyePoint.x, args.eyePoint.y, args.eyePoint.z);\n const yVec = args.upVector.normalize();\n if (!yVec) // up vector zero length?\n return ViewStatus.InvalidUpVector;\n\n const minFrontDist = this.minimumFrontDistance();\n let zVec: Vector3d;\n let focusDist: number;\n if (args.targetPoint) {\n zVec = Vector3d.createStartEnd(args.targetPoint, eye); // z defined by direction from eye to target\n focusDist = zVec.normalizeWithLength(zVec).mag; // set focus at target point\n if (focusDist <= minFrontDist) { // eye and target are too close together\n args.opts?.onExtentsError?.(ViewStatus.InvalidTargetPoint);\n return ViewStatus.InvalidTargetPoint;\n }\n } else {\n zVec = Vector3d.createFrom(args.viewDirection).negate();\n if (!zVec.normalizeInPlace())\n return ViewStatus.InvalidDirection;\n focusDist = this.getFocusDistance();\n }\n\n const xVec = new Vector3d();\n if (yVec.crossProduct(zVec).normalizeWithLength(xVec).mag < Geometry.smallMetricDistance)\n return ViewStatus.InvalidUpVector; // up is parallel to z\n\n if (zVec.crossProduct(xVec).normalizeWithLength(yVec).mag < Geometry.smallMetricDistance)\n return ViewStatus.InvalidUpVector;\n\n // we now have rows of the rotation matrix\n const rotation = Matrix3d.createRows(xVec, yVec, zVec);\n\n let backDist = args.backDistance ? args.backDistance : this.getBackDistance();\n let frontDist = args.frontDistance ? args.frontDistance : this.getFrontDistance();\n\n const delta = args.newExtents ? new Vector3d(Math.abs(args.newExtents.x), Math.abs(args.newExtents.y), this.extents.z) : this.extents.clone();\n\n // The front/back distance are relatively arbitrary -- the frustum will be adjusted to include geometry.\n // Set them here to reasonable in front of eye and just beyond target.\n frontDist = Math.min(frontDist, (.5 * Constant.oneMeter));\n backDist = Math.min(backDist, focusDist + (.5 * Constant.oneMeter));\n\n if (backDist < focusDist) // make sure focus distance is in front of back distance.\n backDist = focusDist + Constant.oneMillimeter;\n\n if (frontDist > focusDist)\n frontDist = focusDist - minFrontDist;\n\n if (frontDist < minFrontDist)\n frontDist = minFrontDist;\n\n delta.z = (backDist - frontDist);\n\n const stat = this.adjustViewDelta(delta, eye, rotation, undefined, args.opts);\n if (ViewStatus.Success !== stat)\n return stat;\n\n if (delta.z > ViewState3d.calculateMaxDepth(delta, zVec)) // make sure we're not zoomed out too far\n return ViewStatus.MaxDisplayDepth;\n\n // The origin is defined as the lower left of the view rectangle on the focus plane, projected to the back plane.\n // Start at eye point, and move to center of back plane, then move left half of width. and down half of height\n const origin = eye.plus3Scaled(zVec, -backDist, xVec, -0.5 * delta.x, yVec, -0.5 * delta.y);\n\n this.setEyePoint(args.eyePoint);\n this.setRotation(rotation);\n this.setFocusDistance(focusDist);\n this.setOrigin(origin);\n this.setExtents(delta);\n this.setLensAngle(this.calcLensAngle());\n if (isPerspective)\n this.enableCamera();\n else\n this.turnCameraOff();\n this._updateMaxGlobalScopeFactor();\n return ViewStatus.Success;\n }\n\n /** Change the focus distance for this ViewState3d. Preserves the content of the view.\n * @internal\n */\n public changeFocusDistance(newDist: number): ViewStatus {\n if (newDist <= Constant.oneMillimeter)\n return ViewStatus.InvalidTargetPoint;\n\n const oldExtents = this.extents.clone(); // save current extents so we can keep frustum unchanged\n this.extents.x = 2.0 * Math.tan(this.camera.lens.radians / 2.0) * newDist; // new width based on focus distance and lens angle.\n this.extents.y = this.extents.y * (this.extents.x / oldExtents.x); // preserve aspect ratio\n this.origin.addScaledInPlace(this.rotation.multiplyTransposeVector(this.extents.vectorTo(oldExtents)), .5); // move origin by half the change in extents\n this.camera.focusDist = newDist; // save new focus distance\n return ViewStatus.Success;\n }\n\n /** Change the focus distance for this ViewState3d to be defined by the the supplied point, if it is in front of the camera.\n * Preserves the content of the view.\n * @internal\n */\n public changeFocusFromPoint(pt: Point3d) {\n return this.changeFocusDistance(this.getZVector().dotProduct(pt.vectorTo(this.camera.eye)));\n }\n\n /** Move the camera relative to its current location by a distance in camera coordinates.\n * @param distance to move camera. Length is in world units, direction relative to current camera orientation.\n * @returns Status indicating whether the camera was successfully positioned. See values at [[ViewStatus]] for possible errors.\n */\n public moveCameraLocal(distance: Vector3d): ViewStatus {\n const distWorld = this.rotation.multiplyTransposeVector(distance);\n return this.moveCameraWorld(distWorld);\n }\n\n /** Move the camera relative to its current location by a distance in world coordinates.\n * @param distance in world units.\n * @returns Status indicating whether the camera was successfully positioned. See values at [[ViewStatus]] for possible errors.\n */\n public moveCameraWorld(distance: Vector3d): ViewStatus {\n if (!this._cameraOn) {\n this.origin.plus(distance, this.origin);\n return ViewStatus.Success;\n }\n\n const targetPoint = this.getTargetPoint().plus(distance);\n const eyePoint = this.getEyePoint().plus(distance);\n return this.lookAt({ eyePoint, targetPoint, upVector: this.getYVector() });\n }\n\n /** Rotate the camera from its current location about an axis relative to its current orientation.\n * @param angle The angle to rotate the camera.\n * @param axis The axis about which to rotate the camera. The axis is a direction relative to the current camera orientation.\n * @param aboutPt The point, in world coordinates, about which the camera is rotated. If aboutPt is undefined, the camera rotates in place\n * (i.e. about the current eyePoint).\n * @note Even though the axis is relative to the current camera orientation, the aboutPt is in world coordinates, \\b not relative to the camera.\n * @returns Status indicating whether the camera was successfully positioned. See values at [[ViewStatus]] for possible errors.\n */\n public rotateCameraLocal(angle: Angle, axis: Vector3d, aboutPt?: Point3d): ViewStatus {\n const axisWorld = this.getRotation().multiplyTransposeVector(axis);\n return this.rotateCameraWorld(angle, axisWorld, aboutPt);\n }\n\n /** Rotate the camera from its current location about an axis in world coordinates.\n * @param angle The angle to rotate the camera.\n * @param axis The world-based axis (direction) about which to rotate the camera.\n * @param aboutPt The point, in world coordinates, about which the camera is rotated. If aboutPt is undefined, the camera rotates in place\n * (i.e. about the current eyePoint).\n * @returns Status indicating whether the camera was successfully positioned. See values at [[ViewStatus]] for possible errors.\n */\n public rotateCameraWorld(angle: Angle, axis: Vector3d, aboutPt?: Point3d): ViewStatus {\n const about = aboutPt ? aboutPt : this.getEyePoint();\n const rotation = Matrix3d.createRotationAroundVector(axis, angle);\n if (!rotation)\n return ViewStatus.InvalidUpVector; // Invalid axis given\n const trans = Transform.createFixedPointAndMatrix(about, rotation);\n const targetPoint = trans.multiplyPoint3d(this.getTargetPoint());\n const upVector = rotation.multiplyVector(this.getYVector());\n return this.lookAt({ eyePoint: this.getEyePoint(), targetPoint, upVector });\n }\n\n /** Move camera about the global ellipsoid. This rotates the camera position about the center of the global ellipsoid maintaining the current height.\n * @param fromPoint Point to pan from.\n * @param point Point to point to.\n * @returns Status indicating whether the camera was successfully positioned. See values at [[ViewStatus]] for possible errors.\n */\n public moveCameraGlobal(fromPoint: Point3d, toPoint: Point3d): ViewStatus {\n if (!this.iModel.ecefLocation)\n return ViewStatus.NotGeolocated;\n\n if (this.globeMode !== GlobeMode.Ellipsoid)\n return ViewStatus.NotEllipsoidGlobeMode;\n\n const earthCenter = this.iModel.ecefLocation?.earthCenter;\n const rMatrix = Matrix3d.createRotationVectorToVector(Vector3d.createStartEnd(earthCenter, toPoint), Vector3d.createStartEnd(earthCenter, fromPoint));\n if (!rMatrix)\n return ViewStatus.DegenerateGeometry;\n\n const rotationTransform = Transform.createFixedPointAndMatrix(earthCenter, rMatrix);\n const frustum = this.calculateFrustum();\n if (!frustum)\n return ViewStatus.DegenerateGeometry;\n\n frustum.multiply(rotationTransform);\n return this.setupFromFrustum(frustum);\n }\n\n /** Get the distance from the eyePoint to the front plane for this view. */\n public getFrontDistance(): number { return this.getBackDistance() - this.extents.z; }\n\n /** Get the distance from the eyePoint to the back plane for this view. */\n public getBackDistance(): number {\n // backDist is the z component of the vector from the origin to the eyePoint .\n const eyeOrg = this.origin.vectorTo(this.getEyePoint());\n this.getRotation().multiplyVector(eyeOrg, eyeOrg);\n return eyeOrg.z;\n }\n\n /** Place the eyepoint of the camera so it is aligned with the center of the view. This removes any 1-point perspective skewing that may be\n * present in the current view.\n * @param backDistance If defined, the new the distance from the eyepoint to the back plane. Otherwise the distance from the\n * current eyepoint is used.\n */\n public centerEyePoint(backDistance?: number): void {\n const eyePoint = this.getExtents().scale(0.5);\n eyePoint.z = backDistance ? backDistance : this.getBackDistance();\n const eye = this.getOrigin().plus(this.getRotation().multiplyTransposeXYZ(eyePoint.x, eyePoint.y, eyePoint.z));\n this.camera.setEyePoint(eye);\n }\n\n /** Center the focus distance of the camera halfway between the front plane and the back plane, keeping the eyepoint,\n * lens angle, rotation, back distance, and front distance unchanged.\n * @note The focus distance, origin, and delta values are modified, but the view encloses the same volume and appears visually unchanged.\n */\n public centerFocusDistance(): void {\n const backDistance = this.getBackDistance();\n const frontDistance = this.getFrontDistance();\n const eyePoint = this.getEyePoint();\n const targetPoint = eyePoint.plusScaled(this.getZVector(), frontDistance - backDistance);\n this.lookAt({ eyePoint, targetPoint, upVector: this.getYVector(), lensAngle: this.getLensAngle(), frontDistance, backDistance });\n }\n\n /** Ensure the focus plane lies between the front and back planes. If not, center it. */\n public verifyFocusPlane(): void {\n if (!this._cameraOn)\n return;\n\n let backDist = this.getBackDistance();\n const frontDist = backDist - this.extents.z;\n const camera = this.camera;\n const extents = this.extents;\n const rot = this.rotation;\n\n if (backDist <= 0.0 || frontDist <= 0.0) {\n // the camera location is invalid. Set it based on the view range.\n const tanAngle = Math.tan(camera.lens.radians / 2.0);\n backDist = extents.z / tanAngle;\n camera.setFocusDistance(backDist / 2);\n this.centerEyePoint(backDist);\n return;\n }\n\n const focusDist = camera.focusDist;\n if (focusDist > frontDist && focusDist < backDist)\n return;\n\n // put it halfway between front and back planes\n camera.setFocusDistance((extents.z / 2.0) + frontDist);\n\n // moving the focus plane means we have to adjust the origin and delta too (they're on the focus plane, see diagram above)\n const ratio = camera.focusDist / focusDist;\n extents.x *= ratio;\n extents.y *= ratio;\n camera.eye.plus3Scaled(rot.rowZ(), -backDist, rot.rowX(), -0.5 * extents.x, rot.rowY(), -0.5 * extents.y, this.origin); // this centers the camera too\n }\n\n /** Get the current location of the eyePoint for camera in this view. */\n public getEyePoint(): Point3d { return this.camera.eye; }\n\n /** Get the lens angle for this view. */\n public getLensAngle(): Angle { return this.camera.lens; }\n\n /** Set the lens angle for this view.\n * @param angle The new lens angle in radians. Must be greater than 0 and less than pi.\n * @note This does not change the view's current field-of-view. Instead, it changes the lens that will be used if the view\n * is subsequently modified and the lens angle is used to position the eyepoint.\n * @note To change the field-of-view (i.e. \"zoom\") of a view, pass a new viewDelta to #lookAt\n */\n public setLensAngle(angle: Angle): void { this.camera.setLensAngle(angle); }\n\n /** Change the location of the eyePoint for the camera in this view.\n * @param pt The new eyepoint.\n * @note This method is generally for internal use only. Moving the eyePoint arbitrarily can result in skewed or illegal perspectives.\n * The most common method for user-level camera positioning is #lookAt.\n */\n public setEyePoint(pt: XYAndZ): void { this.camera.setEyePoint(pt); }\n\n /** Set the focus distance for this view.\n * @note Changing the focus distance changes the plane on which the delta.x and delta.y values lie. So, changing focus distance\n * without making corresponding changes to delta.x and delta.y essentially changes the lens angle, causing a \"zoom\" effect\n */\n public setFocusDistance(dist: number): void { this.camera.setFocusDistance(dist); }\n\n /** Get the distance from the eyePoint to the focus plane for this view. */\n public getFocusDistance(): number { return this.camera.focusDist; }\n\n /** Obtain an \"eye\" point for this view. If the camera is on, this simply returns [[Camera.getEyePoint]].\n * Otherwise, a pseudo-eye-point is computed from the view direction and a lens angle of PI/2.\n */\n public getEyeOrOrthographicViewPoint(): Point3d {\n if (this.isCameraOn)\n return this.camera.getEyePoint();\n\n this.camera.validateLens();\n const tanHalfAngle = Math.tan(this.camera.lens.radians / 2);\n const halfDelta = this.getExtents().magnitudeXY();\n const eyeDistance = tanHalfAngle ? (halfDelta / tanHalfAngle) : 0;\n const zVector = this.getRotation().getRow(2);\n\n return this.getCenter().plusScaled(zVector, - eyeDistance);\n }\n public createAuxCoordSystem(acsName: string): AuxCoordSystemState { return AuxCoordSystem3dState.createNew(acsName, this.iModel); }\n\n public override decorate(context: DecorateContext): void {\n super.decorate(context);\n if (this._environmentDecorations)\n this._environmentDecorations.decorate(context);\n }\n\n /** Returns the ground elevation taken from the environment added with the global z position of this imodel. */\n public getGroundElevation(): number {\n const env = this.getDisplayStyle3d().environment;\n return env.ground.elevation + this.iModel.globalOrigin.z;\n }\n\n /** Return the ground extents, which will originate either from the viewport frustum or the extents of the imodel. */\n public getGroundExtents(vp?: Viewport): AxisAlignedBox3d {\n const displayStyle = this.getDisplayStyle3d();\n const extents = new Range3d();\n if (!displayStyle.environment.displayGround)\n return extents; // Ground plane is not enabled\n\n const elevation = this.getGroundElevation();\n\n if (undefined !== vp) {\n const viewRay = Ray3d.create(Point3d.create(), vp.rotation.rowZ());\n const xyPlane = Plane3dByOriginAndUnitNormal.create(Point3d.create(0, 0, elevation), Vector3d.create(0, 0, 1));\n\n // first determine whether the ground plane is displayed in the view\n const worldFrust = vp.getFrustum();\n for (const point of worldFrust.points) {\n viewRay.origin = point; // We never modify the reference\n const xyzPoint = Point3d.create();\n const param = viewRay.intersectionWithPlane(xyPlane!, xyzPoint);\n if (param === undefined)\n return extents; // View does not show ground plane\n }\n }\n\n extents.setFrom(this.iModel.projectExtents);\n extents.low.z = extents.high.z = elevation;\n\n const center = extents.low.interpolate(.5, extents.high);\n\n const radius = extents.low.distance(extents.high);\n extents.setNull();\n extents.extendPoint(center); // Extents now contains single point\n extents.low.addScaledInPlace(Vector3d.create(-1, -1, -1), radius);\n extents.high.addScaledInPlace(Vector3d.create(1, 1, 1), radius);\n extents.low.z = extents.high.z = elevation;\n return extents;\n }\n\n /** @internal */\n public override getModelElevation(modelId: Id64String): number {\n const settings = this.getDisplayStyle3d().settings.getPlanProjectionSettings(modelId);\n return settings && settings.elevation ? settings.elevation : 0;\n }\n\n /** If the background map is displayed, return the point on the globe in directly front of the eye (or in center of view if camera off)\n * This is generally a better target point for orthographic views than the view center which can be far from the area of interest.\n * @public\n */\n public getEarthFocalPoint(): Point3d | undefined {\n if (!this.iModel.ecefLocation || this.globeMode !== GlobeMode.Ellipsoid)\n return undefined;\n\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n if (undefined === backgroundMapGeometry)\n return undefined;\n\n const earthEllipsoid = backgroundMapGeometry.getEarthEllipsoid();\n const viewZ = this.getRotation().rowZ();\n const center = this.getCenter();\n const eye = this.isCameraOn ? this.camera.getEyePoint() : center.plusScaled(viewZ, Constant.diameterOfEarth);\n const eyeRay = Ray3d.create(eye, viewZ);\n const fractions = new Array<number>(), points = new Array<Point3d>();\n\n if (earthEllipsoid.intersectRay(eyeRay, fractions, points, undefined)) {\n let fraction = -1.0E10, index = -1;\n for (let i = 0; i < fractions.length; i++)\n if (fractions[i] > fraction) {\n fraction = fractions[i];\n index = i;\n }\n return (index >= 0 && fraction < 0) ? points[index] : undefined;\n } else {\n return eyeRay.projectPointToRay(center);\n }\n }\n\n /**\n * For a geoLocated project, align the view with the global ellipsoid by rotating\n * around the supplied target point such that the view axis points toward the\n * globe center. If the viewing height is below the global transition threshold.\n * @param target The rotation target or pivot point. This point will remain stationary in the view.\n * @param transition If this is defined and true then the rotation is scaled by the [[ViewState.globalViewTransition]] This\n * will cause a smooth transition as a view is zoomed out from a specific location to a more global representation.\n * @public\n */\n public alignToGlobe(target: Point3d, transition?: boolean): ViewStatus {\n if (!this.iModel.ecefLocation)\n return ViewStatus.NotGeolocated;\n\n if (this.globeMode !== GlobeMode.Ellipsoid)\n return ViewStatus.NotEllipsoidGlobeMode;\n\n const globalTransition = this.globalViewTransition();\n\n if (globalTransition <= 0)\n return ViewStatus.HeightBelowTransition;\n\n const earthCenter = this.iModel.ecefLocation?.earthCenter;\n const viewCenter = this.getCenter();\n const viewZ = this.getRotation().rowZ();\n const eye = this.isCameraOn ? this.camera.eye : viewCenter.plusScaled(viewZ, Constant.diameterOfEarth);\n\n const centerToEye = earthCenter.unitVectorTo(eye);\n if (!centerToEye)\n return ViewStatus.DegenerateGeometry;\n\n const axis = viewZ.unitCrossProduct(centerToEye);\n if (!axis)\n return ViewStatus.DegenerateGeometry;\n\n const theta = viewZ.angleTo(centerToEye);\n if (theta.radians > Angle.piOver2Radians)\n return ViewStatus.DegenerateGeometry;\n\n if (theta.isAlmostZero)\n return ViewStatus.NoTransitionRequired;\n\n const transitionRotation = Matrix3d.createRotationAroundVector(axis, transition ? theta.cloneScaled(globalTransition) : theta);\n if (!transitionRotation)\n return ViewStatus.DegenerateGeometry;\n\n const transitionTransform = Transform.createFixedPointAndMatrix(target, transitionRotation);\n const frustum = this.calculateFrustum();\n if (!frustum)\n return ViewStatus.DegenerateGeometry;\n\n frustum.multiply(transitionTransform);\n return this.setupFromFrustum(frustum);\n }\n\n /** See [[ViewState.attachToViewport]]. */\n public override attachToViewport(args: AttachToViewportArgs): void {\n super.attachToViewport(args);\n\n const removeListener = this.displayStyle.settings.onEnvironmentChanged.addListener((env) => {\n this._environmentDecorations?.setEnvironment(env);\n });\n\n this._environmentDecorations = new EnvironmentDecorations(this, () => args.invalidateDecorations(), () => removeListener());\n }\n /** See [[ViewState.detachFromViewport]]. */\n public override detachFromViewport(): void {\n super.detachFromViewport();\n this._environmentDecorations = dispose(this._environmentDecorations);\n }\n}\n\n/** Defines the state of a view of a single 2d model.\n * @public\n * @extensions\n */\nexport abstract class ViewState2d extends ViewState {\n private readonly _details: ViewDetails;\n public static override get className() { return \"ViewDefinition2d\"; }\n public readonly origin: Point2d;\n public readonly delta: Point2d;\n public readonly angle: Angle;\n protected _baseModelId: Id64String;\n public get baseModelId(): Id64String { return this._baseModelId; }\n /** @internal */\n protected _treeRef?: TileTreeReference;\n\n /** @internal */\n protected get _tileTreeRef(): TileTreeReference | undefined {\n if (undefined === this._treeRef) {\n const model = this.getViewedModel();\n if (undefined !== model)\n this._treeRef = model.createTileTreeReference(this);\n }\n\n return this._treeRef;\n }\n\n public constructor(props: ViewDefinition2dProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle2dState) {\n super(props, iModel, categories, displayStyle);\n this.origin = Point2d.fromJSON(props.origin);\n this.delta = Point2d.fromJSON(props.delta);\n this.angle = Angle.fromJSON(props.angle);\n this._baseModelId = Id64.fromJSON(props.baseModelId);\n this._details = new ViewDetails(this.jsonProperties);\n }\n\n public override toJSON(): ViewDefinition2dProps {\n const val = super.toJSON() as ViewDefinition2dProps;\n val.origin = this.origin;\n val.delta = this.delta;\n val.angle = this.angle;\n val.baseModelId = this.baseModelId;\n return val;\n }\n\n /** See [[ViewState.is3d]]. */\n public is3d(): this is ViewState3d { return false; }\n\n /** @internal */\n public isSpatialView(): this is SpatialViewState { return false; }\n\n /** Capture a copy of the viewed area. */\n public savePose(): ViewPose2d { return new ViewPose2d(this); }\n\n /** See [[ViewState.applyPose]]. */\n public applyPose(val: ViewPose) {\n if (val instanceof ViewPose2d) {\n this.setOrigin(val.origin);\n this.setExtents(val.delta);\n this.angle.setFrom(val.angle);\n }\n\n return this;\n }\n\n /** Return the model for this 2d view. */\n public getViewedModel(): GeometricModel2dState | undefined {\n const model = this.iModel.models.getLoaded(this.baseModelId);\n if (model && !(model instanceof GeometricModel2dState))\n return undefined;\n\n return model;\n }\n\n /** Change the model viewed by this view.\n * @note The new model should be of the same type (drawing or sheet) as the current viewed model.\n * @throws Error if attempting to change the viewed model while the view is attached to a viewport.\n * @see [[Viewport.changeViewedModel2d]].\n * @public\n */\n public async changeViewedModel(newViewedModelId: Id64String): Promise<void> {\n if (this.isAttachedToViewport)\n throw new Error(\"Cannot change the viewed model of a view that is attached to a viewport.\");\n\n this._baseModelId = newViewedModelId;\n this._treeRef = undefined;\n await this.load();\n }\n\n public computeFitRange(): Range3d {\n return this.getViewedExtents();\n }\n\n /** @internal */\n protected override preload(hydrateRequest: HydrateViewStateRequestProps): void {\n super.preload(hydrateRequest);\n if (this.iModel.models.getLoaded(this.baseModelId) === undefined)\n hydrateRequest.baseModelId = this.baseModelId;\n }\n\n /** @internal */\n protected override async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\n const promises = [];\n promises.push(super.postload(hydrateResponse));\n if (hydrateResponse.baseModelProps !== undefined)\n promises.push(this.iModel.models.updateLoadedWithModelProps([hydrateResponse.baseModelProps]));\n await Promise.all(promises);\n }\n\n /** Provides access to optional detail settings for this view. */\n public get details(): ViewDetails {\n return this._details;\n }\n\n public allow3dManipulations(): boolean { return false; }\n public getOrigin() { return new Point3d(this.origin.x, this.origin.y, Frustum2d.minimumZExtents.low); }\n public getExtents() { return new Vector3d(this.delta.x, this.delta.y, Frustum2d.minimumZExtents.length()); }\n public getRotation() { return Matrix3d.createRotationAroundVector(Vector3d.unitZ(), this.angle)!; }\n public setExtents(delta: XAndY) { this.delta.set(delta.x, delta.y); }\n public setOrigin(origin: XAndY) { this.origin.set(origin.x, origin.y); }\n public setRotation(rot: Matrix3d) {\n const xColumn = rot.getColumn(0);\n this.angle.setRadians(Math.atan2(xColumn.y, xColumn.x));\n }\n\n public viewsModel(modelId: Id64String) { return this.baseModelId === modelId; }\n public forEachModel(func: (model: GeometricModelState) => void) {\n const model = this.iModel.models.getLoaded(this.baseModelId);\n if (undefined !== model && undefined !== model.asGeometricModel2d)\n func(model as GeometricModel2dState);\n }\n\n /** @internal */\n public override * getModelTreeRefs(): Iterable<TileTreeReference> {\n if (this._tileTreeRef) {\n yield this._tileTreeRef;\n }\n }\n\n public createAuxCoordSystem(acsName: string): AuxCoordSystemState { return AuxCoordSystem2dState.createNew(acsName, this.iModel); }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ViewState.js","sourceRoot":"","sources":["../../src/ViewState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoH;AACpH,wDAI8B;AAC9B,oDAK4B;AAC5B,+CAAkG;AAElG,2DAAkG;AAElG,+CAA6C;AAC7C,2CAAwC;AACxC,2CAAwC;AAExC,6CAA0E;AAC1E,+DAAoF;AAKpF,iDAA8D;AAC9D,8CAA0E;AAG1E,6DAA+F;AAC/F,iDAA8C;AAE9C,yCAA8D;AAC9D,6CAA0C;AAC1C,qEAAkE;AAClE,uDAAqE;AAkHrE,uGAAuG;AACvG,MAAM,aAAa;IACmB;IAApC,YAAoC,KAAgB;QAAhB,UAAK,GAAL,KAAK,CAAW;IAAI,CAAC;IAEzC,oBAAoB,GAAG,IAAI,CAAC;IAErC,QAAQ,CAAC,OAAwB;QACtC,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC5B,IAAI,CAAC,EAAE,CAAC,QAAQ;YACd,OAAO;QAET,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC;QACpD,IAAI,iCAAmB,CAAC,QAAQ,GAAG,WAAW,EAAE,CAAC;YAC/C,OAAO,CAAC,eAAe;QACzB,CAAC;QACD,IAAI,iCAAmB,CAAC,QAAQ,KAAK,WAAW,EAAE,CAAC;YACjD,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACvD,OAAO;QACT,CAAC;QAED,MAA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E,gBAAgB;QAChC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,MAAM,IAAI,CAAC,YAAY,CAAC;QAC1B,CAAC;IACH,CAAC;IAEM,oBAAoB,CAAC,OAAe,IAAyB,OAAO,mCAAqB,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CACpI;AA7ID,kCA6IC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { assert, BeEvent, dispose, expectDefined, Id64, Id64Arg, Id64String, JsonUtils } from \"@itwin/core-bentley\";\nimport {\n Angle, AxisOrder, ClipVector, Constant, Geometry, LongitudeLatitudeNumber, LowAndHighXY, LowAndHighXYZ, Map4d, Matrix3d,\n Plane3dByOriginAndUnitNormal, Point2d, Point3d, Range2d, Range3d, Ray3d, Transform, Vector2d, Vector3d, XAndY,\n XYAndZ, XYZ, YawPitchRollAngles,\n} from \"@itwin/core-geometry\";\nimport {\n AnalysisStyle, AxisAlignedBox3d, Camera, Cartographic, ColorDef, FeatureAppearance, Frustum, GlobeMode, GridOrientationType,\n HydrateViewStateRequestProps, HydrateViewStateResponseProps, IModelReadRpcInterface,\n ModelClipGroups, Npc, RenderSchedule, SubCategoryOverride,\n ViewDefinition2dProps, ViewDefinition3dProps, ViewDefinitionProps, ViewDetails, ViewDetails3d, ViewFlags, ViewStateProps,\n} from \"@itwin/core-common\";\nimport { AuxCoordSystem2dState, AuxCoordSystem3dState, AuxCoordSystemState } from \"./AuxCoordSys\";\nimport { CategorySelectorState } from \"./CategorySelectorState\";\nimport { DisplayStyle2dState, DisplayStyle3dState, DisplayStyleState } from \"./DisplayStyleState\";\nimport { DrawingViewState } from \"./DrawingViewState\";\nimport { ElementState } from \"./EntityState\";\nimport { Frustum2d } from \"./Frustum2d\";\nimport { IModelApp } from \"./IModelApp\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { GeometricModel2dState, GeometricModelState } from \"./ModelState\";\nimport { NotifyMessageDetails, OutputMessagePriority } from \"./NotificationManager\";\nimport { RenderClipVolume } from \"./render/RenderClipVolume\";\nimport { RenderMemory } from \"./render/RenderMemory\";\nimport { SheetViewState } from \"./SheetViewState\";\nimport { SpatialViewState } from \"./SpatialViewState\";\nimport { StandardView, StandardViewId } from \"./StandardView\";\nimport { DisclosedTileTreeSet, TileTreeReference } from \"./tile/internal\";\nimport { MarginOptions, OnViewExtentsError } from \"./ViewAnimation\";\nimport { DecorateContext, SceneContext } from \"./ViewContext\";\nimport { areaToEyeHeight, areaToEyeHeightFromGcs, GlobalLocation } from \"./ViewGlobalLocation\";\nimport { ViewingSpace } from \"./ViewingSpace\";\nimport { Viewport } from \"./Viewport\";\nimport { ViewPose, ViewPose2d, ViewPose3d } from \"./ViewPose\";\nimport { ViewStatus } from \"./ViewStatus\";\nimport { EnvironmentDecorations } from \"./EnvironmentDecorations\";\nimport { _scheduleScriptReference } from \"./common/internal/Symbols\";\n\n/** Describes the largest and smallest values allowed for the extents of a [[ViewState]].\n * Attempts to exceed these limits in any dimension will fail, preserving the previous extents.\n * @public\n * @extensions\n */\nexport interface ExtentLimits {\n /** The smallest allowed extent in any dimension. */\n min: number;\n /** The largest allowed extent in any dimension. */\n max: number;\n}\n\n/** A [Transform]($core-geometry) supplied by a [[ModelDisplayTransformProvider]] to be applied to a model when displaying it in a [[Viewport]].\n * @beta\n */\nexport interface ModelDisplayTransform {\n /** The transform to be applied to the model. */\n transform: Transform;\n /** If `true`, [[transform]] is pre-multiplied with (i.e., appled before) the model's base transform.\n * Otherwise, the display transform will instead be post-multiplied with (i.e., applied after) the base transform.\n */\n premultiply?: boolean;\n}\n\n/** Interface adopted by an object that wants to apply a [[ModelDisplayTransform]] to one or more models within a [[Viewport]].\n * @see [[ViewState.modelDisplayTransformProvider]] to get or set the transform provider for a view.\n * @see [[ViewState.computeDisplayTransform]] to compute a full display transform for a model or an element within it, which may include a transform supplied by a ModelDisplayTransformProvider.\n * @beta\n */\nexport interface ModelDisplayTransformProvider {\n /** Return the transform to be applied to the specified model, if any. */\n getModelDisplayTransform(modelId: Id64String): ModelDisplayTransform | undefined;\n}\n\n/** Arguments supplied to [[ViewState.computeDisplayTransform]].\n * @beta\n */\nexport interface ComputeDisplayTransformArgs {\n /** The Id of the model for which to compute the display transform. */\n modelId: Id64String;\n /** The Id of a specific element belonging to the model identified by [[modelId]] for which to compute the display transform. */\n elementId?: Id64String;\n /** The point in time, expressed in [Unix seconds](https://en.wikipedia.org/wiki/Unix_time), at which to evaluate the display transform.\n * Defaults to the [DisplayStyleSettings.timePoint]($common) specified by the view's display style.\n */\n timePoint?: number;\n /** The element Id of the [ViewAttachment]($backend) through which the element or model is drawn.\n * @beta\n */\n viewAttachmentId?: Id64String;\n /** True if the element or model was drawn through a [[SpatialViewState]] attached to a [SectionDrawing]($backend).\n * @beta\n */\n inSectionDrawingAttachment?: boolean;\n /** If supplied, [[ViewState.computeDisplayTransform]] will modify and return this Transform to hold the result instead of allocating a new Transform.\n * @note If [[ViewState.computeDisplayTransform]] returns `undefined`, this Transform will be unmodified.\n */\n output?: Transform;\n}\n\n/** Arguments to [[ViewState3d.lookAt]] for either a perspective or orthographic view\n * @public\n */\nexport interface LookAtArgs {\n /** The new location of the camera/eye. */\n readonly eyePoint: XYAndZ;\n /** A vector that orients the camera's \"up\" (view y). This vector must not be parallel to the view direction. */\n readonly upVector: Vector3d;\n /** The new size (width and height) of the view rectangle on the focus plane centered on the targetPoint. If undefined, the existing size is unchanged. */\n readonly newExtents?: XAndY;\n /** The distance from the eyePoint to the front plane. If undefined, the existing front distance is used. */\n readonly frontDistance?: number;\n /** The distance from the eyePoint to the back plane. If undefined, the existing back distance is used. */\n readonly backDistance?: number;\n /** Used for providing onExtentsError. */\n readonly opts?: OnViewExtentsError;\n}\n\n/** Arguments to [[ViewState3d.lookAt]] to set up a perspective view\n * @public\n */\nexport interface LookAtPerspectiveArgs extends LookAtArgs {\n /** The new location to which the camera should point. This becomes the center of the view on the focus plane. */\n readonly targetPoint: XYAndZ;\n\n readonly viewDirection?: never;\n readonly lensAngle?: never;\n}\n\n/** Arguments to [[ViewState3d.lookAt]] to set up an orthographic view\n * @public\n */\nexport interface LookAtOrthoArgs extends LookAtArgs {\n /** The direction in which the view should look. */\n readonly viewDirection: XYAndZ;\n\n readonly targetPoint?: never;\n readonly lensAngle?: never;\n}\n\n/** Arguments to [[ViewState3d.lookAt]] to set up an perspective view using a (field-of-view) lens angle.\n * @public\n */\nexport interface LookAtUsingLensAngle extends LookAtArgs {\n /** The new location to which the camera should point. This becomes the center of the view on the focus plane. */\n readonly targetPoint: XYAndZ;\n /** The angle that defines the field-of-view for the camera. Must be between .0001 and pi. */\n readonly lensAngle: Angle;\n\n readonly viewDirection?: never;\n}\n\n/** Decorates the viewport with the view's grid. Graphics are cached as long as scene remains valid. */\nclass GridDecorator {\n public constructor(private readonly _view: ViewState) { }\n\n public readonly useCachedDecorations = true;\n\n public decorate(context: DecorateContext): void {\n const vp = context.viewport;\n if (!vp.isGridOn)\n return;\n\n const orientation = this._view.getGridOrientation();\n if (GridOrientationType.AuxCoord < orientation) {\n return; // NEEDSWORK...\n }\n if (GridOrientationType.AuxCoord === orientation) {\n this._view.auxiliaryCoordinateSystem.drawGrid(context);\n return;\n }\n\n const isoGrid = false;\n const gridsPerRef = this._view.getGridsPerRef();\n const spacing = Point2d.createFrom(this._view.getGridSpacing());\n const origin = Point3d.create();\n const matrix = Matrix3d.createIdentity();\n const fixedRepsAuto = Point2d.create();\n\n this._view.getGridSettings(vp, origin, matrix, orientation);\n context.drawStandardGrid(origin, matrix, spacing, gridsPerRef, isoGrid, orientation !== GridOrientationType.View ? fixedRepsAuto : undefined);\n }\n}\n\nconst scratchCorners = Range3d.createNull().corners();\nconst scratchRay = Ray3d.createZero();\nconst unitRange2d = Range2d.createXYXY(0, 0, 1, 1);\nconst scratchRange2d = Range2d.createNull();\nconst scratchRange2dIntersect = Range2d.createNull();\n\n/** Arguments to [[ViewState.attachToViewport]].\n * @note The [[Viewport]] has a dependency upon and control over the [[ViewState]]. Do not use `attachToViewport` to introduce a dependency in\n * the opposite direction.\n * @public\n */\nexport type AttachToViewportArgs = Viewport;\n\n/** Arguments to [[ViewState.getAttachmentViewport]].\n * @internal\n */\nexport interface GetAttachmentViewportArgs {\n viewAttachmentId?: Id64String;\n inSectionDrawingAttachment?: boolean;\n}\n\n/** The front-end state of a [[ViewDefinition]] element.\n * A ViewState is typically associated with a [[Viewport]] to display the contents of the view on the screen. A ViewState being displayed by a Viewport is considered to be\n * \"attached\" to that viewport; a \"detached\" viewport is not being displayed by any viewport. Because the Viewport modifies the state of its attached ViewState, a ViewState\n * can only be attached to one Viewport at a time. Technically, two Viewports can display two different ViewStates that both use the same [[DisplayStyleState]], but this is\n * discouraged - changes made to the style by one Viewport will affect the contents of the other Viewport.\n * * @see [Views]($docs/learning/frontend/Views.md)\n * @public\n * @extensions\n */\nexport abstract class ViewState extends ElementState {\n public static override get className() { return \"ViewDefinition\"; }\n\n private _auxCoordSystem?: AuxCoordSystemState;\n private _extentLimits?: ExtentLimits;\n private _modelDisplayTransformProvider?: ModelDisplayTransformProvider;\n public description?: string;\n public isPrivate?: boolean;\n private readonly _gridDecorator: GridDecorator;\n private _categorySelector: CategorySelectorState;\n private _displayStyle: DisplayStyleState;\n private readonly _unregisterCategorySelectorListeners: VoidFunction[] = [];\n\n /** An event raised when the set of categories viewed by this view changes, *only* if the view is attached to a [[Viewport]]. */\n public readonly onViewedCategoriesChanged = new BeEvent<() => void>();\n\n /** An event raised just before assignment to the [[displayStyle]] property, *only* if the view is attached to a [[Viewport]].\n * @see [[DisplayStyleSettings]] for events raised when properties of the display style change.\n */\n public readonly onDisplayStyleChanged = new BeEvent<(newStyle: DisplayStyleState) => void>();\n\n /** Event raised just before assignment to the [[modelDisplayTransformProvider]] property, *only* if the view is attached to a [[Viewport]].\n * @beta\n */\n public readonly onModelDisplayTransformProviderChanged = new BeEvent<(newProvider: ModelDisplayTransformProvider | undefined) => void>();\n\n /** Selects the categories that are display by this ViewState. */\n public get categorySelector(): CategorySelectorState {\n return this._categorySelector;\n }\n\n public set categorySelector(selector: CategorySelectorState) {\n if (selector === this._categorySelector)\n return;\n\n const isAttached = this.isAttachedToViewport;\n this.unregisterCategorySelectorListeners();\n\n this._categorySelector = selector;\n\n if (isAttached) {\n this.registerCategorySelectorListeners();\n this.onViewedCategoriesChanged.raiseEvent();\n }\n }\n\n /** The style that controls how the contents of the view are displayed. */\n public get displayStyle(): DisplayStyleState {\n return this._displayStyle;\n }\n\n public set displayStyle(style: DisplayStyleState) {\n if (style === this.displayStyle)\n return;\n\n if (this.isAttachedToViewport)\n this.onDisplayStyleChanged.raiseEvent(style);\n\n this._displayStyle = style;\n }\n\n /** @internal */\n protected constructor(props: ViewDefinitionProps, iModel: IModelConnection, categoryOrClone: CategorySelectorState, displayStyle: DisplayStyleState) {\n super(props, iModel);\n this.description = props.description;\n this.isPrivate = props.isPrivate;\n this._displayStyle = displayStyle;\n this._categorySelector = categoryOrClone;\n this._gridDecorator = new GridDecorator(this);\n if (!(categoryOrClone instanceof ViewState)) // is this from the clone method?\n return; // not from clone\n\n // from clone, 3rd argument is source ViewState\n const source = categoryOrClone as ViewState;\n this._categorySelector = source.categorySelector.clone();\n this._displayStyle = source.displayStyle.clone();\n this._extentLimits = source._extentLimits;\n this._auxCoordSystem = source._auxCoordSystem;\n this._modelDisplayTransformProvider = source._modelDisplayTransformProvider;\n }\n\n /** Create a new ViewState object from a set of properties. Generally this is called internally by [[IModelConnection.Views.load]] after the properties\n * have been read from an iModel. But, it can also be used to create a ViewState in memory, from scratch or from properties stored elsewhere.\n */\n public static createFromProps(_props: ViewStateProps, _iModel: IModelConnection): ViewState | undefined { return undefined; }\n\n /** Serialize this ViewState as a set of properties that can be used to recreate it via [[ViewState.createFromProps]]. */\n public toProps(): ViewStateProps {\n return {\n viewDefinitionProps: this.toJSON(),\n categorySelectorProps: this.categorySelector.toJSON(),\n displayStyleProps: this.displayStyle.toJSON(),\n };\n }\n\n /** Flags controlling various aspects of this view's [[DisplayStyleState]].\n * @see [DisplayStyleSettings.viewFlags]($common)\n */\n public get viewFlags(): ViewFlags {\n return this.displayStyle.viewFlags;\n }\n public set viewFlags(flags: ViewFlags) {\n this.displayStyle.viewFlags = flags;\n }\n\n /** See [DisplayStyleSettings.analysisStyle]($common). */\n public get analysisStyle(): AnalysisStyle | undefined {\n return this.displayStyle.settings.analysisStyle;\n }\n\n /** The [RenderSchedule.Script]($common) that animates the contents of the view, if any.\n * @see [[DisplayStyleState.scheduleScript]].\n */\n public get scheduleScript(): RenderSchedule.Script | undefined {\n return this.displayStyle.scheduleScript;\n }\n\n /** @internal */\n public get [_scheduleScriptReference](): RenderSchedule.ScriptReference | undefined {\n return this.displayStyle[_scheduleScriptReference];\n }\n\n /** Get the globe projection mode.\n * @internal\n */\n public get globeMode(): GlobeMode { return this.displayStyle.globeMode; }\n\n /** Determine whether this ViewState exactly matches another. */\n public override equals(other: this): boolean { return super.equals(other) && this.categorySelector.equals(other.categorySelector) && this.displayStyle.equals(other.displayStyle); }\n\n /** Convert to JSON representation. */\n public override toJSON(): ViewDefinitionProps {\n const json = super.toJSON() as ViewDefinitionProps;\n json.categorySelectorId = this.categorySelector.id;\n json.displayStyleId = this.displayStyle.id;\n json.isPrivate = this.isPrivate;\n json.description = this.description;\n return json;\n }\n\n /**\n * Populates the hydrateRequest object stored on the ViewState with:\n * not loaded categoryIds based off of the ViewStates categorySelector.\n * Auxiliary coordinate system id if valid.\n */\n protected preload(hydrateRequest: HydrateViewStateRequestProps): void {\n const acsId = this.getAuxiliaryCoordinateSystemId();\n if (Id64.isValid(acsId))\n hydrateRequest.acsId = acsId;\n }\n\n /** Asynchronously load any required data for this ViewState from the backend.\n * FINAL, No subclass should override load. If additional load behavior is needed, see preload and postload.\n * @note callers should await the Promise returned by this method before using this ViewState.\n * @see [Views]($docs/learning/frontend/Views.md)\n */\n public async load(): Promise<void> {\n // If the iModel associated with the viewState is a blankConnection,\n // then no data can be retrieved from the backend.\n if (this.iModel.isBlank)\n return;\n\n const hydrateRequest: HydrateViewStateRequestProps = {};\n this.preload(hydrateRequest);\n const promises: Promise<void>[] = [\n IModelReadRpcInterface.getClientForRouting(this.iModel.routingContext.token).hydrateViewState(this.iModel.getRpcProps(), hydrateRequest).\n then(async (hydrateResponse) => this.postload(hydrateResponse)),\n this.displayStyle.load(),\n ];\n\n const subcategories = this.iModel.subcategories.load(this.categorySelector.categories);\n if (undefined !== subcategories)\n promises.push(subcategories.promise.then((_) => { }));\n\n await Promise.all(promises);\n }\n\n protected async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\n if (hydrateResponse.acsElementProps)\n this._auxCoordSystem = AuxCoordSystemState.fromProps(hydrateResponse.acsElementProps, this.iModel);\n }\n\n /** Returns true if all [[TileTree]]s required by this view have been loaded.\n * Note that the map tile trees associated to the viewport rather than the view, to check the\n * map tiles as well call [[Viewport.areAreAllTileTreesLoaded]].\n */\n public get areAllTileTreesLoaded(): boolean {\n for (const ref of this.getTileTreeRefs()) {\n if (!ref.isLoadingComplete) {\n return false;\n }\n }\n\n return true;\n }\n\n /** Get the name of the [[ViewDefinition]] from which this ViewState originated. */\n public get name(): string {\n return this.code.value;\n }\n\n /** Get this view's background color. */\n public get backgroundColor(): ColorDef {\n return this.displayStyle.backgroundColor;\n }\n\n /** Query the symbology overrides applied to geometry belonging to a specific subcategory when rendered using this ViewState.\n * @param id The Id of the subcategory.\n * @return The symbology overrides applied to all geometry belonging to the specified subcategory, or undefined if no such overrides exist.\n */\n public getSubCategoryOverride(id: Id64String): SubCategoryOverride | undefined {\n return this.displayStyle.getSubCategoryOverride(id);\n }\n\n /** Query the symbology overrides applied to a model when rendered using this ViewState.\n * @param id The Id of the model.\n * @return The symbology overrides applied to the model, or undefined if no such overrides exist.\n */\n public getModelAppearanceOverride(id: Id64String): FeatureAppearance | undefined {\n return this.displayStyle.settings.getModelAppearanceOverride(id);\n }\n\n /** @internal */\n public isSubCategoryVisible(id: Id64String): boolean {\n const app = this.iModel.subcategories.getSubCategoryAppearance(id);\n if (undefined === app)\n return false;\n\n const ovr = this.getSubCategoryOverride(id);\n if (undefined === ovr || undefined === ovr.invisible)\n return !app.invisible;\n\n return !ovr.invisible;\n }\n\n /** Provides access to optional detail settings for this view. */\n public abstract get details(): ViewDetails;\n\n /** Returns true if this ViewState is-a [[ViewState3d]] */\n public abstract is3d(): this is ViewState3d;\n /** Returns true if this ViewState is-a [[ViewState2d]] */\n public is2d(): this is ViewState2d { return !this.is3d(); }\n /** Returns true if this ViewState is-a [[SpatialViewState]] */\n public abstract isSpatialView(): this is SpatialViewState;\n /** Returns true if this ViewState is-a [[DrawingViewState]] */\n public abstract isDrawingView(): this is DrawingViewState;\n /** Returns true if this ViewState is-a [[SheetViewState]] */\n public isSheetView(): this is SheetViewState { return false; }\n /** Returns true if [[ViewTool]]s are allowed to operate in three dimensions on this view. */\n public abstract allow3dManipulations(): boolean;\n /** @internal */\n public abstract createAuxCoordSystem(acsName: string): AuxCoordSystemState;\n /** Get the extents of this view in [[CoordSystem.World]] coordinates. */\n public abstract getViewedExtents(): AxisAlignedBox3d;\n /** Compute a range in [[CoordSystem.World]] coordinates that tightly encloses the contents of this view.\n * @see [[FitViewTool]].\n */\n public abstract computeFitRange(): Range3d;\n\n /** Returns true if this view displays the contents of a [[Model]] specified by Id. */\n public abstract viewsModel(modelId: Id64String): boolean;\n\n /** Get the origin of this view in [[CoordSystem.World]] coordinates. */\n public abstract getOrigin(): Point3d;\n\n /** Get the extents of this view in [[CoordSystem.World]] coordinates. */\n public abstract getExtents(): Vector3d;\n\n /** Get the 3x3 ortho-normal Matrix3d for this view. */\n public abstract getRotation(): Matrix3d;\n\n /** Set the origin of this view in [[CoordSystem.World]] coordinates. */\n public abstract setOrigin(viewOrg: XYAndZ): void;\n\n /** Set the extents of this view in [[CoordSystem.World]] coordinates. */\n public abstract setExtents(viewDelta: Vector3d): void;\n\n /** set the center of this view to a new position. */\n public setCenter(center: Point3d) {\n const diff = center.minus(this.getCenter());\n this.setOrigin(this.getOrigin().plus(diff));\n }\n\n /** Change the rotation of the view.\n * @note viewRot must be ortho-normal. For 2d views, only the rotation angle about the z axis is used.\n */\n public abstract setRotation(viewRot: Matrix3d): void;\n\n /** Execute a function on each viewed model */\n public abstract forEachModel(func: (model: GeometricModelState) => void): void;\n\n /** @internal */\n public abstract getModelTreeRefs(): Iterable<TileTreeReference>;\n\n /** Execute a function against each [[TileTreeReference]] associated with this view.\n * This may include tile trees not associated with any [[GeometricModelState]] - e.g., context reality data.\n * @note This method is inefficient (iteration cannot be aborted) and awkward (callback cannot be async nor return a value). Prefer to iterate using [[getTileTreeRefs]].\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[getTileTreeRefs]] instead.\n */\n public forEachTileTreeRef(func: (treeRef: TileTreeReference) => void): void {\n for (const ref of this.getModelTreeRefs()) {\n func(ref);\n }\n\n for (const ref of this.displayStyle.getTileTreeRefs()) {\n func(ref);\n }\n }\n\n public * getTileTreeRefs(): Iterable<TileTreeReference> {\n yield * this.getModelTreeRefs();\n yield * this.displayStyle.getTileTreeRefs();\n }\n\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.\n * @internal\n */\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n for (const ref of this.getTileTreeRefs()) {\n trees.disclose(ref);\n }\n }\n\n /** Discloses graphics memory consumed by viewed tile trees and other consumers like view attachments.\n * @internal\n */\n public collectStatistics(stats: RenderMemory.Statistics): void {\n const trees = new DisclosedTileTreeSet();\n this.discloseTileTrees(trees);\n for (const tree of trees)\n tree.collectStatistics(stats);\n\n this.collectNonTileTreeStatistics(stats);\n }\n\n /** Discloses graphics memory consumed by any consumers *other* than viewed tile trees, like view attachments.\n * @internal\n */\n public collectNonTileTreeStatistics(_stats: RenderMemory.Statistics): void {\n //\n }\n\n /** Capture a copy of this view's viewed volume.\n * @see [[applyPose]] to apply the pose to this or another view.\n * @public\n * @extensions\n */\n public abstract savePose(): ViewPose;\n\n /** Apply a pose to this view to change the viewed volume.\n * @see [[savePose]] to capture the view's pose.\n * @public\n * @extensions\n */\n public abstract applyPose(props: ViewPose): this;\n\n /** @internal */\n public createScene(context: SceneContext): void {\n for (const ref of this.getTileTreeRefs()) {\n ref.addToScene(context);\n }\n }\n\n /** Add view-specific decorations. The base implementation draws the grid. Subclasses must invoke super.decorate()\n * @internal\n */\n public decorate(context: DecorateContext): void {\n this.drawGrid(context);\n }\n\n /** @internal */\n public static getStandardViewMatrix(id: StandardViewId): Matrix3d {\n return StandardView.getStandardRotation(id);\n }\n\n /** Orient this view to one of the [[StandardView]] rotations. */\n public setStandardRotation(id: StandardViewId) { this.setRotation(ViewState.getStandardViewMatrix(id)); }\n\n /** Orient this view to one of the [[StandardView]] rotations, if the the view is not viewing the project then the\n * standard rotation is relative to the global position rather than the project.\n */\n public setStandardGlobalRotation(id: StandardViewId) {\n const worldToView = ViewState.getStandardViewMatrix(id);\n const globeToWorld = this.getGlobeRotation();\n if (globeToWorld)\n return this.setRotation(worldToView.multiplyMatrixMatrix(globeToWorld));\n else\n this.setRotation(worldToView);\n }\n\n /** Get the target point of the view. If there is no camera, center is returned. */\n public getTargetPoint(result?: Point3d): Point3d { return this.getCenter(result); }\n\n /** Get the point at the geometric center of the view. */\n public getCenter(result?: Point3d): Point3d {\n const delta = this.getRotation().multiplyTransposeVector(this.getExtents());\n return this.getOrigin().plusScaled(delta, 0.5, result);\n }\n\n /** @internal */\n public drawGrid(context: DecorateContext): void {\n context.addFromDecorator(this._gridDecorator);\n }\n\n /** @internal */\n public computeWorldToNpc(viewRot?: Matrix3d, inOrigin?: Point3d, delta?: Vector3d, enforceFrontToBackRatio = true): { map: Map4d | undefined, frustFraction: number } {\n if (viewRot === undefined)\n viewRot = this.getRotation();\n\n const xVector = viewRot.rowX();\n const yVector = viewRot.rowY();\n const zVector = viewRot.rowZ();\n\n if (delta === undefined)\n delta = this.getExtents();\n if (inOrigin === undefined)\n inOrigin = this.getOrigin();\n\n let frustFraction = 1.0;\n let xExtent: Vector3d;\n let yExtent: Vector3d;\n let zExtent: Vector3d;\n let origin: Point3d;\n\n // Compute root vectors along edges of view frustum.\n if (this.is3d() && this.isCameraOn) {\n const camera = this.camera;\n const eyeToOrigin = Vector3d.createStartEnd(camera.eye, inOrigin); // vector from origin on backplane to eye\n viewRot.multiplyVectorInPlace(eyeToOrigin); // align with view coordinates.\n\n const focusDistance = camera.focusDist;\n let zDelta = delta.z;\n let zBack = eyeToOrigin.z; // Distance from eye to backplane.\n let zFront = zBack + zDelta; // Distance from eye to frontplane.\n\n const nearScale = IModelApp.renderSystem.supportsLogZBuffer ? ViewingSpace.nearScaleLog24 : ViewingSpace.nearScaleNonLog24;\n if (enforceFrontToBackRatio && zFront / zBack < nearScale) {\n // In this case we are running up against the zBuffer resolution limitation (currently 24 bits).\n // Set back clipping plane at 10 kilometer which gives us a front clipping plane about 3 meters.\n // Decreasing the maximumBackClip (MicroStation uses 1 kilometer) will reduce the minimum front\n // clip, but also reduce the back clip (so far geometry may not be visible).\n const maximumBackClip = 10 * Constant.oneKilometer;\n if (-zBack > maximumBackClip) {\n zBack = -maximumBackClip;\n eyeToOrigin.z = zBack;\n }\n\n zFront = zBack * nearScale;\n zDelta = zFront - eyeToOrigin.z;\n }\n\n // z out back of eye ===> origin z coordinates are negative. (Back plane more negative than front plane)\n const backFraction = -zBack / focusDistance; // Perspective fraction at back clip plane.\n const frontFraction = -zFront / focusDistance; // Perspective fraction at front clip plane.\n frustFraction = frontFraction / backFraction;\n\n // delta.x,delta.y are view rectangle sizes at focus distance. Scale to back plane:\n xExtent = xVector.scale(delta.x * backFraction); // xExtent at back == delta.x * backFraction.\n yExtent = yVector.scale(delta.y * backFraction); // yExtent at back == delta.y * backFraction.\n\n // Calculate the zExtent in the View coordinate system.\n zExtent = new Vector3d(eyeToOrigin.x * (frontFraction - backFraction), eyeToOrigin.y * (frontFraction - backFraction), zDelta);\n viewRot.multiplyTransposeVectorInPlace(zExtent); // rotate back to root coordinates.\n\n origin = new Point3d(\n eyeToOrigin.x * backFraction, // Calculate origin in eye coordinates\n eyeToOrigin.y * backFraction,\n eyeToOrigin.z);\n\n viewRot.multiplyTransposeVectorInPlace(origin); // Rotate back to root coordinates\n origin.plus(camera.eye, origin); // Add the eye point.\n } else {\n origin = inOrigin;\n xExtent = xVector.scale(delta.x);\n yExtent = yVector.scale(delta.y);\n zExtent = zVector.scale(delta.z ? delta.z : 1.0);\n }\n\n // calculate the root-to-npc mapping (using expanded frustum)\n return { map: Map4d.createVectorFrustum(origin, xExtent, yExtent, zExtent, frustFraction), frustFraction };\n }\n\n /** Calculate the world coordinate Frustum from the parameters of this ViewState.\n * @param result Optional Frustum to hold result. If undefined a new Frustum is created.\n * @returns The 8-point Frustum with the corners of this ViewState, or undefined if the parameters are invalid.\n */\n public calculateFrustum(result?: Frustum): Frustum | undefined {\n const val = this.computeWorldToNpc();\n if (undefined === val.map)\n return undefined;\n\n const box = result ? result.initNpc() : new Frustum();\n val.map.transform1.multiplyPoint3dArrayQuietNormalize(box.points);\n return box;\n }\n\n public calculateFocusCorners() {\n const map = expectDefined(this.computeWorldToNpc().map);\n const focusNpcZ = Geometry.clamp(map.transform0.multiplyPoint3dQuietNormalize(this.getTargetPoint()).z, 0, 1.0);\n const pts = [new Point3d(0.0, 0.0, focusNpcZ), new Point3d(1.0, 0.0, focusNpcZ), new Point3d(0.0, 1.0, focusNpcZ), new Point3d(1.0, 1.0, focusNpcZ)];\n map.transform1.multiplyPoint3dArrayQuietNormalize(pts);\n return pts;\n }\n\n /** Initialize the origin, extents, and rotation from an existing Frustum\n * This function is commonly used in the implementation of [[ViewTool]]s as follows:\n * 1. Obtain the ViewState's initial frustum.\n * 2. Modify the frustum based on user input.\n * 3. Update the ViewState to match the modified frustum.\n * @param frustum the input Frustum.\n * @param opts for providing onExtentsError\n * @return Success if the frustum was successfully updated, or an appropriate error code.\n */\n public setupFromFrustum(inFrustum: Frustum, opts?: OnViewExtentsError): ViewStatus {\n const frustum = inFrustum.clone(); // make sure we don't modify input frustum\n frustum.fixPointOrder();\n const frustPts = frustum.points;\n const viewOrg = frustPts[Npc.LeftBottomRear];\n\n // frustumX, frustumY, frustumZ are vectors along edges of the frustum. They are NOT unit vectors.\n // X and Y should be perpendicular, and Z should be right handed.\n const frustumX = Vector3d.createFrom(frustPts[Npc.RightBottomRear].minus(viewOrg));\n const frustumY = Vector3d.createFrom(frustPts[Npc.LeftTopRear].minus(viewOrg));\n const frustumZ = Vector3d.createFrom(frustPts[Npc.LeftBottomFront].minus(viewOrg));\n\n const frustMatrix = Matrix3d.createRigidFromColumns(frustumX, frustumY, AxisOrder.XYZ);\n if (!frustMatrix)\n return ViewStatus.InvalidWindow;\n\n // if we're close to one of the standard views, adjust to it to remove any \"fuzz\"\n StandardView.adjustToStandardRotation(frustMatrix);\n\n const xDir = frustMatrix.getColumn(0);\n const yDir = frustMatrix.getColumn(1);\n const zDir = frustMatrix.getColumn(2);\n\n // set up view Rotation matrix as rows of frustum matrix.\n const viewRot = frustMatrix.inverse();\n if (!viewRot)\n return ViewStatus.InvalidWindow;\n\n // Left handed frustum?\n const zSize = zDir.dotProduct(frustumZ);\n if (zSize < 0.0)\n return ViewStatus.InvalidWindow;\n\n const viewDiagRoot = new Vector3d();\n viewDiagRoot.plus2Scaled(xDir, xDir.dotProduct(frustumX), yDir, yDir.dotProduct(frustumY), viewDiagRoot); // vectors on the back plane\n viewDiagRoot.plusScaled(zDir, zSize, viewDiagRoot); // add in z vector perpendicular to x,y\n\n // use center of frustum and view diagonal for origin. Original frustum may not have been orthogonal\n frustum.getCenter().plusScaled(viewDiagRoot, -0.5, viewOrg);\n\n // delta is in view coordinates\n const viewDelta = viewRot.multiplyVector(viewDiagRoot);\n const status = this.adjustViewDelta(viewDelta, viewOrg, viewRot, undefined, opts);\n if (ViewStatus.Success !== status)\n return status;\n\n this.setOrigin(viewOrg);\n this.setExtents(viewDelta);\n this.setRotation(viewRot);\n this._updateMaxGlobalScopeFactor();\n return ViewStatus.Success;\n }\n\n /** Get or set the largest and smallest values allowed for the extents for this ViewState\n * The default limits vary based on the type of view:\n * - Spatial and drawing view extents cannot exceed the diameter of the earth.\n * - Sheet view extents cannot exceed ten times the paper size of the sheet.\n * Explicitly setting the extent limits overrides the default limits.\n * @see [[resetExtentLimits]] to restore the default limits.\n */\n public get extentLimits(): ExtentLimits { return undefined !== this._extentLimits ? this._extentLimits : this.defaultExtentLimits; }\n public set extentLimits(limits: ExtentLimits) { this._extentLimits = limits; }\n\n /** Resets the largest and smallest values allowed for the extents of this ViewState to their default values.\n * @see [[extentLimits]].\n */\n public resetExtentLimits(): void { this._extentLimits = undefined; }\n\n /** Returns the default extent limits for this ViewState. These limits are used if the [[extentLimits]] have not been explicitly overridden.\n */\n public abstract get defaultExtentLimits(): ExtentLimits;\n\n public setDisplayStyle(style: DisplayStyleState) { this.displayStyle = style; }\n\n /** Adjust the y dimension of this ViewState so that its aspect ratio matches the supplied value.\n * @internal\n */\n public fixAspectRatio(windowAspect: number): void {\n const origExtents = this.getExtents();\n const extents = origExtents.clone();\n extents.y = extents.x / (windowAspect * this.getAspectRatioSkew());\n if (extents.isAlmostEqual(origExtents))\n return;\n\n // adjust origin by half of the distance we modified extents to keep centered\n const origin = this.getOrigin().clone();\n origin.addScaledInPlace(this.getRotation().multiplyTransposeVector(extents.vectorTo(origExtents, origExtents)), .5);\n this.setOrigin(origin);\n this.setExtents(extents);\n }\n\n /** @internal */\n public outputStatusMessage(status: ViewStatus): ViewStatus {\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, IModelApp.localization.getLocalizedString(`iModelJs:Viewing.${ViewStatus[status]}`)));\n return status;\n }\n\n /** @internal */\n public adjustViewDelta(delta: Vector3d, origin: XYZ, rot: Matrix3d, aspect?: number, opts?: OnViewExtentsError): ViewStatus {\n const origDelta = delta.clone();\n\n let status = ViewStatus.Success;\n const limit = this.extentLimits;\n const limitDelta = (val: number) => {\n if (val < limit.min) {\n val = limit.min;\n status = ViewStatus.MinWindow;\n } else if (val > limit.max) {\n val = limit.max;\n status = ViewStatus.MaxWindow;\n }\n return val;\n };\n\n delta.x = limitDelta(delta.x);\n delta.y = limitDelta(delta.y);\n\n if (aspect) { // skip if either undefined or 0\n aspect *= this.getAspectRatioSkew();\n if (delta.x > (aspect * delta.y))\n delta.y = delta.x / aspect;\n else\n delta.x = delta.y * aspect;\n }\n\n if (!delta.isAlmostEqual(origDelta))\n origin.addScaledInPlace(rot.multiplyTransposeVector(delta.vectorTo(origDelta, origDelta)), .5);\n\n return (status !== ViewStatus.Success && opts?.onExtentsError) ? opts.onExtentsError(status) : status;\n }\n\n /** Adjust the aspect ratio of this ViewState so it matches the supplied value. The adjustment is accomplished by increasing one dimension\n * and leaving the other unchanged, depending on the ratio of this ViewState's current aspect ratio to the supplied one. This means the result\n * always shows everything in the current volume, plus potentially more.\n * @note The *automatic* adjustment that happens when ViewStates are used in Viewports **always** adjusts the Y axis (making\n * it potentially smaller). That's so that process can be reversible if the view's aspect ratio changes repeatedly (as happens when panels slide in/out, etc.)\n */\n public adjustAspectRatio(aspect: number) {\n const extents = this.getExtents();\n const origin = this.getOrigin();\n this.adjustViewDelta(extents, origin, this.getRotation(), aspect);\n this.setExtents(extents);\n this.setOrigin(origin);\n }\n\n /** Set the CategorySelector for this view. */\n public setCategorySelector(categories: CategorySelectorState) { this.categorySelector = categories; }\n\n /** get the auxiliary coordinate system state object for this ViewState. */\n public get auxiliaryCoordinateSystem(): AuxCoordSystemState {\n if (!this._auxCoordSystem)\n this._auxCoordSystem = this.createAuxCoordSystem(\"\");\n return this._auxCoordSystem;\n }\n\n /** Get the Id of the auxiliary coordinate system for this ViewState */\n public getAuxiliaryCoordinateSystemId(): Id64String {\n return this.details.auxiliaryCoordinateSystemId;\n }\n\n /** Set or clear the AuxiliaryCoordinateSystem for this view.\n * @param acs the new AuxiliaryCoordinateSystem for this view. If undefined, no AuxiliaryCoordinateSystem will be used.\n */\n public setAuxiliaryCoordinateSystem(acs?: AuxCoordSystemState) {\n this._auxCoordSystem = acs;\n this.details.auxiliaryCoordinateSystemId = undefined !== acs ? acs.id : Id64.invalid;\n }\n\n /** Determine whether the specified Category is displayed in this view */\n public viewsCategory(id: Id64String): boolean {\n return this.categorySelector.isCategoryViewed(id);\n }\n\n /** Get the aspect ratio (width/height) of this view */\n public getAspectRatio(): number {\n const extents = this.getExtents();\n return extents.x / extents.y;\n }\n\n /** Get the aspect ratio skew (x/y, usually 1.0) that is used to exaggerate the y axis of the view. */\n public getAspectRatioSkew(): number {\n return this.details.aspectRatioSkew;\n }\n\n /** Set the aspect ratio skew (x/y) for this view. To remove aspect ratio skew, pass 1.0 for val. */\n public setAspectRatioSkew(val: number) {\n this.details.aspectRatioSkew = val;\n }\n\n /** Get the unit vector that points in the view X (left-to-right) direction.\n * @param result optional Vector3d to be used for output. If undefined, a new object is created.\n */\n public getXVector(result?: Vector3d): Vector3d { return this.getRotation().getRow(0, result); }\n\n /** Get the unit vector that points in the view Y (bottom-to-top) direction.\n * @param result optional Vector3d to be used for output. If undefined, a new object is created.\n */\n public getYVector(result?: Vector3d): Vector3d { return this.getRotation().getRow(1, result); }\n\n /** Get the unit vector that points in the view Z (front-to-back) direction.\n * @param result optional Vector3d to be used for output. If undefined, a new object is created.\n */\n public getZVector(result?: Vector3d): Vector3d { return this.getRotation().getRow(2, result); }\n\n /** Set or clear the clipping volume for this view.\n * @param clip the new clipping volume. If undefined, clipping is removed from view.\n * @note The ViewState takes ownership of the supplied ClipVector - it should not be modified after passing it to this function.\n */\n public setViewClip(clip?: ClipVector) {\n this.details.clipVector = clip;\n }\n\n /** Get the clipping volume for this view, if defined\n * @note Do *not* modify the returned ClipVector. If you wish to change the ClipVector, clone the returned ClipVector, modify it as desired, and pass the clone to [[setViewClip]].\n */\n public getViewClip(): ClipVector | undefined {\n return this.details.clipVector;\n }\n\n /** Set the grid settings for this view */\n public setGridSettings(orientation: GridOrientationType, spacing: Point2d, gridsPerRef: number): void {\n switch (orientation) {\n case GridOrientationType.WorldYZ:\n case GridOrientationType.WorldXZ:\n if (!this.is3d())\n return;\n break;\n }\n\n this.details.gridOrientation = orientation;\n this.details.gridsPerRef = gridsPerRef;\n this.details.gridSpacing = spacing;\n }\n\n /** Populate the given origin and rotation with information from the grid settings from the grid orientation. */\n public getGridSettings(vp: Viewport, origin: Point3d, rMatrix: Matrix3d, orientation: GridOrientationType) {\n // start with global origin (for spatial views) and identity matrix\n rMatrix.setIdentity();\n origin.setFrom(vp.view.isSpatialView() ? vp.view.iModel.globalOrigin : Point3d.create());\n\n switch (orientation) {\n case GridOrientationType.View: {\n const centerWorld = Point3d.create(0.5, 0.5, 0.5);\n vp.npcToWorld(centerWorld, centerWorld);\n\n rMatrix.setFrom(vp.rotation);\n rMatrix.multiplyXYZtoXYZ(origin, origin);\n origin.z = centerWorld.z;\n rMatrix.multiplyTransposeVectorInPlace(origin);\n break;\n }\n case GridOrientationType.WorldXY:\n break;\n case GridOrientationType.WorldYZ: {\n const rowX = rMatrix.getRow(0);\n const rowY = rMatrix.getRow(1);\n const rowZ = rMatrix.getRow(2);\n rMatrix.setRow(0, rowY);\n rMatrix.setRow(1, rowZ);\n rMatrix.setRow(2, rowX);\n break;\n }\n case GridOrientationType.WorldXZ: {\n const rowX = rMatrix.getRow(0);\n const rowY = rMatrix.getRow(1);\n const rowZ = rMatrix.getRow(2);\n rMatrix.setRow(0, rowX);\n rMatrix.setRow(1, rowZ);\n rMatrix.setRow(2, rowY);\n break;\n }\n }\n }\n\n /** Get the grid settings for this view */\n public getGridOrientation(): GridOrientationType {\n return this.details.gridOrientation;\n }\n public getGridsPerRef(): number {\n return this.details.gridsPerRef;\n }\n public getGridSpacing(): XAndY {\n return this.details.gridSpacing;\n }\n\n /** Change the volume that this view displays, keeping its current rotation.\n * @param volume The new volume, in world-coordinates, for the view. The resulting view will show all of worldVolume, by fitting a\n * view-axis-aligned bounding box around it. For views that are not aligned with the world coordinate system, this will sometimes\n * result in a much larger volume than worldVolume.\n * @param aspect The X/Y aspect ratio of the view into which the result will be displayed. If the aspect ratio of the volume does not\n * match aspect, the shorter axis is lengthened and the volume is centered. If aspect is undefined, no adjustment is made.\n * @param options for providing MarginPercent and onExtentsError\n * @note for 2d views, only the X and Y values of volume are used.\n */\n public lookAtVolume(volume: LowAndHighXYZ | LowAndHighXY, aspect?: number, options?: MarginOptions & OnViewExtentsError) {\n const rangeBox = Frustum.fromRange(volume).points;\n this.getRotation().multiplyVectorArrayInPlace(rangeBox);\n return this.lookAtViewAlignedVolume(Range3d.createArray(rangeBox), aspect, options);\n }\n\n /** Look at a volume of space defined by a range in view local coordinates, keeping its current rotation.\n * @param volume The new volume, in view-aligned coordinates. The resulting view will show all of the volume.\n * @param aspect The X/Y aspect ratio of the view into which the result will be displayed. If the aspect ratio of the volume does not\n * match aspect, the shorter axis is lengthened and the volume is centered. If aspect is undefined, no adjustment is made.\n * @param options for providing MarginPercent and onExtentsError\n * @see lookAtVolume\n */\n public lookAtViewAlignedVolume(volume: Range3d, aspect?: number, options?: MarginOptions & OnViewExtentsError) {\n if (volume.isNull) // make sure volume is valid\n return;\n\n const viewRot = this.getRotation();\n const newOrigin = volume.low.clone();\n const newDelta = volume.diagonal();\n\n const minimumDepth = Constant.oneMillimeter;\n if (newDelta.z < minimumDepth) {\n newOrigin.z -= (minimumDepth - newDelta.z) / 2.0;\n newDelta.z = minimumDepth;\n }\n\n if (this.is3d() && this.isCameraOn) {\n // If the camera is on, the only way to guarantee we can see the entire volume is to set delta at the front plane, not focus plane.\n // That generally causes the view to be too large (objects in it are too small), since we can't tell whether the objects are at\n // the front or back of the view. For this reason, don't attempt to add any \"margin\" to camera views.\n } else if (undefined !== options?.paddingPercent) {\n let left, right, top, bottom;\n const padding = options.paddingPercent;\n if (typeof padding === \"number\") {\n left = right = top = bottom = padding;\n } else {\n left = padding.left ?? 0;\n right = padding.right ?? 0;\n top = padding.top ?? 0;\n bottom = padding.bottom ?? 0;\n }\n\n const width = newDelta.x;\n const height = newDelta.y;\n\n newOrigin.x -= left * width;\n newDelta.x += (right + left) * width;\n newOrigin.y -= bottom * height;\n newDelta.y += (top + bottom) * height;\n } else if (options?.marginPercent) {\n // compute how much space we'll need for both of X and Y margins in root coordinates\n const margin = options.marginPercent;\n const wPercent = margin.left + margin.right;\n const hPercent = margin.top + margin.bottom;\n\n const marginHorizontal = wPercent / (1 - wPercent) * newDelta.x;\n const marginVert = hPercent / (1 - hPercent) * newDelta.y;\n\n // compute left and bottom margins in root coordinates\n const marginLeft = margin.left / (1 - wPercent) * newDelta.x;\n const marginBottom = margin.bottom / (1 - hPercent) * newDelta.y;\n\n // add the margins to the range\n newOrigin.x -= marginLeft;\n newOrigin.y -= marginBottom;\n newDelta.x += marginHorizontal;\n newDelta.y += marginVert;\n } else {\n const origDelta = newDelta.clone();\n newDelta.scale(1.04, newDelta); // default \"dilation\"\n newOrigin.addScaledInPlace(origDelta.minus(newDelta, origDelta), .5);\n }\n\n viewRot.multiplyTransposeVectorInPlace(newOrigin);\n\n if (ViewStatus.Success !== this.adjustViewDelta(newDelta, newOrigin, viewRot, aspect, options))\n return;\n\n this.setExtents(newDelta);\n this.setOrigin(newOrigin);\n\n if (!this.is3d())\n return;\n\n const cameraDef = this.camera;\n cameraDef.validateLens();\n // move the camera back so the entire x,y range is visible at front plane\n const frontDist = newDelta.x / (2.0 * Math.tan(cameraDef.getLensAngle().radians / 2.0));\n const backDist = frontDist + newDelta.z;\n\n cameraDef.setFocusDistance(frontDist); // do this even if the camera isn't currently on.\n this.centerEyePoint(backDist); // do this even if the camera isn't currently on.\n this.verifyFocusPlane(); // changes delta/origin\n }\n\n /** Set the rotation of this ViewState to the supplied rotation, by rotating it about a point.\n * @param rotation The new rotation matrix for this ViewState.\n * @param point The point to rotate about. If undefined, use the [[getTargetPoint]].\n */\n public setRotationAboutPoint(rotation: Matrix3d, point?: Point3d): void {\n if (undefined === point)\n point = this.getTargetPoint();\n\n const inverse = rotation.clone().inverse();\n if (undefined === inverse)\n return;\n\n const targetMatrix = inverse.multiplyMatrixMatrix(this.getRotation());\n const worldTransform = Transform.createFixedPointAndMatrix(point, targetMatrix);\n const frustum = this.calculateFrustum();\n if (undefined !== frustum) {\n frustum.multiply(worldTransform);\n this.setupFromFrustum(frustum);\n }\n }\n\n /** Intended strictly as a temporary solution for interactive editing applications, until official support for such apps is implemented.\n * Invalidates tile trees for all specified models (or all viewed models, if none specified), causing subsequent requests for tiles to make new requests to back-end for updated tiles.\n * Returns true if any tile tree was invalidated.\n * @internal\n */\n public refreshForModifiedModels(modelIds: Id64Arg | undefined): boolean {\n let refreshed = false;\n for (const ref of this.getModelTreeRefs()) {\n const tree = ref.treeOwner.tileTree;\n if (undefined !== tree && (undefined === modelIds || Id64.has(modelIds, tree.modelId))) {\n ref.treeOwner[Symbol.dispose]();\n refreshed = true;\n }\n }\n\n return refreshed;\n }\n\n /** Determine whether this ViewState has the same coordinate system as another one.\n * They must be from the same iModel, and view a model in common.\n */\n public hasSameCoordinates(other: ViewState): boolean {\n if (this.iModel !== other.iModel)\n return false;\n\n // Spatial views view any number of spatial models all sharing one coordinate system.\n if (this.isSpatialView() && other.isSpatialView())\n return true;\n\n // People sometimes mistakenly stick 2d models into spatial views' model selectors.\n if (this.isSpatialView() || other.isSpatialView())\n return false;\n\n // Non-spatial views view exactly one model. If they view the same model, they share a coordinate system.\n let allowView = false;\n this.forEachModel((model) => {\n allowView ||= other.viewsModel(model.id);\n });\n\n return allowView;\n }\n\n /** Compute the vector in the \"up\" direction of a specific point in world space.\n * This is typically a unit Z vector. However, if the point is outside of the iModel's project extents and using ellipsoid [[globeMode]], an up-vector\n * will be computed relative to the surface of the ellipsoid at that point.\n */\n public getUpVector(point: Point3d): Vector3d {\n if (!this.iModel.isGeoLocated || this.globeMode !== GlobeMode.Ellipsoid || this.iModel.projectExtents.containsPoint(point))\n return Vector3d.unitZ();\n\n const earthCenter = this.iModel.getMapEcefToDb(0).origin;\n const normal = Vector3d.createStartEnd(earthCenter, point);\n normal.normalizeInPlace();\n\n return normal;\n }\n\n /** Return true if the view is looking at the current iModel project extents or\n * false if the viewed area do does not include more than one percent of the project.\n */\n public getIsViewingProject(): boolean {\n if (!this.isSpatialView())\n return false;\n\n const worldToNpc = this.computeWorldToNpc();\n if (!worldToNpc || !worldToNpc.map)\n return false;\n\n const expandedRange = this.iModel.projectExtents.clone();\n expandedRange.expandInPlace(10E3);\n const corners = expandedRange.corners(scratchCorners);\n worldToNpc.map.transform0.multiplyPoint3dArrayQuietNormalize(corners);\n scratchRange2d.setNull();\n corners.forEach((corner) => scratchRange2d.extendXY(corner.x, corner.y));\n const intersection = scratchRange2d.intersect(unitRange2d, scratchRange2dIntersect);\n if (!intersection || intersection.isNull)\n return false;\n\n const area = (intersection.high.x - intersection.low.x) * (intersection.high.y - intersection.low.y);\n return area > 1.0E-2;\n }\n\n /** If the view is not of the project as determined by [[getIsViewingProject]] then return\n * the rotation from a global reference frame to world coordinates. The global reference frame includes\n * Y vector towards true north, X parallel to the equator and Z perpendicular to the ellipsoid surface\n */\n public getGlobeRotation(): Matrix3d | undefined {\n if (!this.iModel.isGeoLocated || this.globeMode !== GlobeMode.Ellipsoid || this.getIsViewingProject())\n return undefined;\n\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n if (!backgroundMapGeometry)\n return undefined;\n\n const targetRay = Ray3d.create(this.getCenter(), this.getRotation().rowZ().negate(), scratchRay);\n const earthEllipsoid = backgroundMapGeometry.getEarthEllipsoid();\n const intersectFractions = new Array<number>(), intersectAngles = new Array<LongitudeLatitudeNumber>();\n if (earthEllipsoid.intersectRay(targetRay, intersectFractions, undefined, intersectAngles) < 2)\n return undefined;\n\n let minIndex = 0, minFraction = -1.0E10;\n for (let i = 0; i < intersectFractions.length; i++) {\n const fraction = intersectFractions[i];\n if (fraction < minFraction) {\n minFraction = fraction;\n minIndex = i;\n }\n }\n const angles = intersectAngles[minIndex];\n const pointAndDeriv = earthEllipsoid.radiansToPointAndDerivatives(angles.longitudeRadians, angles.latitudeRadians, false);\n return Matrix3d.createRigidFromColumns(pointAndDeriv.vectorU, pointAndDeriv.vectorV, AxisOrder.XYZ)?.transpose();\n\n }\n\n /** A value that represents the global scope of the view -- a value greater than one indicates that the scope of this view is global (viewing most of Earth). */\n public get globalScopeFactor(): number {\n return this.getExtents().magnitudeXY() / Constant.earthRadiusWGS84.equator;\n }\n\n private _maxGlobalScopeFactor = 0;\n /** The maximum global scope is not persistent, but maintained as highest global scope factor. This can be used to determine\n * if the view is of a limited area or if it has ever viewed the entire globe and therefore may be assumed to view it again\n * and therefore may warrant resources for displaying the globe, such as an expanded viewing frustum and preloading globe map tiles.\n * A value greater than one indicates that the viewport has been used to view globally at least once.\n * @internal\n */\n public get maxGlobalScopeFactor() { return this._maxGlobalScopeFactor; }\n\n protected _updateMaxGlobalScopeFactor() { this._maxGlobalScopeFactor = Math.max(this._maxGlobalScopeFactor, this.globalScopeFactor); }\n\n /** Return elevation applied to model when displayed. This is strictly relevant to plan projection models.\n * @internal\n */\n public getModelElevation(_modelId: Id64String): number { return 0; }\n\n /** An object that can provide per-model transforms to be applied at display time.\n * @note The transform is used for display purposes only. Operations upon geometry within the model may not take the display transform into account.\n * @see [[computeDisplayTransform]] to compute a full display transform for a model or an element within it, which may include a transform supplied by this provider.\n * @beta\n */\n public get modelDisplayTransformProvider(): ModelDisplayTransformProvider | undefined {\n return this._modelDisplayTransformProvider;\n }\n\n public set modelDisplayTransformProvider(provider: ModelDisplayTransformProvider | undefined) {\n if (provider === this.modelDisplayTransformProvider)\n return;\n\n if (this.isAttachedToViewport)\n this.onModelDisplayTransformProviderChanged.raiseEvent(provider);\n\n this._modelDisplayTransformProvider = provider;\n }\n\n /** Compute the transform applied to a model or element at display time, if any.\n * The display transform may be constructed from any combination of the following:\n * - [PlanProjectionSettings.elevation]($common) applied to plan projection models by [DisplayStyle3dSettings.planProjectionSettings]($common);\n * - A per-model transform supplied by this view's [[modelDisplayTransformProvider]]; and/or\n * - A transform applied to an element by an [RenderSchedule.ElementTimeline]($common) defined by this view's [[scheduleScript]].\n * - A transform from the coordinate space of a [ViewAttachment]($backend)'s view to that of the [[SheetViewState]] in which it is displayed.\n * - A transform from the coordinate space of a [[SpatialViewState]] to that of the [[DrawingViewState]] in which it is displayed, where the spatial view is attached via a [SectionDrawing]($backend).\n * @param args A description of how to compute the transform.\n * @returns The computed transform, or `undefined` if no display transform is to be applied.\n * @beta\n */\n public computeDisplayTransform(args: ComputeDisplayTransformArgs): Transform | undefined {\n const elevation = this.getModelElevation(args.modelId);\n const modelTransform = this.modelDisplayTransformProvider?.getModelDisplayTransform(args.modelId);\n\n // NB: A ModelTimeline can apply a transform to all elements in the model, but no code exists which actually applies that at display time.\n // So for now we continue to only consider the ElementTimeline transform.\n let scriptTransform;\n if (this.scheduleScript && args.elementId) {\n const idPair = Id64.getUint32Pair(args.elementId);\n const modelTimeline = this.scheduleScript.find(args.modelId);\n const elementTimeline = modelTimeline?.getTimelineForElement(idPair.lower, idPair.upper);\n scriptTransform = elementTimeline?.getAnimationTransform(args.timePoint ?? this.displayStyle.settings.timePoint ?? 0);\n }\n\n if (0 === elevation && !modelTransform && !scriptTransform)\n return undefined;\n\n const transform = Transform.createTranslationXYZ(0, 0, elevation);\n if (modelTransform?.premultiply)\n modelTransform.transform.multiplyTransformTransform(transform, transform);\n\n if (modelTransform && !modelTransform.premultiply)\n transform.multiplyTransformTransform(modelTransform.transform, transform);\n\n if (scriptTransform)\n transform.multiplyTransformTransform(scriptTransform as Transform, transform);\n\n return transform;\n }\n\n /** Invoked when this view becomes the view displayed by the specified [[Viewport]].\n * A ViewState can be attached to at most **one** Viewport at any given time.\n * This method is invoked automatically by the viewport - there is generally no reason for applications to invoke it directly.\n * @note If you override this method you **must** call `super.attachToViewport`.\n * @throws Error if the view is already attached to any Viewport.\n * @see [[detachFromViewport]] from the inverse operation.\n */\n public attachToViewport(_args: AttachToViewportArgs): void {\n if (this.isAttachedToViewport)\n throw new Error(\"Attempting to attach a ViewState that is already attached to a Viewport\");\n\n this.registerCategorySelectorListeners();\n }\n\n private registerCategorySelectorListeners(): void {\n const cats = this.categorySelector.observableCategories;\n const event = () => this.onViewedCategoriesChanged.raiseEvent();\n this._unregisterCategorySelectorListeners.push(cats.onAdded.addListener(event));\n this._unregisterCategorySelectorListeners.push(cats.onDeleted.addListener(event));\n this._unregisterCategorySelectorListeners.push(cats.onCleared.addListener(event));\n }\n\n /** Invoked when this view, previously attached to the specified [[Viewport]] via [[attachToViewport]], is no longer the view displayed by that Viewport.\n * This method is invoked automatically by the viewport - there is generally no reason for applications to invoke it directly.\n * @note If you override this method you **must** call `super.detachFromViewport`.\n * @throws Error if the view is not attached to any Viewport.\n */\n public detachFromViewport(): void {\n if (!this.isAttachedToViewport)\n throw new Error(\"Attempting to detach a ViewState from a Viewport to which it is not attached.\");\n\n this.unregisterCategorySelectorListeners();\n }\n\n private unregisterCategorySelectorListeners(): void {\n this._unregisterCategorySelectorListeners.forEach((f) => f());\n this._unregisterCategorySelectorListeners.length = 0;\n }\n\n /** Returns whether this view is currently being displayed by a [[Viewport]].\n * @public\n */\n public get isAttachedToViewport(): boolean {\n // In attachToViewport, we register event listeners on the category selector. We remove them in detachFromViewport.\n // So a non-empty list of event listener removal functions indicates we are currently attached to a viewport.\n return this._unregisterCategorySelectorListeners.length > 0;\n }\n\n /** Returns an iterator over additional Viewports used to construct this view's scene. e.g., those used for ViewAttachments and section drawings.\n * This exists chiefly for display-performance-test-app to determine when all tiles required for the view have been loaded.\n * @internal\n */\n public get secondaryViewports(): Iterable<Viewport> {\n return [];\n }\n\n /** Find the viewport that renders the contents of the view attachment with the specified element Id into this view.\n * @internal\n */\n public getAttachmentViewport(_args: GetAttachmentViewportArgs): Viewport | undefined {\n return undefined;\n }\n}\n\n/** Defines the state of a view of 3d models.\n * @see [ViewState Parameters]($docs/learning/frontend/views#viewstate-parameters)\n * @public\n * @extensions\n */\nexport abstract class ViewState3d extends ViewState {\n private readonly _details: ViewDetails3d;\n private readonly _modelClips: Array<RenderClipVolume | undefined> = [];\n private _environmentDecorations?: EnvironmentDecorations;\n public static override get className() { return \"ViewDefinition3d\"; }\n /** True if the camera is valid. */\n protected _cameraOn: boolean;\n /** The lower left back corner of the view frustum. */\n public readonly origin: Point3d;\n /** The extent of the view frustum. */\n public readonly extents: Vector3d;\n /** Rotation of the view frustum. */\n public readonly rotation: Matrix3d;\n /** The camera used for this view. */\n public readonly camera: Camera;\n /** Minimum distance for front plane */\n public forceMinFrontDist = 0.0;\n /** Provides access to optional detail settings for this view. */\n public get details(): ViewDetails3d {\n return this._details;\n }\n\n public allow3dManipulations(): boolean {\n return this.details.allow3dManipulations;\n }\n\n /** Set whether [[ViewTool]]s are allowed to operate in 3 dimensions on this view. */\n public setAllow3dManipulations(allow: boolean) {\n this.details.allow3dManipulations = allow;\n }\n\n public constructor(props: ViewDefinition3dProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle3dState) {\n super(props, iModel, categories, displayStyle);\n this._cameraOn = JsonUtils.asBool(props.cameraOn);\n this.origin = Point3d.fromJSON(props.origin);\n this.extents = Vector3d.fromJSON(props.extents);\n this.rotation = YawPitchRollAngles.fromJSON(props.angles).toMatrix3d();\n assert(this.rotation.isRigid());\n this.camera = new Camera(props.camera);\n\n // if the camera is on, make sure the eyepoint is centered.\n if (this.is3d() && this.isCameraOn)\n this.centerEyePoint();\n\n this._details = new ViewDetails3d(this.jsonProperties);\n this._details.onModelClipGroupsChanged.addListener((newGroups) => this.updateModelClips(newGroups));\n this.updateModelClips(this._details.modelClipGroups);\n\n this._updateMaxGlobalScopeFactor();\n }\n\n private updateModelClips(groups: ModelClipGroups): void {\n this._modelClips.length = 0;\n for (const group of groups.groups) {\n const clip = group.clip ? IModelApp.renderSystem.createClipVolume(group.clip) : undefined;\n this._modelClips.push(clip);\n }\n }\n\n /** @internal */\n public getModelClip(modelId: Id64String): RenderClipVolume | undefined {\n // ###TODO: ViewFlags.clipVolume is for the *view clip* only. Some tiles will want to ignore *all* clips (i.e., section-cut tiles).\n const index = this.details.modelClipGroups.findGroupIndex(modelId);\n return -1 !== index ? this._modelClips[index] : undefined;\n }\n\n /** Capture a copy of the viewed volume and camera parameters. */\n public savePose(): ViewPose3d { return new ViewPose3d(this); }\n\n /** See [[ViewState.applyPose]]. */\n public applyPose(val: ViewPose): this {\n if (val instanceof ViewPose3d) {\n this._cameraOn = val.cameraOn;\n this.setOrigin(val.origin);\n this.setExtents(val.extents);\n this.rotation.setFrom(val.rotation);\n this.camera.setFrom(val.camera);\n this._updateMaxGlobalScopeFactor();\n }\n\n return this;\n }\n\n public override toJSON(): ViewDefinition3dProps {\n const val = super.toJSON() as ViewDefinition3dProps;\n val.cameraOn = this._cameraOn;\n val.origin = this.origin;\n val.extents = this.extents;\n val.angles = YawPitchRollAngles.createFromMatrix3d(this.rotation)?.toJSON();\n val.camera = this.camera;\n return val;\n }\n\n /** See [[ViewState.is3d]]. */\n public is3d(): this is ViewState3d { return true; }\n\n /** @internal */\n public isDrawingView(): this is DrawingViewState { return false; }\n\n public get isCameraOn(): boolean { return this._cameraOn; }\n\n private static _minGlobeEyeHeight = Constant.earthRadiusWGS84.equator / 4; // View as globe if more than a quarter of earth radius from surface.\n private static _scratchGlobeCarto = Cartographic.createZero();\n\n public get isGlobalView() {\n if (undefined === this.iModel.ecefLocation)\n return false;\n\n return this.globalScopeFactor >= 1;\n }\n\n /** A value that represents the global scope of the view -- a value greater than one indicates that the scope of this view is global.\n * @see [[isGlobalView]].\n */\n public override get globalScopeFactor(): number {\n const eyeHeight = this.getEyeCartographicHeight();\n return (undefined === eyeHeight) ? (this.extents.magnitudeXY() / Constant.earthRadiusWGS84.equator) : (eyeHeight / ViewState3d._minGlobeEyeHeight);\n }\n\n /** A value representing the degree to which a view is viewing the globe as opposed to a specific location\n * a value of zero or less indicates that the view is not global, a value between zero and one represent a semi\n * global view. Values greater than one indicate a global view.\n *\n * A Global view is arbitrarily designated as a camera view with the camera height greater than one fourth of the globe\n * radius or an orthographic view with view diagonal greater than one fourth of the globe radius.\n */\n public globalViewTransition(): number {\n if (undefined === this.iModel.ecefLocation)\n return 0.0;\n\n let h = 0.0;\n if (this.isCameraOn) {\n const carto = this.rootToCartographic(this.getEyePoint(), ViewState3d._scratchGlobeCarto);\n h = (undefined === carto ? 0.0 : carto.height);\n } else\n h = this.extents.magnitudeXY();\n\n const startTransition = 0.33333 * ViewState3d._minGlobeEyeHeight;\n if (h > ViewState3d._minGlobeEyeHeight)\n return 1.0;\n else if (h < startTransition)\n return 0.0;\n else\n return (h - startTransition) / (ViewState3d._minGlobeEyeHeight - startTransition);\n }\n\n public getCartographicHeight(point: XYAndZ): number | undefined {\n const ecefLocation = this.iModel.ecefLocation;\n if (undefined === ecefLocation)\n return undefined;\n\n const carto = this.rootToCartographic(point, ViewState3d._scratchGlobeCarto);\n return carto === undefined ? undefined : carto.height;\n }\n public getEyeCartographicHeight(): number | undefined {\n return this.isCameraOn ? this.getCartographicHeight(this.getEyePoint()) : undefined;\n }\n\n public isEyePointGlobalView(eyePoint: XYAndZ) {\n const cartoHeight = this.getCartographicHeight(eyePoint);\n return undefined === cartoHeight ? false : cartoHeight > ViewState3d._minGlobeEyeHeight;\n }\n\n /** Look at a global location, placing the camera's eye at the specified eye height above a viewed location.\n * If location is defined, its center position will be viewed using the specified eye height.\n * If location also has an area specified, the eye height will be adjusted to view the specified location based on that area.\n * Otherwise, this function views a point on the earth as if the current eye point was placed on the earth. If the eyePoint parameter is defined, instead this point will be placed on the earth and viewed.\n * Specify pitchAngleRadians to tilt the final view; this defaults to 0.\n * Returns the distance from original eye point to new eye point.\n * @public\n */\n public lookAtGlobalLocation(eyeHeight: number, pitchAngleRadians = 0, location?: GlobalLocation, eyePoint?: Point3d): number {\n if (!this.iModel.isGeoLocated)\n return 0;\n\n if (location !== undefined && location.area !== undefined)\n eyeHeight = areaToEyeHeight(this, location.area, location.center.height);\n\n const origEyePoint = eyePoint !== undefined ? eyePoint.clone() : this.getEyeOrOrthographicViewPoint().clone();\n\n let targetPoint = origEyePoint;\n const targetPointCartographic = location !== undefined ? location.center.clone() : expectDefined(this.rootToCartographic(targetPoint));\n targetPointCartographic.height = 0.0;\n targetPoint = expectDefined(this.cartographicToRoot(targetPointCartographic));\n\n targetPointCartographic.height = eyeHeight;\n const lEyePoint = expectDefined(this.cartographicToRoot(targetPointCartographic));\n return this.finishLookAtGlobalLocation(targetPointCartographic, origEyePoint, lEyePoint, targetPoint, pitchAngleRadians);\n }\n\n /** Look at a global location, placing the camera's eye at the specified eye height above a viewed location using the GCS.\n * If location is defined, its center position will be viewed using the specified eye height.\n * If location also has an area specified, the eye height will be adjusted to view the specified location based on that area.\n * Otherwise, this function views a point on the earth as if the current eye point was placed on the earth. If the eyePoint parameter is defined, instead this point will be placed on the earth and viewed.\n * Specify pitchAngleRadians to tilt the final view; this defaults to 0.\n * Returns the distance from original eye point to new eye point.\n * @public\n */\n public async lookAtGlobalLocationFromGcs(eyeHeight: number, pitchAngleRadians = 0, location?: GlobalLocation, eyePoint?: Point3d): Promise<number> {\n if (!this.iModel.isGeoLocated)\n return 0;\n\n if (location !== undefined && location.area !== undefined)\n eyeHeight = await areaToEyeHeightFromGcs(this, location.area, location.center.height);\n\n const origEyePoint = eyePoint !== undefined ? eyePoint.clone() : this.getEyeOrOrthographicViewPoint().clone();\n\n let targetPoint = origEyePoint;\n const targetPointCartographic = location !== undefined ? location.center.clone() : expectDefined(this.rootToCartographic(targetPoint));\n targetPointCartographic.height = 0.0;\n targetPoint = expectDefined(await this.cartographicToRootFromGcs(targetPointCartographic));\n\n targetPointCartographic.height = eyeHeight;\n const lEyePoint = expectDefined(await this.cartographicToRootFromGcs(targetPointCartographic));\n return this.finishLookAtGlobalLocation(targetPointCartographic, origEyePoint, lEyePoint, targetPoint, pitchAngleRadians);\n }\n\n private finishLookAtGlobalLocation(targetPointCartographic: Cartographic, origEyePoint: Point3d, eyePoint: Point3d, targetPoint: Point3d, pitchAngleRadians: number): number {\n targetPointCartographic.latitude += .001;\n const northOfEyePoint = expectDefined(this.cartographicToRoot(targetPointCartographic));\n let upVector = expectDefined(targetPoint.unitVectorTo(northOfEyePoint));\n if (this.globeMode === GlobeMode.Plane)\n upVector = Vector3d.create(Math.abs(upVector.x), Math.abs(upVector.y), Math.abs(upVector.z));\n\n if (0 !== pitchAngleRadians) {\n const pitchAxis = upVector.unitCrossProduct(Vector3d.createStartEnd(targetPoint, eyePoint));\n if (undefined !== pitchAxis) {\n const pitchMatrix = expectDefined(Matrix3d.createRotationAroundVector(pitchAxis, Angle.createRadians(pitchAngleRadians)));\n const pitchTransform = Transform.createFixedPointAndMatrix(targetPoint, pitchMatrix);\n eyePoint = pitchTransform.multiplyPoint3d(eyePoint);\n pitchMatrix.multiplyVector(upVector, upVector);\n }\n }\n\n const isCameraEnabled = this.isCameraOn;\n this.lookAt({ eyePoint, targetPoint, upVector, lensAngle: this.camera.getLensAngle() });\n if (!isCameraEnabled && this.isCameraOn)\n this.turnCameraOff();\n\n return eyePoint.distance(origEyePoint);\n }\n\n /** Convert a point in spatial coordinates to a cartographic coordinate. */\n public rootToCartographic(root: XYAndZ, result?: Cartographic): Cartographic | undefined {\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n return backgroundMapGeometry ? backgroundMapGeometry.dbToCartographic(root, result) : undefined;\n }\n\n /** Convert a cartographic coordinate to a point in spatial coordinates. */\n public cartographicToRoot(cartographic: Cartographic, result?: Point3d): Point3d | undefined {\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n return backgroundMapGeometry ? backgroundMapGeometry.cartographicToDb(cartographic, result) : undefined;\n }\n\n /** Convert a point in spatial coordinates to a cartographic coordinate using the GCS reprojection.\n * @see [[rootToCartographicUsingGcs]] to convert multiple points at once.\n * @see [[cartographicToRootFromGcs]] for the inverse conversion.\n */\n public async rootToCartographicFromGcs(root: XYAndZ, result?: Cartographic): Promise<Cartographic | undefined> {\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n if (!backgroundMapGeometry)\n return undefined;\n\n const carto = (await backgroundMapGeometry.dbToCartographicFromGcs([root]))[0];\n return carto.clone(result);\n }\n\n /** Convert spatial coordinates to cartographic coordinates using the GCS reprojection.\n * @param root Spatial coordinates to be converted\n * @returns the converted coordinates of the same length and order as `root`, or `undefined` if the conversion cannot be performed.\n * @see [[cartographicToRootUsingGcs]] for the inverse conversion.\n */\n public async rootToCartographicUsingGcs(root: XYAndZ[]): Promise<Cartographic[] | undefined> {\n const bgmap = this.displayStyle.getBackgroundMapGeometry();\n return bgmap?.dbToCartographicFromGcs(root);\n }\n\n /** Convert a cartographic coordinate to a point in spatial coordinates using the GCS reprojection.\n * @see [[cartographicToRootUsingGcs]] to convert multiple points at once.\n * @see [[rootToCartographicFromGcs]] for the inverse conversion.\n */\n public async cartographicToRootFromGcs(cartographic: Cartographic, result?: Point3d): Promise<Point3d | undefined> {\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n if (!backgroundMapGeometry)\n return undefined;\n\n const root = (await backgroundMapGeometry.cartographicToDbFromGcs([cartographic]))[0];\n return root.clone(result);\n }\n\n /** Convert cartographic coordinates to spatial coordinates using the GCS reprojection.\n * @param cartographic Cartographic coordinates to be converted\n * @returns the converted coordinates of the same length and order as `cartographic`, or `undefined` if the conversion cannot be performed.\n * @see [[rootToCartographicUsingGcs]] for the inverse conversion.\n */\n public async cartographicToRootUsingGcs(cartographic: Cartographic[]): Promise<Point3d[] | undefined> {\n const bgmap = this.displayStyle.getBackgroundMapGeometry();\n return bgmap?.cartographicToDbFromGcs(cartographic);\n }\n\n public override setupFromFrustum(frustum: Frustum, opts?: OnViewExtentsError): ViewStatus {\n const stat = super.setupFromFrustum(frustum, opts);\n if (ViewStatus.Success !== stat)\n return stat;\n\n this.turnCameraOff();\n const frustPts = frustum.points;\n\n // use comparison of back, front plane X sizes to indicate camera or flat view ...\n const xBack = frustPts[Npc.LeftBottomRear].distance(frustPts[Npc.RightBottomRear]);\n const xFront = frustPts[Npc.LeftBottomFront].distance(frustPts[Npc.RightBottomFront]);\n\n const flatViewFractionTolerance = 1.0e-6;\n if (xFront > xBack * (1.0 + flatViewFractionTolerance))\n return ViewStatus.InvalidWindow;\n\n // see if the frustum is tapered, and if so, set up camera eyepoint and adjust viewOrg and delta.\n const compression = xFront / xBack;\n if (compression >= (1.0 - flatViewFractionTolerance))\n return ViewStatus.Success;\n\n // the frustum has perspective, turn camera on\n let viewOrg = frustPts[Npc.LeftBottomRear];\n const viewDelta = this.getExtents().clone();\n const zDir = this.getZVector();\n const frustumZ = viewOrg.vectorTo(frustPts[Npc.LeftBottomFront]);\n const frustOrgToEye = frustumZ.scale(1.0 / (1.0 - compression));\n const eyePoint = viewOrg.plus(frustOrgToEye);\n\n const backDistance = frustOrgToEye.dotProduct(zDir); // distance from eye to back plane of frustum\n const focusDistance = this.camera.isFocusValid ? this.camera.focusDist : (backDistance - (viewDelta.z / 2.0));\n const focalFraction = focusDistance / backDistance; // ratio of focus plane distance to back plane distance\n\n viewOrg = eyePoint.plus2Scaled(frustOrgToEye, -focalFraction, zDir, focusDistance - backDistance); // now project that point onto back plane\n viewDelta.x *= focalFraction; // adjust view delta for x and y so they are also at focus plane\n viewDelta.y *= focalFraction;\n\n this.setEyePoint(eyePoint);\n this.setFocusDistance(focusDistance);\n this.setOrigin(viewOrg);\n this.setExtents(viewDelta);\n this.setLensAngle(this.calcLensAngle());\n this.enableCamera();\n this._updateMaxGlobalScopeFactor();\n return ViewStatus.Success;\n }\n\n protected static calculateMaxDepth(delta: Vector3d, zVec: Vector3d): number {\n const depthRatioLimit = 1.0E8; // Limit for depth Ratio.\n const maxTransformRowRatio = 1.0E5;\n const minXYComponent = Math.min(Math.abs(zVec.x), Math.abs(zVec.y));\n const maxDepthRatio = (0.0 === minXYComponent) ? depthRatioLimit : Math.min((maxTransformRowRatio / minXYComponent), depthRatioLimit);\n return Math.max(delta.x, delta.y) * maxDepthRatio;\n }\n\n public getOrigin(): Point3d { return this.origin; }\n public getExtents(): Vector3d { return this.extents; }\n public getRotation(): Matrix3d { return this.rotation; }\n public setOrigin(origin: XYAndZ) { this.origin.setFrom(origin); }\n public setExtents(extents: XYAndZ) { this.extents.setFrom(extents); }\n public setRotation(rot: Matrix3d) { this.rotation.setFrom(rot); }\n /** @internal */\n protected enableCamera(): void {\n if (this.supportsCamera())\n this._cameraOn = true;\n }\n\n public supportsCamera(): boolean {\n return this.allow3dManipulations();\n }\n\n public minimumFrontDistance() {\n return Math.max(15.2 * Constant.oneCentimeter, this.forceMinFrontDist);\n }\n\n public isEyePointAbove(elevation: number): boolean {\n return !this._cameraOn ? (this.getZVector().z > 0) : (this.getEyePoint().z > elevation);\n }\n\n /** The style that controls how the contents of the view are displayed. */\n public override get displayStyle(): DisplayStyle3dState {\n return this.getDisplayStyle3d();\n }\n\n public override set displayStyle(style: DisplayStyle3dState) {\n assert(style instanceof DisplayStyle3dState);\n super.displayStyle = style;\n }\n\n /** The style that controls how the contents of the view are displayed.\n * @see [[ViewState3d.displayStyle]].\n */\n public getDisplayStyle3d() {\n return super.displayStyle as DisplayStyle3dState;\n }\n\n /** Turn the camera off for this view. After this call, the camera parameters in this view definition are ignored and views that use it will\n * display with an orthographic (infinite focal length) projection of the view volume from the view direction.\n * @note To turn the camera back on, call #lookAt\n */\n public turnCameraOff() { this._cameraOn = false; }\n\n /** Determine whether the camera is valid for this view */\n public get isCameraValid() { return this.camera.isValid; }\n\n /** Calculate the lens angle formed by the current delta and focus distance */\n public calcLensAngle(): Angle {\n return Angle.createRadians(2.0 * Math.atan2(this.extents.x * 0.5, this.camera.getFocusDistance()));\n }\n\n /** Get the target point of the view. If there is no camera, view center is returned. */\n public override getTargetPoint(result?: Point3d): Point3d {\n if (!this._cameraOn) {\n const earthFocalPoint = this.getEarthFocalPoint();\n return earthFocalPoint ? earthFocalPoint : super.getTargetPoint(result);\n }\n\n return this.getEyePoint().plusScaled(this.getZVector(), -1.0 * this.getFocusDistance(), result);\n }\n\n /** Setup view state for either perspective or orthographic view.\n * @returns A [[ViewStatus]] indicating whether the camera was successfully positioned.\n * @note If the aspect ratio of viewDelta does not match the aspect ratio of a Viewport into which this view is displayed, it will be\n * adjusted when the [[Viewport]] is synchronized from this view.\n */\n public lookAt(args: LookAtPerspectiveArgs | LookAtOrthoArgs | LookAtUsingLensAngle): ViewStatus {\n if (args.lensAngle) {\n const lensAngle = args.lensAngle;\n const eyePoint = Vector3d.createFrom(args.eyePoint);\n const focus = eyePoint.vectorTo(args.targetPoint).magnitude(); // Set focus at target point\n\n if (focus <= Constant.oneMillimeter) // eye and target are too close together\n return ViewStatus.InvalidTargetPoint;\n\n if (lensAngle.radians < .0001 || lensAngle.radians > Math.PI)\n return ViewStatus.InvalidLens;\n\n const width = 2.0 * Math.tan(lensAngle.radians / 2.0) * focus;\n const newExtents = Vector2d.createFrom(args.newExtents ?? this.extents);\n newExtents.scale(width / newExtents.x, newExtents);\n args = { ...args, newExtents };\n }\n\n const isPerspective = undefined !== args.targetPoint;\n if (isPerspective && !this.supportsCamera())\n return ViewStatus.NotCameraView;\n\n const eye = new Point3d(args.eyePoint.x, args.eyePoint.y, args.eyePoint.z);\n const yVec = args.upVector.normalize();\n if (!yVec) // up vector zero length?\n return ViewStatus.InvalidUpVector;\n\n const minFrontDist = this.minimumFrontDistance();\n let zVec: Vector3d;\n let focusDist: number;\n if (args.targetPoint) {\n zVec = Vector3d.createStartEnd(args.targetPoint, eye); // z defined by direction from eye to target\n focusDist = zVec.normalizeWithLength(zVec).mag; // set focus at target point\n if (focusDist <= minFrontDist) { // eye and target are too close together\n args.opts?.onExtentsError?.(ViewStatus.InvalidTargetPoint);\n return ViewStatus.InvalidTargetPoint;\n }\n } else {\n zVec = Vector3d.createFrom(args.viewDirection).negate();\n if (!zVec.normalizeInPlace())\n return ViewStatus.InvalidDirection;\n focusDist = this.getFocusDistance();\n }\n\n const xVec = new Vector3d();\n if (yVec.crossProduct(zVec).normalizeWithLength(xVec).mag < Geometry.smallMetricDistance)\n return ViewStatus.InvalidUpVector; // up is parallel to z\n\n if (zVec.crossProduct(xVec).normalizeWithLength(yVec).mag < Geometry.smallMetricDistance)\n return ViewStatus.InvalidUpVector;\n\n // we now have rows of the rotation matrix\n const rotation = Matrix3d.createRows(xVec, yVec, zVec);\n\n let backDist = args.backDistance ? args.backDistance : this.getBackDistance();\n let frontDist = args.frontDistance ? args.frontDistance : this.getFrontDistance();\n\n const delta = args.newExtents ? new Vector3d(Math.abs(args.newExtents.x), Math.abs(args.newExtents.y), this.extents.z) : this.extents.clone();\n\n // The front/back distance are relatively arbitrary -- the frustum will be adjusted to include geometry.\n // Set them here to reasonable in front of eye and just beyond target.\n frontDist = Math.min(frontDist, (.5 * Constant.oneMeter));\n backDist = Math.min(backDist, focusDist + (.5 * Constant.oneMeter));\n\n if (backDist < focusDist) // make sure focus distance is in front of back distance.\n backDist = focusDist + Constant.oneMillimeter;\n\n if (frontDist > focusDist)\n frontDist = focusDist - minFrontDist;\n\n if (frontDist < minFrontDist)\n frontDist = minFrontDist;\n\n delta.z = (backDist - frontDist);\n\n const stat = this.adjustViewDelta(delta, eye, rotation, undefined, args.opts);\n if (ViewStatus.Success !== stat)\n return stat;\n\n if (delta.z > ViewState3d.calculateMaxDepth(delta, zVec)) // make sure we're not zoomed out too far\n return ViewStatus.MaxDisplayDepth;\n\n // The origin is defined as the lower left of the view rectangle on the focus plane, projected to the back plane.\n // Start at eye point, and move to center of back plane, then move left half of width. and down half of height\n const origin = eye.plus3Scaled(zVec, -backDist, xVec, -0.5 * delta.x, yVec, -0.5 * delta.y);\n\n this.setEyePoint(args.eyePoint);\n this.setRotation(rotation);\n this.setFocusDistance(focusDist);\n this.setOrigin(origin);\n this.setExtents(delta);\n this.setLensAngle(this.calcLensAngle());\n if (isPerspective)\n this.enableCamera();\n else\n this.turnCameraOff();\n this._updateMaxGlobalScopeFactor();\n return ViewStatus.Success;\n }\n\n /** Change the focus distance for this ViewState3d. Preserves the content of the view.\n * @internal\n */\n public changeFocusDistance(newDist: number): ViewStatus {\n if (newDist <= Constant.oneMillimeter)\n return ViewStatus.InvalidTargetPoint;\n\n const oldExtents = this.extents.clone(); // save current extents so we can keep frustum unchanged\n this.extents.x = 2.0 * Math.tan(this.camera.lens.radians / 2.0) * newDist; // new width based on focus distance and lens angle.\n this.extents.y = this.extents.y * (this.extents.x / oldExtents.x); // preserve aspect ratio\n this.origin.addScaledInPlace(this.rotation.multiplyTransposeVector(this.extents.vectorTo(oldExtents)), .5); // move origin by half the change in extents\n this.camera.focusDist = newDist; // save new focus distance\n return ViewStatus.Success;\n }\n\n /** Change the focus distance for this ViewState3d to be defined by the the supplied point, if it is in front of the camera.\n * Preserves the content of the view.\n * @internal\n */\n public changeFocusFromPoint(pt: Point3d) {\n return this.changeFocusDistance(this.getZVector().dotProduct(pt.vectorTo(this.camera.eye)));\n }\n\n /** Move the camera relative to its current location by a distance in camera coordinates.\n * @param distance to move camera. Length is in world units, direction relative to current camera orientation.\n * @returns Status indicating whether the camera was successfully positioned. See values at [[ViewStatus]] for possible errors.\n */\n public moveCameraLocal(distance: Vector3d): ViewStatus {\n const distWorld = this.rotation.multiplyTransposeVector(distance);\n return this.moveCameraWorld(distWorld);\n }\n\n /** Move the camera relative to its current location by a distance in world coordinates.\n * @param distance in world units.\n * @returns Status indicating whether the camera was successfully positioned. See values at [[ViewStatus]] for possible errors.\n */\n public moveCameraWorld(distance: Vector3d): ViewStatus {\n if (!this._cameraOn) {\n this.origin.plus(distance, this.origin);\n return ViewStatus.Success;\n }\n\n const targetPoint = this.getTargetPoint().plus(distance);\n const eyePoint = this.getEyePoint().plus(distance);\n return this.lookAt({ eyePoint, targetPoint, upVector: this.getYVector() });\n }\n\n /** Rotate the camera from its current location about an axis relative to its current orientation.\n * @param angle The angle to rotate the camera.\n * @param axis The axis about which to rotate the camera. The axis is a direction relative to the current camera orientation.\n * @param aboutPt The point, in world coordinates, about which the camera is rotated. If aboutPt is undefined, the camera rotates in place\n * (i.e. about the current eyePoint).\n * @note Even though the axis is relative to the current camera orientation, the aboutPt is in world coordinates, \\b not relative to the camera.\n * @returns Status indicating whether the camera was successfully positioned. See values at [[ViewStatus]] for possible errors.\n */\n public rotateCameraLocal(angle: Angle, axis: Vector3d, aboutPt?: Point3d): ViewStatus {\n const axisWorld = this.getRotation().multiplyTransposeVector(axis);\n return this.rotateCameraWorld(angle, axisWorld, aboutPt);\n }\n\n /** Rotate the camera from its current location about an axis in world coordinates.\n * @param angle The angle to rotate the camera.\n * @param axis The world-based axis (direction) about which to rotate the camera.\n * @param aboutPt The point, in world coordinates, about which the camera is rotated. If aboutPt is undefined, the camera rotates in place\n * (i.e. about the current eyePoint).\n * @returns Status indicating whether the camera was successfully positioned. See values at [[ViewStatus]] for possible errors.\n */\n public rotateCameraWorld(angle: Angle, axis: Vector3d, aboutPt?: Point3d): ViewStatus {\n const about = aboutPt ? aboutPt : this.getEyePoint();\n const rotation = Matrix3d.createRotationAroundVector(axis, angle);\n if (!rotation)\n return ViewStatus.InvalidUpVector; // Invalid axis given\n const trans = Transform.createFixedPointAndMatrix(about, rotation);\n const targetPoint = trans.multiplyPoint3d(this.getTargetPoint());\n const upVector = rotation.multiplyVector(this.getYVector());\n return this.lookAt({ eyePoint: this.getEyePoint(), targetPoint, upVector });\n }\n\n /** Move camera about the global ellipsoid. This rotates the camera position about the center of the global ellipsoid maintaining the current height.\n * @param fromPoint Point to pan from.\n * @param point Point to point to.\n * @returns Status indicating whether the camera was successfully positioned. See values at [[ViewStatus]] for possible errors.\n */\n public moveCameraGlobal(fromPoint: Point3d, toPoint: Point3d): ViewStatus {\n if (!this.iModel.ecefLocation)\n return ViewStatus.NotGeolocated;\n\n if (this.globeMode !== GlobeMode.Ellipsoid)\n return ViewStatus.NotEllipsoidGlobeMode;\n\n const earthCenter = this.iModel.ecefLocation?.earthCenter;\n const rMatrix = Matrix3d.createRotationVectorToVector(Vector3d.createStartEnd(earthCenter, toPoint), Vector3d.createStartEnd(earthCenter, fromPoint));\n if (!rMatrix)\n return ViewStatus.DegenerateGeometry;\n\n const rotationTransform = Transform.createFixedPointAndMatrix(earthCenter, rMatrix);\n const frustum = this.calculateFrustum();\n if (!frustum)\n return ViewStatus.DegenerateGeometry;\n\n frustum.multiply(rotationTransform);\n return this.setupFromFrustum(frustum);\n }\n\n /** Get the distance from the eyePoint to the front plane for this view. */\n public getFrontDistance(): number { return this.getBackDistance() - this.extents.z; }\n\n /** Get the distance from the eyePoint to the back plane for this view. */\n public getBackDistance(): number {\n // backDist is the z component of the vector from the origin to the eyePoint .\n const eyeOrg = this.origin.vectorTo(this.getEyePoint());\n this.getRotation().multiplyVector(eyeOrg, eyeOrg);\n return eyeOrg.z;\n }\n\n /** Place the eyepoint of the camera so it is aligned with the center of the view. This removes any 1-point perspective skewing that may be\n * present in the current view.\n * @param backDistance If defined, the new the distance from the eyepoint to the back plane. Otherwise the distance from the\n * current eyepoint is used.\n */\n public centerEyePoint(backDistance?: number): void {\n const eyePoint = this.getExtents().scale(0.5);\n eyePoint.z = backDistance ? backDistance : this.getBackDistance();\n const eye = this.getOrigin().plus(this.getRotation().multiplyTransposeXYZ(eyePoint.x, eyePoint.y, eyePoint.z));\n this.camera.setEyePoint(eye);\n }\n\n /** Center the focus distance of the camera halfway between the front plane and the back plane, keeping the eyepoint,\n * lens angle, rotation, back distance, and front distance unchanged.\n * @note The focus distance, origin, and delta values are modified, but the view encloses the same volume and appears visually unchanged.\n */\n public centerFocusDistance(): void {\n const backDistance = this.getBackDistance();\n const frontDistance = this.getFrontDistance();\n const eyePoint = this.getEyePoint();\n const targetPoint = eyePoint.plusScaled(this.getZVector(), frontDistance - backDistance);\n this.lookAt({ eyePoint, targetPoint, upVector: this.getYVector(), lensAngle: this.getLensAngle(), frontDistance, backDistance });\n }\n\n /** Ensure the focus plane lies between the front and back planes. If not, center it. */\n public verifyFocusPlane(): void {\n if (!this._cameraOn)\n return;\n\n let backDist = this.getBackDistance();\n const frontDist = backDist - this.extents.z;\n const camera = this.camera;\n const extents = this.extents;\n const rot = this.rotation;\n\n if (backDist <= 0.0 || frontDist <= 0.0) {\n // the camera location is invalid. Set it based on the view range.\n const tanAngle = Math.tan(camera.lens.radians / 2.0);\n backDist = extents.z / tanAngle;\n camera.setFocusDistance(backDist / 2);\n this.centerEyePoint(backDist);\n return;\n }\n\n const focusDist = camera.focusDist;\n if (focusDist > frontDist && focusDist < backDist)\n return;\n\n // put it halfway between front and back planes\n camera.setFocusDistance((extents.z / 2.0) + frontDist);\n\n // moving the focus plane means we have to adjust the origin and delta too (they're on the focus plane, see diagram above)\n const ratio = camera.focusDist / focusDist;\n extents.x *= ratio;\n extents.y *= ratio;\n camera.eye.plus3Scaled(rot.rowZ(), -backDist, rot.rowX(), -0.5 * extents.x, rot.rowY(), -0.5 * extents.y, this.origin); // this centers the camera too\n }\n\n /** Get the current location of the eyePoint for camera in this view. */\n public getEyePoint(): Point3d { return this.camera.eye; }\n\n /** Get the lens angle for this view. */\n public getLensAngle(): Angle { return this.camera.lens; }\n\n /** Set the lens angle for this view.\n * @param angle The new lens angle in radians. Must be greater than 0 and less than pi.\n * @note This does not change the view's current field-of-view. Instead, it changes the lens that will be used if the view\n * is subsequently modified and the lens angle is used to position the eyepoint.\n * @note To change the field-of-view (i.e. \"zoom\") of a view, pass a new viewDelta to #lookAt\n */\n public setLensAngle(angle: Angle): void { this.camera.setLensAngle(angle); }\n\n /** Change the location of the eyePoint for the camera in this view.\n * @param pt The new eyepoint.\n * @note This method is generally for internal use only. Moving the eyePoint arbitrarily can result in skewed or illegal perspectives.\n * The most common method for user-level camera positioning is #lookAt.\n */\n public setEyePoint(pt: XYAndZ): void { this.camera.setEyePoint(pt); }\n\n /** Set the focus distance for this view.\n * @note Changing the focus distance changes the plane on which the delta.x and delta.y values lie. So, changing focus distance\n * without making corresponding changes to delta.x and delta.y essentially changes the lens angle, causing a \"zoom\" effect\n */\n public setFocusDistance(dist: number): void { this.camera.setFocusDistance(dist); }\n\n /** Get the distance from the eyePoint to the focus plane for this view. */\n public getFocusDistance(): number { return this.camera.focusDist; }\n\n /** Obtain an \"eye\" point for this view. If the camera is on, this simply returns [[Camera.getEyePoint]].\n * Otherwise, a pseudo-eye-point is computed from the view direction and a lens angle of PI/2.\n */\n public getEyeOrOrthographicViewPoint(): Point3d {\n if (this.isCameraOn)\n return this.camera.getEyePoint();\n\n this.camera.validateLens();\n const tanHalfAngle = Math.tan(this.camera.lens.radians / 2);\n const halfDelta = this.getExtents().magnitudeXY();\n const eyeDistance = tanHalfAngle ? (halfDelta / tanHalfAngle) : 0;\n const zVector = this.getRotation().getRow(2);\n\n return this.getCenter().plusScaled(zVector, - eyeDistance);\n }\n public createAuxCoordSystem(acsName: string): AuxCoordSystemState { return AuxCoordSystem3dState.createNew(acsName, this.iModel); }\n\n public override decorate(context: DecorateContext): void {\n super.decorate(context);\n if (this._environmentDecorations)\n this._environmentDecorations.decorate(context);\n }\n\n /** Returns the ground elevation taken from the environment added with the global z position of this imodel. */\n public getGroundElevation(): number {\n const env = this.getDisplayStyle3d().environment;\n return env.ground.elevation + this.iModel.globalOrigin.z;\n }\n\n /** Return the ground extents, which will originate either from the viewport frustum or the extents of the imodel. */\n public getGroundExtents(vp?: Viewport): AxisAlignedBox3d {\n const displayStyle = this.getDisplayStyle3d();\n const extents = new Range3d();\n if (!displayStyle.environment.displayGround)\n return extents; // Ground plane is not enabled\n\n const elevation = this.getGroundElevation();\n\n if (undefined !== vp) {\n const viewRay = Ray3d.create(Point3d.create(), vp.rotation.rowZ());\n const xyPlane = Plane3dByOriginAndUnitNormal.create(Point3d.create(0, 0, elevation), Vector3d.create(0, 0, 1));\n assert(undefined !== xyPlane);\n\n // first determine whether the ground plane is displayed in the view\n const worldFrust = vp.getFrustum();\n for (const point of worldFrust.points) {\n viewRay.origin = point; // We never modify the reference\n const xyzPoint = Point3d.create();\n const param = viewRay.intersectionWithPlane(xyPlane, xyzPoint);\n if (param === undefined)\n return extents; // View does not show ground plane\n }\n }\n\n extents.setFrom(this.iModel.projectExtents);\n extents.low.z = extents.high.z = elevation;\n\n const center = extents.low.interpolate(.5, extents.high);\n\n const radius = extents.low.distance(extents.high);\n extents.setNull();\n extents.extendPoint(center); // Extents now contains single point\n extents.low.addScaledInPlace(Vector3d.create(-1, -1, -1), radius);\n extents.high.addScaledInPlace(Vector3d.create(1, 1, 1), radius);\n extents.low.z = extents.high.z = elevation;\n return extents;\n }\n\n /** @internal */\n public override getModelElevation(modelId: Id64String): number {\n const settings = this.getDisplayStyle3d().settings.getPlanProjectionSettings(modelId);\n return settings && settings.elevation ? settings.elevation : 0;\n }\n\n /** If the background map is displayed, return the point on the globe in directly front of the eye (or in center of view if camera off)\n * This is generally a better target point for orthographic views than the view center which can be far from the area of interest.\n * @public\n */\n public getEarthFocalPoint(): Point3d | undefined {\n if (!this.iModel.ecefLocation || this.globeMode !== GlobeMode.Ellipsoid)\n return undefined;\n\n const backgroundMapGeometry = this.displayStyle.getBackgroundMapGeometry();\n if (undefined === backgroundMapGeometry)\n return undefined;\n\n const earthEllipsoid = backgroundMapGeometry.getEarthEllipsoid();\n const viewZ = this.getRotation().rowZ();\n const center = this.getCenter();\n const eye = this.isCameraOn ? this.camera.getEyePoint() : center.plusScaled(viewZ, Constant.diameterOfEarth);\n const eyeRay = Ray3d.create(eye, viewZ);\n const fractions = new Array<number>(), points = new Array<Point3d>();\n\n if (earthEllipsoid.intersectRay(eyeRay, fractions, points, undefined)) {\n let fraction = -1.0E10, index = -1;\n for (let i = 0; i < fractions.length; i++)\n if (fractions[i] > fraction) {\n fraction = fractions[i];\n index = i;\n }\n return (index >= 0 && fraction < 0) ? points[index] : undefined;\n } else {\n return eyeRay.projectPointToRay(center);\n }\n }\n\n /**\n * For a geoLocated project, align the view with the global ellipsoid by rotating\n * around the supplied target point such that the view axis points toward the\n * globe center. If the viewing height is below the global transition threshold.\n * @param target The rotation target or pivot point. This point will remain stationary in the view.\n * @param transition If this is defined and true then the rotation is scaled by the [[ViewState.globalViewTransition]] This\n * will cause a smooth transition as a view is zoomed out from a specific location to a more global representation.\n * @public\n */\n public alignToGlobe(target: Point3d, transition?: boolean): ViewStatus {\n if (!this.iModel.ecefLocation)\n return ViewStatus.NotGeolocated;\n\n if (this.globeMode !== GlobeMode.Ellipsoid)\n return ViewStatus.NotEllipsoidGlobeMode;\n\n const globalTransition = this.globalViewTransition();\n\n if (globalTransition <= 0)\n return ViewStatus.HeightBelowTransition;\n\n const earthCenter = this.iModel.ecefLocation?.earthCenter;\n const viewCenter = this.getCenter();\n const viewZ = this.getRotation().rowZ();\n const eye = this.isCameraOn ? this.camera.eye : viewCenter.plusScaled(viewZ, Constant.diameterOfEarth);\n\n const centerToEye = earthCenter.unitVectorTo(eye);\n if (!centerToEye)\n return ViewStatus.DegenerateGeometry;\n\n const axis = viewZ.unitCrossProduct(centerToEye);\n if (!axis)\n return ViewStatus.DegenerateGeometry;\n\n const theta = viewZ.angleTo(centerToEye);\n if (theta.radians > Angle.piOver2Radians)\n return ViewStatus.DegenerateGeometry;\n\n if (theta.isAlmostZero)\n return ViewStatus.NoTransitionRequired;\n\n const transitionRotation = Matrix3d.createRotationAroundVector(axis, transition ? theta.cloneScaled(globalTransition) : theta);\n if (!transitionRotation)\n return ViewStatus.DegenerateGeometry;\n\n const transitionTransform = Transform.createFixedPointAndMatrix(target, transitionRotation);\n const frustum = this.calculateFrustum();\n if (!frustum)\n return ViewStatus.DegenerateGeometry;\n\n frustum.multiply(transitionTransform);\n return this.setupFromFrustum(frustum);\n }\n\n /** See [[ViewState.attachToViewport]]. */\n public override attachToViewport(args: AttachToViewportArgs): void {\n super.attachToViewport(args);\n\n const removeListener = this.displayStyle.settings.onEnvironmentChanged.addListener((env) => {\n this._environmentDecorations?.setEnvironment(env);\n });\n\n this._environmentDecorations = new EnvironmentDecorations(this, () => args.invalidateDecorations(), () => removeListener());\n }\n /** See [[ViewState.detachFromViewport]]. */\n public override detachFromViewport(): void {\n super.detachFromViewport();\n this._environmentDecorations = dispose(this._environmentDecorations);\n }\n}\n\n/** Defines the state of a view of a single 2d model.\n * @public\n * @extensions\n */\nexport abstract class ViewState2d extends ViewState {\n private readonly _details: ViewDetails;\n public static override get className() { return \"ViewDefinition2d\"; }\n public readonly origin: Point2d;\n public readonly delta: Point2d;\n public readonly angle: Angle;\n protected _baseModelId: Id64String;\n public get baseModelId(): Id64String { return this._baseModelId; }\n /** @internal */\n protected _treeRef?: TileTreeReference;\n\n /** @internal */\n protected get _tileTreeRef(): TileTreeReference | undefined {\n if (undefined === this._treeRef) {\n const model = this.getViewedModel();\n if (undefined !== model)\n this._treeRef = model.createTileTreeReference(this);\n }\n\n return this._treeRef;\n }\n\n public constructor(props: ViewDefinition2dProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle2dState) {\n super(props, iModel, categories, displayStyle);\n this.origin = Point2d.fromJSON(props.origin);\n this.delta = Point2d.fromJSON(props.delta);\n this.angle = Angle.fromJSON(props.angle);\n this._baseModelId = Id64.fromJSON(props.baseModelId);\n this._details = new ViewDetails(this.jsonProperties);\n }\n\n public override toJSON(): ViewDefinition2dProps {\n const val = super.toJSON() as ViewDefinition2dProps;\n val.origin = this.origin;\n val.delta = this.delta;\n val.angle = this.angle;\n val.baseModelId = this.baseModelId;\n return val;\n }\n\n /** See [[ViewState.is3d]]. */\n public is3d(): this is ViewState3d { return false; }\n\n /** @internal */\n public isSpatialView(): this is SpatialViewState { return false; }\n\n /** Capture a copy of the viewed area. */\n public savePose(): ViewPose2d { return new ViewPose2d(this); }\n\n /** See [[ViewState.applyPose]]. */\n public applyPose(val: ViewPose) {\n if (val instanceof ViewPose2d) {\n this.setOrigin(val.origin);\n this.setExtents(val.delta);\n this.angle.setFrom(val.angle);\n }\n\n return this;\n }\n\n /** Return the model for this 2d view. */\n public getViewedModel(): GeometricModel2dState | undefined {\n const model = this.iModel.models.getLoaded(this.baseModelId);\n if (model && !(model instanceof GeometricModel2dState))\n return undefined;\n\n return model;\n }\n\n /** Change the model viewed by this view.\n * @note The new model should be of the same type (drawing or sheet) as the current viewed model.\n * @throws Error if attempting to change the viewed model while the view is attached to a viewport.\n * @see [[Viewport.changeViewedModel2d]].\n * @public\n */\n public async changeViewedModel(newViewedModelId: Id64String): Promise<void> {\n if (this.isAttachedToViewport)\n throw new Error(\"Cannot change the viewed model of a view that is attached to a viewport.\");\n\n this._baseModelId = newViewedModelId;\n this._treeRef = undefined;\n await this.load();\n }\n\n public computeFitRange(): Range3d {\n return this.getViewedExtents();\n }\n\n /** @internal */\n protected override preload(hydrateRequest: HydrateViewStateRequestProps): void {\n super.preload(hydrateRequest);\n if (this.iModel.models.getLoaded(this.baseModelId) === undefined)\n hydrateRequest.baseModelId = this.baseModelId;\n }\n\n /** @internal */\n protected override async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\n const promises = [];\n promises.push(super.postload(hydrateResponse));\n if (hydrateResponse.baseModelProps !== undefined)\n promises.push(this.iModel.models.updateLoadedWithModelProps([hydrateResponse.baseModelProps]));\n await Promise.all(promises);\n }\n\n /** Provides access to optional detail settings for this view. */\n public get details(): ViewDetails {\n return this._details;\n }\n\n public allow3dManipulations(): boolean { return false; }\n public getOrigin() { return new Point3d(this.origin.x, this.origin.y, Frustum2d.minimumZExtents.low); }\n public getExtents() { return new Vector3d(this.delta.x, this.delta.y, Frustum2d.minimumZExtents.length()); }\n\n public getRotation() {\n const rot = Matrix3d.createRotationAroundVector(Vector3d.unitZ(), this.angle);\n assert(undefined !== rot, \"rotation around unit vector always defined\");\n return rot;\n }\n\n public setExtents(delta: XAndY) { this.delta.set(delta.x, delta.y); }\n public setOrigin(origin: XAndY) { this.origin.set(origin.x, origin.y); }\n public setRotation(rot: Matrix3d) {\n const xColumn = rot.getColumn(0);\n this.angle.setRadians(Math.atan2(xColumn.y, xColumn.x));\n }\n\n public viewsModel(modelId: Id64String) { return this.baseModelId === modelId; }\n public forEachModel(func: (model: GeometricModelState) => void) {\n const model = this.iModel.models.getLoaded(this.baseModelId);\n if (undefined !== model && undefined !== model.asGeometricModel2d)\n func(model as GeometricModel2dState);\n }\n\n /** @internal */\n public override * getModelTreeRefs(): Iterable<TileTreeReference> {\n if (this._tileTreeRef) {\n yield this._tileTreeRef;\n }\n }\n\n public createAuxCoordSystem(acsName: string): AuxCoordSystemState { return AuxCoordSystem2dState.createNew(acsName, this.iModel); }\n}\n"]}
|