import { Offset } from "../../../../services/HtmlDomService" ; import { Rectangle } from "../../domain/Rectangle" ; import { SoftVis3dShape } from "../../domain/SoftVis3dShape" ; export default class SceneObjectCalculator { public static findMaxDimension ( shapes ) { let length = 0 ; let width = 0 ; for ( const shape of shapes ) { if ( shape . dimensions . length > length ) { length = shape . dimensions . length ; } if ( shape . dimensions . width > width ) { width = shape . dimensions . width ; } } return new Rectangle ( width , length ) ; } public static calculateDimensionOnResize ( sidebarWidth , topbarHeight , appOffset , sonarFooter , appWidth ) { const sceneBoarderWidth = 1 ; const sonarFooterHeight = sonarFooter ? sonarFooter . offsetHeight : SceneObjectCalculator . DEFAULT_FOOTER_HEIGHT ; const appMaxHeight = window . innerHeight - sonarFooterHeight - appOffset . top - 2 * sceneBoarderWidth ; const appComputedWidth = appWidth - 2 * sceneBoarderWidth ; const width = appComputedWidth - sidebarWidth - 1 ; const height = appMaxHeight - topbarHeight ; return new Rectangle ( width , height ) ; } private static DEFAULT_FOOTER_HEIGHT = 11 ; }