/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	// The require scope
/******/ 	var __webpack_require__ = {};
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "ModelFlatViewModel": function() { return /* reexport */ ModelFlatViewModel; },
  "default": function() { return /* reexport */ ModelFlat; }
});

;// CONCATENATED MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject = require("vue");
;// CONCATENATED MODULE: external "@kq_npm/client_common_vue/_utils/gis-utils"
var gis_utils_namespaceObject = require("@kq_npm/client_common_vue/_utils/gis-utils");
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
}
;// CONCATENATED MODULE: external "element-plus/es"
var es_namespaceObject = require("element-plus/es");
;// CONCATENATED MODULE: external "@kq_npm/client_common_vue/init.js"
var init_js_namespaceObject = require("@kq_npm/client_common_vue/init.js");
var init_js_default = /*#__PURE__*/__webpack_require__.n(init_js_namespaceObject);
;// CONCATENATED MODULE: ./src/common/_ui/message/index.js



es_namespaceObject.ElMessage.install = (Vue, opts) => {
  init_js_default()(Vue, opts);
  Vue.component("KqMessage", es_namespaceObject.ElMessage);
};

/* harmony default export */ var message = (es_namespaceObject.ElMessage);
;// CONCATENATED MODULE: ./src/webgl/modelFlat/ModelFlatViewModel.js

//模型拾取逻辑类

class ModelFlatViewModel {
  //三维viewer对象
  //模型平整三维对象
  //绘制管理对象
  //全局参数
  //绘制的坐标点集合
  //平整高度
  //绘制完成监听事件
  constructor(scenceView, viewModel) {
    _defineProperty(this, "_viewer", null);

    _defineProperty(this, "_terrainexcavationext", null);

    _defineProperty(this, "_drawManager", null);

    _defineProperty(this, "_globaOptions", {});

    _defineProperty(this, "_positions", []);

    _defineProperty(this, "_height", 0);

    _defineProperty(this, "_removeEventListener", null);

    this._viewer = scenceView._viewer;
    this._globaOptions.viewer = scenceView._viewer;
    this._globaOptions.viewer.scene.logarithmicDepthBuffer = false;
    this._globaOptions.viewer.scene.globe.depthTestAgainstTerrain = true;
    this._drawManager = scenceView._drawManager;
    this._handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
    let that = this;
    this._removeEventListener = this._drawManager.drawFinishedEvent.addEventListener(shape => {
      if (shape) {
        that._globaOptions.positions = shape._controlPoints;

        if (that._terrainStyle === 1) {
          that._positions.push(shape._controlPoints);

          if (that._terrainexcavationext) {
            that.setTerrainExcavationAddPolygon();
          } else {
            this.createTerrainExcavation(() => {
              that.setTerrainExcavationAddPolygon();
            });
          }
        } else if (that._terrainStyle === 2) {
          if (that._terrainmodification) {
            that.setTerrainModification();
          } else {
            this.createTerrainModification();
          }
        }

        that._drawManager.clear();
      }
    });
  }

  setCursor(style) {
    this._viewer.canvas.style.cursor = style;
  } //拾取


  pick() {
    // 判断是否添加了模型
    var flag = false;
    var models = this._viewer.scene.primitives._primitives;

    for (let i = 0; i < models.length; i++) {
      if (models[i]._url) {
        flag = true;
      }
    }

    if (flag) {
      this.setCursor("crosshair");
      this._isPick = true;
    } else {
      message({
        message: "请添加模型后拾取!",
        type: "warning"
      });
    }
  } //清除


  clear() {
    this._highlight && this._highlight.remove();
    this._highlight = null;
    this.setCursor("default");
    this._isPick = false;
  } //销毁


  destroy() {
    this.clear();
    this._handler && this._handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
  }

}
;// CONCATENATED MODULE: external "@kq_npm/client_icons_vue"
var client_icons_vue_namespaceObject = require("@kq_npm/client_icons_vue");
;// CONCATENATED MODULE: external "@kq_npm/client_common_vue/_utils/util"
var util_namespaceObject = require("@kq_npm/client_common_vue/_utils/util");
;// CONCATENATED MODULE: external "vue-i18n/dist/vue-i18n.cjs.js"
var vue_i18n_cjs_js_namespaceObject = require("vue-i18n/dist/vue-i18n.cjs.js");
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/webgl/modelFlat/ModelFlat.vue?vue&type=script&setup=true&lang=js

