split up solving

This commit is contained in:
Val Erastov 2014-10-29 23:26:55 -07:00
parent 86be093faf
commit 7ebfcd008e
2 changed files with 10 additions and 3 deletions

View file

@ -693,6 +693,7 @@ TCAD.TWO.DragTool.prototype.mousewheel = function(e) {
TCAD.TWO.DragTool.prototype.solveRequest = function(fineLevel) {
this.solver.solve(fineLevel);
this.solver.sync();
};
TCAD.TWO.DragTool.prototype.prepareSolver = function() {

View file

@ -227,7 +227,9 @@ TCAD.TWO.ParametricManager.prototype.solve1 = function(locked, onSolved) {
};
TCAD.TWO.ParametricManager.prototype.solve = function(locked, fineLevel, alg) {
this.prepare(locked, alg).solve(fineLevel);
var solver = this.prepare(locked, alg);
solver.solve(fineLevel);
solver.sync()
};
TCAD.TWO.ParametricManager.prototype.prepare = function(locked, alg) {
@ -291,12 +293,14 @@ TCAD.TWO.ParametricManager.prototype.prepare = function(locked, alg) {
_p.set(_p._backingParam.get());
}
solver.solveSystem(fineLevel);
}
function sync() {
for (p in pdict) {
_p = pdict[p];
_p._backingParam.set(_p.get());
}
//Make sure all equal constraints are equal
for (i = 0; i < equals.length; ++i) {
var ec = equals[i];
@ -312,7 +316,9 @@ TCAD.TWO.ParametricManager.prototype.prepare = function(locked, alg) {
slave.set( master.get() );
}
}
solver.solve = solve;
solver.sync = sync;
return solver;
};