Browse Source

implementation of label of line segment,
improvements in intersection point and intersaction point label,
improvements in the .geo file,
imporovements in select tool and selectable objects,
improvements in label component,
change new default file names

Victor Luiz Domingues 4 years ago
parent
commit
74c76b3ee7

+ 43 - 38
src/app/component-registry/label.js

@@ -1,40 +1,45 @@
-export const label = (function() {
-  const _labels = [
-    "a",
-    "b",
-    "c",
-    "d",
-    "e",
-    "f",
-    "g",
-    "h",
-    "i",
-    "j",
-    "k",
-    "l",
-    "m",
-    "n",
-    "o",
-    "p",
-    "q",
-    "r",
-    "s",
-    "t",
-    "u",
-    "v",
-    "w",
-    "x",
-    "y",
-    "z"
-  ];
-  let _usedLabels = [];
-
-  function _draw() {
-    var label = _labels[_usedLabels.length];
-    _usedLabels.push(label);
+export class Label {
+  constructor() {
+    this._usedUpperLabels = [];
+    this._usedLowerLabels = [];
+  }
+  draw(lower = false) {
+    if (lower) {
+      return this.pushLower();
+    } else {
+      return this.pushUpper();
+    }
+  }
+  pushLower(label) {
+    if (label == undefined) {
+      label = this._generateLabel(this._usedLowerLabels.length + 1);
+      while (this._usedLowerLabels.includes(this.label)) {
+        label = this._generateLabel(this._usedLowerLabels.length + 1);
+      }
+    }
+    this._usedLowerLabels.push(label);
+    return label.toLowerCase();
+  }
+  pushUpper(label) {
+    if (label == undefined) {
+      label = this._generateLabel(this._usedUpperLabels.length + 1);
+      while (this._usedUpperLabels.includes(this.label)) {
+        label = this._generateLabel(this._usedUpperLabels.length + 1);
+      }
+    }
+    this._usedUpperLabels.push(label);
     return label.toUpperCase();
     return label.toUpperCase();
   }
   }
-  return {
-    draw: _draw
-  };
-})();
+  _generateLabel(n) {
+    let label = "";
+    let labelNumber = n;
+    while (labelNumber > 0) {
+      const letterNumber = (labelNumber - 1) % 26;
+      const currentLetter = String.fromCharCode(letterNumber + 65);
+      label = currentLetter + label;
+      labelNumber = (labelNumber - (letterNumber + 1)) / 26;
+    }
+    return label;
+  }
+}
+export const label = new Label();

+ 4 - 1
src/app/components/circumference-component/drawers/circumference-drawer.js

@@ -5,6 +5,7 @@ import { ELEMENTS_CLASS } from "../../../core/enums/elements-class-enum";
 import { selector as Selector } from "../../../core/application/selector";
 import { selector as Selector } from "../../../core/application/selector";
 import { SelectableDrawer } from "../../../core/drawers/selectable-drawer";
 import { SelectableDrawer } from "../../../core/drawers/selectable-drawer";
 import { objects as Objects } from "../../../core/application/objects";
 import { objects as Objects } from "../../../core/application/objects";
+import { label as Label } from "../../../component-registry/label";
 
 
 export class CircumferenceDrawer extends SelectableDrawer {
 export class CircumferenceDrawer extends SelectableDrawer {
   constructor() {
   constructor() {
@@ -80,6 +81,8 @@ export class CircumferenceDrawer extends SelectableDrawer {
     this.center = center;
     this.center = center;
     this.radius = radius;
     this.radius = radius;
     this.circumference = new CircumferenceModel(this.center, this.radius);
     this.circumference = new CircumferenceModel(this.center, this.radius);
+    const label = Label.draw(true);
+    this.circumference.setLabel(label);
     this.createByCircumference(this.circumference);
     this.createByCircumference(this.circumference);
   }
   }
   createByCircumference(circumference) {
   createByCircumference(circumference) {
@@ -117,7 +120,7 @@ export class CircumferenceDrawer extends SelectableDrawer {
       class: ELEMENTS_CLASS.CIRCUMFERENCE,
       class: ELEMENTS_CLASS.CIRCUMFERENCE,
       style: { stroke: "grey", fill: "grey" }
       style: { stroke: "grey", fill: "grey" }
     });
     });
-    SelectableDrawer.setSelectableIfToolChanged(circle);
+    SelectableDrawer.setSelectableIfIntersectionChanged(circle);
     return circle;
     return circle;
   }
   }
   resolveAggregators(points, aggregators, selected) {
   resolveAggregators(points, aggregators, selected) {

+ 2 - 0
src/app/components/circumference-component/models/circumference-model.js

@@ -53,12 +53,14 @@ export class CircumferenceModel extends GeometricObject {
         break;
         break;
     }
     }
   }
   }
