浏览代码

修复bug

xushiting 2 年之前
父节点
当前提交
f6ac5fc71a
共有 3 个文件被更改,包括 29 次插入45 次删除
  1. 1 1
      server/test/a0k4xu045_202305311600080410/attach/sceneStore
  2. 5 1
      src/graphic/History/HistoryUtil.js
  3. 23 43
      src/graphic/Load.js

文件差异内容过多而无法显示
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 5 - 1
src/graphic/History/HistoryUtil.js

@@ -954,7 +954,11 @@ export default class HistoryUtil {
     curveRoadEdge.vectorId = curveRoadEdgeInfo.vectorId;
     mathUtil.clonePoint(curveRoadEdge.start, curveRoadEdgeInfo.start);
     mathUtil.clonePoint(curveRoadEdge.end, curveRoadEdgeInfo.end);
-    mathUtil.clonePoints(curveRoadEdge.points, curveRoadEdgeInfo.points);
+    for (let i = 0; i < curveRoadEdgeInfo.points.length; ++i) {
+      curveRoadEdge.points[i] = {};
+      mathUtil.clonePoint(curveRoadEdge.points[i], curveRoadEdgeInfo.points[i]);
+    }
+
     curveRoadEdge.curves = JSON.parse(JSON.stringify(curveRoadEdgeInfo.curves));
     curveRoadEdge.type = curveRoadEdgeInfo.type;
     curveRoadEdge.style = curveRoadEdgeInfo.style;

+ 23 - 43
src/graphic/Load.js

@@ -19,6 +19,7 @@ import { uiService } from "./Service/UIService";
 import { crossPointService } from "./Service/CrossPointService.js";
 import Road from "./Geometry/Road.js";
 import { edgeService } from "./Service/EdgeService.js";
+import { curvePointService } from "./Service/CurvePointService.js";
 
 export default class Load {
   constructor(layer) {
@@ -152,52 +153,31 @@ export default class Load {
           }
         }
       }
-      // if (dataLocal.curvelines) {
-      //   for (let key in dataLocal.curvelines) {
-      //     let startPointId = dataLocal.curvelines[key].startId
-      //     let endPointId = dataLocal.curvelines[key].endId
 
-      //     let startPosition = null;
-      //     let endPosition = null ;
-      //     if(dataLocal.curvePoints){
-      //       startPosition ={
-      //         x:dataLocal.curvePoints[startPointId].x,
-      //         y:dataLocal.curvePoints[startPointId].y,
-      //       }
-      //       endPosition ={
-      //         x:dataLocal.curvePoints[endPointId].x,
-      //         y:dataLocal.curvePoints[endPointId].y,
-      //       }
-
-      //     }
+      if (dataLocal.curvePoints) {
+        for (let key in dataLocal.curvePoints) {
+          let curvePointData = dataLocal.curvePoints[key];
+          let curvePoint = curvePointService.create(
+            curvePointData,
+            curvePointData.vectorId
+          );
+          curvePoint.setIndex(curvePointData.index);
+          curvePoint.setPointParent(curvePointData.parent);
+          dataService.addCurvePoint(curvePoint);
+        }
+      }
 
-      //     let curveline = lineService.createCurveLine(
-      //       startPosition,
-      //       endPosition,
-      //       dataLocal.curvelines[key].vectorId,
-      //     );
+      if (dataLocal.curvelines) {
+        for (let key in dataLocal.curvelines) {
+          let curveLineData = dataLocal.curvelines[key];
+          let curveLine = lineService.createCurveLineByPointIds(
+            curveLineData.points,
+            curveLineData.vectorId
+          );
+          dataService.addCurveLine(curveLine);
+        }
+      }
 
-      //     if (dataLocal.curvelines[key].style) {
-      //       curveline.setStyle(dataLocal.curvelines[key].style);
-      //     }
-      //     if (dataLocal.curvelines[key].weight) {
-      //       curveline.setWeight(dataLocal.curvelines[key].weight);
-      //     }
-      //     if (dataLocal.curvelines[key].color) {
-      //       curveline.setColor(dataLocal.curvelines[key].color);
-      //     }
-      //     if (dataLocal.curvelines[key].value) {
-      //       curveline.setValue(dataLocal.curvelines[key].value);
-      //     }
-      //     if (dataLocal.curvelines[key].locationMode) {
-      //       curveline.setLocationMode(dataLocal.curvelines[key].locationMode);
-      //     }
-      //     curveline.setDisplay(dataLocal.curvelines[key].display);
-      //     if (curveline.getCategory() == VectorCategory.Line.BaseLine) {
-      //       Settings.baseLineId = key;
-      //     }
-      //   }
-      // }
       if (dataLocal.roadPoints) {
         for (let key in dataLocal.roadPoints) {
           roadPointService.create(