@kq_npm/client3d_webgl_vue 4.5.43 → 4.5.45

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.
@@ -398,6 +398,7 @@ class ShadowAnalysisViewModel {
398
398
 
399
399
  // 清除全部结果
400
400
  clear() {
401
+ this._globaOptions._drawManager?.clearDrawGroup("ShadowAnalysisDraw");
401
402
  this._globaOptions._drawManager && this._globaOptions._drawManager.stopDraw();
402
403
  if (this._shadowAnalysis) {
403
404
  this._globaOptions.viewer.scene.primitives.remove(this._shadowAnalysis);
@@ -553,11 +553,11 @@ class SightlineAnalysisViewModel {
553
553
  _billboards = []; // 点位图标billboards集合
554
554
  _language = null;
555
555
 
556
- constructor(scenceView, options, language) {
556
+ constructor(scenceView, options) {
557
557
  this._viewer = scenceView._viewer;
558
558
  this._viewer.scene.postProcessStages._fxaa.enabled = true;
559
559
  this._viewer.scene.globe.depthTestAgainstTerrain = true; //开启深度检测
560
- this._language = language;
560
+ this._language = scenceView._language;
561
561
  options.viewer = this._viewer;
562
562
  if (options.visibleColor) {
563
563
  options.visibleColor = Cesium.Color.fromCssColorString(options.visibleColor);
@@ -615,7 +615,7 @@ class SightlineAnalysisViewModel {
615
615
  </div>`;
616
616
  html = html.replace('{X}', longitude).replace('{Y}', latitude).replace('{Z}', height);
617
617
  if (this._language) {
618
- html = html.replace('X', this._language.value.longitude).replace('Y', this._language.value.latitude).replace('Z', this._language.value.elevation);
618
+ html = html.replace('X', this._language.longitude).replace('Y', this._language.latitude).replace('Z', this._language.elevation);
619
619
  }
620
620
 
621
621
  var divpoint = new Cesium.Kq3dHtmlTag(this._viewer, {
@@ -682,6 +682,7 @@ class SightlineAnalysisViewModel {
682
682
  addSeePoint() {
683
683
  let that = this;
684
684
  this._addType = 1;
685
+ if(!this._drawManager) return;
685
686
  this._drawManager.startDraw("point", { image: const_image_.OBSERVATION_POINT }, (feature, { shape }) => {
686
687
  if (!shape.groupName || shape.groupName !== "SightlineAnalysisDraw") return;
687
688
  if (shape && shape.type === "marker") {
@@ -706,6 +707,7 @@ class SightlineAnalysisViewModel {
706
707
  let that = this;
707
708
  if (!this._sightlineAnalysis._seePoint) return;
708
709
  this._addType = 2;
710
+ if(!this._drawManager) return;
709
711
  this._drawManager.startDraw("point", { image: const_image_.TARGET_POINT }, (feature, { shape }) => {
710
712
  if (!shape.groupName || shape.groupName !== "SightlineAnalysisDraw") return;
711
713
  if (shape && shape.type === "marker") {
@@ -721,7 +723,7 @@ class SightlineAnalysisViewModel {
721
723
  that.highlightObstacles(result.id);
722
724
  }
723
725
  }
724
- that._drawManager && that._drawManager.clearDrawGroup("SightlineAnalysisDraw");
726
+ that._drawManager.clearDrawGroup("SightlineAnalysisDraw");
725
727
  }, "SightlineAnalysisDraw", true);
726
728
  }
727
729
 
@@ -746,7 +748,8 @@ class SightlineAnalysisViewModel {
746
748
  }
747
749
  //清除全部
748
750
  clearAll() {
749
- this._drawManager.stopDraw();
751
+ this._drawManager?.clearDrawGroup("SightlineAnalysisDraw");
752
+ this._drawManager?.stopDraw();
750
753
  this.clearDisplay();
751
754
  this.clearHighlights();
752
755
  this.clearBillboards();
@@ -921,7 +924,7 @@ headerTempTitle.value = language.value.sightlineAnalysis;
921
924
  obstacleColor: formItem.obstacleColor,
922
925
  isLabel: formItem.isLabel
923
926
  };
924
- viewModel = new SightlineAnalysisViewModel(scenceView, options, language);
927
+ viewModel = new SightlineAnalysisViewModel(scenceView, options);
925
928
  }
926
929
  });
927
930
  });
@@ -267,7 +267,7 @@ class SlopeAnalysisViewModel {
267
267
  slopeAnalysis: viewModel.slopeAnalysis,
268
268
  };
269
269
  this._globaOptions.viewer.scene.globe.depthTestAgainstTerrain = true; //开启深度检测
270
- // this._globaOptions.viewer.scene.globe.enableLighting = true;
270
+ this._globaOptions.viewer.scene.globe.enableLighting = true;
271
271
  this._globaOptions._drawManager = scenceView._drawManager;
272
272
  // that._slopeAnalysis = new Cesium.Kq3dSlope({
273
273
  // viewer: that._globaOptions.viewer,
@@ -474,12 +474,14 @@ class SlopeAnalysisViewModel {
474
474
  }
475
475
  // 清除全部结果
476
476
  clear() {
477
+ this._globaOptions._drawManager?.clearDrawGroup("SlopeAnalysisDraw");
477
478
  this._globaOptions._drawManager && this._globaOptions._drawManager.stopDraw();
478
479
  this._slopeAnalysis && this._slopeAnalysis.destroy();
479
480
  this._slopeAnalysis = null;
480
481
  }
481
482
  // 销毁
482
483
  destroy() {
484
+ this._globaOptions.viewer.scene.globe.enableLighting = false;
483
485
  this._slopeAnalysis && this._slopeAnalysis.destroy();
484
486
  this._slopeAnalysis = null;
485
487
  }
@@ -248,6 +248,8 @@ class SlopeAspectAnalysisViewModel {
248
248
  ];
249
249
  _scenceView = null;
250
250
  _restrictedArea = null;
251
+ // 开启光阴
252
+ _showEnableLighting = false;
251
253
  constructor(scenceView, viewModel) {
252
254
  this._language = scenceView._language;
253
255
  this._globaOptions.viewer = scenceView._viewer;
@@ -269,11 +271,9 @@ class SlopeAspectAnalysisViewModel {
269
271
  slopeColorAlpha: viewModel.slopeColorAlpha,
270
272
  colorImage: this.getImagePath(viewModel.colorImage),
271
273
  };
274
+ this._showEnableLighting = this._globaOptions.viewer.scene.globe.enableLighting;
272
275
  this._globaOptions.viewer.scene.globe.depthTestAgainstTerrain = true; //开启深度检测
273
- // this._globaOptions.viewer.scene.globe.enableLighting = true;
274
- this._globaOptions.viewer.scene.logarithmicDepthBuffer = true;
275
- this._globaOptions.viewer.scene.pickTranslucentDepth = true;
276
- this._globaOptions.viewer.scene._environmentState.renderTranslucentDepthForPick = true;
276
+ this._globaOptions.viewer.scene.globe.enableLighting = true;
277
277
 
278
278
  this._globaOptions._drawManager = scenceView._drawManager;
279
279
  // 坡度对象
@@ -304,6 +304,9 @@ class SlopeAspectAnalysisViewModel {
304
304
  }
305
305
  return imagePath;
306
306
  }
307
+ setCursor(style) {
308
+ this._globaOptions.viewer.canvas.style.cursor = style;
309
+ }
307
310
  // 开始分析
308
311
  start() {
309
312
  var that = this;
@@ -311,7 +314,9 @@ class SlopeAspectAnalysisViewModel {
311
314
  if (this._globaOptions.viewModel.viewer.terrainProvider.availability) {
312
315
  if (this._globaOptions.viewModel.viewer.terrainProvider && !this._globaOptions.viewModel.viewer.terrainProvider._heightmapStructure) {
313
316
  if (this._globaOptions && this._globaOptions.analysisMethod == 2) {
314
- if(this._calculationSlopeAspect){
317
+ this._globaOptions.viewer.scene.globe.depthTestAgainstTerrain = true; //开启深度检测
318
+ this.setCursor("crosshair");
319
+ if(this._calculationSlopeAspect) {
315
320
  this._calculationSlopeAspect?.startCalculation();
316
321
  }else {
317
322
  this._calculationSlopeAspect = new Cesium.Kq3dCalculationSlopeAspect(this._globaOptions.calculationOption);
@@ -518,6 +523,7 @@ class SlopeAspectAnalysisViewModel {
518
523
  this._globaOptions.calculationOption["controlPointBorder"] = newValue;
519
524
  }
520
525
  stopCalculation(){
526
+ this.setCursor("default");
521
527
  this._calculationSlopeAspect?.stopCalculation?.();
522
528
  }
523
529
  removeCalculation() {
@@ -539,9 +545,10 @@ class SlopeAspectAnalysisViewModel {
539
545
  }
540
546
  // 销毁
541
547
  destroy() {
542
- this._slopeAnalysis && this._slopeAnalysis.destroy();
548
+ this._globaOptions.viewer.scene.globe.enableLighting = this._showEnableLighting;
549
+ this._slopeAnalysis?.destroy?.();
543
550
  this._slopeAnalysis = null;
544
- this._aspectAnalysis && this._aspectAnalysis.clear();
551
+ this._aspectAnalysis?.destroy?.() || this._aspectAnalysis?.clear?.();
545
552
  this._aspectAnalysis = null;
546
553
  this.destroyCalculation();
547
554
  }