projects
/
anneal.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a3a659d
)
checkpoint
author
adam
<adam@megacz.com>
Wed, 5 Dec 2007 05:36:42 +0000
(21:36 -0800)
committer
adam
<adam@megacz.com>
Wed, 5 Dec 2007 05:36:42 +0000
(21:36 -0800)
darcs-hash:
20071205053642
-5007d-
6fe1415871fabaa2aad9f1bb6163dfc084ee302b
.gz
src/edu/berkeley/qfat/Mesh.java
patch
|
blob
|
history
diff --git
a/src/edu/berkeley/qfat/Mesh.java
b/src/edu/berkeley/qfat/Mesh.java
index
8592d8a
..
1579551
100644
(file)
--- a/
src/edu/berkeley/qfat/Mesh.java
+++ b/
src/edu/berkeley/qfat/Mesh.java
@@
-16,7
+16,6
@@
public class Mesh implements Iterable<Mesh.T> {
private PointSet<Vert> pointset = new PointSet<Vert>();
public Vert nearest(Point p) { return pointset.nearest(p); }
private PointSet<Vert> pointset = new PointSet<Vert>();
public Vert nearest(Point p) { return pointset.nearest(p); }
- private HashMap<Point,Vert> verts = new HashMap<Point,Vert>();
public Iterable<E> edges() {
return
public Iterable<E> edges() {
return
@@
-132,14
+131,13
@@
public class Mesh implements Iterable<Mesh.T> {
}
}
}
}
- public Vert register(Point p) { Vert v = verts.get(p); return v==null ? new Vert(p) : v; }
+ public Vert register(Point p) { Vert v = pointset.get(p); return v==null ? new Vert(p) : v; }
public final class Vert extends HasPoint {
public Point p;
public Point getPoint() { return p; }
private Vert(Point p) {
this.p = p;
public final class Vert extends HasPoint {
public Point p;
public Point getPoint() { return p; }
private Vert(Point p) {
this.p = p;
- if (verts.get(p) != null) throw new Error();
- verts.put(this.p, this);
+ if (pointset.get(p) != null) throw new Error();
pointset.add(this);
}
public void reinsert() {
pointset.add(this);
}
public void reinsert() {
@@
-210,8
+208,7
@@
public class Mesh implements Iterable<Mesh.T> {
// FIXME: screws up hashmap
unscore();
try {
// FIXME: screws up hashmap
unscore();
try {
- if (verts.get(this.p)==null) throw new Error();
- verts.remove(this.p);
+ if (pointset.get(this.p)==null) throw new Error();
pointset.remove(this);
float newx = m.a*p.x + m.b*p.y + m.c*p.z + m.d;
float newy = m.e*p.x + m.f*p.y + m.g*p.z + m.h;
pointset.remove(this);
float newx = m.a*p.x + m.b*p.y + m.c*p.z + m.d;
float newy = m.e*p.x + m.f*p.y + m.g*p.z + m.h;
@@
-219,7
+216,6
@@
public class Mesh implements Iterable<Mesh.T> {
this.p = new Point(newx, newy, newz);
// FIXME: what if we move onto exactly where another point is?
pointset.add(this);
this.p = new Point(newx, newy, newz);
// FIXME: what if we move onto exactly where another point is?
pointset.add(this);
- verts.put(this.p,(Vert)this);
} catch (Exception e) {
throw new RuntimeException(e);
}
} catch (Exception e) {
throw new RuntimeException(e);
}