+ public T(E e1, E e2, E e3) {
+ this.e1 = e1;
+ this.e2 = e2;
+ this.e3 = e3;
+ if (e1.t1 == null) e1.t1 = this; else if (e1.t2 == null) e1.t2 = this; else throw new Error("non-manifold surface");
+ if (e2.t1 == null) e2.t1 = this; else if (e2.t2 == null) e2.t2 = this; else throw new Error("non-manifold surface");
+ if (e3.t1 == null) e3.t1 = this; else if (e3.t2 == null) e3.t2 = this; else throw new Error("non-manifold surface");
+ ts.add(this);
+ }
+ public boolean hasE(E e) { return e1==e || e2==e || e3==e; }
+
+ // technically not required
+ /*
+ public int hashCode() { return e1.hashCode() ^ e2.hashCode() ^ e3.hashCode(); }
+ public boolean equals(Object o) {
+ if (o==null || !(o instanceof T)) return false;
+ T t = (T)o;
+ if (this.e1 == t.e1 && this.e2 == t.e2 && this.e3 == t.e3) return true;
+ if (this.e1 == t.e2 && this.e2 == t.e3 && this.e3 == t.e1) return true;
+ if (this.e1 == t.e3 && this.e2 == t.e1 && this.e3 == t.e2) return true;
+ return false;
+ }
+ */
+ public void glVertices(GL gl) {
+ e1.unshared(e2).glVertex(gl);
+ e1.shared(e2).glVertex(gl);
+ e2.shared(e3).glVertex(gl);
+ }