+
   distance(center) {
   distance(center) {
     const dx = center.posX - this.center.posX;
     const dx = center.posX - this.center.posX;
     const dy = center.posY - this.center.posY;
     const dy = center.posY - this.center.posY;
     const dist = Math.sqrt(dy * dy + dx * dx);
     const dist = Math.sqrt(dy * dy + dx * dx);
     return dist;
     return dist;
   }
   }
+
   getIntersectionsByCircumference(circumference) {
   getIntersectionsByCircumference(circumference) {
     // if (this.cente().igual(cd.C()))
     // if (this.cente().igual(cd.C()))
     // return null; // duas circ. com mesmo raio => devolva "null" (ambiguidade!)
     // return null; // duas circ. com mesmo raio => devolva "null" (ambiguidade!)

+ 10 - 4
src/app/components/intersection-component/drawers/intersection-drawer.js

@@ -50,7 +50,8 @@ export class IntersectionDrawer extends Drawer {
       } else if (this.state == IntersectionDrawer.SECOND_OBJECT_STATE) {
       } else if (this.state == IntersectionDrawer.SECOND_OBJECT_STATE) {
         this.setSecondObject(e.target);
         this.setSecondObject(e.target);
         this.drawPoint();
         this.drawPoint();
-        this.clear();
+        this.reset();
+        // this.clear();
       }
       }
     }
     }
   }
   }
@@ -81,7 +82,7 @@ export class IntersectionDrawer extends Drawer {
       // if (!intersectionPoint.visible) return;
       // if (!intersectionPoint.visible) return;
       const point = PointDrawer.drawPoint(
       const point = PointDrawer.drawPoint(
         intersectionPoint,
         intersectionPoint,
-        false,
+        true,
         false,
         false,
         true
         true
       );
       );
@@ -123,8 +124,13 @@ export class IntersectionDrawer extends Drawer {
       aggregator.visible = false;
       aggregator.visible = false;
       return;
       return;
     }
     }
