12345678910111213141516171819202122 |
- import { ELEMENTS_CLASS } from "../../../core/enums/elements-class-enum";
- import { LineSegmentModel } from "../../line-segment-component/models/line-segment-model";
- export class LineModel extends LineSegmentModel {
- constructor(pointA, pointB, label, id) {
- super(pointA, pointB, label, id);
- this.setClass(ELEMENTS_CLASS.LINE);
- this.color = -16776961;
- }
- static do(map, list) {
- const id = map.get("id");
- const pointAId = map.get("param")[0];
- const pointBId = map.get("param")[1];
- const pointA = list.find(x => x.id === pointAId);
- const pointB = list.find(x => x.id === pointBId);
- const label = map.get("label")[0];
- const line = new LineModel(pointA, pointB, label, id);
- return line;
- }
- }
|