}
private Point point(float x, float y) { return new Point(x,y); }
+ private Point point(Point a, Point b) { return new Point((a.x+b.x)/2,(a.y+b.y)/2); }
private Point point(Point p, Affine a) { return point(p.x(a), p.y(a)); }
private class Point {
public float x;
}
}
- private final class Vertex extends Point implements org.ibex.arenaj.Gladiator {
+ private final class Vertex extends Point implements org.ibex.classgen.opt.Arena.Gladiator {
public Vertex(Point p) { super(p); numvertices++; }
}
//if (ret != null) throw new Error("tried to get an edge that already exists!");
if (ret == null) ret = new Edge(v1,v2);
return ret;
+ */
}
public Edge getEdge(Vertex v1, Vertex v2) {
if (v1==v2) throw new Error();
- Edge ret = (Edge)edges.get(v1,v2);
+ //Edge ret = (Edge)edges.get(v1,v2);
+ Edge ret = null;
+ Triangle t = null;
+ if (triangle0 != null) {
+ t = triangle0.seek(point(v1,v2));
+ if (t != null)
+ for(int i=1; i<=3; i++)
+ if (t.e(i).hasVertex(v1) && t.e(i).hasVertex(v2)) ret = t.e(i);
+ }
+ if (ret == null) {
+ ret = (Edge)edges.get(v1,v2);
+ if (ret != null && (ret.t1 != null || ret.t2 != null)) throw new Error("bah! " + ret);
+ }
if (ret == null) ret = new Edge(v1,v2);
return ret;
}
- private final class Edge implements org.ibex.arenaj.Gladiator {
+ private final class Edge implements org.ibex.classgen.opt.Arena.Gladiator {
private final Vertex v1;
private final Vertex v2;
Triangle t1 = null;
}
public static boolean fixing = false;
- private final class Triangle implements org.ibex.arenaj.Gladiator {
+ private final class Triangle implements org.ibex.classgen.opt.Arena.Gladiator {
final float r2;
final Point cc;