-    aggregator.konvaObject.x(aggregator.genericObject.posX);
-    aggregator.konvaObject.y(aggregator.genericObject.posY);
+    //todo: konva objects
+    aggregator.konvaObject.children[0].x(aggregator.genericObject.posX + 10);
+    aggregator.konvaObject.children[0].y(aggregator.genericObject.posY - 10);
+
+    aggregator.konvaObject.children[1].x(aggregator.genericObject.posX);
+    aggregator.konvaObject.children[1].y(aggregator.genericObject.posY);
+
     if (!aggregator.visible || aggregator.genericObject.posX == Number.MAX_SAFE_INTEGER) {
     if (!aggregator.visible || aggregator.genericObject.posX == Number.MAX_SAFE_INTEGER) {
       aggregator.genericObject.visible = true;
       aggregator.genericObject.visible = true;
       aggregator.konvaObject.show();
       aggregator.konvaObject.show();

+ 16 - 6
src/app/components/intersection-component/models/intersection-model.js

@@ -2,6 +2,7 @@ import { PointModel } from "../../point-component/models/point-model";
 import { ELEMENTS_CLASS } from "../../../core/enums/elements-class-enum";
 import { ELEMENTS_CLASS } from "../../../core/enums/elements-class-enum";
 import { DrawerAggregator } from "../../../core/drawers/drawer-aggregator";
 import { DrawerAggregator } from "../../../core/drawers/drawer-aggregator";
 import { GeometricObject } from "../../../core/models/objects/geometric-object";
 import { GeometricObject } from "../../../core/models/objects/geometric-object";
+import { setWith } from "lodash";
 
 
 export class IntersectionModel extends PointModel {
 export class IntersectionModel extends PointModel {
   /**
   /**
@@ -10,7 +11,7 @@ export class IntersectionModel extends PointModel {
    * @param {GeometricObject} s Geometric Object
    * @param {GeometricObject} s Geometric Object
    * @param {boolean} visible Visiblity of Object 
    * @param {boolean} visible Visiblity of Object 
    * @param {number} index Index position of Object ex (1)
    * @param {number} index Index position of Object ex (1)
-
+   * @param {id} id indentity of intersection ex: 0
    */
    */
   constructor(posX, posY, label, r, s, visible, index, id) {
   constructor(posX, posY, label, r, s, visible, index, id) {
     super(posX, posY, label, id);
     super(posX, posY, label, id);
@@ -66,7 +67,7 @@ export class IntersectionModel extends PointModel {
   }
   }
 
 
   getDefinitions() {
   getDefinitions() {
-    return [{ id: this.r.id }, { id: this.s.id }, { id: this.index + 1 }, { id: this.posX + 5 }, { id: this.posY - 5 }, { id: this.visible ? 1 : 0 }];
+    return [{ id: this.r.id }, { id: this.s.id }, { id: this.index + 1 }, { id: this.visible ? 1 : 0 }];
   }
   }
 
 
   bind(posX, posY, label, r, s, visible, index) {
   bind(posX, posY, label, r, s, visible, index) {
@@ -90,12 +91,21 @@ export class IntersectionModel extends PointModel {
     const rId = map.get("param")[0];
     const rId = map.get("param")[0];
     const sId = map.get("param")[1];
     const sId = map.get("param")[1];
     const index = map.get("param")[2] - 1;
     const index = map.get("param")[2] - 1;
-    const x = (map.get("param")[3]) - 5;
-    const y = (map.get("param")[4]) + 5;
     const visible = map.get("param")[5] == 1;
     const visible = map.get("param")[5] == 1;
-    const label = map.get("label");
+    const label = map.get("label")[0];
     const r = list.find(x => x.id == rId);
     const r = list.find(x => x.id == rId);
     const s = list.find(x => x.id == sId);
     const s = list.find(x => x.id == sId);
-    return new IntersectionModel(x, y, label, r, s, visible, index, id);
+
+    const intersections = r.getIntersection(s);
+    if (intersections.length == 1) {
+      const i = intersections[0];
+      i.bind(i.posX, i.posY, label, r, s, true, index);
+      return i;
+    } else {
+      const i = intersections.find(x => x.index == index);
+      i.bind(i.posX, i.posY, label, r, s, true, index);
+      return i;
+    }
   }
   }
+
 }
 }

+ 31 - 5
src/app/components/line-segment-component/drawers/line-segment-drawer.js

@@ -96,7 +96,7 @@ export class LineSegmentDrawer extends SelectableDrawer {
     this.setPointA(points[0]);
     this.setPointA(points[0]);
     this.setPointB(points[1]);
     this.setPointB(points[1]);
     aggregators = this.resolveAggregators(points, aggregators, true);
     aggregators = this.resolveAggregators(points, aggregators, true);
-    this.label = Label.draw();
+    this.label = Label.draw(true);
     this.lineSegment = new LineSegmentModel(
     this.lineSegment = new LineSegmentModel(
       this.pointA,
       this.pointA,
       this.pointB,
       this.pointB,
@@ -108,15 +108,19 @@ export class LineSegmentDrawer extends SelectableDrawer {
 
 
   drawByLineSegment(lineSegment) {
   drawByLineSegment(lineSegment) {
     this.lineSegment = lineSegment;
     this.lineSegment = lineSegment;
+    const group = SelectableDrawer.getKonvaGroup(false);
+    const text = LineSegmentDrawer.getKonvaText(lineSegment, lineSegment.label);
+    group.add(text);
     const konvaObject = LineSegmentDrawer.getKonvaLine(
     const konvaObject = LineSegmentDrawer.getKonvaLine(
       lineSegment.pointA,
       lineSegment.pointA,
       lineSegment.pointB
       lineSegment.pointB
     );
     );
-    super.setKonvaObject(konvaObject);
+    group.add(konvaObject);
+    super.setKonvaObject(group);
     const aggregator = new DrawerAggregator(
     const aggregator = new DrawerAggregator(
       this,
       this,
       this.lineSegment,
       this.lineSegment,
-      this.konvaObject,
+      group,
       ELEMENTS_CLASS.LINE_SEGMENT
       ELEMENTS_CLASS.LINE_SEGMENT
     );
     );
     super.addAggregator(aggregator);
     super.addAggregator(aggregator);
@@ -150,7 +154,11 @@ export class LineSegmentDrawer extends SelectableDrawer {
     if (!aggregator.visible) return;
     if (!aggregator.visible) return;
     const pointA = aggregator.genericObject.pointA;
     const pointA = aggregator.genericObject.pointA;
     const pointB = aggregator.genericObject.pointB;
     const pointB = aggregator.genericObject.pointB;
-    aggregator.konvaObject.points([
+    const pos = aggregator.genericObject.getMiddlePoint();
+    aggregator.konvaObject.children[0].x(pos.posX);
+    aggregator.konvaObject.children[0].y(pos.posY - 20);
+    super.batchDra
+    aggregator.konvaObject.children[1].points([
       pointA.posX,
       pointA.posX,
       pointA.posY,
       pointA.posY,
       pointB.posX,
       pointB.posX,
@@ -175,6 +183,24 @@ export class LineSegmentDrawer extends SelectableDrawer {
     super.batchDraw();
     super.batchDraw();
   }
   }
 
 
+  static getKonvaText(lineSegment, label) {
+    const pos = lineSegment.getMiddlePoint();
+    return new Konva.Text({
+      x: pos.posX,
+      y: pos.posY - 20,
+      text: label,
+      fontSize: 14,
+      fontFamily: "Calibri",
+      fill: "#434a45",
+      stroke: "#ffffff",
+      strokeWidth: 0.2,
+      draggable: false,
+      resizeEnabled: false,
+      transformEnabled: false,
+      selectable: false
+    });
+  }
+
   static getKonvaLine(pointA, pointB, useLabel) {
   static getKonvaLine(pointA, pointB, useLabel) {
     const points = [pointA.posX, pointA.posY, pointB.posX, pointB.posY];
     const points = [pointA.posX, pointA.posY, pointB.posX, pointB.posY];
     const line = new Konva.Line({
     const line = new Konva.Line({
@@ -191,7 +217,7 @@ export class LineSegmentDrawer extends SelectableDrawer {
       draggable: false,
       draggable: false,
       style: { stroke: "grey", fill: "grey" }
       style: { stroke: "grey", fill: "grey" }
     });
     });
-    SelectableDrawer.setSelectableIfToolChanged(line);
+    SelectableDrawer.setSelectableIfIntersectionChanged(line);
     return line;
     return line;
   }
   }
 
 

+ 12 - 4
src/app/components/line-segment-component/models/line-segment-model.js

@@ -30,6 +30,13 @@ export class LineSegmentModel extends GeometricObject {
     const b = bY - aY;
     const b = bY - aY;
     return [a, b];
     return [a, b];
   }
   }
+
+
+  getMiddlePoint() {
+    const x = (this.pointA.posX + this.pointB.posX) / 2;
+    const y = (this.pointA.posY + this.pointB.posY) / 2;
+    return { posX: x, posY: y };
+  }
   getIntersection(geometricObject) {
   getIntersection(geometricObject) {
     switch (geometricObject.elementClass) {
     switch (geometricObject.elementClass) {
       case ELEMENTS_CLASS.LINE_SEGMENT:
       case ELEMENTS_CLASS.LINE_SEGMENT:
@@ -67,13 +74,15 @@ export class LineSegmentModel extends GeometricObject {
           Number.MAX_SAFE_INTEGER,
           Number.MAX_SAFE_INTEGER,
           undefined,
           undefined,
           this,
           this,
-          lineSegment
+          lineSegment,
+          true,
+          0
         )
         )
       ];
       ];
     } else {
     } else {
       const x = (b2 * c1 - b1 * c2) / determinant;
       const x = (b2 * c1 - b1 * c2) / determinant;
       const y = (a1 * c2 - a2 * c1) / determinant;
       const y = (a1 * c2 - a2 * c1) / determinant;
-      return [new IntersectionModel(x, y, undefined, this, lineSegment)];
+      return [new IntersectionModel(x, y, undefined, this, lineSegment, true, 0)];
     }
     }
   }
   }
 
 
@@ -134,9 +143,8 @@ export class LineSegmentModel extends GeometricObject {
         PA.bind(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, undefined, this, circumference, false, 0)
         PA.bind(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, undefined, this, circumference, false, 0)
 
 
       if (!this.insideSegment(PB.posX, PB.posY))
       if (!this.insideSegment(PB.posX, PB.posY))
-        PB.bind(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, undefined, this, circumference, false, 1)
+        PB.bind(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, undefined, this, circumference, false, 1);
     }
     }
-
     return [
     return [
       PA,
       PA,
       PB
       PB

+ 3 - 2
src/app/components/point-component/drawers/point-drawer.js

@@ -84,13 +84,14 @@ export class PointDrawer extends SelectableDrawer {
     const circle = PointDrawer.getKonvaCircle(point, draggable, selectable);
     const circle = PointDrawer.getKonvaCircle(point, draggable, selectable);
 
 
     if (useLabel != undefined && useLabel) {
     if (useLabel != undefined && useLabel) {
-      const label = Label.draw();
+      let label = (point != undefined && point.label != undefined && point.label != '') ? point.label : Label.draw();
       point.setLabel(label);
       point.setLabel(label);
       const text = PointDrawer.getKonvaText(point, label);
       const text = PointDrawer.getKonvaText(point, label);
       group.add(text);
       group.add(text);
     }
     }
+
     if (selectable == undefined || selectable)
     if (selectable == undefined || selectable)
-      SelectableDrawer.setSelectable(circle);
+      SelectableDrawer.setSelectableIfSelectorChanged(circle);
 
 
     if (useLabel) {
     if (useLabel) {
       group.add(circle);
       group.add(circle);

+ 6 - 4
src/app/core/application/header-menu.js

@@ -2,7 +2,7 @@ import { stageManager } from "./stage-manager";
 import { FileParser } from "../parser/file-parser";
 import { FileParser } from "../parser/file-parser";
 import { ParserOrchestrator } from "../parser/parser-orchestrator";
 import { ParserOrchestrator } from "../parser/parser-orchestrator";
 class HeaderMenu {
 class HeaderMenu {
-  constructor() {}
+  constructor() { }
   bootstrap() {
   bootstrap() {
     $("body").on("click", "#save", this.save.bind(this));
     $("body").on("click", "#save", this.save.bind(this));
     $("body").on("click", "#open", this.open.bind(this));
     $("body").on("click", "#open", this.open.bind(this));
@@ -11,13 +11,15 @@ class HeaderMenu {
   save() {
   save() {
     const layer = stageManager.getCurrentLayer();
     const layer = stageManager.getCurrentLayer();
     const file = layer.actionManager.save();
     const file = layer.actionManager.save();
+    const name = prompt("Salvar como", layer.name.replace(/ /g, "_").toLowerCase());
+    if (name == undefined) return;
     const a = document.createElement("a"),
     const a = document.createElement("a"),
       url = URL.createObjectURL(file);
       url = URL.createObjectURL(file);
     a.href = url;
     a.href = url;
-    a.download = `${layer.name}.geo`;
+    a.download = `${name}.geo`;
     document.body.appendChild(a);
     document.body.appendChild(a);
     a.click();
     a.click();
-    setTimeout(function() {
+    setTimeout(function () {
       document.body.removeChild(a);
       document.body.removeChild(a);
       window.URL.revokeObjectURL(url);
       window.URL.revokeObjectURL(url);
     }, 0);
     }, 0);
@@ -29,7 +31,7 @@ class HeaderMenu {
     const files = $("#input-file")[0].files;
     const files = $("#input-file")[0].files;
     if (files == undefined || files.length === 0) return;
     if (files == undefined || files.length === 0) return;
     const reader = new FileReader();
     const reader = new FileReader();
-    reader.onload = function() {
+    reader.onload = function () {
       const result = reader.result;
       const result = reader.result;
       const parser = new FileParser(result);
       const parser = new FileParser(result);
       const map = parser.parse();
       const map = parser.parse();

+ 1 - 1
src/app/core/drawers/drawer.js

@@ -13,7 +13,7 @@ export class Drawer {
     this.konvaObject;
     this.konvaObject;
     this.elementClass = undefined;
     this.elementClass = undefined;
   }
   }
-  onDragMove() {}
+  onDragMove() { }
   setElementClass(elementClass) {
   setElementClass(elementClass) {
     this.elementClass = elementClass;
     this.elementClass = elementClass;
   }
   }

+ 1 - 1
src/app/core/drawers/layer.js

@@ -4,7 +4,7 @@ import { ActionManager } from "../models/application/actions/action-manager";
 export class Layer {
 export class Layer {
   constructor(id, konvaLayer) {
   constructor(id, konvaLayer) {
     this.id = id;
     this.id = id;
-    this.name = "New document " + this.id;
+    this.name = "New Construction " + this.id;
     this.konvaLayer = konvaLayer;
     this.konvaLayer = konvaLayer;
     this.aggregators = [];
     this.aggregators = [];
     this.selectedAggregators = [];
     this.selectedAggregators = [];

+ 29 - 4
src/app/core/drawers/selectable-drawer.js

@@ -1,8 +1,8 @@
 import { Drawer } from "./drawer";
 import { Drawer } from "./drawer";
-
 import { stageManager as StageManager } from "../application/stage-manager";
 import { stageManager as StageManager } from "../application/stage-manager";
 import { ELEMENTS_CLASS } from "../enums/elements-class-enum";
 import { ELEMENTS_CLASS } from "../enums/elements-class-enum";
 import { app as App } from "../../app";
 import { app as App } from "../../app";
+import { COMPONENT_TYPE } from "../enums/component-type-enum";
 const HOVER_STYLE = {
 const HOVER_STYLE = {
   fill: "#33BCFF",
   fill: "#33BCFF",
   strokeWidth: 6,
   strokeWidth: 6,
@@ -23,14 +23,39 @@ const STYLE_POINT = {
 export class SelectableDrawer extends Drawer {
 export class SelectableDrawer extends Drawer {
   constructor() {
   constructor() {
     super();
     super();
+    this.setElementClass(ELEMENTS_CLASS.SELECTOR);
+  }
+  static setSelectableIfIntersectionChanged(konvaObject) {
+    konvaObject.on("mouseover", function () {
+      const selectedTool = App.getSelectedTool();
+      if (
+        selectedTool != undefined &&
+        selectedTool.drawer != undefined && (
+          selectedTool.drawer.elementClass == ELEMENTS_CLASS.INTERSECTION_POINT
+        )
+      ) {
+        this.strokeWidth(HOVER_STYLE.strokeWidth);
+        this.stroke(HOVER_STYLE.stroke);
+        StageManager.getCurrentKonvaStage().draw();
+      }
+    });
+    konvaObject.on("mouseout", function () {
+      if (konvaObject == undefined) return;
+      this.strokeWidth(STYLE_STROKE.strokeWidth);
+      this.stroke(konvaObject.attrs.style.stroke);
+      StageManager.getCurrentKonvaStage().draw();
+    });
+    return konvaObject;
   }
   }
-  static setSelectableIfToolChanged(konvaObject) {
+  static setSelectableIfSelectorChanged(konvaObject) {
     konvaObject.on("mouseover", function () {
     konvaObject.on("mouseover", function () {
       const selectedTool = App.getSelectedTool();
       const selectedTool = App.getSelectedTool();
       if (
       if (
         selectedTool != undefined &&
         selectedTool != undefined &&
         selectedTool.drawer != undefined &&
         selectedTool.drawer != undefined &&
-        selectedTool.drawer.elementClass == ELEMENTS_CLASS.INTERSECTION_POINT
+        selectedTool.options.type === COMPONENT_TYPE.SELECTOR
+        || selectedTool.drawer.elementClass == ELEMENTS_CLASS.CIRCUMFERENCE
+        || selectedTool.drawer.elementClass == ELEMENTS_CLASS.LINE_SEGMENT
       ) {
       ) {
         this.strokeWidth(HOVER_STYLE.strokeWidth);
         this.strokeWidth(HOVER_STYLE.strokeWidth);
         this.stroke(HOVER_STYLE.stroke);
         this.stroke(HOVER_STYLE.stroke);
@@ -58,4 +83,4 @@ export class SelectableDrawer extends Drawer {
     });
     });
     return konvaObject;
     return konvaObject;
   }
   }
-}
+}

+ 2 - 1
src/app/core/enums/elements-class-enum.js

@@ -2,7 +2,8 @@ export const ELEMENTS_CLASS = {
   POINT: 0,
   POINT: 0,
   INTERSECTION_POINT: 1,
   INTERSECTION_POINT: 1,
   CIRCUMFERENCE: 3,
   CIRCUMFERENCE: 3,
-  LINE_SEGMENT: 6
+  LINE_SEGMENT: 6,
+  SELECTOR: 6
   // TO: PONTO                      =   0;
   // TO: PONTO                      =   0;
   // TO: PONTO_INTERSECAO           =   1;
   // TO: PONTO_INTERSECAO           =   1;
   // TO: PONTO_SOBRE                =   2;
   // TO: PONTO_SOBRE                =   2;

+ 12 - 1
src/app/core/parser/parser-orchestrator.js

@@ -4,7 +4,7 @@ import { CircumferenceModel } from "../../components/circumference-component/mod
 import { LineSegmentModel } from "../../components/line-segment-component/models/line-segment-model";
 import { LineSegmentModel } from "../../components/line-segment-component/models/line-segment-model";
 import { IntersectionModel } from "../../components/intersection-component/models/intersection-model";
 import { IntersectionModel } from "../../components/intersection-component/models/intersection-model";
 import { menu } from "../application/menu";
 import { menu } from "../application/menu";
-
+import { label as Label } from '../../component-registry/label';
 export class ParserOrchestrator {
 export class ParserOrchestrator {
 
 
   constructor(mapArr) {
   constructor(mapArr) {
@@ -34,8 +34,19 @@ export class ParserOrchestrator {
         break;
         break;
       default:
       default:
         break;
         break;
+
+    }
+    if (object == undefined) return;
+    switch (object.elementClass) {
+      case ELEMENTS_CLASS.CIRCUMFERENCE:
+        Label.pushLower(object.label);
+      case ELEMENTS_CLASS.LINE_SEGMENT:
+        Label.pushLower(object.label);
+      default:
+        Label.pushUpper(object.label);
     }
     }
     this.list.push(object);
     this.list.push(object);
+
   }
   }
   draw(object) {
   draw(object) {
     if (object == undefined) return;
     if (object == undefined) return;