xushiting hace 2 años
padre
commit
e787e47272

+ 33 - 34
src/graphic/CanvasStyle/default.js

@@ -6,44 +6,43 @@ const Road = {
   //   strokeStyle: "rgba(255,0,0,0.5)",
   //   fillStyle: "rgba(255,0,0,0.8)",
   // },
-}
+};
 
 const RoadEdge = {
   ...Road,
   lineWidth: 1,
   strokeStyle: "#000",
-}
+};
 
 const Lane = {
   ...RoadEdge,
   lineWidth: 1,
   strokeStyle: "#000",
-  dash: [8, 8]
-}
+  dash: [8, 8],
+};
 
 const CurveRoad = {
   ...Road,
   lineWidth: 1,
-}
+};
 
 const CurveRoadEdge = {
   ...CurveRoad,
   ...RoadEdge,
-}
+};
 
 const CurveLan = {
   ...CurveRoad,
-  ...Lane
-}
+  ...Lane,
+};
 
-
-const Tag = {
+const Text = {
   strokeStyle: "rgb(255,255,255,1)",
   fillStyle: "rgb(255,255,255,1)",
   strokeStyle_adding: "rgba(243, 255, 0, 0.8)",
   fillStyle_adding: "rgba(243, 255, 0, 0.8)",
   lineWidth: 1,
-}
+};
 
 const CanvasFont = {
   font: "14px Microsoft YaHei",
@@ -53,73 +52,73 @@ const CanvasFont = {
   textBaseline: "middle",
   miterLimit: 10,
   direction: "ltr",
-}
+};
 
 const Point = {
   strokeStyle: "#3290FF",
   fillStyle: "#fff",
   radius: 4,
   lineWidth: 4,
-}
+};
 
 const RoadPoint = {
-  ...Point
-}
+  ...Point,
+};
 
 const CurveRoadPoint = {
-  ...Point
-}
+  ...Point,
+};
 
 const ControlPoint = {
   ...Point,
   strokeStyle: "#3290FF",
-  radius: 8
-}
+  radius: 8,
+};
 
 const Text = {
-  ...Tag,
+  ...Text,
   ...CanvasFont,
   font: "12px Microsoft YaHei",
   fillStyle: "rgba(0,0,0,0.7)",
   strokeStyle: "rgba(0,0,0,0.7)",
-}
+};
 
 const Measure = {
   txt: "rgba(255,255,255,1)", //画墙/选墙的时候 测量值的颜色
   strokeStyle: "rgba(255,255,255,1)",
   lineWidth: 1,
-}
+};
 
 const Element = {
   AddingPoint: {
     radius: 4,
-      fillStyle: "yellow",
-      strokeStyle: "green",
+    fillStyle: "yellow",
+    strokeStyle: "green",
   },
   NewRoad: {
     lineWidth: 4,
-      strokeStyle: "rgba(100,100,100,0.3)",
-      errorStrokeStyle: "rgb(250,63,72,0.3)",
+    strokeStyle: "rgba(100,100,100,0.3)",
+    errorStrokeStyle: "rgb(250,63,72,0.3)",
   },
   CheckLinesX: {
     lineWidth: 2,
-      strokeStyle: "#CED806",
+    strokeStyle: "#CED806",
   },
   CheckLinesY: {
     lineWidth: 2,
-      strokeStyle: "#CED806",
+    strokeStyle: "#CED806",
   },
   VCheckLinesX: {
     lineWidth: 2,
-      strokeStyle: "#CED806",
+    strokeStyle: "#CED806",
     //strokeStyle: 'rgba(100,149,237,0.5)',
   },
   VCheckLinesY: {
     lineWidth: 2,
-      strokeStyle: "#CED806",
+    strokeStyle: "#CED806",
     //strokeStyle: 'rgba(100,149,237,0.5)',
   },
-}
+};
 
 export default {
   Road,
@@ -129,7 +128,7 @@ export default {
   Lane,
   CurveLan,
   Point,
-  Tag,
+  Text,
   ControlPoint,
   CurveRoadPoint,
   Text,
@@ -137,5 +136,5 @@ export default {
   Measure,
   Element,
   RoadPoint,
-  bgColor: "#fff"
-}
+  bgColor: "#fff",
+};

+ 20 - 0
src/graphic/Controls/AddCircle.js

@@ -0,0 +1,20 @@
+import { mathUtil } from "../Util/MathUtil";
+
+export default class AddCircle {
+  constructor() {
+    this.center = null;
+    this.radius = null;
+  }
+
+  setCenter(value) {
+    this.center = {};
+    mathUtil.clonePoint(this.center, value);
+  }
+
+  setRadius(value) {
+    this.radius = value;
+  }
+}
+
+const addCircle = new AddCircle();
+export { addCircle };

+ 4 - 4
src/graphic/Controls/AddLine.js

@@ -15,8 +15,8 @@ export default class AddLine {
           x: pointInfo.x,
           y: pointInfo.y,
         },
-        linkedRoadPointId: pointInfo.linkedRoadPointId,
-        linkedRoadId: pointInfo.linkedRoadId,
+        linkedPointId: pointInfo.linkedPointId,
+        lineId: pointInfo.lineId,
       };
     } else if (dir == "end") {
       this.endInfo = {
@@ -24,8 +24,8 @@ export default class AddLine {
           x: pointInfo.x,
           y: pointInfo.y,
         },
-        linkedRoadPointId: pointInfo.linkedRoadPointId,
-        linkedRoadId: pointInfo.linkedRoadId,
+        linkedPointId: pointInfo.linkedPointId,
+        lineId: pointInfo.lineId,
       };
     }
   }

