|
@@ -11,9 +11,14 @@ import { ELEMENTS_CLASS } from "../../../core/enums/elements-class-enum";
|
|
import { GeometricObject } from "../../../core/models/objects/geometric-object";
|
|
import { GeometricObject } from "../../../core/models/objects/geometric-object";
|
|
import { IntersectionModel } from "../../intersection-component/models/intersection-model";
|
|
import { IntersectionModel } from "../../intersection-component/models/intersection-model";
|
|
|
|
|
|
|
|
+// Point extends GeometricObject (app/core/models/objects/geometric-object.js)
|
|
export class CircumferenceModel extends GeometricObject {
|
|
export class CircumferenceModel extends GeometricObject {
|
|
|
|
|
|
- constructor(center, radius, id) {
|
|
|
|
|
|
+ // Construct one free Point
|
|
|
|
+ // @param {center } Point (defining center)
|
|
|
|
+ // @param {radius } Point (defining radius)
|
|
|
|
+ // @param {int } int id
|
|
|
|
+ constructor (center, radius, id) {
|
|
super(id);
|
|
super(id);
|
|
this.center = center;
|
|
this.center = center;
|
|
this.radius = radius;
|
|
this.radius = radius;
|
|
@@ -28,18 +33,22 @@ export class CircumferenceModel extends GeometricObject {
|
|
this.definitions.push(this.radius);
|
|
this.definitions.push(this.radius);
|
|
}
|
|
}
|
|
|
|
|
|
- getCenter() {
|
|
|
|
|
|
+ // Return this.center
|
|
|
|
+ getCenter () {
|
|
return this.center;
|
|
return this.center;
|
|
}
|
|
}
|
|
|
|
|
|
- getPoint() {
|
|
|
|
|
|
+ // Return this.radius - REMOVE?
|
|
|
|
+ getPoint () {
|
|
return this.radius;
|
|
return this.radius;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Return this.radius
|
|
getRadius () {
|
|
getRadius () {
|
|
return this.radius; // the point
|
|
return this.radius; // the point
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Return radius as float value
|
|
getRadiusValue () { // return ||this.center - this.radius||
|
|
getRadiusValue () { // return ||this.center - this.radius||
|
|
//_ Deixar mais intuitiva...
|
|
//_ Deixar mais intuitiva...
|
|
//_ this._coordinates[0] = this.center.posX;
|
|
//_ this._coordinates[0] = this.center.posX;
|
|
@@ -218,7 +227,11 @@ export class CircumferenceModel extends GeometricObject {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Used to read a GEO file, pre-processed by 'header-menu.js'
|
|
|
|
+ // Get some information from GEO file and create internal Circumference
|
|
|
|
+ // @calledby app/core/application/header-menu.js!onFileChanged()
|
|
static do (map, vecIdObj, list) {
|
|
static do (map, vecIdObj, list) {
|
|
|
|
+ //D console.log("circumference-model.js!do(.): inicio");
|
|
const id = map.get("id");
|
|
const id = map.get("id");
|
|
const centerId = map.get("param")[0];
|
|
const centerId = map.get("param")[0];
|
|
const radiusId = map.get("param")[1];
|
|
const radiusId = map.get("param")[1];
|
|
@@ -231,6 +244,7 @@ export class CircumferenceModel extends GeometricObject {
|
|
const label = map.get("label")[0];
|
|
const label = map.get("label")[0];
|
|
const circumference = new CircumferenceModel(center, radius, id);
|
|
const circumference = new CircumferenceModel(center, radius, id);
|
|
circumference.setLabel(label);
|
|
circumference.setLabel(label);
|
|
|
|
+ //D console.log("circumference-model.js!do(.): final - criada circ. " + label);
|
|
return circumference;
|
|
return circumference;
|
|
}
|
|
}
|
|
|
|
|