X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2Fbind%2FHasBindingGroup.java;h=56b7d9bdacdb1412545c64f2b6ebf9ec448df0f9;hp=b9b85b8a6cc21bd1e88952c7185c9ce2b6d26e69;hb=HEAD;hpb=7c73c0f732bbadef09d098b7f4542b060fdacc7d diff --git a/src/edu/berkeley/qfat/bind/HasBindingGroup.java b/src/edu/berkeley/qfat/bind/HasBindingGroup.java index b9b85b8..56b7d9b 100644 --- a/src/edu/berkeley/qfat/bind/HasBindingGroup.java +++ b/src/edu/berkeley/qfat/bind/HasBindingGroup.java @@ -32,6 +32,13 @@ public abstract class HasBindingGroup { if (bindingGroup == null) bindingGroup = new BindingGroup(this); if (other.bindingGroup == null) other.bindingGroup = new BindingGroup(other); + // this = bg.getMatrix(this) * bg.master + // other = obg.getMatrix(other) * obg.master + // this = bindingMatrix * other + // this = bindingMatrix * obg.getMatrix(other) * obg.master + // bg.getMatrix(this) * bg.master = bindingMatrix * obg.getMatrix(other) * obg.master + // bg.master = bg.getMatrix(this)^-1 * bindingMatrix * obg.getMatrix(other) * obg.master + // bg.master = XXX * obg.master Matrix bm = bindingGroup.getMatrix(this); Matrix obm = other.bindingGroup.getMatrix(other); bindingMatrix = @@ -49,7 +56,7 @@ public abstract class HasBindingGroup { /** returns the AffineConstraint of this BG, translated into this HBG's space */ public AffineConstraint getBindingConstraint() { - if (bindingGroup==null) return new AffineConstraint.All(); + if (bindingGroup==null) return AffineConstraint.ALL; return bindingGroup.getAffineConstraint(this); } @@ -81,4 +88,10 @@ public abstract class HasBindingGroup { /** invoked after the binding group of this HBG has changed due to bindTo() or unbind() */ public void bindingGroupChanged() { } + + public boolean bindingGroupUnconstrained() { + if (bindingGroupSize() > 1) return false; + if (getBindingConstraint()!=AffineConstraint.ALL) return false; + return true; + } }