瀏覽代碼

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

bill 2 年之前
父節點
當前提交
83ffa7ccb9

文件差異過大導致無法顯示
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 1 - 164
src/graphic/Controls/AddPoint.js

@@ -19,68 +19,8 @@ export default class AddPoint {
     this.testPointIds = []; //所有待测点
     this.testPointIds = []; //所有待测点
   }
   }
 
 
-  buildPoint(position) {
-    //只有一个基准点的时候,测量的时候自动选择基准点
-    if (
-      (Settings.selectLocationMode == Constant.angleLocationMode ||
-        Settings.selectLocationMode == Constant.allLocationMode) &&
-      Settings.basePointIds.length == 1
-    ) {
-      Settings.selectBasePointId = Settings.basePointIds[0];
-    }
-    let newPoint;
-    if (Settings.selectPointCategory == VectorCategory.Point.BasePoint) {
-      newPoint = pointService.create(position);
-      Settings.selectBasePointId = newPoint.vectorId;
-    } else {
-      if (
-        Settings.selectBasePointId != null &&
-        Settings.selectLocationMode == Constant.angleLocationMode
-      ) {
-        newPoint = pointService.create(position);
-        this.setLocationByAngle(newPoint.vectorId);
-        newPoint.setLocationMode(Constant.angleLocationMode);
-        stateService.setEventName(LayerEvents.AddPoint);
-      } else if (
-        Settings.selectBasePointId != null &&
-        Settings.selectLocationMode == Constant.allLocationMode
-      ) {
-        newPoint = pointService.create(position);
-        this.setLocationByAll(newPoint.vectorId);
-        newPoint.setLocationMode(Constant.allLocationMode);
-        stateService.setEventName(LayerEvents.AddPoint);
-      } else if (
-        Settings.baseLineId != null &&
-        Settings.selectLocationMode == Constant.normalLocationMode
-      ) {
-        newPoint = pointService.create(position);
-        this.setLocationByNormal(newPoint.vectorId);
-        newPoint.setLocationMode(Constant.normalLocationMode);
-
-        stateService.setEventName(LayerEvents.AddPoint);
-      } else if (
-        Settings.selectBasePointId == null &&
-        (Settings.selectLocationMode == Constant.angleLocationMode ||
-          Settings.selectLocationMode == Constant.allLocationMode)
-      ) {
-        return null;
-      }
-      if (
-        newPoint &&
-        (newPoint.getLocationMode() == Constant.allLocationMode ||
-          newPoint.getLocationMode() == Constant.angleLocationMode ||
-          newPoint.getLocationMode() == Constant.normalLocationMode) &&
-        newPoint.getCategory() == VectorCategory.Point.TestPoint
-      ) {
-        this.testPointIds.push(newPoint.vectorId);
-      }
-    }
-    listenLayer.clear();
-    return newPoint;
-  }
-
   //添加固定点/基准点
   //添加固定点/基准点
