X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FMesh.java;h=926a5b7b5d55ffea170ea62037216a1e88193c1a;hb=4d37197f8e2572a3c5510d77c0f09a19e9d9f748;hp=e12407294024a003e76642844290f3b79739109d;hpb=f018c9f76356b71ee3560595f6d236a76a7d13eb;p=anneal.git diff --git a/src/edu/berkeley/qfat/Mesh.java b/src/edu/berkeley/qfat/Mesh.java index e124072..926a5b7 100644 --- a/src/edu/berkeley/qfat/Mesh.java +++ b/src/edu/berkeley/qfat/Mesh.java @@ -215,8 +215,19 @@ public class Mesh implements Iterable { // Vertexices ////////////////////////////////////////////////////////////////////////////// + /** a vertex in the mesh */ - public final class Vertex extends HasQuadric implements Visitor { + public final class Vertex extends HasQuadric implements Visitor, HasPoint { + public void bindTo(Matrix bindingMatrix, HasBindingGroup other) { + bindTo(bindingMatrix, other, EPSILON); + } + public float getMaxX() { return getPoint().getMaxX(); } + public float getMinX() { return getPoint().getMinX(); } + public float getMaxY() { return getPoint().getMaxY(); } + public float getMinY() { return getPoint().getMinY(); } + public float getMaxZ() { return getPoint().getMaxZ(); } + public float getMinZ() { return getPoint().getMinZ(); } + public Point p, goodp; public Point oldp; E e; // some edge *leaving* this point @@ -557,6 +568,10 @@ public class Mesh implements Iterable { /** [UNIQUE] an edge */ public final class E extends HasBindingGroup implements Comparable { + public void bindTo(Matrix bindingMatrix, HasBindingGroup other) { + bindTo(bindingMatrix, other, EPSILON); + } + public void sanity() { if (destroyed) return; if (pair!=null && (pair.v1!=v2 || pair.v2!=v1)) throw new RuntimeException(); @@ -610,13 +625,9 @@ public class Mesh implements Iterable { } - public void bindingGroupChanged(BindingGroup newBindingGroup_) { - - BindingGroup newBindingGroup = (BindingGroup)newBindingGroup_; - if (newBindingGroup==null) return; - //if (this==newBindingGroup.getMaster()) return; + public void bindingGroupChanged() { HashSet nbg = new HashSet(); - for(E eother : (Iterable)newBindingGroup) nbg.add(eother); + for(E eother : (Iterable)getBoundPeers()) nbg.add(eother); for(E eother : nbg) { if (next==null || prev==null) continue; if (eother.next==null || eother.prev==null) continue; @@ -691,8 +702,8 @@ public class Mesh implements Iterable { v1.bindTo(getBindingMatrix(e), e.v1); v2.bindTo(getBindingMatrix(e), e.v2); /* - e.v1.setConstraint(getConstraint()); - e.v2.setConstraint(getConstraint()); + e.v1.setConstraint(getAffineConstraint()); + e.v2.setConstraint(getAffineConstraint()); */ } } @@ -736,8 +747,8 @@ public class Mesh implements Iterable { e.v2.getE(mid).pair.pair.bindTo(e.getBindingMatrix(firste), firstq.pair); } /* - first.setConstraint(firste.getConstraint()); - firstq.setConstraint(firste.getConstraint()); + first.setConstraint(firste.getAffineConstraint()); + firstq.setConstraint(firste.getAffineConstraint()); */ return nearest(midpoint()); } @@ -1069,8 +1080,8 @@ public class Mesh implements Iterable { } */ /* - first.setConstraint(firste.getConstraint()); - firstq.setConstraint(firste.getConstraint()); + first.setConstraint(firste.getAffineConstraint()); + firstq.setConstraint(firste.getAffineConstraint()); */ return null; }