    ﻿import { Zondy } from '../../../base'
    import { defaultValue, extend } from '../../../util'
    import {
      CLinAdjustType,
      CLinHeadType,
      CLinJointType,
      CLinStyleMakeType
    } from './EnumComm'

    /**
     * 线图形参数对象
     * @class module:专题图服务.CLinInfo
     * @classdesc 线图形参数对象
     * @description Zondy.Object.Theme.CLinInfo
     * @param {Object} options
     * @param {Number} [options.LibID = 0] 库ID
     * @param {Boolean} [options.Ovprnt = false] 覆盖方式
     * @param {Number} [options.AdjustFlg = CLinAdjustType.Adjust] 线型调整方法 {@link Zondy.Enum.Theme.CLinAdjustType}
     * @param {Number} [options.HeadType = CLinHeadType.Round] 线头类型 {@link Zondy.Enum.Theme.CLinHeadType}
     * @param {Number} [options.JointType = CLinHeadType.Round] 拐角类型 {@link Zondy.Enum.Theme.CLinJointType}
     * @param {Number} [options.LinStyID = 0] 线型号
     * @param {Number} [options.MakeMethod = CLinStyleMakeType.Byrule] 线型生成方法 {@link Zondy.Enum.Theme.CLinStyleMakeType}
     * @param {Array} [options.OutClr = [46, 4, 3]] 可变颜色 Array<Integer>(3)
     * @param {Number} [options.XScale = 10] X系数
     * @param {Number} [options.YScale = 10] Y系数
     * @param {Array} [options.OutPenW = [0.05, 0.05, 0.05]] 外部笔宽 Array<Float>(3)
     */
    const CLinInfo = function (options) {
      options = defaultValue(options, {})
      extend(this, options)
      /**
       * @private
       * @member Zondy.Object.Theme.CLinInfo.prototype.LibID
       * @type {Number}
       * @description 库ID
       * @default 0
       */
      this.LibID = options.LibID !== undefined ? options.LibID : 0

      /**
       * @private
       * @member Zondy.Object.Theme.CLinInfo.prototype.Ovprnt
       * @type {Boolean}
       * @description 覆盖方式,true/false 覆盖/透明
       * @default false
       */
      this.Ovprnt = options.Ovprnt !== undefined ? options.Ovprnt : false

      /**
       * @private
       * @member Zondy.Object.Theme.CLinInfo.prototype.AdjustFlg
       * @type {Number}
       * @description 线型调整方法 {@link Zondy.Enum.Theme.CLinAdjustType}
       * @default CLinAdjustType.Adjust
       */
      this.AdjustFlg =
        options.AdjustFlg !== undefined ? options.AdjustFlg : CLinAdjustType.Adjust

      /**
       * @private
       * @member Zondy.Object.Theme.CLinInfo.prototype.HeadType
       * @type {Number}
       * @description 线头类型 {@link Zondy.Enum.Theme.CLinHeadType}
       * @default CLinHeadType.Round
       */
      this.HeadType =
        options.HeadType !== undefined ? options.HeadType : CLinHeadType.Round

      /**
       * @private
       * @member Zondy.Object.Theme.CLinInfo.prototype.JointType
       * @type {Number}
       * @description 拐角类型 {@link Zondy.Enum.Theme.CLinJointType}
       * @default CLinJointType.Round
       */
      this.JointType =
        options.JointType !== undefined ? options.JointType : CLinJointType.Round

      /**
       * @private
       * @member Zondy.Object.Theme.CLinInfo.prototype.LinStyID
       * @type {Number}
       * @description 线型号
       * @default 0
       */
      this.LinStyID = options.LinStyID !== undefined ? options.LinStyID : 0

      /**
       * @private
       * @member Zondy.Object.Theme.CLinInfo.prototype.MakeMethod
       * @type {Number}
       * @description 线型生成方法 {@link Zondy.Enum.Theme.CLinStyleMakeType}
       * @default CLinStyleMakeType.Byrule
       */
      this.MakeMethod =
        options.MakeMethod !== undefined
          ? options.MakeMethod
          : CLinStyleMakeType.Byrule

      /**
       * @private
       * @member Zondy.Object.Theme.CLinInfo.prototype.OutClr
       * @type {Array}
       * @description 可变颜色 Array<Integer>(3)
       * @default [46, 4, 3]
       */
      this.OutClr = options.OutClr !== undefined ? options.OutClr : [46, 4, 3]

      /**
       * @private
       * @member Zondy.Object.Theme.CLinInfo.prototype.XScale
       * @type {Number}
       * @description X系数
       * @default 10
       */
      this.XScale = options.XScale !== undefined ? options.XScale : 10

      /**
       * @private
       * @member Zondy.Object.Theme.CLinInfo.prototype.YScale
       * @type {Number}
       * @description Y系数
       * @default 10
       */
      this.YScale = options.YScale !== undefined ? options.YScale : 10

      /**
       * @private
       * @member Zondy.Object.Theme.CLinInfo.prototype.OutPenW
       * @type {Array}
       * @description 外部笔宽 Array<Float>(3)
       * @default [0.05, 0.05, 0.05]
       */
      this.OutPenW =
        options.OutPenW !== undefined ? options.OutPenW : [0.05, 0.05, 0.05]
    }
    export default CLinInfo
    Zondy.Object.Theme.CLinInfo = CLinInfo