소스 검색

Merge remote-tracking branch 'origin/master'

bill 2 년 전
부모
커밋
aef041fd13

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

@@ -73615,11 +73615,8 @@ void main()
 	                type: 'isVisible',
 	                visible: shouldVisi,
 	                reason,
-	            }); 
-	             
-	        }
-	        
-	        
+	            });  
+	        } 
 	    };    
 	    
 	    
@@ -73654,10 +73651,12 @@ void main()
 	    update(); 
 	    
 	}; 
-	 
-	 
-	 
-	 
+	/* 
+	    复杂案例: 如果物体默认隐藏, 当符合任何一个其他条件时可见,则可:
+	    Potree.Utils.updateVisible(this, "default", false, 0 ) //默认隐藏    
+	    Potree.Utils.updateVisible(this, 条件名,  ifShow, 1, ifShow?'add':'cancel' ) //其他的条件
+	*/ 
+
 	Utils.getObjVisiByReason = function(object,reason){//获取在某条件下是否可见.  注: 用户在数据集选择可不可见为"datasetSelection"
 	    if(object.visible)return true
 	    else {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
public/static/lib/potree/potree.js.map


+ 458 - 11
src/graphic/Controls/AddCrossRoad.js

@@ -4,11 +4,167 @@ import { listenLayer } from "../ListenLayer";
 import { roadPointService } from "../Service/RoadPointService";
 import { roadService } from "../Service/RoadService";
 import { edgeService } from "../Service/EdgeService";
+import { dataService } from "../Service/DataService";
+import { uiService } from "../Service/UIService";
+import UIEvents from "../enum/UIEvents.js";
+import Constant from "../Constant.js";
+import Settings from "../Settings.js";
+import RoadTemplate from "../enum/RoadTemplate";
+import { curveRoadPointService } from "../Service/CurveRoadPointService";
+import { curveRoadService } from "../Service/CurveRoadService";
+import { curveEdgeService } from "../Service/CurveEdgeService";
+import CurveRoad from "../Geometry/CurveRoad.js";
 
 export default class AddCrossRoad {
   constructor() {}
 
-  build(position, count) {}
+  build(position) {
+    const roadTemplate = uiService.getSelectRoadTemplate();
+    // 丁字路口
+    if (roadTemplate == RoadTemplate.TJunction) {
+      this.buildThree(position);
+    }
+    // 十字路口
+    else if (roadTemplate == RoadTemplate.Crossroads) {
+      this.buildFour(position);
+    }
+    // 五岔路口
+    else if (roadTemplate == RoadTemplate.FiveForks) {
+      this.buildFive(position);
+    }
+    // 六岔路口
+    else if (roadTemplate == RoadTemplate.SixForkIntersection) {
+      this.buildSix(position);
+    }
+    // s型弯路
+    else if (roadTemplate == RoadTemplate.SBend) {
+      this.buildCurveRoad(position);
+    }
+    // 出口匝道
+    else if (roadTemplate == RoadTemplate.ExitRamp) {
+      this.buildExitRamp(position);
+    }
+    // 国道(路肩)
+    else if (roadTemplate == RoadTemplate.NationalHighwayShoulder) {
+      this.buildNationalHighwayShoulder(position);
+    }
+    // 室内路段
+    else if (roadTemplate == RoadTemplate.IndoorSection) {
+      this.buildIndoorSection(position);
+    }
+    // 弯道
+    else if (roadTemplate == RoadTemplate.Bend) {
+      this.buildBend(position);
+    }
+    // 急转弯道
+    else if (roadTemplate == RoadTemplate.SharpCurve) {
+      this.buildSharpCurve(position);
+    }
+    // 直角弯道
+    else if (roadTemplate == RoadTemplate.Corner) {
+      this.buildCorner(position);
+    }
+    // 进口砸到
+    else if (roadTemplate == RoadTemplate.ImportSmashedRoad) {
+      this.buildImportSmashedRoad(position);
+    }
+    // 高速收费站
+    else if (roadTemplate == RoadTemplate.HighSpeedTollBooth) {
+      this.buildHighSpeedTollBooth(position);
+    }
+    // 高速港湾
+    else if (roadTemplate == RoadTemplate.HighSpeedHarbor) {
+      this.buildHighSpeedHarbor(position);
+    }
+    // 高速路段
+    else if (roadTemplate == RoadTemplate.HighwaySection) {
+      this.buildHighwaySection(position);
+    }
+    // 宽变窄路段
+    else if (roadTemplate == RoadTemplate.WideNarrowRoad) {
+      this.buildWideNarrowRoad(position);
+    }
+  }
+
+  //s型弯路
+  buildCurveRoad(position) {
+    const roadLen = 500;
+    const offsetDis = 100;
+    let startPoint = {
+      x: position.x,
+      y: position.y + roadLen / 2,
+    };
+    let endPoint = {
+      x: position.x,
+      y: position.y - roadLen / 2,
+    };
+    startPoint = curveRoadPointService.create(startPoint);
+    endPoint = curveRoadPointService.create(endPoint);
+
+    let curveRoad = new CurveRoad(startPoint.vectorId, endPoint.vectorId);
+    dataService.addCurveRoad(curveRoad);
+
+    startPoint.setPointParent(curveRoad.vectorId);
+    startPoint.setIndex(0);
+
+    endPoint.setPointParent(curveRoad.vectorId);
+    endPoint.setIndex(2);
+
+    let edgePoints = mathUtil.RectangleVertex(
+      startPoint,
+      endPoint,
+      curveRoad.leftWidth +
+        curveRoad.rightWidth +
+        curveRoad.midDivide.midDivideWidth
+    );
+
+    let leftEdge = curveEdgeService.create(
+      edgePoints.leftEdgeStart,
+      edgePoints.leftEdgeEnd,
+      null,
+      curveRoad.vectorId
+    );
+
+    let rightEdge = curveEdgeService.create(
+      edgePoints.rightEdgeStart,
+      edgePoints.rightEdgeEnd,
+      null,
+      curveRoad.vectorId
+    );
+
+    curveRoad.setLeftEdge(leftEdge.vectorId);
+    curveRoad.setRightEdge(rightEdge.vectorId);
+
+    curveRoad.points.push(startPoint);
+    curveRoad.points.push(endPoint);
+
+    leftEdge.points.push(edgePoints.leftEdgeStart);
+    leftEdge.points.push(edgePoints.leftEdgeEnd);
+
+    rightEdge.points.push(edgePoints.rightEdgeStart);
+    rightEdge.points.push(edgePoints.rightEdgeEnd);
+
+    //得有点曲率
+    const midPoint = {
+      x: (startPoint.x + endPoint.x) / 2,
+      y: (startPoint.y + endPoint.y) / 2,
+    };
+    let mid1 = {
+      x: (startPoint.x + midPoint.x) / 2,
+      y: (startPoint.y + midPoint.y) / 2,
+    };
+    let mid2 = {
+      x: (endPoint.x + midPoint.x) / 2,
+      y: (endPoint.y + midPoint.y) / 2,
+    };
+
+    curveRoadService.addCPoint(curveRoad, mid1, 0);
+    curveRoadService.addCPoint(curveRoad, mid2, 1);
+    mid1.x -= offsetDis;
+    mid2.x += offsetDis;
+    curveRoadService.updateForMovePoint(curveRoad.points[1].vectorId, mid1);
+    curveRoadService.updateForMovePoint(curveRoad.points[2].vectorId, mid2);
+  }
 
   //三岔口
   buildThree(position) {
@@ -25,15 +181,12 @@ export default class AddCrossRoad {
     });
 
     let start3 = roadPointService.create({
-      x: end.x - len,
-      y: end.y,
+      x: end.x,
+      y: end.y - len,
     });
 
     //需要设置公路的车道数,是否双向等等
-    // this.leftDrivewayCount = Settings.roadLeftDrivewayCount;
-    // this.rightDrivewayCount = Settings.roadRightDrivewayCount;
-    // this.singleRoadDrivewayCount = Settings.singleRoadDrivewayCount;
-    // this.way = Settings.wayType;
+    uiService.isBelongRoad(UIEvents.TwoEdgeOneLanRoad);
 
     roadService.create(start1.vectorId, end.vectorId);
     roadService.create(start2.vectorId, end.vectorId);
@@ -66,10 +219,7 @@ export default class AddCrossRoad {
     });
 
     //需要设置公路的车道数,是否双向等等
-    // this.leftDrivewayCount = Settings.roadLeftDrivewayCount;
-    // this.rightDrivewayCount = Settings.roadRightDrivewayCount;
-    // this.singleRoadDrivewayCount = Settings.singleRoadDrivewayCount;
-    // this.way = Settings.wayType;
+    uiService.isBelongRoad(UIEvents.TwoEdgeOneLanRoad);
 
     roadService.create(start1.vectorId, end.vectorId);
     roadService.create(start2.vectorId, end.vectorId);
@@ -95,6 +245,303 @@ export default class AddCrossRoad {
     roadService.create(start5.vectorId, end.vectorId);
     edgeService.updateEdgeForMulRoad(end.vectorId);
   }
+
+  //六岔口
+  buildSix(position) {
+    const len = 300;
+    const points = mathUtil.createSixPoint(position, len);
+    let end = roadPointService.create(position);
+    let start1 = roadPointService.create(points[0]);
+    let start2 = roadPointService.create(points[1]);
+    let start3 = roadPointService.create(points[2]);
+    let start4 = roadPointService.create(points[3]);
+    let start5 = roadPointService.create(points[4]);
+    let start6 = roadPointService.create(points[5]);
+    roadService.create(start1.vectorId, end.vectorId);
+    roadService.create(start2.vectorId, end.vectorId);
+    roadService.create(start3.vectorId, end.vectorId);
+    roadService.create(start4.vectorId, end.vectorId);
+    roadService.create(start5.vectorId, end.vectorId);
+    roadService.create(start6.vectorId, end.vectorId);
+    edgeService.updateEdgeForMulRoad(end.vectorId);
+  }
+
+  buildExitRamp(position) {
+    const roadLen = 600;
+    let startPoint = {
+      x: position.x,
+      y: position.y + (roadLen * 3) / 5,
+    };
+    let endPoint = {
+      x: position.x,
+      y: position.y - (roadLen * 2) / 5,
+    };
+    startPoint = roadPointService.create(startPoint);
+    endPoint = roadPointService.create(endPoint);
+    let crossPoint = roadPointService.create(position);
+
+    uiService.isBelongRoad(UIEvents.OneEdgeThreeLanRoad);
+    roadService.create(startPoint.vectorId, crossPoint.vectorId);
+    roadService.create(crossPoint.vectorId, endPoint.vectorId);
+    let startPoint2 = {
+      x: startPoint.x + roadLen / 4,
+      y: startPoint.y,
+    };
+    startPoint2 = roadPointService.create(startPoint2);
+    uiService.isBelongRoad(UIEvents.OneEdgeOneLanRoad);
+    roadService.create(startPoint2.vectorId, crossPoint.vectorId);
+    edgeService.updateEdgeForMulRoad(crossPoint.vectorId);
+  }
+
+  buildNationalHighwayShoulder(position) {
+    const roadLen = 600;
+    let startPoint = {
+      x: position.x,
+      y: position.y + roadLen / 2,
+    };
+    let endPoint = {
+      x: position.x,
+      y: position.y - roadLen / 2,
+    };
+    startPoint = roadPointService.create(startPoint);
+    endPoint = roadPointService.create(endPoint);
+    uiService.isBelongRoad(UIEvents.TwoEdgeTwoLanRoad);
+    roadService.create(startPoint.vectorId, endPoint.vectorId);
+  }
+
+  buildIndoorSection(position) {
+    const roadLen = 600;
+    let startPoint = {
+      x: position.x,
+      y: position.y + roadLen / 2,
+    };
+    let endPoint = {
+      x: position.x,
+      y: position.y - roadLen / 2,
+    };
+    startPoint = roadPointService.create(startPoint);
+    endPoint = roadPointService.create(endPoint);
+    uiService.isBelongRoad(UIEvents.TwoEdgeThreeLanRoad);
+    roadService.create(startPoint.vectorId, endPoint.vectorId);
+  }
+
+  buildBend(position) {
+    const roadLen = 500;
+    const offsetDis = 150;
+    let startPoint = {
+      x: position.x,
+      y: position.y + roadLen / 2,
+    };
+    let endPoint = {
+      x: position.x,
+      y: position.y - roadLen / 2,
+    };
+    startPoint = curveRoadPointService.create(startPoint);
+    endPoint = curveRoadPointService.create(endPoint);
+    uiService.setCurveRoadLeftDrivewayCount(2);
+    uiService.setCurveRoadRightDrivewayCount(2);
+    uiService.setLeftCurveRoadWidth(100);
+    uiService.setRightCurveRoadWidth(100);
+    const curveRoad = curveRoadService.create(
+      startPoint.vectorId,
+      endPoint.vectorId
+    );
+    const midPoint = {
+      x: (startPoint.x + endPoint.x) / 2 - offsetDis,
+      y: (startPoint.y + endPoint.y) / 2,
+    };
+    curveRoadService.updateForMovePoint(curveRoad.points[1].vectorId, midPoint);
+    uiService.setCurveRoadLeftDrivewayCount(1);
+    uiService.setCurveRoadRightDrivewayCount(1);
+    uiService.setLeftCurveRoadWidth(50);
+    uiService.setRightCurveRoadWidth(50);
+  }
+
+  buildSharpCurve(position) {
+    const roadLen = 650;
+    const height = 450;
+    let startPoint = {
+      x: position.x + roadLen,
+      y: position.y + height / 2,
+    };
+    let endPoint = {
+      x: position.x + roadLen,
+      y: position.y - height / 2,
+    };
+    startPoint = curveRoadPointService.create(startPoint);
+    endPoint = curveRoadPointService.create(endPoint);
+
+    uiService.setCurveRoadLeftDrivewayCount(2);
+    uiService.setCurveRoadRightDrivewayCount(2);
+    uiService.setLeftCurveRoadWidth(100);
+    uiService.setRightCurveRoadWidth(100);
+
+    let curveRoad = new CurveRoad(startPoint.vectorId, endPoint.vectorId);
+    dataService.addCurveRoad(curveRoad);
+
+    startPoint.setPointParent(curveRoad.vectorId);
+    startPoint.setIndex(0);
+
+    endPoint.setPointParent(curveRoad.vectorId);
+    endPoint.setIndex(2);
+
+    let edgePoints = mathUtil.RectangleVertex(
+      startPoint,
+      endPoint,
+      curveRoad.leftWidth +
+        curveRoad.rightWidth +
+        curveRoad.midDivide.midDivideWidth
+    );
+
+    let leftEdge = curveEdgeService.create(
+      edgePoints.leftEdgeStart,
+      edgePoints.leftEdgeEnd,
+      null,
+      curveRoad.vectorId
+    );
+
+    let rightEdge = curveEdgeService.create(
+      edgePoints.rightEdgeStart,
+      edgePoints.rightEdgeEnd,
+      null,
+      curveRoad.vectorId
+    );
+
+    curveRoad.setLeftEdge(leftEdge.vectorId);
+    curveRoad.setRightEdge(rightEdge.vectorId);
+
+    curveRoad.points.push(startPoint);
+    curveRoad.points.push(endPoint);
+
+    leftEdge.points.push(edgePoints.leftEdgeStart);
+    leftEdge.points.push(edgePoints.leftEdgeEnd);
+
+    rightEdge.points.push(edgePoints.rightEdgeStart);
+    rightEdge.points.push(edgePoints.rightEdgeEnd);
+
+    let point1 = {
+      x: position.x + 200,
+      y: position.y + height / 2,
+    };
+    let point2 = {
+      x: position.x + 50,
+      y: position.y + height / 2 - 50,
+    };
+    let point3 = {
+      x: position.x + 50,
+      y: position.y - height / 2 + 50,
+    };
+    let point4 = {
+      x: position.x + 200,
+      y: position.y - height / 2,
+    };
+
+    curveRoadService.addCPoint(curveRoad, point1, 0);
+    curveRoadService.addCPoint(curveRoad, point2, 1);
+    curveRoadService.addCPoint(curveRoad, position, 2);
+    curveRoadService.addCPoint(curveRoad, point3, 3);
+    curveRoadService.addCPoint(curveRoad, point4, 4);
+
+    curveRoadService.updateForMovePoint(curveRoad.points[1].vectorId, point1);
+    curveRoadService.updateForMovePoint(curveRoad.points[2].vectorId, point2);
+    curveRoadService.updateForMovePoint(curveRoad.points[3].vectorId, position);
+    curveRoadService.updateForMovePoint(curveRoad.points[4].vectorId, point3);
+    curveRoadService.updateForMovePoint(curveRoad.points[5].vectorId, point4);
+
+    uiService.setCurveRoadLeftDrivewayCount(1);
+    uiService.setCurveRoadRightDrivewayCount(1);
+    uiService.setLeftCurveRoadWidth(50);
+    uiService.setRightCurveRoadWidth(50);
+  }
+
+  buildCorner(position) {
+    const len = 300;
+    let end = roadPointService.create(position);
+    let start1 = roadPointService.create({
+      x: end.x + len,
+      y: end.y,
+    });
+
+    let start2 = roadPointService.create({
+      x: end.x,
+      y: end.y - len,
+    });
+
+    //需要设置公路的车道数,是否双向等等
+    uiService.isBelongRoad(UIEvents.TwoEdgeTwoLanRoad);
+
+    roadService.create(start1.vectorId, end.vectorId);
+    roadService.create(start2.vectorId, end.vectorId);
+    edgeService.updateEdgeForMulRoad(end.vectorId);
+  }
+
+  buildImportSmashedRoad(position) {
+    const roadLen = 600;
+    let startPoint = {
+      x: position.x,
+      y: position.y - (roadLen * 3) / 5,
+    };
+    let endPoint = {
+      x: position.x,
+      y: position.y + (roadLen * 2) / 5,
+    };
+    startPoint = roadPointService.create(startPoint);
+    endPoint = roadPointService.create(endPoint);
+    let crossPoint = roadPointService.create(position);
+
+    uiService.isBelongRoad(UIEvents.OneEdgeThreeLanRoad);
+    roadService.create(startPoint.vectorId, crossPoint.vectorId);
+    roadService.create(crossPoint.vectorId, endPoint.vectorId);
+    let startPoint2 = {
+      x: startPoint.x + roadLen / 4,
+      y: startPoint.y,
+    };
+    startPoint2 = roadPointService.create(startPoint2);
+    uiService.isBelongRoad(UIEvents.OneEdgeOneLanRoad);
+    roadService.create(startPoint2.vectorId, crossPoint.vectorId);
+    edgeService.updateEdgeForMulRoad(crossPoint.vectorId);
+  }
+
+  buildHighSpeedTollBooth(position) {
+    const roadLen = 600;
+    let startPoint = {
+      x: position.x,
+      y: position.y + roadLen / 2,
+    };
+    let endPoint = {
+      x: position.x,
+      y: position.y - roadLen / 2,
+    };
+    startPoint = roadPointService.create(startPoint);
+    endPoint = roadPointService.create(endPoint);
+    uiService.setWayType(Constant.oneWay);
+    uiService.setSingleRoadDrivewayCount(6);
+    uiService.setSingleRoadWidth(Settings.singleLaneWidth * 6);
+
+    roadService.create(startPoint.vectorId, endPoint.vectorId);
+  }
+
+  buildHighwaySection(position) {
+    const roadLen = 600;
+    let startPoint = {
+      x: position.x,
+      y: position.y + roadLen / 2,
+    };
+    let endPoint = {
+      x: position.x,
+      y: position.y - roadLen / 2,
+    };
+    startPoint = roadPointService.create(startPoint);
+    endPoint = roadPointService.create(endPoint);
+    uiService.isBelongRoad(UIEvents.TwoEdgeTwoLanRoad);
+    roadService.create(startPoint.vectorId, endPoint.vectorId);
+  }
+
+  //这个还没解决
+  buildHighSpeedHarbor(position) {}
+
+  //这个还没解决
+  buildWideNarrowRoad(position) {}
 }
 
 const addCrossRoad = new AddCrossRoad();

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

@@ -1,6 +1,8 @@
 import { coordinate } from "../Coordinate.js";
 import LayerEvents from "../enum/LayerEvents.js";
 import UIEvents from "../enum/UIEvents.js";
+import RoadTemplate from "../enum/RoadTemplate.js";
+import RoadStructure from "../enum/RoadStructure.js";
 import VectorType from "../enum/VectorType.js";
 import VectorStyle from "../enum/VectorStyle.js";
 import GeoActions from "../enum/GeoActions.js";
@@ -108,6 +110,10 @@ export default class UIControl {
           stateService.setEventName(LayerEvents.AddSVG);
         } else if (selectUI == UIEvents.Img) {
           stateService.setEventName(LayerEvents.Img);
+        } else if (uiService.isBelongRoadTemplate(selectUI)) {
+          stateService.setEventName(LayerEvents.AddRoadTemplate);
+        } else if (uiService.isBelongRoadStructure(selectUI)) {
+          stateService.setEventName(LayerEvents.AddRoadStructure);
         }
       }
     }

