@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
@@ -174,7 +174,8 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
174
174
  }, {
175
175
  colorTableHeight: 8000,
176
176
  colorTable: "#FF0000"
177
- }]);
177
+ }]); // 自定义颜色区间数据列表
178
+
178
179
  const colorImages = [{
179
180
  value: "0",
180
181
  src: _constImage.RED_TO_PURPLE_URL
@@ -184,8 +185,9 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
184
185
  }, {
185
186
  value: "2",
186
187
  src: _constImage.GREEN_TO_BLUE_URL
187
- }];
188
- let activeName = (0, _vue.ref)("line");
188
+ }]; // 渐变纹理图片选项列表
189
+
190
+ let activeName = (0, _vue.ref)("line"); // 当前激活的标签页名称
189
191
 
190
192
  // 获取组件传参
191
193
  const props = __props;
@@ -260,7 +262,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
260
262
  // 最大高度范围的最大值
261
263
  surfaceAlpha: props?.settingParams?.surfaceAlpha ?? 0.6 // 面透明度
262
264
  });
263
- let viewModel = null;
265
+ let viewModel = null; // 视图模型实例
264
266
 
265
267
  // 组件容器Ref
266
268
  let boxRef = (0, _vue.ref)(null);
@@ -268,7 +270,8 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
268
270
  // 生成组件默认header
269
271
  let headerTemp = (0, _vue.ref)();
270
272
  let headerTempRef = (0, _vue.ref)();
271
- let maxHeight = (0, _vue.ref)(300);
273
+ let maxHeight = (0, _vue.ref)(300); // 滚动区域最大高度
274
+
272
275
  (0, _vue.onMounted)(() => {
273
276
  (0, _util.updatePosition)(boxRef.value, props);
274
277
  (0, _vue.watch)(() => props.position, (newVal, oldVal) => {
@@ -332,7 +335,9 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
332
335
  }
333
336
  };
334
337
 
335
- // 刷新自定义样式数组
338
+ /** @description 刷新自定义样式数组
339
+ * @param {String} type 类型:height 或 color
340
+ */
336
341
  function refactorArr(type) {
337
342
  if (!dataList || !dataList.length) return;
338
343
  if (type == "height") {
@@ -353,12 +358,16 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
353
358
  viewModel && viewModel.start();
354
359
  }
355
360
 
356
- //修改填充类型
361
+ /** @description 修改填充类型
362
+ * @param {Number} value 填充类型编号
363
+ */
357
364
  const onChangeSelect = value => {
358
365
  viewModel.setFillType(value);
359
366
  };
360
367
 
361
- //修改填充样式
368
+ /** @description 修改填充样式
369
+ * @param {Number} value 填充样式编号
370
+ */
362
371
  const onChangeFillStyle = value => {
363
372
  viewModel.setFillStyle(value);
364
373
  };
@@ -373,7 +382,10 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
373
382
  viewModel && viewModel.destroy();
374
383
  });
375
384
 
376
- //获取图片路径
385
+ /** @description 获取图片路径
386
+ * @param {String} value 图片编号
387
+ * @returns {String} 图片路径
388
+ */
377
389
  function getImagePath(value) {
378
390
  var imagePath = "";
379
391
  var image = colorImages.find(item => item.value === value);
@@ -382,6 +394,10 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
382
394
  }
383
395
  return imagePath;
384
396
  }