-  buildPoint2(position) {
+  buildPoint(position) {
     let newPoint = null;
     let newPoint = null;
     if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedPointId) {
     if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedPointId) {
       return null;
       return null;
@@ -112,109 +52,6 @@ export default class AddPoint {
     return null;
     return null;
   }
   }
 
 
-  //直角定位法
-  setLocationByAngle(testPointId) {
-    let basePoint = this.isFocusBasePoint();
-    if (!basePoint) {
-      return;
-    }
-    let testPoint = dataService.getPoint(testPointId);
-    if (testPoint.getCategory() != VectorCategory.Point.TestPoint) {
-      return;
-    }
-    testPoint.setLinkedBasePointId(basePoint.vectorId);
-    let lineGeometry = dataService.getLine(Settings.baseLineId);
-    let startPoint = dataService.getPoint(lineGeometry.startId);
-    let endPoint = dataService.getPoint(lineGeometry.endId);
-    let line = mathUtil.createLine1(startPoint, endPoint);
-    let vLine = mathUtil.getVerticalLine(line, testPoint);
-    let join = mathUtil.getJoinLinePoint(basePoint, vLine);
-    join = pointService.create(join);
-    join.setCategory(VectorCategory.Point.TestBasePoint);
-    join.setLocationMode(Constant.angleLocationMode);
-    join.setLinkedBasePointId(basePoint.vectorId);
-    let guidePositionLine = lineService.createByPointId(
-      testPointId,
-      join.vectorId,
-      VectorCategory.Line.GuidePositionLine
-    );
-
-    let positionLine = lineService.createByPointId(
-      basePoint.vectorId,
-      join.vectorId,
-      VectorCategory.Line.PositionLine
-    );
-    guidePositionLine.setLocationMode(Constant.angleLocationMode);
-    positionLine.setLocationMode(Constant.angleLocationMode);
-    join.setCategory(VectorCategory.Point.TestBasePoint);
-  }
-
-  //综合定位法
-  setLocationByAll(testPointId) {
-    let basePoint = this.isFocusBasePoint();
-    if (!basePoint) {
-      return;
-    }
-
-    let testPoint = dataService.getPoint(testPointId);
-    testPoint.setLinkedBasePointId(basePoint.vectorId);
-    let lineGeometry = dataService.getLine(Settings.baseLineId);
-    let startPoint = dataService.getPoint(lineGeometry.startId);
-    let endPoint = dataService.getPoint(lineGeometry.endId);
-    let line = mathUtil.createLine1(startPoint, endPoint);
-    let join = mathUtil.getJoinLinePoint(testPoint, line);
-    join = pointService.create(join); //经过待测点且与基准线垂直的线段,与基准线的交点
-    join.setCategory(VectorCategory.Point.TestBasePoint);
-    join.setLocationMode(Constant.allLocationMode);
-    join.setLinkedBasePointId(basePoint.vectorId);
-    //待测点与基准线的垂直线
-    lineService.createByPointId(
-      testPointId,
-      join.vectorId,
-      VectorCategory.Line.PositionLine
-    );
-    //暂时没有其他待测点
-    if (this.testPointIds.length == 0) {
-      //待测点与基准线点的连线
-      lineService.createByPointId(
-        basePoint.vectorId,
-        testPointId,
-        VectorCategory.Line.PositionLine
-      );
-    } else {
-      //取上一个待测点
-      lineService.createByPointId(
-        this.testPointIds[this.testPointIds.length - 1],
-        testPointId,
-        VectorCategory.Line.PositionLine
-      );
-    }
-  }
-
-  setLocationByNormal(testPointId) {
-    let testPoint = dataService.getPoint(testPointId);
-    if (testPoint.getCategory() != VectorCategory.Point.TestPoint) {
-      return;
-    }
-    if (!Settings.baseLineId) {
-      return;
-    }
-    let lineGeometry = dataService.getLine(Settings.baseLineId);
-    let startPoint = dataService.getPoint(lineGeometry.startId);
-    let endPoint = dataService.getPoint(lineGeometry.endId);
-    let line = mathUtil.createLine1(startPoint, endPoint);
-    let vLine = mathUtil.getVerticalLine(line, testPoint);
-    let join = mathUtil.getIntersectionPoint(vLine, line);
-    join = pointService.create(join);
-    join.setCategory(VectorCategory.Point.TestBasePoint);
-    join.setLocationMode(Constant.normalLocationMode);
-    lineService.createByPointId(
-      testPointId,
-      join.vectorId,
-      VectorCategory.Line.PositionLine
-    );
-  }
-
   deleteTestPoints() {
   deleteTestPoints() {
     for (let i = 0; i < this.testPointIds.length; ++i) {
     for (let i = 0; i < this.testPointIds.length; ++i) {
       pointService.deletePoint(this.testPointIds[i]);
       pointService.deletePoint(this.testPointIds[i]);

+ 8 - 77
src/graphic/Controls/MoveLine.js

@@ -7,87 +7,12 @@ import { pointService } from "../Service/PointService";
 import { movePoint } from "./MovePoint";
 import { movePoint } from "./MovePoint";
 import { mathUtil } from "../Util/MathUtil";
 import { mathUtil } from "../Util/MathUtil";
 import VectorCategory from "../enum/VectorCategory";
 import VectorCategory from "../enum/VectorCategory";
+import { locationModeControl } from "./LocationModeControl";
+import { uiService } from "../Service/UIService";
 
 
 export default class MoveLine {
 export default class MoveLine {
   constructor() {}
   constructor() {}
 
 
-  // moveLine(lineId, dx, dy) {
-  //   dx = dx;
-  //   dy = -dy;
-  //   let line = dataService.getLine(lineId);
-  //   let startPoint = dataService.getPoint(line.startId);
-  //   let endPoint = dataService.getPoint(line.endId);
-
-  //   //垂直移动
-  //   if (line.getCategory() == VectorCategory.Line.PositionLine && line.getLocationMode() == Constant.angleLocationMode) {
-  //     let point1 = {
-  //       x: startPoint.x + dx,
-  //       y: startPoint.y + dy,
-  //     };
-  //     let point2 = {
-  //       x: endPoint.x + dx,
-  //       y: endPoint.y + dy,
-  //     };
-  //     let lineGeometry = mathUtil.createLine1(point1, point2);
-  //     point1 = mathUtil.getJoinLinePoint(startPoint, lineGeometry);
-  //     //startPoint本来是基准点
-  //     if (startPoint.getCategory() == VectorCategory.Point.BasePoint) {
-  //       //达到一定距离才能移动
-  //       if (mathUtil.getDistance(startPoint, point1) < Constant.minAdsorbPix) {
-  //         return false;
-  //       }
-  //       let newStartPoint = pointService.create(point1);
-  //       let extendedPositionLine = lineService.createByPointId(startPoint.vectorId, newStartPoint.vectorId, VectorCategory.Line.ExtendedPositionLine);
-  //       extendedPositionLine.setLocationMode(Constant.angleLocationMode);
-  //       dataService.deletePointParent(startPoint.vectorId, lineId);
-  //       line.startId = newStartPoint.vectorId;
-  //       newStartPoint.setPointParent(line.vectorId, 'start');
-  //       newStartPoint.setCategory(VectorCategory.Point.TestBasePoint);
-  //     } else {
-  //       startPoint.x = point1.x;
-  //       startPoint.y = point1.y;
-  //       let parents = Object.keys(startPoint.parent);
-  //       let extendedLine = dataService.getLine(parents[0]);
-  //       if (extendedLine.getCategory() != VectorCategory.Line.ExtendedPositionLine) {
-  //         extendedLine = dataService.getLine(parents[1]);
-  //       }
-  //       if (extendedLine.getCategory() == VectorCategory.Line.ExtendedPositionLine) {
-  //         //point1是基准点
-  //         point1 = dataService.getPoint(extendedLine.startId);
-  //         point2 = dataService.getPoint(extendedLine.endId);
-  //         if (mathUtil.getDistance(point1, point2) < Constant.minAdsorbPix) {
-  //           dataService.deleteLine(extendedLine.vectorId);
-  //           dataService.deletePoint(extendedLine.endId);
-
-  //           line.startId = point1.vectorId;
-  //           point1.setPointParent(line.vectorId, 'start');
-
-  //           lineGeometry = mathUtil.createLine3(lineGeometry, point1);
-  //         }
-  //       }
-  //     }
-
-  //     point2 = mathUtil.getJoinLinePoint(endPoint, lineGeometry);
-  //     endPoint.x = point2.x;
-  //     endPoint.y = point2.y;
-  //   } else {
-  //     //综合定位和垂线定位,拖动基准线更新位置
-  //     if (line.getCategory() == VectorCategory.Line.BaseLine) {
-  //       let points = dataService.vectorData.points;
-  //       for (let key in points) {
-  //         if (points[key].category == VectorCategory.Point.TestPoint && (points[key].locationMode == Constant.allLocationMode || points[key].locationMode == Constant.normalLocationMode)) {
-  //           movePoint.updatePositionByTestPoint(points[key].vectorId);
-  //         }
-  //       }
-  //     }
-  //     startPoint.x += dx;
-  //     startPoint.y += dy;
-  //     endPoint.x += dx;
-  //     endPoint.y += dy;
-  //   }
-  //   return true;
-  // }
-
   moveLine(lineId, dx, dy) {
   moveLine(lineId, dx, dy) {
     dx = dx;
     dx = dx;
     dy = -dy;
     dy = -dy;
@@ -231,6 +156,7 @@ export default class MoveLine {
             dataService.deleteLine(extendedPositionLine.vectorId);
             dataService.deleteLine(extendedPositionLine.vectorId);
             dataService.deletePoint(otherPoint.vectorId);
             dataService.deletePoint(otherPoint.vectorId);
             line.startId = startPoint.vectorId;
             line.startId = startPoint.vectorId;
+            startPoint.setPointParent(line.vectorId, "start");
           }
           }
           join = mathUtil.getJoinLinePoint(startPoint, baseLine);
           join = mathUtil.getJoinLinePoint(startPoint, baseLine);
           mathUtil.clonePoint(endPoint, join);
           mathUtil.clonePoint(endPoint, join);
@@ -243,6 +169,11 @@ export default class MoveLine {
       startPoint.y += dy;
       startPoint.y += dy;
       endPoint.x += dx;
       endPoint.x += dx;
       endPoint.y += dy;
       endPoint.y += dy;
+      if (line.getCategory() == VectorCategory.Line.BaseLine) {
+        if (uiService.getSelectLocationMode() == Constant.angleLocationMode) {
+          locationModeControl.setAngle();
+        }
+      }
     }
     }
     return true;
     return true;
   }
   }

+ 11 - 65
src/graphic/Controls/MovePoint.js

@@ -6,37 +6,11 @@ import VectorCategory from "../enum/VectorCategory";
 import { listenLayer } from "../ListenLayer";
 import { listenLayer } from "../ListenLayer";
 import { uiService } from "../Service/UIService";
 import { uiService } from "../Service/UIService";
 import { mathUtil } from "../Util/MathUtil";
 import { mathUtil } from "../Util/MathUtil";
+import { moveText } from "./MoveText";
+import { locationModeControl } from "./LocationModeControl";
 
 
 export default class MovePoint {
 export default class MovePoint {
   constructor() {}
   constructor() {}
-
-  // movePoint(position, pointId) {
-  //   let point = dataService.getPoint(pointId);
-  //   point.x = position.x;
-  //   point.y = position.y;
-  //   if (point.getCategory() == VectorCategory.Point.TestPoint) {
-  //     this.updatePositionByTestPoint(pointId);
-  //   } else if (point.getCategory() == VectorCategory.Point.BasePoint) {
-  //     this.updateBasePoint(pointId);
-  //   } else {
-  //     let parent = point.getParent();
-  //     for (let key in parent) {
-  //       let line = dataService.getLine(key);
-  //       line.setValue(null);
-  //       //拖拽的点是基准线
-  //       if (line.category == VectorCategory.Line.BaseLine) {
-  //         let points = dataService.getPoints();
-  //         for (let key in points) {
-  //           let testPoint = dataService.getPoint(key);
-  //           if (testPoint.category == VectorCategory.Point.TestPoint) {
-  //             this.updatePositionByTestPoint(key);
-  //           }
-  //         }
-  //       }
-  //     }
-  //   }
-  // }
-
   movePoint(position, pointId) {
   movePoint(position, pointId) {
     let point = dataService.getPoint(pointId);
     let point = dataService.getPoint(pointId);
     if (point.getCategory() == VectorCategory.Point.BasePoint) {
     if (point.getCategory() == VectorCategory.Point.BasePoint) {
@@ -46,32 +20,17 @@ export default class MovePoint {
     } else {
     } else {
       point.x = position.x;
       point.x = position.x;
       point.y = position.y;
       point.y = position.y;
+      let parent = point.getParent();
+      let line = dataService.getLine(Object.keys(parent)[0]);
+      if (line.getCategory() == VectorCategory.Line.BaseLine) {
+        if (uiService.getSelectLocationMode() == Constant.angleLocationMode) {
+          locationModeControl.setAngle();
+        }
+      }
     }
     }
   }
   }
 
 
   finish(pointId) {
   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);
-    //     Settings.selectBasePointId = null;
-    //   } else if (category == VectorCategory.Point.BasePoint) {
-    //     Settings.selectBasePointId = pointId;
-    //   } else {
-    //     Settings.selectBasePointId = null;
-    //   }
-    // }
     if (
     if (
       pointId &&
       pointId &&
       listenLayer.modifyPoint &&
       listenLayer.modifyPoint &&
@@ -83,8 +42,7 @@ export default class MovePoint {
       const category = linkedPoint.getCategory();
       const category = linkedPoint.getCategory();
       if (
       if (
         category != VectorCategory.Point.BasePoint &&
         category != VectorCategory.Point.BasePoint &&
-        category != VectorCategory.Point.TestBasePoint &&
-        category != VectorCategory.Point.TestPoint
+        category != VectorCategory.Point.TestBasePoint
       ) {
       ) {
         pointService.mergePoint(pointId, listenLayer.modifyPoint.linkedPointId);
         pointService.mergePoint(pointId, listenLayer.modifyPoint.linkedPointId);
         Settings.selectBasePointId = null;
         Settings.selectBasePointId = null;
@@ -224,19 +182,6 @@ export default class MovePoint {
     mathUtil.clonePoint(testBasePoint, join);
     mathUtil.clonePoint(testBasePoint, join);
   }
   }
 
 
-  // updateBasePoint(basePointId) {
-  //   let points = dataService.getPoints();
-  //   for (let key in points) {
-  //     let point = dataService.getPoint(key);
-  //     if (
-  //       point.getCategory() == VectorCategory.Point.TestPoint &&
-  //       point.getLinkedBasePointId() == basePointId
-  //     ) {
-  //       this.updatePositionByTestPoint(key);
-  //     }
-  //   }
-  // }
-
   updateBasePoint(position, basePointId) {
   updateBasePoint(position, basePointId) {
     let lineGeometry = dataService.getLine(Settings.baseLineId);
     let lineGeometry = dataService.getLine(Settings.baseLineId);
     let startPoint = dataService.getPoint(lineGeometry.startId);
     let startPoint = dataService.getPoint(lineGeometry.startId);
@@ -285,6 +230,7 @@ export default class MovePoint {
         let otherPointId = line.getOtherPointId(fixPointId);
         let otherPointId = line.getOtherPointId(fixPointId);
         let otherPoint = dataService.getPoint(otherPointId);
         let otherPoint = dataService.getPoint(otherPointId);
         mathUtil.clonePoint(otherPoint, join);
         mathUtil.clonePoint(otherPoint, join);
+        moveText.moveFullText(position, fixPoint.linkedTextId);
       } else if (line.getCategory() == VectorCategory.Line.GuideLocationLine) {
       } else if (line.getCategory() == VectorCategory.Line.GuideLocationLine) {
         let otherPointId = line.getOtherPointId(fixPointId);
         let otherPointId = line.getOtherPointId(fixPointId);
         let otherPoint = dataService.getPoint(otherPointId);
         let otherPoint = dataService.getPoint(otherPointId);

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

@@ -6,7 +6,7 @@ export default class MoveText {
 
 
   moveFullText(position, textId) {
   moveFullText(position, textId) {
     let text = dataService.getText(textId);
     let text = dataService.getText(textId);
-    if (!text.linkedPointId) {
+    if (text) {
       mathUtil.clonePoint(text.center, position);
       mathUtil.clonePoint(text.center, position);
     }
     }
   }
   }

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

@@ -117,6 +117,7 @@ export default class UIControl {
         } else if (uiService.isBelongRoadStructure(selectUI)) {
         } else if (uiService.isBelongRoadStructure(selectUI)) {
           stateService.setEventName(LayerEvents.AddRoadStructure);
           stateService.setEventName(LayerEvents.AddRoadStructure);
         } else if (selectUI == Constant.angleLocationMode) {
         } else if (selectUI == Constant.angleLocationMode) {
+          uiService.setSelectLocationMode(Constant.angleLocationMode);
           locationModeControl.setAngle();
           locationModeControl.setAngle();
           this.layer.history.save();
           this.layer.history.save();
           this.layer.renderer.autoRedraw();
           this.layer.renderer.autoRedraw();

+ 11 - 7
src/graphic/Layer.js

@@ -154,7 +154,7 @@ export default class Layer {
       //   break;
       //   break;
       case LayerEvents.AddPoint:
       case LayerEvents.AddPoint:
         stateService.setEventName(LayerEvents.MovePoint);
         stateService.setEventName(LayerEvents.MovePoint);
-        const newPoint = addPoint.buildPoint2(position);
+        const newPoint = addPoint.buildPoint(position);
         if (newPoint) {
         if (newPoint) {
           stateService.setSelectItem(
           stateService.setSelectItem(
             newPoint.vectorId,
             newPoint.vectorId,
@@ -593,9 +593,14 @@ export default class Layer {
         if (addLine.newLine != null) {
         if (addLine.newLine != null) {
           exceptLineId = addLine.newLine.vectorId;
           exceptLineId = addLine.newLine.vectorId;
           exceptPointId = addLine.newLine.endId;
           exceptPointId = addLine.newLine.endId;
+          if (exceptPointId) {
+            let exceptPoint = dataService.getPoint(exceptPointId);
+            exceptLineId = exceptPoint.getParent();
+          }
         }
         }
         listenLayer.start(position, {
         listenLayer.start(position, {
-          exceptLineId: exceptLineId,
+          //exceptLineId: exceptLineId,
+          exceptLineIds: exceptLineId,
           exceptPointId: exceptPointId,
           exceptPointId: exceptPointId,
         });
         });
         if (listenLayer.modifyPoint) {
         if (listenLayer.modifyPoint) {
@@ -850,10 +855,6 @@ export default class Layer {
             };
             };
           }
           }
           movePoint.movePoint(position, draggingItem.vectorId);
           movePoint.movePoint(position, draggingItem.vectorId);
-          point = dataService.getPoint(draggingItem.vectorId);
-          if (point.getCategory() == VectorCategory.Point.FixPoint) {
-            moveText.moveFullText(position, point.linkedTextId);
-          }
           needAutoRedraw = true;
           needAutoRedraw = true;
           if (!point) {
           if (!point) {
             stateService.clearEventName();
             stateService.clearEventName();
@@ -920,7 +921,10 @@ export default class Layer {
       case LayerEvents.MoveText:
       case LayerEvents.MoveText:
         needAutoRedraw = true;
         needAutoRedraw = true;
         if (draggingItem != null) {
         if (draggingItem != null) {
-          moveText.moveFullText(position, draggingItem.vectorId);
+          let vectorText = dataService.getText(draggingItem.vectorId);
+          if (!vectorText.linkedPointId) {
+            moveText.moveFullText(position, draggingItem.vectorId);
+          }
         }
         }
         break;
         break;
       case LayerEvents.MoveSVG:
       case LayerEvents.MoveSVG:

+ 16 - 21
src/graphic/ListenLayer.js

@@ -24,7 +24,8 @@ export default class ListenLayer {
    *
    *
    * @param exceptVectorIds:{
    * @param exceptVectorIds:{
           exceptPointId,
           exceptPointId,
-          exceptLineId,
+          //exceptLineId,
+          exceptLineIds,
           exceptCurvePointId,
           exceptCurvePointId,
           exceptCurveLineId,
           exceptCurveLineId,
           exceptRoadPointId,
           exceptRoadPointId,
@@ -60,18 +61,18 @@ export default class ListenLayer {
       position,
       position,
       exceptVectorIds.exceptRoadPointId
       exceptVectorIds.exceptRoadPointId
     );
     );
-    // selectInfo.pointInfo = this.isSelectPoint(
-    //   position,
-    //   exceptVectorIds.exceptPointId,
-    //   exceptVectorIds.exceptLineIds
-    // );
     selectInfo.pointInfo = this.isSelectPoint(
     selectInfo.pointInfo = this.isSelectPoint(
       position,
       position,
-      exceptVectorIds.exceptPointId
+      exceptVectorIds.exceptPointId,
+      exceptVectorIds.exceptLineIds
     );
     );
+    // selectInfo.pointInfo = this.isSelectPoint(
+    //   position,
+    //   exceptVectorIds.exceptPointId
+    // );
     selectInfo.lineInfo = this.isSelectLine(
     selectInfo.lineInfo = this.isSelectLine(
       position,
       position,
-      exceptVectorIds.exceptLineId
+      exceptVectorIds.exceptLineIds
     );
     );
     selectInfo.curvePointInfo = this.isSelectCurvePoint(
     selectInfo.curvePointInfo = this.isSelectCurvePoint(
       position,
       position,
@@ -234,9 +235,6 @@ export default class ListenLayer {
     };
     };
 
 
     let exceptPointIds = [];
     let exceptPointIds = [];
-    if (exceptPointId) {
-      exceptPointIds.push(exceptPointId);
-    }
     if (exceptLineIds) {
     if (exceptLineIds) {
       for (let key in exceptLineIds) {
       for (let key in exceptLineIds) {
         let exceptLine = dataService.getLine(key);
         let exceptLine = dataService.getLine(key);
@@ -248,20 +246,20 @@ export default class ListenLayer {
     let seqInfo = {};
     let seqInfo = {};
     const points = dataService.getPoints();
     const points = dataService.getPoints();
     for (const pointId in points) {
     for (const pointId in points) {
-      // if (pointId == exceptPointId) {
-      //   continue;
-      // }
-      if (exceptPointIds.indexOf(pointId) > -1) {
+      if (pointId == exceptPointId) {
         continue;
         continue;
       }
       }
-      const point = dataService.getPoint(pointId);
 
 
+      const point = dataService.getPoint(pointId);
       if (point.getCategory() == VectorCategory.Point.TestBasePoint) {
       if (point.getCategory() == VectorCategory.Point.TestBasePoint) {
         continue;
         continue;
       }
       }
 
 
       const distance = this.getDistance(position, point);
       const distance = this.getDistance(position, point);
       if (distance < Constant.minAdsorbPix) {
       if (distance < Constant.minAdsorbPix) {
+        if (exceptPointIds.indexOf(pointId) > -1) {
+          continue;
+        }
         if (pointInfo.pointId == null) {
         if (pointInfo.pointId == null) {
           pointInfo = {
           pointInfo = {
             pointId: pointId,
             pointId: pointId,
@@ -326,7 +324,7 @@ export default class ListenLayer {
     return pointInfo;
     return pointInfo;
   }
   }
 
 
-  isSelectLine(position, exceptLineId) {
+  isSelectLine(position, exceptLineIds) {
     let lineInfo = {
     let lineInfo = {
       lineId: null,
       lineId: null,
       type: null,
       type: null,
@@ -334,10 +332,7 @@ export default class ListenLayer {
     };
     };
     const lines = dataService.getLines();
     const lines = dataService.getLines();
     for (const lineId in lines) {
     for (const lineId in lines) {
-      if (
-        exceptLineId &&
-        (exceptLineId == lineId || exceptLineId.hasOwnProperty(lineId))
-      ) {
+      if (exceptLineIds && exceptLineIds.hasOwnProperty(lineId)) {
         continue;
         continue;
       }
       }
 
 

+ 9 - 0
src/graphic/Load.js

@@ -22,6 +22,7 @@ import CurveRoad from "./Geometry/CurveRoad.js";
 import { edgeService } from "./Service/EdgeService.js";
 import { edgeService } from "./Service/EdgeService.js";
 import { curvePointService } from "./Service/CurvePointService.js";
 import { curvePointService } from "./Service/CurvePointService.js";
 import { curveEdgeService } from "./Service/CurveEdgeService.js";
 import { curveEdgeService } from "./Service/CurveEdgeService.js";
+import Constant from "./Constant.js";
 
 
 export default class Load {
 export default class Load {
   constructor(layer) {
   constructor(layer) {
@@ -386,6 +387,14 @@ export default class Load {
           }
           }
         } catch (e) {}
         } catch (e) {}
         if (data3d.meterPerPixel) {
         if (data3d.meterPerPixel) {
+          uiService.setSingleLaneWidth(
+            (Constant.defaultSingleLaneWidth * coordinate.res) /
+              data3d.meterPerPixel
+          );
+          uiService.setRoadMidDivideWidth(
+            (Constant.defaultMidDivideWidth * coordinate.res) /
+              data3d.meterPerPixel
+          );
           coordinate.setRes(data3d.meterPerPixel);
           coordinate.setRes(data3d.meterPerPixel);
         }
         }
         const width = bgImg.imageData.width;
         const width = bgImg.imageData.width;

+ 5 - 3
src/graphic/Service/CurveRoadService.js

@@ -125,9 +125,6 @@ export default class CurveRoadService extends RoadService {
     newEndPoint.setIndex(1); //addCPoint执行后会自动增加
     newEndPoint.setIndex(1); //addCPoint执行后会自动增加
 
 
     newCurveRoad.setWay(curveRoad.way);
     newCurveRoad.setWay(curveRoad.way);
-    newCurveRoad.singleRoadWidth = curveRoad.singleRoadWidth;
-    newCurveRoad.leftWidth = curveRoad.leftWidth;
-    newCurveRoad.rightWidth = curveRoad.rightWidth;
 
 
     let edgePoints;
     let edgePoints;
     if (newCurveRoad.way == Constant.oneWay) {
     if (newCurveRoad.way == Constant.oneWay) {
@@ -188,6 +185,8 @@ export default class CurveRoadService extends RoadService {
     }
     }
     leftEdge.start = uiService.getNewPositionForPop(leftCurveEdge.start);
     leftEdge.start = uiService.getNewPositionForPop(leftCurveEdge.start);
     leftEdge.end = uiService.getNewPositionForPop(leftCurveEdge.end);
     leftEdge.end = uiService.getNewPositionForPop(leftCurveEdge.end);
+    leftEdge.setStyle(leftCurveEdge.getStyle());
+    leftEdge.setWeight(leftCurveEdge.getWeight());
 
 
     const rightCurveEdge = dataService.getCurveRoadEdge(curveRoad.rightEdgeId);
     const rightCurveEdge = dataService.getCurveRoadEdge(curveRoad.rightEdgeId);
     for (let i = 0; i < rightEdge.points.length; ++i) {
     for (let i = 0; i < rightEdge.points.length; ++i) {
@@ -197,12 +196,15 @@ export default class CurveRoadService extends RoadService {
     }
     }
     rightEdge.start = uiService.getNewPositionForPop(rightCurveEdge.start);
     rightEdge.start = uiService.getNewPositionForPop(rightCurveEdge.start);
     rightEdge.end = uiService.getNewPositionForPop(rightCurveEdge.end);
     rightEdge.end = uiService.getNewPositionForPop(rightCurveEdge.end);
+    rightEdge.setStyle(rightCurveEdge.getStyle());
+    rightEdge.setWeight(rightCurveEdge.getWeight());
 
 
     curveEdgeService.setCurves(leftEdge);
     curveEdgeService.setCurves(leftEdge);
     curveEdgeService.setCurves(rightEdge);
     curveEdgeService.setCurves(rightEdge);
     newCurveRoad.singleRoadDrivewayCount = curveRoad.singleRoadDrivewayCount;
     newCurveRoad.singleRoadDrivewayCount = curveRoad.singleRoadDrivewayCount;
     newCurveRoad.leftDrivewayCount = curveRoad.leftDrivewayCount;
     newCurveRoad.leftDrivewayCount = curveRoad.leftDrivewayCount;
     newCurveRoad.rightDrivewayCount = curveRoad.rightDrivewayCount;
     newCurveRoad.rightDrivewayCount = curveRoad.rightDrivewayCount;
+    newCurveRoad.singleRoadWidth = curveRoad.singleRoadWidth;
     newCurveRoad.leftWidth = curveRoad.leftWidth;
     newCurveRoad.leftWidth = curveRoad.leftWidth;
     newCurveRoad.rightWidth = curveRoad.rightWidth;
     newCurveRoad.rightWidth = curveRoad.rightWidth;
     this.setLanes(newCurveRoad.vectorId);
     this.setLanes(newCurveRoad.vectorId);

+ 10 - 8
src/graphic/Service/DataService.js

@@ -138,14 +138,16 @@ export class DataService {
       return;
       return;
     }
     }
     let start = this.getPoint(line.startId);
     let start = this.getPoint(line.startId);
-    let startParent = start.getParent();
-    delete startParent[lineId];
-    if (
-      Object.keys(startParent).length == 0 &&
-      start.getCategory() != VectorCategory.Point.BasePoint &&
-      start.getCategory() != VectorCategory.Point.FixPoint
-    ) {
-      this.deletePoint(line.startId);
+    if (start) {
+      let startParent = start.getParent();
+      delete startParent[lineId];
+      if (
+        Object.keys(startParent).length == 0 &&
+        start.getCategory() != VectorCategory.Point.BasePoint &&
+        start.getCategory() != VectorCategory.Point.FixPoint
+      ) {
+        this.deletePoint(line.startId);
+      }
     }
     }
 
 
     let end = this.getPoint(line.endId);
     let end = this.getPoint(line.endId);

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

@@ -53,8 +53,7 @@ export default class LineService {
         let category = point.getCategory();
         let category = point.getCategory();
         if (
         if (
           category == VectorCategory.Point.BasePoint ||
           category == VectorCategory.Point.BasePoint ||
-          category == VectorCategory.Point.TestBasePoint ||
-          category == VectorCategory.Point.TestPoint
+          category == VectorCategory.Point.TestBasePoint
         ) {
         ) {
           dataService.deletePoint(key);
           dataService.deletePoint(key);
         }
         }

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

@@ -52,10 +52,7 @@ export default class PointService {
         dataService.deletePoint(pointId); //暂时简单粗暴
         dataService.deletePoint(pointId); //暂时简单粗暴
       } else if (category == VectorCategory.Point.BasePoint) {
       } else if (category == VectorCategory.Point.BasePoint) {
         this.deleteBasePoint(pointId);
         this.deleteBasePoint(pointId);
-      } else if (
-        category == VectorCategory.Point.TestPoint ||
-        category == VectorCategory.Point.TestBasePoint
-      ) {
+      } else if (category == VectorCategory.Point.TestBasePoint) {
         this.deleteTestPoint(pointId);
         this.deleteTestPoint(pointId);
       } else if (category == VectorCategory.Point.FixPoint) {
       } else if (category == VectorCategory.Point.FixPoint) {
         this.deleteFixPoint(pointId);
         this.deleteFixPoint(pointId);

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

@@ -134,10 +134,14 @@ export default class RoadService {
     let oldLeftEdge = dataService.getRoadEdge(road.leftEdgeId);
     let oldLeftEdge = dataService.getRoadEdge(road.leftEdgeId);
     leftEdge.start = uiService.getNewPositionForPop(oldLeftEdge.start);
     leftEdge.start = uiService.getNewPositionForPop(oldLeftEdge.start);
     leftEdge.end = uiService.getNewPositionForPop(oldLeftEdge.end);
     leftEdge.end = uiService.getNewPositionForPop(oldLeftEdge.end);
+    leftEdge.setStyle(oldLeftEdge.getStyle());
+    leftEdge.setWeight(oldLeftEdge.getWeight());
 
 
     let oldRightEdge = dataService.getRoadEdge(road.rightEdgeId);
     let oldRightEdge = dataService.getRoadEdge(road.rightEdgeId);
     rightEdge.start = uiService.getNewPositionForPop(oldRightEdge.start);
     rightEdge.start = uiService.getNewPositionForPop(oldRightEdge.start);
     rightEdge.end = uiService.getNewPositionForPop(oldRightEdge.end);
     rightEdge.end = uiService.getNewPositionForPop(oldRightEdge.end);
+    rightEdge.setStyle(oldRightEdge.getStyle());
+    rightEdge.setWeight(oldRightEdge.getWeight());
 
 
     newRoad.singleRoadDrivewayCount = road.singleRoadDrivewayCount;
     newRoad.singleRoadDrivewayCount = road.singleRoadDrivewayCount;
     newRoad.leftDrivewayCount = road.leftDrivewayCount;
     newRoad.leftDrivewayCount = road.leftDrivewayCount;

+ 4 - 23
src/graphic/Service/UIService.js

@@ -79,11 +79,9 @@ export default class UIService {
       return true;
       return true;
     } else if (ui == UIEvents.Line) {
     } else if (ui == UIEvents.Line) {
       this.setSelectLineCategory(VectorCategory.Line.NormalLine);
       this.setSelectLineCategory(VectorCategory.Line.NormalLine);
-      this.setSelectLocationMode(Constant.null);
       return true;
       return true;
     } else if (ui == UIEvents.FreeMeasureLine) {
     } else if (ui == UIEvents.FreeMeasureLine) {
       this.setSelectLineCategory(VectorCategory.Line.FreeMeasureLine);
       this.setSelectLineCategory(VectorCategory.Line.FreeMeasureLine);
-      this.setSelectLocationMode(Constant.freeLocationMode);
       return true;
       return true;
     } else if (ui == UIEvents.BaseLine) {
     } else if (ui == UIEvents.BaseLine) {
       this.setSelectLineCategory(VectorCategory.Line.BaseLine);
       this.setSelectLineCategory(VectorCategory.Line.BaseLine);
@@ -93,29 +91,8 @@ export default class UIService {
   }
   }
 
 
   isBelongPoint(ui) {
   isBelongPoint(ui) {
-    // if (ui == UIEvents.NormalLocationMode) {
-    //   this.setSelectPointCategory(VectorCategory.Point.TestPoint);
-    //   this.setSelectLocationMode(Constant.normalLocationMode);
-    //   return true;
-    // } else if (ui == UIEvents.AngleLocationMode) {
-    //   this.setSelectPointCategory(VectorCategory.Point.TestPoint);
-    //   this.setSelectLocationMode(Constant.angleLocationMode);
-    //   return true;
-    // } else if (ui == UIEvents.AllLocationMode) {
-    //   this.setSelectPointCategory(VectorCategory.Point.TestPoint);
-    //   this.setSelectLocationMode(Constant.allLocationMode);
-    //   return true;
-    // } else if (ui == UIEvents.BasePoint) {
-    //   this.setSelectPointCategory(VectorCategory.Point.BasePoint);
-    //   this.setSelectLocationMode(null);
-    //   return true;
-    // } else if (ui == UIEvents.FixPoint) {
-    //   this.setSelectPointCategory(VectorCategory.Point.FixPoint);
-    //   return true;
-    // }
     if (ui == UIEvents.BasePoint) {
     if (ui == UIEvents.BasePoint) {
       this.setSelectPointCategory(VectorCategory.Point.BasePoint);
       this.setSelectPointCategory(VectorCategory.Point.BasePoint);
-      this.setSelectLocationMode(null);
       return true;
       return true;
     } else if (ui == UIEvents.FixPoint) {
     } else if (ui == UIEvents.FixPoint) {
       this.setSelectPointCategory(VectorCategory.Point.FixPoint);
       this.setSelectPointCategory(VectorCategory.Point.FixPoint);
@@ -235,6 +212,10 @@ export default class UIService {
     Settings.selectLocationMode = value;
     Settings.selectLocationMode = value;
   }
   }
 
 
+  getSelectLocationMode() {
+    return Settings.selectLocationMode;
+  }
+
   setSelectSVGType(value) {
   setSelectSVGType(value) {
     Settings.selectSVGType = value;
     Settings.selectSVGType = value;
   }
   }

+ 0 - 1
src/graphic/enum/VectorCategory.js

@@ -22,7 +22,6 @@ const VectorCategory = {
   },
   },
   Point: {
   Point: {
     BasePoint: "BasePoint", //基准点
     BasePoint: "BasePoint", //基准点
-    TestPoint: "TestPoint", //待测点
     NormalPoint: "NormalPoint", //正常点
     NormalPoint: "NormalPoint", //正常点
     TestBasePoint: "TestBasePoint", //待测基准点,待测点与基准线相交的点
     TestBasePoint: "TestBasePoint", //待测基准点,待测点与基准线相交的点
     FixPoint: "FixPoint", //固定点
     FixPoint: "FixPoint", //固定点