/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Utilities
 */
import { DrawingViewState, OrthographicViewState, SheetViewState, SpatialViewState, } from "@itwin/core-frontend";
/**
 * Various View utility methods
 * @public
 */
export class ViewUtilities {
    /**
     * Extracts the BisBaseClass from a full class name.
     * @param classFullName full class name
     * @returns BisBaseClass name
     */
    static getBisBaseClass(classFullName) {
        const bisBaseClass = classFullName.substring(classFullName.indexOf(":") + 1);
        return bisBaseClass;
    }
    /**
     * Determines if given class is a spatial view.
     * @param classname Name of class to check
     */
    static isSpatial(classname) {
        return (classname === SpatialViewState.className ||
            classname === OrthographicViewState.className);
    }
    /**
     * Determines if given class is a spatial view.
     * @param classname Name of class to check
     */
    static isOrthographic(classname) {
        return classname === OrthographicViewState.className;
    }
    /**
     * Determines if given class is a drawing view.
     * @param classname Name of class to check
     */
    static isDrawing(classname) {
        return classname === DrawingViewState.className;
    }
    /**
     * Determines if given class is a sheet view.
     * @param classname Name of class to check
     */
    static isSheet(classname) {
        return classname === SheetViewState.className;
    }
    /**
     * Determines if viewport displays a Sheet view.
     * @param viewport ScreenViewport to check
     */
    static isSheetView(viewport) {
        return ViewUtilities.isSheet(ViewUtilities.getBisBaseClass(viewport.view.classFullName));
    }
    /**
     * Determines if viewport displays a Drawing view.
     * @param viewport ScreenViewport to check
     */
    static isDrawingView(viewport) {
        return ViewUtilities.isDrawing(ViewUtilities.getBisBaseClass(viewport.view.classFullName));
    }
    /**
     * Determines if viewport displays a Orthographic view.
     * @param viewport ScreenViewport to check
     */
    static isOrthographicView(viewport) {
        return ViewUtilities.isOrthographic(ViewUtilities.getBisBaseClass(viewport.view.classFullName));
    }
    /**
     * Determines if viewport displays a Spatial view.
     * @param viewport ScreenViewport to check
     */
    static isSpatialView(viewport) {
        return ViewUtilities.isSpatial(ViewUtilities.getBisBaseClass(viewport.view.classFullName));
    }
    /**
     * Determines if viewport displays a 3d view.
     * @param viewport ScreenViewport to check
     */
    static is3dView(viewport) {
        return viewport.view.is3d();
    }
    /**
     * Determines if viewport supports use of a camera.
     * @param viewport ScreenViewport to check
     */
    static viewSupportsCamera(viewport) {
        return (SpatialViewState.className ===
            ViewUtilities.getBisBaseClass(viewport.view.classFullName));
    }
}
//# sourceMappingURL=ViewUtilities.js.map