|
@@ -19,7 +19,6 @@ export default class MovePoint {
|
|
} else if (point.getCategory() == VectorCategory.Point.BasePoint) {
|
|
} else if (point.getCategory() == VectorCategory.Point.BasePoint) {
|
|
this.updateBasePoint(pointId);
|
|
this.updateBasePoint(pointId);
|
|
} else {
|
|
} else {
|
|
-
|
|
|
|
let parent = point.getParent();
|
|
let parent = point.getParent();
|
|
for (let key in parent) {
|
|
for (let key in parent) {
|
|
let line = dataService.getLine(key);
|
|
let line = dataService.getLine(key);
|
|
@@ -39,6 +38,28 @@ export default class MovePoint {
|
|
}
|
|
}
|
|
|
|
|
|
finish(pointId) {
|
|
finish(pointId) {
|
|
|
|
+ // if (
|
|
|
|
+ // pointId &&
|
|
|
|
+ // listenLayer.modifyPoint &&
|
|
|
|
+ // listenLayer.modifyPoint.linkedPointId
|
|
|
|
+ // ) {
|
|
|
|
+ // let linkedPoint = dataService.getPoint(
|
|
|
|
+ // listenLayer.modifyPoint.linkedPointId
|
|
|
|
+ // );
|
|
|
|
+ // const category = linkedPoint.getCategory();
|
|
|
|
+ // if (
|
|
|
|
+ // category != VectorCategory.Point.BasePoint &&
|
|
|
|
+ // category != VectorCategory.Point.TestBasePoint &&
|
|
|
|
+ // category != VectorCategory.Point.TestPoint
|
|
|
|
+ // ) {
|
|
|
|
+ // pointService.mergePoint(pointId, listenLayer.modifyPoint.linkedPointId);
|
|
|
|
+ // Settings.selectBasePointId = null;
|
|
|
|
+ // } else if (category == VectorCategory.Point.BasePoint) {
|
|
|
|
+ // Settings.selectBasePointId = pointId;
|
|
|
|
+ // } else {
|
|
|
|
+ // Settings.selectBasePointId = null;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
if (
|
|
if (
|
|
pointId &&
|
|
pointId &&
|
|
listenLayer.modifyPoint &&
|
|
listenLayer.modifyPoint &&
|
|
@@ -55,10 +76,17 @@ export default class MovePoint {
|
|
) {
|
|
) {
|
|
pointService.mergePoint(pointId, listenLayer.modifyPoint.linkedPointId);
|
|
pointService.mergePoint(pointId, listenLayer.modifyPoint.linkedPointId);
|
|
Settings.selectBasePointId = null;
|
|
Settings.selectBasePointId = null;
|
|
- } else if (category == VectorCategory.Point.BasePoint) {
|
|
|
|
- Settings.selectBasePointId = pointId;
|
|
|
|
} else {
|
|
} else {
|
|
- Settings.selectBasePointId = null;
|
|
|
|
|
|
+ let point = dataService.getPoint(pointId);
|
|
|
|
+ const parent = point.getParent();
|
|
|
|
+ for (let key in parent) {
|
|
|
|
+ let line = dataService.getLine(key);
|
|
|
|
+ let startPoint = dataService.getPoint(line.startId);
|
|
|
|
+ let endPoint = dataService.getPoint(line.endId);
|
|
|
|
+ if (mathUtil.getDistance(startPoint, endPoint) == 0) {
|
|
|
|
+ pointService.deletePoint(pointId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -132,14 +160,20 @@ export default class MovePoint {
|
|
let startPoint = dataService.getPoint(positionLine.startId);
|
|
let startPoint = dataService.getPoint(positionLine.startId);
|
|
let endPoint = dataService.getPoint(positionLine.endId);
|
|
let endPoint = dataService.getPoint(positionLine.endId);
|
|
let positionLineGeometry = mathUtil.createLine1(startPoint, endPoint);
|
|
let positionLineGeometry = mathUtil.createLine1(startPoint, endPoint);
|
|
|
|
+ if (!positionLineGeometry) {
|
|
|
|
+ let lineGeometry = dataService.getLine(Settings.baseLineId);
|
|
|
|
+ let baseStartPoint = dataService.getPoint(lineGeometry.startId);
|
|
|
|
+ let baseEndPoint = dataService.getPoint(lineGeometry.endId);
|
|
|
|
+ let baseLine = mathUtil.createLine1(baseStartPoint, baseEndPoint);
|
|
|
|
+ positionLineGeometry = mathUtil.createLine3(baseLine, testPoint);
|
|
|
|
+ }
|
|
let join = mathUtil.getJoinLinePoint(testPoint, positionLineGeometry);
|
|
let join = mathUtil.getJoinLinePoint(testPoint, positionLineGeometry);
|
|
mathUtil.clonePoint(otherPoint, join);
|
|
mathUtil.clonePoint(otherPoint, join);
|
|
-
|
|
|
|
- if (
|
|
|
|
- mathUtil.getDistance(startPoint, endPoint) < Constant.minAdsorbPix
|
|
|
|
- ) {
|
|
|
|
- pointService.deletePoint(positionLine.startId);
|
|
|
|
- }
|
|
|
|
|
|
+ // if (
|
|
|
|
+ // mathUtil.getDistance(startPoint, endPoint) < Constant.minAdsorbPix
|
|
|
|
+ // ) {
|
|
|
|
+ // pointService.deletePoint(positionLine.startId);
|
|
|
|
+ // }
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|