+ 2 - 2
src/graphic/Controls/UIControl.js

@@ -72,12 +72,12 @@ export default class UIControl {
           stateService.setEventName(LayerEvents.AddCurveRoad);
         } else if (selectUI == UIEvents.Line) {
           stateService.setEventName(LayerEvents.AddLine);
+        } else if (selectUI == UIEvents.Circle) {
+          stateService.setEventName(LayerEvents.AddCircle);
         } else if (selectUI == UIEvents.Text) {
           stateService.setEventName(LayerEvents.AddText);
         } else if (selectUI == UIEvents.Img) {
           stateService.setEventName(LayerEvents.Img);
-        } else if (selectUI == UIEvents.AddMeasureLine) {
-          stateService.setEventName(LayerEvents.AddMeasureLine);
         }
       }
     }

+ 14 - 9
src/graphic/Layer.js

@@ -10,6 +10,7 @@ import UIControl from "./Controls/UIControl";
 import { moveText } from "./Controls/MoveText";
 import { addRoad } from "./Controls/AddRoad";
 import { addLine } from "./Controls/AddLine";
+import { addCircle } from "./Controls/AddCircle";
 import { moveRoad } from "./Controls/MoveRoad";
 import { coordinate } from "./Coordinate";
 import Render from "./Renderer/Render";
@@ -120,6 +121,10 @@ export default class Layer {
         stateService.setEventName(LayerEvents.AddingLine);
         addLine.setNewLinePoint("start", position);
         break;
+      case LayerEvents.AddCircle:
+        stateService.setEventName(LayerEvents.AddingCircle);
+        addCircle.setCenter(position);
+        break;
     }
     stateService.setDraggingItem(selectItem);
     // 清除上一个状态
@@ -211,12 +216,12 @@ export default class Layer {
           };
         }
 
-        elementService.hideAll();
+        elementService.execute(addLine.startInfo.position, position);
         elementService.setPoint(position);
-        elementService.showPoint();
-        if (listenLayer.modifyPoint) {
-          elementService.execute(listenLayer.modifyPoint, position);
-        }
+        elementService.setNewRoad(addLine.startInfo.position, position);
+        elementService.showNewRoad();
+
+        addLine.setNewLinePoint("end", position);
         break;
       case LayerEvents.AddingRoad:
         needAutoRedraw = true;
