private HashSet<E> left = new HashSet<E>();
private HashSet<E> right = new HashSet<E>();
public BindingGroup() { }
- public BindingGroup(E e) {
- left.add(e);
- }
+ public BindingGroup(E e) { add(e, false); }
public void add(E e, boolean swap) {
if (e.bg != null) {
- if (e.bg == this) return;
+ if (e.bg == this) return; /* fixme what if it is in the "other" set? */
for(E ex : (!swap ? e.bg.left : e.bg.right)) {
ex.bg = this;
left.add(ex);
}
}
public void dobind(E e) {
- // assumes e is part of the "left" set
Vert v1 = null;
Vert v2 = null;
if (left.contains(e)) { v1 = e.p1; v2 = e.p2; }
for(E e : left) {
e.shatter(e.midpoint(), bg1, bg2);
}
+ /*
for(E e : right) {
- e.shatter(e.midpoint(), bg2, bg1); /* swap correct? */
+ e.shatter(e.midpoint(), bg1, bg2); // swap correct?
}
+ */
}
}