@kq_npm/client3d_webgl_vue 4.5.55 → 4.5.57

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.
Files changed (82) hide show
  1. package/adddata/index.js +189 -21
  2. package/airspacegridoccupancyquery/index.js +1977 -0
  3. package/airspacegridoccupancyquery/style/airspacegridoccupancyquery.css +1 -0
  4. package/airspacegridoccupancyquery/style/index.js +3 -0
  5. package/airspaceprofileanalysis/index.js +1870 -0
  6. package/airspaceprofileanalysis/style/airspaceprofileanalysis.css +1 -0
  7. package/airspaceprofileanalysis/style/index.js +3 -0
  8. package/aspectanalysis/index.js +25 -7
  9. package/baseterraingallery/index.js +16 -4
  10. package/boxclip/index.js +58 -16
  11. package/buildpointmodel/index.js +3207 -230
  12. package/buildpointmodel/style/buildpointmodel.css +1 -1
  13. package/buildpolygonmodel/index.js +205 -81
  14. package/buildpolylinemodel/index.js +346 -70
  15. package/clientPrint/index.js +32440 -2337
  16. package/comparemap/index.js +132 -60
  17. package/compass/index.js +16 -6
  18. package/excavatefillanalysis/index.js +51 -7
  19. package/fixedzoomin/index.js +24 -7
  20. package/fixedzoomout/index.js +25 -7
  21. package/flight/index.js +113 -26
  22. package/floodanalysis/index.js +79 -14
  23. package/geologicalbodyanalysis/index.js +41 -5
  24. package/gpuspatialquery/index.js +127 -19
  25. package/gridoccupancyquery/index.js +627 -0
  26. package/gridoccupancyquery/style/gridoccupancyquery.css +1 -0
  27. package/gridoccupancyquery/style/index.js +3 -0
  28. package/hawkeye/index.js +20 -2
  29. package/headertemp/index.js +7 -2
  30. package/heatmap3d/index.js +282 -158
  31. package/index.js +32440 -2337
  32. package/isolineanalysis/index.js +113 -38
  33. package/light/index.js +80 -22
  34. package/limitheightanalysis/index.js +30 -10
  35. package/lowaltitudefeature/index.js +5027 -0
  36. package/lowaltitudefeature/style/index.js +3 -0
  37. package/lowaltitudefeature/style/lowaltitudefeature.css +1 -0
  38. package/measure/index.js +60 -19
  39. package/modelFlat/index.js +48 -8
  40. package/modeledit/index.js +38 -4
  41. package/modelexcavate/index.js +48 -7
  42. package/modelfilter/index.js +51 -8
  43. package/modelmaterialedit/index.js +127 -25
  44. package/modelprofileanalysis/index.js +51 -14
  45. package/modelselect/index.js +34 -3
  46. package/modelstyleedit/index.js +39 -3
  47. package/modeltransform/index.js +79 -14
  48. package/package.json +1 -1
  49. package/particleeffect/index.js +83 -17
  50. package/planeclip/index.js +66 -17
  51. package/pointcloudrender/index.js +134 -15
  52. package/radarscananalysis/index.js +35 -3
  53. package/resetview/index.js +14 -6
  54. package/roller/index.js +55 -18
  55. package/scaneffect/index.js +98 -29
  56. package/sceneadvancedtoimage/index.js +32 -6
  57. package/sceneapp/index.js +32440 -2337
  58. package/sceneset/index.js +141 -71
  59. package/scenetohdimage/index.js +23 -3
  60. package/sceneview/index.js +32440 -2337
  61. package/sceneview/style/sceneview.css +1 -1
  62. package/screenshot/index.js +44 -11
  63. package/shadowanalysis/index.js +79 -19
  64. package/sightlineanalysis/index.js +66 -15
  65. package/skylineanalysis/index.js +20 -4
  66. package/slopeanalysis/index.js +75 -16
  67. package/slopeaspectanalysis/index.js +128 -26
  68. package/statusbar/index.js +80 -67
  69. package/style.css +1 -1
  70. package/terrainoperation/index.js +39 -7
  71. package/terrainprofileanalysis/index.js +43 -5
  72. package/toolbarapp/index.js +32440 -2337
  73. package/toolboxapp/index.js +32440 -2337
  74. package/typhoontrac/index.js +134 -16
  75. package/underground/index.js +8 -2
  76. package/videofusion/index.js +164 -79
  77. package/videoproject/index.js +77 -23
  78. package/viewshedanalysis/index.js +61 -14
  79. package/weathereffect/index.js +73 -18
  80. package/webgl.es.js +866 -16
  81. package/windyslicing/index.js +258 -54
  82. package/wireframesketch/index.js +25 -8
