import { GeoPolygon , Projection , ProjectionType } from "@here/harp-geoutils" ; import { PerspectiveCamera } from "three" ; import { PlaneViewBounds } from "./PlaneViewBounds" ; import { SphereViewBounds } from "./SphereViewBounds" ; import { ViewBounds } from "./ViewBounds" ; internal export class BoundsGenerator { private m_viewBounds ! : ViewBounds ; constructor ( private readonly m_view ) { this . createViewBounds ( ) ; } /**
     * Generates a  {@link @here/harp-geoutils#GeoPolygon} covering the visible map.
     * The coordinates are sorted to ccw winding, so a polygon could be drawn with them.
     *  returns generate ( ) { if ( this . m_view . projection !== this . m_viewBounds . projection ) { this . createViewBounds ( ) ; } return this . m_viewBounds . generate ( ) ; } private createViewBounds ( ) { this . m_viewBounds = this . m_view . projection . type === ProjectionType . Planar ? new PlaneViewBounds ( this . m_view . camera , this . m_view . projection , this . m_view ) : new SphereViewBounds ( this . m_view . camera , this . m_view . projection ) ; } }