|
@@ -7,6 +7,7 @@ import { mathUtil } from "../Util/MathUtil";
|
|
|
import addLine from "./AddLine";
|
|
|
import Settings from "../Settings";
|
|
|
import { stateService } from "../Service/StateService";
|
|
|
+import LayerEvents from "../enum/LayerEvents";
|
|
|
import VectorType from "../enum/VectorType";
|
|
|
import Constant from "../Constant";
|
|
|
import { listenLayer } from "../ListenLayer";
|
|
@@ -29,6 +30,7 @@ export default class AddPoint {
|
|
|
newPoint = pointService.create(position);
|
|
|
this.setLocationByAngle(newPoint.vectorId);
|
|
|
newPoint.setLocationMode(Constant.angleLocationMode);
|
|
|
+ stateService.setEventName(LayerEvents.AddPoint);
|
|
|
} else if (
|
|
|
Settings.selectBasePointId != null &&
|
|
|
Settings.locationMode == Constant.allLocationMode
|
|
@@ -36,6 +38,7 @@ export default class AddPoint {
|
|
|
newPoint = pointService.create(position);
|
|
|
this.setLocationByAll(newPoint.vectorId);
|
|
|
newPoint.setLocationMode(Constant.allLocationMode);
|
|
|
+ stateService.setEventName(LayerEvents.AddPoint);
|
|
|
} else if (Settings.locationMode == Constant.normalLocationMode) {
|
|
|
newPoint = pointService.create(position);
|
|
|
this.setLocationByNormal(newPoint.vectorId);
|
|
@@ -49,7 +52,8 @@ export default class AddPoint {
|
|
|
}
|
|
|
if (
|
|
|
newPoint &&
|
|
|
- newPoint.getLocationMode() == Constant.allLocationMode &&
|
|
|
+ (newPoint.getLocationMode() == Constant.allLocationMode ||
|
|
|
+ newPoint.getLocationMode() == Constant.angleLocationMode) &&
|
|
|
newPoint.getCategory() == VectorCategory.Point.TestPoint
|
|
|
) {
|
|
|
this.testPointIds.push(newPoint.vectorId);
|
|
@@ -171,6 +175,13 @@ export default class AddPoint {
|
|
|
VectorCategory.Line.PositionLine
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ deleteTestPoints() {
|
|
|
+ for (let i = 0; i < this.testPointIds.length; ++i) {
|
|
|
+ pointService.deletePoint(this.testPointIds[i]);
|
|
|
+ }
|
|
|
+ this.testPointIds = [];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const addPoint = new AddPoint();
|