+ 20 - 7
src/graphic/Layer.js

@@ -10,6 +10,7 @@ import { moveText } from "./Controls/MoveText";
 import { moveSVG } from "./Controls/MoveSVG";
 import { moveMagnifier } from "./Controls/MoveMagnifier";
 import { addRoad } from "./Controls/AddRoad";
+import { addCrossRoad } from "./Controls/AddCrossRoad";
 import { addLine } from "./Controls/AddLine";
 import { addPoint } from "./Controls/AddPoint";
 import { addCircle } from "./Controls/AddCircle";
@@ -290,16 +291,23 @@ export default class Layer {
               position
             );
             if (dis1 > dis2) {
-              curveRoadService.addCPoint(
-                curveRoad,
-                position,
-                curveRoad.points.length - 2
-              );
+              index = curveRoad.points.length - 2;
+              // curveRoadService.addCPoint(
+              //   curveRoad,
+              //   position,
+              //   curveRoad.points.length - 2
+              // );
             } else {
-              curveRoadService.addCPoint(curveRoad, position, 1);
+              //curveRoadService.addCPoint(curveRoad, position, 1);
+              index = 1;
             }
+            curveRoadService.addCPoint(curveRoad, position, index);
           }
-          curveRoadService.setLanes(curveRoad.vectorId);
+          //curveRoadService.setLanes(curveRoad.vectorId);
+          curveRoadService.updateForMovePoint(
+            curveRoad.points[index + 1].vectorId,
+            position
+          );
           stateService.clearEventName();
           this.history.save();
           this.renderer.autoRedraw();
