瀏覽代碼

adjustment in the line model to build the .geo file

Victor Luiz Domingues 4 年之前
父節點
當前提交
df10f01db0

+ 2 - 1
src/app/components/line-component/models/line-model.js

@@ -15,7 +15,8 @@ export class LineModel extends LineSegmentModel {
     const pointA = list.find(x => x.id === pointAId);
     const pointB = list.find(x => x.id === pointBId);
     const label = map.get("label")[0];
-    return new LineModel(pointA, pointB, label, id);
+    const line = new LineModel(pointA, pointB, label, id);
+    return line;
   }
 }
 

+ 3 - 0
src/app/core/enums/elements-class-enum.js

@@ -40,7 +40,10 @@ export function fromCodeToClass(code) {
       return ELEMENTS_CLASS.LINE_SEGMENT;
     case 3:
       return ELEMENTS_CLASS.CIRCUMFERENCE;
+    case 4:
+      return ELEMENTS_CLASS.LINE;
     default:
+      console.error("Tipo não suportado" + "\"" + code + "\"", code)
       return ELEMENTS_CLASS.POINT;
   }
 }

+ 7 - 0
src/app/core/parser/parser-orchestrator.js

@@ -5,6 +5,7 @@ import { LineSegmentModel } from "../../components/line-segment-component/models
 import { IntersectionModel } from "../../components/intersection-component/models/intersection-model";
 import { menu } from "../application/menu";
 import { label as Label } from '../../component-registry/label';
+import { LineModel } from "../../components/line-component/models/line-model";
 export class ParserOrchestrator {
 
   constructor(mapArr) {
@@ -32,6 +33,9 @@ export class ParserOrchestrator {
       case ELEMENTS_CLASS.LINE_SEGMENT:
         object = LineSegmentModel.do(map, this.list);
         break;
+      case ELEMENTS_CLASS.LINE:
+        object = LineModel.do(map, this.list);
+        break;
       default:
         break;
 
@@ -65,6 +69,9 @@ export class ParserOrchestrator {
       case ELEMENTS_CLASS.LINE_SEGMENT:
         drawer = this.getDrawer(ELEMENTS_CLASS.LINE_SEGMENT)
         break;
+      case ELEMENTS_CLASS.LINE:
+        drawer = this.getDrawer(ELEMENTS_CLASS.LINE)
+        break;
       default:
         break;
     }