浏览代码

Merge branch 'master' of http://192.168.0.115:3000/bill/traffic-laser

bill 2 年之前
父节点
当前提交
0cb7415f82

+ 11 - 8
public/static/lib/potree/potree.js

@@ -139524,14 +139524,17 @@ ENDSEC
 	                boundSize.x = Math.max(min, boundSize.x);
 	                boundSize.y = Math.max(min, boundSize.y);
 	            }
-	            if(camera.type == 'OrthographicCamera'){
-	                //dis = boundSize.length()   
-	                o.dontChangeCamDir = true; //强制不改方向
-	                //必须在模型外部
-	                this.mainViewport.targetPlane.setFromNormalAndCoplanarPoint(this.mainViewport.view.direction, this.bound.center ); 
-	                this.mainViewport.targetPlane.projectPoint(target,  this.mainViewport.shiftTarget ); //得到target在中心面的投影
-	                let pos = this.splitScreen.getPosOutOfModel(this.mainViewport, this.bound.size);  //得到观察位置(shiftTarget投影到模型外部)
-	                dis = pos.distanceTo(target);   
+	            if(camera.type == 'OrthographicCamera'){ 
+	                if(o.dontChangeCamDir) {
+	                    //必须在模型外部(如点击测量线时)
+	                    this.mainViewport.targetPlane.setFromNormalAndCoplanarPoint(this.mainViewport.view.direction, this.bound.center ); 
+	                    this.mainViewport.targetPlane.projectPoint(target,  this.mainViewport.shiftTarget ); //得到target在中心面的投影
+	                    let pos = this.splitScreen.getPosOutOfModel(this.mainViewport, this.bound.size);  //得到观察位置(shiftTarget投影到模型外部)
+	                    dis = pos.distanceTo(target);  
+	                }else {
+	                    dis = boundSize.length(); 
+	                }                   
+	                
 	            }else {
 	                let aspect = boundSize.x / boundSize.y;
 	                if(camera.aspect > aspect){//视野更宽则用bound的纵向来决定

文件差异内容过多而无法显示
+ 1 - 1
public/static/lib/potree/potree.js.map


+ 3 - 1
src/graphic/Controls/AddLine.js

@@ -6,7 +6,9 @@ import Point from "../Geometry/Point.js";
 import { mathUtil } from "../Util/MathUtil";
 import Settings from "../Settings";
 import { pointService } from "../Service/PointService";
+import { uiService } from "../Service/UIService";
 import Constant from "../Constant";
+
 export default class AddLine {
   constructor() {
     this.newLine = null;
@@ -90,7 +92,7 @@ export default class AddLine {
         }
       }
       if (this.newLine.getCategory() == VectorCategory.Line.BaseLine) {
-        Settings.baseLineId = this.newLine.vectorId;
+        uiService.setBaseLineId(this.newLine.vectorId);
       }
     }
   }

+ 1 - 1
src/graphic/Controls/UIControl.js

@@ -644,7 +644,7 @@ export default class UIControl {
   menu_clear(isBack) {
     dataService.clear();
     Settings.selectLocationMode = null;
-    Settings.baseLineId = null;
+    uiService.setBaseLineId(null);
     uiService.setSelectBasePointId(null);
     elementService.hideAll();
     this.layer.exit();

+ 1 - 1
src/graphic/Layer.js

@@ -1399,7 +1399,7 @@ export default class Layer {
   }
 
   initLocation() {
-    Settings.baseLineId = null;
+    uiService.setBaseLineId(null);
     this.uiControl.graphicStateUI.canAngleLocationMode = false;
     this.uiControl.graphicStateUI.canAllLocationMode = false;
     this.uiControl.graphicStateUI.canVerticalMeasure = false;

+ 1 - 1
src/graphic/Load.js

@@ -161,7 +161,7 @@ export default class Load {
 
           line.setDisplay(dataLocal.lines[key].display);
           if (line.getCategory() == VectorCategory.Line.BaseLine) {
-            Settings.baseLineId = key;
+            uiService.setBaseLineId(key);
           }
         }
       }

+ 1 - 1
src/graphic/Service/LineService.js

@@ -58,7 +58,7 @@ export default class LineService {
           dataService.deletePoint(key);
         }
       }
-      Settings.baseLineId = null;
+      uiService.setBaseLineId(null);
     }
     dataService.deleteLine();
   }

+ 4 - 0
src/graphic/Service/PointService.js

@@ -4,6 +4,7 @@ import { dataService } from "./DataService.js";
 import VectorCategory from "../enum/VectorCategory.js";
 import { mathUtil } from "../Util/MathUtil.js";
 import { lineService } from "./LineService.js";
+import { uiService } from "./UIService.js";
 import Settings from "../Settings.js";
 export default class PointService {
   constructor() {}
@@ -92,6 +93,9 @@ export default class PointService {
     let parent = normalPoint.getParent();
     for (let key in parent) {
       dataService.deleteLine(key);
+      if (Settings.baseLineId == key) {
+        uiService.setBaseLineId(null);
+      }
     }
   }
 

+ 8 - 0
src/graphic/Service/UIService.js

@@ -268,6 +268,14 @@ export default class UIService {
     Settings.lineWidth = value;
   }
 
+  setBaseLineId(value) {
+    Settings.baseLineId = value;
+  }
+
+  getBaseLineId() {
+    return Settings.baseLineId;
+  }
+
   //如果position在屏幕左上角,返回的就朝向右下角,如果是右下角,则返回的是左上角。其他情况以此类推
   getNewPositionForPop(position) {
     const offset = 50;