@@ -1175,6 +1183,11 @@ export default class Layer {
           elementService.hideAll();
         }
         break;
+      case LayerEvents.AddRoadTemplate:
+        addCrossRoad.build(position);
+        this.history.save();
+        this.renderer.autoRedraw();
+        break;
     }
 
     this.setEventName("mouseUp");

+ 2 - 6
src/graphic/Service/CurveRoadService.js

@@ -149,22 +149,18 @@ export default class CurveRoadService extends RoadService {
       edgePoints.leftEdgeStart,
       edgePoints.leftEdgeEnd,
       null,
-      vectorId
+      newCurveRoad.vectorId
     );
 
     let rightEdge = curveEdgeService.create(
       edgePoints.rightEdgeStart,
       edgePoints.rightEdgeEnd,
       null,
-      vectorId
+      newCurveRoad.vectorId
     );
 
     newCurveRoad.setLeftEdge(leftEdge.vectorId);
     newCurveRoad.setRightEdge(rightEdge.vectorId);
-    if (!vectorId) {
-      leftEdge.setEdgeParent(newCurveRoad.vectorId);
-      rightEdge.setEdgeParent(newCurveRoad.vectorId);
-    }
 
     newCurveRoad.points.push(newStartPoint);
     newCurveRoad.points.push(newEndPoint);

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

