|
@@ -48,6 +48,8 @@ export class DrawerAggregator {
|
|
this.elementClass = elementClass;
|
|
this.elementClass = elementClass;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Add in OG.dependents[] any object that directly depend of OG
|
|
|
|
+ // Examples: A:=Point(1,2); B:=Point(3,4); C:=MidPoint(A,B) => A.dependentsOnThis[] <- C; B.dependentsOnThis[] <- C
|
|
addAggregator (aggregator) {
|
|
addAggregator (aggregator) {
|
|
if (this.aggregators==undefined) {
|
|
if (this.aggregators==undefined) {
|
|
console.log("drawer-aggregator.js!addAggregator(aggregator): Error, 'this.aggregators==undefined'");
|
|
console.log("drawer-aggregator.js!addAggregator(aggregator): Error, 'this.aggregators==undefined'");
|
|
@@ -55,25 +57,30 @@ export class DrawerAggregator {
|
|
}
|
|
}
|
|
var auxE = "1, ";
|
|
var auxE = "1, ";
|
|
try {
|
|
try {
|
|
|
|
+ // Add the Geometric Object "aggregator.genericObject" in list of dependents of this Geometric Object "this.genericObject"
|
|
|
|
+ console.log("drawer-aggregator.js!addAggregator(aggregator): adiciona OG.id=" + aggregator.genericObject.id + " como dependente de " + this.genericObject.id);
|
|
if (!this.aggregators.includes(aggregator)) {
|
|
if (!this.aggregators.includes(aggregator)) {
|
|
auxE += "2, "; //D
|
|
auxE += "2, "; //D
|
|
this.aggregators.push(aggregator);
|
|
this.aggregators.push(aggregator);
|
|
auxE += "3, "; //D
|
|
auxE += "3, "; //D
|
|
- this.genericObject.dependentsOnThis.push(aggregator.genericObject);
|
|
|
|
|
|
+ this.genericObject.dependentsOnThis.push(aggregator.genericObject); // app/core/models/objects/generic-object.js: this.dependentsOnThis = []
|
|
}
|
|
}
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.log("drawer-aggregator.js!addAggregator(aggregator): Error '" + error + "', with " + auxE);
|
|
console.log("drawer-aggregator.js!addAggregator(aggregator): Error '" + error + "', with " + auxE);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Update all objects that dependend of this
|
|
update (e) {
|
|
update (e) {
|
|
|
|
+ // REVER "this.aggregators[]": NAO pode ser um vetor como lista de dependentes! Seria lista de todos os objetos?
|
|
var tam = this.aggregators?this.aggregators.length:0; //D xxx
|
|
var tam = this.aggregators?this.aggregators.length:0; //D xxx
|
|
- var aux = JSON.stringify(this.geometricObject) + ", #this.aggregators=" + tam + " : "; //D xxx
|
|
|
|
- for (var ii=0; ii<tam; ii++) aux += this.aggregators[ii].id + ","; //D xxx
|
|
|
|
- console.log("drawer-aggregator.js!update(e): this.id=" + this.id + ": this.geometricObject=" + aux); //D xxx
|
|
|
|
|
|
+ var aux = JSON.stringify(this.geometricObject) + ", #this.aggregators=" + tam + " : list of dependents = ["; //D xxx
|
|
|
|
+ //D List the dependents of
|
|
|
|
+ //D for (var ii=0; ii<tam; ii++) aux += this.aggregators[ii].id + ","; aux += "]"; //D xxx
|
|
|
|
+ //D console.log("drawer-aggregator.js!update(e): this.id=" + this.id + ": this.geometricObject=" + aux); //D xxx
|
|
this.drawer.update(this, e);
|
|
this.drawer.update(this, e);
|
|
this.updateAggregators(this.aggregators, e);
|
|
this.updateAggregators(this.aggregators, e);
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
updateAggregators (aggregators, e) {
|
|
updateAggregators (aggregators, e) {
|
|
console.log("drawer-aggregator.js!updateAggregators(aggregators,e)"); //D
|
|
console.log("drawer-aggregator.js!updateAggregators(aggregators,e)"); //D
|