|
@@ -133,16 +133,22 @@ export default class EdgeService {
|
|
|
if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft1);
|
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight1);
|
|
|
+ mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
|
+
|
|
|
+ newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft2);
|
|
|
+ newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight2);
|
|
|
+ mathUtil.clonePoint(rightEdge2.start, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(leftEdge2.start, newEdgePoint2);
|
|
|
} else {
|
|
|
newEdgePoint1 = mathUtil.getIntersectionPoint(lineLeft1, lineRight2);
|
|
|
newEdgePoint2 = mathUtil.getIntersectionPoint(lineLeft2, lineRight1);
|
|
|
- }
|
|
|
-
|
|
|
- mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
|
- mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
|
+ mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
|
|
|
|
- mathUtil.clonePoint(rightEdge2.start, newEdgePoint1);
|
|
|
- mathUtil.clonePoint(leftEdge2.start, newEdgePoint2);
|
|
|
+ mathUtil.clonePoint(rightEdge2.start, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(leftEdge2.start, newEdgePoint2);
|
|
|
+ }
|
|
|
|
|
|
if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
//要删除控制点
|
|
@@ -203,16 +209,22 @@ export default class EdgeService {
|
|
|
if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft1);
|
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight1);
|
|
|
+ mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
|
+
|
|
|
+ newEdgePoint1 = mathUtil.getJoinLinePoint(startPoint1, lineLeft2);
|
|
|
+ newEdgePoint2 = mathUtil.getJoinLinePoint(startPoint1, lineRight2);
|
|
|
+ mathUtil.clonePoint(leftEdge2.end, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge2.end, newEdgePoint2);
|
|
|
} else {
|
|
|
newEdgePoint1 = mathUtil.getIntersectionPoint(lineLeft1, lineLeft2);
|
|
|
newEdgePoint2 = mathUtil.getIntersectionPoint(lineRight1, lineRight2);
|
|
|
- }
|
|
|
-
|
|
|
- mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
|
- mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
|
+ mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
|
|
|
|
- mathUtil.clonePoint(leftEdge2.end, newEdgePoint1);
|
|
|
- mathUtil.clonePoint(rightEdge2.end, newEdgePoint2);
|
|
|
+ mathUtil.clonePoint(leftEdge2.end, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge2.end, newEdgePoint2);
|
|
|
+ }
|
|
|
|
|
|
if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
//要删除控制点
|
|
@@ -272,20 +284,31 @@ export default class EdgeService {
|
|
|
if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft1);
|
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight1);
|
|
|
+ mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
|
+ newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft2);
|
|
|
+ newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight2);
|
|
|
+ mathUtil.clonePoint(leftEdge2.start, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge2.start, newEdgePoint2);
|
|
|
} else {
|
|
|
newEdgePoint1 = mathUtil.getIntersectionPoint(lineLeft1, lineLeft2);
|
|
|
newEdgePoint2 = mathUtil.getIntersectionPoint(lineRight1, lineRight2);
|
|
|
- }
|
|
|
+ mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
|
|
|
|
- if (newEdgePoint1 == null || newEdgePoint2 == null) {
|
|
|
- debugger;
|
|
|
+ mathUtil.clonePoint(leftEdge2.start, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge2.start, newEdgePoint2);
|
|
|
}
|
|
|
|
|
|
- mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
|
- mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
|
+ // if (newEdgePoint1 == null || newEdgePoint2 == null) {
|
|
|
+ // debugger;
|
|
|
+ // }
|
|
|
|
|
|
- mathUtil.clonePoint(leftEdge2.start, newEdgePoint1);
|
|
|
- mathUtil.clonePoint(rightEdge2.start, newEdgePoint2);
|
|
|
+ // mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
|
+ // mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
|
+
|
|
|
+ // mathUtil.clonePoint(leftEdge2.start, newEdgePoint1);
|
|
|
+ // mathUtil.clonePoint(rightEdge2.start, newEdgePoint2);
|
|
|
if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
//要删除控制点
|
|
|
dataService.deleteCrossPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
@@ -344,15 +367,23 @@ export default class EdgeService {
|
|
|
if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft1);
|
|
|
newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight1);
|
|
|
+
|
|
|
+ mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
|
+
|
|
|
+ newEdgePoint1 = mathUtil.getJoinLinePoint(endPoint1, lineLeft2);
|
|
|
+ newEdgePoint2 = mathUtil.getJoinLinePoint(endPoint1, lineRight2);
|
|
|
+ mathUtil.clonePoint(rightEdge2.end, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(leftEdge2.end, newEdgePoint2);
|
|
|
} else {
|
|
|
newEdgePoint1 = mathUtil.getIntersectionPoint(lineLeft1, lineRight2);
|
|
|
newEdgePoint2 = mathUtil.getIntersectionPoint(lineLeft2, lineRight1);
|
|
|
- }
|
|
|
- mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
|
- mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
|
+ mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
|
|
|
|
- mathUtil.clonePoint(rightEdge2.end, newEdgePoint1);
|
|
|
- mathUtil.clonePoint(leftEdge2.end, newEdgePoint2);
|
|
|
+ mathUtil.clonePoint(rightEdge2.end, newEdgePoint1);
|
|
|
+ mathUtil.clonePoint(leftEdge2.end, newEdgePoint2);
|
|
|
+ }
|
|
|
|
|
|
if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
//要删除控制点
|
|
@@ -478,29 +509,43 @@ export default class EdgeService {
|
|
|
mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
|
mathUtil.clonePoint(rightEdge2.start, newEdgePoint1);
|
|
|
|
|
|
- crossPointService.update(
|
|
|
- newEdgePoint1,
|
|
|
- startPoint1,
|
|
|
- newEdgePoint1,
|
|
|
- leftEdge1,
|
|
|
- rightEdge2,
|
|
|
- "start",
|
|
|
- "start"
|
|
|
- );
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
+ //要删除控制点
|
|
|
+ dataService.deleteCrossPoint(leftEdge1.vectorId, rightEdge2.vectorId);
|
|
|
+ } else {
|
|
|
+ //需要考虑控制点CrossPointService
|
|
|
+ crossPointService.update(
|
|
|
+ newEdgePoint1,
|
|
|
+ startPoint1,
|
|
|
+ newEdgePoint1,
|
|
|
+ leftEdge1,
|
|
|
+ rightEdge2,
|
|
|
+ "start",
|
|
|
+ "start"
|
|
|
+ );
|
|
|
+
|
|
|
+ //需要删除之前的控制点,包含:leftEdge1.vectorId和rightEdge2.vectorId
|
|
|
+ }
|
|
|
} else {
|
|
|
// console.log("情况2");
|
|
|
mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
|
mathUtil.clonePoint(leftEdge2.start, newEdgePoint2);
|
|
|
|
|
|
- crossPointService.update(
|
|
|
- newEdgePoint2,
|
|
|
- startPoint1,
|
|
|
- newEdgePoint2,
|
|
|
- leftEdge2,
|
|
|
- rightEdge1,
|
|
|
- "start",
|
|
|
- "start"
|
|
|
- );
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
+ //要删除控制点
|
|
|
+ dataService.deleteCrossPoint(leftEdge2.vectorId, rightEdge1.vectorId);
|
|
|
+ } else {
|
|
|
+ //需要考虑控制点CrossPointService
|
|
|
+ crossPointService.update(
|
|
|
+ newEdgePoint2,
|
|
|
+ startPoint1,
|
|
|
+ newEdgePoint2,
|
|
|
+ leftEdge2,
|
|
|
+ rightEdge1,
|
|
|
+ "start",
|
|
|
+ "start"
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -528,29 +573,44 @@ export default class EdgeService {
|
|
|
mathUtil.clonePoint(leftEdge1.start, newEdgePoint1);
|
|
|
mathUtil.clonePoint(leftEdge2.end, newEdgePoint1);
|
|
|
|
|
|
- crossPointService.update(
|
|
|
- newEdgePoint1,
|
|
|
- startPoint1,
|
|
|
- newEdgePoint1,
|
|
|
- leftEdge1,
|
|
|
- leftEdge2,
|
|
|
- "start",
|
|
|
- "end"
|
|
|
- );
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
+ //要删除控制点
|
|
|
+ dataService.deleteCrossPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
|
+ } else {
|
|
|
+ //需要考虑控制点CrossPointService
|
|
|
+ crossPointService.update(
|
|
|
+ newEdgePoint1,
|
|
|
+ startPoint1,
|
|
|
+ newEdgePoint1,
|
|
|
+ leftEdge1,
|
|
|
+ leftEdge2,
|
|
|
+ "start",
|
|
|
+ "end"
|
|
|
+ );
|
|
|
+ }
|
|
|
} else {
|
|
|
//console.log("情况4");
|
|
|
mathUtil.clonePoint(rightEdge1.start, newEdgePoint2);
|
|
|
mathUtil.clonePoint(rightEdge2.end, newEdgePoint2);
|
|
|
|
|
|
- crossPointService.update(
|
|
|
- newEdgePoint2,
|
|
|
- startPoint1,
|
|
|
- newEdgePoint2,
|
|
|
- rightEdge1,
|
|
|
- rightEdge2,
|
|
|
- "start",
|
|
|
- "end"
|
|
|
- );
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
+ //要删除控制点
|
|
|
+ dataService.deleteCrossPoint(
|
|
|
+ rightEdge1.vectorId,
|
|
|
+ rightEdge2.vectorId
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ //需要考虑控制点CrossPointService
|
|
|
+ crossPointService.update(
|
|
|
+ newEdgePoint2,
|
|
|
+ startPoint1,
|
|
|
+ newEdgePoint2,
|
|
|
+ rightEdge1,
|
|
|
+ rightEdge2,
|
|
|
+ "start",
|
|
|
+ "end"
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -578,29 +638,44 @@ export default class EdgeService {
|
|
|
mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
|
mathUtil.clonePoint(leftEdge2.start, newEdgePoint1);
|
|
|
|
|
|
- crossPointService.update(
|
|
|
- newEdgePoint1,
|
|
|
- endPoint1,
|
|
|
- newEdgePoint1,
|
|
|
- leftEdge1,
|
|
|
- leftEdge2,
|
|
|
- "end",
|
|
|
- "start"
|
|
|
- );
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
+ //要删除控制点
|
|
|
+ dataService.deleteCrossPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
|
+ } else {
|
|
|
+ //需要考虑控制点CrossPointService
|
|
|
+ crossPointService.update(
|
|
|
+ newEdgePoint1,
|
|
|
+ endPoint1,
|
|
|
+ newEdgePoint1,
|
|
|
+ leftEdge1,
|
|
|
+ leftEdge2,
|
|
|
+ "end",
|
|
|
+ "start"
|
|
|
+ );
|
|
|
+ }
|
|
|
} else {
|
|
|
//console.log("情况6");
|
|
|
mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
|
mathUtil.clonePoint(rightEdge2.start, newEdgePoint2);
|
|
|
|
|
|
- crossPointService.update(
|
|
|
- newEdgePoint2,
|
|
|
- endPoint1,
|
|
|
- newEdgePoint2,
|
|
|
- rightEdge1,
|
|
|
- rightEdge2,
|
|
|
- "end",
|
|
|
- "start"
|
|
|
- );
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
+ //要删除控制点
|
|
|
+ dataService.deleteCrossPoint(
|
|
|
+ rightEdge1.vectorId,
|
|
|
+ rightEdge2.vectorId
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ //需要考虑控制点CrossPointService
|
|
|
+ crossPointService.update(
|
|
|
+ newEdgePoint2,
|
|
|
+ endPoint1,
|
|
|
+ newEdgePoint2,
|
|
|
+ rightEdge1,
|
|
|
+ rightEdge2,
|
|
|
+ "end",
|
|
|
+ "start"
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -628,29 +703,41 @@ export default class EdgeService {
|
|
|
mathUtil.clonePoint(leftEdge1.end, newEdgePoint1);
|
|
|
mathUtil.clonePoint(rightEdge2.end, newEdgePoint1);
|
|
|
|
|
|
- crossPointService.update(
|
|
|
- newEdgePoint1,
|
|
|
- endPoint1,
|
|
|
- newEdgePoint1,
|
|
|
- leftEdge1,
|
|
|
- leftEdge2,
|
|
|
- "end",
|
|
|
- "end"
|
|
|
- );
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
+ //要删除控制点
|
|
|
+ dataService.deleteCrossPoint(leftEdge1.vectorId, leftEdge2.vectorId);
|
|
|
+ } else {
|
|
|
+ //需要考虑控制点CrossPointService
|
|
|
+ crossPointService.update(
|
|
|
+ newEdgePoint1,
|
|
|
+ endPoint1,
|
|
|
+ newEdgePoint1,
|
|
|
+ leftEdge1,
|
|
|
+ leftEdge2,
|
|
|
+ "end",
|
|
|
+ "end"
|
|
|
+ );
|
|
|
+ }
|
|
|
} else {
|
|
|
//console.log("情况8");
|
|
|
mathUtil.clonePoint(rightEdge1.end, newEdgePoint2);
|
|
|
mathUtil.clonePoint(leftEdge2.end, newEdgePoint2);
|
|
|
|
|
|
- crossPointService.update(
|
|
|
- newEdgePoint2,
|
|
|
- endPoint1,
|
|
|
- newEdgePoint2,
|
|
|
- rightEdge1,
|
|
|
- leftEdge2,
|
|
|
- "end",
|
|
|
- "end"
|
|
|
- );
|
|
|
+ if (angle > Constant.maxAngle || angle < Constant.minAngle) {
|
|
|
+ //要删除控制点
|
|
|
+ dataService.deleteCrossPoint(rightEdge1.vectorId, leftEdge2.vectorId);
|
|
|
+ } else {
|
|
|
+ //需要考虑控制点CrossPointService
|
|
|
+ crossPointService.update(
|
|
|
+ newEdgePoint2,
|
|
|
+ endPoint1,
|
|
|
+ newEdgePoint2,
|
|
|
+ rightEdge1,
|
|
|
+ leftEdge2,
|
|
|
+ "end",
|
|
|
+ "end"
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
return true;
|
|
|
} else {
|