@@ -854,10 +859,10 @@ export default class Layer {
       // }
       else if (eventName == LayerEvents.AddingCurveRoad) {
         stateService.setEventName(LayerEvents.AddCurveRoad);
-      } else if (eventName == LayerEvents.AddMeasureLine) {
-        stateService.setEventName(LayerEvents.AddingMeasureLine);
-      } else if (eventName == LayerEvents.AddingMeasureLine) {
-        stateService.setEventName(LayerEvents.AddMeasureLine);
+      } else if (eventName == LayerEvents.AddLine) {
+        stateService.setEventName(LayerEvents.AddingLine);
+      } else if (eventName == LayerEvents.AddingLine) {
+        stateService.setEventName(LayerEvents.AddLine);
       } else {
         stateService.clearEventName();
       }

+ 0 - 7
src/graphic/Renderer/Render.js

@@ -79,13 +79,6 @@ export default class Render {
       this.drawElement(elementService.newRoad);
     }
 
-    if (
-      elementService.newMeasureLine &&
-      elementService.newMeasureLine.display
-    ) {
-      this.drawElement(elementService.newMeasureLine);
-    }
-
     if (elementService.checkLines.X && elementService.checkLines.X.display) {
       this.drawElement(elementService.checkLines.X);
     }

+ 3 - 14
src/graphic/Service/ElementService.js

@@ -8,14 +8,13 @@ import Constant from "../Constant";
 import { dataService } from "./DataService.js";
 import { mathUtil } from "../Util/MathUtil";
 import { coordinate } from "../Coordinate.js";
-import { edgeService } from "./EdgeService.js";
 import SimpleLine from "../Geometry/SimpleLine.js";
 
 export class ElementService {
   constructor() {
     this.point = null;
 
-    this.newMeasureLine = null;
+    this.newLine = null;
     this.newRoad = null;
 
     this.checkLines = {
@@ -41,9 +40,8 @@ export class ElementService {
     this.newLine.setCategory(VectorCategory.Line.GuideLine);
     this.newLine.name = ElementEvents.NewLine;
 
-    this.newMeasureLine = new SimpleLine({ x: 0, y: 0 }, { x: 1, y: 1 });
-    this.newLine.setCategory(VectorCategory.Line.MeasureLine);
-    this.newMeasureLine.name = ElementEvents.NewMeasureLine;
+    this.newLine = new SimpleLine({ x: 0, y: 0 }, { x: 1, y: 1 });
+    this.newLine.name = ElementEvents.NewLine;
 
     this.checkLines.X = new SimpleLine({ x: 0, y: 0 }, { x: 1, y: 1 });
     this.newLine.setCategory(VectorCategory.Line.GuideLine);
@@ -207,21 +205,12 @@ export class ElementService {
     this.vCheckLines.Y.setPositions(point1, point2);
   }
 
-  showNewMeasureLine() {
-    this.newMeasureLine.display = true;
-  }
-
-  hideNewMeasureLine() {
-    this.newMeasureLine.display = false;
-  }
-
   hideAll() {
     this.hideCheckLinesX();
     this.hideCheckLinesY();
     this.hidePoint();
     this.hideNewRoad();
     this.hideNewLine();
-    this.hideNewMeasureLine();
     this.hideVCheckLinesX();
     this.hideVCheckLinesY();
   }

+ 0 - 522
src/graphic/Service/MeasureService.js

@@ -1,522 +0,0 @@
-import { dataService } from "./DataService";
-// import { mathUtil } from "../MathUtil.js";
-import { coordinate } from "../Coordinate";
-import Constant from "../Constant";
-
-/*
-1. 所有的点都投影到上下左右四个测量区域并排序
-2. 分别从起点开始向终点一段段画测量线,如果太短(按照像素来)则合并到上一条线段上。确定好当前线段的起始点后,开始画
-*/
-
-export default class MeasureService {
-  constructor() {
-    this.pad = {
-      top: 60,
-      bottom: 60,
-      left: 265,
-      right: 265,
-    };
-
-    this.region = {};
-    this.measureLines = {
-      top: [],
-      bottom: [],
-      left: [],
-      right: [],
-    };
-    this.minDis = null;
-    //1 英尺=0.3048 米
-    //this.ftUnit = 0.3048
-    this.unit = "m";
-
-    this.defalutMeasurePad = {
-      bottom: 60,
-      right: 265,
-    };
-  }
-
-  /**
-   * 设置边距
-   * @param {*} config
-   */
-  padding(config = {}) {
-    Object.assign(this.pad, config);
-    Object.assign(this.defalutMeasurePad, config);
-  }
-
-  updatePad(pad) {
-    Object.assign(this.pad, pad);
-  }
-
-  updateRegion(download) {
-    this.region.top = this.pad.top;
-    this.region.bottom = coordinate.height - this.pad.bottom;
-    this.region.left = this.pad.left;
-    this.region.right = coordinate.width - this.pad.right;
-    // if (download) {   //不能用下面的,因为Constant.cadImg_Height / Constant.ratio和coordinate.height不同
-    //     this.region.bottom = Constant.cadImg_Height / Constant.ratio - this.pad.bottom
-    //     this.region.right = Constant.cadImg_Width / Constant.ratio - this.pad.right
-    // }
-
-    // let leftTop = coordinate.getXYFromScreen({
-    //     x: this.region.left,
-    //     y: this.region.top,
-    // })
-
-    // let rightBottom = coordinate.getXYFromScreen({
-    //     x: this.region.right,
-    //     y: this.region.bottom,
-    // })
-
-    // this.region.top = leftTop.y
-    // this.region.left = leftTop.x
-    // this.region.bottom = rightBottom.y
-    // this.region.right = rightBottom.x
-  }
-
-  //更新测量线
-  update() {
-    if (this.minDis == null) {
-      this.minDis = 100 / coordinate.res;
-    }
-    let tops = [];
-    let bottoms = [];
-    let lefts = [];
-    let rights = [];
-    let measurePoints = [];
-
-    let data = dataService.getFloorData();
-    if (!data) {
-      return;
-    }
-
-    const points = dataService.getRoadPoints();
-    for (let key in points) {
-      const point = points[key];
-      measurePoints.push({
-        x: point.x,
-        y: point.y,
-      });
-    }
-
-    function sortNumber_topbottom(a, b) {
-      return b.y - a.y;
-    }
-
-    function sortNumber_leftright(a, b) {
-      return a.x - b.x;
-    }
-
-    tops = [].concat(measurePoints).sort(sortNumber_topbottom.bind(this));
-    bottoms = [].concat(tops);
-    bottoms.reverse();
-    lefts = [].concat(measurePoints).sort(sortNumber_leftright.bind(this));
-    rights = [].concat(lefts);
-    rights.reverse();
-
-    let start = null;
-    let end = null;
-
-    this.measureLines.top = [];
-    for (let i = 0; i < tops.length; ++i) {
-      if (i == 0) {
-        start = tops[0].x;
-        end = tops[0].x;
-        this.measureLines.top.push({
-          x: tops[0].x,
-          y: this.region.top,
-        });
-      } else {
-        if (tops[i].x >= start && tops[i].x <= end) {
-          continue;
-        } else {
-          start = Math.min(start, tops[i].x);
-          end = Math.max(end, tops[i].x);
-          if (start != end) {
-            this.measureLines.top.push({
-              x: tops[i].x,
-              y: this.region.top,
-            });
-          }
-        }
-      }
-    }
-    tops = this.measureLines.top.sort(sortNumber_leftright.bind(this));
-    this.measureLines.top = [];
-    this.measureLines.top.push(tops[0]);
-    for (let i = 0; i < tops.length - 1; ++i) {
-      start = tops[i];
-      end = null;
-      for (let j = i + 1; j < tops.length; ++j) {
-        end = tops[j];
-        if (Math.abs(start.x - end.x) < this.minDis) {
-          end = null;
-          ++i;
-          continue;
-        } else {
-          break;
-        }
-      }
-      if (end != null) {
-        this.measureLines.top.push(end);
-      } else if (i == tops.length - 1) {
-        let len = this.measureLines.top.length;
-        this.measureLines.top[len - 1] = tops[i];
-        break;
-      }
-    }
-
-    this.measureLines.bottom = [];
-    for (let i = 0; i < bottoms.length; ++i) {
-      if (i == 0) {
-        start = bottoms[0].x;
-        end = bottoms[0].x;
-        this.measureLines.bottom.push({
-          x: bottoms[0].x,
-          y: this.region.bottom,
-        });
-      } else {
-        if (bottoms[i].x >= start && bottoms[i].x <= end) {
-          continue;
-        } else {
-          start = Math.min(start, bottoms[i].x);
-          end = Math.max(end, bottoms[i].x);
-          if (start != end) {
-            this.measureLines.bottom.push({
-              x: bottoms[i].x,
-              y: this.region.bottom,
-            });
-          }
-        }
-      }
-    }
-    bottoms = this.measureLines.bottom.sort(sortNumber_leftright.bind(this));
-    this.measureLines.bottom = [];
-    this.measureLines.bottom.push(bottoms[0]);
-    for (let i = 0; i < bottoms.length - 1; ++i) {
-      start = bottoms[i];
-      end = null;
-      for (let j = i + 1; j < bottoms.length; ++j) {
-        end = bottoms[j];
-        if (Math.abs(start.x - end.x) < this.minDis) {
-          end = null;
-          ++i;
-          continue;
-        } else {
-          break;
-        }
-      }
-      if (end != null) {
-        this.measureLines.bottom.push(end);
-      } else if (i == bottoms.length - 1) {
-        let len = this.measureLines.bottom.length;
-        this.measureLines.bottom[len - 1] = bottoms[i];
-        break;
-      }
-    }
-
-    this.measureLines.left = [];
-    for (let i = 0; i < lefts.length; ++i) {
-      if (i == 0) {
-        start = lefts[0].y;
-        end = lefts[0].y;
-        this.measureLines.left.push({
-          x: this.region.left,
-          y: lefts[0].y,
-        });
-      } else {
-        if (lefts[i].y >= start && lefts[i].y <= end) {
-          continue;
-        } else {
-          start = Math.min(start, lefts[i].y);
-          end = Math.max(end, lefts[i].y);
-          if (start != end) {
-            this.measureLines.left.push({
-              x: this.region.left,
-              y: lefts[i].y,
-            });
-          }
-        }
-      }
-    }
-    lefts = this.measureLines.left.sort(sortNumber_topbottom.bind(this));
-    this.measureLines.left = [];
-    this.measureLines.left.push(lefts[0]);
-    for (let i = 0; i < lefts.length - 1; ++i) {
-      start = lefts[i];
-      end = null;
-      for (let j = i + 1; j < lefts.length; ++j) {
-        end = lefts[j];
-        if (Math.abs(start.y - end.y) < this.minDis) {
-          end = null;
-          ++i;
-          continue;
-        } else {
-          break;
-        }
-      }
-      if (end != null) {
-        this.measureLines.left.push(end);
-      } else if (i == lefts.length - 1) {
-        let len = this.measureLines.left.length;
-        this.measureLines.left[len - 1] = lefts[i];
-        break;
-      }
-    }
-
-    this.measureLines.right = [];
-    for (let i = 0; i < rights.length; ++i) {
-      if (i == 0) {
-        start = rights[0].y;
-        end = rights[0].y;
-        this.measureLines.right.push({
-          x: this.region.right,
-          y: rights[0].y,
-        });
-      } else {
-        if (rights[i].y >= start && rights[i].y <= end) {
-          continue;
-        } else {
-          start = Math.min(start, rights[i].y);
-          end = Math.max(end, rights[i].y);
-          if (start != end) {
-            this.measureLines.right.push({
-              x: this.region.right,
-              y: rights[i].y,
-            });
-          }
-        }
-      }
-    }
-    rights = this.measureLines.right.sort(sortNumber_topbottom.bind(this));
-    this.measureLines.right = [];
-    this.measureLines.right.push(rights[0]);
-    for (let i = 0; i < rights.length - 1; ++i) {
-      start = rights[i];
-      end = null;
-      for (let j = i + 1; j < rights.length; ++j) {
-        end = rights[j];
-        if (Math.abs(start.y - end.y) < this.minDis) {
-          end = null;
-          ++i;
-          continue;
-        } else {
-          break;
-        }
-      }
-      if (end != null) {
-        this.measureLines.right.push(end);
-      } else if (i == rights.length - 1) {
-        let len = this.measureLines.right.length;
-        this.measureLines.right[len - 1] = rights[i];
-        break;
-      }
-    }
-  }
-
-  /*
-    update() {
-        let tops = []
-        let bottoms = []
-        let lefts = []
-        let rights = []
-
-        let minX = coordinate.center.x;
-        let minY = coordinate.center.y;
-        let maxX = coordinate.center.x;
-        let maxY = coordinate.center.y;
-
-        const points = dataService.getRoadPoints()
-        for (let key in points) {
-            const point = points[key]
-            if(point.y > coordinate.center.y){
-                tops.push({
-                    x: point.x,
-                    y: this.region.top,
-                })
-            }
-            else{
-                bottoms.push({
-                    x:point.x,
-                    y:this.region.bottom
-                })
-            }
-
-            if(point.x<coordinate.center.x){
-                lefts.push({
-                    x: this.region.left,
-                    y: point.y,
-                })
-            }
-            else{
-                rights.push({
-                    x:this.region.right,
-                    y:point.y
-                })
-            }
-
-            if(minX>point.x){
-                minX = point.x
-            }
-            if(maxX<point.x){
-                maxX = point.x
-            }
-
-            if(minY>point.y){
-                minY = point.y
-            }
-            if(maxY<point.y){
-                maxY = point.y
-            }
-        }
-
-        tops.unshift({
-            x:minX,
-            y:this.region.top
-        })
-        tops.push({
-            x:maxX,
-            y:this.region.top
-        })
-
-        bottoms.unshift({
-            x:minX,
-            y:this.region.bottom
-        })
-        bottoms.push({
-            x:maxX,
-            y:this.region.bottom
-        })
-
-        lefts.unshift({
-            x:this.region.left,
-            y:maxY
-        })
-        lefts.push({
-            x:this.region.left,
-            y:minY
-        })
-
-        rights.unshift({
-            x:this.region.right,
-            y:maxY
-        })
-        rights.push({
-            x:this.region.right,
-            y:minY
-        })
-
-        function sortNumber_topbottom(a, b) {
-            return a.x - b.x
-        }
-
-        function sortNumber_leftright(a, b) {
-            return b.y - a.y
-        }
-
-        tops = tops.sort(sortNumber_topbottom.bind(this))
-        bottoms = bottoms.sort(sortNumber_topbottom.bind(this))
-        lefts = lefts.sort(sortNumber_leftright.bind(this))
-        rights = rights.sort(sortNumber_leftright.bind(this))
-
-        this.measureLines.top = []
-        this.measureLines.top.push(tops[0])
-        for (let i = 0; i < tops.length - 1; ++i) {
-            let start = tops[i]
-            let end = null
-            for (let j = i + 1; j < tops.length; ++j) {
-                end = tops[j]
-                if (mathUtil.getDistance(start, end) < this.minDis) {
-                    end = null
-                    ++i
-                    continue
-                } else {
-                    break
-                }
-            }
-            if (end != null) {
-                this.measureLines.top.push(end)
-            } else if (i == tops.length - 1) {
-                let len = this.measureLines.top.length
-                this.measureLines.top[len - 1] = tops[i]
-                break
-            }
-        }
-
-        this.measureLines.bottom = []
-        this.measureLines.bottom.push(bottoms[0])
-        for (let i = 0; i < bottoms.length - 1; ++i) {
-            let start = bottoms[i]
-            let end = null
-            for (let j = i + 1; j < bottoms.length; ++j) {
-                end = bottoms[j]
-                if (mathUtil.getDistance(start, end) < this.minDis) {
-                    end = null
-                    ++i
-                    continue
-                } else {
-                    break
-                }
-            }
-            if (end != null) {
-                this.measureLines.bottom.push(end)
-            } else if (i == bottoms.length - 1) {
-                let len = this.measureLines.bottom.length
-                this.measureLines.bottom[len - 1] = bottoms[i]
-                break
-            }
-        }
-
-        this.measureLines.left = []
-        this.measureLines.left.push(lefts[0])
-        for (let i = 0; i < lefts.length - 1; ++i) {
-            let start = lefts[i]
-            let end = null
-            for (let j = i + 1; j < lefts.length; ++j) {
-                end = lefts[j]
-                if (mathUtil.getDistance(start, end) < this.minDis) {
-                    end = null
-                    ++i
-                    continue
-                } else {
-                    break
-                }
-            }
-            if (end != null) {
-                this.measureLines.left.push(end)
-            } else if (i == lefts.length - 1) {
-                let len = this.measureLines.left.length
-                this.measureLines.left[len - 1] = lefts[i]
-                break
-            }
-        }
-
-        this.measureLines.right = []
-        this.measureLines.right.push(rights[0])
-        for (let i = 0; i < rights.length - 1; ++i) {
-            let start = rights[i]
-            let end = null
-            for (let j = i + 1; j < rights.length; ++j) {
-                end = rights[j]
-                if (mathUtil.getDistance(start, end) < this.minDis) {
-                    end = null
-                    ++i
-                    continue
-                } else {
-                    break
-                }
-            }
-            if (end != null) {
-                this.measureLines.right.push(end)
-            } else if (i == rights.length - 1) {
-                let len = this.measureLines.right.length
-                this.measureLines.right[len - 1] = rights[i]
-                break
-            }
-        }
-    }
-    */
-}
-
-const measureService = new MeasureService();
-export { measureService };

+ 0 - 1
src/graphic/enum/ElementEvents.js

@@ -2,7 +2,6 @@ const ElementEvents = {
   AddingPoint: "AddingPoint",
   NewRoad: "NewRoad",
   NewLine: "NewLine",
-  NewMeasureLine: "NewMeasureLine",
   CheckLinesX: "CheckLinesX",
   CheckLinesY: "CheckLinesY",
   VCheckLinesX: "vCheckLinesX",

+ 4 - 3
src/graphic/enum/LayerEvents.js

@@ -16,6 +16,10 @@ const LayerEvents = {
   MoveLine: "moveLine",
   MovePoint: "movePoint",
 
+  AddCircle: "addCircle",
+  AddingCircle: "addingCircle",
+  MoveCircle: "moveCircle",
+
   MoveControlPoint: "moveControlPoint",
   MoveEdge: "moveEdge",
   MoveCurveEdge: "moveCurveEdge",
@@ -26,9 +30,6 @@ const LayerEvents = {
   MoveText: "moveText",
 
   Img: "Img",
-  AddMeasureLine: "addMeasureLine",
-  AddingMeasureLine: "addingMeasureLine",
-  MoveMeasureLine: "moveMeasureLine",
   MoveMeasureArrow: "moveMeasureArrow",
 };
 export default LayerEvents;

+ 2 - 24
src/graphic/enum/UIEvents.js

@@ -1,6 +1,8 @@
 const UIEvents = {
   // 画线
   Line: "line",
+  // 画圆
+  Circle: "Circle",
   // 图例
   Img: "backgroundImage",
   // 测量
@@ -147,28 +149,4 @@ const UIEvents = {
   CurveRoad: "curveRoad",
 };
 
-// export const Furnitures = {
-//   TV: UIEvents.TV, //电视
-//   CombinationSofa: UIEvents.CombinationSofa, //组合沙发
-//   SingleSofa: UIEvents.SingleSofa, //单人沙发
-//   TeaTable: UIEvents.TeaTable, //茶几
-//   Carpet: UIEvents.Carpet, //地毯
-//   Plant: UIEvents.Plant, //植物
-//   DiningTable: UIEvents.DiningTable, //餐桌
-//   DoubleBed: UIEvents.DoubleBed, //双人床
-//   SingleBed: UIEvents.SingleBed, //单人床
-//   Wardrobe: UIEvents.Wardrobe, //衣柜
-//   Dresser: UIEvents.Dresser, //梳妆台
-//   BedsideCupboard: UIEvents.BedsideCupboard, //床头柜
-//   Pillow: UIEvents.Pillow, //抱枕
-//   GasStove: UIEvents.GasStove, //燃气灶
-//   Cupboard: UIEvents.Cupboard, //橱柜
-//   Bathtub: UIEvents.Bathtub, //浴缸
-//   Closestool: UIEvents.Closestool, //马桶
-//   Washstand: UIEvents.Washstand, //洗漱台
-//   Desk: UIEvents.Desk, //书桌
-//   BalconyChair: UIEvents.BalconyChair, //阳台椅
-//   Elevator: UIEvents.Elevator, //电梯
-// };
-
 export default UIEvents;