浏览代码

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	server/test/SS-t-P1d6CwREny2/attach/sceneStore
bill 2 年之前
父节点
当前提交
fef28fc321

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

@@ -138754,7 +138754,11 @@ ENDSEC
 	                }
 	                }
 	                this.images360.panos.forEach(pano=>{
 	                this.images360.panos.forEach(pano=>{
 	                    Potree.Utils.updateVisible(pano, 'screenshot', true);
 	                    Potree.Utils.updateVisible(pano, 'screenshot', true);
-	                });    
+	                }); 
+	                viewer.scene.measurements.forEach((e)=>{
+	                    Potree.Utils.updateVisible(e, 'screenshot', true);  
+	                });
+	                
 	                Potree.Utils.updateVisible(this.reticule, 'screenshot', true);
 	                Potree.Utils.updateVisible(this.reticule, 'screenshot', true);
 	                 
 	                 
 	            
 	            
@@ -138829,7 +138833,12 @@ ENDSEC
 	            this.images360.panos.forEach(pano=>{//令漫游点不可见
 	            this.images360.panos.forEach(pano=>{//令漫游点不可见
 	                Potree.Utils.updateVisible(pano, 'screenshot', false);
 	                Potree.Utils.updateVisible(pano, 'screenshot', false);
 	            }); 
 	            }); 
-	        }                    
+	        } 
+	        if(info.hideMeasures){
+	            viewer.scene.measurements.forEach((e)=>{
+	                Potree.Utils.updateVisible(e, 'screenshot', false);  
+	            });
+	        }            
 	        Potree.Utils.updateVisible(this.reticule, 'screenshot', false);//令reticule不可见 
 	        Potree.Utils.updateVisible(this.reticule, 'screenshot', false);//令reticule不可见 
 	                                
 	                                
 	        
 	        

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


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

@@ -5,6 +5,7 @@ import VectorCategory from "../enum/VectorCategory";
 import Point from "../Geometry/Point.js";
 import Point from "../Geometry/Point.js";
 import { mathUtil } from "../Util/MathUtil";
 import { mathUtil } from "../Util/MathUtil";
 import Settings from "../Settings";
 import Settings from "../Settings";
