@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
@@ -62,6 +62,13 @@ exports["default"] = void 0;
62
62
  */
63
63
  //视频投放逻辑类
64
64
  class VideoProjectViewModel {
65
+ // 视频DOM元素
66
+
67
+ /**
68
+ * @description 构造函数,初始化视频投放管理对象并创建视频元素
69
+ * @param {Object} scenceView 场景视图对象,包含 _viewer 属性
70
+ * @param {Object} options 视频投放配置参数
71
+ */
65
72
  constructor(scenceView, options) {
66
73
  this._viewer = null;
67
74
  //三维viewer对象
@@ -96,11 +103,11 @@ class VideoProjectViewModel {
96
103
  // 投放
97
104
  project() {
98
105
  this.clear();
99
- let position = Cesium.Cartesian3.clone(this._viewer.camera.positionWC);
106
+ const position = Cesium.Cartesian3.clone(this._viewer.camera.positionWC);
100
107
  this._options.heading = this._viewer.camera.heading;
101
108
  this._options.pitch = this._viewer.camera.pitch;
102
109
  this._options.roll = this._viewer.camera.roll;
103
- let options = {
110
+ const options = {
104
111
  position: position,
105
112
  heading: this._options.heading,
106
113
  pitch: this._options.pitch,
@@ -112,9 +119,11 @@ class VideoProjectViewModel {
112
119
  };
113
120
  this._videoElement.src = this._options.videoPath;
114
121
  if (this._options.projectType == 1) {
122
+ // 平面投放:使用平面投影类
115
123
  options.outline = this._options.showHideLine;
116
124
  this._projectVideo = new Cesium.K3dProjectVideoPlane(options);
117
125
  } else {
126
+ // 模型投放:使用模型投影类
118
127
  options.showHelperPrimitive = this._options.showHideLine;
119
128
  this._projectVideo = new Cesium.Kq3dProjectVideo(options);
120
129
  }
@@ -124,7 +133,7 @@ class VideoProjectViewModel {
124
133
  // 获取投放坐标
125
134
  getProjectCoordinate() {
126
135
  if (this._projectVideo) {
127
- let cartographic = Cesium.Cartographic.fromCartesian(this._projectVideo.position);
136
+ const cartographic = Cesium.Cartographic.fromCartesian(this._projectVideo.position);
128
137
  return {
129
138
  longitude: Cesium.Math.toDegrees(cartographic.longitude),
130
139
  latitude: Cesium.Math.toDegrees(cartographic.latitude),
@@ -169,65 +178,99 @@ class VideoProjectViewModel {
169
178
  this._videoElement = null;
170
179
  }
171
180
 
172
- // 设置坐标
181
+ /**
182
+ * @description 设置投放的坐标位置
183
+ * @param {Number} longitude 经度
184
+ * @param {Number} latitude 纬度
185
+ * @param {Number} height 高度
186
+ */
173
187
  setPosition(longitude, latitude, height) {
174
- let position = Cesium.Cartesian3.fromDegrees(longitude, latitude, height);
188
+ const position = Cesium.Cartesian3.fromDegrees(longitude, latitude, height);
175
189
  this._projectVideo.position = position;
176
190
  }
177
191
 
178
- // 设置视频路径
192
+ /**
193
+ * @description 设置视频流路径
194
+ * @param {String} val 视频流地址
195
+ */
179
196
  setVideoPath(val) {
180
197
  this._options.videoPath = val;
181
198
  }
182
199
 
183
- // 设置投放类型, 1:平面上, 2: 模型上
200
+ /**
201
+ * @description 设置投放类型, 1:平面上, 2: 模型上
202
+ * @param {Number} val 投放类型值
203
+ */
184
204
  setProjectType(val) {
185
205
  this._options.projectType = Number(val);
186
206
  }
187
207
 
188
- // 设置视场角度
208
+ /**
209
+ * @description 设置视场角度
210
+ * @param {Number} val 视场角度值
211
+ */
189
212
  setFov(val) {
190
213
  this._options.fov = Number(val);
191
214
  if (this._projectVideo) this._projectVideo.fov = Cesium.Math.toRadians(this._options.fov);
192
215
  }
193
216
 
194
- // 设置纵横比
217
+ /**
218
+ * @description 设置纵横比
219
+ * @param {Number} val 纵横比值
220
+ */
195
221
  setAspectRatio(val) {
196
222
  this._options.aspectRatio = Number(val);
197
223
  if (this._projectVideo) this._projectVideo.aspectRatio = this._options.aspectRatio;
198
224
  }
199
225
 
200
- // 设置投放距离
226
+ /**
227
+ * @description 设置投放距离
228
+ * @param {Number} val 投放距离值
229
+ */
201
230
  setFar(val) {
202
231
  this._options.far = Number(val);
203
232
  if (this._projectVideo) this._projectVideo.far = this._options.far;
204
233
  }
205
234
 
206
- // 设置朝向角
235
+ /**
236
+ * @description 设置朝向角
237
+ * @param {Number} val 朝向角度值
238
+ */
207
239
  setHeading(val) {
208
240
  this._options.heading = Number(val);
209
241
  if (this._projectVideo) this._projectVideo.heading = Cesium.Math.toRadians(this._options.heading);
210
242
  }
211
243
 
212
- // 设置俯仰角
244
+ /**
245
+ * @description 设置俯仰角
246
+ * @param {Number} val 俯仰角度值
247
+ */
213
248
  setPitch(val) {
214
249
  this._options.pitch = Number(val);
215
250
  if (this._projectVideo) this._projectVideo.pitch = Cesium.Math.toRadians(this._options.pitch);
216
251
  }
217
252
 
218
- // 设置翻转角
253
+ /**
254
+ * @description 设置翻转角
255
+ * @param {Number} val 翻转角度值
256
+ */
219
257
  setRoll(val) {
220
258
  this._options.roll = Number(val);
221
259
  if (this._projectVideo) this._projectVideo.roll = Cesium.Math.toRadians(this._options.roll);
222
260
  }
223
261
 
224
- // 显隐线框
262
+ /**
263
+ * @description 设置线框显隐
264
+ * @param {Boolean} val 是否显示线框
265
+ */
225
266
  showHideLine(val) {
226
267
  this._options.showHideLine = val;
227
268
  if (this._projectVideo) {
228
269
  if (this._options.projectType == 1) {
270
+ // 平面投放:设置outline属性
229
271
  this._projectVideo.outline = val;
230
272
  } else {
273
+ // 模型投放:设置showHelperPrimitive属性
231
274
  this._projectVideo.showHelperPrimitive = val;
232
275
  }
233
276
  }
@@ -333,8 +376,9 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
333
376
 
334
377
  // 获取组件传参
335
378
  const props = __props;
336
- const lonlatOffset = 0.000010;
337
- const heightOffset = 10.0;
379
+ const lonlatOffset = 0.000010; // 经纬度滑动条偏移量
380
+ const heightOffset = 10.0; // 高度滑动条偏移量
381
+
338
382
  let formItem = (0, _vue.reactive)({
339
383
  collapseValue: props?.settingParams?.collapseValue === '' ? '' : props?.settingParams?.collapseValue ?? "setting",
340
384
  // 默认展开属性设置
@@ -361,14 +405,15 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
361
405
  let showCoordinate = (0, _vue.ref)(false);
362
406
  // 显示朝向角俯仰角翻转角
363
407
  let showHpr = (0, _vue.ref)(false);
364
- let viewModel = null;
408
+ let viewModel = null; // 视频投影视图模型对象
365
409
 
366
410
  // 组件容器Ref
367
411
  let boxRef = (0, _vue.ref)(null);
368
412
 
369
413
  // 生成组件默认header
370
- let headerTemp = (0, _vue.ref)();
371
- let headerTempRef = (0, _vue.ref)();
414
+ let headerTemp = (0, _vue.ref)(); // 动态生成的Header组件
415
+ let headerTempRef = (0, _vue.ref)(); // Header组件Ref
416
+
372
417
  (0, _vue.onMounted)(() => {
373
418
  (0, _util.updatePosition)(boxRef.value, props);
374
419
  (0, _vue.watch)(() => props.position, (newVal, oldVal) => {
@@ -406,13 +451,21 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
406
451
  headerTemp.value = (0, _util.createHeaderTemp)(boxRef.value, (0, _vue.toRefs)(props), headerTempRef, 'webgl.videoProject');
407
452
  }
408
453
  };
454
+
455
+ /**
456
+ * @description 选择视频文件后获取本地访问URL并设置到视图模型
457
+ * @param {Object} file 上传的文件对象
458
+ */
409
459
  function selectVideo(file) {
410
460
  formItem.videoPath = file.name;
411
461
  let url = URL.createObjectURL(file.raw);
412
462
  viewModel.setVideoPath(url);
413
463
  }
414
464
 
415
- // 参数改变
465
+ /**
466
+ * @description 参数改变时根据类型调用对应的视图模型方法
467
+ * @param {String} key 改变的参数类型标识
468
+ */
416
469
  function paramsChanged(key) {
417
470
  switch (key) {
418
471
  case "videoPath":
@@ -445,6 +498,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
445
498
  case "longitude":
446
499
  case "latitude":
447
500
  case "height":
501
+ // 经纬度或高度变化时统一更新坐标
448
502
  viewModel.setPosition(formItem.longitude, formItem.latitude, formItem.height);
449
503
  break;
450
504
  default:
@@ -1125,11 +1179,11 @@ Object.defineProperty(exports, "__esModule", ({
1125
1179
  value: true
1126
1180
  }));
1127
1181
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
1128
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
1182
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
1129
1183
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
1130
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
1184
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
1131
1185
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
1132
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
1186
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
1133
1187
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
1134
1188
 
1135
1189
  /***/ })
@@ -530,14 +530,15 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
530
530
  // 不可见颜色
531
531
  lineColor: props?.settingParams?.lineColor ?? "#E6A23C" // 边界线颜色
532
532
  });
533
- let viewModel = null;
533
+ let viewModel = null; // 可视域分析视图模型对象
534
534
 
535
535
  // 组件容器Ref
536
536
  let boxRef = (0, _vue.ref)(null);
537
537
 
538
538
  // 生成组件默认header
539
- let headerTemp = (0, _vue.ref)();
540
- let headerTempRef = (0, _vue.ref)();
539
+ let headerTemp = (0, _vue.ref)(); // 动态生成的Header组件
540
+ let headerTempRef = (0, _vue.ref)(); // Header组件Ref
541
+
541
542
  (0, _vue.onMounted)(() => {
542
543
  (0, _util.updatePosition)(boxRef.value, props);
543
544
  (0, _vue.watch)(() => props.position, (newVal, oldVal) => {
@@ -551,6 +552,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
551
552
  });
552
553
  _gisUtils.utils.getWebMap(props.mapTarget, scenceView => {
553
554
  if (scenceView) {
555
+ // 需要重现时从本地存储恢复参数
554
556
  if (props.isReappear) {
555
557
  let options = localStorage.getItem('ViewshedAnalysis');
556
558
  if (options) {
@@ -584,6 +586,11 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
584
586
  headerTemp.value = (0, _util.createHeaderTemp)(boxRef.value, (0, _vue.toRefs)(props), headerTempRef, 'webgl.viewshedAnalysis');
585
587
  }
586
588
  };
589
+
590
+ /**
591
+ * @description 参数改变时根据类型调用对应的视图模型方法
592
+ * @param {String} key 改变的参数类型标识
593
+ */
587
594
  function paramsChanged(key) {
588
595
  switch (key) {
589
596
  case "height":
@@ -1196,10 +1203,17 @@ var _constImage = __webpack_require__(4822);
1196
1203
 
1197
1204
  //可视域分析逻辑类
1198
1205
  class ViewshedAnalysisViewModel {
1206
+ //是否恢复上次分析结果
1207
+ /**
1208
+ * @description 构造函数,初始化可视域分析对象并根据配置恢复上次分析
1209
+ * @param {Object} scenceView 场景视图对象,包含 _viewer 和 _drawManager 属性
1210
+ * @param {Object} options 可视域分析配置参数
1211
+ */
1199
1212
  constructor(scenceView, options) {
1200
1213
  this._viewshedAnalysis = null;
1201
1214
  //可视域分析三维对象
1202
1215
  this._viewer = null;
1216
+ //三维viewer对象
1203
1217
  this._scene = null;
1204
1218
  //三维场景对象
1205
1219
  this._options = null;
@@ -1209,7 +1223,9 @@ class ViewshedAnalysisViewModel {
1209
1223
  this._position = null;
1210
1224
  //可视域分析初始点坐标
1211
1225
  this._drawManager = null;
1226
+ //绘制管理器对象
1212
1227
  this._handler = null;
1228
+ //事件处理对象
1213
1229
  this._isReappear = false;
1214
1230
  this._isReappear = options.isReappear;
1215
1231
  this._viewer = scenceView._viewer;
@@ -1217,9 +1233,11 @@ class ViewshedAnalysisViewModel {
1217
1233
  this._drawManager = scenceView._drawManager;
1218
1234
  this._scene.globe.depthTestAgainstTerrain = true;
1219
1235
  this._options = options;
1236
+ // 解析可视颜色为Cesium颜色对象
1220
1237
  if (this._options.visibleColor) {
1221
1238
  this._options.visibleColor = Cesium.Color.fromCssColorString(this._options.visibleColor);
1222
1239
  }
1240
+ // 解析不可视颜色为Cesium颜色对象
1223
1241
  if (this._options.visibleColor) {
1224
1242
  this._options.invisibleColor = Cesium.Color.fromCssColorString(this._options.invisibleColor);
1225
1243
  }
@@ -1231,6 +1249,7 @@ class ViewshedAnalysisViewModel {
1231
1249
  // // beforeDrawText: '',
1232
1250
  // // });
1233
1251
  // }, window.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
1252
+ // 恢复上次分析结果
1234
1253
  if (this._isReappear) {
1235
1254
  let options = localStorage.getItem('ViewshedAnalysis');
1236
1255
  if (options) {
@@ -1257,7 +1276,9 @@ class ViewshedAnalysisViewModel {
1257
1276
  this.clear();
1258
1277
  this._viewshedAnalysis = new Cesium.Kq3dViewshedInteractive(this._scene, this._options);
1259
1278
  let that = this;
1279
+ // 监听可视域交互事件,更新观察点和目标点
1260
1280
  this._viewshedAnalysis.event.addEventListener((p1, p2) => {
1281
+ // p1存在表示设置了观察点
1261
1282
  if (p1 && p2 == undefined) {
1262
1283
  that._position = p1;
1263
1284
  let cartographic = Cesium.Cartographic.fromCartesian(p1);
@@ -1265,6 +1286,7 @@ class ViewshedAnalysisViewModel {
1265
1286
  if (that._marker) {
1266
1287
  that._marker.position = newPos;
1267
1288
  } else {
1289
+ // 创建观察点图标
1268
1290
  that._marker = that._viewer.entities.add({
1269
1291
  position: newPos,
1270
1292
  billboard: {
@@ -1275,6 +1297,7 @@ class ViewshedAnalysisViewModel {
1275
1297
  });
1276
1298
  }
1277
1299
  }
1300
+ // p2存在表示设置了目标点
1278
1301
  if (p2) that._target = p2;
1279
1302
  });
1280
1303
  // this._drawManager.startDraw("marker", { image: null }, (feature, { shape }) => {
@@ -1289,7 +1312,9 @@ class ViewshedAnalysisViewModel {
1289
1312
  //清除全部结果
1290
1313
  clear() {
1291
1314
  // this._drawManager?.stopDraw?.();
1292
- this._viewshedAnalysis && this._viewshedAnalysis.destroy();
1315
+ this._viewshedAnalysis?.pause();
1316
+ this._viewshedAnalysis?.stopHandle();
1317
+ this._viewshedAnalysis?.destroy();
1293
1318
  this._viewshedAnalysis = null;
1294
1319
  if (this._marker) {
1295
1320
  this._viewer.entities.remove(this._marker);
@@ -1301,6 +1326,7 @@ class ViewshedAnalysisViewModel {
1301
1326
  //销毁
1302
1327
  destroy() {
1303
1328
  // this?._handler?.removeInputAction?.(window.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
1329
+ // 需要恢复时保存当前分析结果到本地存储
1304
1330
  if (this._viewshedAnalysis && this._isReappear) {
1305
1331
  let options = {
1306
1332
  offsetHeight: this._options.offsetHeight,
@@ -1316,7 +1342,10 @@ class ViewshedAnalysisViewModel {
1316
1342
  this.clear();
1317
1343
  }
1318
1344
 
1319
- //设置偏移高度
1345
+ /**
1346
+ * @description 设置偏移高度
1347
+ * @param {Number} offsetHeight 偏移高度值
1348
+ */
1320
1349
  setOffsetHeight(offsetHeight) {
1321
1350
  this._options.offsetHeight = Number(offsetHeight);
1322
1351
  if (this._viewshedAnalysis) this._viewshedAnalysis.attachedViewshed.offsetHeight = this._options.offsetHeight;
@@ -1325,32 +1354,50 @@ class ViewshedAnalysisViewModel {
1325
1354
  this._marker.position = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height + this._options.offsetHeight);
1326
1355
  }
1327
1356
  }
1328
- //设置水平角
1357
+ /**
1358
+ * @description 设置水平角
1359
+ * @param {Number} fovH 水平角度值
1360
+ */
1329
1361
  setFovH(fovH) {
1330
1362
  this._options.fovH = Number(fovH);
1331
1363
  if (this._viewshedAnalysis) this._viewshedAnalysis.attachedViewshed.fovH = this._options.fovH;
1332
1364
  }
1333
- //设置竖直角
1365
+ /**
1366
+ * @description 设置竖直角
1367
+ * @param {Number} fovV 竖直角度值
1368
+ */
1334
1369
  setFovV(fovV) {
1335
1370
  this._options.fovV = Number(fovV);
1336
1371
  if (this._viewshedAnalysis) this._viewshedAnalysis.attachedViewshed.fovV = this._options.fovV;
1337
1372
  }
1338
- //设置可视颜色
1373
+ /**
1374
+ * @description 设置可视颜色
1375
+ * @param {String} visibleColor 可视颜色的CSS颜色字符串
1376
+ */
1339
1377
  setVisibleColor(visibleColor) {
1340
1378
  this._options.visibleColor = Cesium.Color.fromCssColorString(visibleColor);
1341
1379
  if (this._viewshedAnalysis) this._viewshedAnalysis.attachedViewshed.visibleColor = this._options.visibleColor;
1342
1380
  }
1343
- //设置不可视颜色
1381
+ /**
1382
+ * @description 设置不可视颜色
1383
+ * @param {String} invisibleColor 不可视颜色的CSS颜色字符串
1384
+ */
1344
1385
  setInvisibleColor(invisibleColor) {
1345
1386
  this._options.invisibleColor = Cesium.Color.fromCssColorString(invisibleColor);
1346
1387
  if (this._viewshedAnalysis) this._viewshedAnalysis.attachedViewshed.invisibleColor = this._options.invisibleColor;
1347
1388
  }
1348
- //设置网格线颜色
1389
+ /**
1390
+ * @description 设置网格线颜色
1391
+ * @param {String} lineColor 网格线颜色的CSS颜色字符串
1392
+ */
1349
1393
  setLineColor(lineColor) {
1350
1394
  this._options.lineColor = lineColor;
1351
1395
  if (this._viewshedAnalysis) this._viewshedAnalysis.attachedViewshed.lineColor = Cesium.Color.fromCssColorString(lineColor);
1352
1396
  }
1353
- //显示/隐藏网格线
1397
+ /**
1398
+ * @description 显示/隐藏网格线
1399
+ * @param {Boolean} showGridLine 是否显示网格线
1400
+ */
1354
1401
  setShowGridLine(showGridLine) {
1355
1402
  this._options.showGridLine = showGridLine;
1356
1403
  if (this._viewshedAnalysis) this._viewshedAnalysis.attachedViewshed.showGridLine = showGridLine;
@@ -2416,11 +2463,11 @@ Object.defineProperty(exports, "__esModule", ({
2416
2463
  value: true
2417
2464
  }));
2418
2465
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
2419
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
2466
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
2420
2467
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
2421
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
2468
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
2422
2469
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
2423
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
2470
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
2424
2471
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
2425
2472
 
2426
2473
  /***/ })
@@ -34,12 +34,16 @@ var _constImage = __webpack_require__(4822);
34
34
  * All rights reserved.
35
35
  */
36
36
 
37
- let _gravityScratch = null;
38
- let _gravityStart = 0.0;
39
- let _gravityEnd = -1.0;
37
+ let _gravityScratch = null; // 重力计算用的临时笛卡尔变量
38
+ let _gravityStart = 0.0; // 重力随机范围起始值
39
+ let _gravityEnd = -1.0; // 重力随机范围结束值
40
40
  //天气特效逻辑类
41
41
  class WeatherEffectViewModel {
42
42
  //雪图片url地址
43
+ /**
44
+ * @description 构造函数,初始化场景时钟及重力计算变量
45
+ * @param {Object} scenceView 场景视图对象,包含 _viewer 和 _drawManager 属性
46
+ */
43
47
  constructor(scenceView) {
44
48
  this._scene = null;
45
49
  //三维球场景视图对象
@@ -59,22 +63,33 @@ class WeatherEffectViewModel {
59
63
  this._drawManager = scenceView._drawManager;
60
64
  _gravityScratch = new Cesium.Cartesian3();
61
65
  }
66
+
67
+ /**
68
+ * @description 粒子更新回调,为粒子施加重力效果
69
+ * @param {Object} particle 粒子对象
70
+ * @param {Number} dt 时间增量
71
+ */
62
72
  applyGravity(particle, dt) {
63
73
  _gravityScratch = Cesium.Cartesian3.normalize(particle.position, _gravityScratch);
64
74
  Cesium.Cartesian3.multiplyByScalar(_gravityScratch, Cesium.Math.randomBetween(_gravityStart, _gravityEnd), _gravityScratch);
65
75
  particle.velocity = Cesium.Cartesian3.add(particle.velocity, _gravityScratch, particle.velocity);
66
76
  }
67
77
 
68
- //添加天气特效
78
+ /**
79
+ * @description 添加天气特效(雨或雪)
80
+ * @param {Object} options 天气特效配置参数,包含 mode、gravity、lifeCycle 等
81
+ */
69
82
  addWeatherEffect(options) {
70
83
  var that = this;
71
84
  let mode = options.mode;
85
+ // 校验模式仅支持 rain 或 snow
72
86
  if (mode !== "rain" && mode !== "snow") {
73
87
  console.log("This mode is not supported.");
74
88
  return;
75
89
  }
76
90
  if (options.gravity) this.setGravity(options.gravity);
77
91
  this._options = options;
92
+ // 通过绘制管理器获取标记点位置作为粒子系统位置
78
93
  this._drawManager?.startDraw("marker", {
79
94
  image: null
80
95
  }, (feature, {
@@ -86,6 +101,7 @@ class WeatherEffectViewModel {
86
101
  if (position) {
87
102
  let matrix = new Cesium.Matrix4.fromTranslation(position);
88
103
  if (!that._particleSystem) {
104
+ // 首次创建粒子系统
89
105
  that._particleSystem = new Cesium.ParticleSystem({
90
106
  modelMatrix: matrix,
91
107
  lifetime: that._options.lifeCycle,
@@ -103,6 +119,7 @@ class WeatherEffectViewModel {
103
119
  });
104
120
  that._scene.primitives.add(that._particleSystem);
105
121
  } else {
122
+ // 已存在粒子系统时仅更新位置矩阵
106
123
  that._particleSystem.modelMatrix = matrix;
107
124
  }
108
125
  }
@@ -124,49 +141,72 @@ class WeatherEffectViewModel {
124
141
  this.clear();
125
142
  }
126
143
 
127
- //设置范围半径
144
+ /**
145
+ * @description 设置范围半径
146
+ * @param {Number} radius 范围半径值
147
+ */
128
148
  setRangeRadius(radius) {
129
149
  if (this._particleSystem) {
130
150
  this._particleSystem.emitter = new Cesium.BoxEmitter(new Cesium.Cartesian3(radius, radius, radius));
131
151
  }
132
152
  }
133
- //设置粒子数量
153
+ /**
154
+ * @description 设置粒子数量
155
+ * @param {Number} number 粒子数量值
156
+ */
134
157
  setParticleNumber(number) {
135
158
  if (this._particleSystem) {
136
159
  this._particleSystem.emissionRate = number;
137
160
  }
138
161
  }
139
- //设置粒子大小
162
+ /**
163
+ * @description 设置粒子大小
164
+ * @param {Number} size 粒子大小值
165
+ */
140
166
  setParticleSize(size) {
141
167
  if (this._particleSystem) {
142
168
  this._particleSystem.minimumImageSize = new Cesium.Cartesian2(size, size);
143
169
  this._particleSystem.maximumImageSize = new Cesium.Cartesian2(size, size);
144
170
  }
145
171
  }
146
- //设置生命周期
172
+ /**
173
+ * @description 设置生命周期
174
+ * @param {Number} lifeCycle 生命周期值
175
+ */
147
176
  setLifeCycle(lifeCycle) {
148
177
  if (this._particleSystem) {
149
178
  this._particleSystem.lifetime = lifeCycle;
150
179
  }
151
180
  }
152
- //设置初始比例
181
+ /**
182
+ * @description 设置初始比例
183
+ * @param {Number} startScale 初始比例值
184
+ */
153
185
  setStartScale(startScale) {
154
186
  if (this._particleSystem) {
155
187
  this._particleSystem.startScale = startScale;
156
188
  }
157
189
  }
158
- //设置结束比例
190
+ /**
191
+ * @description 设置结束比例
192
+ * @param {Number} endScale 结束比例值
193
+ */
159
194
  setEndScale(endScale) {
160
195
  if (this._particleSystem) {
161
196
  this._particleSystem.endScale = endScale;
162
197
  }
163
198
  }
164
- //设置重力
199
+ /**
200
+ * @description 设置重力,根据值大小调整重力随机范围
201
+ * @param {Number} gravity 重力值
202
+ */
165
203
  setGravity(gravity) {
204
+ // 重力小于等于1时,起始值为0
166
205
  if (gravity <= 1) {
167
206
  _gravityStart = 0.0;
168
207
  _gravityEnd = 0 - gravity;
169
208
  } else {
209
+ // 重力大于1时,起始值为负值
170
210
  _gravityStart = 0 - (gravity - 1);
171
211
  _gravityEnd = 0 - gravity;
172
212
  }
@@ -309,14 +349,15 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
309
349
  endScale: props?.settingParams?.endScale ?? 1.3,
310
350
  gravity: props?.settingParams?.gravity ?? 1
311
351
  });
312
- let viewModel = null;
352
+ let viewModel = null; // 天气特效视图模型对象
313
353
 
314
354
  // 组件容器Ref
315
355
  let boxRef = (0, _vue.ref)(null);
316
356
 
317
357
  // 生成组件默认header
318
- let headerTemp = (0, _vue.ref)();
319
- let headerTempRef = (0, _vue.ref)();
358
+ let headerTemp = (0, _vue.ref)(); // 动态生成的Header组件
359
+ let headerTempRef = (0, _vue.ref)(); // Header组件Ref
360
+
320
361
  (0, _vue.onMounted)(() => {
321
362
  (0, _util.updatePosition)(boxRef.value, props);
322
363
  (0, _vue.watch)(() => props.position, (newVal, oldVal) => {
@@ -345,22 +386,32 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
345
386
  }
346
387
  };
347
388
 
348
- //切换雨雪天气特效
389
+ /**
390
+ * @description 切换雨雪天气特效
391
+ * @param {String} mode 天气模式:rain-雨,snow-雪
392
+ */
349
393
  function changeMode(mode) {
350
394
  if (formItem.mode !== mode) {
351
395
  viewModel && viewModel.clear();
352
396
  formItem.mode = mode;
397
+ // 切换为雨模式且需要重置参数时恢复默认值
353
398
  if (mode === "rain" && formItem.isResetParams) {
354
399
  formItem.particleSize = 2.0;
355
400
  formItem.startScale = 1.1;
356
401
  formItem.endScale = 1.3;
357
402
  } else if (mode === "snow" && formItem.isResetParams) {
403
+ // 切换为雪模式且需要重置参数时恢复默认值
358
404
  formItem.particleSize = 0.6;
359
405
  formItem.startScale = 0.5;
360
406
  formItem.endScale = 0.6;
361
407
  }
362
408
  }
363
409
  }
410
+
411
+ /**
412
+ * @description 参数改变时根据类型调用对应的视图模型方法
413
+ * @param {String} key 改变的参数类型标识
414
+ */
364
415
  function paramsChanged(key) {
365
416
  switch (key) {
366
417
  case "rangeRadius":
@@ -388,9 +439,13 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
388
439
  break;
389
440
  }
390
441
  }
442
+
443
+ // 添加天气特效
391
444
  function add() {
392
445
  viewModel && viewModel.addWeatherEffect(formItem);
393
446
  }
447
+
448
+ // 清除天气特效
394
449
  function clear() {
395
450
  viewModel && viewModel.clear();
396
451
  }
@@ -2493,11 +2548,11 @@ Object.defineProperty(exports, "__esModule", ({
2493
2548
  value: true
2494
2549
  }));
2495
2550
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
2496
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
2551
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
2497
2552
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
2498
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
2553
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
2499
2554
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
2500
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
2555
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
2501
2556
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
2502
2557
 
2503
2558
  /***/ })