Forráskód Böngészése

Update 'src/app/components/circumference-component/models/circumference-model.js'

Only added explaining comments.
leo 2 hónapja
szülő
commit
734b3ec33a

+ 17 - 3
src/app/components/circumference-component/models/circumference-model.js

@@ -11,9 +11,14 @@ import { ELEMENTS_CLASS } from "../../../core/enums/elements-class-enum";
 import { GeometricObject } from "../../../core/models/objects/geometric-object";
 import { IntersectionModel } from "../../intersection-component/models/intersection-model";
 
+// Point extends GeometricObject (app/core/models/objects/geometric-object.js)
 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);
     this.center = center;
     this.radius = radius;
@@ -28,18 +33,22 @@ export class CircumferenceModel extends GeometricObject {
     this.definitions.push(this.radius);
     }
 
-  getCenter() {
+  // Return this.center
+  getCenter () {
     return this.center;
     }
 
-  getPoint() {
+  // Return this.radius - REMOVE?
+  getPoint () {
     return this.radius;
     }
 
+  // Return this.radius
   getRadius () {
     return this.radius; // the point
     }
 
+  // Return radius as float value
   getRadiusValue () { // return ||this.center - this.radius||
     //_ Deixar mais intuitiva...
     //_ this._coordinates[0] = this.center.posX;
@@ -218,7 +227,11 @@ export class CircumferenceModel extends GeometricObject {
     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) {
+    //D console.log("circumference-model.js!do(.): inicio");
     const id = map.get("id");
     const centerId = map.get("param")[0];
     const radiusId = map.get("param")[1];
@@ -231,6 +244,7 @@ export class CircumferenceModel extends GeometricObject {
     const label = map.get("label")[0];
     const circumference = new CircumferenceModel(center, radius, id);
     circumference.setLabel(label);
+    //D console.log("circumference-model.js!do(.): final - criada circ. " + label);
     return circumference;
     }