+import { pointService } from "../Service/PointService";
 
 
 export default class AddLine {
 export default class AddLine {
   constructor() {
   constructor() {
@@ -63,7 +64,7 @@ export default class AddLine {
       this.newLine.getCategory() != VectorCategory.Line.ArrowLine &&
       this.newLine.getCategory() != VectorCategory.Line.ArrowLine &&
       this.newLine.getCategory() != VectorCategory.Line.GuideLine
       this.newLine.getCategory() != VectorCategory.Line.GuideLine
     ) {
     ) {
-      lineService.mergePoint(
+      pointService.mergePoint(
         this.newLine.endId,
         this.newLine.endId,
         listenLayer.modifyPoint.linkedPointId
         listenLayer.modifyPoint.linkedPointId
       );
       );

+ 24 - 0
src/graphic/Controls/MovePoint.js

@@ -1,5 +1,9 @@
 import { dataService } from "../Service/DataService";
 import { dataService } from "../Service/DataService";
+import { pointService } from "../Service/PointService";
 import Settings from "../Settings";
 import Settings from "../Settings";
+import VectorCategory from "../enum/VectorCategory";
+import { listenLayer } from "../ListenLayer";
+
 export default class MovePoint {
 export default class MovePoint {
   constructor() {}
   constructor() {}
 
 
@@ -9,6 +13,26 @@ export default class MovePoint {
     point.y = position.y;
     point.y = position.y;
   }
   }
 
 
+  finish(pointId) {
+    if (
+      pointId &&
+      listenLayer.modifyPoint &&
+      listenLayer.modifyPoint.linkedPointId
+    ) {
+      let linkedPoint = dataService.getPoint(
+        listenLayer.modifyPoint.linkedPointId
+      );
+      const category = linkedPoint.getCategory();
+      if (
+        category != VectorCategory.Point.BasePoint &&
+        category != VectorCategory.Point.TestBasePoint &&
+        category != VectorCategory.Point.TestPoint
+      ) {
+        pointService.mergePoint(pointId, listenLayer.modifyPoint.linkedPointId);
+      }
+    }
+  }
+
   //直角定位法
   //直角定位法
   //movePointForLocationByAngle(testPointId, basePointId) {
   //movePointForLocationByAngle(testPointId, basePointId) {
   movePointByAngleLocation(pointId) {
   movePointByAngleLocation(pointId) {

+ 2 - 1
src/graphic/Layer.js

@@ -819,6 +819,7 @@ export default class Layer {
         break;
         break;
       case LayerEvents.MovePoint:
       case LayerEvents.MovePoint:
         needAutoRedraw = true;
         needAutoRedraw = true;
+        movePoint.finish(draggingItem.vectorId);
         this.history.save();
         this.history.save();
         break;
         break;
       case LayerEvents.MoveCircle:
       case LayerEvents.MoveCircle:
@@ -856,7 +857,7 @@ export default class Layer {
     dataService.setGridForZoom(
     dataService.setGridForZoom(
       coordinate.width,
       coordinate.width,
       coordinate.height,
       coordinate.height,
-      (coordinate.res * coordinate.zoom) / coordinate.defaultZoom
+      coordinate.zoom / coordinate.defaultZoom
     );
     );
     this.renderer.autoRedraw();
     this.renderer.autoRedraw();
   }
   }

+ 3 - 0
src/graphic/Load.js

@@ -145,6 +145,9 @@ export default class Load {
           );
           );
         }
         }
       }
       }
+      if (data3d.meterPerPixel) {
+        coordinate.setRes(data3d.meterPerPixel);
+      }
     }
     }
     this.layer.history.init();
     this.layer.history.init();
     this.layer.renderer.autoRedraw();
     this.layer.renderer.autoRedraw();

+ 2 - 4
src/graphic/Service/DataService.js

@@ -70,11 +70,9 @@ export class DataService {
     this.grid.startX += dx;
     this.grid.startX += dx;
     this.grid.startY += dy;
     this.grid.startY += dy;
     this.grid.step1 =
     this.grid.step1 =
-      (this.grid.defalutstep1 * coordinate.res * coordinate.zoom) /
-      coordinate.defaultZoom;
+      (this.grid.defalutstep1 * coordinate.zoom) / coordinate.defaultZoom;
     this.grid.step2 =
     this.grid.step2 =
-      (this.grid.defalutstep2 * coordinate.res * coordinate.zoom) /
-      coordinate.defaultZoom;
+      (this.grid.defalutstep2 * coordinate.zoom) / coordinate.defaultZoom;
     while (this.grid.startX > 0) {
     while (this.grid.startX > 0) {
       this.grid.startX -= this.grid.step2;
       this.grid.startX -= this.grid.step2;
     }
     }

+ 10 - 18
src/graphic/Service/LineService.js

@@ -72,26 +72,18 @@ export default class LineService {
     return newLine;
     return newLine;
   }
   }
 
 
-  //将pointId1合并到pointId2
-  mergePoint(pointId1, pointId2) {
-    if (pointId1 == pointId2) {
-      return;
-    } else if (pointId1 != null && pointId2 != null) {
-      let point1 = dataService.getPoint(pointId1);
-      let parent1 = point1.getParent();
-      let point2 = dataService.getPoint(pointId2);
-      for (let key in parent1) {
-        let line = dataService.getLine(key);
-        let dir = line.getDir(pointId1);
-        if (dir == "start") {
-          line.startId = pointId2;
-        } else if (dir == "end") {
-          line.endId = pointId2;
-        }
-        point2.setPointParent(key, dir);
+  getLine(pointId1, pointId2) {
+    let lines = dataService.getLines();
+    for (let key in lines) {
+      const line = dataService.getLine(key);
+      if (
+        (line.startId == pointId1 && line.endId == pointId2) ||
+        (line.endId == pointId1 && line.startId == pointId2)
+      ) {
+        return key;
       }
       }
-      dataService.deletePoint(pointId1);
     }
     }
+    return null;
   }
   }
 }
 }
 
 

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

