fl-web-component 2.1.1-beta.0 → 2.1.1-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2409,6 +2409,13 @@ Factory_1.Factory.addGetterSetter(Node_1.Node, 'levels', 0.5, (0, Validators_1.g
2409
2409
 
2410
2410
  /***/ }),
2411
2411
 
2412
+ /***/ "209f":
2413
+ /***/ (function(module, exports, __webpack_require__) {
2414
+
2415
+ // extracted by mini-css-extract-plugin
2416
+
2417
+ /***/ }),
2418
+
2412
2419
  /***/ "21d3":
2413
2420
  /***/ (function(module, exports, __webpack_require__) {
2414
2421
 
@@ -4041,13 +4048,6 @@ exports.default = {
4041
4048
 
4042
4049
  /***/ }),
4043
4050
 
4044
- /***/ "2c6b":
4045
- /***/ (function(module, exports, __webpack_require__) {
4046
-
4047
- // extracted by mini-css-extract-plugin
4048
-
4049
- /***/ }),
4050
-
4051
4051
  /***/ "2e4d":
4052
4052
  /***/ (function(module, exports) {
4053
4053
 
@@ -13311,13 +13311,6 @@ Factory_1.Factory.addGetterSetter(Ellipse, 'radiusY', 0, (0, Validators_1.getNum
13311
13311
 
13312
13312
  /***/ }),
13313
13313
 
13314
- /***/ "3886":
13315
- /***/ (function(module, exports, __webpack_require__) {
13316
-
13317
- // extracted by mini-css-extract-plugin
13318
-
13319
- /***/ }),
13320
-
13321
13314
  /***/ "393a":
13322
13315
  /***/ (function(module, exports, __webpack_require__) {
13323
13316
 
@@ -13823,13 +13816,6 @@ function isVNode(node) {
13823
13816
 
13824
13817
  /***/ }),
13825
13818
 
13826
- /***/ "4326":
13827
- /***/ (function(module, exports, __webpack_require__) {
13828
-
13829
- // extracted by mini-css-extract-plugin
13830
-
13831
- /***/ }),
13832
-
13833
13819
  /***/ "4546":
13834
13820
  /***/ (function(module, exports, __webpack_require__) {
13835
13821
 
@@ -19965,6 +19951,17 @@ module.exports = _$export;
19965
19951
  /* unused harmony reexport * */
19966
19952
 
19967
19953
 
19954
+ /***/ }),
19955
+
19956
+ /***/ "5313":
19957
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
19958
+
19959
+ "use strict";
19960
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_27a9d008_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("209f");
19961
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_27a9d008_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_27a9d008_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
19962
+ /* unused harmony reexport * */
19963
+
19964
+
19968
19965
  /***/ }),
19969
19966
 
19970
19967
  /***/ "5414":
@@ -41835,6 +41832,17 @@ function isEventSupported(eventNameSuffix, capture) {
41835
41832
  }
41836
41833
  module.exports = isEventSupported;
41837
41834
 
41835
+ /***/ }),
41836
+
41837
+ /***/ "7bbf":
41838
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
41839
+
41840
+ "use strict";
41841
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_27a9d008_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("c7d2");
41842
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_27a9d008_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_27a9d008_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
41843
+ /* unused harmony reexport * */
41844
+
41845
+
41838
41846
  /***/ }),
41839
41847
 
41840
41848
  /***/ "7cc1":
@@ -42558,17 +42566,6 @@ var isMac = exports.isMac = function isMac() {
42558
42566
  return !_vue2.default.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent);
42559
42567
  };
42560
42568
 
42561
- /***/ }),
42562
-
42563
- /***/ "8130":
42564
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
42565
-
42566
- "use strict";
42567
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_160a92af_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2c6b");
42568
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_160a92af_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_160a92af_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
42569
- /* unused harmony reexport * */
42570
-
42571
-
42572
42569
  /***/ }),
42573
42570
 
42574
42571
  /***/ "83bc":
@@ -56184,6 +56181,13 @@ Factory_1.Factory.addGetterSetter(Path, 'data');
56184
56181
 
56185
56182
  /***/ }),
56186
56183
 
56184
+ /***/ "8d26":
56185
+ /***/ (function(module, exports, __webpack_require__) {
56186
+
56187
+ // extracted by mini-css-extract-plugin
56188
+
56189
+ /***/ }),
56190
+
56187
56191
  /***/ "8e84":
56188
56192
  /***/ (function(module, exports, __webpack_require__) {
56189
56193
 
@@ -56503,7 +56507,7 @@ module.exports = document && document.documentElement;
56503
56507
  /***/ "9224":
56504
56508
  /***/ (function(module) {
56505
56509
 
56506
- module.exports = JSON.parse("{\"name\":\"fl-web-component\",\"version\":\"2.1.1-beta.0\",\"scripts\":{\"postinstall\":\"patch-package\",\"tip1\":\"仅调试本组件不涉及业务组件,请执行dev\",\"dev\":\"vue-cli-service serve\",\"lint\":\"eslint \\\"{src,packages}/**/*.{vue,js}\\\" --fix\",\"prettier\":\"prettier --write \\\"packages/**/*.{js,css,less,scss,vue,html}\\\"\",\"=\":\"=============================================================\",\"tip2\":\"同时调试本组件与业务组件,请执行watch,生产模式监听请执行watch:prod\",\"watch\":\"vue-cli-service build --watch --mode development --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"watch:prod\":\"vue-cli-service build --watch --mode production --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build\":\"npm run lint && vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build:test\":\"vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"publish:base\":\"npm run build && npm publish --registry https://registry.npmjs.org/\",\"publish:beta:base\":\"npm run build && npm publish --tag beta --registry https://registry.npmjs.org/\",\"==\":\"=============================================================\",\"tip3\":\"发版注意: 【测试版执行publish:beta】【修改bug执行publish:fix】【新增功能执行publish:feat】【新特性执行publish:perf】\",\"publish:beta\":\"npm version prerelease --preid=beta && npm run publish:beta:base\",\"publish:fix\":\"npm version patch && npm run publish:base\",\"publish:feat\":\"npm version minor && npm run publish:base\",\"publish:perf\":\"npm version major && npm run publish:base\"},\"files\":[\"dist\",\"packages\",\"src\"],\"main\":\"dist/fl-web-component.common.js\",\"dependencies\":{\"camera-controls\":\"2.9.0\",\"core-js\":\"^3.42.0\",\"dxf-parser\":\"^1.1.2\",\"element-ui\":\"2.15.14\",\"fflate\":\"^0.8.2\",\"html2canvas\":\"^1.4.1\",\"jspdf\":\"^3.0.1\",\"konva\":\"^9.3.12\",\"lodash\":\"^4.17.21\",\"meshline\":\"^3.3.1\",\"regenerator-runtime\":\"^0.14.1\",\"svg-pan-zoom\":\"^3.6.2\",\"three\":\"^0.176.0\",\"three.path\":\"^1.0.1\",\"vue\":\"^2.6.11\"},\"devDependencies\":{\"@babel/core\":\"^7.12.16\",\"@babel/plugin-proposal-nullish-coalescing-operator\":\"^7.18.6\",\"@babel/plugin-proposal-optional-chaining\":\"^7.21.0\",\"@babel/preset-env\":\"^7.0.0\",\"@babel/runtime-corejs3\":\"^7.27.1\",\"@vue/cli-plugin-babel\":\"~4.4.0\",\"@vue/cli-plugin-eslint\":\"~4.4.0\",\"@vue/cli-service\":\"~4.4.0\",\"babel-eslint\":\"^10.1.0\",\"babel-loader\":\"^8.0.0\",\"copy-webpack-plugin\":\"^4.0.1\",\"eslint\":\"^6.7.2\",\"eslint-config-prettier\":\"^6.15.0\",\"eslint-plugin-prettier\":\"^3.4.1\",\"eslint-plugin-vue\":\"^6.2.2\",\"patch-package\":\"^6.4.7\",\"prettier\":\"^2.8.8\",\"sass\":\"1.32.13\",\"sass-loader\":\"10.1.1\",\"vue-template-compiler\":\"^2.6.11\",\"worker-loader\":\"^3.0.8\"},\"browserslist\":[\"> 1%\",\"last 2 versions\"]}");
56510
+ module.exports = JSON.parse("{\"name\":\"fl-web-component\",\"version\":\"2.1.1-beta.10\",\"scripts\":{\"postinstall\":\"patch-package\",\"tip1\":\"仅调试本组件不涉及业务组件,请执行dev\",\"dev\":\"vue-cli-service serve\",\"lint\":\"eslint \\\"{src,packages}/**/*.{vue,js}\\\" --fix\",\"prettier\":\"prettier --write \\\"packages/**/*.{js,css,less,scss,vue,html}\\\"\",\"=\":\"=============================================================\",\"tip2\":\"同时调试本组件与业务组件,请执行watch,生产模式监听请执行watch:prod\",\"watch\":\"vue-cli-service build --watch --mode development --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"watch:prod\":\"vue-cli-service build --watch --mode production --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build\":\"npm run lint && vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build:test\":\"vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"publish:base\":\"npm run build && npm publish --registry https://registry.npmjs.org/\",\"publish:beta:base\":\"npm run build && npm publish --tag beta --registry https://registry.npmjs.org/\",\"==\":\"=============================================================\",\"tip3\":\"发版注意: 【测试版执行publish:beta】【修改bug执行publish:fix】【新增功能执行publish:feat】【新特性执行publish:perf】\",\"publish:beta\":\"npm version prerelease --preid=beta && npm run publish:beta:base\",\"publish:fix\":\"npm version patch && npm run publish:base\",\"publish:feat\":\"npm version minor && npm run publish:base\",\"publish:perf\":\"npm version major && npm run publish:base\"},\"files\":[\"dist\",\"packages\",\"src\"],\"main\":\"dist/fl-web-component.common.js\",\"dependencies\":{\"camera-controls\":\"2.9.0\",\"core-js\":\"^3.42.0\",\"dxf-parser\":\"^1.1.2\",\"element-ui\":\"2.15.14\",\"fflate\":\"^0.8.2\",\"html2canvas\":\"^1.4.1\",\"jspdf\":\"^3.0.1\",\"konva\":\"^9.3.12\",\"lodash\":\"^4.17.21\",\"meshline\":\"^3.3.1\",\"regenerator-runtime\":\"^0.14.1\",\"svg-pan-zoom\":\"^3.6.2\",\"three\":\"^0.176.0\",\"three.path\":\"^1.0.1\",\"vue\":\"^2.6.11\"},\"devDependencies\":{\"@babel/core\":\"^7.12.16\",\"@babel/plugin-proposal-nullish-coalescing-operator\":\"^7.18.6\",\"@babel/plugin-proposal-optional-chaining\":\"^7.21.0\",\"@babel/preset-env\":\"^7.0.0\",\"@babel/runtime-corejs3\":\"^7.27.1\",\"@vue/cli-plugin-babel\":\"~4.4.0\",\"@vue/cli-plugin-eslint\":\"~4.4.0\",\"@vue/cli-service\":\"~4.4.0\",\"babel-eslint\":\"^10.1.0\",\"babel-loader\":\"^8.0.0\",\"copy-webpack-plugin\":\"^4.0.1\",\"eslint\":\"^6.7.2\",\"eslint-config-prettier\":\"^6.15.0\",\"eslint-plugin-prettier\":\"^3.4.1\",\"eslint-plugin-vue\":\"^6.2.2\",\"patch-package\":\"^6.4.7\",\"prettier\":\"^2.8.8\",\"sass\":\"1.32.13\",\"sass-loader\":\"10.1.1\",\"vue-template-compiler\":\"^2.6.11\",\"worker-loader\":\"^3.0.8\"},\"browserslist\":[\"> 1%\",\"last 2 versions\"]}");
56507
56511
 
56508
56512
  /***/ }),
56509
56513
 
@@ -59321,28 +59325,6 @@ var isDefined = exports.isDefined = function isDefined(val) {
59321
59325
 
59322
59326
  module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAACGUlEQVR4AeSUPU4CURSFgRW4A7FwAUYLC4yY2DNUFhZApLPRxMKOsAPsSYAVACuQCdqZ2NiYmIiFPQsw4Hfe/GTeMINkEirJO3N/3n333PsuM4Xcln//gMBxnHJwi+jFQJeM2/LFkXpFHC5Xq9VPDtSQj9j1fD4v2UIXetpD74E6euJKJSBZazgc7o1Go8ZyuRxgX/h2m0znwGVPepu9FnbiWiGgGlM5SeeREzvY3xH7naQfsiGZsffDucROLAKCdMenfqVVJRBI0gFN6YJ0Yp6kC9j7oAFpzc8ht4FFgEcD/UJmWnQyix+0CKii71dRZ7CleHCardhKpXLH2TI5LBKLIJLgimqOIvZaldh6oVC4RPbjgRaB7o+gCVWcgE48OM0mtslMDtgvKgcyXBYBXg0ZkX1Bln5FbE50j1QxBTeb0hDbZQ6vxLvAWvEOzCbX9AzRizE2e7xxZkLoLrCWRUAlZQWOx+N77jT8n1snEgw613tyy9afM9D9ZZ4DXRchUw64vGV14G+6juPotZ96Ibkc91vC1w1s6SCcEbo+gj2617cpCDPSIpAHkj5ooJtvDTK3WCyOqe5QuuDru9J9zHQGaA6+yxMrBJ7bPF0qN5XxEl1T3YhK1ZkqfSBiLlsx6AOQuFIJqKZPUnXSZuD6bKv9Nv4GUJfGZu8Me6XygC2VQAEcVOvh0GTLHyBuB/6oXEsQDcyqb53gFwAA//9V8fpjAAAABklEQVQDAOkWA0BYT6hNAAAAAElFTkSuQmCC"
59323
59327
 
59324
- /***/ }),
59325
-
59326
- /***/ "affa":
59327
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
59328
-
59329
- "use strict";
59330
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_e2de7752_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4326");
59331
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_e2de7752_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_e2de7752_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
59332
- /* unused harmony reexport * */
59333
-
59334
-
59335
- /***/ }),
59336
-
59337
- /***/ "b1d7":
59338
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
59339
-
59340
- "use strict";
59341
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_160a92af_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("3886");
59342
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_160a92af_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_160a92af_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
59343
- /* unused harmony reexport * */
59344
-
59345
-
59346
59328
  /***/ }),
59347
59329
 
59348
59330
  /***/ "b2fd":
@@ -69114,6 +69096,24 @@ var Contrast = function Contrast(imageData) {
69114
69096
  exports.Contrast = Contrast;
69115
69097
  Factory_1.Factory.addGetterSetter(Node_1.Node, 'contrast', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
69116
69098
 
69099
+ /***/ }),
69100
+
69101
+ /***/ "c7d2":
69102
+ /***/ (function(module, exports, __webpack_require__) {
69103
+
69104
+ // extracted by mini-css-extract-plugin
69105
+
69106
+ /***/ }),
69107
+
69108
+ /***/ "c89b":
69109
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
69110
+
69111
+ "use strict";
69112
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_41b98e1a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8d26");
69113
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_41b98e1a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_41b98e1a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
69114
+ /* unused harmony reexport * */
69115
+
69116
+
69117
69117
  /***/ }),
69118
69118
 
69119
69119
  /***/ "c8ba":
