|
@@ -152,31 +152,35 @@ export default class MoveRoad {
|
|
listenLayer.modifyPoint &&
|
|
listenLayer.modifyPoint &&
|
|
listenLayer.modifyPoint.hasOwnProperty("linkedRoadId")
|
|
listenLayer.modifyPoint.hasOwnProperty("linkedRoadId")
|
|
) {
|
|
) {
|
|
- // let splitRoadPoint = roadPointService.create({
|
|
|
|
- // x: listenLayer.modifyPoint.x,
|
|
|
|
- // y: listenLayer.modifyPoint.y,
|
|
|
|
- // });
|
|
|
|
- // roadService.splitRoad(
|
|
|
|
- // listenLayer.modifyPoint.linkedRoadId,
|
|
|
|
- // splitRoadPoint.vectorId,
|
|
|
|
- // "start"
|
|
|
|
- // );
|
|
|
|
roadService.splitRoad(
|
|
roadService.splitRoad(
|
|
listenLayer.modifyPoint.linkedRoadId,
|
|
listenLayer.modifyPoint.linkedRoadId,
|
|
point.vectorId,
|
|
point.vectorId,
|
|
"start"
|
|
"start"
|
|
);
|
|
);
|
|
- //this.moveTo(point.vectorId, point.vectorId);
|
|
|
|
edgeService.updateEdgeForMovePoint(point.vectorId);
|
|
edgeService.updateEdgeForMovePoint(point.vectorId);
|
|
- } else if (this.splitRoadId != null) {
|
|
|
|
- roadService.splitRoad(this.splitRoadId, point.vectorId, "start");
|
|
|
|
}
|
|
}
|
|
|
|
+ // else if (this.splitRoadId != null) {
|
|
|
|
+ // roadService.splitRoad(this.splitRoadId, point.vectorId, "start");
|
|
|
|
+ // }
|
|
//draggingItem.vectorId所在的墙面与其他墙角相交
|
|
//draggingItem.vectorId所在的墙面与其他墙角相交
|
|
- this.updateForAbsorbRoadPoints();
|
|
|
|
|
|
+ //this.updateForAbsorbRoadPoints();
|
|
|
|
+ // if (
|
|
|
|
+ // this.adsorbPointRoads != null &&
|
|
|
|
+ // Object.keys(this.adsorbPointRoads).length > 0
|
|
|
|
+ // ) {
|
|
|
|
+ // debugger;
|
|
|
|
+ // }
|
|
|
|
+
|
|
let parent = point.getParent();
|
|
let parent = point.getParent();
|
|
for (let key in parent) {
|
|
for (let key in parent) {
|
|
roadService.setLanes(key);
|
|
roadService.setLanes(key);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //draggingItem.vectorId所在的墙面与其他墙角相交
|
|
|
|
+ let splitPointId = this.updateForSplitRoad(point);
|
|
|
|
+ if (splitPointId) {
|
|
|
|
+ edgeService.updateEdgeForMovePoint(splitPointId);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//拖拽墙角/墙面,被其他墙角吸附
|
|
//拖拽墙角/墙面,被其他墙角吸附
|
|
@@ -218,6 +222,41 @@ export default class MoveRoad {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ updateForSplitRoad(point) {
|
|
|
|
+ if (this.splitRoadId) {
|
|
|
|
+ let splitRoad = dataService.getRoad(this.splitRoadId);
|
|
|
|
+ let splitRoadStartPoint = dataService.getRoadPoint(splitRoad.startId);
|
|
|
|
+ let splitRoadEndPoint = dataService.getRoadPoint(splitRoad.endId);
|
|
|
|
+ let splitLine = mathUtil.createLine1(
|
|
|
|
+ splitRoadStartPoint,
|
|
|
|
+ splitRoadEndPoint
|
|
|
|
+ );
|
|
|
|
+ let parent = point.getParent();
|
|
|
|
+ for (let key in parent) {
|
|
|
|
+ let road = dataService.getRoad(key);
|
|
|
|
+ let startPoint = dataService.getRoadPoint(road.startId);
|
|
|
|
+ let endPoint = dataService.getRoadPoint(road.endId);
|
|
|
|
+ let line = mathUtil.createLine1(startPoint, endPoint);
|
|
|
|
+ let join = mathUtil.getIntersectionPoint(splitLine, line);
|
|
|
|
+ if (
|
|
|
|
+ mathUtil.isContainForSegment(join, startPoint, endPoint) &&
|
|
|
|
+ mathUtil.getDistance(join, splitRoadStartPoint) <
|
|
|
|
+ Constant.minAdsorbPix
|
|
|
|
+ ) {
|
|
|
|
+ roadService.splitRoad(key, splitRoadStartPoint.vectorId, "start");
|
|
|
|
+ return splitRoadStartPoint.vectorId;
|
|
|
|
+ } else if (
|
|
|
|
+ mathUtil.isContainForSegment(join, startPoint, endPoint) &&
|
|
|
|
+ mathUtil.getDistance(join, splitRoadEndPoint) < Constant.minAdsorbPix
|
|
|
|
+ ) {
|
|
|
|
+ roadService.splitRoad(key, splitRoadEndPoint.vectorId, "end");
|
|
|
|
+ return splitRoadEndPoint.vectorId;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
getNewPointsForMoveRoad(roadId, dx, dy) {
|
|
getNewPointsForMoveRoad(roadId, dx, dy) {
|
|
dx = dx;
|
|
dx = dx;
|
|
dy = -dy;
|
|
dy = -dy;
|