const _hoisted_1 = {
  class: "kq3d-model-flat-span"
};
const _hoisted_2 = {
  class: "footer-buttons"
};





 // tree数据源

const __default__ = {
  name: "Kq3dModelFlat"
};
/* harmony default export */ var ModelFlatvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(__default__, {
  props: {
    //指定组件绑定的viewer对象的div的id
    mapTarget: String,
    // 外部字段别名映射
    aliasNameReflection: {
      type: Function
    },
    // 高亮颜色
    highlightColor: {
      type: String,
      default: "#FF0000"
    },
    // 模型属性唯一值字段集合
    modeFiledArray: {
      type: Array,
      default: () => {
        return null;
      }
    },
    // 是否显示阴影效果
    showShadow: {
      type: Boolean,
      default: true
    }
  },

  setup(__props, {
    expose
  }) {
    const props = __props;
    let layerNameTitle = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(""); //语言

    let language = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)({});
    let viewModel = null;
    let ref_box = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(); // 获取组件传参

    let formItem = reactive({
      flatHeight: props.settingParams && props.settingParams.excavationDepth || 10,
      minFlatDepth: props.settingParams && props.settingParams.minExcavationDepth || 0,
      // 地形开挖深度范围最小值
      maxFlatDepth: props.settingParams && props.settingParams.maxExcavationDepth || 100 // 地形开挖深度范围最大值

    }); // 组件容器Ref

    let boxRef = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(null); // 生成组件默认header

    let headerTemp = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)();
    let headerTempRef = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(); // 国际化

    let {
      locale,
      messages
    } = (0,vue_i18n_cjs_js_namespaceObject.useI18n)();
    let headerTempTitle = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(null);
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.watch)(() => locale.value, (newVal, oldVal) => {
      language.value = messages.value[newVal]["webgl"];
      headerTempTitle.value = language.value.modelFlat;
    });
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onMounted)(() => {
      (0,util_namespaceObject.updatePosition)(boxRef.value, props);
      (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.watch)(() => props.position, (newVal, oldVal) => {
        (0,util_namespaceObject.updatePosition)(boxRef.value, props);
      });
      watchCreateHeaderTemp();
      (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.watch)(() => props.showHeaderTemp, (newVal, oldVal) => {
        watchCreateHeaderTemp();
      }); //父组件ScenceView初始化完成后执行

      gis_utils_namespaceObject.utils.getWebMap(null, scenceView => {
        if (scenceView) {
          viewModel = new ModelFlatViewModel(scenceView, pickCallFunc);
          viewModel._highlightColor = props.highlightColor;
          viewModel._modeFiledArray = props.modeFiledArray;
        }
      });
    });
    /**
     * @description 监听header生成
     */

    const watchCreateHeaderTemp = () => {
      if (props.showHeaderTemp) {
        // 生成headerTemp
        headerTemp.value = (0,util_namespaceObject.createHeaderTemp)(boxRef.value, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.toRefs)(props), headerTempRef, headerTempTitle);
      }
    };

    function pick() {
      viewModel && viewModel.pick();
    }

    function pickCallFunc(layerName, properties) {
      layerNameTitle.value = layerName;
      let propertiesData = [];

      if (props.aliasNameReflection) {
        let arrKeys = [];

        for (let key in properties) {
          arrKeys.push(key);
        }

        props.aliasNameReflection(arrKeys, item => {
          // console.log(item);
          for (let key in properties) {
            propertiesData.push({
              field: item[key] ? item[key] : key,
              value: properties[key]
            });
          }
        });
      } else {
        for (let key in properties) {
          propertiesData.push({
            field: key,
            value: properties[key]
          });
        }
      }

      tableData.value = propertiesData;
    }

    function clear() {
      layerNameTitle.value = "";
      tableData.value = [];
      viewModel && viewModel.clear();
    } // 销毁


    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onBeforeUnmount)(() => {
      viewModel && viewModel.destroy();
    });
    expose({
      pick,
      clear,
      pickCallFunc
    });
    return (_ctx, _cache) => {
      const _component_kq_col = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-col");

      const _component_kq_slider = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-slider");

      const _component_kq_row = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-row");

      const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-button");

      return (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createElementBlock)("section", {
        class: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.normalizeClass)(["kq3d-model-Flat", {
          'kq-box-shadow': __props.showShadow
        }]),
        ref_key: "boxRef",
        ref: boxRef
      }, [_ctx.showHeaderTemp ? ((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createBlock)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveDynamicComponent)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(headerTemp)), {
        key: 0,
        ref_key: "headerTempRef",
        ref: headerTempRef
      }, null, 512
      /* NEED_PATCH */
      )) : (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createCommentVNode)("v-if", true), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createElementVNode)("div", {
        class: "kq3d-model-flat-box",
        ref_key: "ref_box",
        ref: ref_box
      }, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_row, null, {
        default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_col, {
          span: _ctx.currentLang === 'zh' ? 7 : 10
        }, {
          default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createElementVNode)("span", _hoisted_1, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).flatHeight), 1
          /* TEXT */
          )]),
          _: 1
          /* STABLE */

        }, 8
        /* PROPS */
        , ["span"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_col, {
          span: _ctx.currentLang === 'zh' ? 11 : 8
        }, {
          default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_slider, {
            modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(formItem).flatHeight,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(formItem).flatHeight = $event),
            step: 100,
            min: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(formItem).minFlatDepth,
            max: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(formItem).maxFlatDepth,
            onChange: _cache[1] || (_cache[1] = $event => _ctx.changeHeight()),
            onClick: _cache[2] || (_cache[2] = $event => _ctx.changeHeight())
          }, null, 8
          /* PROPS */
          , ["modelValue", "min", "max"])]),
          _: 1
          /* STABLE */

        }, 8
        /* PROPS */
        , ["span"])]),
        _: 1
        /* STABLE */

      }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_row, {
        class: "kq3d-model-flat-tip"
      }, {
        default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createElementVNode)("p", null, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).flatTip), 1
        /* TEXT */
        ), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createCommentVNode)(" <p v-if=\"formItem.terrainStyle === 2\">{{ \"(\" + language.reverseDrawPolygon + \")\" }}</p> ")]),
        _: 1
        /* STABLE */

      }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createElementVNode)("div", _hoisted_2, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_button, {
        onClick: _cache[3] || (_cache[3] = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withModifiers)($event => pick(), ["stop"])),
        title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).start,
        type: "primary"
      }, {
        default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createTextVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).flatStart), 1
        /* TEXT */
        )]),
        _: 1
        /* STABLE */

      }, 8
      /* PROPS */
      , ["title"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_button, {
        onClick: _cache[4] || (_cache[4] = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withModifiers)($event => clear(), ["stop"])),
        title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).clear
      }, {
        default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createTextVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).clear), 1
        /* TEXT */
        )]),
        _: 1
        /* STABLE */

      }, 8
      /* PROPS */
      , ["title"])])], 512
      /* NEED_PATCH */
      )], 2
      /* CLASS */
      );
    };
  }

}));
;// CONCATENATED MODULE: ./src/webgl/modelFlat/ModelFlat.vue?vue&type=script&setup=true&lang=js
 
;// CONCATENATED MODULE: ./src/webgl/modelFlat/ModelFlat.vue



const __exports__ = ModelFlatvue_type_script_setup_true_lang_js;

/* harmony default export */ var ModelFlat = (__exports__);
;// CONCATENATED MODULE: ./src/webgl/modelFlat/index.js




ModelFlat.install = (Vue, opts) => {
  init_js_default()(Vue, opts);
  Vue.component(ModelFlat.name, ModelFlat);
};


module.exports = __webpack_exports__;
/******/ })()
;