@@ -78634,8 +78634,8 @@ if (typeof window !== 'undefined') {
78634
78634
  // Indicate to webpack that this file can be concatenated
78635
78635
  /* harmony default export */ var setPublicPath = (null);
78636
78636
 
78637
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1a6f8321-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/index.vue?vue&type=template&id=160a92af&scoped=true
78638
- var com_graphicsvue_type_template_id_160a92af_scoped_true_render = function render() {
78637
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3c0d80fb-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/index.vue?vue&type=template&id=27a9d008&scoped=true
78638
+ var com_graphicsvue_type_template_id_27a9d008_scoped_true_render = function render() {
78639
78639
  var _vm = this,
78640
78640
  _c = _vm._self._c;
78641
78641
  return _c('div', {
@@ -78647,7 +78647,7 @@ var com_graphicsvue_type_template_id_160a92af_scoped_true_render = function rend
78647
78647
  };
78648
78648
  var staticRenderFns = [];
78649
78649
 
78650
- // CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=template&id=160a92af&scoped=true
78650
+ // CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=template&id=27a9d008&scoped=true
78651
78651
 
78652
78652
  // CONCATENATED MODULE: ./node_modules/camera-controls/dist/camera-controls.module.js
78653
78653
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
@@ -112489,9 +112489,14 @@ function draw2Dmodel(geom, instanceName, instanceCount, nColor, nOpacity) {
112489
112489
  color = _geom$prop2.color,
112490
112490
  linewidth = _geom$prop2.linewidth;
112491
112491
  var formatLinewidth = (linewidth < 1 ? linewidth * 50 : linewidth) || 5;
112492
+ var meshLineResolution = options.meshLineResolution || {};
112493
+ var resolutionWidth = meshLineResolution.width || window.innerWidth || 1;
112494
+ var resolutionHeight = meshLineResolution.height || window.innerHeight || 1;
112492
112495
  var material = new dist_MeshLineMaterial({
112493
112496
  color: new Color("rgb(".concat(color[0], ", ").concat(color[1], ", ").concat(color[2], ")")),
112494
- lineWidth: formatLinewidth
112497
+ lineWidth: formatLinewidth,
112498
+ resolution: new Vector2(resolutionWidth, resolutionHeight),
112499
+ sizeAttenuation: 0
112495
112500
  });
112496
112501
  var lineGeometry = new dist_MeshLineGeometry();
112497
112502
  lineGeometry.setPoints(geometry);
@@ -121487,7 +121492,7 @@ var LOG_INTERVAL = 30;
121487
121492
 
121488
121493
  var isDebug = false || false === true;
121489
121494
  // const isDebug = false;
121490
- var COLLISION_PENETRATION_EPSILON = 10;
121495
+ var COLLISION_PENETRATION_EPSILON = 1;
121491
121496
  var COLLISION_OBB_AXIS_EPSILON = 1e-8;
121492
121497
  var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
121493
121498
  /* harmony default export */ var com_graphicsvue_type_script_lang_js = ({
@@ -121536,7 +121541,9 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
121536
121541
  isPaused: false
121537
121542
  },
121538
121543
  isolateMode: false,
121539
- collisionObbDebugEnabled: true
121544
+ sceneBoundingBoxDebugEnabled: false,
121545
+ // collisionObbDebugEnabled: isDebug,
121546
+ collisionObbDebugEnabled: false
121540
121547
  };
121541
121548
  },
121542
121549
  watch: {
@@ -121544,6 +121551,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
121544
121551
  if (val) {
121545
121552
  this.detachTransformControls();
121546
121553
  }
121554
+ },
121555
+ sceneBoundingBoxDebugEnabled: function sceneBoundingBoxDebugEnabled(val) {
121556
+ if (val) {
121557
+ this.refreshSceneBoundingBoxHelper(true);
121558
+ } else {
121559
+ this.hideSceneBoundingBox();
121560
+ }
121547
121561
  }
121548
121562
  },
121549
121563
  beforeCreate: function beforeCreate() {
@@ -121640,12 +121654,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
121640
121654
  wheelTimeout: null
121641
121655
  }
121642
121656
  },
121657
+ cameraControlMoveObserver: {
121658
+ enabled: false,
121659
+ interval: 500
121660
+ },
121643
121661
  streamLoader: null,
121644
121662
  // isPerformingInitialCentering: false, // 标记是否正在执行初始居中
121645
121663
  isObserverEnabled: true,
121646
121664
  // 标记相机变更观察者是否启用
121647
121665
  sceneBoxes: new Map(),
121648
121666
  documentModelIds: new Map(),
121667
+ documentSceneBoundsIds: new Map(),
121649
121668
  outlineInstanceProxyMap: new Map(),
121650
121669
  occlusionWorker: null,
121651
121670
  occlusionWorkerRequestMap: new Map(),
@@ -122750,61 +122769,100 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122750
122769
  updateGlobalSceneBoundingBox: function updateGlobalSceneBoundingBox() {
122751
122770
  var state = this.noObserver || {};
122752
122771
  var occScene = state.occlusionState && state.occlusionState._occScene;
122772
+ var mergedBox = new this.THREE.Box3();
122773
+ var hasValidBox = false;
122774
+ var mergeBox = function mergeBox(box) {
122775
+ if (!box || !box.isBox3 || box.isEmpty()) return;
122776
+ if (!hasValidBox) {
122777
+ mergedBox.copy(box);
122778
+ hasValidBox = true;
122779
+ return;
122780
+ }
122781
+ mergedBox.union(box);
122782
+ };
122753
122783
 
122754
- // 优先使用由 boxIndex 构建出的离屏全场景,作为整体居中与 home 的统一范围
122784
+ // 离屏遮挡场景只包含参与遮挡的模型,需要继续合并场景范围索引中的二维图形范围。
122755
122785
  if (occScene && occScene.children && occScene.children.length > 0) {
122756
122786
  var occBox = new this.THREE.Box3().setFromObject(occScene);
122757
- if (!occBox.isEmpty()) {
122758
- this.sceneBoundingBox = occBox;
122759
- return this.sceneBoundingBox;
122760
- }
122787
+ mergeBox(occBox);
122761
122788
  }
122762
122789
 
122763
- // 离屏场景尚未完成时,回退到 boxIndex 联合包围盒,确保每次 add boxIndex 都能更新全场景范围
122764
- if (this._boxIndex && this._boxIndex.size > 0) {
122765
- var minX = Infinity,
122766
- minY = Infinity,
122767
- minZ = Infinity;
122768
- var maxX = -Infinity,
122769
- maxY = -Infinity,
122770
- maxZ = -Infinity;
122771
- this._boxIndex.forEach(function (box) {
122772
- if (!box || !box.isBox3 || box.isEmpty()) return;
122773
- var mn = box.min;
122774
- var mx = box.max;
122775
- if (mn.x < minX) minX = mn.x;
122776
- if (mn.y < minY) minY = mn.y;
122777
- if (mn.z < minZ) minZ = mn.z;
122778
- if (mx.x > maxX) maxX = mx.x;
122779
- if (mx.y > maxY) maxY = mx.y;
122780
- if (mx.z > maxZ) maxZ = mx.z;
122790
+ // sceneBoundsIndex 包含二维和三维图形,是全场景 dolly 距离的主要范围来源。
122791
+ if (this._sceneBoundsIndex && this._sceneBoundsIndex.size > 0) {
122792
+ this._sceneBoundsIndex.forEach(function (box) {
122793
+ mergeBox(box);
122781
122794
  });
122782
- if (Number.isFinite(minX) && Number.isFinite(minY) && Number.isFinite(minZ) && Number.isFinite(maxX) && Number.isFinite(maxY) && Number.isFinite(maxZ)) {
122783
- this.sceneBoundingBox = new this.THREE.Box3(new this.THREE.Vector3(minX, minY, minZ), new this.THREE.Vector3(maxX, maxY, maxZ));
122784
- return this.sceneBoundingBox;
122785
- }
122786
122795
  }
122787
122796
  var boxes = Array.from(state.sceneBoxes && state.sceneBoxes.values() || []);
122788
122797
  if (boxes.length > 0) {
122789
- var firstBox = boxes[0].clone();
122790
- for (var i = 1; i < boxes.length; i++) {
122791
- firstBox.union(boxes[i]);
122798
+ for (var i = 0; i < boxes.length; i++) {
122799
+ mergeBox(boxes[i]);
122792
122800
  }
122793
- this.sceneBoundingBox = firstBox;
122801
+ }
122802
+ if (hasValidBox) {
122803
+ this.sceneBoundingBox = mergedBox;
122804
+ this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
122794
122805
  return this.sceneBoundingBox;
122795
122806
  }
122796
122807
  this.sceneBoundingBox = new this.THREE.Box3();
122808
+ this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
122797
122809
  return this.sceneBoundingBox;
122798
122810
  },
122811
+ upsertIndexedBox: function upsertIndexedBox(indexMap, modelId, box) {
122812
+ if (!indexMap || !modelId || !box || !box.isBox3) return null;
122813
+ var key = String(modelId);
122814
+ var existingBox = indexMap.get(key);
122815
+ if (!existingBox) {
122816
+ indexMap.set(key, box);
122817
+ return box;
122818
+ }
122819
+ existingBox.union(box);
122820
+ return existingBox;
122821
+ },
122822
+ mergeModelBoxUserData: function mergeModelBoxUserData(targetBox, sourceUserData) {
122823
+ if (!targetBox || !sourceUserData) return;
122824
+ if (!targetBox.userData) {
122825
+ targetBox.userData = sourceUserData;
122826
+ return;
122827
+ }
122828
+ var targetUserData = targetBox.userData;
122829
+ targetUserData.visible = targetUserData.visible !== false || sourceUserData.visible !== false;
122830
+ targetUserData.sourceVisible = targetUserData.sourceVisible !== false || sourceUserData.sourceVisible !== false;
122831
+ targetUserData.transparent = !!targetUserData.transparent && !!sourceUserData.transparent;
122832
+ targetUserData.mergedBoxCount = (targetUserData.mergedBoxCount || 1) + 1;
122833
+ // 同一模型包含多个图元时,单个图元的遮挡代理不再可靠,改由视锥体合并盒兜底加载。
122834
+ targetUserData.occlusionEnabled = false;
122835
+ var targetObbs = Array.isArray(targetUserData.collisionObbs) ? targetUserData.collisionObbs : [];
122836
+ var sourceObbs = Array.isArray(sourceUserData.collisionObbs) ? sourceUserData.collisionObbs : [];
122837
+ if (sourceObbs.length > 0) {
122838
+ targetUserData.collisionObbs = targetObbs.concat(sourceObbs);
122839
+ }
122840
+ },
122841
+ upsertModelBox: function upsertModelBox(modelId, box) {
122842
+ if (!this._boxIndex || !modelId || !box || !box.isBox3) return;
122843
+ var key = String(modelId);
122844
+ var existingBox = this._boxIndex.get(key);
122845
+ if (!existingBox) {
122846
+ this._boxIndex.set(key, box);
122847
+ return;
122848
+ }
122849
+ existingBox.union(box);
122850
+ this.mergeModelBoxUserData(existingBox, box.userData);
122851
+ },
122799
122852
  setBoxIndex: function setBoxIndex(boxJson, documentId) {
122800
122853
  var _this0 = this;
122801
122854
  var isAdd = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
122802
122855
  if (!this._boxIndex) this._boxIndex = new Map();
122856
+ if (!this._sceneBoundsIndex) this._sceneBoundsIndex = new Map();
122803
122857
  if (!documentId) {
122804
122858
  this._boxIndex.clear();
122859
+ this._sceneBoundsIndex.clear();
122805
122860
  if (this.noObserver && this.noObserver.documentModelIds) {
122806
122861
  this.noObserver.documentModelIds.clear();
122807
122862
  }
122863
+ if (this.noObserver && this.noObserver.documentSceneBoundsIds) {
122864
+ this.noObserver.documentSceneBoundsIds.clear();
122865
+ }
122808
122866
  this.hasExecutedCentering = false;
122809
122867
  this.buildOctreeFromBoxIndex();
122810
122868
  return;
@@ -122812,19 +122870,25 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122812
122870
  if (isAdd && boxJson) {
122813
122871
  var arr = boxJson ? boxJson : [];
122814
122872
  var modelIds = new Set();
122873
+ var sceneBoundIds = new Set();
122815
122874
  var validGeomTypes = new Set(Object.values(GEOM_TYPES));
122816
122875
  for (var i = 0; i < arr.length; i++) {
122817
122876
  var it = arr[i];
122818
122877
  if (!validGeomTypes.has(it.geomType)) {
122819
122878
  continue;
122820
122879
  }
122821
- if (it.obb.length == 0) {
122880
+ var minSource = it.min;
122881
+ var maxSource = it.max;
122882
+ var hasValidMinMax = minSource && maxSource && minSource.length >= 3 && maxSource.length >= 3 && Number.isFinite(minSource[0]) && Number.isFinite(minSource[1]) && Number.isFinite(minSource[2]) && Number.isFinite(maxSource[0]) && Number.isFinite(maxSource[1]) && Number.isFinite(maxSource[2]);
122883
+ if (!hasValidMinMax) {
122822
122884
  continue;
122823
122885
  }
122886
+ var obbData = it.obb || [];
122887
+ var modelId = String(it.id);
122824
122888
 
122825
122889
  // 使用新的 min/max 数据结构
122826
- var min = new this.THREE.Vector3(it.min[0], it.min[1], it.min[2]);
122827
- var max = new this.THREE.Vector3(it.max[0], it.max[1], it.max[2]);
122890
+ var min = new this.THREE.Vector3(minSource[0], minSource[1], minSource[2]);
122891
+ var max = new this.THREE.Vector3(maxSource[0], maxSource[1], maxSource[2]);
122828
122892
  var sourceBox = new this.THREE.Box3(min.clone(), max.clone());
122829
122893
  // 八叉树仍使用 AABB 粗筛,最终碰撞使用 sourceBox 派生的 OBB 精筛
122830
122894
  var boxThree = sourceBox.clone();
@@ -122854,11 +122918,18 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122854
122918
  collisionMatrix = this.bizToThreeMatrix.clone();
122855
122919
  boxThree.applyMatrix4(collisionMatrix);
122856
122920
  }
122921
+ this.upsertIndexedBox(this._sceneBoundsIndex, modelId, boxThree.clone());
122922
+ sceneBoundIds.add(modelId);
122923
+
122924
+ // 没有 OBB 数据的二维图形只参与全场景范围,不纳入碰撞和遮挡索引。
122925
+ if (obbData.length === 0) {
122926
+ continue;
122927
+ }
122857
122928
  var userData = {
122858
122929
  flag: it.flag || 1,
122859
122930
  // 默认为 1
122860
122931
  geomType: it.geomType,
122861
- obbData: it.obb,
122932
+ obbData: obbData,
122862
122933
  // 存储原始 OBB 数据
122863
122934
  transparent: it.transp > 0,
122864
122935
  sourceVisible: it.visible === false ? false : true,
@@ -122873,8 +122944,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122873
122944
  // userData.matrix = new this.THREE.Matrix4().identity();
122874
122945
  }
122875
122946
  // 如果是 flag=3,解析并存储中心点、半轴长、旋转矩阵
122876
- else if (it.flag === 3 && it.obb && it.obb.length === 15) {
122877
- var obbData = it.obb;
122947
+ else if (it.flag === 3 && obbData.length === 15) {
122878
122948
  var center = new this.THREE.Vector3(obbData[0], obbData[1], obbData[2]);
122879
122949
  var halfSize = new this.THREE.Vector3(obbData[3], obbData[4], obbData[5]);
122880
122950
  var rotation = new this.THREE.Matrix3().fromArray(obbData.slice(6, 15));
@@ -122898,13 +122968,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122898
122968
  userData.collisionObbs = [collisionObb];
122899
122969
  }
122900
122970
  // 如果是 flag=2,解析并存储多个子包围盒 (min, max)
122901
- else if (it.flag === 2 && it.obb && it.obb.length > 0) {
122971
+ else if (it.flag === 2 && obbData.length > 0) {
122902
122972
  var subBoxes = [];
122903
122973
  var collisionObbs = [];
122904
- for (var k = 0; k < it.obb.length; k += 6) {
122905
- if (k + 5 < it.obb.length) {
122906
- var _min = new this.THREE.Vector3(it.obb[k], it.obb[k + 1], it.obb[k + 2]);
122907
- var _max = new this.THREE.Vector3(it.obb[k + 3], it.obb[k + 4], it.obb[k + 5]);
122974
+ for (var k = 0; k < obbData.length; k += 6) {
122975
+ if (k + 5 < obbData.length) {
122976
+ var _min = new this.THREE.Vector3(obbData[k], obbData[k + 1], obbData[k + 2]);
122977
+ var _max = new this.THREE.Vector3(obbData[k + 3], obbData[k + 4], obbData[k + 5]);
122908
122978
  subBoxes.push({
122909
122979
  min: _min,
122910
122980
  max: _max
@@ -122930,11 +123000,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122930
123000
  userData.collisionObbs = [_collisionObb2];
122931
123001
  }
122932
123002
  boxThree.userData = userData;
122933
- var modelId = String(it.id);
122934
- this._boxIndex.set(modelId, boxThree);
123003
+ this.upsertModelBox(modelId, boxThree);
122935
123004
  modelIds.add(modelId);
122936
123005
  }
122937
123006
  this.noObserver.documentModelIds.set(documentId, modelIds);
123007
+ this.noObserver.documentSceneBoundsIds.set(documentId, sceneBoundIds);
122938
123008
  } else {
122939
123009
  var _modelIds = this.noObserver.documentModelIds.get(documentId);
122940
123010
  if (_modelIds) {
@@ -122948,6 +123018,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122948
123018
  this.hasExecutedCentering = false;
122949
123019
  }
122950
123020
  }
123021
+ var _sceneBoundIds = this.noObserver.documentSceneBoundsIds && this.noObserver.documentSceneBoundsIds.get(documentId);
123022
+ if (_sceneBoundIds) {
123023
+ _sceneBoundIds.forEach(function (id) {
123024
+ _this0._sceneBoundsIndex.delete(id);
123025
+ });
123026
+ this.noObserver.documentSceneBoundsIds.delete(documentId);
123027
+ }
122951
123028
  }
122952
123029
  this.buildOctreeFromBoxIndex();
122953
123030
  this.refreshCollisionObbDebug();
@@ -122959,7 +123036,9 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122959
123036
  tryInitialCenterAfterBoundsReady: function tryInitialCenterAfterBoundsReady() {
122960
123037
  if (this.hasExecutedCentering || this.userInteracting) return;
122961
123038
  if (!this.sceneBoundingBox || !this.sceneBoundingBox.isBox3 || this.sceneBoundingBox.isEmpty()) return;
122962
- if (!this._boxIndex || this._boxIndex.size === 0) return;
123039
+ var hasBoxIndex = this._boxIndex && this._boxIndex.size > 0;
123040
+ var hasSceneBoundsIndex = this._sceneBoundsIndex && this._sceneBoundsIndex.size > 0;
123041
+ if (!hasBoxIndex && !hasSceneBoundsIndex) return;
122963
123042
  this.smartModelCenter(this.sceneBoundingBox, 0);
122964
123043
  },
122965
123044
  buildOctreeFromBoxIndex: function buildOctreeFromBoxIndex() {
@@ -123065,6 +123144,45 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123065
123144
  box: box
123066
123145
  });
123067
123146
  },
123147
+ _buildCollisionOctreeFromEntries: function _buildCollisionOctreeFromEntries(entries) {
123148
+ var _this10 = this;
123149
+ if (!Array.isArray(entries) || entries.length === 0) {
123150
+ return null;
123151
+ }
123152
+ var minX = Infinity;
123153
+ var minY = Infinity;
123154
+ var minZ = Infinity;
123155
+ var maxX = -Infinity;
123156
+ var maxY = -Infinity;
123157
+ var maxZ = -Infinity;
123158
+ entries.forEach(function (item) {
123159
+ var box = item && item.box;
123160
+ if (!box || !box.isBox3) return;
123161
+ var mn = box.min;
123162
+ var mx = box.max;
123163
+ if (mn.x < minX) minX = mn.x;
123164
+ if (mn.y < minY) minY = mn.y;
123165
+ if (mn.z < minZ) minZ = mn.z;
123166
+ if (mx.x > maxX) maxX = mx.x;
123167
+ if (mx.y > maxY) maxY = mx.y;
123168
+ if (mx.z > maxZ) maxZ = mx.z;
123169
+ });
123170
+ if (minX === Infinity) {
123171
+ return null;
123172
+ }
123173
+ var rootBox = new this.THREE.Box3(new this.THREE.Vector3(minX, minY, minZ), new this.THREE.Vector3(maxX, maxY, maxZ));
123174
+ var root = {
123175
+ box: rootBox,
123176
+ items: [],
123177
+ children: null,
123178
+ depth: 0
123179
+ };
123180
+ entries.forEach(function (item) {
123181
+ if (!item || !item.box) return;
123182
+ _this10._octreeInsert(root, String(item.id), item.box);
123183
+ });
123184
+ return root;
123185
+ },
123068
123186
  _isCollisionBoxAvailable: function _isCollisionBoxAvailable(box) {
123069
123187
  if (!box || !box.isBox3 || box.isEmpty()) return false;
123070
123188
  if (box.userData && box.userData.visible === false) return false;
@@ -123189,7 +123307,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123189
123307
  return pairMap;
123190
123308
  },
123191
123309
  refreshCollisionObbDebug: function refreshCollisionObbDebug() {
123192
- var _this10 = this;
123310
+ var _this11 = this;
123193
123311
  if (!this.collisionObbDebugEnabled) return;
123194
123312
  var group = this._getCollisionDebugGroup();
123195
123313
  if (!group) return;
@@ -123197,14 +123315,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123197
123315
  var pairMap = this._buildCollisionPairMap();
123198
123316
  if (pairMap.size === 0) return;
123199
123317
  pairMap.forEach(function (relatedIds, modelId) {
123200
- var box = _this10._boxIndex && _this10._boxIndex.has(String(modelId)) ? _this10._boxIndex.get(String(modelId)) : _this10._boxIndex && _this10._boxIndex.has(modelId) ? _this10._boxIndex.get(modelId) : null;
123201
- if (!_this10._isCollisionBoxAvailable(box)) return;
123202
- var obbs = _this10._getCollisionObbs(box);
123318
+ var box = _this11._boxIndex && _this11._boxIndex.has(String(modelId)) ? _this11._boxIndex.get(String(modelId)) : _this11._boxIndex && _this11._boxIndex.has(modelId) ? _this11._boxIndex.get(modelId) : null;
123319
+ if (!_this11._isCollisionBoxAvailable(box)) return;
123320
+ var obbs = _this11._getCollisionObbs(box);
123203
123321
  if (!obbs.length) return;
123204
123322
  var isColliding = relatedIds && relatedIds.size > 0;
123205
123323
  var color = isColliding ? 0xff3b30 : 0x36cfc9;
123206
123324
  for (var i = 0; i < obbs.length; i++) {
123207
- var lineSegments = _this10._createCollisionObbLineSegments(obbs[i], color);
123325
+ var lineSegments = _this11._createCollisionObbLineSegments(obbs[i], color);
123208
123326
  if (!lineSegments) continue;
123209
123327
  lineSegments.name = "".concat(COLLISION_DEBUG_GROUP_NAME, ":").concat(modelId, ":").concat(i);
123210
123328
  lineSegments.userData.modelId = modelId;
@@ -123240,7 +123358,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123240
123358
  return axisInfo.halfSizes[0] * Math.abs(axis.dot(axisInfo.axes[0])) + axisInfo.halfSizes[1] * Math.abs(axis.dot(axisInfo.axes[1])) + axisInfo.halfSizes[2] * Math.abs(axis.dot(axisInfo.axes[2]));
123241
123359
  },
123242
123360
  _getObbMinPenetration: function _getObbMinPenetration(obbA, obbB) {
123243
- var _this11 = this;
123361
+ var _this12 = this;
123244
123362
  var axisInfoA = this._getObbAxisInfo(obbA);
123245
123363
  var axisInfoB = this._getObbAxisInfo(obbB);
123246
123364
  var centerDelta = new this.THREE.Vector3().subVectors(axisInfoB.center, axisInfoA.center);
@@ -123250,7 +123368,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123250
123368
  if (lengthSq <= COLLISION_OBB_AXIS_EPSILON) return true;
123251
123369
  var normalizedAxis = axis.clone().multiplyScalar(1 / Math.sqrt(lengthSq));
123252
123370
  var projectionDistance = Math.abs(centerDelta.dot(normalizedAxis));
123253
- var penetration = _this11._getObbProjectionRadius(axisInfoA, normalizedAxis) + _this11._getObbProjectionRadius(axisInfoB, normalizedAxis) - projectionDistance;
123371
+ var penetration = _this12._getObbProjectionRadius(axisInfoA, normalizedAxis) + _this12._getObbProjectionRadius(axisInfoB, normalizedAxis) - projectionDistance;
123254
123372
  if (penetration <= 0) {
123255
123373
  minPenetration = penetration;
123256
123374
  return false;
@@ -123288,9 +123406,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123288
123406
  }
123289
123407
  return false;
123290
123408
  },
123291
- _queryOctreeByBox: function _queryOctreeByBox(box) {
123409
+ _queryOctreeByBoxWithRoot: function _queryOctreeByBoxWithRoot(root, box) {
123292
123410
  var results = [];
123293
- var root = this._octree;
123294
123411
  if (!root || !this._isCollisionBoxAvailable(box)) return results;
123295
123412
  var stack = [root];
123296
123413
  while (stack.length) {
@@ -123312,29 +123429,95 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123312
123429
  }
123313
123430
  return results;
123314
123431
  },
123432
+ _queryOctreeByBox: function _queryOctreeByBox(box) {
123433
+ return this._queryOctreeByBoxWithRoot(this._octree, box);
123434
+ },
123315
123435
  getOctreeCollisionPairs: function getOctreeCollisionPairs() {
123316
- var _this12 = this;
123436
+ var _this13 = this;
123437
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
123317
123438
  var pairs = [];
123318
123439
  if (!this._boxIndex || this._boxIndex.size === 0) return {
123319
123440
  pairs: pairs
123320
123441
  };
123321
- if (!this._octree) {
123322
- this.buildOctreeFromBoxIndex();
123323
- }
123324
- if (!this._octree) return {
123325
- pairs: pairs
123442
+ var normalizeIds = function normalizeIds(value) {
123443
+ return Array.isArray(value) ? Array.from(new Set(value.map(function (item) {
123444
+ return item === null || item === undefined ? '' : String(item);
123445
+ }).filter(function (item) {
123446
+ return item !== '';
123447
+ }))) : [];
123326
123448
  };
123327
- this._boxIndex.forEach(function (boxA, idA) {
123328
- if (!_this12._isCollisionBoxAvailable(boxA)) return;
123329
- var hits = _this12._queryOctreeByBox(boxA);
123449
+ var getEntriesByIds = function getEntriesByIds(ids) {
123450
+ var entries = [];
123451
+ var idSet = new Set(ids);
123452
+ _this13._boxIndex.forEach(function (box, id) {
123453
+ var key = String(id);
123454
+ if (idSet.has(key)) {
123455
+ entries.push({
123456
+ id: key,
123457
+ box: box
123458
+ });
123459
+ }
123460
+ });
123461
+ return entries;
123462
+ };
123463
+ var sourceIds = normalizeIds(options.sourceIds);
123464
+ var targetIds = normalizeIds(options.targetIds);
123465
+ var includeIds = Array.isArray(options.includeIds) ? normalizeIds(options.includeIds) : [];
123466
+ var root = this._octree;
123467
+ var sourceEntries = [];
123468
+ var dedupePairKeySet = null;
123469
+ if (sourceIds.length > 0 && targetIds.length > 0) {
123470
+ var targetEntries = getEntriesByIds(targetIds);
123471
+ sourceEntries = getEntriesByIds(sourceIds);
123472
+ if (sourceEntries.length === 0 || targetEntries.length === 0) return {
123473
+ pairs: pairs
123474
+ };
123475
+ root = this._buildCollisionOctreeFromEntries(targetEntries);
123476
+ if (!root) return {
123477
+ pairs: pairs
123478
+ };
123479
+ dedupePairKeySet = new Set();
123480
+ } else if (includeIds.length > 0) {
123481
+ sourceEntries = getEntriesByIds(includeIds);
123482
+ if (sourceEntries.length === 0) return {
123483
+ pairs: pairs
123484
+ };
123485
+ root = this._buildCollisionOctreeFromEntries(sourceEntries);
123486
+ if (!root) return {
123487
+ pairs: pairs
123488
+ };
123489
+ } else {
123490
+ if (!this._octree) {
123491
+ this.buildOctreeFromBoxIndex();
123492
+ }
123493
+ if (!this._octree) return {
123494
+ pairs: pairs
123495
+ };
123496
+ this._boxIndex.forEach(function (box, id) {
123497
+ sourceEntries.push({
123498
+ id: String(id),
123499
+ box: box
123500
+ });
123501
+ });
123502
+ }
123503
+ sourceEntries.forEach(function (_ref) {
123504
+ var idA = _ref.id,
123505
+ boxA = _ref.box;
123506
+ if (!_this13._isCollisionBoxAvailable(boxA)) return;
123507
+ var hits = _this13._queryOctreeByBoxWithRoot(root, boxA);
123330
123508
  for (var i = 0; i < hits.length; i++) {
123331
123509
  var item = hits[i];
123332
123510
  if (!item || String(item.id) === String(idA)) continue;
123333
123511
  var boxB = item.box;
123334
- if (!_this12._isCollisionBoxMatched(boxA, boxB)) continue;
123512
+ if (!_this13._isCollisionBoxMatched(boxA, boxB)) continue;
123513
+ if (dedupePairKeySet) {
123514
+ var pairKey = "".concat(String(idA), "__").concat(String(item.id));
123515
+ if (dedupePairKeySet.has(pairKey)) continue;
123516
+ dedupePairKeySet.add(pairKey);
123517
+ }
123335
123518
  pairs.push({
123336
- idA: _this12._formatCollisionPairId(idA),
123337
- idB: _this12._formatCollisionPairId(item.id)
123519
+ idA: _this13._formatCollisionPairId(idA),
123520
+ idB: _this13._formatCollisionPairId(item.id)
123338
123521
  });
123339
123522
  }
123340
123523
  });
@@ -123471,7 +123654,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123471
123654
  * @returns {Object|null} { planeBox: THREE.Box3|null, frustumBox: THREE.Box3, frustumY: {min, max} } 或 null(当没有平面交点且未请求 frustumY)
123472
123655
  */
123473
123656
  getScreenPlaneBounds: function getScreenPlaneBounds(camera, width, height, plane) {
123474
- var _this13 = this;
123657
+ var _this14 = this;
123475
123658
  var opts = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
123476
123659
  var _opts$includeFrustumY = opts.includeFrustumY,
123477
123660
  includeFrustumY = _opts$includeFrustumY === void 0 ? false : _opts$includeFrustumY;
@@ -123516,7 +123699,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123516
123699
  var volumeCorners = nearCorners.concat(farCorners);
123517
123700
  var projectedPoints = volumeCorners.map(function (p) {
123518
123701
  var yProj = -(a * p.x + c * p.z + d) / b;
123519
- return new _this13.THREE.Vector3(p.x, yProj, p.z);
123702
+ return new _this14.THREE.Vector3(p.x, yProj, p.z);
123520
123703
  });
123521
123704
  planeBox = new this.THREE.Box3().setFromPoints(projectedPoints);
123522
123705
  }
@@ -123746,14 +123929,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123746
123929
  * 执行视椎体裁切,清理视椎体外的InstancedMesh实例
123747
123930
  */
123748
123931
  performFrustumCulling: function performFrustumCulling() {
123749
- var _this14 = this;
123932
+ var _arguments = arguments,
123933
+ _this15 = this;
123750
123934
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee3() {
123751
- var modelState, now, globalFrustum, globalVpMatrix, toUnload, bypassList, visibleIds, candidates, visibleIdSet, frustum, exclude, hits, i, occlusionState, occlusionEnabled, state, w, h, aspectRatio, sw, sh, rt, t0, opaqueCandidates, transparentCandidates, _i5, totalInstances, transparentTotal, activeIdIndexArr, transparentIdIndexArr, occObjs, asyncBuildEnabled, _occBuild, asyncState, token, opaqueSnapshot, transparentMesh, transparentCapacity, nextCap, geometry, material, tempMatrix, tempScale, tempObj, tempColor, tIdx, _i0, c, idx, r, g, b, _c$box$userData$obb, matrix, halfSize, tMaxIdx, prevToneMapping, prevTarget, prevClearColorHex, prevClearAlpha, _c3, cvs, cssW, cssH, dst, src, row, srcRow, dstRow, idIndexArr, maxIdx, totalPixels, targetSamples, baseStride, extraStride, stride, minSampleCount, scanResult, indices, _i1, id, transparentMaxIdx, tIdIndexArr, tScanResult, tIndices, _i10, _id, _i11, _i12, toLoadSet, parentsToCheck, _i15, _toUnload, _toUnload$_i, modelId, child, _t2;
123935
+ var options, skipUnload, modelState, now, globalFrustum, globalVpMatrix, toUnload, bypassList, visibleIds, candidates, visibleIdSet, frustum, exclude, hits, i, occlusionState, occlusionEnabled, state, w, h, aspectRatio, sw, sh, rt, t0, opaqueCandidates, transparentCandidates, _i5, totalInstances, transparentTotal, activeIdIndexArr, transparentIdIndexArr, occObjs, asyncBuildEnabled, _occBuild, asyncState, token, opaqueSnapshot, transparentMesh, transparentCapacity, nextCap, geometry, material, tempMatrix, tempScale, tempObj, tempColor, tIdx, _i0, c, idx, r, g, b, _c$box$userData$obb, matrix, halfSize, tMaxIdx, prevToneMapping, prevTarget, prevClearColorHex, prevClearAlpha, _c3, cvs, cssW, cssH, dst, src, row, srcRow, dstRow, idIndexArr, maxIdx, totalPixels, targetSamples, baseStride, extraStride, stride, minSampleCount, scanResult, indices, _i1, id, transparentMaxIdx, tIdIndexArr, tScanResult, tIndices, _i10, _id, _i11, _i12, toLoadSet, parentsToCheck, _i15, _toUnload, _toUnload$_i, modelId, child, _t2;
123752
123936
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context3) {
123753
123937
  while (1) switch (_context3.p = _context3.n) {
123754
123938
  case 0:
123755
- modelState = _this14.noObserver ? _this14.noObserver.modelStateManager : _this14.modelStateManager;
123756
- if (!(!_this14.modelStateManager.frustumCheckEnabled || !_this14.scene)) {
123939
+ options = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : {};
123940
+ skipUnload = !!(options && options.skipUnload);
123941
+ modelState = _this15.noObserver ? _this15.noObserver.modelStateManager : _this15.modelStateManager;
123942
+ if (!(!_this15.modelStateManager.frustumCheckEnabled || !_this15.scene)) {
123757
123943
  _context3.n = 1;
123758
123944
  break;
123759
123945
  }
@@ -123769,10 +123955,10 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123769
123955
  modelState.lastCullingTime = now;
123770
123956
 
123771
123957
  // 预先创建视椎体,供后续遍历复用
123772
- if (!_this14._frustum) _this14._frustum = new _this14.THREE.Frustum();
123773
- if (!_this14._vpMatrix) _this14._vpMatrix = new _this14.THREE.Matrix4();
123774
- globalFrustum = _this14._frustum;
123775
- globalVpMatrix = _this14._vpMatrix.multiplyMatrices(_this14.camera.projectionMatrix, _this14.camera.matrixWorldInverse);
123958
+ if (!_this15._frustum) _this15._frustum = new _this15.THREE.Frustum();
123959
+ if (!_this15._vpMatrix) _this15._vpMatrix = new _this15.THREE.Matrix4();
123960
+ globalFrustum = _this15._frustum;
123961
+ globalVpMatrix = _this15._vpMatrix.multiplyMatrices(_this15.camera.projectionMatrix, _this15.camera.matrixWorldInverse);
123776
123962
  globalFrustum.setFromProjectionMatrix(globalVpMatrix);
123777
123963
 
123778
123964
  // 使用局部变量收集 ID,最后一次性赋值
@@ -123786,13 +123972,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123786
123972
  });
123787
123973
  }
123788
123974
  visibleIdSet = new Set(visibleIds);
123789
- if (!_this14._octree) {
123975
+ if (!_this15._octree) {
123790
123976
  _context3.n = 8;
123791
123977
  break;
123792
123978
  }
123793
- frustum = _this14._getCurrentFrustum();
123979
+ frustum = _this15._getCurrentFrustum();
123794
123980
  exclude = bypassList || new Set();
123795
- hits = _this14.queryOctreeByFrustum(frustum, exclude);
123981
+ hits = _this15.queryOctreeByFrustum(frustum, exclude);
123796
123982
  i = 0;
123797
123983
  case 3:
123798
123984
  if (!(i < hits.length)) {
@@ -123805,11 +123991,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123805
123991
  }
123806
123992
  return _context3.a(3, 6);
123807
123993
  case 4:
123808
- if (_this14.shouldApplyOcclusionByBox(hits[i].box)) {
123994
+ if (_this15.shouldApplyOcclusionByBox(hits[i].box)) {
123809
123995
  _context3.n = 5;
123810
123996
  break;
123811
123997
  }
123812
- visibleIdSet.add(_this14.formatModelId(hits[i].modelId));
123998
+ visibleIdSet.add(_this15.formatModelId(hits[i].modelId));
123813
123999
  return _context3.a(3, 6);
123814
124000
  case 5:
123815
124001
  candidates.push(hits[i]);
@@ -123821,13 +124007,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123821
124007
  _context3.n = 9;
123822
124008
  break;
123823
124009
  case 8:
123824
- if (_this14._boxIndex && _this14._boxIndex.size > 0) {
123825
- _this14._boxIndex.forEach(function (box, modelId) {
124010
+ if (_this15._boxIndex && _this15._boxIndex.size > 0) {
124011
+ _this15._boxIndex.forEach(function (box, modelId) {
123826
124012
  if (bypassList && bypassList.size > 0 && bypassList.has(modelId)) return;
123827
124013
  if (box.userData && box.userData.visible === false) return;
123828
- if (_this14.isBoxInFrustum(box)) {
123829
- if (!_this14.shouldApplyOcclusionByBox(box)) {
123830
- visibleIdSet.add(_this14.formatModelId(modelId));
124014
+ if (_this15.isBoxInFrustum(box)) {
124015
+ if (!_this15.shouldApplyOcclusionByBox(box)) {
124016
+ visibleIdSet.add(_this15.formatModelId(modelId));
123831
124017
  return;
123832
124018
  }
123833
124019
  candidates.push({
@@ -123838,18 +124024,18 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123838
124024
  });
123839
124025
  }
123840
124026
  case 9:
123841
- occlusionState = _this14.noObserver ? _this14.noObserver.occlusionState : _this14.occlusionState; // 从响应式对象获取开关状态
123842
- occlusionEnabled = _this14.occlusionState && _this14.occlusionState.enabled;
124027
+ occlusionState = _this15.noObserver ? _this15.noObserver.occlusionState : _this15.occlusionState; // 从响应式对象获取开关状态
124028
+ occlusionEnabled = _this15.occlusionState && _this15.occlusionState.enabled;
123843
124029
  if (!occlusionEnabled) {
123844
124030
  _context3.n = 16;
123845
124031
  break;
123846
124032
  }
123847
124033
  state = occlusionState;
123848
- w = _this14.renderer && _this14.renderer.domElement ? _this14.renderer.domElement.clientWidth || _this14.renderer.domElement.width || 0 : 0;
123849
- h = _this14.renderer && _this14.renderer.domElement ? _this14.renderer.domElement.clientHeight || _this14.renderer.domElement.height || 0 : 0; // bufferWidth/Height 仍从响应式对象读取以支持动态修改
124034
+ w = _this15.renderer && _this15.renderer.domElement ? _this15.renderer.domElement.clientWidth || _this15.renderer.domElement.width || 0 : 0;
124035
+ h = _this15.renderer && _this15.renderer.domElement ? _this15.renderer.domElement.clientHeight || _this15.renderer.domElement.height || 0 : 0; // bufferWidth/Height 仍从响应式对象读取以支持动态修改
123850
124036
  // 性能优化:使用降采样缓冲区进行遮挡剔除,大幅减少 readPixels 耗时 (从全屏降至约 256px 宽)
123851
124037
  aspectRatio = h > 0 ? w / h : 1;
123852
- sw = _this14.occlusionState.bufferWidth || 256;
124038
+ sw = _this15.occlusionState.bufferWidth || 256;
123853
124039
  sh = Math.floor(sw / aspectRatio);
123854
124040
  sw = Math.max(1, sw);
123855
124041
  sh = Math.max(1, sh);
@@ -123858,16 +124044,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123858
124044
  _context3.p = 10;
123859
124045
  if (!rt || state._rtW !== sw || state._rtH !== sh) {
123860
124046
  if (rt && typeof rt.dispose === 'function') rt.dispose();
123861
- rt = new _this14.THREE.WebGLRenderTarget(sw, sh, {
124047
+ rt = new _this15.THREE.WebGLRenderTarget(sw, sh, {
123862
124048
  depthBuffer: true,
123863
124049
  stencilBuffer: false,
123864
124050
  samples: 0
123865
124051
  });
123866
- rt.texture.minFilter = _this14.THREE.NearestFilter;
123867
- rt.texture.magFilter = _this14.THREE.NearestFilter;
124052
+ rt.texture.minFilter = _this15.THREE.NearestFilter;
124053
+ rt.texture.magFilter = _this15.THREE.NearestFilter;
123868
124054
  rt.texture.generateMipmaps = false;
123869
- rt.texture.type = _this14.THREE.UnsignedByteType;
123870
- rt.texture.format = _this14.THREE.RGBAFormat;
124055
+ rt.texture.type = _this15.THREE.UnsignedByteType;
124056
+ rt.texture.format = _this15.THREE.RGBAFormat;
123871
124057
  rt.samples = 0;
123872
124058
  state._colorRT = rt;
123873
124059
  state._rtW = sw;
@@ -123876,7 +124062,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123876
124062
  } else if (!state._colorBuffer || state._colorBuffer.length !== sw * sh * 4) {
123877
124063
  state._colorBuffer = new Uint8Array(sw * sh * 4);
123878
124064
  }
123879
- if (!state._occScene) state._occScene = new _this14.THREE.Scene();
124065
+ if (!state._occScene) state._occScene = new _this15.THREE.Scene();
123880
124066
  // if (!state._occPerfStats) state._occPerfStats = Object.create(null);
123881
124067
  // const _occRecordPerf = (name, ms, meta) => {
123882
124068
  // const this.stats = state._occPerfStats;
@@ -123925,7 +124111,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123925
124111
  // child.parent = null;
123926
124112
  // // child.dispatchEvent({ type: 'removed' }); // 保持轻量,暂不触发事件
123927
124113
  // }
123928
- asyncBuildEnabled = _this14.occlusionState && _this14.occlusionState.asyncBuildEnabled && !!window.requestAnimationFrame;
124114
+ asyncBuildEnabled = _this15.occlusionState && _this15.occlusionState.asyncBuildEnabled && !!window.requestAnimationFrame;
123929
124115
  _occBuild = function _occBuild(opaqueList) {
123930
124116
  var tBuild0 = performance.now();
123931
124117
  var flag1Items = [];
@@ -123936,7 +124122,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123936
124122
  var obbData = c.box && c.box.userData ? c.box.userData.obbData : null;
123937
124123
  if (!obbData || !obbData.length) continue;
123938
124124
  var idx = globalIdx++;
123939
- activeIdIndexArr[idx] = _this14.formatModelId(c.modelId);
124125
+ activeIdIndexArr[idx] = _this15.formatModelId(c.modelId);
123940
124126
  var flag = c.box.userData && c.box.userData.flag || 1;
123941
124127
  if (flag === 3 && c.box.userData && c.box.userData.obb) {
123942
124128
  flag3Items.push({
@@ -123952,11 +124138,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123952
124138
  }
123953
124139
  var maxIdx = globalIdx - 1;
123954
124140
  activeIdIndexArr.length = maxIdx + 1;
123955
- var _tempMatrix = occObjs._tempMatrix || (occObjs._tempMatrix = new _this14.THREE.Matrix4());
123956
- var _tempColor = occObjs._tempColor || (occObjs._tempColor = new _this14.THREE.Color());
123957
- var _tempScale = occObjs._tempScale || (occObjs._tempScale = new _this14.THREE.Vector3());
123958
- var _tempVec3 = occObjs._tempVec3 || (occObjs._tempVec3 = new _this14.THREE.Vector3());
123959
- var _tempMatA = occObjs._tempMatA || (occObjs._tempMatA = new _this14.THREE.Matrix4());
124141
+ var _tempMatrix = occObjs._tempMatrix || (occObjs._tempMatrix = new _this15.THREE.Matrix4());
124142
+ var _tempColor = occObjs._tempColor || (occObjs._tempColor = new _this15.THREE.Color());
124143
+ var _tempScale = occObjs._tempScale || (occObjs._tempScale = new _this15.THREE.Vector3());
124144
+ var _tempVec3 = occObjs._tempVec3 || (occObjs._tempVec3 = new _this15.THREE.Vector3());
124145
+ var _tempMatA = occObjs._tempMatA || (occObjs._tempMatA = new _this15.THREE.Matrix4());
123960
124146
  var boxes = occObjs.boxes;
123961
124147
  var boxCount = flag3Items.length;
123962
124148
  if (boxCount > 0) {
@@ -123969,16 +124155,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123969
124155
  if (boxes.mesh.material) boxes.mesh.material.dispose();
123970
124156
  }
123971
124157
  var nextCap = Math.max(needCapacity, capacity > 0 ? capacity * 2 : 256);
123972
- var geometry = new _this14.THREE.BoxGeometry(1, 1, 1);
123973
- var mat = new _this14.THREE.MeshBasicMaterial({
124158
+ var geometry = new _this15.THREE.BoxGeometry(1, 1, 1);
124159
+ var mat = new _this15.THREE.MeshBasicMaterial({
123974
124160
  color: 0xffffff,
123975
- side: _this14.THREE.DoubleSide,
123976
- blending: _this14.THREE.NoBlending,
124161
+ side: _this15.THREE.DoubleSide,
124162
+ blending: _this15.THREE.NoBlending,
123977
124163
  depthTest: true,
123978
124164
  depthWrite: true,
123979
124165
  toneMapped: false
123980
124166
  });
123981
- var mesh = new _this14.THREE.InstancedMesh(geometry, mat, nextCap);
124167
+ var mesh = new _this15.THREE.InstancedMesh(geometry, mat, nextCap);
123982
124168
  mesh.frustumCulled = false;
123983
124169
  mesh.matrixAutoUpdate = false;
123984
124170
  state._occScene.add(mesh);
@@ -124003,8 +124189,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124003
124189
  _tempScale.copy(halfSize).multiplyScalar(2);
124004
124190
  _tempMatrix.copy(matrix);
124005
124191
  _tempMatrix.scale(_tempScale);
124006
- if (typeof _this14.bizToThreeMatrix !== 'undefined' && _this14.bizToThreeMatrix) {
124007
- _tempMatrix.premultiply(_this14.bizToThreeMatrix);
124192
+ if (typeof _this15.bizToThreeMatrix !== 'undefined' && _this15.bizToThreeMatrix) {
124193
+ _tempMatrix.premultiply(_this15.bizToThreeMatrix);
124008
124194
  }
124009
124195
  boxes.mesh.setMatrixAt(_i7, _tempMatrix);
124010
124196
  boxes.mesh.setColorAt(_i7, _tempColor);
@@ -124033,16 +124219,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124033
124219
  var needIdx = totalIdx;
124034
124220
  var ensureBatch1 = function ensureBatch1() {
124035
124221
  if (batch1 && batch1.mesh && batch1.geometry && batch1.material) return;
124036
- var geometry = new _this14.THREE.BufferGeometry();
124037
- var material = new _this14.THREE.MeshBasicMaterial({
124222
+ var geometry = new _this15.THREE.BufferGeometry();
124223
+ var material = new _this15.THREE.MeshBasicMaterial({
124038
124224
  vertexColors: true,
124039
- side: _this14.THREE.DoubleSide,
124040
- blending: _this14.THREE.NoBlending,
124225
+ side: _this15.THREE.DoubleSide,
124226
+ blending: _this15.THREE.NoBlending,
124041
124227
  depthTest: true,
124042
124228
  depthWrite: true,
124043
124229
  toneMapped: false
124044
124230
  });
124045
- var mesh = new _this14.THREE.Mesh(geometry, material);
124231
+ var mesh = new _this15.THREE.Mesh(geometry, material);
124046
124232
  mesh.frustumCulled = false;
124047
124233
  batch1 = occObjs.batch1 = {
124048
124234
  mesh: mesh,
@@ -124066,14 +124252,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124066
124252
  batch1.positions = _positions;
124067
124253
  batch1.colors = _colors;
124068
124254
  batch1.indices = _indices2;
124069
- var _posAttr = new _this14.THREE.BufferAttribute(_positions, 3);
124070
- var _colAttr = new _this14.THREE.BufferAttribute(_colors, 3);
124071
- _posAttr.setUsage(_this14.THREE.DynamicDrawUsage);
124072
- _colAttr.setUsage(_this14.THREE.DynamicDrawUsage);
124255
+ var _posAttr = new _this15.THREE.BufferAttribute(_positions, 3);
124256
+ var _colAttr = new _this15.THREE.BufferAttribute(_colors, 3);
124257
+ _posAttr.setUsage(_this15.THREE.DynamicDrawUsage);
124258
+ _colAttr.setUsage(_this15.THREE.DynamicDrawUsage);
124073
124259
  batch1.geometry.setAttribute('position', _posAttr);
124074
124260
  batch1.geometry.setAttribute('color', _colAttr);
124075
- var _idxAttr = new _this14.THREE.BufferAttribute(_indices2, 1);
124076
- _idxAttr.setUsage(_this14.THREE.DynamicDrawUsage);
124261
+ var _idxAttr = new _this15.THREE.BufferAttribute(_indices2, 1);
124262
+ _idxAttr.setUsage(_this15.THREE.DynamicDrawUsage);
124077
124263
  batch1.geometry.setIndex(_idxAttr);
124078
124264
  }
124079
124265
  var positions = batch1.positions;
@@ -124093,15 +124279,15 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124093
124279
  var _g = (_idx2 >> 8 & 255) / 255;
124094
124280
  var _b = (_idx2 >> 16 & 255) / 255;
124095
124281
  var vertexCount = _obbData2.length / 3 | 0;
124096
- var needTransform = matrixArr && matrixArr.length >= 16 || typeof _this14.bizToThreeMatrix !== 'undefined' && _this14.bizToThreeMatrix;
124282
+ var needTransform = matrixArr && matrixArr.length >= 16 || typeof _this15.bizToThreeMatrix !== 'undefined' && _this15.bizToThreeMatrix;
124097
124283
  if (needTransform) {
124098
124284
  if (matrixArr && matrixArr.length >= 16) {
124099
124285
  _tempMatA.fromArray(matrixArr);
124100
124286
  } else {
124101
124287
  _tempMatA.identity();
124102
124288
  }
124103
- if (typeof _this14.bizToThreeMatrix !== 'undefined' && _this14.bizToThreeMatrix) {
124104
- _tempMatA.premultiply(_this14.bizToThreeMatrix);
124289
+ if (typeof _this15.bizToThreeMatrix !== 'undefined' && _this15.bizToThreeMatrix) {
124290
+ _tempMatA.premultiply(_this15.bizToThreeMatrix);
124105
124291
  }
124106
124292
  }
124107
124293
  if (!needTransform && ArrayBuffer.isView(_obbData2)) {
@@ -124201,7 +124387,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124201
124387
  state._occMaxIdx = 0;
124202
124388
  activeIdIndexArr.length = 0;
124203
124389
  }
124204
- if (!state._occTransparentScene) state._occTransparentScene = new _this14.THREE.Scene();
124390
+ if (!state._occTransparentScene) state._occTransparentScene = new _this15.THREE.Scene();
124205
124391
  transparentMesh = state._occTransparentMesh;
124206
124392
  transparentCapacity = transparentMesh && transparentMesh.userData && typeof transparentMesh.userData.capacity === 'number' ? transparentMesh.userData.capacity : 0;
124207
124393
  if (!transparentMesh || transparentCapacity < transparentTotal) {
@@ -124211,16 +124397,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124211
124397
  state._occTransparentScene.remove(transparentMesh);
124212
124398
  }
124213
124399
  nextCap = Math.max(transparentTotal, transparentCapacity > 0 ? transparentCapacity * 2 : 256);
124214
- geometry = new _this14.THREE.BoxGeometry(1, 1, 1);
124215
- material = new _this14.THREE.MeshBasicMaterial({
124400
+ geometry = new _this15.THREE.BoxGeometry(1, 1, 1);
124401
+ material = new _this15.THREE.MeshBasicMaterial({
124216
124402
  color: 0xffffff,
124217
- side: _this14.THREE.DoubleSide,
124218
- blending: _this14.THREE.NoBlending,
124403
+ side: _this15.THREE.DoubleSide,
124404
+ blending: _this15.THREE.NoBlending,
124219
124405
  depthTest: true,
124220
124406
  depthWrite: false,
124221
124407
  toneMapped: false
124222
124408
  });
124223
- transparentMesh = new _this14.THREE.InstancedMesh(geometry, material, nextCap);
124409
+ transparentMesh = new _this15.THREE.InstancedMesh(geometry, material, nextCap);
124224
124410
  transparentMesh.frustumCulled = false;
124225
124411
  transparentMesh.matrixAutoUpdate = false;
124226
124412
  transparentMesh.userData.capacity = nextCap;
@@ -124230,15 +124416,15 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124230
124416
  state._occTransparentScene.add(transparentMesh);
124231
124417
  }
124232
124418
  if (transparentTotal > 0) {
124233
- tempMatrix = new _this14.THREE.Matrix4();
124234
- tempScale = new _this14.THREE.Vector3();
124235
- tempObj = new _this14.THREE.Object3D();
124236
- tempColor = new _this14.THREE.Color();
124419
+ tempMatrix = new _this15.THREE.Matrix4();
124420
+ tempScale = new _this15.THREE.Vector3();
124421
+ tempObj = new _this15.THREE.Object3D();
124422
+ tempColor = new _this15.THREE.Color();
124237
124423
  tIdx = 1;
124238
124424
  for (_i0 = 0; _i0 < transparentTotal; _i0++) {
124239
124425
  c = transparentCandidates[_i0];
124240
124426
  idx = tIdx++;
124241
- transparentIdIndexArr[idx] = _this14.formatModelId(c.modelId);
124427
+ transparentIdIndexArr[idx] = _this15.formatModelId(c.modelId);
124242
124428
  r = (idx & 255) / 255;
124243
124429
  g = (idx >> 8 & 255) / 255;
124244
124430
  b = (idx >> 16 & 255) / 255;
@@ -124248,8 +124434,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124248
124434
  tempMatrix.copy(matrix);
124249
124435
  tempScale.copy(halfSize).multiplyScalar(2);
124250
124436
  tempMatrix.scale(tempScale);
124251
- if (typeof _this14.bizToThreeMatrix !== 'undefined' && _this14.bizToThreeMatrix) {
124252
- tempMatrix.premultiply(_this14.bizToThreeMatrix);
124437
+ if (typeof _this15.bizToThreeMatrix !== 'undefined' && _this15.bizToThreeMatrix) {
124438
+ tempMatrix.premultiply(_this15.bizToThreeMatrix);
124253
124439
  }
124254
124440
  } else {
124255
124441
  c.box.getSize(tempScale);
@@ -124277,28 +124463,28 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124277
124463
  }
124278
124464
 
124279
124465
  // console.log('this.renderer', this.renderer)
124280
- prevToneMapping = _this14.renderer.toneMapping;
124281
- prevTarget = _this14.renderer.getRenderTarget ? _this14.renderer.getRenderTarget() : null;
124466
+ prevToneMapping = _this15.renderer.toneMapping;
124467
+ prevTarget = _this15.renderer.getRenderTarget ? _this15.renderer.getRenderTarget() : null;
124282
124468
  prevClearColorHex = 0x000000;
124283
124469
  prevClearAlpha = 0;
124284
124470
  try {
124285
- _c3 = _this14.renderer.getClearColor ? _this14.renderer.getClearColor() : null;
124471
+ _c3 = _this15.renderer.getClearColor ? _this15.renderer.getClearColor() : null;
124286
124472
  if (_c3 && _c3.isColor) prevClearColorHex = _c3.getHex();
124287
- prevClearAlpha = typeof _this14.renderer.getClearAlpha === 'function' ? _this14.renderer.getClearAlpha() : 0;
124473
+ prevClearAlpha = typeof _this15.renderer.getClearAlpha === 'function' ? _this15.renderer.getClearAlpha() : 0;
124288
124474
  } catch (_) {}
124289
- _this14.renderer.toneMapping = _this14.THREE.NoToneMapping;
124290
- _this14.renderer.setRenderTarget(rt);
124291
- _this14.renderer.setClearColor(new _this14.THREE.Color(0, 0, 0), 0);
124292
- _this14.renderer.clear(true, true, false);
124293
- _this14.camera.updateMatrixWorld(true);
124294
- _this14.renderer.render(state._occScene, _this14.camera);
124295
- _this14.updateGlobalSceneBoundingBox();
124475
+ _this15.renderer.toneMapping = _this15.THREE.NoToneMapping;
124476
+ _this15.renderer.setRenderTarget(rt);
124477
+ _this15.renderer.setClearColor(new _this15.THREE.Color(0, 0, 0), 0);
124478
+ _this15.renderer.clear(true, true, false);
124479
+ _this15.camera.updateMatrixWorld(true);
124480
+ _this15.renderer.render(state._occScene, _this15.camera);
124481
+ _this15.updateGlobalSceneBoundingBox();
124296
124482
  // const t1 = performance.now();
124297
124483
  // 从响应式对象读取 previewEnabled
124298
- _this14.$emit('updateBoundingBox');
124484
+ _this15.$emit('updateBoundingBox');
124299
124485
 
124300
124486
  // const tPreview0 = performance.now();
124301
- if (_this14.occlusionState.previewEnabled) {
124487
+ if (_this15.occlusionState.previewEnabled) {
124302
124488
  if (!state._previewCanvas) {
124303
124489
  cvs = document.createElement('canvas');
124304
124490
  cvs.style.position = 'fixed';
@@ -124316,11 +124502,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124316
124502
  }
124317
124503
  state._previewCanvas.width = sw;
124318
124504
  state._previewCanvas.height = sh;
124319
- cssW = Math.min(_this14.renderer.domElement.width / 5);
124320
- cssH = Math.min(_this14.renderer.domElement.height / 5);
124505
+ cssW = Math.min(_this15.renderer.domElement.width / 5);
124506
+ cssH = Math.min(_this15.renderer.domElement.height / 5);
124321
124507
  state._previewCanvas.style.width = cssW + 'px';
124322
124508
  state._previewCanvas.style.height = cssH + 'px';
124323
- _this14.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._previewBuffer);
124509
+ _this15.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._previewBuffer);
124324
124510
  if (!state._previewImageData || state._previewImageData.width !== sw || state._previewImageData.height !== sh) {
124325
124511
  state._previewImageData = state._previewCtx.createImageData(sw, sh);
124326
124512
  }
@@ -124343,17 +124529,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124343
124529
  }
124344
124530
  // const tPreview1 = performance.now();
124345
124531
  // _occRecordPerf('occ_preview_ms', tPreview1 - tPreview0, { sw, sh });
124346
- _this14.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._colorBuffer);
124532
+ _this15.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._colorBuffer);
124347
124533
  idIndexArr = activeIdIndexArr;
124348
124534
  maxIdx = typeof state._occMaxIdx === 'number' ? state._occMaxIdx : 0;
124349
124535
  totalPixels = sw * sh;
124350
124536
  targetSamples = totalPixels;
124351
124537
  baseStride = Math.max(1, Math.floor(Math.sqrt(totalPixels / Math.max(1, targetSamples))));
124352
- extraStride = _this14.occlusionState && _this14.occlusionState.sampleStride ? _this14.occlusionState.sampleStride : 1;
124538
+ extraStride = _this15.occlusionState && _this15.occlusionState.sampleStride ? _this15.occlusionState.sampleStride : 1;
124353
124539
  stride = Math.max(1, baseStride * Math.max(1, extraStride));
124354
- minSampleCount = _this14.occlusionState && _this14.occlusionState.minSampleCount ? _this14.occlusionState.minSampleCount : 1;
124540
+ minSampleCount = _this15.occlusionState && _this15.occlusionState.minSampleCount ? _this15.occlusionState.minSampleCount : 1;
124355
124541
  _context3.n = 11;
124356
- return _this14.scanOcclusionIndices(state._colorBuffer, sw, sh, stride, maxIdx, minSampleCount);
124542
+ return _this15.scanOcclusionIndices(state._colorBuffer, sw, sh, stride, maxIdx, minSampleCount);
124357
124543
  case 11:
124358
124544
  scanResult = _context3.v;
124359
124545
  if (scanResult && scanResult.buffer) {
@@ -124371,13 +124557,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124371
124557
  _context3.n = 13;
124372
124558
  break;
124373
124559
  }
124374
- _this14.renderer.setClearColor(new _this14.THREE.Color(0, 0, 0), 0);
124375
- _this14.renderer.clear(true, false, false);
124376
- _this14.renderer.render(state._occTransparentScene, _this14.camera);
124377
- _this14.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._colorBuffer);
124560
+ _this15.renderer.setClearColor(new _this15.THREE.Color(0, 0, 0), 0);
124561
+ _this15.renderer.clear(true, false, false);
124562
+ _this15.renderer.render(state._occTransparentScene, _this15.camera);
124563
+ _this15.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._colorBuffer);
124378
124564
  tIdIndexArr = transparentIdIndexArr;
124379
124565
  _context3.n = 12;
124380
- return _this14.scanOcclusionIndices(state._colorBuffer, sw, sh, stride, transparentMaxIdx, minSampleCount);
124566
+ return _this15.scanOcclusionIndices(state._colorBuffer, sw, sh, stride, transparentMaxIdx, minSampleCount);
124381
124567
  case 12:
124382
124568
  tScanResult = _context3.v;
124383
124569
  if (tScanResult && tScanResult.buffer) {
@@ -124391,9 +124577,9 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124391
124577
  }
124392
124578
  }
124393
124579
  case 13:
124394
- _this14.renderer.setRenderTarget(prevTarget);
124395
- _this14.renderer.setClearColor(prevClearColorHex, prevClearAlpha);
124396
- _this14.renderer.toneMapping = prevToneMapping;
124580
+ _this15.renderer.setRenderTarget(prevTarget);
124581
+ _this15.renderer.setClearColor(prevClearColorHex, prevClearAlpha);
124582
+ _this15.renderer.toneMapping = prevToneMapping;
124397
124583
  _context3.n = 15;
124398
124584
  break;
124399
124585
  case 14:
@@ -124416,7 +124602,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124416
124602
  });
124417
124603
  toLoadSet = new Set(visibleIdSet);
124418
124604
  parentsToCheck = new Set();
124419
- _this14.scene.traverse(function (child) {
124605
+ _this15.scene.traverse(function (child) {
124420
124606
  if (!child.isInstancedMesh) return;
124421
124607
  // 如果复用数量等于大于2个,则跳过裁剪和剔除处理(始终保留)
124422
124608
  if (child.count >= 2) {
@@ -124430,7 +124616,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124430
124616
  var _modelId = _modelIds2[_i13];
124431
124617
  // 检查已取消勾选模型进行卸载
124432
124618
  var documentId = _modelId.split(':')[1];
124433
- if (!_this14.noObserver.documentModelIds.get(documentId)) {
124619
+ if (!_this15.noObserver.documentModelIds.get(documentId)) {
124434
124620
  toUnload.push({
124435
124621
  modelId: _modelId,
124436
124622
  child: child
@@ -124440,12 +124626,12 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124440
124626
  if (bypassList && bypassList.size > 0 && bypassList.has(_modelId)) return;
124441
124627
  var instanceInfo = instancesMap.get(_modelId);
124442
124628
  var instanceIndex = instanceInfo && typeof instanceInfo.instanceIndex === 'number' ? instanceInfo.instanceIndex : null;
124443
- var _box = _this14._boxIndex && _this14._boxIndex.has(String(_modelId)) ? _this14._boxIndex.get(String(_modelId)) : _this14._boxIndex && _this14._boxIndex.has(_modelId) ? _this14._boxIndex.get(_modelId) : null;
124444
- if (!_this14.shouldApplyOcclusionByBox(_box)) {
124629
+ var _box = _this15._boxIndex && _this15._boxIndex.has(String(_modelId)) ? _this15._boxIndex.get(String(_modelId)) : _this15._boxIndex && _this15._boxIndex.has(_modelId) ? _this15._boxIndex.get(_modelId) : null;
124630
+ if (!_this15.shouldApplyOcclusionByBox(_box)) {
124445
124631
  allInactive = false;
124446
124632
  continue;
124447
124633
  }
124448
- var _inFrustum = _this14.isModelInFrustum(child, instanceIndex, globalFrustum);
124634
+ var _inFrustum = _this15.isModelInFrustum(child, instanceIndex, globalFrustum);
124449
124635
  var _modelInVisible = toLoadSet.has(_modelId);
124450
124636
  // console.log('modelId', modelId, 'inFrustum', inFrustum, 'modelInVisible', modelInVisible)
124451
124637
 
@@ -124458,8 +124644,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124458
124644
  // 第二遍遍历:同步状态并决定是否卸载
124459
124645
  for (var _i14 = 0, _modelIds3 = modelIds; _i14 < _modelIds3.length; _i14++) {
124460
124646
  var _modelId2 = _modelIds3[_i14];
124461
- var _box2 = _this14._boxIndex && _this14._boxIndex.has(String(_modelId2)) ? _this14._boxIndex.get(String(_modelId2)) : _this14._boxIndex && _this14._boxIndex.has(_modelId2) ? _this14._boxIndex.get(_modelId2) : null;
124462
- if (!_this14.shouldApplyOcclusionByBox(_box2)) {
124647
+ var _box2 = _this15._boxIndex && _this15._boxIndex.has(String(_modelId2)) ? _this15._boxIndex.get(String(_modelId2)) : _this15._boxIndex && _this15._boxIndex.has(_modelId2) ? _this15._boxIndex.get(_modelId2) : null;
124648
+ if (!_this15.shouldApplyOcclusionByBox(_box2)) {
124463
124649
  if (toLoadSet.has(_modelId2)) {
124464
124650
  toLoadSet.delete(_modelId2);
124465
124651
  }
@@ -124471,7 +124657,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124471
124657
  }
124472
124658
 
124473
124659
  // 仅当所有实例都不活跃时,才执行卸载
124474
- if (!_this14.firstPerSign && !_this14.roaming && allInactive) {
124660
+ if (!skipUnload && !_this15.firstPerSign && !_this15.roaming && allInactive) {
124475
124661
  toUnload.push({
124476
124662
  modelId: _modelId2,
124477
124663
  child: child
@@ -124486,19 +124672,19 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124486
124672
  }
124487
124673
  var modelId = child.parent && child.parent.userData && child.parent.userData.instanceId ? child.parent.userData.instanceId : child.uuid;
124488
124674
  if (bypassList && bypassList.size > 0 && bypassList.has(modelId)) return;
124489
- var box = _this14._boxIndex && _this14._boxIndex.has(String(modelId)) ? _this14._boxIndex.get(String(modelId)) : _this14._boxIndex && _this14._boxIndex.has(modelId) ? _this14._boxIndex.get(modelId) : null;
124490
- if (!_this14.shouldApplyOcclusionByBox(box)) {
124675
+ var box = _this15._boxIndex && _this15._boxIndex.has(String(modelId)) ? _this15._boxIndex.get(String(modelId)) : _this15._boxIndex && _this15._boxIndex.has(modelId) ? _this15._boxIndex.get(modelId) : null;
124676
+ if (!_this15.shouldApplyOcclusionByBox(box)) {
124491
124677
  if (toLoadSet.has(modelId)) {
124492
124678
  toLoadSet.delete(modelId);
124493
124679
  }
124494
124680
  return;
124495
124681
  }
124496
- var inFrustum = _this14.isModelInFrustum(child, null, globalFrustum);
124682
+ var inFrustum = _this15.isModelInFrustum(child, null, globalFrustum);
124497
124683
  var modelInVisible = toLoadSet.has(modelId);
124498
124684
  if (modelInVisible) {
124499
124685
  toLoadSet.delete(modelId);
124500
124686
  }
124501
- if (!_this14.firstPerSign && !_this14.roaming && (!inFrustum || !modelInVisible)) {
124687
+ if (!skipUnload && !_this15.firstPerSign && !_this15.roaming && (!inFrustum || !modelInVisible)) {
124502
124688
  toUnload.push({
124503
124689
  modelId: modelId,
124504
124690
  child: child
@@ -124508,16 +124694,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124508
124694
  for (_i15 = 0, _toUnload = toUnload; _i15 < _toUnload.length; _i15++) {
124509
124695
  _toUnload$_i = _toUnload[_i15], modelId = _toUnload$_i.modelId, child = _toUnload$_i.child;
124510
124696
  if (child && child.parent) parentsToCheck.add(child.parent);
124511
- _this14.unloadInstancedModel(modelId, child);
124697
+ _this15.unloadInstancedModel(modelId, child);
124512
124698
  }
124513
- if (_this14.scene) {
124699
+ if (_this15.scene) {
124514
124700
  parentsToCheck.forEach(function (group) {
124515
124701
  if (group && group.children && group.children.length === 0) {
124516
124702
  group.removeFromParent();
124517
124703
  }
124518
124704
  });
124519
124705
  }
124520
- _this14.modelStateManager.isloadedModelsIds = Object.freeze(Array.from(toLoadSet));
124706
+ _this15.modelStateManager.isloadedModelsIds = Object.freeze(Array.from(toLoadSet));
124521
124707
  case 18:
124522
124708
  return _context3.a(2);
124523
124709
  }
@@ -124544,8 +124730,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124544
124730
 
124545
124731
  // 卸载前内存快照
124546
124732
  // this.logRendererMemory(`before unload modelId=${modelId}`);
124547
- var _ref = instancedMesh.userData.instancesMap.get(modelId) || 0,
124548
- instanceIndex = _ref.instanceIndex;
124733
+ var _ref2 = instancedMesh.userData.instancesMap.get(modelId) || 0,
124734
+ instanceIndex = _ref2.instanceIndex;
124549
124735
  // const instanceIndex = instancedMesh.userData.instanceIndex || 0;
124550
124736
 
124551
124737
  this.removeOutlineInstanceProxy(instancedMesh, instanceIndex);
@@ -124612,10 +124798,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124612
124798
  * @param {Object} config - 配置项
124613
124799
  * @param {Object} config.modelApi - 模型API接口
124614
124800
  * @param {string} [config.projectId] - 项目ID
124801
+ * @param {Object} [config.cameraControlMoveObserver] - 普通视角运动中触发加载的配置
124802
+ * @param {boolean} [config.cameraControlMoveObserver.enabled=false] - 是否开启普通视角运动中加载
124803
+ * @param {number} [config.cameraControlMoveObserver.interval=500] - 触发间隔,单位毫秒
124804
+ * @param {boolean} [config.enableCameraControlMoveObserver=false] - 是否开启普通视角运动中加载
124805
+ * @param {number} [config.cameraControlMoveInterval=500] - 触发间隔,单位毫秒
124615
124806
  */
124616
124807
  init: function init() {
124617
124808
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
124618
124809
  console.log('init');
124810
+ this.setCameraControlMoveObserverConfig(config);
124619
124811
  this.initStreamLoader(config.modelApi, config);
124620
124812
  },
124621
124813
  /**
@@ -124625,11 +124817,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124625
124817
  * @param {string} [config.projectId] - 项目ID
124626
124818
  */
124627
124819
  initStreamLoader: function initStreamLoader(modelApi) {
124628
- var _this15 = this;
124820
+ var _this16 = this;
124629
124821
  var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
124630
- var _ref2 = config || {},
124631
- projectId = _ref2.projectId,
124632
- restConfig = _objectWithoutProperties(_ref2, _excluded);
124822
+ var _ref3 = config || {},
124823
+ projectId = _ref3.projectId,
124824
+ restConfig = _objectWithoutProperties(_ref3, _excluded);
124633
124825
  var streamLoader = new StreamLoader_StreamLoader(com_graphicsvue_type_script_lang_js_objectSpread({
124634
124826
  modelApi: modelApi,
124635
124827
  projectId: projectId,
@@ -124641,7 +124833,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124641
124833
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context4) {
124642
124834
  while (1) switch (_context4.n) {
124643
124835
  case 0:
124644
- if (!(_this15.userInteracting || _this15.noObserver.batchLoadingState.interactionState.isInteracting)) {
124836
+ if (!(_this16.userInteracting || _this16.noObserver.batchLoadingState.interactionState.isInteracting)) {
124645
124837
  _context4.n = 1;
124646
124838
  break;
124647
124839
  }
@@ -124691,9 +124883,9 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124691
124883
  this.noObserver.occlusionWorkerRequestMap = new Map();
124692
124884
  streamLoader.worker.addEventListener('message', function (e) {
124693
124885
  var payload = e.data || {};
124694
- var pending = _this15.noObserver.occlusionWorkerRequestMap.get(payload.id);
124886
+ var pending = _this16.noObserver.occlusionWorkerRequestMap.get(payload.id);
124695
124887
  if (!pending) return;
124696
- _this15.noObserver.occlusionWorkerRequestMap.delete(payload.id);
124888
+ _this16.noObserver.occlusionWorkerRequestMap.delete(payload.id);
124697
124889
  pending.resolve(payload);
124698
124890
  });
124699
124891
  }
@@ -124704,13 +124896,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124704
124896
  * @param {Object} materialData - 材质数据
124705
124897
  */
124706
124898
  setStreamModel: function setStreamModel(item, materialData) {
124707
- var _this16 = this;
124899
+ var _this17 = this;
124708
124900
  if (this.noObserver.streamLoader) {
124709
124901
  this.noObserver.streamLoader.setCurrentModel(item, materialData);
124710
124902
  // 设置完模型后,尝试触发一次范围加载以渲染初始视图
124711
124903
  // 使用 setTimeout 确保在下一帧执行,避免当前栈还在初始化中
124712
124904
  setTimeout(function () {
124713
- _this16.getRangeStream();
124905
+ _this17.getRangeStream();
124714
124906
  }, 0);
124715
124907
  } else {}
124716
124908
  },
@@ -124718,17 +124910,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124718
124910
  * 批量加载区域(供外部调用)
124719
124911
  */
124720
124912
  batchLoadRegions: function batchLoadRegions(item, divideData, materialData) {
124721
- var _this17 = this;
124913
+ var _this18 = this;
124722
124914
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee6() {
124723
124915
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context6) {
124724
124916
  while (1) switch (_context6.n) {
124725
124917
  case 0:
124726
- if (!_this17.noObserver.streamLoader) {
124918
+ if (!_this18.noObserver.streamLoader) {
124727
124919
  _context6.n = 1;
124728
124920
  break;
124729
124921
  }
124730
124922
  _context6.n = 1;
124731
- return _this17.noObserver.streamLoader.batchLoadRegions(item, divideData, materialData);
124923
+ return _this18.noObserver.streamLoader.batchLoadRegions(item, divideData, materialData);
124732
124924
  case 1:
124733
124925
  return _context6.a(2);
124734
124926
  }
@@ -124739,21 +124931,21 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124739
124931
  * 获取批量加载详情(供外部调用)
124740
124932
  */
124741
124933
  loadModelByIds: function loadModelByIds(options) {
124742
- var _this18 = this;
124934
+ var _this19 = this;
124743
124935
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee7() {
124744
- var _ref3, ids;
124936
+ var _ref4, ids;
124745
124937
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context7) {
124746
124938
  while (1) switch (_context7.n) {
124747
124939
  case 0:
124748
124940
  // 绕过剔除模型
124749
- _ref3 = options.params || {}, ids = _ref3.ids;
124750
- _this18.addBypassCullingModelIds(ids);
124751
- if (!_this18.noObserver.streamLoader) {
124941
+ _ref4 = options.params || {}, ids = _ref4.ids;
124942
+ _this19.addBypassCullingModelIds(ids);
124943
+ if (!_this19.noObserver.streamLoader) {
124752
124944
  _context7.n = 2;
124753
124945
  break;
124754
124946
  }
124755
124947
  _context7.n = 1;
124756
- return _this18.noObserver.streamLoader.loadModelByIds(options);
124948
+ return _this19.noObserver.streamLoader.loadModelByIds(options);
124757
124949
  case 1:
124758
124950
  return _context7.a(2, _context7.v);
124759
124951
  case 2:
@@ -124766,32 +124958,32 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124766
124958
  * 处理单个模型项加载(供外部调用)
124767
124959
  */
124768
124960
  processModelItem: function processModelItem(item) {
124769
- var _arguments = arguments,
124770
- _this19 = this;
124961
+ var _arguments2 = arguments,
124962
+ _this20 = this;
124771
124963
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee8() {
124772
124964
  var _options$onComplete;
124773
124965
  var options, res;
124774
124966
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context8) {
124775
124967
  while (1) switch (_context8.n) {
124776
124968
  case 0:
124777
- options = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : {};
124969
+ options = _arguments2.length > 1 && _arguments2[1] !== undefined ? _arguments2[1] : {};
124778
124970
  _context8.n = 1;
124779
- return _this19.noObserver.streamLoader.processModelItem(item, options);
124971
+ return _this20.noObserver.streamLoader.processModelItem(item, options);
124780
124972
  case 1:
124781
124973
  res = _context8.v;
124782
124974
  // item.id is the documentId
124783
124975
  if (item && item.id) {
124784
124976
  if (res && res.sceneBox) {
124785
- _this19.setSceneBox(res.sceneBox, item.id, true);
124977
+ _this20.setSceneBox(res.sceneBox, item.id, true);
124786
124978
  }
124787
124979
  if (res && res.boxIndex) {
124788
- _this19.setBoxIndex(res.boxIndex, item.id, true);
124980
+ _this20.setBoxIndex(res.boxIndex, item.id, true);
124789
124981
  }
124790
- _this19.tryInitialCenterAfterBoundsReady();
124982
+ _this20.tryInitialCenterAfterBoundsReady();
124791
124983
  // this.setBoxIndex(boxJson.data, item.id, true);
124792
124984
  }
124793
124985
  (_options$onComplete = options.onComplete) === null || _options$onComplete === void 0 || _options$onComplete.call(options);
124794
- _this19.notifyCameraChange(); // 触发场景更新
124986
+ _this20.notifyCameraChange(); // 触发场景更新
124795
124987
  case 2:
124796
124988
  return _context8.a(2);
124797
124989
  }
@@ -124845,7 +125037,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124845
125037
  * 内部渲染流式数据方法
124846
125038
  */
124847
125039
  renderModelData: function renderModelData(meshes, primitives, list, range, onComplete, immediateUpdate) {
124848
- var _this20 = this;
125040
+ var _this21 = this;
124849
125041
  var renderOptions = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
124850
125042
  // 构造 drawModel 需要的数据格式
124851
125043
  var modelRegistry = this.noObserver.streamLoader.modelRegistry;
@@ -124899,8 +125091,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124899
125091
  resolve(result || {});
124900
125092
  };
124901
125093
  options.onComplete = function (complete) {
124902
- if (_this20.sceneCommandService && typeof _this20.sceneCommandService.retryPendingOriginalModelSaveChanges === 'function') {
124903
- _this20.sceneCommandService.retryPendingOriginalModelSaveChanges();
125094
+ if (_this21.sceneCommandService && typeof _this21.sceneCommandService.retryPendingOriginalModelSaveChanges === 'function') {
125095
+ _this21.sceneCommandService.retryPendingOriginalModelSaveChanges();
124904
125096
  }
124905
125097
  onComplete === null || onComplete === void 0 || onComplete(complete);
124906
125098
  finish(complete);
@@ -124910,7 +125102,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124910
125102
  canceled: true
124911
125103
  }, cancelInfo || {}));
124912
125104
  };
124913
- _this20.drawModel(regionModelData, '', meshNameConfig, options);
125105
+ _this21.drawModel(regionModelData, '', meshNameConfig, options);
124914
125106
  });
124915
125107
  },
124916
125108
  waitNextRenderFrame: function waitNextRenderFrame() {
@@ -124925,18 +125117,18 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124925
125117
  });
124926
125118
  },
124927
125119
  handleRangeStreamComplete: function handleRangeStreamComplete() {
124928
- var _arguments2 = arguments,
124929
- _this21 = this;
125120
+ var _arguments3 = arguments,
125121
+ _this22 = this;
124930
125122
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee9() {
124931
125123
  var payload;
124932
125124
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context9) {
124933
125125
  while (1) switch (_context9.n) {
124934
125126
  case 0:
124935
- payload = _arguments2.length > 0 && _arguments2[0] !== undefined ? _arguments2[0] : {};
125127
+ payload = _arguments3.length > 0 && _arguments3[0] !== undefined ? _arguments3[0] : {};
124936
125128
  _context9.n = 1;
124937
- return _this21.waitNextRenderFrame();
125129
+ return _this22.waitNextRenderFrame();
124938
125130
  case 1:
124939
- _this21.$emit('loadComplete', com_graphicsvue_type_script_lang_js_objectSpread({
125131
+ _this22.$emit('loadComplete', com_graphicsvue_type_script_lang_js_objectSpread({
124940
125132
  source: 'inRangeDis2'
124941
125133
  }, payload));
124942
125134
  case 2:
@@ -125100,43 +125292,135 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125100
125292
  setCameraObserverEnabled: function setCameraObserverEnabled(enabled) {
125101
125293
  this.noObserver.isObserverEnabled = enabled;
125102
125294
  },
125295
+ setCameraControlMoveObserverConfig: function setCameraControlMoveObserverConfig() {
125296
+ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
125297
+ if (!this.noObserver) return;
125298
+ var nestedConfig = config.cameraControlMoveObserver || {};
125299
+ var enabled = typeof nestedConfig.enabled === 'boolean' ? nestedConfig.enabled : typeof config.enableCameraControlMoveObserver === 'boolean' ? config.enableCameraControlMoveObserver : false;
125300
+ var rawInterval = nestedConfig.interval !== undefined ? nestedConfig.interval : config.cameraControlMoveInterval;
125301
+ var interval = Number(rawInterval);
125302
+ var safeInterval = Number.isFinite(interval) && interval > 0 ? interval : 500;
125303
+ this.noObserver.cameraControlMoveObserver = {
125304
+ enabled: enabled,
125305
+ interval: safeInterval
125306
+ };
125307
+ this.resetCameraControlMoveSnapshot(false);
125308
+ },
125309
+ isCameraControlMoveObserverEnabled: function isCameraControlMoveObserverEnabled() {
125310
+ var config = this.noObserver && this.noObserver.cameraControlMoveObserver;
125311
+ return !!(config && config.enabled);
125312
+ },
125313
+ getCameraControlTarget: function getCameraControlTarget(target) {
125314
+ if (!target || !this.cameraControls) return false;
125315
+ if (typeof this.cameraControls.getTarget === 'function') {
125316
+ this.cameraControls.getTarget(target);
125317
+ return true;
125318
+ }
125319
+ if (this.cameraControls._target) {
125320
+ target.copy(this.cameraControls._target);
125321
+ return true;
125322
+ }
125323
+ return false;
125324
+ },
125325
+ resetCameraControlMoveSnapshot: function resetCameraControlMoveSnapshot() {
125326
+ var syncCurrent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
125327
+ if (!this.noObserver) return;
125328
+ if (!this.noObserver._cameraControlMoveState) {
125329
+ this.noObserver._cameraControlMoveState = {
125330
+ position: new this.THREE.Vector3(),
125331
+ quaternion: new this.THREE.Quaternion(),
125332
+ target: new this.THREE.Vector3(),
125333
+ currentTarget: new this.THREE.Vector3(),
125334
+ initialized: false,
125335
+ hasTarget: false
125336
+ };
125337
+ }
125338
+ var state = this.noObserver._cameraControlMoveState;
125339
+ if (!syncCurrent || !this.camera) {
125340
+ state.initialized = false;
125341
+ state.hasTarget = false;
125342
+ return;
125343
+ }
125344
+ this.camera.updateMatrixWorld(true);
125345
+ state.position.copy(this.camera.position);
125346
+ state.quaternion.copy(this.camera.quaternion);
125347
+ state.hasTarget = this.getCameraControlTarget(state.target);
125348
+ state.initialized = true;
125349
+ },
125350
+ observeCameraControlMove: function observeCameraControlMove() {
125351
+ if (!this.noObserver || !this.noObserver.isObserverEnabled || !this.isCameraControlMoveObserverEnabled() || !this.camera || !this.cameraControls || typeof this._cameraChangeObserver !== 'function') {
125352
+ return;
125353
+ }
125354
+ var loadingState = this.noObserver.batchLoadingState || {};
125355
+ var interactionState = loadingState.interactionState || {};
125356
+ var wheelActive = !!interactionState.wheelTimeout;
125357
+ var controlActive = !!this.noObserver.isControlActive;
125358
+ if (!controlActive && !wheelActive || this.firstPerSign) {
125359
+ this.resetCameraControlMoveSnapshot(false);
125360
+ return;
125361
+ }
125362
+ if (!this.noObserver._cameraControlMoveState) {
125363
+ this.resetCameraControlMoveSnapshot(true);
125364
+ return;
125365
+ }
125366
+ var state = this.noObserver._cameraControlMoveState;
125367
+ if (!state.initialized) {
125368
+ this.resetCameraControlMoveSnapshot(true);
125369
+ return;
125370
+ }
125371
+ this.camera.updateMatrixWorld(true);
125372
+ var hasTarget = this.getCameraControlTarget(state.currentTarget);
125373
+ var positionMoved = state.position.distanceToSquared(this.camera.position) > 1e-8;
125374
+ var quaternionMoved = 1 - Math.abs(state.quaternion.dot(this.camera.quaternion)) > 1e-10;
125375
+ var targetMoved = hasTarget !== state.hasTarget || hasTarget && state.target.distanceToSquared(state.currentTarget) > 1e-8;
125376
+ if (!positionMoved && !quaternionMoved && !targetMoved) return;
125377
+ state.position.copy(this.camera.position);
125378
+ state.quaternion.copy(this.camera.quaternion);
125379
+ state.hasTarget = hasTarget;
125380
+ if (hasTarget) {
125381
+ state.target.copy(state.currentTarget);
125382
+ }
125383
+ this._cameraChangeObserver('controlMove');
125384
+ },
125103
125385
  /**
125104
125386
  * 初始化相机变更观察者 (CameraChangeObserver)
125105
125387
  * 统一监听:用户交互(Wheel/Control)、程序化动画、API调用
125106
125388
  */
125107
125389
  initCameraChangeObserver: function initCameraChangeObserver() {
125108
- var _this22 = this;
125390
+ var _this23 = this;
125109
125391
  // 初始化 control 状态标志
125110
125392
  this.noObserver.isControlActive = false;
125111
125393
  var _this = this;
125112
125394
  // 1. 创建统一的响应触发器 (Debounced)
125113
125395
  this._cameraChangeObserver = this.debounce(/*#__PURE__*/function () {
125114
- var _ref4 = com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee0(source) {
125396
+ var _ref5 = com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee0(source) {
125115
125397
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context0) {
125116
125398
  while (1) switch (_context0.n) {
125117
125399
  case 0:
125118
- if (_this22.noObserver.isObserverEnabled) {
125400
+ if (_this23.noObserver.isObserverEnabled) {
125119
125401
  _context0.n = 1;
125120
125402
  break;
125121
125403
  }
125122
125404
  return _context0.a(2);
125123
125405
  case 1:
125124
- if (!(source === 'rest' && _this22.noObserver.isControlActive)) {
125406
+ if (!(source === 'rest' && _this23.noObserver.isControlActive)) {
125125
125407
  _context0.n = 2;
125126
125408
  break;
125127
125409
  }
125128
125410
  return _context0.a(2);
125129
125411
  case 2:
125130
- if (!_this22.modelStateManager.frustumCheckEnabled) {
125412
+ if (!_this23.modelStateManager.frustumCheckEnabled) {
125131
125413
  _context0.n = 3;
125132
125414
  break;
125133
125415
  }
125134
125416
  _context0.n = 3;
125135
- return _this22.performFrustumCulling();
125417
+ return _this23.performFrustumCulling({
125418
+ skipUnload: source === 'controlMove'
125419
+ });
125136
125420
  case 3:
125137
125421
  // 执行流式加载请求
125138
- if (_this22.modelStateManager.isloadedModelsIds && _this22.modelStateManager.isloadedModelsIds.length > 0) {
125139
- _this22.getRangeStream(false);
125422
+ if (_this23.modelStateManager.isloadedModelsIds && _this23.modelStateManager.isloadedModelsIds.length > 0) {
125423
+ _this23.getRangeStream(false);
125140
125424
  }
125141
125425
  case 4:
125142
125426
  return _context0.a(2);
@@ -125144,10 +125428,10 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125144
125428
  }, _callee0);
125145
125429
  }));
125146
125430
  return function (_x3) {
125147
- return _ref4.apply(this, arguments);
125431
+ return _ref5.apply(this, arguments);
125148
125432
  };
125149
125433
  }(), function (source) {
125150
- // 漫游模式下,或者第一人称移动时,使用节流策略(每300ms触发一次)
125434
+ // 漫游、第一人称移动、普通视角拖拽/缩放中,使用节流策略避免持续运动被防抖吞掉。
125151
125435
  // 避免在持续运动中因防抖重置定时器而无法触发
125152
125436
  if (source === 'roam' || source === 'firstPersonMove') {
125153
125437
  return {
@@ -125155,24 +125439,38 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125155
125439
  limit: 1000
125156
125440
  };
125157
125441
  }
125442
+ if (source === 'controlMove') {
125443
+ var config = _this23.noObserver && _this23.noObserver.cameraControlMoveObserver;
125444
+ var interval = config && Number.isFinite(config.interval) && config.interval > 0 ? config.interval : 500;
125445
+ return {
125446
+ type: 'throttle',
125447
+ limit: interval
125448
+ };
125449
+ }
125158
125450
  return 300; // 默认防抖 300ms
125159
125451
  });
125160
125452
 
125161
125453
  // 2. 公开API:允许外部或业务逻辑手动触发更新
125162
125454
  this.notifyCameraChange = function () {
125163
125455
  var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'api';
125164
- _this22._cameraChangeObserver(source);
125456
+ _this23._cameraChangeObserver(source);
125165
125457
  };
125166
125458
 
125167
125459
  // 3. 监听器 - Wheel (用户滚轮)
125168
125460
  this._wheelHandler = function (res) {
125169
- _this22.$emit('wheelStart', res);
125170
-
125171
- // 统一交互开始处理
125172
- _this22.beginInteraction('wheel');
125461
+ _this23.$emit('wheelStart', res);
125462
+ var cameraControlMoveEnabled = _this23.isCameraControlMoveObserverEnabled();
125463
+ var loadingState = _this23.noObserver ? _this23.noObserver.batchLoadingState : _this23.batchLoadingState;
125464
+ var wheelAlreadyActive = loadingState && loadingState.interactionState && loadingState.interactionState.wheelTimeout;
125465
+ if (cameraControlMoveEnabled && !wheelAlreadyActive) {
125466
+ _this23.resetCameraControlMoveSnapshot(true);
125467
+ } else if (!cameraControlMoveEnabled) {
125468
+ // 未开启普通视角运动加载时,保持原有交互中断流程。
125469
+ _this23.beginInteraction('wheel');
125470
+ }
125173
125471
 
125174
125472
  // 设置滚轮交互的结束检测
125175
- _this22.scheduleWheelInteractionEnd(res, 100);
125473
+ _this23.scheduleWheelInteractionEnd(res, 100);
125176
125474
 
125177
125475
  // 滚轮逻辑:infinityDolly 与 maxDollyDistance 控制
125178
125476
  var event = res;
@@ -125188,10 +125486,10 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125188
125486
 
125189
125487
  // dolly最大距离限制
125190
125488
  try {
125191
- if (_this22.sceneBoundingBox && isFinite(maxDollyDistance)) {
125489
+ if (_this23.sceneBoundingBox && isFinite(maxDollyDistance)) {
125192
125490
  if (isZoomOut) {
125193
- _this22.camera.updateMatrixWorld(true);
125194
- var currentDistance = _this22.camera.position.distanceTo(_this22.cameraControls._target);
125491
+ _this23.camera.updateMatrixWorld(true);
125492
+ var currentDistance = _this23.camera.position.distanceTo(_this23.cameraControls._target);
125195
125493
  if (currentDistance >= maxDollyDistance) {
125196
125494
  event.preventDefault && event.preventDefault();
125197
125495
  event.stopImmediatePropagation && event.stopImmediatePropagation();
@@ -125204,17 +125502,20 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125204
125502
  }
125205
125503
 
125206
125504
  // 触发观察者
125207
- _this22._cameraChangeObserver('wheel');
125505
+ _this23._cameraChangeObserver('wheel');
125208
125506
  };
125209
125507
  this.renderer.domElement.addEventListener('wheel', this._wheelHandler);
125210
125508
 
125211
125509
  // 4. 监听器 - Controls (用户拖拽/操作)
125212
125510
  this._onControlStart = function (res) {
125213
- _this22.noObserver.isControlActive = true;
125214
-
125215
- // 统一交互开始处理(相机)
125216
- _this22.beginInteraction('this.camera');
125217
- _this22.$emit('controlStart', res);
125511
+ _this23.noObserver.isControlActive = true;
125512
+ if (_this23.isCameraControlMoveObserverEnabled()) {
125513
+ _this23.resetCameraControlMoveSnapshot(true);
125514
+ } else {
125515
+ // 未开启普通视角运动加载时,保持原有交互中断流程。
125516
+ _this23.beginInteraction('this.camera');
125517
+ }
125518
+ _this23.$emit('controlStart', res);
125218
125519
 
125219
125520
  // 记录鼠标按下时的位置
125220
125521
  var event = res.originalEvent || window.event;
@@ -125226,12 +125527,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125226
125527
  };
125227
125528
  this._onControlEnd = function (res) {
125228
125529
  _this.noObserver.isControlActive = false;
125229
- _this22.$emit('controlEnd', res);
125230
-
125231
- // 统一交互结束处理(相机)
125232
- _this22.endInteraction('this.camera', res, {
125233
- immediateResume: false
125234
- });
125530
+ _this23.$emit('controlEnd', res);
125531
+ if (!_this23.isCameraControlMoveObserverEnabled()) {
125532
+ // 未开启普通视角运动加载时,保持原有交互中断流程。
125533
+ _this23.endInteraction('this.camera', res, {
125534
+ immediateResume: false
125535
+ });
125536
+ }
125235
125537
 
125236
125538
  // 记录鼠标抬起时的位置并计算是否发生了拖拽
125237
125539
  var event = res.originalEvent || window.event;
@@ -125258,7 +125560,10 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125258
125560
  // }
125259
125561
 
125260
125562
  // 触发观察者
125261
- _this22._cameraChangeObserver('control');
125563
+ _this23._cameraChangeObserver('control');
125564
+ }
125565
+ if (_this23.isCameraControlMoveObserverEnabled()) {
125566
+ _this23.resetCameraControlMoveSnapshot(false);
125262
125567
  }
125263
125568
  };
125264
125569
  this.cameraControls.addEventListener('controlstart', this._onControlStart);
@@ -125268,7 +125573,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125268
125573
  // 监听 rest 事件,捕获 this.cameraControls.setLookAt(..., true) 等动画结束(以及阻尼停止)
125269
125574
  // 注意:rest 事件在用户交互完全静止时也会触发,与 controlEnd 有部分重叠,但 Observer 有防抖,影响不大
125270
125575
  this._onRest = function () {
125271
- _this22._cameraChangeObserver('rest');
125576
+ _this23._cameraChangeObserver('rest');
125272
125577
  };
125273
125578
  this.cameraControls.addEventListener('rest', this._onRest);
125274
125579
  },
@@ -125295,7 +125600,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125295
125600
  meshNameConfig: {}
125296
125601
  */
125297
125602
  drawModel: function drawModel(data) {
125298
- var _this23 = this;
125603
+ var _this24 = this;
125299
125604
  var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
125300
125605
  var meshNameConfig = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
125301
125606
  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
@@ -125304,25 +125609,46 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125304
125609
  // 使用新的分帧加载方法,提供进度回调
125305
125610
  return this.drawModelWithBatchLoading(data, color, meshNameConfig, options, function (progress) {
125306
125611
  // 触发原有的进度事件
125307
- _this23.$emit('loadProgress', _this23.progress);
125612
+ _this24.$emit('loadProgress', _this24.progress);
125308
125613
  }, function (complete) {
125309
125614
  var _options$onComplete2;
125310
125615
  options === null || options === void 0 || (_options$onComplete2 = options.onComplete) === null || _options$onComplete2 === void 0 || _options$onComplete2.call(options, complete);
125311
125616
  console.log('加载完成');
125312
125617
  // 触发原有的完成事件
125313
125618
  if (!(options !== null && options !== void 0 && options.suppressLoadComplete)) {
125314
- _this23.$emit('loadComplete');
125619
+ _this24.$emit('loadComplete');
125315
125620
  }
125316
125621
  });
125317
125622
  },
125318
125623
  // 动态设置视角滚轮的距离
125319
125624
  setCameraConfig: function setCameraConfig() {
125625
+ if (!this.sceneBoundingBox || !this.sceneBoundingBox.isBox3 || this.sceneBoundingBox.isEmpty()) {
125626
+ return;
125627
+ }
125320
125628
  // let box3 = new this.THREE.Box3().setFromObject(this.sceneBoundingBox);
125321
125629
  var size = new this.THREE.Vector3();
125322
125630
  this.sceneBoundingBox.getSize(size);
125323
125631
  var maxBorder = Math.max(size.x, size.y, size.z);
125632
+ if (isDebug) {
125633
+ var center = this.sceneBoundingBox.getCenter(new this.THREE.Vector3());
125634
+ console.log('sceneBoundingBox 调试信息', {
125635
+ size: {
125636
+ x: size.x,
125637
+ y: size.y,
125638
+ z: size.z
125639
+ },
125640
+ center: {
125641
+ x: center.x,
125642
+ y: center.y,
125643
+ z: center.z
125644
+ },
125645
+ maxBorder: maxBorder
125646
+ });
125647
+ this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
125648
+ }
125324
125649
  // this.cameraControls.this.camera.far = maxBorder * 10; // 设置相机的远裁剪面
125325
125650
  this.cameraControls.minDistance = maxBorder * 0.2; // 动态设置视角滚轮的距离
125651
+ // this.cameraControls.minDistance = 1000; // 动态设置视角滚轮的距离
125326
125652
  this.camera.updateProjectionMatrix();
125327
125653
  },
125328
125654
  // 获取mesh的中心点
@@ -125338,14 +125664,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125338
125664
  };
125339
125665
  },
125340
125666
  mouseDown: function mouseDown(event) {
125341
- var _this24 = this;
125667
+ var _this25 = this;
125342
125668
  // 在鼠标按下时启用渲染中断以提升响应性
125343
125669
  this.forceSkipRendering = true;
125344
125670
  this.skipNextRenderFrame = true;
125345
125671
  var intersects = this.getRaycasterObjects(event);
125346
125672
  console.log(intersects);
125347
125673
  var shouldBlockCamera = intersects.some(function (item) {
125348
- return _this24.isActiveTransformControlIntersection(item);
125674
+ return _this25.isActiveTransformControlIntersection(item);
125349
125675
  });
125350
125676
  if (shouldBlockCamera) {
125351
125677
  this.setPointerCameraGuard(true);
@@ -125427,19 +125753,19 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125427
125753
  return this.isTransformControlIntersection(intersection);
125428
125754
  },
125429
125755
  getPrimaryIntersection: function getPrimaryIntersection() {
125430
- var _this25 = this;
125756
+ var _this26 = this;
125431
125757
  var intersects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
125432
125758
  if (!Array.isArray(intersects) || intersects.length === 0) {
125433
125759
  return null;
125434
125760
  }
125435
125761
  var validIntersects = intersects.filter(function (item) {
125436
- return item && item.object && !_this25.isTransformControlIntersection(item);
125762
+ return item && item.object && !_this26.isTransformControlIntersection(item);
125437
125763
  });
125438
125764
  if (validIntersects.length === 0) {
125439
125765
  return null;
125440
125766
  }
125441
125767
  var selectableIntersect = validIntersects.find(function (item) {
125442
- return _this25.getSelectableSceneObject(item.object);
125768
+ return _this26.getSelectableSceneObject(item.object);
125443
125769
  });
125444
125770
  return selectableIntersect || validIntersects[0] || null;
125445
125771
  },
@@ -125511,13 +125837,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125511
125837
  }
125512
125838
  },
125513
125839
  mouseClick: function mouseClick(event) {
125514
- var _this26 = this;
125840
+ var _this27 = this;
125515
125841
  // 鼠标抬起时重置渲染中断标记
125516
125842
  setTimeout(function () {
125517
- _this26.forceSkipRendering = false;
125843
+ _this27.forceSkipRendering = false;
125518
125844
  // interactionFrameCount = 0;
125519
125845
  // 恢复批次加载操作
125520
- _this26.resumeBatchLoading();
125846
+ _this27.resumeBatchLoading();
125521
125847
  }, 50); // 短暂延迟确保交互完成
125522
125848
 
125523
125849
  // 在测量模式下,不进行事件暴露
@@ -125576,21 +125902,21 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125576
125902
  this.setPointerCameraGuard(false);
125577
125903
  this.$emit('rightClick', params);
125578
125904
  onContextHandle(event, 'fl-model', '隐藏', this.isolateMode ? '取消隔离' : '隔离', function () {
125579
- _this26.updateProperty([{
125905
+ _this27.updateProperty([{
125580
125906
  name: params.instanceId,
125581
125907
  attr: {
125582
125908
  visible: false
125583
125909
  }
125584
125910
  }]);
125585
125911
  }, function () {
125586
- _this26.setAllModelVisible(_this26.isolateMode);
125587
- _this26.updateProperty([{
125912
+ _this27.setAllModelVisible(_this27.isolateMode);
125913
+ _this27.updateProperty([{
125588
125914
  name: params.instanceId,
125589
125915
  attr: {
125590
125916
  visible: true
125591
125917
  }
125592
125918
  }]);
125593
- _this26.isolateMode = !_this26.isolateMode;
125919
+ _this27.isolateMode = !_this27.isolateMode;
125594
125920
  });
125595
125921
  }
125596
125922
  } else if (event.button === 2) {
@@ -125598,21 +125924,21 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125598
125924
  this.setPointerCameraGuard(false);
125599
125925
  this.$emit('rightClick', params);
125600
125926
  onContextHandle(event, 'fl-model', '隐藏', this.isolateMode ? '取消隔离' : '隔离', function () {
125601
- _this26.updateProperty([{
125927
+ _this27.updateProperty([{
125602
125928
  name: params.instanceId,
125603
125929
  attr: {
125604
125930
  visible: false
125605
125931
  }
125606
125932
  }]);
125607
125933
  }, function () {
125608
- _this26.setAllModelVisible(_this26.isolateMode);
125609
- _this26.updateProperty([{
125934
+ _this27.setAllModelVisible(_this27.isolateMode);
125935
+ _this27.updateProperty([{
125610
125936
  name: params.instanceId,
125611
125937
  attr: {
125612
125938
  visible: true
125613
125939
  }
125614
125940
  }]);
125615
- _this26.isolateMode = !_this26.isolateMode;
125941
+ _this27.isolateMode = !_this27.isolateMode;
125616
125942
  });
125617
125943
  }
125618
125944
  }
@@ -125640,8 +125966,19 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125640
125966
  if (this.threeMeasure) {
125641
125967
  this.threeMeasure.updateParams(width, height);
125642
125968
  }
125969
+ this.updateMeshLineResolution(width, height);
125643
125970
  }
125644
125971
  },
125972
+ updateMeshLineResolution: function updateMeshLineResolution(width, height) {
125973
+ if (!this.modelGroup || !width || !height) return;
125974
+ this.modelGroup.traverse(function (child) {
125975
+ var material = child && child.material;
125976
+ if (material && material.type === 'MeshLineMaterial' && material.resolution) {
125977
+ material.resolution.set(width, height);
125978
+ material.needsUpdate = true;
125979
+ }
125980
+ });
125981
+ },
125645
125982
  setModelCenter: function setModelCenter(target) {
125646
125983
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
125647
125984
  // return
@@ -125692,7 +126029,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125692
126029
  },
125693
126030
  // 带防抖和用户交互检测的智能居中方法
125694
126031
  smartModelCenter: function smartModelCenter(mesh) {
125695
- var _this27 = this;
126032
+ var _this28 = this;
125696
126033
  var debounceDelay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
125697
126034
  // if (this.hasExecutedCentering) {
125698
126035
  // return;
@@ -125712,13 +126049,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125712
126049
  // 设置新的防抖定时器
125713
126050
  this.centeringDebounceTimer = setTimeout(function () {
125714
126051
  // 如果已经执行过居中操作,则不再执行
125715
- if (!_this27.userInteracting && !_this27.hasExecutedCentering && _this27.noObserver.documentModelIds.size > 0) {
125716
- _this27.setModelCenter(mesh, {
126052
+ if (!_this28.userInteracting && !_this28.hasExecutedCentering && _this28.noObserver.documentModelIds.size > 0) {
126053
+ _this28.setModelCenter(mesh, {
125717
126054
  enableTransition: false
125718
126055
  });
125719
- _this27.hasExecutedCentering = true;
126056
+ _this28.hasExecutedCentering = true;
125720
126057
  // 触发场景更新
125721
- _this27.notifyCameraChange();
126058
+ _this28.notifyCameraChange();
125722
126059
  }
125723
126060
  }, debounceDelay);
125724
126061
  },
@@ -125742,14 +126079,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125742
126079
  * }
125743
126080
  */
125744
126081
  updateProperty: function updateProperty(list) {
125745
- var _this28 = this;
126082
+ var _this29 = this;
125746
126083
  var hasOutline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
125747
126084
  var isUpdate = false;
125748
126085
  var _loop = function _loop() {
125749
126086
  var ele = list[index];
125750
126087
  var type = ele.type || 'mesh';
125751
126088
  var instanceId = ele.name;
125752
- var targetObj = _this28.getObjectByName(instanceId);
126089
+ var targetObj = _this29.getObjectByName(instanceId);
125753
126090
  var _loop2 = function _loop2(key) {
125754
126091
  switch (key) {
125755
126092
  case 'color':
@@ -125759,19 +126096,19 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125759
126096
  var instanceInfo = (_children$userData = children.userData) === null || _children$userData === void 0 || (_children$userData = _children$userData.instancesMap) === null || _children$userData === void 0 ? void 0 : _children$userData.get(instanceId);
125760
126097
  if (!instanceInfo) return;
125761
126098
  var instanceIndex = instanceInfo.instanceIndex;
125762
- children.setColorAt(instanceIndex, new _this28.THREE.Color(ele.attr[key]));
126099
+ children.setColorAt(instanceIndex, new _this29.THREE.Color(ele.attr[key]));
125763
126100
  children.instanceColor.needsUpdate = true;
125764
- if (!_this28.isCurrentVisible(instanceId, children)) {
125765
- _this28.removeOutlineObject(children, instanceIndex);
126101
+ if (!_this29.isCurrentVisible(instanceId, children)) {
126102
+ _this29.removeOutlineObject(children, instanceIndex);
125766
126103
  return;
125767
126104
  }
125768
126105
  if (hasOutline) {
125769
- if (_this28.outlinePass) {
126106
+ if (_this29.outlinePass) {
125770
126107
  if (children.isInstancedMesh) {
125771
- var proxy = _this28.ensureOutlineInstanceProxy(children, instanceIndex);
125772
- _this28.pushOutlineTarget(proxy);
125773
- } else if (!_this28.isSourceHiddenInstance(children, instanceId)) {
125774
- _this28.pushOutlineTarget(children);
126108
+ var proxy = _this29.ensureOutlineInstanceProxy(children, instanceIndex);
126109
+ _this29.pushOutlineTarget(proxy);
126110
+ } else if (!_this29.isSourceHiddenInstance(children, instanceId)) {
126111
+ _this29.pushOutlineTarget(children);
125775
126112
  }
125776
126113
  }
125777
126114
  }
@@ -125784,10 +126121,10 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125784
126121
  isUpdate = true;
125785
126122
  }
125786
126123
  var requestedVisible = Boolean(ele.attr[key]);
125787
- var nextBoxVisible = requestedVisible && _this28.isSourceVisible(instanceId);
125788
- var boxKey = _this28._boxIndex && _this28._boxIndex.has(String(instanceId)) ? String(instanceId) : instanceId;
125789
- if (_this28._boxIndex && _this28._boxIndex.has(boxKey)) {
125790
- var boxData = _this28._boxIndex.get(boxKey);
126124
+ var nextBoxVisible = requestedVisible && _this29.isSourceVisible(instanceId);
126125
+ var boxKey = _this29._boxIndex && _this29._boxIndex.has(String(instanceId)) ? String(instanceId) : instanceId;
126126
+ if (_this29._boxIndex && _this29._boxIndex.has(boxKey)) {
126127
+ var boxData = _this29._boxIndex.get(boxKey);
125791
126128
  if (boxData && boxData.userData) {
125792
126129
  boxData.userData.visible = nextBoxVisible;
125793
126130
  }
@@ -125797,22 +126134,22 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125797
126134
  if (!instanceInfo) return;
125798
126135
  var instanceIndex = instanceInfo.instanceIndex,
125799
126136
  copyMatrix = instanceInfo.copyMatrix;
125800
- var nextVisible = requestedVisible && _this28.isSourceVisible(instanceId, children);
126137
+ var nextVisible = requestedVisible && _this29.isSourceVisible(instanceId, children);
125801
126138
  instanceInfo.visible = nextVisible;
125802
126139
  if (nextVisible) {
125803
- var restoreMatrix = new _this28.THREE.Matrix4().copy(copyMatrix || children.userData.copyMatrix);
126140
+ var restoreMatrix = new _this29.THREE.Matrix4().copy(copyMatrix || children.userData.copyMatrix);
125804
126141
  children.setMatrixAt(instanceIndex, restoreMatrix);
125805
126142
  } else {
125806
- var _copyMatrix = _this28.getInstanceCopyMatrix(children, instanceId);
126143
+ var _copyMatrix = _this29.getInstanceCopyMatrix(children, instanceId);
125807
126144
  if (!_copyMatrix) return;
125808
- var offsetMatrix = new _this28.THREE.Matrix4().copy(_copyMatrix || children.userData.copyMatrix).makeTranslation(9999999, 9999999, 9999999);
126145
+ var offsetMatrix = new _this29.THREE.Matrix4().copy(_copyMatrix || children.userData.copyMatrix).makeTranslation(9999999, 9999999, 9999999);
125809
126146
  children.setMatrixAt(instanceIndex, offsetMatrix);
125810
- _this28.removeOutlineObject(children, instanceIndex);
126147
+ _this29.removeOutlineObject(children, instanceIndex);
125811
126148
  }
125812
126149
  children.instanceMatrix.needsUpdate = true;
125813
126150
  });
125814
- _this28.refreshCollisionObbDebug();
125815
- _this28.notifyCameraChange(); // 触发场景更新
126151
+ _this29.refreshCollisionObbDebug();
126152
+ _this29.notifyCameraChange(); // 触发场景更新
125816
126153
  break;
125817
126154
  }
125818
126155
  case 'opacity':
@@ -125863,13 +126200,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125863
126200
  }
125864
126201
  },
125865
126202
  setAllModelVisible: function setAllModelVisible(visible) {
125866
- var _this29 = this;
126203
+ var _this30 = this;
125867
126204
  var isVisible = Boolean(visible);
125868
126205
  var matrixCache = new this.THREE.Matrix4();
125869
126206
  if (this._boxIndex && this._boxIndex.size > 0) {
125870
126207
  this._boxIndex.forEach(function (box, modelId) {
125871
126208
  if (!box || !box.userData) return;
125872
- box.userData.visible = isVisible && _this29.isSourceVisible(modelId);
126209
+ box.userData.visible = isVisible && _this30.isSourceVisible(modelId);
125873
126210
  });
125874
126211
  }
125875
126212
  if (this.scene) {
@@ -125882,7 +126219,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125882
126219
  var instanceIndex = instanceInfo && typeof instanceInfo.instanceIndex === 'number' ? instanceInfo.instanceIndex : null;
125883
126220
  if (instanceIndex === null) return;
125884
126221
  var copyMatrix = instanceInfo.copyMatrix || userData.copyMatrix;
125885
- if (isVisible && _this29.isSourceVisible(instanceId, child)) {
126222
+ if (isVisible && _this30.isSourceVisible(instanceId, child)) {
125886
126223
  instanceInfo.visible = true;
125887
126224
  matrixCache.copy(copyMatrix);
125888
126225
  child.setMatrixAt(instanceIndex, matrixCache);
@@ -125890,7 +126227,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125890
126227
  instanceInfo.visible = false;
125891
126228
  matrixCache.copy(copyMatrix).makeTranslation(9999999, 9999999, 9999999);
125892
126229
  child.setMatrixAt(instanceIndex, matrixCache);
125893
- _this29.removeOutlineObject(child, instanceIndex);
126230
+ _this30.removeOutlineObject(child, instanceIndex);
125894
126231
  }
125895
126232
  });
125896
126233
  child.instanceMatrix.needsUpdate = true;
@@ -125915,7 +126252,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125915
126252
  this.refreshCollisionObbDebug();
125916
126253
  },
125917
126254
  showOutlinePass: function showOutlinePass(instanceId) {
125918
- var _this30 = this;
126255
+ var _this31 = this;
125919
126256
  var targetObj = this.getObjectByName(instanceId);
125920
126257
  targetObj.forEach(function (children) {
125921
126258
  if (children.isMesh) {
@@ -125923,27 +126260,27 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125923
126260
  var instanceInfo = (_children$userData3 = children.userData) === null || _children$userData3 === void 0 || (_children$userData3 = _children$userData3.instancesMap) === null || _children$userData3 === void 0 ? void 0 : _children$userData3.get(instanceId);
125924
126261
  if (!instanceInfo) return;
125925
126262
  var instanceIndex = instanceInfo.instanceIndex;
125926
- if (!_this30.isSourceVisible(instanceId, children)) {
125927
- _this30.removeOutlineObject(children, instanceIndex);
126263
+ if (!_this31.isSourceVisible(instanceId, children)) {
126264
+ _this31.removeOutlineObject(children, instanceIndex);
125928
126265
  return;
125929
126266
  }
125930
- if (!_this30.isCurrentVisible(instanceId, children)) {
125931
- _this30.removeOutlineObject(children, instanceIndex);
126267
+ if (!_this31.isCurrentVisible(instanceId, children)) {
126268
+ _this31.removeOutlineObject(children, instanceIndex);
125932
126269
  return;
125933
126270
  }
125934
- if (_this30.outlinePass) {
126271
+ if (_this31.outlinePass) {
125935
126272
  if (children.isInstancedMesh) {
125936
- var proxy = _this30.ensureOutlineInstanceProxy(children, instanceIndex);
125937
- _this30.pushOutlineTarget(proxy);
126273
+ var proxy = _this31.ensureOutlineInstanceProxy(children, instanceIndex);
126274
+ _this31.pushOutlineTarget(proxy);
125938
126275
  } else {
125939
- _this30.pushOutlineTarget(children);
126276
+ _this31.pushOutlineTarget(children);
125940
126277
  }
125941
126278
  }
125942
126279
  }
125943
126280
  });
125944
126281
  },
125945
126282
  hideOutlinePass: function hideOutlinePass(instanceId) {
125946
- var _this31 = this;
126283
+ var _this32 = this;
125947
126284
  var targetObj = this.getObjectByName(instanceId);
125948
126285
  targetObj.forEach(function (children) {
125949
126286
  if (children.isMesh) {
@@ -125951,7 +126288,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125951
126288
  var instanceInfo = (_children$userData4 = children.userData) === null || _children$userData4 === void 0 || (_children$userData4 = _children$userData4.instancesMap) === null || _children$userData4 === void 0 ? void 0 : _children$userData4.get(instanceId);
125952
126289
  if (!instanceInfo) return;
125953
126290
  var instanceIndex = instanceInfo.instanceIndex;
125954
- _this31.removeOutlineObject(children, instanceIndex);
126291
+ _this32.removeOutlineObject(children, instanceIndex);
125955
126292
  }
125956
126293
  });
125957
126294
  },
@@ -125974,17 +126311,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125974
126311
  },
125975
126312
  // 修改材质的自定义数据
125976
126313
  updateMaterialUserData: function updateMaterialUserData(list) {
125977
- var _this32 = this;
126314
+ var _this33 = this;
125978
126315
  var _loop3 = function _loop3() {
125979
126316
  var ele = list[index];
125980
126317
  var instanceId = ele.name;
125981
- var targetObj = _this32.getObjectByName(instanceId);
126318
+ var targetObj = _this33.getObjectByName(instanceId);
125982
126319
  var _loop4 = function _loop4(key) {
125983
126320
  switch (key) {
125984
126321
  case 'nColor':
125985
126322
  targetObj.forEach(function (children) {
125986
126323
  if (children.isMesh) {
125987
- children.material.userData[key] = new _this32.THREE.Color(ele.attr[key]);
126324
+ children.material.userData[key] = new _this33.THREE.Color(ele.attr[key]);
125988
126325
  }
125989
126326
  });
125990
126327
  break;
@@ -126000,12 +126337,12 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126000
126337
  },
126001
126338
  // 重置
126002
126339
  resetMaterialUserData: function resetMaterialUserData(list) {
126003
- var _this33 = this;
126340
+ var _this34 = this;
126004
126341
  console.log('resetMaterialUserData');
126005
126342
  var _loop5 = function _loop5() {
126006
126343
  var ele = list[index];
126007
126344
  var instanceId = ele.name;
126008
- var targetObj = _this33.getObjectByName(instanceId);
126345
+ var targetObj = _this34.getObjectByName(instanceId);
126009
126346
  var _loop6 = function _loop6(key) {
126010
126347
  switch (key) {
126011
126348
  case 'nColor':
@@ -126033,11 +126370,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126033
126370
  },
126034
126371
  // 清除上一次的属性修改操作 为了方便业务平台参数跟updateProperty方法的参数一样
126035
126372
  resetProperty: function resetProperty(list) {
126036
- var _this34 = this;
126373
+ var _this35 = this;
126037
126374
  var _loop7 = function _loop7() {
126038
126375
  var ele = list[index];
126039
126376
  var instanceId = ele.name;
126040
- var obj = _this34.getObjectByName(instanceId);
126377
+ var obj = _this35.getObjectByName(instanceId);
126041
126378
  if (obj) {
126042
126379
  for (var key in ele.attr) {
126043
126380
  switch (key) {
@@ -126050,12 +126387,12 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126050
126387
  var instanceIndex = instanceInfo.instanceIndex;
126051
126388
  children.setColorAt(instanceIndex, children.material.userData.nColor);
126052
126389
  children.instanceColor.needsUpdate = true;
126053
- if (_this34.outlinePass) {
126390
+ if (_this35.outlinePass) {
126054
126391
  if (children.isInstancedMesh) {
126055
- _this34.removeOutlineInstanceProxy(children, instanceIndex);
126392
+ _this35.removeOutlineInstanceProxy(children, instanceIndex);
126056
126393
  } else {
126057
- var idx = _this34.outlinePass.selectedObjects.indexOf(children);
126058
- if (idx !== -1) _this34.outlinePass.selectedObjects.splice(idx, 1);
126394
+ var idx = _this35.outlinePass.selectedObjects.indexOf(children);
126395
+ if (idx !== -1) _this35.outlinePass.selectedObjects.splice(idx, 1);
126059
126396
  }
126060
126397
  }
126061
126398
  }
@@ -126068,19 +126405,19 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126068
126405
  if (!instanceInfo) return;
126069
126406
  var instanceIndex = instanceInfo.instanceIndex,
126070
126407
  copyMatrix = instanceInfo.copyMatrix;
126071
- if (_this34.isSourceVisible(instanceId, children)) {
126408
+ if (_this35.isSourceVisible(instanceId, children)) {
126072
126409
  instanceInfo.visible = true;
126073
- var restoreMatrix = new _this34.THREE.Matrix4().copy(copyMatrix);
126410
+ var restoreMatrix = new _this35.THREE.Matrix4().copy(copyMatrix);
126074
126411
  children.setMatrixAt(instanceIndex, restoreMatrix);
126075
126412
  } else {
126076
126413
  instanceInfo.visible = false;
126077
- var offsetMatrix = new _this34.THREE.Matrix4().copy(copyMatrix).makeTranslation(9999999, 9999999, 9999999);
126414
+ var offsetMatrix = new _this35.THREE.Matrix4().copy(copyMatrix).makeTranslation(9999999, 9999999, 9999999);
126078
126415
  children.setMatrixAt(instanceIndex, offsetMatrix);
126079
- _this34.removeOutlineObject(children, instanceIndex);
126416
+ _this35.removeOutlineObject(children, instanceIndex);
126080
126417
  }
126081
126418
  children.instanceMatrix.needsUpdate = true;
126082
126419
  });
126083
- _this34.refreshCollisionObbDebug();
126420
+ _this35.refreshCollisionObbDebug();
126084
126421
  break;
126085
126422
  }
126086
126423
  case 'opacity':
@@ -126130,19 +126467,19 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126130
126467
  // 定位到模型
126131
126468
  // name 模型名称或运行态 uuid,可以是数组
126132
126469
  locateModel: function locateModel(name) {
126133
- var _this35 = this;
126470
+ var _this36 = this;
126134
126471
  if (!this.scene) return false;
126135
126472
  if (Array.isArray(name)) {
126136
126473
  var box3 = new this.THREE.Box3();
126137
126474
  name.forEach(function (n) {
126138
- var objectByUuid = _this35.getObjectByUuid(n);
126475
+ var objectByUuid = _this36.getObjectByUuid(n);
126139
126476
  if (objectByUuid) {
126140
- _this35.expandLocateBoxByObject(box3, objectByUuid);
126477
+ _this36.expandLocateBoxByObject(box3, objectByUuid);
126141
126478
  return;
126142
126479
  }
126143
- var arr = _this35.getObjectByName(n);
126480
+ var arr = _this36.getObjectByName(n);
126144
126481
  arr.forEach(function (o) {
126145
- _this35.expandLocateBoxByObject(box3, o);
126482
+ _this36.expandLocateBoxByObject(box3, o);
126146
126483
  });
126147
126484
  });
126148
126485
  if (!box3.isEmpty()) {
@@ -126187,14 +126524,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126187
126524
  }
126188
126525
  */
126189
126526
  updatePropertyByCustom: function updatePropertyByCustom(params) {
126190
- var _this36 = this;
126527
+ var _this37 = this;
126191
126528
  if (!this.scene) return;
126192
126529
  this.scene.traverse(function (child) {
126193
126530
  if (child.isMesh && child.userData[params.customName] === params.customValue) {
126194
126531
  for (var key in params.attr) {
126195
126532
  switch (key) {
126196
126533
  case 'color':
126197
- child.setColorAt(obj.userData.instanceIndex, new _this36.THREE.Color(params.attr[key]));
126534
+ child.setColorAt(obj.userData.instanceIndex, new _this37.THREE.Color(params.attr[key]));
126198
126535
  child.instanceColor.needsUpdate = true;
126199
126536
  break;
126200
126537
  case 'visible':
@@ -126277,14 +126614,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126277
126614
  passType: 要过滤的类型,默认是group,不返回group类型的实体
126278
126615
  */
126279
126616
  getObjectByName: function getObjectByName(name) {
126280
- var _this37 = this;
126617
+ var _this38 = this;
126281
126618
  var passType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'group';
126282
126619
  if (!this.scene) return [];
126283
126620
  if (Array.isArray(name)) {
126284
126621
  var result = [];
126285
126622
  var exist = new Set();
126286
126623
  name.forEach(function (item) {
126287
- _this37.getObjectByName(item, passType).forEach(function (obj) {
126624
+ _this38.getObjectByName(item, passType).forEach(function (obj) {
126288
126625
  if (!obj || exist.has(obj.uuid)) return;
126289
126626
  exist.add(obj.uuid);
126290
126627
  result.push(obj);
@@ -126322,12 +126659,12 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126322
126659
  return modelState.colorConfig;
126323
126660
  },
126324
126661
  addBypassCullingModelIds: function addBypassCullingModelIds(modelIds) {
126325
- var _this38 = this;
126662
+ var _this39 = this;
126326
126663
  var modelState = this.noObserver ? this.noObserver.modelStateManager : this.modelStateManager;
126327
126664
  if (!modelIds) return;
126328
126665
  if (Array.isArray(modelIds)) {
126329
126666
  modelIds.forEach(function (id) {
126330
- var modelId = _this38.formatModelId(id);
126667
+ var modelId = _this39.formatModelId(id);
126331
126668
  modelState.bypassCullingModelIds.add(modelId);
126332
126669
  });
126333
126670
  } else {
@@ -126340,12 +126677,12 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126340
126677
  return com_graphicsvue_type_script_lang_js_toConsumableArray(modelState.bypassCullingModelIds);
126341
126678
  },
126342
126679
  removeBypassCullingModelIds: function removeBypassCullingModelIds(modelIds) {
126343
- var _this39 = this;
126680
+ var _this40 = this;
126344
126681
  var modelState = this.noObserver ? this.noObserver.modelStateManager : this.modelStateManager;
126345
126682
  if (!modelIds) return;
126346
126683
  if (Array.isArray(modelIds)) {
126347
126684
  modelIds.forEach(function (id) {
126348
- var modelId = _this39.formatModelId(id);
126685
+ var modelId = _this40.formatModelId(id);
126349
126686
  modelState.bypassCullingModelIds.delete(modelId);
126350
126687
  });
126351
126688
  } else {
@@ -126359,7 +126696,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126359
126696
  },
126360
126697
  // 通过id删除对象
126361
126698
  removeObjectById: function removeObjectById(id) {
126362
- var _this40 = this;
126699
+ var _this41 = this;
126363
126700
  if (!this.scene) return;
126364
126701
  var array = this.getObjectByName(id);
126365
126702
  array.forEach(function (item) {
@@ -126369,13 +126706,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126369
126706
  if (item.isMesh) {
126370
126707
  item.clear();
126371
126708
  }
126372
- _this40.scene.remove(item);
126709
+ _this41.scene.remove(item);
126373
126710
  }
126374
126711
  });
126375
126712
  },
126376
126713
  // 通过名称删除对象
126377
126714
  removeObjectByName: function removeObjectByName(name) {
126378
- var _this41 = this;
126715
+ var _this42 = this;
126379
126716
  if (!this.scene) return;
126380
126717
  var array = this.getObjectByName(name);
126381
126718
  array.forEach(function (item) {
@@ -126384,17 +126721,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126384
126721
  if (item.isMesh) {
126385
126722
  item.clear();
126386
126723
  }
126387
- if (_this41.scene) _this41.scene.remove(item);
126724
+ if (_this42.scene) _this42.scene.remove(item);
126388
126725
  });
126389
126726
  },
126390
126727
  // 删除场景中所有的实体
126391
126728
  removeAll: function removeAll() {
126392
- var _this42 = this;
126729
+ var _this43 = this;
126393
126730
  return new Promise(function (resolve) {
126394
- if (_this42.scene) {
126395
- _this42.removeAllCustomElements();
126396
- _this42.removeTraverse();
126397
- _this42.removeModelByDocumentId();
126731
+ if (_this43.scene) {
126732
+ _this43.removeAllCustomElements();
126733
+ _this43.removeTraverse();
126734
+ _this43.removeModelByDocumentId();
126398
126735
  resolve();
126399
126736
  } else {
126400
126737
  resolve();
@@ -126402,7 +126739,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126402
126739
  });
126403
126740
  },
126404
126741
  removeTraverse: function removeTraverse() {
126405
- var _this43 = this;
126742
+ var _this44 = this;
126406
126743
  if (!this.modelGroup) return;
126407
126744
  var length = this.modelGroup.children.length;
126408
126745
  if (length > 0) {
@@ -126415,7 +126752,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126415
126752
  item.clear();
126416
126753
  item.material = null;
126417
126754
  item.geometry = null;
126418
- _this43.modelGroup && _this43.modelGroup.remove(item);
126755
+ _this44.modelGroup && _this44.modelGroup.remove(item);
126419
126756
  item = null;
126420
126757
  }
126421
126758
  });
@@ -126432,7 +126769,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126432
126769
  },
126433
126770
  // 销毁场景 释放内存
126434
126771
  destroyScene: function destroyScene() {
126435
- var _this44 = this;
126772
+ var _this45 = this;
126436
126773
  cancelAnimationFrame(this.animateId);
126437
126774
  this.disposeTransformControls();
126438
126775
  if (this.sceneCommandEventDisposers.length > 0) {
@@ -126447,11 +126784,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126447
126784
  }
126448
126785
  if (this.noObserver && this.noObserver.outlineInstanceProxyMap) {
126449
126786
  this.noObserver.outlineInstanceProxyMap.forEach(function (proxy) {
126450
- if (_this44.outlinePass) {
126451
- var idx = _this44.outlinePass.selectedObjects.indexOf(proxy);
126452
- if (idx !== -1) _this44.outlinePass.selectedObjects.splice(idx, 1);
126787
+ if (_this45.outlinePass) {
126788
+ var idx = _this45.outlinePass.selectedObjects.indexOf(proxy);
126789
+ if (idx !== -1) _this45.outlinePass.selectedObjects.splice(idx, 1);
126453
126790
  }
126454
- if (_this44.scene) _this44.scene.remove(proxy);
126791
+ if (_this45.scene) _this45.scene.remove(proxy);
126455
126792
  if (proxy && proxy.material && proxy.material.dispose) proxy.material.dispose();
126456
126793
  });
126457
126794
  this.noObserver.outlineInstanceProxyMap.clear();
@@ -126566,11 +126903,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126566
126903
  }
126567
126904
  */
126568
126905
  drawCurve: function drawCurve(params) {
126569
- var _this45 = this;
126906
+ var _this46 = this;
126570
126907
  this.removeObjectByName(params.name);
126571
126908
  var route = [];
126572
126909
  params.path.forEach(function (element) {
126573
- route.push(new _this45.THREE.Vector3(element.x, element.y, element.z));
126910
+ route.push(new _this46.THREE.Vector3(element.x, element.y, element.z));
126574
126911
  });
126575
126912
  if (route.length > 1) {
126576
126913
  this.curve = new this.THREE.CatmullRomCurve3(route);
@@ -126594,11 +126931,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126594
126931
  }
126595
126932
  */
126596
126933
  drawTextureCurve: function drawTextureCurve(params) {
126597
- var _this46 = this;
126934
+ var _this47 = this;
126598
126935
  this.removeObjectByName(params.name);
126599
126936
  var route = [];
126600
126937
  params.path.forEach(function (element) {
126601
- route.push(new _this46.THREE.Vector3(element.x, element.y, element.z));
126938
+ route.push(new _this47.THREE.Vector3(element.x, element.y, element.z));
126602
126939
  });
126603
126940
  // 画曲线
126604
126941
  if (route.length > 1) {
@@ -126703,14 +127040,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126703
127040
  * 参数val: 爆炸的值
126704
127041
  */
126705
127042
  globalBomb: function globalBomb(val) {
126706
- var _this47 = this;
127043
+ var _this48 = this;
126707
127044
  if (this.scene.children.length === 0) return;
126708
127045
  for (var i = 0; i < this.scene.children.length; i++) {
126709
127046
  console.log('this.scene', this.scene);
126710
127047
  this.scene.children[i].traverse(function (item) {
126711
127048
  if (!item.isMesh || !item.worldDir) return;
126712
127049
  // 爆炸公式
126713
- _this47.computedBomb(item, val);
127050
+ _this48.computedBomb(item, val);
126714
127051
  });
126715
127052
  }
126716
127053
  // this.timeRender();
@@ -126753,13 +127090,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126753
127090
  return object.type === 'CSS2DObject' || object.type === 'TransformControlsRoot';
126754
127091
  },
126755
127092
  getGlobalClippingRoots: function getGlobalClippingRoots() {
126756
- var _this48 = this;
127093
+ var _this49 = this;
126757
127094
  if (this.modelGroup && this.modelGroup.children && this.modelGroup.children.length) {
126758
127095
  return [this.modelGroup];
126759
127096
  }
126760
127097
  if (!this.scene || !this.scene.children || this.scene.children.length === 0) return [];
126761
127098
  return this.scene.children.filter(function (child) {
126762
- return !_this48.isGlobalClippingExcludedNode(child);
127099
+ return !_this49.isGlobalClippingExcludedNode(child);
126763
127100
  });
126764
127101
  },
126765
127102
  getGlobalClippingBox: function getGlobalClippingBox() {
@@ -126990,11 +127327,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126990
127327
  },
126991
127328
  // 开启第一视角
126992
127329
  startFirstPer: function startFirstPer(options) {
126993
- var _ref5 = options || {},
126994
- _ref5$moveSpeed = _ref5.moveSpeed,
126995
- moveSpeed = _ref5$moveSpeed === void 0 ? 200 : _ref5$moveSpeed,
126996
- _ref5$jumpSpeed = _ref5.jumpSpeed,
126997
- jumpSpeed = _ref5$jumpSpeed === void 0 ? 200 : _ref5$jumpSpeed;
127330
+ var _ref6 = options || {},
127331
+ _ref6$moveSpeed = _ref6.moveSpeed,
127332
+ moveSpeed = _ref6$moveSpeed === void 0 ? 200 : _ref6$moveSpeed,
127333
+ _ref6$jumpSpeed = _ref6.jumpSpeed,
127334
+ jumpSpeed = _ref6$jumpSpeed === void 0 ? 200 : _ref6$jumpSpeed;
126998
127335
  this.removeSpeed = this.getFirstPersonMoveSpeed(moveSpeed);
126999
127336
  var jumpConfig = this.getFirstPersonJumpConfig(jumpSpeed);
127000
127337
  this.upSpeed = jumpConfig.jumpSpeed;
@@ -127008,71 +127345,71 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127008
127345
  },
127009
127346
  // 页面是否锁定
127010
127347
  initPointerLock: function initPointerLock() {
127011
- var _this49 = this;
127348
+ var _this50 = this;
127012
127349
  this.home();
127013
127350
  setTimeout(function () {
127014
127351
  // 开启第一视角时,将相机与水平面保持水平
127015
- _this49.camera.rotation.x = 0;
127016
- _this49.camera.rotation.z = 0;
127017
- _this49.pointControls = new PointerLockControls(_this49.camera, _this49.renderer.domElement);
127018
- _this49.pointControls.lock();
127019
- if (!_this49._onFirstPersonChange) {
127020
- _this49._onFirstPersonChange = function () {
127021
- if (typeof _this49._cameraChangeObserver === 'function') {
127022
- _this49._cameraChangeObserver('firstPerson');
127352
+ _this50.camera.rotation.x = 0;
127353
+ _this50.camera.rotation.z = 0;
127354
+ _this50.pointControls = new PointerLockControls(_this50.camera, _this50.renderer.domElement);
127355
+ _this50.pointControls.lock();
127356
+ if (!_this50._onFirstPersonChange) {
127357
+ _this50._onFirstPersonChange = function () {
127358
+ if (typeof _this50._cameraChangeObserver === 'function') {
127359
+ _this50._cameraChangeObserver('firstPerson');
127023
127360
  }
127024
127361
  };
127025
127362
  }
127026
127363
  try {
127027
- _this49.pointControls.addEventListener('change', _this49._onFirstPersonChange);
127364
+ _this50.pointControls.addEventListener('change', _this50._onFirstPersonChange);
127028
127365
  } catch (e) {}
127029
127366
  // 锁定
127030
- _this49.pointControls.addEventListener('lock', function () {
127031
- _this49.detachTransformControls();
127032
- if (_this49.cameraControls) {
127033
- _this49.cameraControls.enabled = false;
127367
+ _this50.pointControls.addEventListener('lock', function () {
127368
+ _this50.detachTransformControls();
127369
+ if (_this50.cameraControls) {
127370
+ _this50.cameraControls.enabled = false;
127034
127371
  }
127035
- window.addEventListener('keydown', _this49.onKeyDown, false);
127036
- window.addEventListener('keyup', _this49.onKeyUp, false);
127037
- _this49.unbindScenePointerEvents();
127038
- if (typeof _this49._cameraChangeObserver === 'function') {
127039
- _this49._cameraChangeObserver('firstPersonLock');
127372
+ window.addEventListener('keydown', _this50.onKeyDown, false);
127373
+ window.addEventListener('keyup', _this50.onKeyUp, false);
127374
+ _this50.unbindScenePointerEvents();
127375
+ if (typeof _this50._cameraChangeObserver === 'function') {
127376
+ _this50._cameraChangeObserver('firstPersonLock');
127040
127377
  }
127041
127378
  });
127042
127379
  // 解锁
127043
- _this49.pointControls.addEventListener('unlock', function () {
127044
- _this49.firstPerSign = false;
127045
- if (_this49.cameraControls) {
127046
- _this49.cameraControls.enabled = true;
127380
+ _this50.pointControls.addEventListener('unlock', function () {
127381
+ _this50.firstPerSign = false;
127382
+ if (_this50.cameraControls) {
127383
+ _this50.cameraControls.enabled = true;
127047
127384
  }
127048
127385
  // 返回初始视角
127049
- if (_this49.cameraControls && _this49.camera && _this49.sceneBoundingBox) {
127050
- _this49.home();
127386
+ if (_this50.cameraControls && _this50.camera && _this50.sceneBoundingBox) {
127387
+ _this50.home();
127051
127388
  }
127052
127389
  try {
127053
- if (_this49._onFirstPersonChange && _this49.pointControls) {
127054
- _this49.pointControls.removeEventListener('change', _this49._onFirstPersonChange);
127390
+ if (_this50._onFirstPersonChange && _this50.pointControls) {
127391
+ _this50.pointControls.removeEventListener('change', _this50._onFirstPersonChange);
127055
127392
  }
127056
127393
  } catch (e) {}
127057
- if (_this49.noObserver) {
127058
- _this49.noObserver._firstPersonLastPos = null;
127394
+ if (_this50.noObserver) {
127395
+ _this50.noObserver._firstPersonLastPos = null;
127059
127396
  }
127060
127397
  setTimeout(function () {
127061
- window.removeEventListener('keydown', _this49.onKeyDown);
127062
- window.removeEventListener('keyup', _this49.onKeyUp);
127063
- if (_this49.renderer && _this49.renderer.domElement) {
127064
- _this49.bindScenePointerEvents();
127398
+ window.removeEventListener('keydown', _this50.onKeyDown);
127399
+ window.removeEventListener('keyup', _this50.onKeyUp);
127400
+ if (_this50.renderer && _this50.renderer.domElement) {
127401
+ _this50.bindScenePointerEvents();
127065
127402
  }
127066
- if (_this49.scene) {
127067
- _this49.ensureTransformSelectionValid();
127403
+ if (_this50.scene) {
127404
+ _this50.ensureTransformSelectionValid();
127068
127405
  }
127069
127406
  // this.timeRender()
127070
127407
  }, 0);
127071
- if (typeof _this49._cameraChangeObserver === 'function') {
127072
- _this49._cameraChangeObserver('firstPersonUnlock');
127408
+ if (typeof _this50._cameraChangeObserver === 'function') {
127409
+ _this50._cameraChangeObserver('firstPersonUnlock');
127073
127410
  }
127074
127411
  });
127075
- if (_this49.scene) _this49.scene.add(_this49.pointControls.object);
127412
+ if (_this50.scene) _this50.scene.add(_this50.pointControls.object);
127076
127413
  }, 10);
127077
127414
  },
127078
127415
  // 第一视角运动
@@ -127227,7 +127564,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127227
127564
  return this.scene && this.scene.children ? this.scene.children : [];
127228
127565
  },
127229
127566
  openMeasure: function openMeasure(type) {
127230
- var _this50 = this;
127567
+ var _this51 = this;
127231
127568
  var isClear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
127232
127569
  if (this.threeMeasure) {
127233
127570
  this.threeMeasure.close(isClear);
@@ -127239,7 +127576,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127239
127576
  case 'distance':
127240
127577
  this.threeMeasure = new measure_distance.MeasureDistance(this.renderer, this.scene, this.camera, this.instructions.offsetWidth, this.instructions.offsetHeight, {
127241
127578
  pickRoots: function pickRoots() {
127242
- return _this50.getMeasurePickRoots();
127579
+ return _this51.getMeasurePickRoots();
127243
127580
  }
127244
127581
  });
127245
127582
  this.threeMeasure.start();
@@ -127247,7 +127584,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127247
127584
  case 'area':
127248
127585
  this.threeMeasure = new measure_area.MeasureArea(this.renderer, this.scene, this.camera, this.instructions.offsetWidth, this.instructions.offsetHeight, {
127249
127586
  pickRoots: function pickRoots() {
127250
- return _this50.getMeasurePickRoots();
127587
+ return _this51.getMeasurePickRoots();
127251
127588
  }
127252
127589
  });
127253
127590
  this.threeMeasure.start();
@@ -127255,7 +127592,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127255
127592
  case 'angle':
127256
127593
  this.threeMeasure = new measure_angle.MeasureAngle(this.renderer, this.scene, this.camera, this.instructions.offsetWidth, this.instructions.offsetHeight, {
127257
127594
  pickRoots: function pickRoots() {
127258
- return _this50.getMeasurePickRoots();
127595
+ return _this51.getMeasurePickRoots();
127259
127596
  }
127260
127597
  });
127261
127598
  this.threeMeasure.start();
@@ -127263,7 +127600,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127263
127600
  case 'height':
127264
127601
  this.threeMeasure = new measure_height.MeasureHeight(this.renderer, this.scene, this.camera, this.instructions.offsetWidth, this.instructions.offsetHeight, {
127265
127602
  pickRoots: function pickRoots() {
127266
- return _this50.getMeasurePickRoots();
127603
+ return _this51.getMeasurePickRoots();
127267
127604
  }
127268
127605
  });
127269
127606
  this.threeMeasure.start();
@@ -127309,11 +127646,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127309
127646
  return object.name === 'measureObj' || userData.isMeasureObject === true;
127310
127647
  },
127311
127648
  removeMeasureObjectsFromScene: function removeMeasureObjectsFromScene() {
127312
- var _this51 = this;
127649
+ var _this52 = this;
127313
127650
  if (!this.scene) return;
127314
127651
  var measureObjects = [];
127315
127652
  this.scene.traverse(function (object) {
127316
- if (_this51.isMeasureObject(object)) {
127653
+ if (_this52.isMeasureObject(object)) {
127317
127654
  measureObjects.push(object);
127318
127655
  }
127319
127656
  });
@@ -127321,9 +127658,9 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127321
127658
  if (object.parent) {
127322
127659
  object.parent.remove(object);
127323
127660
  } else {
127324
- _this51.scene.remove(object);
127661
+ _this52.scene.remove(object);
127325
127662
  }
127326
- _this51.disposeMeasureObject(object);
127663
+ _this52.disposeMeasureObject(object);
127327
127664
  });
127328
127665
  },
127329
127666
  // 增加一个清除所有测量结果的方法,清理历史测量实例遗留的对象
@@ -127396,12 +127733,12 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127396
127733
  参数: object, 目标实体,
127397
127734
  */
127398
127735
  isolate: function isolate(object) {
127399
- var _this52 = this;
127736
+ var _this53 = this;
127400
127737
  if (!this.scene) return;
127401
127738
  // 隔离 将目标实体以外的实体隐藏掉
127402
127739
  this.scene.traverse(function (item) {
127403
127740
  if (item.isMesh && item.name !== object.name) {
127404
- var offsetMatrix = new _this52.THREE.Matrix4().copy(item.userData.copyMatrix).makeTranslation(9999999, 9999999, 9999999);
127741
+ var offsetMatrix = new _this53.THREE.Matrix4().copy(item.userData.copyMatrix).makeTranslation(9999999, 9999999, 9999999);
127405
127742
  item.setMatrixAt(item.userData.instanceIndex, offsetMatrix);
127406
127743
  item.instanceMatrix.needsUpdate = true;
127407
127744
  }
@@ -127409,7 +127746,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127409
127746
  },
127410
127747
  // 还原操作 将修改过的实体进行恢复
127411
127748
  restore: function restore() {
127412
- var _this53 = this;
127749
+ var _this54 = this;
127413
127750
  if (!this.scene) return;
127414
127751
  this.scene.traverse(function (item) {
127415
127752
  if (item.isMesh) {
@@ -127431,20 +127768,20 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127431
127768
  item.userData.translateMatrixInvert = null;
127432
127769
  }
127433
127770
  if (item.userData.combineMatrixInvert) {
127434
- _this53.rotateMesh(item, {
127771
+ _this54.rotateMesh(item, {
127435
127772
  x: 0,
127436
127773
  y: 0,
127437
127774
  z: 0
127438
127775
  });
127439
127776
  item.userData.combineMatrixInvert = null;
127440
127777
  }
127441
- var copyMatrix = _this53.getInstanceCopyMatrix(item, instanceId);
127778
+ var copyMatrix = _this54.getInstanceCopyMatrix(item, instanceId);
127442
127779
  if (!copyMatrix) return;
127443
- var sourceHidden = _this53.isSourceHiddenInstance(item, instanceId);
127444
- var offsetMatrix = new _this53.THREE.Matrix4().copy(copyMatrix);
127780
+ var sourceHidden = _this54.isSourceHiddenInstance(item, instanceId);
127781
+ var offsetMatrix = new _this54.THREE.Matrix4().copy(copyMatrix);
127445
127782
  if (sourceHidden) {
127446
127783
  offsetMatrix.makeTranslation(9999999, 9999999, 9999999);
127447
- _this53.removeOutlineInstanceProxy(item, item.userData.instanceIndex);
127784
+ _this54.removeOutlineInstanceProxy(item, item.userData.instanceIndex);
127448
127785
  }
127449
127786
  item.setMatrixAt(item.userData.instanceIndex, offsetMatrix);
127450
127787
  item.instanceMatrix.needsUpdate = true;
@@ -127453,7 +127790,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127453
127790
  },
127454
127791
  // 添加自定义模型, 暂时只支持glb、gltf格式
127455
127792
  addCustomModel: function addCustomModel(name, position, url) {
127456
- var _this54 = this;
127793
+ var _this55 = this;
127457
127794
  var scale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
127458
127795
  var immediately = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
127459
127796
  var callback = arguments.length > 5 ? arguments[5] : undefined;
@@ -127464,41 +127801,41 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127464
127801
  locationModel.scale.set(scale, scale, scale);
127465
127802
  locationModel.updateMatrixWorld();
127466
127803
  if (immediately) {
127467
- _this54.cameraControls.fitToSphere(gltf.this.scene, true);
127804
+ _this55.cameraControls.fitToSphere(gltf.this.scene, true);
127468
127805
  }
127469
127806
  // 动画混合器
127470
127807
  // 不参与裁剪
127471
127808
  locationModel.userData.cull = false;
127472
127809
  locationModel.name = name;
127473
- if (_this54.scene) _this54.scene.add(locationModel);
127474
- locationModel.position.copy(new _this54.THREE.Vector3(position.x, position.y, position.z));
127810
+ if (_this55.scene) _this55.scene.add(locationModel);
127811
+ locationModel.position.copy(new _this55.THREE.Vector3(position.x, position.y, position.z));
127475
127812
  if (gltf.animations.length > 0) {
127476
- var actionMixer = new _this54.THREE.AnimationMixer(gltf.this.scene);
127813
+ var actionMixer = new _this55.THREE.AnimationMixer(gltf.this.scene);
127477
127814
  var walkActive = actionMixer.clipAction(gltf.animations[0]);
127478
127815
  walkActive.play();
127479
- _this54.modelActive.push(walkActive);
127480
- _this54.modelActions.push(actionMixer);
127816
+ _this55.modelActive.push(walkActive);
127817
+ _this55.modelActions.push(actionMixer);
127481
127818
  }
127482
127819
  callback && callback();
127483
127820
  });
127484
127821
  },
127485
127822
  // 删除添加的自定义模型
127486
127823
  removeCustomModel: function removeCustomModel(name) {
127487
- var _this55 = this;
127824
+ var _this56 = this;
127488
127825
  var obj = this.getObjectByName(name);
127489
127826
  obj.forEach(function (item, index) {
127490
127827
  if (item.animations > 0) {
127491
127828
  item.removeFromParent();
127492
- _this55.modelActions[index].uncacheRoot(item);
127493
- _this55.modelActions[index].uncacheRoot(_this55.modelActive[index]);
127829
+ _this56.modelActions[index].uncacheRoot(item);
127830
+ _this56.modelActions[index].uncacheRoot(_this56.modelActive[index]);
127494
127831
  }
127495
127832
  item.traverse(function (child) {
127496
- if (child instanceof _this55.THREE.Mesh) {
127833
+ if (child instanceof _this56.THREE.Mesh) {
127497
127834
  child.geometry.dispose();
127498
127835
  child.material.dispose();
127499
127836
  }
127500
127837
  });
127501
- if (_this55.scene) _this55.scene.remove(item);
127838
+ if (_this56.scene) _this56.scene.remove(item);
127502
127839
  });
127503
127840
  this.modelActions.splice(0);
127504
127841
  this.modelActive.splice(0);
@@ -127560,7 +127897,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127560
127897
  return size;
127561
127898
  },
127562
127899
  animate: function animate() {
127563
- var _this56 = this;
127900
+ var _this57 = this;
127564
127901
  if (isDebug) {
127565
127902
  this.stats && this.stats.begin(); // 开始帧率统计
127566
127903
  }
@@ -127574,10 +127911,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127574
127911
  if (this.timeStamp > singleFrameTime) {
127575
127912
  if (this.modelActions.length > 0) {
127576
127913
  this.modelActions.forEach(function (item) {
127577
- item.update(_this56.timeStamp);
127914
+ item.update(_this57.timeStamp);
127578
127915
  });
127579
127916
  }
127580
127917
  this.cameraControls.enabled && this.cameraControls.update(this.timeStamp);
127918
+ this.observeCameraControlMove();
127581
127919
  // 计算相机近裁面到包围盒当前面的距离
127582
127920
  this.cameraTrack();
127583
127921
  this.firstPerspective();
@@ -127751,6 +128089,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127751
128089
  var onProgress = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
127752
128090
  var onComplete = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
127753
128091
  var loadingState = this.noObserver ? this.noObserver.batchLoadingState : this.batchLoadingState;
128092
+ var rect = this.renderer ? this.renderer.domElement.getBoundingClientRect() : {
128093
+ width: window.innerWidth,
128094
+ height: window.innerHeight
128095
+ };
128096
+ options.meshLineResolution = {
128097
+ width: rect.width || window.innerWidth || 1,
128098
+ height: rect.height || window.innerHeight || 1
128099
+ };
127754
128100
  // 如果已经在加载中,先停止之前的加载
127755
128101
  if (loadingState.isLoading) {
127756
128102
  this.stopBatchLoading('restart');
@@ -127932,25 +128278,25 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127932
128278
  * 加载下一批数据
127933
128279
  */
127934
128280
  loadNextBatch: function loadNextBatch() {
127935
- var _this57 = this;
128281
+ var _this58 = this;
127936
128282
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee1() {
127937
128283
  var loadingState, batch, _t3;
127938
128284
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context1) {
127939
128285
  while (1) switch (_context1.p = _context1.n) {
127940
128286
  case 0:
127941
- loadingState = _this57.noObserver ? _this57.noObserver.batchLoadingState : _this57.batchLoadingState;
127942
- if (_this57.isBatchLoadingSceneReady()) {
128287
+ loadingState = _this58.noObserver ? _this58.noObserver.batchLoadingState : _this58.batchLoadingState;
128288
+ if (_this58.isBatchLoadingSceneReady()) {
127943
128289
  _context1.n = 1;
127944
128290
  break;
127945
128291
  }
127946
- _this57.stopBatchLoading('scene_unavailable');
128292
+ _this58.stopBatchLoading('scene_unavailable');
127947
128293
  return _context1.a(2);
127948
128294
  case 1:
127949
128295
  if (!(!loadingState.isLoading || loadingState.currentBatch >= loadingState.pendingData.length)) {
127950
128296
  _context1.n = 2;
127951
128297
  break;
127952
128298
  }
127953
- _this57.completeBatchLoading();
128299
+ _this58.completeBatchLoading();
127954
128300
  return _context1.a(2);
127955
128301
  case 2:
127956
128302
  if (!loadingState.isPaused) {
@@ -127959,7 +128305,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127959
128305
  }
127960
128306
  // 如果暂停,延迟一段时间后再次检查
127961
128307
  loadingState.animationFrameId = requestAnimationFrame(function () {
127962
- _this57.loadNextBatch();
128308
+ _this58.loadNextBatch();
127963
128309
  });
127964
128310
  return _context1.a(2);
127965
128311
  case 3:
@@ -127969,7 +128315,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127969
128315
  }
127970
128316
  // 如果正在交互,延迟一段时间后再次检查
127971
128317
  loadingState.animationFrameId = requestAnimationFrame(function () {
127972
- _this57.loadNextBatch();
128318
+ _this58.loadNextBatch();
127973
128319
  });
127974
128320
  return _context1.a(2);
127975
128321
  case 4:
@@ -127978,13 +128324,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127978
128324
  _context1.n = 5;
127979
128325
  break;
127980
128326
  }
127981
- _this57.completeBatchLoading();
128327
+ _this58.completeBatchLoading();
127982
128328
  return _context1.a(2);
127983
128329
  case 5:
127984
128330
  _context1.p = 5;
127985
128331
  console.log('加载批次:', loadingState.currentBatch);
127986
128332
  _context1.n = 6;
127987
- return _this57.processWithMainThread(batch);
128333
+ return _this58.processWithMainThread(batch);
127988
128334
  case 6:
127989
128335
  if (loadingState.isLoading) {
127990
128336
  _context1.n = 7;
@@ -127992,11 +128338,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127992
128338
  }
127993
128339
  return _context1.a(2);
127994
128340
  case 7:
127995
- if (_this57.isBatchLoadingSceneReady()) {
128341
+ if (_this58.isBatchLoadingSceneReady()) {
127996
128342
  _context1.n = 8;
127997
128343
  break;
127998
128344
  }
127999
- _this57.stopBatchLoading('scene_unavailable');
128345
+ _this58.stopBatchLoading('scene_unavailable');
128000
128346
  return _context1.a(2);
128001
128347
  case 8:
128002
128348
  // 更新进度
@@ -128004,8 +128350,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128004
128350
  loadingState.currentBatch++;
128005
128351
 
128006
128352
  // 同步到响应式状态
128007
- _this57.batchLoadingState.loadedCount = loadingState.loadedCount;
128008
- _this57.batchLoadingState.currentBatch = loadingState.currentBatch;
128353
+ _this58.batchLoadingState.loadedCount = loadingState.loadedCount;
128354
+ _this58.batchLoadingState.currentBatch = loadingState.currentBatch;
128009
128355
 
128010
128356
  // 调用进度回调
128011
128357
  if (loadingState.onProgress) {
@@ -128019,7 +128365,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128019
128365
 
128020
128366
  // 使用 requestAnimationFrame 在下一帧继续加载
128021
128367
  loadingState.animationFrameId = requestAnimationFrame(function () {
128022
- _this57.loadNextBatch();
128368
+ _this58.loadNextBatch();
128023
128369
  });
128024
128370
  _context1.n = 10;
128025
128371
  break;
@@ -128030,7 +128376,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128030
128376
 
128031
128377
  // 继续下一批次
128032
128378
  loadingState.animationFrameId = requestAnimationFrame(function () {
128033
- _this57.loadNextBatch();
128379
+ _this58.loadNextBatch();
128034
128380
  });
128035
128381
  case 10:
128036
128382
  return _context1.a(2);
@@ -128042,20 +128388,20 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128042
128388
  * 使用主线程处理批次数据
128043
128389
  */
128044
128390
  processWithMainThread: function processWithMainThread(batch) {
128045
- var _this58 = this;
128391
+ var _this59 = this;
128046
128392
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee10() {
128047
128393
  var loadingState;
128048
128394
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context10) {
128049
128395
  while (1) switch (_context10.n) {
128050
128396
  case 0:
128051
- loadingState = _this58.noObserver ? _this58.noObserver.batchLoadingState : _this58.batchLoadingState;
128397
+ loadingState = _this59.noObserver ? _this59.noObserver.batchLoadingState : _this59.batchLoadingState;
128052
128398
  loadingState.options.batchSize = loadingState.batchSize;
128053
128399
  loadingState.options.resetState = loadingState.currentBatch === 0;
128054
128400
  // 使用原始的handleInstancedMeshModel方法
128055
128401
 
128056
128402
  isDebug && performance.mark('handleInstancedMeshModel-start');
128057
128403
  _context10.n = 1;
128058
- return handleInstancedMeshModel(_this58.modelGroup, batch.instances, batch.drawObjs, '', _this58.scene, loadingState.color, loadingState.meshNameConfig, '', loadingState.options);
128404
+ return handleInstancedMeshModel(_this59.modelGroup, batch.instances, batch.drawObjs, '', _this59.scene, loadingState.color, loadingState.meshNameConfig, '', loadingState.options);
128059
128405
  case 1:
128060
128406
  isDebug && performance.mark('handleInstancedMeshModel-end');
128061
128407
  isDebug && performance.measure('handleInstancedMeshModel', 'handleInstancedMeshModel-start', 'handleInstancedMeshModel-end');
@@ -128069,7 +128415,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128069
128415
  * 完成批量加载
128070
128416
  */
128071
128417
  completeBatchLoading: function completeBatchLoading() {
128072
- var _this59 = this;
128418
+ var _this60 = this;
128073
128419
  var loadingState = this.noObserver ? this.noObserver.batchLoadingState : this.batchLoadingState;
128074
128420
  if (!loadingState.isLoading) return;
128075
128421
  if (!this.isBatchLoadingSceneReady()) {
@@ -128102,17 +128448,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128102
128448
  this.modelGroup.traverse(function (child) {
128103
128449
  if (child.isMesh && !child.userData.batchInitDone) {
128104
128450
  markRendered(child);
128105
- var json = _this59.getMeshCenterAndVolume(child);
128106
- var meshBox3 = new _this59.THREE.Box3();
128451
+ var json = _this60.getMeshCenterAndVolume(child);
128452
+ var meshBox3 = new _this60.THREE.Box3();
128107
128453
  meshBox3.setFromObject(child);
128108
- var worldPs = new _this59.THREE.Vector3().addVectors(meshBox3.max, meshBox3.min).multiplyScalar(0.5);
128454
+ var worldPs = new _this60.THREE.Vector3().addVectors(meshBox3.max, meshBox3.min).multiplyScalar(0.5);
128109
128455
  if (isNaN(worldPs.x)) return;
128110
- child.worldDir = new _this59.THREE.Vector3().subVectors(worldPs, modelWorldPs).normalize();
128456
+ child.worldDir = new _this60.THREE.Vector3().subVectors(worldPs, modelWorldPs).normalize();
128111
128457
  child.userData.center = json.center;
128112
128458
  child.userData.worldPs = worldPs;
128113
- child.userData.oldPs = child.getWorldPosition(new _this59.THREE.Vector3());
128459
+ child.userData.oldPs = child.getWorldPosition(new _this60.THREE.Vector3());
128114
128460
  child.userData.box = json.box;
128115
- child.userData.position = new _this59.THREE.Vector3().copy(child.position);
128461
+ child.userData.position = new _this60.THREE.Vector3().copy(child.position);
128116
128462
  child.userData.translate = {
128117
128463
  x: 0,
128118
128464
  y: 0,
@@ -128204,7 +128550,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128204
128550
  * @param {Object} options - 配置项 { immediate: boolean }
128205
128551
  */
128206
128552
  setSystemInterruption: function setSystemInterruption(active) {
128207
- var _this60 = this;
128553
+ var _this61 = this;
128208
128554
  var reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'user_interaction';
128209
128555
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
128210
128556
  var loadingState = this.noObserver ? this.noObserver.batchLoadingState : this.batchLoadingState;
@@ -128270,7 +128616,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128270
128616
  if (loadingState.interactionState.wheelTimeout) return;
128271
128617
 
128272
128618
  // 2. 如果是 wheel 结束,但 this.userInteracting (this.camera) 还在进行,则不恢复
128273
- if (reason === 'wheel' && _this60.userInteracting) return;
128619
+ if (reason === 'wheel' && _this61.userInteracting) return;
128274
128620
 
128275
128621
  // 3. 检查是否有强制跳过标记 (可能由其他逻辑触发)
128276
128622
  // if (this.forceSkipRendering && reason !== 'user_interaction') return; // 视情况而定
@@ -128281,15 +128627,15 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128281
128627
  loadingState.pauseReason = '';
128282
128628
  loadingState.interactionState.isInteracting = false;
128283
128629
  loadingState.interactionState.interactionType = '';
128284
- _this60.forceSkipRendering = false;
128630
+ _this61.forceSkipRendering = false;
128285
128631
 
128286
128632
  // 恢复本地批量加载 (如果未完成)
128287
128633
  if (loadingState.isLoading && loadingState.currentBatch < loadingState.totalBatches) {
128288
- _this60.loadNextBatch();
128634
+ _this61.loadNextBatch();
128289
128635
  }
128290
128636
 
128291
128637
  // 恢复 StreamLoader
128292
- var streamLoader = _this60.noObserver.streamLoader;
128638
+ var streamLoader = _this61.noObserver.streamLoader;
128293
128639
  if (streamLoader && typeof streamLoader.handleControlEnd === 'function') {
128294
128640
  // StreamLoader 内部通常有防抖或延迟,这里直接通知结束即可
128295
128641
  streamLoader.handleControlEnd();
@@ -128342,7 +128688,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128342
128688
  * 滚轮交互结束的定时检测
128343
128689
  */
128344
128690
  scheduleWheelInteractionEnd: function scheduleWheelInteractionEnd(event) {
128345
- var _this61 = this;
128691
+ var _this62 = this;
128346
128692
  var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
128347
128693
  var loadingState = this.noObserver ? this.noObserver.batchLoadingState : this.batchLoadingState;
128348
128694
  if (loadingState.interactionState.wheelTimeout) {
@@ -128350,11 +128696,18 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128350
128696
  loadingState.interactionState.wheelTimeout = null;
128351
128697
  }
128352
128698
  loadingState.interactionState.wheelTimeout = setTimeout(function () {
128353
- _this61.$emit('wheelEnd', event);
128354
- _this61.endInteraction('wheel', event, {
128355
- immediateResume: false
128356
- });
128699
+ _this62.$emit('wheelEnd', event);
128357
128700
  loadingState.interactionState.wheelTimeout = null;
128701
+ if (_this62.isCameraControlMoveObserverEnabled()) {
128702
+ _this62.resetCameraControlMoveSnapshot(false);
128703
+ if (typeof _this62._cameraChangeObserver === 'function') {
128704
+ _this62._cameraChangeObserver('wheel');
128705
+ }
128706
+ } else {
128707
+ _this62.endInteraction('wheel', event, {
128708
+ immediateResume: false
128709
+ });
128710
+ }
128358
128711
  }, delay);
128359
128712
  },
128360
128713
  /**
@@ -128382,9 +128735,71 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128382
128735
  /**
128383
128736
  * 隐藏场景包围盒
128384
128737
  */
128738
+ refreshSceneBoundingBoxHelper: function refreshSceneBoundingBoxHelper() {
128739
+ var forceVisible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.boundingBoxVisible;
128740
+ if (this.sceneBoundingBoxHelper && this.scene) {
128741
+ this.scene.remove(this.sceneBoundingBoxHelper);
128742
+ this.sceneBoundingBoxHelper.geometry && this.sceneBoundingBoxHelper.geometry.dispose();
128743
+ if (Array.isArray(this.sceneBoundingBoxHelper.material)) {
128744
+ this.sceneBoundingBoxHelper.material.forEach(function (material) {
128745
+ material && material.dispose && material.dispose();
128746
+ });
128747
+ } else if (this.sceneBoundingBoxHelper.material && this.sceneBoundingBoxHelper.material.dispose) {
128748
+ this.sceneBoundingBoxHelper.material.dispose();
128749
+ }
128750
+ this.sceneBoundingBoxHelper = null;
128751
+ }
128752
+ if (!forceVisible || !this.scene || !this.sceneBoundingBox || !this.sceneBoundingBox.isBox3 || this.sceneBoundingBox.isEmpty()) {
128753
+ this.boundingBoxVisible = false;
128754
+ return false;
128755
+ }
128756
+ var helper = new this.THREE.Box3Helper(this.sceneBoundingBox, 0x00ff88);
128757
+ helper.name = 'sceneBoundingBoxHelper';
128758
+ helper.renderOrder = 999;
128759
+ if (helper.material) {
128760
+ helper.material.depthTest = false;
128761
+ helper.material.transparent = true;
128762
+ helper.material.opacity = 0.9;
128763
+ }
128764
+ this.scene.add(helper);
128765
+ this.sceneBoundingBoxHelper = helper;
128766
+ this.boundingBoxVisible = true;
128767
+ return true;
128768
+ },
128769
+ showSceneBoundingBox: function showSceneBoundingBox() {
128770
+ this.sceneBoundingBoxDebugEnabled = true;
128771
+ var shown = this.refreshSceneBoundingBoxHelper(true);
128772
+ if (!shown) {
128773
+ console.warn('sceneBoundingBox 无有效范围,无法绘制调试线框');
128774
+ return;
128775
+ }
128776
+ var size = this.sceneBoundingBox.getSize(new this.THREE.Vector3());
128777
+ var center = this.sceneBoundingBox.getCenter(new this.THREE.Vector3());
128778
+ console.log('sceneBoundingBox 线框已绘制', {
128779
+ size: {
128780
+ x: size.x,
128781
+ y: size.y,
128782
+ z: size.z
128783
+ },
128784
+ center: {
128785
+ x: center.x,
128786
+ y: center.y,
128787
+ z: center.z
128788
+ }
128789
+ });
128790
+ },
128385
128791
  hideSceneBoundingBox: function hideSceneBoundingBox() {
128792
+ this.sceneBoundingBoxDebugEnabled = false;
128386
128793
  if (this.sceneBoundingBoxHelper && this.scene) {
128387
128794
  this.scene.remove(this.sceneBoundingBoxHelper);
128795
+ this.sceneBoundingBoxHelper.geometry && this.sceneBoundingBoxHelper.geometry.dispose();
128796
+ if (Array.isArray(this.sceneBoundingBoxHelper.material)) {
128797
+ this.sceneBoundingBoxHelper.material.forEach(function (material) {
128798
+ material && material.dispose && material.dispose();
128799
+ });
128800
+ } else if (this.sceneBoundingBoxHelper.material && this.sceneBoundingBoxHelper.material.dispose) {
128801
+ this.sceneBoundingBoxHelper.material.dispose();
128802
+ }
128388
128803
  this.sceneBoundingBoxHelper = null;
128389
128804
  this.boundingBoxVisible = false;
128390
128805
  console.log('场景包围盒已隐藏');
@@ -128394,7 +128809,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128394
128809
  * 切换场景包围盒显示状态
128395
128810
  */
128396
128811
  toggleSceneBoundingBox: function toggleSceneBoundingBox() {
128397
- if (this.boundingBoxVisible) {
128812
+ if (this.sceneBoundingBoxDebugEnabled) {
128398
128813
  this.hideSceneBoundingBox();
128399
128814
  } else {
128400
128815
  this.showSceneBoundingBox();
@@ -128404,11 +128819,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128404
128819
  });
128405
128820
  // CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=script&lang=js
128406
128821
  /* harmony default export */ var components_com_graphicsvue_type_script_lang_js = (com_graphicsvue_type_script_lang_js);
128407
- // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=0&id=160a92af&prod&lang=scss&scoped=true
128408
- var com_graphicsvue_type_style_index_0_id_160a92af_prod_lang_scss_scoped_true = __webpack_require__("b1d7");
128822
+ // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=0&id=27a9d008&prod&lang=scss&scoped=true
128823
+ var com_graphicsvue_type_style_index_0_id_27a9d008_prod_lang_scss_scoped_true = __webpack_require__("5313");
128409
128824
 
128410
- // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=1&id=160a92af&prod&lang=css
128411
- var com_graphicsvue_type_style_index_1_id_160a92af_prod_lang_css = __webpack_require__("8130");
128825
+ // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=1&id=27a9d008&prod&lang=css
128826
+ var com_graphicsvue_type_style_index_1_id_27a9d008_prod_lang_css = __webpack_require__("7bbf");
128412
128827
 
128413
128828
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
128414
128829
  /* globals __VUE_SSR_CONTEXT__ */
@@ -128520,18 +128935,18 @@ function normalizeComponent(
128520
128935
 
128521
128936
  var component = normalizeComponent(
128522
128937
  components_com_graphicsvue_type_script_lang_js,
128523
- com_graphicsvue_type_template_id_160a92af_scoped_true_render,
128938
+ com_graphicsvue_type_template_id_27a9d008_scoped_true_render,
128524
128939
  staticRenderFns,
128525
128940
  false,
128526
128941
  null,
128527
- "160a92af",
128942
+ "27a9d008",
128528
128943
  null
128529
128944
 
128530
128945
  )
128531
128946
 
128532
128947
  /* harmony default export */ var com_graphics = (component.exports);
128533
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1a6f8321-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-flcanvas/index.vue?vue&type=template&id=e2de7752&scoped=true
128534
- var com_flcanvasvue_type_template_id_e2de7752_scoped_true_render = function render() {
128948
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3c0d80fb-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-flcanvas/index.vue?vue&type=template&id=41b98e1a&scoped=true
128949
+ var com_flcanvasvue_type_template_id_41b98e1a_scoped_true_render = function render() {
128535
128950
  var _vm = this,
128536
128951
  _c = _vm._self._c;
128537
128952
  return _c('div', {
@@ -128544,9 +128959,9 @@ var com_flcanvasvue_type_template_id_e2de7752_scoped_true_render = function rend
128544
128959
  }
128545
128960
  });
128546
128961
  };
128547
- var com_flcanvasvue_type_template_id_e2de7752_scoped_true_staticRenderFns = [];
128962
+ var com_flcanvasvue_type_template_id_41b98e1a_scoped_true_staticRenderFns = [];
128548
128963
 
128549
- // CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=template&id=e2de7752&scoped=true
128964
+ // CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=template&id=41b98e1a&scoped=true
128550
128965
 
128551
128966
  // EXTERNAL MODULE: ./node_modules/konva/lib/index.js
128552
128967
  var lib = __webpack_require__("362d");
@@ -133593,7 +134008,6 @@ function decimalToRGBHex(decimalValue) {
133593
134008
  };
133594
134009
  }
133595
134010
  function handleFn(functionName, recordDxf, entity, group, key, configParams, konvaLayer) {
133596
- console.log(functionName);
133597
134011
  switch (functionName) {
133598
134012
  case 'LINE':
133599
134013
  drawLine(recordDxf, entity, group, key, configParams);
@@ -133764,9 +134178,11 @@ function mtextContentAndFormattingToTextAndStyle(textAndControlChars, entity, co
133764
134178
  function drawArc(recordDxf, entity, group, key, configParams) {
133765
134179
  var color = entity.color;
133766
134180
  var rgb = decimalToRGBHex(color);
133767
- console.log(rgb);
133768
134181
  var hex = rgb.hex;
133769
134182
  var startAngle, endAngle;
134183
+ if (hex == '#FFFFFF') {
134184
+ hex = '#000';
134185
+ }
133770
134186
  if (entity.type === 'CIRCLE') {
133771
134187
  startAngle = entity.startAngle || 0;
133772
134188
  endAngle = startAngle + 2 * Math.PI;
@@ -133788,10 +134204,11 @@ function drawArc(recordDxf, entity, group, key, configParams) {
133788
134204
  name: key.replace(/\s*/g, ''),
133789
134205
  entityId: key,
133790
134206
  stroke: hex,
133791
- customColor: configParams ? configParams.color : '',
134207
+ customColor: configParams ? configParams.color : hex,
133792
134208
  strokeWidth: width,
133793
134209
  visible: configParams ? configParams.visible : true,
133794
- oldstrokeLength: width
134210
+ oldstrokeLength: width,
134211
+ isGroup: false
133795
134212
  });
133796
134213
  // if(group.attrs.isBlock){
133797
134214
  // let scale=group.scale();
@@ -133816,8 +134233,6 @@ function drawEllpse(recordDxf, entity, group, key, configParams) {
133816
134233
  var xrad = Math.sqrt(Math.pow(parseFloat(entity.majorAxisEndPoint.x), 2) + Math.pow(parseFloat(entity.majorAxisEndPoint.y), 2));
133817
134234
  var yrad = xrad * parseFloat(entity.axisRatio);
133818
134235
  var rotation = Math.atan2(parseFloat(entity.majorAxisEndPoint.y), parseFloat(entity.majorAxisEndPoint.x));
133819
- console.log(entity.startAngle);
133820
- console.log(entity.endAngle);
133821
134236
  var curve = new EllipseCurve(parseFloat(entity.center.x), parseFloat(entity.center.y), xrad, yrad, parseFloat(entity.startAngle), parseFloat(entity.endAngle), false,
133822
134237
  // Always counterclockwise
133823
134238
  rotation);
@@ -133834,10 +134249,11 @@ function drawEllpse(recordDxf, entity, group, key, configParams) {
133834
134249
  name: key.replace(/\s*/g, ''),
133835
134250
  entityId: key,
133836
134251
  stroke: configParams ? configParams.color : '#000',
133837
- customColor: configParams ? configParams.color : '',
134252
+ customColor: configParams ? configParams.color : '#000',
133838
134253
  strokeWidth: width,
133839
134254
  visible: configParams ? configParams.visible : true,
133840
- oldstrokeLength: width
134255
+ oldstrokeLength: width,
134256
+ isGroup: false
133841
134257
  });
133842
134258
  // let line = new Konva.Line({
133843
134259
  // name: key.replace(/\s*/g, ""),
@@ -133858,7 +134274,6 @@ function drawEllpse(recordDxf, entity, group, key, configParams) {
133858
134274
  function drawLine(recordDxf, entity, group, key, configParams) {
133859
134275
  var color = entity.color;
133860
134276
  var rgb = decimalToRGBHex(color);
133861
- console.log(rgb);
133862
134277
  var hex = rgb.hex;
133863
134278
  var x1 = entity.vertices[0].x;
133864
134279
  var y1 = entity.vertices[0].y;
@@ -133875,7 +134290,7 @@ function drawLine(recordDxf, entity, group, key, configParams) {
133875
134290
  entityId: key,
133876
134291
  isGroup: false,
133877
134292
  stroke: hex,
133878
- customColor: configParams ? configParams.color : '',
134293
+ customColor: configParams ? configParams.color : hex,
133879
134294
  strokeWidth: width,
133880
134295
  visible: configParams ? configParams.visible : true,
133881
134296
  oldstrokeLength: width
@@ -133905,7 +134320,6 @@ function drawLine(recordDxf, entity, group, key, configParams) {
133905
134320
  function entityFormatting_drawText(recordDxf, entity, group, key, configParams) {
133906
134321
  var color = entity.color;
133907
134322
  var rgb = decimalToRGBHex(color);
133908
- console.log(rgb);
133909
134323
  var hex = rgb.hex;
133910
134324
  if (hex == '#FFFFFF') {
133911
134325
  hex = '#000';
@@ -133923,13 +134337,14 @@ function entityFormatting_drawText(recordDxf, entity, group, key, configParams)
133923
134337
  align: 'left',
133924
134338
  verticalAlign: 'top',
133925
134339
  fill: hex,
133926
- customColor: configParams ? configParams.color : '',
134340
+ customColor: configParams ? configParams.color : hex,
133927
134341
  name: key.replace(/\s*/g, ''),
133928
134342
  entityId: key,
133929
134343
  fontFamily: 'SimSun',
133930
134344
  visible: configParams ? configParams.visible : true,
133931
134345
  stroke: hex,
133932
- strokeWidth: 0.1
134346
+ strokeWidth: 0.1,
134347
+ shapeType: 'text'
133933
134348
  });
133934
134349
  if (entity.xScale) {
133935
134350
  dim.scaleX(entity.xScale);
@@ -133982,7 +134397,8 @@ function entityFormatting_drawText(recordDxf, entity, group, key, configParams)
133982
134397
  name: key.replace(/\s*/g, ''),
133983
134398
  entityId: key,
133984
134399
  visible: configParams ? configParams.visible : true,
133985
- customColor: configParams ? configParams.color : ''
134400
+ customColor: configParams ? configParams.color : '',
134401
+ isGroup: true
133986
134402
  });
133987
134403
  g.add(dim);
133988
134404
  group.push({
@@ -133991,13 +134407,10 @@ function entityFormatting_drawText(recordDxf, entity, group, key, configParams)
133991
134407
  });
133992
134408
  // group.add(dim);
133993
134409
  }
133994
- function drawHatch(recordDxf, entity, group, key, configParams) {
133995
- console.log('hatch');
133996
- }
134410
+ function drawHatch(recordDxf, entity, group, key, configParams) {}
133997
134411
  function drawLwLine(recordDxf, entity, group, key, configParams) {
133998
134412
  var color = entity.color;
133999
134413
  var rgb = decimalToRGBHex(color);
134000
- console.log(rgb);
134001
134414
  var hex = rgb.hex;
134002
134415
  if (hex == '#FFFFFF') {
134003
134416
  hex = '#000';
@@ -134019,9 +134432,10 @@ function drawLwLine(recordDxf, entity, group, key, configParams) {
134019
134432
  points: list,
134020
134433
  closed: closed,
134021
134434
  name: key.replace(/\s*/g, ''),
134435
+ isGroup: false,
134022
134436
  entityId: key,
134023
134437
  stroke: hex,
134024
- customColor: configParams ? configParams.color : '',
134438
+ customColor: configParams ? configParams.color : hex,
134025
134439
  strokeWidth: width,
134026
134440
  visible: configParams ? configParams.visible : true,
134027
134441
  oldstrokeLength: width
@@ -134057,7 +134471,7 @@ function drawSpline(recordDxf, entity, group, key, configParams) {
134057
134471
  entityId: key,
134058
134472
  isGroup: false,
134059
134473
  stroke: configParams ? configParams : '#000',
134060
- customColor: configParams ? configParams.color : '',
134474
+ customColor: configParams ? configParams.color : '#000',
134061
134475
  strokeWidth: width,
134062
134476
  visible: configParams ? configParams.visible : true,
134063
134477
  oldstrokeLength: width
@@ -134847,6 +135261,7 @@ function downloadPDF(base64, fileName) {
134847
135261
  }
134848
135262
  });
134849
135263
  this.$nextTick(function () {
135264
+ console.log(_this2.$refs.svgDraw.clientHeight);
134850
135265
  _this2.konvaStage = new lib_default.a.Stage({
134851
135266
  className: 'stage',
134852
135267
  container: 'konva-container',
@@ -134867,7 +135282,6 @@ function downloadPDF(base64, fileName) {
134867
135282
  var scaleBy = 1.1;
134868
135283
  //初始化缩放方法
134869
135284
  _this2.konvaStage.on('wheel', function (e) {
134870
- console.log(e);
134871
135285
  e.evt.preventDefault();
134872
135286
  var oldScale = _this2.konvaStage.scaleX();
134873
135287
  var pointer = _this2.konvaStage.getPointerPosition();
@@ -134920,20 +135334,18 @@ function downloadPDF(base64, fileName) {
134920
135334
  this.konvaStage.setY(y2); // 750
134921
135335
  */
134922
135336
 
134923
- var _this2$calculateScale = _this2.calculateScaleAndPosition(_this2.bounds, _this2.konvaStage.width(), _this2.konvaStage.height(), 0.05 // 5% 边距
134924
- ),
134925
- scale = _this2$calculateScale.scale,
134926
- x = _this2$calculateScale.x,
134927
- y = _this2$calculateScale.y;
134928
- _this2.konvaStage.position({
134929
- x: x,
134930
- y: y
134931
- });
134932
- _this2.konvaStage.scale({
134933
- x: scale,
134934
- y: scale
134935
- });
134936
- _this2.konvaStage.batchDraw();
135337
+ // const { scale, x, y } = this.calculateScaleAndPosition(
135338
+ // this.bounds,
135339
+ // this.konvaStage.width(),
135340
+ // this.konvaStage.height(),
135341
+ // 0.05 // 5% 边距
135342
+ // );
135343
+
135344
+ // this.konvaStage.position({ x: x, y: y });
135345
+ // this.konvaStage.scale({ x: scale, y: scale });
135346
+
135347
+ // this.konvaStage.batchDraw();
135348
+ _this2.centerDraw();
134937
135349
  });
134938
135350
  _this2.konvaStage.on('click', function (e) {
134939
135351
  var target = _this2.konvaStage.mouseClickEndShape;
@@ -134944,6 +135356,23 @@ function downloadPDF(base64, fileName) {
134944
135356
  //销毁方法
134945
135357
 
134946
135358
  methods: {
135359
+ // 图纸居中展示
135360
+ centerDraw: function centerDraw() {
135361
+ var _this$calculateScaleA = this.calculateScaleAndPosition(this.bounds, this.konvaStage.width(), this.konvaStage.height(), 0.05 // 5% 边距
135362
+ ),
135363
+ scale = _this$calculateScaleA.scale,
135364
+ x = _this$calculateScaleA.x,
135365
+ y = _this$calculateScaleA.y;
135366
+ this.konvaStage.position({
135367
+ x: x,
135368
+ y: y
135369
+ });
135370
+ this.konvaStage.scale({
135371
+ x: scale,
135372
+ y: scale
135373
+ });
135374
+ this.konvaStage.batchDraw();
135375
+ },
134947
135376
  calculateScaleAndPosition: function calculateScaleAndPosition(contentBounds, stageWidth, stageHeight) {
134948
135377
  var padding = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.1;
134949
135378
  // 1. 计算内容的实际宽高
@@ -135045,7 +135474,7 @@ function downloadPDF(base64, fileName) {
135045
135474
  nodes[i].destroy();
135046
135475
  }
135047
135476
  }*/
135048
-
135477
+ this.bounds = null;
135049
135478
  this.konvaLayer.destroyChildren();
135050
135479
  var parser = new dxf_parser_dist();
135051
135480
  var dxf = parser.parse(data);
@@ -135057,10 +135486,10 @@ function downloadPDF(base64, fileName) {
135057
135486
  var entity = hatchEntitys[i];
135058
135487
  var layerConfig = this.recordLayerConfig[entity.layer];
135059
135488
  var configParams = layerConfig && Object.keys(layerConfig).length > 0 ? layerConfig : null;
135060
- var color = configParams ? configParams.color : "#000";
135489
+ var color = configParams ? configParams.color : '#000';
135061
135490
  var visible = configParams ? configParams.visible : true;
135062
- var name = entity.layer.replace(/\s*/g, "");
135063
- if (entity.type == "HATCH") {
135491
+ var name = entity.layer.replace(/\s*/g, '');
135492
+ if (entity.type == 'HATCH') {
135064
135493
  var boundaryLoops = entity.boundaryLoops;
135065
135494
  for (var j = 0; j < boundaryLoops.length; j++) {
135066
135495
  var list = [];
@@ -135197,75 +135626,78 @@ function downloadPDF(base64, fileName) {
135197
135626
  if (_this3.konvaLayer) _this3.konvaLayer.add(_entity2.obj);
135198
135627
  }
135199
135628
  }
135200
- if (group[0].stroke == undefined) {
135201
- console.log(group);
135202
- group[0].stroke = '#000';
135203
- }
135204
- var customShape = new lib_default.a.Shape({
135205
- x: 0,
135206
- y: 0,
135207
- strokeWidth: 0.2,
135208
- name: key.replace(/\s*/g, ''),
135209
- entityId: key,
135210
- stroke: group[0].stroke,
135211
- customColor: _configParams ? _configParams.color : '',
135212
- //visible: configParams ? configParams.visible :true,
135213
- sceneFunc: function sceneFunc(context, shape) {
135214
- context.beginPath();
135215
- for (var _i5 = 0; _i5 < group.length; _i5++) {
135216
- var _entity3 = group[_i5];
135217
- if (_entity3.type === 'line') {
135218
- context.strokeStyle = _entity3.stroke;
135219
- var x1 = _entity3.x1;
135220
- var y1 = _entity3.y1;
135221
- var x2 = _entity3.x2;
135222
- var y2 = _entity3.y2;
135223
- if (x1 != undefined && y1 != undefined && x2 != undefined && y2 != undefined) {
135224
- context.moveTo(x1, -parseFloat(y1));
135225
- context.lineTo(x2, -parseFloat(y2));
135629
+ if (group.length > 0) {
135630
+ var _group$;
135631
+ if ((_group$ = group[0]) !== null && _group$ !== void 0 && _group$.stroke) {
135632
+ group[0].stroke = '#000';
135633
+ }
135634
+ var customShape = new lib_default.a.Shape({
135635
+ x: 0,
135636
+ y: 0,
135637
+ strokeWidth: 0.2,
135638
+ name: key.replace(/\s*/g, ''),
135639
+ entityId: key,
135640
+ stroke: group[0].stroke,
135641
+ customColor: _configParams ? _configParams.color : group[0].stroke,
135642
+ //visible: configParams ? configParams.visible :true,
135643
+ sceneFunc: function sceneFunc(context, shape) {
135644
+ context.beginPath();
135645
+ for (var _i5 = 0; _i5 < group.length; _i5++) {
135646
+ var _entity3 = group[_i5];
135647
+ if (_entity3.type === 'line') {
135648
+ context.strokeStyle = _entity3.stroke;
135649
+ var x1 = _entity3.x1;
135650
+ var y1 = _entity3.y1;
135651
+ var x2 = _entity3.x2;
135652
+ var y2 = _entity3.y2;
135653
+ if (x1 != undefined && y1 != undefined && x2 != undefined && y2 != undefined) {
135654
+ context.moveTo(x1, -parseFloat(y1));
135655
+ context.lineTo(x2, -parseFloat(y2));
135656
+ }
135657
+ var v1 = {};
135658
+ v1.x = x1;
135659
+ v1.y = y1;
135660
+ var v2 = {};
135661
+ v2.x = x2;
135662
+ v2.y = y2;
135663
+ _this.updateBounds(v1);
135664
+ _this.updateBounds(v2);
135226
135665
  }
135227
- var v1 = {};
135228
- v1.x = x1;
135229
- v1.y = y1;
135230
- var v2 = {};
135231
- v2.x = x2;
135232
- v2.y = y2;
135233
- _this.updateBounds(v1);
135234
- _this.updateBounds(v2);
135235
- }
135236
- if (_entity3.type === 'polyline') {
135237
- context.strokeStyle = _entity3.stroke;
135238
- var flag = false;
135239
- var points = _entity3.points;
135240
- var closed = _entity3.closed;
135241
- for (var _j = 0; _j < points.length; _j++) {
135242
- var index = _j % 2;
135243
- if (index === 0) {
135244
- var _x = points[_j];
135245
- var _y = points[_j + 1];
135246
- var point = {};
135247
- point.x = _x;
135248
- point.y = _y;
135249
- _this.updateBounds(point);
135250
- if (_j === 0) {
135251
- context.moveTo(_x, _y);
135252
- } else {
135253
- context.lineTo(_x, _y);
135666
+ if (_entity3.type === 'polyline') {
135667
+ context.strokeStyle = _entity3.stroke;
135668
+ var flag = false;
135669
+ var points = _entity3.points;
135670
+ var closed = _entity3.closed;
135671
+ for (var _j = 0; _j < points.length; _j++) {
135672
+ var index = _j % 2;
135673
+ if (index === 0) {
135674
+ var _x = points[_j];
135675
+ var _y = points[_j + 1];
135676
+ var point = {};
135677
+ point.x = _x;
135678
+ point.y = _y;
135679
+ _this.updateBounds(point);
135680
+ if (_j === 0) {
135681
+ context.moveTo(_x, _y);
135682
+ } else {
135683
+ context.lineTo(_x, _y);
135684
+ }
135254
135685
  }
135255
- }
135256
- if (closed) {
135257
- if (_j === points.length - 1) {
135258
- context.lineTo(points[0], points[1]);
135686
+ if (closed) {
135687
+ if (_j === points.length - 1) {
135688
+ context.lineTo(points[0], points[1]);
135689
+ }
135259
135690
  }
135260
135691
  }
135261
135692
  }
135262
135693
  }
135263
- }
135264
- // context.closePath();
135265
- context.fillStrokeShape(shape);
135266
- }
135267
- });
135268
- if (_this3.konvaLayer) _this3.konvaLayer.add(customShape);
135694
+ // context.closePath();
135695
+ context.fillStrokeShape(shape);
135696
+ },
135697
+ shapeType: 'shape'
135698
+ });
135699
+ if (_this3.konvaLayer) _this3.konvaLayer.add(customShape);
135700
+ }
135269
135701
  }
135270
135702
  },
135271
135703
  _ret;
@@ -135289,18 +135721,20 @@ function downloadPDF(base64, fileName) {
135289
135721
  //平移视口
135290
135722
  var x = ((_this$$refs$svgDraw2 = this.$refs.svgDraw) === null || _this$$refs$svgDraw2 === void 0 ? void 0 : _this$$refs$svgDraw2.clientWidth) / 2 - (Math.ceil(boundingScale.width) / 2 + boundingScale.x / 2);
135291
135723
  var y = this.$refs.svgDraw.clientHeight / 2 - (Math.ceil(boundingScale.height) / 2 + boundingScale.y);
135292
- this.konvaStage.scale({
135293
- x: 2,
135294
- y: 2
135295
- });
135296
- this.konvaStage.setX(0);
135297
- this.konvaStage.setY(750); // 750
135298
135724
 
135299
- this.activedSvgPan.zoom.x = 0;
135300
- this.activedSvgPan.zoom.y = 750;
135301
- this.activedSvgPan.x = x;
135302
- this.activedSvgPan.y = x;
135725
+ // this.konvaStage.scale({
135726
+ // x: 2,
135727
+ // y: 2,
135728
+ // });
135729
+ // this.konvaStage.setX(0);
135730
+ // this.konvaStage.setY(750); // 750
135731
+
135732
+ // this.activedSvgPan.zoom.x = 0;
135733
+ // this.activedSvgPan.zoom.y = 750;
135734
+ // this.activedSvgPan.x = x;
135735
+ // this.activedSvgPan.y = x;
135303
135736
  setTimeout(function () {
135737
+ _this3.centerDraw();
135304
135738
  _this3.$emit('loaded');
135305
135739
  }, 100);
135306
135740
  },
@@ -135335,180 +135769,187 @@ function downloadPDF(base64, fileName) {
135335
135769
  toPdfs: function toPdfs(list) {
135336
135770
  var _this4 = this;
135337
135771
  var _this = this;
135338
- var pdf = new jspdf_es_min["a" /* default */]('l', 'px', [this.konvaStage.width(), this.konvaStage.height()]);
135339
- var exportPixelRatio = 2; // 可以 2/3/4 自己调
135340
-
135341
- for (var pageIdx = 0; pageIdx < list.length; pageIdx++) {
135342
- var data = list[pageIdx];
135343
- //先绘制图面
135344
- this.konvaLayer.destroyChildren();
135345
- var parser = new dxf_parser_dist();
135346
- var dxf = parser.parse(data);
135347
- var entities = formatEntity(dxf.entities);
135348
- var layers = dxf.tables.layer.layers;
135349
-
135350
- //先计算包围
135351
- for (var key in entities) {
135352
- if (entities[key]) {
135353
- var group = [];
135354
- var l = entities[key].length;
135355
- var layerConfig = this.recordLayerConfig[key];
135356
- var configParams = layerConfig && Object.keys(layerConfig).length > 0 ? layerConfig : null;
135357
- for (var i = 0; i < l; i++) {
135358
- var type = entities[key][i].type;
135359
- handleFn(type, dxf, entities[key][i], group, key, configParams, this.konvaLayer, this.recordLayerConfig);
135360
- }
135361
- for (var _i6 = 0; _i6 < group.length; _i6++) {
135362
- var entity = group[_i6];
135363
- if (entity.type === 'line') {
135364
- var x1 = entity.x1;
135365
- var y1 = entity.y1;
135366
- var x2 = entity.x2;
135367
- var y2 = entity.y2;
135368
- var v1 = {};
135369
- v1.x = x1;
135370
- v1.y = y1;
135371
- var v2 = {};
135372
- v2.x = x2;
135373
- v2.y = y2;
135374
- _this.updateBounds1(v1);
135375
- _this.updateBounds1(v2);
135376
- }
135377
- if (entity.type === 'polyline') {
135378
- var flag = false;
135379
- var points = entity.points;
135380
- var closed = entity.closed;
135381
- for (var j = 0; j < points.length; j++) {
135382
- var index = j % 2;
135383
- if (index === 0) {
135384
- var _x2 = points[j];
135385
- var _y2 = points[j + 1];
135386
- var point = {};
135387
- point.x = _x2;
135388
- point.y = _y2;
135389
- _this.updateBounds1(point);
135772
+ return new Promise(function (resolve, reject) {
135773
+ var pdf = new jspdf_es_min["a" /* default */]('l', 'px', [_this4.konvaStage.width(), _this4.konvaStage.height()]);
135774
+ var exportPixelRatio = 2; // 可以 2/3/4 自己调
135775
+ var index = 0;
135776
+ for (var pageIdx = 0; pageIdx < list.length; pageIdx++) {
135777
+ var data = list[pageIdx];
135778
+ //先绘制图面
135779
+ _this4.konvaLayer.destroyChildren();
135780
+ var parser = new dxf_parser_dist();
135781
+ var dxf = parser.parse(data);
135782
+ if (dxf.entities.length > 0) {
135783
+ var entities = formatEntity(dxf.entities);
135784
+ var layers = dxf.tables.layer.layers;
135785
+ //先计算包围
135786
+ for (var key in entities) {
135787
+ if (entities[key]) {
135788
+ var group = [];
135789
+ var l = entities[key].length;
135790
+ var layerConfig = _this4.recordLayerConfig[key];
135791
+ var configParams = layerConfig && Object.keys(layerConfig).length > 0 ? layerConfig : null;
135792
+ for (var i = 0; i < l; i++) {
135793
+ var type = entities[key][i].type;
135794
+ handleFn(type, dxf, entities[key][i], group, key, configParams, _this4.konvaLayer, _this4.recordLayerConfig);
135795
+ }
135796
+ for (var _i6 = 0; _i6 < group.length; _i6++) {
135797
+ var entity = group[_i6];
135798
+ if (entity.type === 'line') {
135799
+ var x1 = entity.x1;
135800
+ var y1 = entity.y1;
135801
+ var x2 = entity.x2;
135802
+ var y2 = entity.y2;
135803
+ var v1 = {};
135804
+ v1.x = x1;
135805
+ v1.y = y1;
135806
+ var v2 = {};
135807
+ v2.x = x2;
135808
+ v2.y = y2;
135809
+ _this.updateBounds1(v1);
135810
+ _this.updateBounds1(v2);
135811
+ }
135812
+ if (entity.type === 'polyline') {
135813
+ var flag = false;
135814
+ var points = entity.points;
135815
+ var closed = entity.closed;
135816
+ for (var j = 0; j < points.length; j++) {
135817
+ var _index = j % 2;
135818
+ if (_index === 0) {
135819
+ var _x2 = points[j];
135820
+ var _y2 = points[j + 1];
135821
+ var point = {};
135822
+ point.x = _x2;
135823
+ point.y = _y2;
135824
+ _this.updateBounds1(point);
135825
+ }
135826
+ }
135390
135827
  }
135391
135828
  }
135392
135829
  }
135393
135830
  }
135394
- }
135395
- }
135396
- console.log('bounds1');
135397
- console.log(_this.bounds1);
135398
- var _loop2 = function _loop2() {
135399
- if (entities[_key]) {
135400
- var _group = [];
135401
- var _l = entities[_key].length;
135402
- var _layerConfig2 = _this4.recordLayerConfig[_key];
135403
- var _configParams2 = _layerConfig2 && Object.keys(_layerConfig2).length > 0 ? _layerConfig2 : null;
135404
- for (var _i7 = 0; _i7 < _l; _i7++) {
135405
- var _type = entities[_key][_i7].type;
135406
- handleFn(_type, dxf, entities[_key][_i7], _group, _key, _configParams2, _this4.konvaLayer, _this4.recordLayerConfig);
135407
- }
135408
- if (!_this4.konvaLayer) return {
135409
- v: void 0
135410
- };
135411
- for (var _i8 = 0; _i8 < _group.length; _i8++) {
135412
- var _entity4 = _group[_i8];
135413
- if (_entity4.type === 'text') {
135414
- if (_this4.konvaLayer) _this4.konvaLayer.add(_entity4.obj);
135415
- }
135416
- }
135417
- if (_group[0].stroke == undefined) {
135418
- console.log(_group);
135419
- _group[0].stroke = '#000';
135420
- }
135421
- var customShape = new lib_default.a.Shape({
135422
- x: 0,
135423
- y: 0,
135424
- strokeWidth: 0.2,
135425
- name: _key.replace(/\s*/g, ''),
135426
- entityId: _key,
135427
- stroke: _group[0].stroke,
135428
- customColor: _configParams2 ? _configParams2.color : '',
135429
- //visible: configParams ? configParams.visible :true,
135430
- sceneFunc: function sceneFunc(context, shape) {
135431
- context.beginPath();
135432
- for (var _i9 = 0; _i9 < _group.length; _i9++) {
135433
- var _entity5 = _group[_i9];
135434
- if (_entity5.type === 'line') {
135435
- context.strokeStyle = _entity5.stroke;
135436
- var _x3 = _entity5.x1;
135437
- var _y3 = _entity5.y1;
135438
- var _x4 = _entity5.x2;
135439
- var _y4 = _entity5.y2;
135440
- if (_x3 != undefined && _y3 != undefined && _x4 != undefined && _y4 != undefined) {
135441
- context.moveTo(_x3, -parseFloat(_y3));
135442
- context.lineTo(_x4, -parseFloat(_y4));
135443
- }
135831
+ var _loop2 = function _loop2() {
135832
+ if (entities[_key]) {
135833
+ var _group = [];
135834
+ var _l = entities[_key].length;
135835
+ var _layerConfig2 = _this4.recordLayerConfig[_key];
135836
+ var _configParams2 = _layerConfig2 && Object.keys(_layerConfig2).length > 0 ? _layerConfig2 : null;
135837
+ for (var _i7 = 0; _i7 < _l; _i7++) {
135838
+ var _type = entities[_key][_i7].type;
135839
+ handleFn(_type, dxf, entities[_key][_i7], _group, _key, _configParams2, _this4.konvaLayer, _this4.recordLayerConfig);
135840
+ }
135841
+ if (!_this4.konvaLayer) return {
135842
+ v: void 0
135843
+ };
135844
+ for (var _i8 = 0; _i8 < _group.length; _i8++) {
135845
+ var _entity4 = _group[_i8];
135846
+ if (_entity4.type === 'text') {
135847
+ if (_this4.konvaLayer) _this4.konvaLayer.add(_entity4.obj);
135444
135848
  }
135445
- if (_entity5.type === 'polyline') {
135446
- context.strokeStyle = _entity5.stroke;
135447
- var _flag = false;
135448
- var _points = _entity5.points;
135449
- var _closed = _entity5.closed;
135450
- for (var _j2 = 0; _j2 < _points.length; _j2++) {
135451
- var _index = _j2 % 2;
135452
- if (_index === 0) {
135453
- var _x5 = _points[_j2];
135454
- var _y5 = _points[_j2 + 1];
135455
- if (_j2 === 0) {
135456
- context.moveTo(_x5, _y5);
135457
- } else {
135458
- context.lineTo(_x5, _y5);
135849
+ }
135850
+ if (_group.length > 0) {
135851
+ var _group$2;
135852
+ if ((_group$2 = _group[0]) !== null && _group$2 !== void 0 && _group$2.stroke) {
135853
+ _group[0].stroke = '#000';
135854
+ }
135855
+ var customShape = new lib_default.a.Shape({
135856
+ x: 0,
135857
+ y: 0,
135858
+ strokeWidth: 0.2,
135859
+ name: _key.replace(/\s*/g, ''),
135860
+ entityId: _key,
135861
+ stroke: _group[0].stroke,
135862
+ customColor: _configParams2 ? _configParams2.color : '',
135863
+ //visible: configParams ? configParams.visible :true,
135864
+ sceneFunc: function sceneFunc(context, shape) {
135865
+ context.beginPath();
135866
+ for (var _i9 = 0; _i9 < _group.length; _i9++) {
135867
+ var _entity5 = _group[_i9];
135868
+ if (_entity5.type === 'line') {
135869
+ context.strokeStyle = _entity5.stroke;
135870
+ var _x3 = _entity5.x1;
135871
+ var _y3 = _entity5.y1;
135872
+ var _x4 = _entity5.x2;
135873
+ var _y4 = _entity5.y2;
135874
+ if (_x3 != undefined && _y3 != undefined && _x4 != undefined && _y4 != undefined) {
135875
+ context.moveTo(_x3, -parseFloat(_y3));
135876
+ context.lineTo(_x4, -parseFloat(_y4));
135877
+ }
135459
135878
  }
135460
- }
135461
- if (_closed) {
135462
- if (_j2 === _points.length - 1) {
135463
- context.lineTo(_points[0], _points[1]);
135879
+ if (_entity5.type === 'polyline') {
135880
+ context.strokeStyle = _entity5.stroke;
135881
+ var _flag = false;
135882
+ var _points = _entity5.points;
135883
+ var _closed = _entity5.closed;
135884
+ for (var _j2 = 0; _j2 < _points.length; _j2++) {
135885
+ var _index2 = _j2 % 2;
135886
+ if (_index2 === 0) {
135887
+ var _x5 = _points[_j2];
135888
+ var _y5 = _points[_j2 + 1];
135889
+ if (_j2 === 0) {
135890
+ context.moveTo(_x5, _y5);
135891
+ } else {
135892
+ context.lineTo(_x5, _y5);
135893
+ }
135894
+ }
135895
+ if (_closed) {
135896
+ if (_j2 === _points.length - 1) {
135897
+ context.lineTo(_points[0], _points[1]);
135898
+ }
135899
+ }
135900
+ }
135464
135901
  }
135465
135902
  }
135903
+ // context.closePath();
135904
+ context.fillStrokeShape(shape);
135466
135905
  }
135467
- }
135906
+ });
135907
+ if (_this4.konvaLayer) _this4.konvaLayer.add(customShape);
135468
135908
  }
135469
- // context.closePath();
135470
- context.fillStrokeShape(shape);
135471
135909
  }
135472
- });
135473
- if (_this4.konvaLayer) _this4.konvaLayer.add(customShape);
135910
+ },
135911
+ _ret2;
135912
+ for (var _key in entities) {
135913
+ _ret2 = _loop2();
135914
+ if (_ret2) return _ret2.v;
135474
135915
  }
135475
- },
135476
- _ret2;
135477
- for (var _key in entities) {
135478
- _ret2 = _loop2();
135479
- if (_ret2) return _ret2.v;
135480
- }
135481
- var _this$calculateScaleA = this.calculateScaleAndPosition(_this.bounds1, this.konvaStage.width(), this.konvaStage.height(), 0.05 // 5% 边距
135482
- ),
135483
- scale = _this$calculateScaleA.scale,
135484
- x = _this$calculateScaleA.x,
135485
- y = _this$calculateScaleA.y;
135486
- console.log('test1:');
135487
- console.log(this.bounds1);
135488
- _this.bounds1 = null;
135489
- this.konvaStage.position({
135490
- x: x,
135491
- y: y
135492
- });
135493
- this.konvaStage.scale({
135494
- x: scale,
135495
- y: scale
135496
- });
135497
- this.konvaStage.batchDraw();
135498
- //添加成功移动视口位置
135916
+ var _this4$calculateScale = _this4.calculateScaleAndPosition(_this.bounds1, _this4.konvaStage.width(), _this4.konvaStage.height(), 0.05 // 5% 边距
135917
+ ),
135918
+ scale = _this4$calculateScale.scale,
135919
+ x = _this4$calculateScale.x,
135920
+ y = _this4$calculateScale.y;
135921
+ _this.bounds1 = null;
135922
+ _this4.konvaStage.position({
135923
+ x: x,
135924
+ y: y
135925
+ });
135926
+ _this4.konvaStage.scale({
135927
+ x: scale,
135928
+ y: scale
135929
+ });
135930
+ _this4.konvaStage.batchDraw();
135931
+ //添加成功移动视口位置 pageIdx === 0
135499
135932
 
135500
- if (pageIdx == 0) {
135501
- pdf.addImage(this.konvaStage.toDataURL({
135502
- pixelRatio: 2
135503
- }), 0, 0, this.konvaStage.width(), this.konvaStage.height());
135933
+ if (index === 0) {
135934
+ pdf.addImage(_this4.konvaStage.toDataURL({
135935
+ pixelRatio: 2
135936
+ }), 0, 0, _this4.konvaStage.width(), _this4.konvaStage.height());
135937
+ } else {
135938
+ pdf.addPage();
135939
+ pdf.addImage(_this4.konvaStage.toDataURL({
135940
+ pixelRatio: 2
135941
+ }), 0, 0, _this4.konvaStage.width(), _this4.konvaStage.height());
135942
+ }
135943
+ index++;
135944
+ }
135945
+ }
135946
+ if (index > 0) {
135947
+ pdf.save('批量导出.pdf');
135948
+ resolve();
135504
135949
  } else {
135505
- pdf.addPage();
135506
- pdf.addImage(this.konvaStage.toDataURL({
135507
- pixelRatio: 2
135508
- }), 0, 0, this.konvaStage.width(), this.konvaStage.height());
135950
+ reject('解析数据为空, 请检查数据再进行下载');
135509
135951
  }
135510
- }
135511
- pdf.save('批量导出.pdf');
135952
+ });
135512
135953
 
135513
135954
  // var imgData = canvas.toDataURL('image/png');
135514
135955
  //doc.text("Hello world!", 10, 10);
@@ -135523,15 +135964,49 @@ function downloadPDF(base64, fileName) {
135523
135964
  this.konvaLayer = null;
135524
135965
  this.konvaStage = null;
135525
135966
  },
135526
- beforeDestroy: function beforeDestroy() {
135527
- this.clearCache();
135967
+ // 更改图纸的色系 区分明暗两种 darkness 暗色系 bright 明亮
135968
+ setColorScheme: function setColorScheme(colorType) {
135969
+ var _this5 = this;
135970
+ // const backgroundColor = colorType === "darkness" ? "#000" : "transparent";
135971
+ var color = colorType === 'darkness' ? '#fff' : '#000';
135972
+ // konvaStage.container().style.background = backgroundColor;
135973
+ this.konvaLayer.children.forEach(function (item) {
135974
+ _this5.traverseLayer(item, color);
135975
+ });
135976
+ },
135977
+ traverseLayer: function traverseLayer(obj, color) {
135978
+ var _this6 = this;
135979
+ if (!obj.attrs.isGroup) {
135980
+ if (color === '#fff') {
135981
+ var setColor = obj.attrs.customColor === '#000' || obj.attrs.customColor === '#000000' || obj.attrs.customColor === 'rgb(0, 0, 0)' || obj.attrs.customColor === 'rgba(0, 0, 0, 1)' ? color : obj.attrs.customColor;
135982
+ if (obj.attrs.shapeType === 'hatch' || obj.attrs.shapeType === 'text') {
135983
+ obj.setFill(setColor);
135984
+ }
135985
+ obj.setStroke(setColor);
135986
+ obj.attrs.oldCustomColor = obj.attrs.customColor;
135987
+ obj.attrs.customColor = setColor;
135988
+ } else {
135989
+ obj.attrs.customColor = obj.attrs.oldCustomColor;
135990
+ if (obj.attrs.shapeType === 'hatch' || obj.attrs.shapeType === 'text') {
135991
+ obj.setFill(obj.attrs.customColor);
135992
+ }
135993
+ obj.setStroke(obj.attrs.customColor);
135994
+ }
135995
+ } else {
135996
+ obj.children.forEach(function (item) {
135997
+ _this6.traverseLayer(item, color);
135998
+ });
135999
+ }
135528
136000
  }
136001
+ },
136002
+ beforeDestroy: function beforeDestroy() {
136003
+ this.clearCache();
135529
136004
  }
135530
136005
  });
135531
136006
  // CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=script&lang=js
135532
136007
  /* harmony default export */ var components_com_flcanvasvue_type_script_lang_js = (com_flcanvasvue_type_script_lang_js);
135533
- // EXTERNAL MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=style&index=0&id=e2de7752&prod&lang=scss&scoped=true
135534
- var com_flcanvasvue_type_style_index_0_id_e2de7752_prod_lang_scss_scoped_true = __webpack_require__("affa");
136008
+ // EXTERNAL MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=style&index=0&id=41b98e1a&prod&lang=scss&scoped=true
136009
+ var com_flcanvasvue_type_style_index_0_id_41b98e1a_prod_lang_scss_scoped_true = __webpack_require__("c89b");
135535
136010
 
135536
136011
  // CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue
135537
136012
 
@@ -135544,17 +136019,17 @@ var com_flcanvasvue_type_style_index_0_id_e2de7752_prod_lang_scss_scoped_true =
135544
136019
 
135545
136020
  var com_flcanvas_component = normalizeComponent(
135546
136021
  components_com_flcanvasvue_type_script_lang_js,
135547
- com_flcanvasvue_type_template_id_e2de7752_scoped_true_render,
135548
- com_flcanvasvue_type_template_id_e2de7752_scoped_true_staticRenderFns,
136022
+ com_flcanvasvue_type_template_id_41b98e1a_scoped_true_render,
136023
+ com_flcanvasvue_type_template_id_41b98e1a_scoped_true_staticRenderFns,
135549
136024
  false,
135550
136025
  null,
135551
- "e2de7752",
136026
+ "41b98e1a",
135552
136027
  null
135553
136028
 
135554
136029
  )
135555
136030
 
135556
136031
  /* harmony default export */ var com_flcanvas = (com_flcanvas_component.exports);
135557
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1a6f8321-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/per-control.vue?vue&type=template&id=f547d5c6&scoped=true
136032
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3c0d80fb-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/per-control.vue?vue&type=template&id=f547d5c6&scoped=true
135558
136033
  var per_controlvue_type_template_id_f547d5c6_scoped_true_render = function render() {
135559
136034
  var _vm = this,
135560
136035
  _c = _vm._self._c;
@@ -135662,7 +136137,7 @@ var per_control_component = normalizeComponent(
135662
136137
  )
135663
136138
 
135664
136139
  /* harmony default export */ var per_control = (per_control_component.exports);
135665
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1a6f8321-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/pid.vue?vue&type=template&id=2572c0e2&scoped=true
136140
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3c0d80fb-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/pid.vue?vue&type=template&id=2572c0e2&scoped=true
135666
136141
  var pidvue_type_template_id_2572c0e2_scoped_true_render = function render() {
135667
136142
  var _vm = this,
135668
136143
  _c = _vm._self._c;
@@ -135709,7 +136184,7 @@ var browserify_default = /*#__PURE__*/__webpack_require__.n(browserify);
135709
136184
  var html2canvas = __webpack_require__("c0e9");
135710
136185
  var html2canvas_default = /*#__PURE__*/__webpack_require__.n(html2canvas);
135711
136186
 
135712
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1a6f8321-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/component/ann-tool.vue?vue&type=template&id=4b17bce0&scoped=true
136187
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3c0d80fb-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/component/ann-tool.vue?vue&type=template&id=4b17bce0&scoped=true
135713
136188
  var ann_toolvue_type_template_id_4b17bce0_scoped_true_render = function render() {
135714
136189
  var _vm = this,
135715
136190
  _c = _vm._self._c;