397
+
398
+ /** @description 表单参数变化回调,根据 key 调用对应的视图模型方法
399
+ * @param {String} key 变化的字段标识
400
+ */
385
401
  function paramsChanged(key) {
386
402
  switch (key) {
387
403
  case "elevationMarking":
@@ -2147,6 +2163,11 @@ var _useGlobalConfig = __webpack_require__(22686);
2147
2163
  //等值线分析逻辑类
2148
2164
 
2149
2165
  class IsolineAnalysisViewModel {
2166
+ // 当前语言包
2167
+ /** @description 构造函数,初始化等值线分析对象
2168
+ * @param {Object} scenceView 场景视图对象,包含 viewer、drawManager 等
2169
+ * @param {Object} options 等值线分析参数对象
2170
+ */
2150
2171
  constructor(scenceView, options) {
2151
2172
  this._elevation = null;
2152
2173
  //等值线分析三维对象
@@ -2179,9 +2200,10 @@ class IsolineAnalysisViewModel {
2179
2200
  this._language = locale;
2180
2201
  this._options = options;
2181
2202
  this._options.viewer = scenceView._viewer;
2182
- this._options.viewer.scene.globe.depthTestAgainstTerrain = true;
2203
+ this._options.viewer.scene.globe.depthTestAgainstTerrain = true; // 开启地形深度测试
2183
2204
  this._options.colorImage = this.getImagePath(this._options.colorImage);
2184
2205
  this._surfaceColorImage = this._options.colorImage;
2206
+ // 各曲线颜色字符串转换为 Cesium.Color 对象
2185
2207
  if (options.firstCurve.color) {
2186
2208
  options.firstCurve.color = Cesium.Color.fromCssColorString(options.firstCurve.color);
2187
2209
  }
@@ -2203,32 +2225,42 @@ class IsolineAnalysisViewModel {
2203
2225
  this._elevation = null;
2204
2226
  this._drawManager = scenceView._drawManager;
2205
2227
  }
2206
- // 设置等高面区间
2228
+ /** @description 设置等高面区间
2229
+ * @param {Array<Number>} heights 高度区间数组
2230
+ */
2207
2231
  setColorTableHeight(heights) {
2208
2232
  this._surfaceColorTableValue = heights.map(function (item) {
2209
2233
  return item / 8000;
2210
2234
  });
2211
2235
  this.changeSurfaceFillStyle(0);
2212
2236
  }
2213
- // 设置等高面填充样式
2237
+ /** @description 设置等高面填充样式
2238
+ * @param {Array<String>} newValue 颜色数组
2239
+ */
2214
2240
  setColorTable(newValue) {
2215
2241
  this._surfaceColorTable = newValue;
2216
2242
  this.changeSurfaceFillStyle(0);
2217
2243
  }
2218
2244
 
2219
- //设置填充图片
2245
+ /** @description 设置填充图片
2246
+ * @param {String} image 填充图片地址
2247
+ */
2220
2248
  setFillStyleImage(image) {
2221
2249
  this._options.colorImage = image;
2222
2250
  this._surfaceColorImage = image;
2223
2251
  if (this._elevation) this._elevation.colorImage = image;
2224
2252
  }
2225
2253
 
2226
- //设置填充样式
2254
+ /** @description 设置填充样式
2255
+ * @param {Number} value 填充样式编号
2256
+ */
2227
2257
  setFillStyle(value) {
2228
2258
  this.changeSurfaceFillStyle(value);
2229
2259
  }
2230
2260
 
2231
- //修改等高面填充样式
2261
+ /** @description 修改等高面填充样式
2262
+ * @param {Number} value 填充样式编号
2263
+ */
2232
2264
  changeSurfaceFillStyle(value) {
2233
2265
  if (!this._elevation) return;
2234
2266
  switch (value) {
@@ -2245,7 +2277,10 @@ class IsolineAnalysisViewModel {
2245
2277
  }
2246
2278
  }
2247
2279
 
2248
- //获取图片路径
2280
+ /** @description 获取图片路径
2281
+ * @param {String} value 图片编号
2282
+ * @returns {String} 图片路径
2283
+ */
2249
2284
  getImagePath(value) {
2250
2285
  var imagePath = "";
2251
2286
  var image = this._colorImages.find(item => item.value === value);
@@ -2255,7 +2290,10 @@ class IsolineAnalysisViewModel {
2255
2290
  return imagePath;
2256
2291
  }
2257
2292
 
2258
- //修改填充图片
2293
+ /** @description 修改填充图片
2294
+ * @param {Number} value 图片编号
2295
+ * @returns {String} 图片路径
2296
+ */
2259
2297
  setColorLine(value) {
2260
2298
  var path = "";
2261
2299
  switch (value) {
@@ -2272,7 +2310,9 @@ class IsolineAnalysisViewModel {
2272
2310
  return path;
2273
2311
  }
2274
2312
 
2275
- //设置填充类型
2313
+ /** @description 设置填充类型
2314
+ * @param {Number} value 填充类型编号
2315
+ */
2276
2316
  setFillType(value) {
2277
2317
  // if(!this._elevation) return;
2278
2318
  switch (value) {
@@ -2316,6 +2356,7 @@ class IsolineAnalysisViewModel {
2316
2356
  if (!shape.groupName || shape.groupName !== "IsolineAnalysisDraw") return;
2317
2357
  if (shape) {
2318
2358
  that._options.positions = shape._controlPoints;
2359
+ // 根据填充类型设置分析类型
2319
2360
  switch (that._options.filltype) {
2320
2361
  case 0:
2321
2362
  that._options.type = Cesium.Kq3dContourAnalysisType.LINE;
@@ -2355,88 +2396,122 @@ class IsolineAnalysisViewModel {
2355
2396
  destroy() {
2356
2397
  this.clear();
2357
2398
  }
2358
- //设置首曲线显隐
2399
+ /** @description 设置首曲线显隐
2400
+ * @param {Boolean} show 是否显示
2401
+ */
2359
2402
  setElevationMarking(show) {
2360
2403
  this._options.label = show;
2361
2404
  if (this._elevation) this._elevation._isLabel = this._options.label;
2362
2405
  }
2363
- //设置首曲线显隐
2406
+ /** @description 设置首曲线显隐
2407
+ * @param {Boolean} show 是否显示
2408
+ */
2364
2409
  setFirstCurve(show) {
2365
2410
  this._options.firstCurve.show = show;
2366
2411
  if (this._elevation) this._elevation.firstCurve = this._options.firstCurve;
2367
2412
  }
2368
- //设置首曲线间隔
2413
+ /** @description 设置首曲线间隔
2414
+ * @param {Number} spaceing 间隔值
2415
+ */
2369
2416
  setFirstCurveSpace(spaceing) {
2370
2417
  this._options.spaceing = Number(spaceing);
2371
2418
  if (this._elevation) this._elevation.spaceing = this._options.spaceing;
2372
2419
  }
2373
- //设置首曲线宽度
2420
+ /** @description 设置首曲线宽度
2421
+ * @param {Number} width 宽度值
2422
+ */
2374
2423
  setFirstCurveWidth(width) {
2375
2424
  this._options.firstCurve.width = Number(width);
2376
2425
  if (this._elevation) this._elevation.firstCurve = this._options.firstCurve;
2377
2426
  }
2378
- //设置首曲线颜色
2427
+ /** @description 设置首曲线颜色
2428
+ * @param {String} color 颜色字符串
2429
+ */
2379
2430
  setFirstCurveColor(color) {
2380
2431
  this._options.firstCurve.color = new Cesium.Color.fromCssColorString(color);
2381
2432
  if (this._elevation) this._elevation.firstCurve = this._options.firstCurve;
2382
2433
  }
2383
2434
 
2384
- //设置计曲线显隐
2435
+ /** @description 设置计曲线显隐
2436
+ * @param {Boolean} show 是否显示
2437
+ */
2385
2438
  setRememberCurve(show) {
2386
2439
  this._options.rememberCurve.show = show;
2387
2440
  if (this._elevation) this._elevation.rememberCurve = this._options.rememberCurve;
2388
2441
  }
2389
- //设置计曲线宽度
2442
+ /** @description 设置计曲线宽度
2443
+ * @param {Number} width 宽度值
2444
+ */
2390
2445
  setRememberCurveWidth(width) {
2391
2446
  this._options.rememberCurve.width = Number(width);
2392
2447
  if (this._elevation) this._elevation.rememberCurve = this._options.rememberCurve;
2393
2448
  }
2394
- //设置计曲线颜色
2449
+ /** @description 设置计曲线颜色
2450
+ * @param {String} color 颜色字符串
2451
+ */
2395
2452
  setRememberCurveColor(color) {
2396
2453
  this._options.rememberCurve.color = new Cesium.Color.fromCssColorString(color);
2397
2454
  if (this._elevation) this._elevation.rememberCurve = this._options.rememberCurve;
2398
2455
  }
2399
- //设置间曲线显隐
2456
+ /** @description 设置间曲线显隐
2457
+ * @param {Boolean} show 是否显示
2458
+ */
2400
2459
  setIntervalCurve(show) {
2401
2460
  this._options.timeCurve.show = show;
2402
2461
  if (this._elevation) this._elevation.timeCurve = this._options.timeCurve;
2403
2462
  }
2404
- //设置间曲线宽度
2463
+ /** @description 设置间曲线宽度
2464
+ * @param {Number} width 宽度值
2465
+ */
2405
2466
  setIntervalCurveWidth(width) {
2406
2467
  this._options.timeCurve.width = Number(width);
2407
2468
  if (this._elevation) this._elevation.timeCurve = this._options.timeCurve;
2408
2469
  }
2409
- //设置间曲线颜色
2470
+ /** @description 设置间曲线颜色
2471
+ * @param {String} color 颜色字符串
2472
+ */
2410
2473
  setIntervalCurveColor(color) {
2411
2474
  this._options.timeCurve.color = new Cesium.Color.fromCssColorString(color);
2412
2475
  if (this._elevation) this._elevation.timeCurve = this._options.timeCurve;
2413
2476
  }
2414
- //设置助曲线显隐
2477
+ /** @description 设置助曲线显隐
2478
+ * @param {Boolean} show 是否显示
2479
+ */
2415
2480
  setExtraCurve(show) {
2416
2481
  this._options.helpCurve.show = show;
2417
2482
  if (this._elevation) this._elevation.helpCurve = this._options.helpCurve;
2418
2483
  }
2419
- //设置助曲线宽度
2484
+ /** @description 设置助曲线宽度
2485
+ * @param {Number} width 宽度值
2486
+ */
2420
2487
  setExtraCurveWidth(width) {
2421
2488
  this._options.helpCurve.width = Number(width);
2422
2489
  if (this._elevation) this._elevation.helpCurve = this._options.helpCurve;
2423
2490
  }
2424
- //设置助曲线颜色
2491
+ /** @description 设置助曲线颜色
2492
+ * @param {String} color 颜色字符串
2493
+ */
2425
2494
  setExtraCurveColor(color) {
2426
2495
  if (this._elevation) this._elevation.helpCurve = this._options.helpCurve;
2427
2496
  this._options.helpCurve.color = new Cesium.Color.fromCssColorString(color);
2428
2497
  }
2429
- //设置面透明度
2498
+ /** @description 设置面透明度
2499
+ * @param {Number} alpha 透明度值
2500
+ */
2430
2501
  setSurfaceAlpha(alpha) {
2431
2502
  this._options.surfaceAlpha = Number(alpha);
2432
2503
  if (this._elevation) this._elevation.surfaceAlpha = Number(alpha);
2433
2504
  }
2434
- //设置最小高度
2505
+ /** @description 设置最小高度
2506
+ * @param {Number} minHeight 最小高度值
2507
+ */
2435
2508
  setMinHeight(minHeight) {
2436
2509
  this._options.minHeight = Number(minHeight);
2437
2510
  if (this._elevation) this._elevation.minHeight = Number(minHeight);
2438
2511
  }
2439
- //设置最大高度
2512
+ /** @description 设置最大高度
2513
+ * @param {Number} maxHeight 最大高度值
2514
+ */
2440
2515
  setMaxHeight(maxHeight) {
2441
2516
  this._options.maxHeight = Number(maxHeight);
2442
2517
  if (this._elevation) this._elevation.maxHeight = Number(maxHeight);
@@ -3880,11 +3955,11 @@ Object.defineProperty(exports, "__esModule", ({
3880
3955
  value: true
3881
3956
  }));
3882
3957
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
3883
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
3958
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
3884
3959
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
3885
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
3960
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
3886
3961
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
3887
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
3962
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
3888
3963
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
3889
3964
 
3890
3965
  /***/ })
package/light/index.js CHANGED
@@ -335,22 +335,36 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
335
335
  collapseValue: props?.settingParams?.collapseValue === '' ? '' : props?.settingParams?.collapseValue ?? "setting",
336
336
  // 默认展开属性设置
337
337
  mode: props?.settingParams?.mode ?? "point",
338
+ // 灯光类型:point/spot/parallel
338
339
  color: props?.settingParams?.color ?? "#fff",
340
+ // 灯光颜色
339
341
  distance: props?.settingParams?.distance ?? 200,
342
+ // 扩散距离
340
343
  minDistance: props?.settingParams?.minDistance ?? 1,
344
+ // 扩散距离最小值
341
345
  maxDistance: props?.settingParams?.maxDistance ?? 1000,
346
+ // 扩散距离最大值
342
347
  decay: props?.settingParams?.decay ?? 0.1,
348
+ // 衰减因子
343
349
  minDecay: props?.settingParams?.minDecay ?? 0,
350
+ // 衰减因子最小值
344
351
  maxDecay: props?.settingParams?.maxDecay ?? 1,
352
+ // 衰减因子最大值
345
353
  intensity: props?.settingParams?.intensity ?? 5,
354
+ // 光源强度
346
355
  minIntensity: props?.settingParams?.minIntensity ?? 0,
356
+ // 光源强度最小值
347
357
  maxIntensity: props?.settingParams?.maxIntensity ?? 20,
358
+ // 光源强度最大值
348
359
  angle: props?.settingParams?.angle ?? 80,
360
+ // 聚光灯角度
349
361
  minAngle: props?.settingParams?.minAngle ?? 0,
362
+ // 聚光灯角度最小值
350
363
  maxAngle: props?.settingParams?.maxAngle ?? 160,
351
- showModel: props?.settingParams?.showModel ?? true
364
+ // 聚光灯角度最大值
365
+ showModel: props?.settingParams?.showModel ?? true // 是否显示光源模型
352
366
  });
353
- let viewModel = null;
367
+ let viewModel = null; // 灯光视图模型实例
354
368
 
355
369
  // 组件容器Ref
356
370
  let boxRef = (0, _vue.ref)(null);
@@ -385,11 +399,19 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
385
399
  headerTemp.value = (0, _util.createHeaderTemp)(boxRef.value, (0, _vue.toRefs)(props), headerTempRef, "webgl.light");
386
400
  }
387
401
  };
402
+
403
+ /** @description 切换灯光类型
404
+ * @param {String} mode 灯光类型:point/spot/parallel
405
+ */
388
406
  function changeMode(mode) {
389
407
  if (formItem.mode !== mode) {
390
408
  formItem.mode = mode;
391
409
  }
392
410
  }
411
+
412
+ /** @description 表单参数变化回调,根据 key 调用对应的视图模型方法
413
+ * @param {String} key 变化的字段标识
414
+ */
393
415
  function paramsChanged(key) {
394
416
  switch (key) {
395
417
  case "color":
@@ -414,9 +436,13 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
414
436
  break;
415
437
  }
416
438
  }
439
+
440
+ // 添加灯光
417
441
  function add() {
418
442
  viewModel && viewModel.addLight();
419
443
  }
444
+
445
+ // 清除灯光
420
446
  function clear() {
421
447
  viewModel && viewModel.clear();
422
448
  }
@@ -841,8 +867,13 @@ exports["default"] = void 0;
841
867
  class LightViewModel {
842
868
  //灯光对象集合
843
869
 
870
+ /** @description 构造函数,初始化灯光视图模型并注册绘制事件
871
+ * @param {Object} scenceView 场景视图对象
872
+ * @param {Object} options 灯光参数对象
873
+ */
844
874
  constructor(scenceView, options) {
845
875
  this._viewer = null;
876
+ // Cesium Viewer 实例
846
877
  this._light = null;
847
878
  //灯光对象
848
879
  this._lightModel = null;
@@ -862,9 +893,10 @@ class LightViewModel {
862
893
  this._viewer.dataSources.add(this._lightModelDs);
863
894
  var that = this;
864
895
  that._handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
896
+ // 注册鼠标左键点击事件,用于平行光绘制时拾取两点
865
897
  that._handler.setInputAction(function () {
866
898
  if (that._drawHandler._shapeObject && that._drawHandler._shapeObject.type === "polyline") {
867
- let positions = that._drawHandler._shapeObject.controlPoints;
899
+ const positions = that._drawHandler._shapeObject.controlPoints;
868
900
  if (positions.length === 3) {
869
901
  that._drawManager.stopDraw();
870
902
  if (that._options.mode == "parallel") {
@@ -879,6 +911,7 @@ class LightViewModel {
879
911
  var that = this;
880
912
  if (this._options) {
881
913
  if (!this._drawManager) return;
914
+ // 点光源或聚光灯:进入标点绘制模式
882
915
  if (this._options.mode == "point" || this._options.mode == "spot") {
883
916
  this._drawManager.startDraw("marker", {
884
917
  image: null
@@ -887,7 +920,7 @@ class LightViewModel {
887
920
  }) => {
888
921
  if (!shape.groupName || shape.groupName !== "LightDraw") return;
889
922
  if (shape && shape.type === "marker") {
890
- let position = shape.position;
923
+ const position = shape.position;
891
924
  if (position) {
892
925
  if (that._options.mode == "point") {
893
926
  that.addPointLight(position);
@@ -899,6 +932,7 @@ class LightViewModel {
899
932
  that._drawManager && that._drawManager.clearDrawGroup("LightDraw");
900
933
  }, "LightDraw");
901
934
  } else if (this._options.mode == "parallel") {
935
+ // 平行光:进入折线绘制模式
902
936
  this._drawManager.startDraw("polyline", {
903
937
  clampToGround: false
904
938
  }, (feature, {
@@ -909,9 +943,12 @@ class LightViewModel {
909
943
  }
910
944
  }
911
945
  }
912
- //添加点光源
946
+ /** @description 添加点光源
947
+ * @param {Cesium.Cartesian3} position 点光源位置
948
+ */
913
949
  addPointLight(position) {
914
- let color = Cesium.Color.fromCssColorString(this._options.color);
950
+ const color = Cesium.Color.fromCssColorString(this._options.color);
951
+ // 不同 Cesium 版本走不同分支
915
952
  if (Cesium.SplitDirection) {
916
953
  this._light = new Cesium.Kq3dPointLight({
917
954
  position: position,
@@ -933,6 +970,7 @@ class LightViewModel {
933
970
  lightIntensity: this._options.intensity
934
971
  });
935
972
  }
973
+ // 添加点光源对应的可视化模型
936
974
  this._lightModel = this._lightModelDs.entities.add({
937
975
  show: this._options.showModel,
938
976
  position: position,
@@ -944,14 +982,17 @@ class LightViewModel {
944
982
  });
945
983
  this._lightList.push(this._light);
946
984
  }
947
- //添加聚光灯
985
+ /** @description 添加聚光灯
986
+ * @param {Cesium.Cartesian3} position 聚光灯位置
987
+ */
948
988
  addSpotLight(position) {
949
- let color = Cesium.Color.fromCssColorString(this._options.color);
950
- let lights = [{
989
+ const color = Cesium.Color.fromCssColorString(this._options.color);
990
+ const lights = [{
951
991
  modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(position),
952
992
  offset: new Cesium.Cartesian3(),
953
993
  direction: new Cesium.Cartesian3(0, 0, -1.0)
954
994
  }];
995
+ // 不同 Cesium 版本走不同分支
955
996
  if (Cesium.SplitDirection) {
956
997
  this._light = new Cesium.Kq3dSpotLightStage({
957
998
  viewer: this._viewer,
@@ -975,6 +1016,7 @@ class LightViewModel {
975
1016
  }
976
1017
  this._viewer.effects.add(this._light);
977
1018
  this._lightList.push(this._light);
1019
+ // 添加聚光灯对应的可视化模型
978
1020
  this._lightModel = this._lightModelDs.entities.add({
979
1021
  show: this._options.showModel,
980
1022
  position: position,
@@ -985,10 +1027,14 @@ class LightViewModel {
985
1027
  }
986
1028
  });
987
1029
  }
988
- //添加平行光
1030
+ /** @description 添加平行光
1031
+ * @param {Cesium.Cartesian3} positionA 平行光方向起点
1032
+ * @param {Cesium.Cartesian3} positionB 平行光方向终点
1033
+ */
989
1034
  addParallelLight(positionA, positionB) {
990
- let color = Cesium.Color.fromCssColorString(this._options.color);
991
- let direction = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(positionB, positionA, new Cesium.Cartesian3()), new Cesium.Cartesian3());
1035
+ const color = Cesium.Color.fromCssColorString(this._options.color);
1036
+ // 计算平行光方向向量并归一化
1037
+ const direction = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(positionB, positionA, new Cesium.Cartesian3()), new Cesium.Cartesian3());
992
1038
  this._light = new Cesium.DirectionalLight({
993
1039
  direction: direction,
994
1040
  color: color,
@@ -1036,9 +1082,11 @@ class LightViewModel {
1036
1082
  this.clear();
1037
1083
  this._handler && this._handler.destroy();
1038
1084
  }
1039
- //设置光源颜色
1085
+ /** @description 设置光源颜色
1086
+ * @param {String} color 颜色字符串
1087
+ */
1040
1088
  setColor(color) {
1041
- let cesiumColor = Cesium.Color.fromCssColorString(color);
1089
+ const cesiumColor = Cesium.Color.fromCssColorString(color);
1042
1090
  if (this._light) {
1043
1091
  this._light.color = cesiumColor;
1044
1092
  }
@@ -1047,7 +1095,9 @@ class LightViewModel {
1047
1095
  this._lightModel.ellipsoid.material = cesiumColor;
1048
1096
  }
1049
1097
  }
1050
- //设置扩散距离
1098
+ /** @description 设置扩散距离
1099
+ * @param {Number} distance 扩散距离值
1100
+ */
1051
1101
  setDistance(distance) {
1052
1102
  if (this._light) {
1053
1103
  if (Cesium.SplitDirection) {
@@ -1061,13 +1111,17 @@ class LightViewModel {
1061
1111
  }
1062
1112
  }
1063
1113
  }
1064
- //设置衰减因子
1114
+ /** @description 设置衰减因子
1115
+ * @param {Number} decay 衰减因子值
1116
+ */
1065
1117
  setDecay(decay) {
1066
1118
  if (this._light) {
1067
1119
  this._light.decay = Number(decay);
1068
1120
  }
1069
1121
  }
1070
- //设置光源强度
1122
+ /** @description 设置光源强度
1123
+ * @param {Number} intensity 光源强度值
1124
+ */
1071
1125
  setIntensity(intensity) {
1072
1126
  if (this._light) {
1073
1127
  if (this._options.mode == "parallel") {
@@ -1081,14 +1135,18 @@ class LightViewModel {
1081
1135
  }
1082
1136
  }
1083
1137
  }
1084
- //光源模型显隐控制
1138
+ /** @description 光源模型显隐控制
1139
+ * @param {Boolean} isShow 是否显示
1140
+ */
1085
1141
  showModel(isShow) {
1086
1142
  if (this._lightModel) {
1087
1143
  this._lightModel.show = isShow;
1088
1144
  }
1089
1145
  //this._lightModelDs.show = isShow;
1090
1146
  }
1091
- // 设置聚光灯角度
1147
+ /** @description 设置聚光灯角度
1148
+ * @param {Number} angle 聚光灯角度
1149
+ */
1092
1150
  showAngle(angle) {
1093
1151
  if (this._light) {
1094
1152
  this._light.angle = Number(angle);
@@ -2555,11 +2613,11 @@ Object.defineProperty(exports, "__esModule", ({
2555
2613
  value: true
2556
2614
  }));
2557
2615
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
2558
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
2616
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
2559
2617
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
2560
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
2618
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
2561
2619
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
2562
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
2620
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
2563
2621
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
2564
2622
 
2565
2623
  /***/ })