Browse Source

Merge remote-tracking branch 'origin/master'

bill 2 years ago
parent
commit
29da67088b

File diff suppressed because it is too large
+ 1 - 1
server/test/SS-t-P1d6CwREny2/attach/sceneStore


+ 5 - 1
src/graphic/Controls/MoveCircle.js

@@ -17,7 +17,11 @@ export default class MoveCircle {
   movePoint(position, circleId, pointIndex) {
     let circle = dataService.getCircle(circleId);
     let flag = this.check(position, circle.center, pointIndex);
-    let radius = mathUtil.getDistance(circle.center, position);
+
+    let line = mathUtil.createLine1(circle.center, circle.points[pointIndex]);
+    let join = mathUtil.getJoinLinePoint(position, line);
+
+    let radius = mathUtil.getDistance(circle.center, join) / Math.sqrt(2);
     //没有超出界
     if (flag && radius > Constant.minAdsorbPix) {
       circle.setRadius(radius);

+ 27 - 40
src/graphic/Load.js

@@ -65,46 +65,33 @@ export default class Load {
           text.setDisplay(dataLocal.texts[key].display);
         }
       }
-      // if (data3d.baseLines) {
-      //   for (let i = 0; i < data3d.baseLines.length; ++i) {
-      //     //理论上基准线只能有一条
-      //     lineService.create(
-      //       data3d.baseLines[i][0],
-      //       data3d.baseLines[i][1],
-      //       VectorCategory.Line.BaseLine
-      //     );
-      //   }
-      // }
-      // if (data3d.measures) {
-      //   for (let i = 0; i < data3d.measures.length; ++i) {
-      //     //理论上基准线只能有一条
-      //     lineService.create(
-      //       data3d.measures[i][0],
-      //       data3d.measures[i][1],
-      //       VectorCategory.Line.MeasureLine
-      //     );
-      //   }
-      // }
-      // if (data3d.basePoints) {
-      //   for (let i = 0; i < data3d.basePoints.length; ++i) {
-      //     let point = pointService.create(
-      //       data3d.basePoints[i],
-      //       data3d.basePoints[i].category,
-      //       data3d.basePoints[i].vectorId
-      //     );
-      //     point.setParent(data3d.basePoints[i].parent);
-      //   }
-      // }
-      // if (data3d.fixPoints) {
-      //   for (let i = 0; i < data3d.fixPoints.length; ++i) {
-      //     let point = pointService.create(
-      //       data3d.fixPoints[i],
-      //       data3d.fixPoints[i].category,
-      //       data3d.fixPoints[i].vectorId
-      //     );
-      //     point.setParent(data3d.fixPoints[i].parent);
-      //   }
-      // }
+      if (dataLocal.points) {
+        for (let key in dataLocal.points) {
+          let point = pointService.create(
+            { x: dataLocal.points[key].x, y: dataLocal.points[key].y },
+            dataLocal.points[key].category,
+            key
+          );
+          point.setParent(
+            JSON.parse(JSON.stringify(dataLocal.points[key].parent))
+          );
+          point.setDisplay(dataLocal.points[key].display);
+        }
+      }
+      if (dataLocal.lines) {
+        for (let key in dataLocal.lines) {
+          let line = lineService.createByPointId(
+            dataLocal.lines[key].startId,
+            dataLocal.lines[key].endId,
+            dataLocal.lines[key].category,
+            key
+          );
+          if (dataLocal.lines[key].arrowColor) {
+            line.setArrowColor(dataLocal.lines[key].arrowColor);
+          }
+          line.setDisplay(dataLocal.lines[key].display);
+        }
+      }
     }
     if (data3d) {
       if (data3d.backImage) {