@@ -7,6 +7,8 @@ import UIEvents from "../enum/UIEvents.js";
 import VectorCategory from "../enum/VectorCategory.js";
 import Constant from "../Constant.js";
 import VectorStyle from "../enum/VectorStyle.js";
+import RoadTemplate from "../enum/RoadTemplate.js";
+import RoadStructure from "../enum/RoadStructure.js";
 
 export default class UIService {
   constructor() {}
@@ -129,6 +131,24 @@ export default class UIService {
     }
   }
 
+  isBelongRoadTemplate(ui) {
+    if (RoadTemplate[ui]) {
+      this.setSelectRoadTemplate(ui);
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  isBelongRoadStructure(ui) {
+    if (RoadStructure[ui]) {
+      this.setSelectRoadStructure(ui);
+      return true;
+    } else {
+      return false;
+    }
+  }
+
   setWayType(value) {
     Settings.wayType = value;
   }
@@ -165,6 +185,22 @@ export default class UIService {
     Settings.rightRoadWidth = value;
   }
 
+  setCurveRoadLeftDrivewayCount(value) {
+    Settings.curveRoadLeftDrivewayCount = value;
+  }
+
+  setCurveRoadRightDrivewayCount(value) {
+    Settings.curveRoadRightDrivewayCount = value;
+  }
+
+  setLeftCurveRoadWidth(value) {
+    Settings.leftCurveRoadWidth = value;
+  }
+
+  setRightCurveRoadWidth(value) {
+    Settings.rightCurveRoadWidth = value;
+  }
+
   setSelectLineCategory(value) {
     Settings.selectLineCategory = value;
   }
@@ -182,6 +218,22 @@ export default class UIService {
     Settings.selectSVGType = value;
   }
 
+  getSelectRoadTemplate() {
+    return Settings.selectRoadTemplate;
+  }
+
+  setSelectRoadTemplate(value) {
+    Settings.selectRoadTemplate = value;
+  }
+
+  setSelectRoadStructure(value) {
+    Settings.selectRoadStructure = value;
+  }
+
+  getSelectRoadStructure() {
+    return Settings.selectRoadStructure;
+  }
+
   //如果position在屏幕左上角,返回的就朝向右下角,如果是右下角,则返回的是左上角。其他情况以此类推
   getNewPositionForPop(position) {
     const offset = 50;

+ 4 - 2
src/graphic/Settings.js

@@ -25,7 +25,9 @@ const Settings = {
   selectPointCategory: VectorCategory.Point.NormalPoint,
   selectLocationMode: null,
   selectBasePointId: null, //选中的基准点
-  selectSVGType: null,
+  selectSVGType: null, //图例
+  selectRoadTemplate: null, //道路模板
+  selectRoadStructure: null, //道路结构
 };
-console.error(os.isPc)
+console.error(os.isPc);
 export default Settings;

+ 30 - 0
src/graphic/Util/MathUtil.js

@@ -1106,6 +1106,36 @@ export default class MathUtil {
     return points;
   }
 
+  createSixPoint(position, r) {
+    let deg = Math.PI / 180; //角度
+    let points = [];
+    points[0] = {
+      x: position.x,
+      y: position.y + r,
+    };
+    points[1] = {
+      x: position.x + r * Math.sin(60 * deg),
+      y: position.y + r * Math.cos(60 * deg),
+    };
+    points[2] = {
+      x: position.x + r * Math.cos(30 * deg),
+      y: position.y - r * Math.sin(30 * deg),
+    };
+    points[3] = {
+      x: position.x,
+      y: position.y - r,
+    };
+    points[4] = {
+      x: position.x - r * Math.cos(30 * deg),
+      y: position.y - r * Math.sin(30 * deg),
+    };
+    points[5] = {
+      x: position.x - r * Math.sin(60 * deg),
+      y: position.y + r * Math.cos(60 * deg),
+    };
+    return points;
+  }
+
   //求圆和直线之间的交点
   /**
    * 求圆和直线之间的交点

+ 3 - 0
src/graphic/enum/LayerEvents.js

@@ -48,5 +48,8 @@ const LayerEvents = {
 
   Img: "Img",
   MoveMeasureArrow: "moveMeasureArrow",
+
+  AddRoadTemplate: "addRoadTemplate",
+  AddRoadStructure: "addRoadStructure",
 };
 export default LayerEvents;