    import { defaultValue } from '../util'
    import FeatureExpressionInfo from './FeatureExpressionInfo'
    import Zondy from './Zondy'
    import { ElevationMode, LengthUnit } from './enum'

    /**
     * 高程信息
     * @classdesc 高程信息
     * @class ElevationInfo
     * @param {Object} options 构造参数
     * @param {ElevationMode} [options.mode = ElevationMode.OnTheGround] 模式
     * @param {Number} [options.offset = 0] 高程偏移
     * @param {FeatureExpressionInfo} [options.featureExpressionInfo = undefined] 高度表达式
     * @param {LengthUnit} [options.unit = LengthUnit.meter] 单位
     */
    class ElevationInfo {
      constructor(options) {
        options = defaultValue(options, {})
        /**
         * 高程模式
         *
         * @date 10/12/2021
         * @memberof ElevationInfo
         */
        this.mode = defaultValue(options.mode, ElevationMode.AbsoluteHeight)

        /**
         * 高程偏移。默认为零，默认单位为米。
         *
         * @date 10/12/2021
         * @memberof ElevationInfo
         */
        this.offset = defaultValue(options.offset, 0)

        /**
         * 要素表达式信息
         *
         * @date 10/12/2021
         * @memberof ElevationInfo
         */
        this.featureExpressionInfo = new FeatureExpressionInfo(
          options.featureExpressionInfo
        )

        /**
         * offset和featureExpression的单位
         *
         * @date 10/12/2021
         * @memberof ElevationInfo
         */
        this.unit = defaultValue(options.unit, LengthUnit.meter)
      }

      clone() {
        return new ElevationInfo({
          unit: this.unit,
          mode: this.mode,
          offset: this.offset,
          featureExpressionInfo: this.featureExpressionInfo.clone()
        })
      }

      /**
       * @description 转换为json对象
       * @return {Object} json对象
       */
      toJSON() {
        return {
          unit: this.unit,
          mode: this.mode,
          offset: this.offset,
          featureExpressionInfo: this.featureExpressionInfo.toJSON()
        }
      }
    }

    Zondy.ElevationInfo = ElevationInfo
    export default ElevationInfo