1 package edu.berkeley.qfat.geom;
2 import edu.wlu.cs.levy.CG.KDTree;
5 public class PointSet<V extends HasPoint> {
7 private /*final*/ KDTree kd = new KDTree(3);
8 private final double[] doubles = new double[3];
10 private HashMap<Point,V> exact = new HashMap<Point,V>();
16 public void add(V v) {
17 Point p = v.getPoint();
22 kd.insert(doubles, v);
23 } catch (Exception e) {
29 public void remove(HasPoint v) { remove(v.getPoint()); }
30 public void remove(Point p) {
36 } catch (Exception e) { }
40 public V nearest(Point p) {
46 results = kd.nearest(doubles,1);
47 } catch (Exception e) {