import { ViewRanges } from "@here/harp-datasource-protocol/lib/ViewRanges" ; import { Projection } from "@here/harp-geoutils" ; import * as THREE from "three" ; import { ClipPlanesEvaluator } from "./ClipPlanesEvaluator" ; import { ElevationProvider } from "./ElevationProvider" ; /**
 * Provides the most basic evaluation concept giving fixed values with some constraints.
 */ export class FixedClipPlanesEvaluator implements ClipPlanesEvaluator { readonly minFar : number ; private m_nearPlane : number ; private m_farPlane : number ; constructor ( readonly minNear = 1 , readonly minFarOffset = 10 ) { this . minFar = minNear + minFarOffset ; this . m_nearPlane = minNear ; this . m_farPlane = this . minFar ; } get nearPlane ( ) : number { return this . m_nearPlane ; } set nearPlane ( fixedNear ) { this . invalidatePlanes ( fixedNear , this . m_farPlane ) ; } get farPlane ( ) : number { return this . m_farPlane ; } set farPlane ( fixedFar ) { this . invalidatePlanes ( this . m_nearPlane , fixedFar ) ; } set minElevation ( elevation ) { } get minElevation ( ) : number { return 0 ; } set maxElevation ( elevation ) { } get maxElevation ( ) : number { return 0 ; } @override  evaluateClipPlanes ( camera , projection , elevationProvider ? ) { const viewRanges = { near : this . m_nearPlane , far : this . m_farPlane , minimum : this . minNear , maximum : this . m_farPlane } ; return viewRanges ; } private invalidatePlanes ( near , far ) { const nearDist = Math . max ( this . minNear , near ) ; const farDist = Math . max ( this . minFar , far , nearDist + this . minFarOffset ) ; this . m_nearPlane = nearDist ; this . m_farPlane = farDist ; } }