@@ -40,10 +40,18 @@ const MATERIAL_PART = {
40
40
  DEFAULT: -1
41
41
  };
42
42
  class ModelMaterialEditViewModel {
43
+ /**
44
+ * @description 构造函数,初始化场景视图与表单配置
45
+ * @param {Object} sceneView 三维场景视图
46
+ * @param {Object} formItem 表单配置项
47
+ */
43
48
  constructor(sceneView, formItem) {
44
49
  this._options = {};
50
+ // 表单配置项
45
51
  this._sceneView = null;
52
+ // 三维场景视图
46
53
  this._buildModels = [];
54
+ // 当前编辑的构建模型集合
47
55
  this._language = null;
48
56
  this._sceneView = sceneView;
49
57
  this._options = formItem;
@@ -53,14 +61,22 @@ class ModelMaterialEditViewModel {
53
61
  this._language = locale;
54
62
  }
55
63
 
56
- // 获取模型
64
+ /**
65
+ * @description 获取模型
66
+ * @param {Array} keys 模型 key 列表
67
+ * @returns {Array} 匹配到的构建模型集合
68
+ */
57
69
  getBuildModels(keys) {
58
70
  const primitives = this._sceneView?._viewer?.scene?.primitives?._primitives ?? [];
59
71
  this._buildModels = primitives.filter(element => element?._key && keys.includes(element._key));
60
72
  return this._buildModels;
61
73
  }
62
74
 
63
- // 参数切换
75
+ /**
76
+ * @description 参数切换
77
+ * @param {String} key 参数名
78
+ * @param {*} val 参数值
79
+ */
64
80
  paramsChanged(key, val) {
65
81
  if (!this._buildModels?.length) {
66
82
  this._showNoDataMessage();
@@ -79,7 +95,10 @@ class ModelMaterialEditViewModel {
79
95
  }
80
96
  }
81
97
 
82
- // 处理材质变更
98
+ /**
99
+ * @description 处理材质变更
100
+ * @param {*} val 材质值
101
+ */
83
102
  _handleMaterialChange(val) {
84
103
  this._buildModels.forEach(element => {
85
104
  const materialConfig = this._getMaterialConfig(element);
@@ -120,11 +139,21 @@ class ModelMaterialEditViewModel {
120
139
  });
121
140
  }
122
141
 
123
- // 处理道路放样的重复模式
142
+ /**
143
+ * @description 处理道路放样的重复模式
144
+ * @param {Object} element 模型对象
145
+ * @param {Number} materialPart 材质部位
146
+ * @param {Number} repeatBySize 重复模式(0:按尺寸,1:按次数)
147
+ * @param {Number} repeatWidth 重复宽度
148
+ * @param {Number} repeatHeight 重复高度
149
+ * @param {Number} repeatCountX X 方向重复次数
150
+ * @param {Number} repeatCountY Y 方向重复次数
151
+ */
124
152
  _handleRoadLoftingRepeat(element, materialPart, repeatBySize, repeatWidth, repeatHeight, repeatCountX, repeatCountY) {
125
153
  const isRepeatBySize = repeatBySize === REPEAT_MODE.BY_SIZE;
126
154
  element.repeatBySize = isRepeatBySize;
127
155
  if (materialPart === MATERIAL_PART.WALL) {
156
+ // 墙体部位:按尺寸或按次数设置纹理重复参数
128
157
  if (isRepeatBySize) {
129
158
  element.wallTextureWidth = repeatWidth || 3;
130
159
  element.wallTextureHeight = repeatHeight || 3;
@@ -133,6 +162,7 @@ class ModelMaterialEditViewModel {
133
162
  element.wallTextureRepeatY = repeatCountY || 1;
134
163
  }
135
164
  } else if (materialPart === MATERIAL_PART.WALL_TOP) {
165
+ // 墙顶部位:按尺寸或按次数设置纹理重复参数
136
166
  if (isRepeatBySize) {
137
167
  element.wallTopTextureWidth = repeatWidth || 3;
138
168
  element.wallTopTextureHeight = repeatHeight || 3;
@@ -143,7 +173,14 @@ class ModelMaterialEditViewModel {
143
173
  }
144
174
  }
145
175
 
146
- // 处理管道放样的重复模式
176
+ /**
177
+ * @description 处理管道放样的重复模式
178
+ * @param {Object} element 模型对象
179
+ * @param {Number} materialPart 材质部位
180
+ * @param {Number} repeatBySize 重复模式(0:按尺寸,1:按次数)
181
+ * @param {Number} repeatCountX X 方向重复次数
182
+ * @param {Number} repeatCountY Y 方向重复次数
183
+ */
147
184
  _handlePipelineLoftingRepeat(element, materialPart, repeatBySize, repeatCountX, repeatCountY) {
148
185
  if (repeatBySize === REPEAT_MODE.BY_COUNT && materialPart === MATERIAL_PART.DEFAULT) {
149
186
  element.repeatX = repeatCountX || 1;
@@ -151,7 +188,10 @@ class ModelMaterialEditViewModel {
151
188
  }
152
189
  }
153
190
 
154
- // 处理颜色变更
191
+ /**
192
+ * @description 处理颜色变更
193
+ * @param {String} val 颜色值
194
+ */
155
195
  _handleColorChange(val) {
156
196
  this._buildModels.forEach(element => {
157
197
  if (element) {
@@ -160,7 +200,11 @@ class ModelMaterialEditViewModel {
160
200
  });
161
201
  }
162
202
 
163
- // 获取材质配置
203
+ /**
204
+ * @description 获取材质配置
205
+ * @param {Object} element 模型对象
206
+ * @returns {Object} 材质配置
207
+ */
164
208
  _getMaterialConfig(element) {
165
209
  const modelingType = element?._modelingType;
166
210
  const materialPart = this._options?.materialPart;
@@ -168,7 +212,12 @@ class ModelMaterialEditViewModel {
168
212
  return config[materialPart];
169
213
  }
170
214
 
171
- // 应用材质配置
215
+ /**
216
+ * @description 应用材质配置
217
+ * @param {Object} element 模型对象
218
+ * @param {Object} config 材质配置
219
+ * @param {*} val 材质值
220
+ */
172
221
  _applyMaterialConfig(element, config, val) {
173
222
  const {
174
223
  key,
@@ -197,9 +246,13 @@ class ModelMaterialEditViewModel {
197
246
  type: "info"
198
247
  });
199
248
  }
249
+
250
+ // 清空构建模型集合
200
251
  clear() {
201
252
  this._buildModels = [];
202
253
  }
254
+
255
+ // 销毁并清理资源
203
256
  destroy() {
204
257
  this.clear();
205
258
  // 可选的清理其他资源
@@ -209,6 +262,7 @@ class ModelMaterialEditViewModel {
209
262
  }
210
263
  }
211
264
  exports["default"] = ModelMaterialEditViewModel;
265
+ // 语言配置
212
266
  // 材质配置映射
213
267
  ModelMaterialEditViewModel.MATERIAL_CONFIG = {
214
268
  roadLofting: {
@@ -303,10 +357,11 @@ var _default = exports.A = {
303
357
  emit: __emit
304
358
  }) {
305
359
  const props = __props;
306
- const refreshKey = (0, _vue.ref)(0);
307
- const emit = __emit;
360
+ const refreshKey = (0, _vue.ref)(0); // 级联选择器刷新 key
361
+ const emit = __emit; // 自定义事件:v-model 更新、目录选中
308
362
  const selectedPath = (0, _vue.ref)(props.modelValue); // 使用 props.modelValue
309
363
 
364
+ // 级联选择器字段映射配置
310
365
  const cascaderProps = {
311
366
  value: "id",
312
367
  label: "name",
@@ -315,6 +370,8 @@ var _default = exports.A = {
315
370
  emitPath: true,
316
371
  multiple: false
317
372
  };
373
+
374
+ // 目录树选项数据(仅保留有子节点的目录)
318
375
  const directoryOptions = (0, _vue.computed)(() => {
319
376
  const filterDirectories = nodes => {
320
377
  if (!nodes) return [];
@@ -334,7 +391,11 @@ var _default = exports.A = {
334
391
  return filterDirectories(props.materials);
335
392
  });
336
393
 
337
- // 根据路径查找节点对象(实时查找)
394
+ /**
395
+ * @description 根据路径查找节点对象(实时查找)
396
+ * @param {Array} path 路径 id 数组
397
+ * @returns {Object|null} 节点对象
398
+ */
338
399
  const getNodeByPath = path => {
339
400
  if (!path || path.length === 0) return null;
340
401
  const findNode = (nodes, pathArray) => {
@@ -349,7 +410,10 @@ var _default = exports.A = {
349
410
  return findNode(props.materials, path);
350
411
  };
351
412
 
352
- // 选中目录事件
413
+ /**
414
+ * @description 选中目录事件
415
+ * @param {Array} pathValues 选中路径 id 数组
416
+ */
353
417
  const handleDirectoryChange = pathValues => {
354
418
  if (!pathValues || pathValues.length === 0) {
355
419
  // 清除操作时,重置为根目录
@@ -372,6 +436,11 @@ var _default = exports.A = {
372
436
  });
373
437
  }
374
438
  };
439
+ /**
440
+ * @description 根据名称查找节点对象
441
+ * @param {String} name 节点名称
442
+ * @returns {Object|null} 节点对象
443
+ */
375
444
  const getNodeByName = name => {
376
445
  const findNode = (nodes, targetName) => {
377
446
  if (!nodes) return null;
@@ -388,7 +457,11 @@ var _default = exports.A = {
388
457
  };
389
458
  return findNode(props.materials, name);
390
459
  };
391
- // 通过ID获取完整路径
460
+ /**
461
+ * @description 通过ID获取完整路径
462
+ * @param {String} id 节点 id
463
+ * @returns {Array|null} 路径 id 数组
464
+ */
392
465
  const getPathById = id => {
393
466
  const findPath = (nodes, targetId, currentPath = []) => {
394
467
  if (!nodes) return null;
@@ -406,11 +479,16 @@ var _default = exports.A = {
406
479
  };
407
480
  return findPath(props.materials, id);
408
481
  };
482
+ /**
483
+ * @description 根据节点 id 设置选中路径并同步父组件
484
+ * @param {String} id 节点 id
485
+ */
409
486
  const setSelectedPath = id => {
410
487
  const path = getPathById(id) || ["root"];
411
488
  selectedPath.value = path;
412
489
  emit("update:modelValue", path); // 同步到父组件
413
490
  };
491
+ // 刷新级联选择器(预留)
414
492
  const refreshCascader = () => {
415
493
  // refreshKey.value++;
416
494
  };
@@ -554,8 +632,8 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
554
632
  lang,
555
633
  locale
556
634
  } = (0, _useGlobalConfig.useLocale)();
557
- let accept = ".png,.jpg";
558
- const emit = __emit;
635
+ let accept = ".png,.jpg"; // 允许上传的图片后缀
636
+ const emit = __emit; // 自定义事件:添加目录、上传图片、删除图片
559
637
  // 获取组件传参
560
638
  const props = __props;
561
639
  // 关联数据
@@ -595,7 +673,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
595
673
  // 重复次数-长
596
674
  repeatCountY: props?.settingParams?.repeatCountY ?? 1 // 重复次数-宽
597
675
  });
598
- const repeatModes = (0, _vue.ref)([locale.value.webgl.actualSize, locale.value.webgl.repeatCount]);
676
+ const repeatModes = (0, _vue.ref)([locale.value.webgl.actualSize, locale.value.webgl.repeatCount]); // 重复模式选项
599
677
  // 材质列表
600
678
  let materialDirectorys = (0, _vue.computed)(() => [{
601
679
  id: "root",
@@ -620,7 +698,8 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
620
698
  // 生成组件默认header
621
699
  let headerTemp = (0, _vue.ref)();
622
700
  let headerTempRef = (0, _vue.ref)();
623
- let viewModel = null;
701
+ let viewModel = null; // 材质编辑视图模型实例
702
+ // 组件挂载后初始化位置、监听 header 生成及视图模型
624
703
  (0, _vue.onMounted)(() => {
625
704
  (0, _util.updatePosition)(boxRef.value, props);
626
705
  (0, _vue.watch)(() => props.materials, () => {
@@ -643,10 +722,12 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
643
722
  }
644
723
  });
645
724
  });
725
+ // 打开添加目录对话框
646
726
  const openAddFolderDialog = () => {
647
727
  folderForm.name = "";
648
728
  showFolderDialog.value = true;
649
729
  };
730
+ // 关闭添加目录对话框时重置表单
650
731
  const handleDialogClosed = () => {
651
732
  folderForm.name = "";
652
733
  showFolderDialog.value = false;
@@ -663,6 +744,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
663
744
  if (!currentNode.children) {
664
745
  currentNode.children = [];
665
746
  }
747
+ // 重名目录校验
666
748
  const exists = currentNode.children.some(child => child.name === folderForm.name && child.children);
667
749
  if (exists) {
668
750
  _message.default.warning(locale.value.webgl.duplicateDirectory);
@@ -688,11 +770,18 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
688
770
  return currentNode?.children || [];
689
771
  });
690
772
 
691
- // 处理目录选择
773
+ /**
774
+ * @description 处理目录选择
775
+ * @param {Object} event 选中事件对象(包含 path、node)
776
+ */
692
777
  const handleDirectorySelect = event => {
693
778
  // 如果需要处理节点相关的其他逻辑
694
779
  if (event.node) {}
695
780
  };
781
+ /**
782
+ * @description 点击缩略项:目录则进入,图片则切换材质
783
+ * @param {Object} item 缩略项数据
784
+ */
696
785
  const clickItem = item => {
697
786
  if (item.children) {
698
787
  item.id && cascaderRef?.value?.setSelectedPath(item.id);
@@ -705,7 +794,10 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
705
794
  function resetMaterial() {
706
795
  viewModel?.paramsChanged?.("changImage", "null");
707
796
  }
708
- // 上传图片
797
+ /**
798
+ * @description 上传图片
799
+ * @param {Object} file 上传文件对象
800
+ */
709
801
  const handleImageChange = file => {
710
802
  const reader = new FileReader();
711
803
  const currentNode = cascaderRef.value?.getCurrentNode();
@@ -740,7 +832,10 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
740
832
  cascaderKey.value++;
741
833
  });
742
834
  };
743
- // 删除目录和图片
835
+ /**
836
+ * @description 删除目录和图片
837
+ * @param {Object} item 缩略项数据
838
+ */
744
839
  const deleteItem = item => {
745
840
  const itemName = item.name;
746
841
  const itemType = item.children ? locale.value.webgl.directory : locale.value.webgl.image;
@@ -776,14 +871,20 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
776
871
  headerTemp.value = (0, _util.createHeaderTemp)(boxRef.value, (0, _vue.toRefs)(props), headerTempRef, "webgl.modelMaterialEditTitle");
777
872
  }
778
873
  };
779
- //
874
+ /**
875
+ * @description 参数改变时同步至视图模型
876
+ * @param {String} key 参数名
877
+ */
780
878
  function paramsChanged(key) {
781
879
  if (viewModel) {
782
880
  viewModel._options[key] = formItem[key];
783
881
  viewModel.paramsChanged(key, formItem[key]);
784
882
  }
785
883
  }
786
- // 设置数据
884
+ /**
885
+ * @description 设置数据
886
+ * @param {Array|String} guids 模型 guid 列表
887
+ */
787
888
  function setData(guids) {
788
889
  if (!guids) return;
789
890
  if (!viewModel) return;
@@ -792,6 +893,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
792
893
  if (guidArray.length === 0) return;
793
894
  viewModel.getBuildModels(guidArray);
794
895
  }
896
+ // 清空选中模型集合
795
897
  function clear() {
796
898
  viewModel?.clear();
797
899
  }
@@ -1640,11 +1742,11 @@ Object.defineProperty(exports, "__esModule", ({
1640
1742
  value: true
1641
1743
  }));
1642
1744
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
1643
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
1745
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
1644
1746
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
1645
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
1747
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
1646
1748
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
1647
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
1749
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
1648
1750
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
1649
1751
 
1650
1752
  /***/ })
@@ -31,9 +31,15 @@ var _useGlobalConfig = __webpack_require__(22686);
31
31
  //剖面分析逻辑类
32
32
  let floatingPoint;
33
33
  let drawPoints = (/* unused pure expression or super */ null && ([]));
34
- let activeShapePoints = [];
34
+ let activeShapePoints = []; //当前绘制的剖面点数组
35
35
  let activeCartographicPoints = (/* unused pure expression or super */ null && ([]));
36
36
  class ModelProfileAnalysisViewModel {
37
+ /**
38
+ * @description 构造函数,初始化viewer、剖面分析对象、屏幕事件处理器及结果显示canvas
39
+ * @param {Object} scenceView 三维场景视图对象
40
+ * @param {Object} viewModel 表单参数对象
41
+ * @param {HTMLElement} chart 结果显示DOM元素
42
+ */
37
43
  constructor(scenceView, viewModel, chart) {
38
44
  this._profileAnalysis = null;
39
45
  //剖面分析三维对象
@@ -103,6 +109,7 @@ class ModelProfileAnalysisViewModel {
103
109
  this.remove();
104
110
  let that = this;
105
111
  this._globaOptions._handler.removeInputAction(window.Cesium.ScreenSpaceEventType.LEFT_CLICK);
112
+ // 注册左键点击事件,收集剖面点
106
113
  this._globaOptions._handler.setInputAction(function (event) {
107
114
  var earthPosition = that._globaOptions.viewer.scene.pickPosition(event.position);
108
115
  if (window.Cesium.defined(earthPosition)) {
@@ -132,13 +139,18 @@ class ModelProfileAnalysisViewModel {
132
139
  that._drawManager.clearDrawGroup("ModelProfileAnalysis");
133
140
  }, "ModelProfileAnalysis");
134
141
  } else {
142
+ // 未添加模型时给出警告
135
143
  (0, _message.default)({
136
144
  message: this._language.value.webgl["addModelTips"],
137
145
  type: "warning"
138
146
  });
139
147
  }
140
148
  }
141
- //绘制点
149
+ /**
150
+ * @description 绘制点
151
+ * @param {Object} worldPosition 世界坐标
152
+ * @returns {Object} 点实体
153
+ */
142
154
  createPoint(worldPosition) {
143
155
  var point = this._globaOptions.viewer.entities.add({
144
156
  position: worldPosition,
@@ -156,6 +168,7 @@ class ModelProfileAnalysisViewModel {
156
168
  this._profileAnalysis.angle = this._globaOptions.viewModel.angle;
157
169
  this._profileAnalysis.extendWidth = this._globaOptions.viewModel.extendWidth;
158
170
  this._profileAnalysis.cameraHeight = this._globaOptions.viewModel.cameraHeight;
171
+ this._profileAnalysis._cameraHeight = this._globaOptions.viewModel.cameraHeight;
159
172
  this._profileAnalysis.isPerspective = this._globaOptions.viewModel.isPerspective;
160
173
  if (this._globaOptions._handler) {
161
174
  let buffer = this._profileAnalysis.updateBuffer();
@@ -167,7 +180,10 @@ class ModelProfileAnalysisViewModel {
167
180
  }
168
181
  }
169
182
  }
170
- //获取单线剖面分析纹理
183
+ /**
184
+ * @description 获取单线剖面分析纹理并绘制到结果canvas上
185
+ * @param {Array} buffer 像素缓冲数据
186
+ */
171
187
  getPorfileAnalysisTexture(buffer) {
172
188
  if (buffer) {
173
189
  this._globaOptions.canvas.height = this._globaOptions.height;
@@ -176,6 +192,7 @@ class ModelProfileAnalysisViewModel {
176
192
 
177
193
  // flipY
178
194
  var line = this._globaOptions.width * 4;
195
+ // 纵向翻转像素数据
179
196
  for (let h = 0; h < this._globaOptions.height; h++) {
180
197
  for (let w = 0; w < this._globaOptions.width; w++) {
181
198
  for (let n = 0; n < 4; n++) {
@@ -185,7 +202,7 @@ class ModelProfileAnalysisViewModel {
185
202
  }
186
203
  this._globaOptions.ctx.putImageData(imgData, 0, 0);
187
204
 
188
- //=====================
205
+ //===================== 绘制目标区域边框
189
206
  this._globaOptions.ctx.setLineDash([20, 5]);
190
207
  this._globaOptions.ctx.lineWidth = 1;
191
208
  this._globaOptions.ctx.strokeStyle = "#ff2";
@@ -197,7 +214,7 @@ class ModelProfileAnalysisViewModel {
197
214
  this._globaOptions.ctx.lineTo(360 - fLeft, 360);
198
215
  this._globaOptions.ctx.stroke();
199
216
 
200
- //=====================
217
+ //===================== 绘制剖面长度/高度文本
201
218
  let str = String(this._profileAnalysis._frustumW.toFixed(2));
202
219
  let str1 = this._language.value.webgl.profileLength + " : " + str + "m";
203
220
  str = String(this._profileAnalysis._maxW.toFixed(2));
@@ -216,32 +233,50 @@ class ModelProfileAnalysisViewModel {
216
233
  this._globaOptions.ctx.fillText(str4, 10, 80);
217
234
  }
218
235
  }
219
- // 是否透视
236
+ /**
237
+ * @description 是否透视
238
+ * @param {Boolean} val 是否透视
239
+ */
220
240
  setEnablePerspective(val) {
221
241
  this._globaOptions.viewModel.isPerspective = val;
222
242
  if (this._ProfileAnalysisChartVis.value) this.updatePorfileAnalysis();
223
243
  }
224
- // 透视角度
244
+ /**
245
+ * @description 透视角度
246
+ * @param {Number} val 透视角度值
247
+ */
225
248
  setPerspectiveAngle(val) {
226
249
  this._globaOptions.viewModel.angle = val;
227
250
  if (this._ProfileAnalysisChartVis.value) this.updatePorfileAnalysis();
228
251
  }
229
- // 目标区域宽度
252
+ /**
253
+ * @description 目标区域宽度
254
+ * @param {Number} val 宽度值
255
+ */
230
256
  setTargetAreaWidth(val) {
231
257
  this._globaOptions.viewModel.extendWidth = val;
232
258
  if (this._ProfileAnalysisChartVis.value) this.updatePorfileAnalysis();
233
259
  }
234
- // 目标区域高度
260
+ /**
261
+ * @description 目标区域高度
262
+ * @param {Number} val 高度值
263
+ */
235
264
  setTargetAreaHeight(val) {
236
265
  this._globaOptions.viewModel.frustumH = val;
237
266
  if (this._ProfileAnalysisChartVis.value) this.updatePorfileAnalysis();
238
267
  }
239
- // 相机高度
268
+ /**
269
+ * @description 相机高度
270
+ * @param {Number} val 相机高度值
271
+ */
240
272
  setCameraHeight(val) {
241
273
  this._globaOptions.viewModel.cameraHeight = val;
242
274
  if (this._ProfileAnalysisChartVis.value) this.updatePorfileAnalysis();
243
275
  }
244
- // 切换语言
276
+ /**
277
+ * @description 切换语言
278
+ * @param {String} lang 语言标识
279
+ */
245
280
  changeLanguage(lang) {
246
281
  if (this._ProfileAnalysisChartVis.value) this.updatePorfileAnalysis();
247
282
  }
@@ -1637,6 +1672,7 @@ const __default__ = {
1637
1672
  };
1638
1673
  var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
1639
1674
  props: {
1675
+ // 指定组件绑定的viewer对象的div的id
1640
1676
  mapTarget: {
1641
1677
  type: String
1642
1678
  },
@@ -1742,6 +1778,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
1742
1778
  });
1743
1779
  _gisUtils.utils.getWebMap(props.mapTarget, scenceView => {
1744
1780
  if (scenceView) {
1781
+ // 初始化剖面分析逻辑类并绑定结果图表DOM
1745
1782
  viewModel = new _ModelProfileAnalysisViewModel.default(scenceView, {
1746
1783
  perspectiveAngle: formItem.perspectiveAngle,
1747
1784
  // 透视角度
@@ -2342,11 +2379,11 @@ Object.defineProperty(exports, "__esModule", ({
2342
2379
  value: true
2343
2380
  }));
2344
2381
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
2345
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
2382
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
2346
2383
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
2347
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
2384
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
2348
2385
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
2349
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
2386
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
2350
2387
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
2351
2388
 
2352
2389
  /***/ })