From 0a5c8b18a402d5a139cd0059f0229c465fb776ac Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 15 Dec 2007 17:29:16 -0800 Subject: [PATCH] checkpoint darcs-hash:20071216012916-5007d-fc7f582f1183c0c48147ce8963935422eacc2940.gz --- src/edu/berkeley/qfat/geom/RTree.java | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/edu/berkeley/qfat/geom/RTree.java b/src/edu/berkeley/qfat/geom/RTree.java index 2fab5f5..35b6f9b 100644 --- a/src/edu/berkeley/qfat/geom/RTree.java +++ b/src/edu/berkeley/qfat/geom/RTree.java @@ -4,6 +4,7 @@ import java.util.*; import com.infomatiq.jsi.*; import com.infomatiq.jsi.rtree.*; +/** wrapper around the com.infomatiq.jsi.rtree.RTree class */ public class RTree implements Iterable { private com.infomatiq.jsi.rtree.RTree rtree = @@ -15,10 +16,10 @@ public class RTree implements Iterable { public Iterator iterator() { return vToId.keySet().iterator(); } - private final MyIntProcedure myIntProcedure = new MyIntProcedure(); + private final MyIntProcedure myIntProcedure = new MyIntProcedure(); private final com.infomatiq.jsi.Rectangle rect = new com.infomatiq.jsi.Rectangle(0,0,0,0,0,0); - private final com.infomatiq.jsi.Point point = new com.infomatiq.jsi.Point(0,0,0); - private V found = null; + private final com.infomatiq.jsi.Point point = new com.infomatiq.jsi.Point(0,0,0); + private V found = null; private Visitor visitor = null; private static final Properties props = new Properties(); @@ -54,19 +55,6 @@ public class RTree implements Iterable { rtree.delete(rect, id); } - private class MyIntProcedure implements IntProcedure { - public boolean execute(int id) { - if (visitor != null) { - V v = idToV.get(id); - visitor.visit(v); - return true; - } else { - found = idToV.get(id); - return false; - } - } - } - public V nearest(Point p) { point.set(p.x, p.y, p.z); rtree.nearest(point, myIntProcedure, Float.POSITIVE_INFINITY); @@ -81,4 +69,16 @@ public class RTree implements Iterable { visitor = null; } + private class MyIntProcedure implements IntProcedure { + public boolean execute(int id) { + if (visitor != null) { + V v = idToV.get(id); + visitor.visit(v); + return true; + } else { + found = idToV.get(id); + return false; + } + } + } } -- 1.7.10.4