|
@@ -21,7 +21,7 @@ export default class EdgeService {
|
|
|
|
|
|
//计算默认的edge
|
|
//计算默认的edge
|
|
computerDefaultEdge(roadId) {
|
|
computerDefaultEdge(roadId) {
|
|
- console.log("开始执行computerDefaultEdge");
|
|
|
|
|
|
+ // console.log("开始执行computerDefaultEdge");
|
|
let road = dataService.getRoad(roadId);
|
|
let road = dataService.getRoad(roadId);
|
|
let line = roadService.getMidLine(road);
|
|
let line = roadService.getMidLine(road);
|
|
|
|
|
|
@@ -72,7 +72,7 @@ export default class EdgeService {
|
|
//单独的墙的一端
|
|
//单独的墙的一端
|
|
updateDefaultEdge(roadId, dir) {
|
|
updateDefaultEdge(roadId, dir) {
|
|
//console.log('计算'+roadId+' '+dir+'方向的默认Edge端点');
|
|
//console.log('计算'+roadId+' '+dir+'方向的默认Edge端点');
|
|
- console.log("开始执行updateDefaultEdge");
|
|
|
|
|
|
+ // console.log("开始执行updateDefaultEdge");
|
|
|
|
|
|
let road = dataService.getRoad(roadId);
|
|
let road = dataService.getRoad(roadId);
|
|
let startPoint = dataService.getPoint(road.startId);
|
|
let startPoint = dataService.getPoint(road.startId);
|
|
@@ -110,7 +110,7 @@ export default class EdgeService {
|
|
//不纠正edge与墙的中心线平行
|
|
//不纠正edge与墙的中心线平行
|
|
updateEdgeForTwoRoad(roadId1, roadId2) {
|
|
updateEdgeForTwoRoad(roadId1, roadId2) {
|
|
//console.log('计算'+roadId1+'和'+roadId2+'相交的edge交点');
|
|
//console.log('计算'+roadId1+'和'+roadId2+'相交的edge交点');
|
|
- console.log("开始执行updateEdgeForTwoRoad");
|
|
|
|
|
|
+ // console.log("开始执行updateEdgeForTwoRoad");
|
|
|
|
|
|
let road1 = dataService.getRoad(roadId1);
|
|
let road1 = dataService.getRoad(roadId1);
|
|
let startPoint1 = dataService.getPoint(road1.startId);
|
|
let startPoint1 = dataService.getPoint(road1.startId);
|
|
@@ -144,7 +144,7 @@ export default class EdgeService {
|
|
//left-right,right-left
|
|
//left-right,right-left
|
|
if (road1.startId == road2.startId) {
|
|
if (road1.startId == road2.startId) {
|
|
//如果墙的角度过大,不能计算edge对应的line的交点
|
|
//如果墙的角度过大,不能计算edge对应的line的交点
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft1);
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight1);
|
|
} else {
|
|
} else {
|
|
@@ -158,7 +158,7 @@ export default class EdgeService {
|
|
mathUtil.clonePoint(rightEdge2.start, newEdgePoint1);
|
|
mathUtil.clonePoint(rightEdge2.start, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge2.start, newEdgePoint2);
|
|
mathUtil.clonePoint(leftEdge2.start, newEdgePoint2);
|
|
|
|
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, rightEdge2.vectorId);
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, rightEdge2.vectorId);
|
|
dataService.deleteControlPoint(rightEdge1.vectorId, leftEdge2.vectorId);
|
|
dataService.deleteControlPoint(rightEdge1.vectorId, leftEdge2.vectorId);
|
|
@@ -214,7 +214,7 @@ export default class EdgeService {
|
|
//start-end
|
|
//start-end
|
|
//left-left,right-right
|
|
//left-left,right-right
|
|
else if (road1.startId == road2.endId) {
|
|
else if (road1.startId == road2.endId) {
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft1);
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight1);
|
|
} else {
|
|
} else {
|
|
@@ -228,7 +228,7 @@ export default class EdgeService {
|
|
mathUtil.clonePoint(leftEdge2.end, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge2.end, newEdgePoint1);
|
|
mathUtil.clonePoint(rightEdge2.end, newEdgePoint2);
|
|
mathUtil.clonePoint(rightEdge2.end, newEdgePoint2);
|
|
|
|
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
dataService.deleteControlPoint(
|
|
dataService.deleteControlPoint(
|
|
@@ -286,19 +286,24 @@ export default class EdgeService {
|
|
//end-start
|
|
//end-start
|
|
//left-left,right-right
|
|
//left-left,right-right
|
|
else if (road1.endId == road2.startId) {
|
|
else if (road1.endId == road2.startId) {
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft1);
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight1);
|
|
} else {
|
|
} else {
|
|
newEdgePoint1 = mathUtil.getIntersectionPoint(lineLeft1, lineLeft2);
|
|
newEdgePoint1 = mathUtil.getIntersectionPoint(lineLeft1, lineLeft2);
|
|
newEdgePoint2 = mathUtil.getIntersectionPoint(lineRight1, lineRight2);
|
|
newEdgePoint2 = mathUtil.getIntersectionPoint(lineRight1, lineRight2);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (newEdgePoint1 == null || newEdgePoint2 == null) {
|
|
|
|
+ debugger;
|
|
|
|
+ }
|
|
|
|
+
|
|
mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
|
|
|
|
mathUtil.clonePoint(leftEdge2.start, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge2.start, newEdgePoint1);
|
|
mathUtil.clonePoint(rightEdge2.start, newEdgePoint2);
|
|
mathUtil.clonePoint(rightEdge2.start, newEdgePoint2);
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
dataService.deleteControlPoint(
|
|
dataService.deleteControlPoint(
|
|
@@ -356,7 +361,7 @@ export default class EdgeService {
|
|
//end-end
|
|
//end-end
|
|
//left-right,right-left
|
|
//left-right,right-left
|
|
else if (road1.endId == road2.endId) {
|
|
else if (road1.endId == road2.endId) {
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft1);
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight1);
|
|
} else {
|
|
} else {
|
|
@@ -369,7 +374,7 @@ export default class EdgeService {
|
|
mathUtil.clonePoint(rightEdge2.end, newEdgePoint1);
|
|
mathUtil.clonePoint(rightEdge2.end, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge2.end, newEdgePoint2);
|
|
mathUtil.clonePoint(leftEdge2.end, newEdgePoint2);
|
|
|
|
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, rightEdge2.vectorId);
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, rightEdge2.vectorId);
|
|
dataService.deleteControlPoint(rightEdge1.vectorId, leftEdge2.vectorId);
|
|
dataService.deleteControlPoint(rightEdge1.vectorId, leftEdge2.vectorId);
|
|
@@ -436,7 +441,7 @@ export default class EdgeService {
|
|
//主要用于多个road相交,计算相邻的road之间的edge
|
|
//主要用于多个road相交,计算相邻的road之间的edge
|
|
updateSingleEdgeForTwoRoad(roadId1, roadId2) {
|
|
updateSingleEdgeForTwoRoad(roadId1, roadId2) {
|
|
//console.log('更新'+roadId1+'和'+roadId2+'一侧相交的edge交点');
|
|
//console.log('更新'+roadId1+'和'+roadId2+'一侧相交的edge交点');
|
|
- console.log("开始执行updateSingleEdgeForTwoRoad");
|
|
|
|
|
|
+ // console.log("开始执行updateSingleEdgeForTwoRoad");
|
|
const road1 = dataService.getRoad(roadId1);
|
|
const road1 = dataService.getRoad(roadId1);
|
|
const startPoint1 = dataService.getPoint(road1.startId);
|
|
const startPoint1 = dataService.getPoint(road1.startId);
|
|
const endPoint1 = dataService.getPoint(road1.endId);
|
|
const endPoint1 = dataService.getPoint(road1.endId);
|
|
@@ -479,7 +484,7 @@ export default class EdgeService {
|
|
lineRight2 = mathUtil.createLine3(line2, rightEdge2.end);
|
|
lineRight2 = mathUtil.createLine3(line2, rightEdge2.end);
|
|
|
|
|
|
// 如果墙的角度过大,不能计算edge对应的line的交点
|
|
// 如果墙的角度过大,不能计算edge对应的line的交点
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft1);
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight1);
|
|
} else {
|
|
} else {
|
|
@@ -489,7 +494,7 @@ export default class EdgeService {
|
|
|
|
|
|
points[2] = newEdgePoint1;
|
|
points[2] = newEdgePoint1;
|
|
if (mathUtil.isClockwise(points)) {
|
|
if (mathUtil.isClockwise(points)) {
|
|
- console.log("情况1");
|
|
|
|
|
|
+ // console.log("情况1");
|
|
mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
mathUtil.clonePoint(rightEdge2.start, newEdgePoint1);
|
|
mathUtil.clonePoint(rightEdge2.start, newEdgePoint1);
|
|
//要删除控制点
|
|
//要删除控制点
|
|
@@ -497,7 +502,7 @@ export default class EdgeService {
|
|
//不能按照下面的方式计算,因为一个edge可以属于两个控制点,毕竟有两个端点
|
|
//不能按照下面的方式计算,因为一个edge可以属于两个控制点,毕竟有两个端点
|
|
// dataService.deleteControlPointForEdge(leftEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge2.vectorId);
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(
|
|
dataService.deleteControlPoint(
|
|
leftEdge1.vectorId,
|
|
leftEdge1.vectorId,
|
|
@@ -518,14 +523,14 @@ export default class EdgeService {
|
|
//需要删除之前的控制点,包含:leftEdge1.vectorId和rightEdge2.vectorId
|
|
//需要删除之前的控制点,包含:leftEdge1.vectorId和rightEdge2.vectorId
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- console.log("情况2");
|
|
|
|
|
|
+ // console.log("情况2");
|
|
mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
mathUtil.clonePoint(leftEdge2.start, newEdgePoint2);
|
|
mathUtil.clonePoint(leftEdge2.start, newEdgePoint2);
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(leftEdge2.vectorId, rightEdge1.vectorId);
|
|
dataService.deleteControlPoint(leftEdge2.vectorId, rightEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge1.vectorId);
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(
|
|
dataService.deleteControlPoint(
|
|
leftEdge2.vectorId,
|
|
leftEdge2.vectorId,
|
|
@@ -557,7 +562,7 @@ export default class EdgeService {
|
|
lineLeft2 = mathUtil.createLine3(line2, leftEdge2.start);
|
|
lineLeft2 = mathUtil.createLine3(line2, leftEdge2.start);
|
|
lineRight2 = mathUtil.createLine3(line2, rightEdge2.start);
|
|
lineRight2 = mathUtil.createLine3(line2, rightEdge2.start);
|
|
|
|
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft1);
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight1);
|
|
} else {
|
|
} else {
|
|
@@ -566,14 +571,14 @@ export default class EdgeService {
|
|
}
|
|
}
|
|
points[2] = newEdgePoint1;
|
|
points[2] = newEdgePoint1;
|
|
if (mathUtil.isClockwise(points)) {
|
|
if (mathUtil.isClockwise(points)) {
|
|
- console.log("情况3");
|
|
|
|
|
|
+ //console.log("情况3");
|
|
mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge2.end, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge2.end, newEdgePoint1);
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge2.vectorId);
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(
|
|
dataService.deleteControlPoint(
|
|
leftEdge1.vectorId,
|
|
leftEdge1.vectorId,
|
|
@@ -592,7 +597,7 @@ export default class EdgeService {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- console.log("情况4");
|
|
|
|
|
|
+ //console.log("情况4");
|
|
mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
mathUtil.clonePoint(rightEdge2.end, newEdgePoint2);
|
|
mathUtil.clonePoint(rightEdge2.end, newEdgePoint2);
|
|
//要删除控制点
|
|
//要删除控制点
|
|
@@ -602,7 +607,7 @@ export default class EdgeService {
|
|
);
|
|
);
|
|
// dataService.deleteControlPointForEdge(rightEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge2.vectorId);
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(
|
|
dataService.deleteControlPoint(
|
|
rightEdge1.vectorId,
|
|
rightEdge1.vectorId,
|
|
@@ -634,7 +639,7 @@ export default class EdgeService {
|
|
lineLeft2 = mathUtil.createLine3(line2, leftEdge2.end);
|
|
lineLeft2 = mathUtil.createLine3(line2, leftEdge2.end);
|
|
lineRight2 = mathUtil.createLine3(line2, rightEdge2.end);
|
|
lineRight2 = mathUtil.createLine3(line2, rightEdge2.end);
|
|
|
|
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft1);
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight1);
|
|
} else {
|
|
} else {
|
|
@@ -643,14 +648,14 @@ export default class EdgeService {
|
|
}
|
|
}
|
|
points[2] = newEdgePoint1;
|
|
points[2] = newEdgePoint1;
|
|
if (mathUtil.isClockwise(points)) {
|
|
if (mathUtil.isClockwise(points)) {
|
|
- console.log("情况5");
|
|
|
|
|
|
+ //console.log("情况5");
|
|
mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge2.start, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge2.start, newEdgePoint1);
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge2.vectorId);
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(
|
|
dataService.deleteControlPoint(
|
|
leftEdge1.vectorId,
|
|
leftEdge1.vectorId,
|
|
@@ -669,7 +674,7 @@ export default class EdgeService {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- console.log("情况6");
|
|
|
|
|
|
+ //console.log("情况6");
|
|
mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
mathUtil.clonePoint(rightEdge2.start, newEdgePoint2);
|
|
mathUtil.clonePoint(rightEdge2.start, newEdgePoint2);
|
|
//要删除控制点
|
|
//要删除控制点
|
|
@@ -679,7 +684,7 @@ export default class EdgeService {
|
|
);
|
|
);
|
|
// dataService.deleteControlPointForEdge(rightEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge2.vectorId);
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(
|
|
dataService.deleteControlPoint(
|
|
rightEdge1.vectorId,
|
|
rightEdge1.vectorId,
|
|
@@ -711,7 +716,7 @@ export default class EdgeService {
|
|
lineLeft2 = mathUtil.createLine3(line2, leftEdge2.start);
|
|
lineLeft2 = mathUtil.createLine3(line2, leftEdge2.start);
|
|
lineRight2 = mathUtil.createLine3(line2, rightEdge2.start);
|
|
lineRight2 = mathUtil.createLine3(line2, rightEdge2.start);
|
|
|
|
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft1);
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight1);
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight1);
|
|
} else {
|
|
} else {
|
|
@@ -720,14 +725,14 @@ export default class EdgeService {
|
|
}
|
|
}
|
|
points[2] = newEdgePoint1;
|
|
points[2] = newEdgePoint1;
|
|
if (mathUtil.isClockwise(points)) {
|
|
if (mathUtil.isClockwise(points)) {
|
|
- console.log("情况7");
|
|
|
|
|
|
+ //console.log("情况7");
|
|
mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
mathUtil.clonePoint(rightEdge2.end, newEdgePoint1);
|
|
mathUtil.clonePoint(rightEdge2.end, newEdgePoint1);
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
dataService.deleteControlPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge2.vectorId);
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(
|
|
dataService.deleteControlPoint(
|
|
leftEdge1.vectorId,
|
|
leftEdge1.vectorId,
|
|
@@ -746,14 +751,14 @@ export default class EdgeService {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- console.log("情况8");
|
|
|
|
|
|
+ //console.log("情况8");
|
|
mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
mathUtil.clonePoint(leftEdge2.end, newEdgePoint2);
|
|
mathUtil.clonePoint(leftEdge2.end, newEdgePoint2);
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(rightEdge1.vectorId, leftEdge2.vectorId);
|
|
dataService.deleteControlPoint(rightEdge1.vectorId, leftEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(leftEdge2.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge1.vectorId);
|
|
// dataService.deleteControlPointForEdge(rightEdge1.vectorId);
|
|
- if (angle > Constant.maxAngle) {
|
|
|
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
//要删除控制点
|
|
//要删除控制点
|
|
dataService.deleteControlPoint(
|
|
dataService.deleteControlPoint(
|
|
rightEdge1.vectorId,
|
|
rightEdge1.vectorId,
|
|
@@ -785,7 +790,7 @@ export default class EdgeService {
|
|
//更新pointId对应的全部edge端点
|
|
//更新pointId对应的全部edge端点
|
|
updateEdgeForMulRoad(pointId) {
|
|
updateEdgeForMulRoad(pointId) {
|
|
//console.log('更新 '+pointId+' 那一圈的edge端点');
|
|
//console.log('更新 '+pointId+' 那一圈的edge端点');
|
|
- console.log("开始执行updateEdgeForMulRoad");
|
|
|
|
|
|
+ //console.log("开始执行updateEdgeForMulRoad");
|
|
let point = dataService.getPoint(pointId);
|
|
let point = dataService.getPoint(pointId);
|
|
let parent = point.getParent();
|
|
let parent = point.getParent();
|
|
|
|
|