|
@@ -18,8 +18,10 @@ import { historyService } from "./Service/HistoryService.js";
|
|
import { uiService } from "./Service/UIService";
|
|
import { uiService } from "./Service/UIService";
|
|
import { crossPointService } from "./Service/CrossPointService.js";
|
|
import { crossPointService } from "./Service/CrossPointService.js";
|
|
import Road from "./Geometry/Road.js";
|
|
import Road from "./Geometry/Road.js";
|
|
|
|
+import CurveRoad from "./Geometry/CurveRoad.js";
|
|
import { edgeService } from "./Service/EdgeService.js";
|
|
import { edgeService } from "./Service/EdgeService.js";
|
|
import { curvePointService } from "./Service/CurvePointService.js";
|
|
import { curvePointService } from "./Service/CurvePointService.js";
|
|
|
|
+import { curveEdgeService } from "./Service/CurveEdgeService.js";
|
|
|
|
|
|
export default class Load {
|
|
export default class Load {
|
|
constructor(layer) {
|
|
constructor(layer) {
|
|
@@ -248,16 +250,63 @@ export default class Load {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (dataLocal.curveRoadEdges) {
|
|
|
|
+ for (let key in dataLocal.curveRoadEdges) {
|
|
|
|
+ let curveRoadEdgeData = dataLocal.curveRoadEdges[key];
|
|
|
|
+ let curveRoadEdge = curveEdgeService.create(
|
|
|
|
+ curveRoadEdgeData.start,
|
|
|
|
+ curveRoadEdgeData.end,
|
|
|
|
+ curveRoadEdgeData.vectorId,
|
|
|
|
+ curveRoadEdgeData.parentId,
|
|
|
|
+ curveRoadEdgeData.points
|
|
|
|
+ );
|
|
|
|
+ curveRoadEdge.setStyle(curveRoadEdgeData.style);
|
|
|
|
+ curveRoadEdge.setWeight(curveRoadEdgeData.weight);
|
|
|
|
+ curveEdgeService.setCurves(curveRoadEdge);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (dataLocal.curveRoads) {
|
|
if (dataLocal.curveRoads) {
|
|
for (let key in dataLocal.curveRoads) {
|
|
for (let key in dataLocal.curveRoads) {
|
|
- console.log(dataLocal.curveRoads[key].points);
|
|
|
|
- console.log(
|
|
|
|
- mathUtil.getCurvesByPoints(dataLocal.curveRoads[key].points, 0.2)
|
|
|
|
|
|
+ let curveRoadData = dataLocal.curveRoads[key];
|
|
|
|
+ let curveRoad = new CurveRoad(
|
|
|
|
+ curveRoadData.startId,
|
|
|
|
+ curveRoadData.endId,
|
|
|
|
+ curveRoadData.vectorId
|
|
|
|
+ );
|
|
|
|
+ dataService.addCurveRoad(curveRoad);
|
|
|
|
+
|
|
|
|
+ curveRoad.leftEdgeId = curveRoadData.leftEdgeId;
|
|
|
|
+ curveRoad.rightEdgeId = curveRoadData.rightEdgeId;
|
|
|
|
+
|
|
|
|
+ curveRoad.points = [];
|
|
|
|
+ for (let i = 0; i < curveRoadData.points.length; ++i) {
|
|
|
|
+ curveRoad.points[i] = dataService.getCurvePoint(
|
|
|
|
+ curveRoadData.points[i].vectorId
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ curveRoad.curves = JSON.parse(JSON.stringify(curveRoadData.curves));
|
|
|
|
+ curveRoad.way = curveRoadData.way;
|
|
|
|
+ curveRoad.singleCurveRoadWidth = curveRoadData.singleCurveRoadWidth;
|
|
|
|
+ curveRoad.singleCurveRoadDrivewayCount =
|
|
|
|
+ curveRoadData.singleCurveRoadDrivewayCount;
|
|
|
|
+ curveRoad.singleLanesCurves = JSON.parse(
|
|
|
|
+ JSON.stringify(curveRoadData.singleLanesCurves)
|
|
);
|
|
);
|
|
- let curveRoad = curveRoadService.create(
|
|
|
|
- dataLocal.curveRoads[key].startId,
|
|
|
|
- dataLocal.curveRoads[key].endId,
|
|
|
|
- dataLocal.curveRoads[key].vectorId
|
|
|
|
|
|
+ curveRoad.leftWidth = curveRoadData.leftWidth;
|
|
|
|
+ curveRoad.rightWidth = curveRoadData.rightWidth;
|
|
|
|
+ curveRoad.leftDrivewayCount = curveRoadData.leftDrivewayCount;
|
|
|
|
+ curveRoad.rightDrivewayCount = curveRoadData.rightDrivewayCount;
|
|
|
|
+ curveRoad.midDivide = JSON.parse(
|
|
|
|
+ JSON.stringify(curveRoadData.midDivide)
|
|
|
|
+ );
|
|
|
|
+ curveRoad.leftLanesCurves = JSON.parse(
|
|
|
|
+ JSON.stringify(curveRoadData.leftLanesCurves)
|
|
|
|
+ );
|
|
|
|
+ curveRoad.rightLanesCurves = JSON.parse(
|
|
|
|
+ JSON.stringify(curveRoadData.rightLanesCurves)
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -293,6 +342,7 @@ export default class Load {
|
|
text.setAngle(dataLocal.texts[key].angle || 0);
|
|
text.setAngle(dataLocal.texts[key].angle || 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
if (dataLocal.hasOwnProperty("currentId")) {
|
|
if (dataLocal.hasOwnProperty("currentId")) {
|
|
dataService.setCurrentId(dataLocal.currentId);
|
|
dataService.setCurrentId(dataLocal.currentId);
|
|
}
|
|
}
|