@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
package/roller/index.js CHANGED
@@ -94,6 +94,11 @@ exports["default"] = void 0;
94
94
  //卷帘逻辑类
95
95
  class RollerViewModel {
96
96
  //上下卷帘活动状态
97
+ /**
98
+ * @description 构造函数:初始化卷帘视图模型
99
+ * @param {Object} scenceView 场景视图对象
100
+ * @param {Object} options 选项对象(包含图层数组)
101
+ */
97
102
  constructor(scenceView, options) {
98
103
  this._viewer = null;
99
104
  //三维viewer对象
@@ -115,14 +120,17 @@ class RollerViewModel {
115
120
  this._viewer = scenceView._viewer;
116
121
  this._layerManager = scenceView._layerManager;
117
122
  this._layers = options.layers;
123
+ // 创建左右卷帘分割线DOM元素
118
124
  this._lrSlider = document.createElement("div");
119
125
  this._lrSlider.class = "shutter-slider";
120
126
  this._lrSlider.id = "lrSlider";
127
+ // 创建上下卷帘分割线DOM元素
121
128
  this._tbSlider = document.createElement("div");
122
129
  this._tbSlider.class = "shutter-slider";
123
130
  this._tbSlider.id = "tbSlider";
124
131
  this._viewer.container.appendChild(this._lrSlider);
125
132
  this._viewer.container.appendChild(this._tbSlider);
133
+ // 延迟初始化图层,等待图层加载完成
126
134
  setTimeout(() => {
127
135
  this.initLayers();
128
136
  }, 500);
@@ -131,46 +139,55 @@ class RollerViewModel {
131
139
 
132
140
  //注册卷帘拖动事件
133
141
  registerEvents() {
134
- let that = this;
142
+ const that = this;
143
+ // 左右卷帘分割线事件处理
135
144
  this._lrSliderHandler = new Cesium.ScreenSpaceEventHandler(this._lrSlider);
145
+ // 鼠标左键按下:激活左右卷帘拖动
136
146
  this._lrSliderHandler.setInputAction(function () {
137
147
  that._lrSliderActive = true;
138
148
  }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
149
+ // 鼠标移动:根据位置更新分割位置
139
150
  this._lrSliderHandler.setInputAction(function (movement) {
140
151
  if (!that._lrSliderActive) {
141
152
  return;
142
153
  }
143
- let relativeOffset = movement.endPosition.x;
144
- let splitPosition = (that._lrSlider.offsetLeft + relativeOffset) / that._lrSlider.parentElement.parentElement.offsetWidth;
154
+ const relativeOffset = movement.endPosition.x;
155
+ const splitPosition = (that._lrSlider.offsetLeft + relativeOffset) / that._lrSlider.parentElement.parentElement.offsetWidth;
145
156
  that._lrSlider.style.left = 100.0 * splitPosition + "%";
146
157
  if (that._viewer.scene.imagerySplitPosition !== undefined) that._viewer.scene.imagerySplitPosition = splitPosition;else that._viewer.scene.splitPosition = splitPosition;
147
158
  }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
159
+ // 鼠标左键抬起:停止拖动
148
160
  this._lrSliderHandler.setInputAction(function () {
149
161
  that._lrSliderActive = false;
150
162
  }, Cesium.ScreenSpaceEventType.LEFT_UP);
163
+
164
+ // 上下卷帘分割线事件处理
151
165
  this._tbSliderHandler = new Cesium.ScreenSpaceEventHandler(this._tbSlider);
166
+ // 鼠标左键按下:激活上下卷帘拖动
152
167
  this._tbSliderHandler.setInputAction(function () {
153
168
  that._tbSliderActive = true;
154
169
  }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
170
+ // 鼠标移动:根据位置更新分割位置
155
171
  this._tbSliderHandler.setInputAction(function (movement) {
156
172
  if (!that._tbSliderActive) {
157
173
  return;
158
174
  }
159
- let relativeOffset = movement.endPosition.y;
160
- let splitPosition = 1.0 - (that._tbSlider.offsetTop + relativeOffset) / that._tbSlider.parentElement.parentElement.offsetHeight;
175
+ const relativeOffset = movement.endPosition.y;
176
+ const splitPosition = 1.0 - (that._tbSlider.offsetTop + relativeOffset) / that._tbSlider.parentElement.parentElement.offsetHeight;
161
177
  that._tbSlider.style.top = 100.0 * (1.0 - splitPosition) + "%";
162
178
  // 兼容Cesium186和1102
163
179
  if (that._viewer.scene.imagerySplitPosition !== undefined) that._viewer.scene.imagerySplitPosition = splitPosition;else that._viewer.scene.splitPosition = splitPosition;
164
180
  }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
181
+ // 鼠标左键抬起:停止拖动
165
182
  this._tbSliderHandler.setInputAction(function () {
166
183
  that._tbSliderActive = false;
167
184
  }, Cesium.ScreenSpaceEventType.LEFT_UP);
168
185
  }
169
186
  //初始化图层数据
170
187
  initLayers() {
171
- let layers = this._layerManager.getLayerCheckedList();
188
+ const layers = this._layerManager.getLayerCheckedList();
172
189
  for (let i = 0; i < layers.length; i++) {
173
- let layer = this._layerManager.getLayerByGuid(layers[i].guid);
190
+ const layer = this._layerManager.getLayerByGuid(layers[i].guid);
174
191
  if (layer instanceof Cesium.ImageryLayer || layer instanceof Cesium.Cesium3DTileset) {
175
192
  this._layers.push({
176
193
  guid: layers[i].guid,
@@ -181,21 +198,28 @@ class RollerViewModel {
181
198
  }
182
199
  }
183
200
 
201
+ /**
202
+ * @description 切换卷帘模式
203
+ * @param {Number} mode 模式值(1:左右卷帘,2:上下卷帘,0/其他:无卷帘)
204
+ */
184
205
  //切换模式
185
206
  changeMode(mode) {
186
207
  let direction = 0;
187
208
  let splitdirection = Cesium.ImagerySplitDirection ? Cesium.ImagerySplitDirection.NONE : Cesium.SplitDirection.NONE;
188
209
  let splitPosition = 0.5;
210
+ // 先隐藏所有分割线
189
211
  this._lrSlider.style.display = "none";
190
212
  this._tbSlider.style.display = "none";
191
213
  switch (mode) {
192
214
  case 1:
215
+ // 左右卷帘模式
193
216
  direction = 1;
194
217
  this._lrSlider.style.display = "block";
195
218
  splitdirection = Cesium.ImagerySplitDirection ? Cesium.ImagerySplitDirection.LEFT : Cesium.SplitDirection.LEFT;
196
219
  splitPosition = this._lrSlider.offsetLeft / this._lrSlider.parentElement.parentElement.offsetWidth;
197
220
  break;
198
221
  case 2:
222
+ // 上下卷帘模式
199
223
  direction = 3;
200
224
  this._tbSlider.style.display = "block";
201
225
  splitdirection = Cesium.ImagerySplitDirection ? Cesium.ImagerySplitDirection.TOP : Cesium.SplitDirection.TOP;
@@ -204,22 +228,29 @@ class RollerViewModel {
204
228
  default:
205
229
  break;
206
230
  }
207
- let that = this;
231
+ const that = this;
232
+ // 同步所有图层的方向和分割方向
208
233
  this._layers.forEach(layer => {
209
234
  layer.direction = direction;
210
- let layerObj = that._layerManager.getLayerByGuid(layer.guid);
235
+ const layerObj = that._layerManager.getLayerByGuid(layer.guid);
211
236
  if (layerObj) layerObj.splitDirection = splitdirection;
212
237
  });
213
238
  if (mode !== 0) {
239
+ // 兼容Cesium186和1102
214
240
  if (this._viewer.scene.imagerySplitPosition !== undefined) {
215
241
  this._viewer.scene.imagerySplitPosition = splitPosition;
216
242
  } else this._viewer.scene.splitPosition = splitPosition;
217
243
  }
218
244
  }
219
245
 
246
+ /**
247
+ * @description 改变指定图层的卷帘方向
248
+ * @param {Number} index 图层在列表中的索引
249
+ */
220
250
  //改变方向
221
251
  changeDirection(index) {
222
- let direction = this._layers[index].direction;
252
+ const direction = this._layers[index].direction;
253
+ // 兼容Cesium186和1102的分割方向枚举
223
254
  let splitDirection = Cesium.ImagerySplitDirection;
224
255
  if (!splitDirection) {
225
256
  splitDirection = Cesium.SplitDirection;
@@ -240,12 +271,13 @@ class RollerViewModel {
240
271
  splitdirection = splitDirection.BOTTOM;
241
272
  break;
242
273
  case 5:
274
+ // 隐藏图层
243
275
  show = false;
244
276
  break;
245
277
  default:
246
278
  break;
247
279
  }
248
- let layer = this._layerManager.getLayerByGuid(this._layers[index].guid);
280
+ const layer = this._layerManager.getLayerByGuid(this._layers[index].guid);
249
281
  if (layer) {
250
282
  layer.show = show;
251
283
  layer.splitDirection = splitdirection;
@@ -1021,18 +1053,20 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
1021
1053
  "font-size": "14px"
1022
1054
  };
1023
1055
  };
1056
+
1057
+ //卷帘表单参数
1024
1058
  let formItem = (0, _vue.reactive)({
1025
1059
  mode: props?.settingParams?.mode ?? null
1026
1060
  });
1027
- let layers = (0, _vue.reactive)([]);
1028
- let viewModel = null;
1061
+ let layers = (0, _vue.reactive)([]); // 卷帘图层列表
1062
+ let viewModel = null; // 卷帘视图模型实例
1029
1063
 
1030
1064
  // 组件容器Ref
1031
1065
  let boxRef = (0, _vue.ref)(null);
1032
1066
 
1033
1067
  // 生成组件默认header
1034
1068
  let headerTemp = (0, _vue.ref)();
1035
- let headerTempRef = (0, _vue.ref)();
1069
+ let headerTempRef = (0, _vue.ref)(); // headerTemp组件Ref
1036
1070
  (0, _vue.onMounted)(() => {
1037
1071
  (0, _util.updatePosition)(boxRef.value, props);
1038
1072
  (0, _vue.watch)(() => props.position, (newVal, oldVal) => {
@@ -1069,7 +1103,10 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
1069
1103
  let mode = formItem.mode;
1070
1104
  viewModel && viewModel.changeMode(formItem.mode);
1071
1105
  }
1072
- // 改变方向
1106
+ /**
1107
+ * @description 改变方向
1108
+ * @param {Number} index 图层在列表中的索引
1109
+ */
1073
1110
  function changeDirection(index) {
1074
1111
  viewModel && viewModel.changeDirection(index);
1075
1112
  }
@@ -1313,11 +1350,11 @@ Object.defineProperty(exports, "__esModule", ({
1313
1350
  value: true
1314
1351
  }));
1315
1352
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
1316
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
1353
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
1317
1354
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
1318
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
1355
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
1319
1356
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
1320
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
1357
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
1321
1358
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
1322
1359
 
1323
1360
  /***/ })
@@ -87,41 +87,72 @@ var _useGlobalConfig = __webpack_require__(22686);
87
87
  // 国际化
88
88
 
89
89
  class ScanEffectViewModel {
90
+ // 国际化语言对象
91
+ /**
92
+ * @description 构造函数,初始化扫描效果视图模型
93
+ * @param {Object} scenceView 场景视图对象,包含 _viewer 与 _drawManager
94
+ * @param {Object} option 表单参数对象,包含扫描样式、半径、颜色等配置
95
+ */
90
96
  constructor(scenceView, option) {
91
97
  this._viewer = null;
98
+ // Cesium 视图对象
92
99
  //参数
93
100
  this._options = {
94
101
  scanMode: 1,
95
102
  // 分析类型
96
103
  viewer: null,
104
+ // Cesium 视图对象
97
105
  lineWidth: 5,
106
+ // 线扫描宽度
98
107
  glowWidth: 20,
108
+ // 扫描线发光宽度
99
109
  length: 100,
110
+ // 扫描线长度
100
111
  origin: null,
112
+ // 扫描起点(笛卡尔坐标)
101
113
  direction: 45 / 180 * Math.PI,
114
+ // 扫描方向(弧度)
102
115
  color: window.Cesium.Color.fromCssColorString("#78f1fa"),
116
+ // 扫描颜色
103
117
  speed: 20,
118
+ // 扫描速度
104
119
  period: 5,
120
+ // 周期样式周期
105
121
  moveMode: 0,
122
+ // 移动模式
106
123
  lineColor: window.Cesium.Color.fromCssColorString("#78f1fa"),
124
+ // 线扫描颜色
107
125
  distance: 0,
126
+ // 扫描距离
108
127
  times: 0,
109
128
  // 扫描运动次数
110
129
  whetherToAndFrom: 0,
130
+ // 是否往返扫描
131
+
111
132
  ringMoveMode: 0,
133
+ // 环形扫描移动模式
112
134
  ringColor: window.Cesium.Color.fromCssColorString("#78f1fa"),
135
+ // 环形扫描颜色
113
136
  radius: 2000,
137
+ // 环形扫描半径
114
138
  ringScanType: 0,
139
+ // 环形扫描类型
115
140
  image: _constImage.ROUNDNESS_IMG,
141
+ // 环形扫描纹理
116
142
  blendEnable: false,
143
+ // 是否启用混合
117
144
  textureStyle: 1,
145
+ // 纹理样式
118
146
  lineScans: [],
119
- ringScans: []
147
+ // 已添加的线扫描集合
148
+ ringScans: [] // 已添加的环形扫描集合
120
149
  };
121
150
  this._drawManager = null;
122
151
  // 绘制对象
123
152
  this._lineScan = null;
153
+ // 当前线扫描实例
124
154
  this._ringScan = null;
155
+ // 当前环形扫描实例
125
156
  this._language = null;
126
157
  this._viewer = scenceView._viewer;
127
158
  this._options.viewer = this._viewer;
@@ -142,15 +173,20 @@ class ScanEffectViewModel {
142
173
  period: option.cycleStyle,
143
174
  distance: option.lengthStyle
144
175
  });
145
- this._viewer.scene.globe.depthTestAgainstTerrain = true;
176
+ this._viewer.scene.globe.depthTestAgainstTerrain = true; // 启用地形深度测试
146
177
  this._drawManager = scenceView._drawManager;
147
178
  const {
148
179
  locale
149
180
  } = (0, _useGlobalConfig.useLocale)();
150
181
  this._language = locale;
151
182
  }
183
+ /**
184
+ * @description 根据扫描模式添加扫描线(线扫描或环形扫描)
185
+ * @param {Object} cartesian 笛卡尔坐标点,作为扫描起点
186
+ */
152
187
  addScaningLine(cartesian) {
153
188
  if (this._options.scanMode == 0) {
189
+ // 线扫描模式:构造线扫描参数
154
190
  var params = {
155
191
  viewer: this._viewer,
156
192
  color: this._options.lineColor,
@@ -173,6 +209,7 @@ class ScanEffectViewModel {
173
209
  this._viewer.effects.add(this._lineScan); // 添加条形扫描线
174
210
  this._options.lineScans.push(this._lineScan);
175
211
  } else if (this._options.scanMode == 1) {
212
+ // 环形扫描模式:将笛卡尔坐标转为经纬度后添加环形扫描线
176
213
  var cPosition = window.Cesium.Cartographic.fromCartesian(cartesian);
177
214
  var position1 = window.Cesium.Math.toDegrees(cPosition.longitude);
178
215
  var position2 = window.Cesium.Math.toDegrees(cPosition.latitude);
@@ -181,7 +218,11 @@ class ScanEffectViewModel {
181
218
  this._options.ringScans.push(this._ringScan);
182
219
  }
183
220
  }
184
- //添加环型扫描线
221
+ /**
222
+ * @description 添加环型扫描线,根据扫描类型创建雷达扫描或圆形缩放扫描
223
+ * @param {Array} position 扫描中心点经纬度数组 [经度, 纬度, 高度]
224
+ * @returns {Object} 环形扫描线实例
225
+ */
185
226
  addRingScanLine(position) {
186
227
  var options = {
187
228
  viewer: this._viewer,
@@ -193,23 +234,29 @@ class ScanEffectViewModel {
193
234
  position: position || this._options.position
194
235
  };
195
236
  if (this._options.ringScanType == 2) {
237
+ // 雷达扫描类型
196
238
  return new RadarScanLine(options);
197
239
  } else {
240
+ // 圆形缩放扫描类型
198
241
  return new CircleZoomScanLine(options);
199
242
  }
243
+ /**
244
+ * 雷达扫描线构造函数
245
+ * @param {Object} options 扫描线配置参数
246
+ */
200
247
  function RadarScanLine(options) {
201
248
  options = options || {};
202
- this.position = options.position;
203
- this.radius = options.radius;
204
- this.moveMode = window.Cesium.defined(options.moveMode) ? options.moveMode : 1;
205
- this.fillStyle = window.Cesium.defined(options.fillStyle) ? options.fillStyle : 0;
206
- this.image = options.image;
207
- this.color = options.color;
208
- this.show = window.Cesium.defined(options.show) ? options.show : true;
209
- this.customDataSource = new window.Cesium.CustomDataSource("CircleRotateScan");
210
- this.viewer = options.viewer;
249
+ this.position = options.position; // 扫描中心点
250
+ this.radius = options.radius; // 扫描半径
251
+ this.moveMode = window.Cesium.defined(options.moveMode) ? options.moveMode : 1; // 移动模式
252
+ this.fillStyle = window.Cesium.defined(options.fillStyle) ? options.fillStyle : 0; // 填充样式
253
+ this.image = options.image; // 纹理图片
254
+ this.color = options.color; // 颜色
255
+ this.show = window.Cesium.defined(options.show) ? options.show : true; // 是否显示
256
+ this.customDataSource = new window.Cesium.CustomDataSource("CircleRotateScan"); // 自定义数据源
257
+ this.viewer = options.viewer; // Cesium 视图
211
258
  var that = this;
212
- var ratio = 1;
259
+ var ratio = 1; // 旋转方向系数
213
260
  var scanline = that.customDataSource.entities.add({
214
261
  position: window.Cesium.Cartesian3.fromDegrees(that.position[0], that.position[1], that.position[2]),
215
262
  name: "CircleRotateScan",
@@ -245,12 +292,14 @@ class ScanEffectViewModel {
245
292
  }),
246
293
  stRotation: new window.Cesium.CallbackProperty(function () {
247
294
  if (that.moveMode == 0) {
295
+ // 单一方向:始终正向
248
296
  ratio = 1;
249
297
  }
250
298
  if (!window.Cesium.defined(scanline.ellipse._stRotation2)) {
251
299
  scanline.ellipse._stRotation2 = 0;
252
300
  }
253
301
  if (scanline.ellipse._stRotation2 < 0) {
302
+ // 负角度处理
254
303
  if (that.moveMode == 1) {
255
304
  ratio = 1;
256
305
  } else {
@@ -258,6 +307,7 @@ class ScanEffectViewModel {
258
307
  }
259
308
  }
260
309
  if (scanline.ellipse._stRotation2 > 2 * Math.PI) {
310
+ // 超过一圈处理
261
311
  if (that.moveMode == 1) {
262
312
  ratio = -1;
263
313
  } else {
@@ -277,18 +327,22 @@ class ScanEffectViewModel {
277
327
  this.viewer.dataSources.remove(this.customDataSource, true);
278
328
  };
279
329
  }
330
+ /**
331
+ * 圆形缩放扫描线构造函数
332
+ * @param {Object} options 扫描线配置参数
333
+ */
280
334
  function CircleZoomScanLine(options) {
281
335
  options = options || {};
282
- this.position = options.position;
283
- this.radius = options.radius;
284
- this.moveMode = window.Cesium.defined(options.moveMode) ? options.moveMode : 1;
285
- this.fillStyle = window.Cesium.defined(options.fillStyle) ? options.fillStyle : 0;
286
- this.image = options.image;
287
- this.color = options.color;
288
- this.show = window.Cesium.defined(options.show) ? options.show : true;
289
- this.customDataSource = new window.Cesium.CustomDataSource("CircleRotateScan");
290
- this.viewer = options.viewer;
291
- var multiS = 1;
336
+ this.position = options.position; // 扫描中心点
337
+ this.radius = options.radius; // 扫描半径
338
+ this.moveMode = window.Cesium.defined(options.moveMode) ? options.moveMode : 1; // 移动模式
339
+ this.fillStyle = window.Cesium.defined(options.fillStyle) ? options.fillStyle : 0; // 填充样式
340
+ this.image = options.image; // 纹理图片
341
+ this.color = options.color; // 颜色
342
+ this.show = window.Cesium.defined(options.show) ? options.show : true; // 是否显示
343
+ this.customDataSource = new window.Cesium.CustomDataSource("CircleRotateScan"); // 自定义数据源
344
+ this.viewer = options.viewer; // Cesium 视图
345
+ var multiS = 1; // 缩放方向系数
292
346
  var that = this;
293
347
  var circleFirst3 = that.customDataSource.entities.add({
294
348
  position: window.Cesium.Cartesian3.fromDegrees(that.position[0], that.position[1], that.position[2]),
@@ -376,7 +430,11 @@ class ScanEffectViewModel {
376
430
  };
377
431
  }
378
432
  }
379
- // 参数切换
433
+ /**
434
+ * @description 参数切换,根据 key 更新对应扫描参数并同步到当前扫描实例
435
+ * @param {String} key 参数键名
436
+ * @param {*} val 参数值
437
+ */
380
438
  paramsChanged(key, val) {
381
439
  switch (key) {
382
440
  case "linearScanning":
@@ -455,6 +513,11 @@ class ScanEffectViewModel {
455
513
  break;
456
514
  }
457
515
  }
516
+ /**
517
+ * @description 根据填充样式获取对应的纹理图片地址
518
+ * @param {Number} val 填充样式值(0/1/2)
519
+ * @returns {String} 纹理图片地址
520
+ */
458
521
  getImageUrl(val) {
459
522
  var imageUrl = "";
460
523
  switch (val) {
@@ -484,6 +547,7 @@ class ScanEffectViewModel {
484
547
  }
485
548
  }
486
549
  if (flag) {
550
+ // 场景中存在模型:启动绘制点交互
487
551
  if (this._drawManager) {
488
552
  this._drawManager.startDraw("point", {
489
553
  clampToGround: true,
@@ -500,12 +564,14 @@ class ScanEffectViewModel {
500
564
  }, "ScanEffectDraw");
501
565
  }
502
566
  } else {
567
+ // 场景中无模型:提示用户先添加模型
503
568
  (0, _message.default)({
504
569
  message: this._language?.value?.webgl?.["addModelExtractionTips"],
505
570
  type: "warning"
506
571
  });
507
572
  }
508
573
  }
574
+ // 移除当前扫描并清除所有已添加的扫描线
509
575
  removeScan() {
510
576
  if (this._ringScan) this._ringScan.destroy();
511
577
  if (this._lineScan) this._viewer.effects.remove(this._lineScan);
@@ -679,7 +745,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
679
745
  cycleStyle: props?.settingParams?.cycleStyle ?? 5,
680
746
  lengthStyle: props?.settingParams?.lengthStyle ?? 100
681
747
  });
682
- let viewModel = null;
748
+ let viewModel = null; // 扫描效果视图模型实例
683
749
 
684
750
  // 组件容器Ref
685
751
  let boxRef = (0, _vue.ref)(null);
@@ -714,7 +780,10 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
714
780
  headerTemp.value = (0, _util.createHeaderTemp)(boxRef.value, (0, _vue.toRefs)(props), headerTempRef, 'webgl.scanningTitle');
715
781
  }
716
782
  };
717
- // 切换参数
783
+ /**
784
+ * @description 切换参数,根据 key 调用 viewModel 更新对应配置项
785
+ * @param {String} key 参数键名
786
+ */
718
787
  function paramsChanged(key) {
719
788
  switch (key) {
720
789
  case "linearScanning":
@@ -1326,11 +1395,11 @@ Object.defineProperty(exports, "__esModule", ({
1326
1395
  value: true
1327
1396
  }));
1328
1397
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
1329
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
1398
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
1330
1399
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
1331
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
1400
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
1332
1401
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
1333
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
1402
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
1334
1403
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
1335
1404
 
1336
1405
  /***/ })
@@ -191,7 +191,10 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
191
191
  function drawHander() {
192
192
  viewModel && viewModel.start();
193
193
  }
194
- // 参数改变
194
+ /**
195
+ * @description 参数改变,调用 viewModel 更新对应配置项
196
+ * @param {String} key 参数键名
197
+ */
195
198
  function paramsChanged(key) {
196
199
  viewModel && viewModel.paramsChanged(key, formItem[key]);
197
200
  }
@@ -592,14 +595,23 @@ var _jspdf = _interopRequireDefault(__webpack_require__(65515));
592
595
  // 国际化
593
596
 
594
597
  class SceneAdvancedToImageViewModel {
598
+ // 国际化语言对象
599
+ /**
600
+ * @description 构造函数,初始化场景高级出图视图模型
601
+ * @param {Object} scenceView 场景视图对象,包含 _viewer 与 _drawManager
602
+ * @param {Object} options 表单参数对象
603
+ */
595
604
  constructor(scenceView, options) {
596
605
  this._viewer = null;
606
+ // Cesium 视图对象
597
607
  this._options = null;
608
+ // 表单参数对象
598
609
  this._canvasToImage = null;
599
610
  //场景出图类
600
611
  this._drawManager = null;
601
612
  //绘制管理对象
602
613
  this._satellitePyramidPrimitive = null;
614
+ // 卫星视椎体图元
603
615
  this._language = {};
604
616
  const {
605
617
  locale
@@ -616,7 +628,10 @@ class SceneAdvancedToImageViewModel {
616
628
  canvas: this._viewer.scene.canvas
617
629
  });
618
630
  }
619
- //加载椎体
631
+ /**
632
+ * @description 加载卫星视椎体图元
633
+ * @param {Object} position 椎体顶点的笛卡尔坐标
634
+ */
620
635
  addSatellitePyramidPrimitive(position) {
621
636
  // 实例化
622
637
  let cartographic = Cesium.Cartographic.fromCartesian(position);
@@ -672,7 +687,11 @@ class SceneAdvancedToImageViewModel {
672
687
  }
673
688
  return {};
674
689
  }
675
- // 获取矩阵
690
+ /**
691
+ * @description 获取点集的外接矩形范围
692
+ * @param {Array} points 点集数组,每个元素为 [经度, 纬度]
693
+ * @returns {Object} 外接矩形 { xmin, ymin, xmax, ymax }
694
+ */
676
695
  getRect(points) {
677
696
  let xmin, ymin, xmax, ymax;
678
697
  for (let i in points) {
@@ -766,6 +785,7 @@ class SceneAdvancedToImageViewModel {
766
785
  newCtx.save();
767
786
  newCtx.drawImage(this._viewer.canvas, 0, 0);
768
787
  if (this._options.imgFormat === "pdf") {
788
+ // 输出 PDF:使用 jsPDF 生成并保存
769
789
  const pdf = new _jspdf.default({
770
790
  orientation: canvas.width >= canvas.height ? "landscape" : "portrait",
771
791
  unit: "px",
@@ -782,6 +802,7 @@ class SceneAdvancedToImageViewModel {
782
802
  pdf.save(datetimeCode + ".pdf");
783
803
  }, 100);
784
804
  } else {
805
+ // 其它格式:直接保存为图片
785
806
  this._canvasToImage.saveAsimages(canvas, options);
786
807
  }
787
808
  }
@@ -803,6 +824,11 @@ class SceneAdvancedToImageViewModel {
803
824
  that._drawManager.clearDrawGroup("SceneAdvancedToImageDraw");
804
825
  }, "SceneAdvancedToImageDraw");
805
826
  }
827
+ /**
828
+ * @description 参数改变,更新配置项并同步到当前视椎体图元
829
+ * @param {String} key 参数键名
830
+ * @param {*} val 参数值
831
+ */
806
832
  paramsChanged(key, val) {
807
833
  if (!this._options) return;
808
834
  this._options[key] = val;
@@ -959,11 +985,11 @@ Object.defineProperty(exports, "__esModule", ({
959
985
  value: true
960
986
  }));
961
987
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
962
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
988
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
963
989
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
964
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
990
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
965
991
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
966
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
992
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
967
993
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
968
994
 
969
995
  /***/ })