xushiting 2 years ago
parent
commit
f7aaab54c0

File diff suppressed because it is too large
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 0 - 1
src/graphic/History/History.js

@@ -17,7 +17,6 @@ import { crossPointService } from "../Service/CrossPointService";
 import { curveRoadPointService } from "../Service/CurveRoadPointService";
 import { curveRoadPointService } from "../Service/CurveRoadPointService";
 import { curveEdgeService } from "../Service/CurveEdgeService";
 import { curveEdgeService } from "../Service/CurveEdgeService";
 import { curveRoadService } from "../Service/CurveRoadService";
 import { curveRoadService } from "../Service/CurveRoadService";
-// import { curvePointService } from "../Service/CurvePointService";
 import Settings from "../Settings";
 import Settings from "../Settings";
 
 
 export default class History {
 export default class History {

+ 11 - 21
src/graphic/ListenLayer.js

@@ -190,33 +190,23 @@ export default class ListenLayer {
         continue;
         continue;
       }
       }
       const curveLine = dataService.getCurveLine(curveLineId);
       const curveLine = dataService.getCurveLine(curveLineId);
-      let startPoint = dataService.getCurvePoint(curveLine.startId);
-      let endPoint = dataService.getCurvePoint(curveLine.endId);
-      const comLine = mathUtil.createLine1(startPoint, endPoint);
-      const join = mathUtil.getJoinLinePoint(position, comLine);
-      const distance = this.getDistance(position, join);
-      if (!mathUtil.isContainForSegment(join, startPoint, endPoint)) {
-        continue;
-      }
-      if (distance < Constant.minAdsorbPix / 2) {
+
+      let joinInfo = this.distanceForBezier(
+        position,
+        curveLine.curves,
+        Constant.minAdsorbPix
+      );
+      //选中了路
+      if (joinInfo.distance < Constant.minAdsorbPix) {
         curveLineInfo = {
         curveLineInfo = {
           curveLineId: curveLineId,
           curveLineId: curveLineId,
           type: VectorType.CurveLine,
           type: VectorType.CurveLine,
-          distance: distance,
+          distance: joinInfo.distance,
+          x: joinInfo.position.x,
+          y: joinInfo.position.y,
         };
         };
       }
       }
     }
     }
-
-    if (curveLineInfo.curveLineId) {
-      const linkedLine = dataService.getLine(lineInfo.curveLineId);
-      let startPoint = dataService.getCurvePoint(linkedLine.startId);
-      let endPoint = dataService.getCurvePoint(linkedLine.endId);
-      const linkedComLine = mathUtil.createLine1(startPoint, endPoint);
-      const linkedPosition = mathUtil.getJoinLinePoint(position, linkedComLine);
-      curveLineInfo.x = linkedPosition.x;
-      curveLineInfo.y = linkedPosition.y;
-      return curveLineInfo;
-    }
     return curveLineInfo;
     return curveLineInfo;
   }
   }
 
 

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

@@ -3,7 +3,7 @@ import Line from "../Geometry/Line.js";
 import CurvePoint from "../Geometry/CurvePoint.js";
 import CurvePoint from "../Geometry/CurvePoint.js";
 import CurveLine from "../Geometry/CurveLine.js";
 import CurveLine from "../Geometry/CurveLine.js";
 import { dataService } from "./DataService.js";
 import { dataService } from "./DataService.js";
-// import { curvePointService } from "./CurvePointService.js";
+import { curvePointService } from "./CurvePointService.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 { uiService } from "./UIService.js";
 import { uiService } from "./UIService.js";