@@ -3,6 +3,7 @@ import Line from "../Geometry/Line.js";
 import { dataService } from "./DataService.js";
 import { dataService } from "./DataService.js";
 import VectorCategory from "../enum/VectorCategory.js";
 import VectorCategory from "../enum/VectorCategory.js";
 import { mathUtil } from "../Util/MathUtil.js";
 import { mathUtil } from "../Util/MathUtil.js";
+import { lineService } from "./LineService.js";
 export default class PointService {
 export default class PointService {
   constructor() {}
   constructor() {}
 
 
@@ -11,6 +12,35 @@ export default class PointService {
     dataService.addPoint(point);
     dataService.addPoint(point);
     return point;
     return point;
   }
   }
+
+  //将pointId1合并到pointId2
+  mergePoint(pointId1, pointId2) {
+    if (pointId1 == pointId2) {
+      return;
+    } else if (pointId1 != null && pointId2 != null) {
+      let point1 = dataService.getPoint(pointId1);
+      let parent1 = point1.getParent();
+      let point2 = dataService.getPoint(pointId2);
+      if (mathUtil.equalPoint(point1, point2)) {
+        let lineId = lineService.getLine(pointId1, pointId2);
+        if (lineId) {
+          dataService.deleteLine(lineId);
+          return;
+        }
+      }
+      for (let key in parent1) {
+        let line = dataService.getLine(key);
+        let dir = line.getDir(pointId1);
+        if (dir == "start") {
+          line.startId = pointId2;
+        } else if (dir == "end") {
+          line.endId = pointId2;
+        }
+        point2.setPointParent(key, dir);
+      }
+      dataService.deletePoint(pointId1);
+    }
+  }
 }
 }
 
 
 const pointService = new PointService();
 const pointService = new PointService();

+ 18 - 11
src/graphic/Service/UIService.js

@@ -81,17 +81,24 @@ export default class UIService {
   }
   }
 
 
   isBelongPoint(ui) {
   isBelongPoint(ui) {
-    // if (ui == UIEvents.Arrow) {
-    //   this.setLineCategory(VectorCategory.Line.ArrowLine);
-    //   return true;
-    // } else if (ui == UIEvents.MeasureLine) {
-    //   this.setLineCategory(VectorCategory.Line.MeasureLine);
-    //   return true;
-    // } else if (ui == UIEvents.Line) {
-    //   this.setLineCategory(VectorCategory.Line.NormalLine);
-    //   return true;
-    // }
-    // return false;
+    if (ui == UIEvents.NormalLocationMode) {
+      this.setPointCategory(VectorCategory.Point.TestPoint);
+      this.setLocationMode(Constant.normalLocationMode);
+      return true;
+    } else if (ui == UIEvents.AngleLocationMode) {
+      this.setPointCategory(VectorCategory.Point.TestPoint);
+      this.setLocationMode(Constant.angleLocationMode);
+      return true;
+    } else if (ui == UIEvents.AllLocationMode) {
+      this.setPointCategory(VectorCategory.Point.TestPoint);
+      this.setLocationMode(Constant.allLocationMode);
+      return true;
+    } else if (ui == UIEvents.BasePoint) {
+      this.setPointCategory(VectorCategory.Point.BasePoint);
+      this.setLocationMode(null);
+      return true;
+    }
+    return false;
   }
   }
 
 
   setWayType(value) {
   setWayType(value) {

+ 1 - 0
src/sdk/laser/core/enter.js

@@ -305,6 +305,7 @@ var enter = ({
                         type: "measure",
                         type: "measure",
                         measurement: measure,
                         measurement: measure,
                         hideMarkers: true,
                         hideMarkers: true,
+                        hideMeasures:true,
                         ifGetPose: true,
                         ifGetPose: true,
                     },
                     },
                         width,
                         width,