@Test public void testSearchIntersects() { PointQuadTree<String> qt = getTree(); List<PointData<String>> points = qt.searchIntersect(4, 0, 51, 98); Collections.sort(points); String keyString = Arrays.asList(points).toString(); String expected = "[(5.0, 20.0), (12.0, 0.0), (47.0, 96.0), (50.0, 32.0), (50.0, 50.0)]"; System.err.println(points.toString()); }
public List<PointData<V>> searchIntersect(final double xmin, final double ymin, final double xmax, final double ymax) { final List<PointData<V>> arr = new ArrayList<PointData<V>>(); this.navigate(this.root, new Func<V>() { @Override public void call(PointQuadTree<V> quadTree, Node<V> node) { PointData<V> pt = (PointData<V>) node.getData(); if (pt.getPoint().getX() < xmin || pt.getPoint().getX() > xmax || pt.getPoint().getZ() < ymin || pt.getPoint().getZ() > ymax) { } else { arr.add((PointData<V>) node.getData()); } } }, xmin, ymin, xmax, ymax); return arr; }
PointQuadTree extends QuadTree<Vector3, V> { public List<PointData<V>> searchIntersect(final double xmin, final double ymin, final double xmax, final double ymax) { final List<PointData<V>> arr = new ArrayList<PointData<V>>(); this.navigate(this.root, new Func<V>() { @Override public void call(PointQuadTree<V> quadTree, Node<V> node) { PointData<V> pt = (PointData<V>) node.getData(); if (pt.getPoint().getX() < xmin || pt.getPoint().getX() > xmax || pt.getPoint().getZ() < ymin || pt.getPoint().getZ() > ymax) { } else { arr.add((PointData<V>) node.getData()); } } }, xmin, ymin, xmax, ymax); return arr; } }
PointQuadTree extends QuadTree<Vector3, V> { public List<PointData<V>> searchIntersect(final double xmin, final double ymin, final double xmax, final double ymax) { final List<PointData<V>> arr = new ArrayList<PointData<V>>(); this.navigate(this.root, new Func<V>() { @Override public void call(PointQuadTree<V> quadTree, Node<V> node) { PointData<V> pt = (PointData<V>) node.getData(); if (pt.getPoint().getX() < xmin || pt.getPoint().getX() > xmax || pt.getPoint().getZ() < ymin || pt.getPoint().getZ() > ymax) { } else { arr.add((PointData<V>) node.getData()); } } }, xmin, ymin, xmax, ymax); return arr; } PointQuadTree(float minX, float minZ, float maxX, float maxZ);  PointQuadTree(Vector3 startPoint,Vector3 endPoint); }
PointQuadTree extends QuadTree<Vector3, V> { public List<PointData<V>> searchIntersect(final double xmin, final double ymin, final double xmax, final double ymax) { final List<PointData<V>> arr = new ArrayList<PointData<V>>(); this.navigate(this.root, new Func<V>() { @Override public void call(PointQuadTree<V> quadTree, Node<V> node) { PointData<V> pt = (PointData<V>) node.getData(); if (pt.getPoint().getX() < xmin || pt.getPoint().getX() > xmax || pt.getPoint().getZ() < ymin || pt.getPoint().getZ() > ymax) { } else { arr.add((PointData<V>) node.getData()); } } }, xmin, ymin, xmax, ymax); return arr; } PointQuadTree(float minX, float minZ, float maxX, float maxZ);  PointQuadTree(Vector3 startPoint,Vector3 endPoint); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override void set(Vector3 k, V v); @Override V get(Vector3 k, V defaultValue); @Override Node<V> find(Node<V> node, Vector3 vector3); @Override V remove(Vector3 k); @SuppressWarnings("unchecked") @Override List<PointData<V>> getKeyValues(); @Override List<Vector3> getKeys(); @Override List<V> getValues(); void traverse(Node<V> node, Func<V> func); List<PointData<V>> searchIntersect(final double xmin, final double ymin, final double xmax,
			final double ymax); List<PointData<V>> searchWithin(final float xmin, final float zmin, final float xmax, final float zmax); List<PointData<V>> searchWithin(Vector3 point, float radius); PointQuadTree<V> clone(); }
PointQuadTree extends QuadTree<Vector3, V> { public List<PointData<V>> searchIntersect(final double xmin, final double ymin, final double xmax, final double ymax) { final List<PointData<V>> arr = new ArrayList<PointData<V>>(); this.navigate(this.root, new Func<V>() { @Override public void call(PointQuadTree<V> quadTree, Node<V> node) { PointData<V> pt = (PointData<V>) node.getData(); if (pt.getPoint().getX() < xmin || pt.getPoint().getX() > xmax || pt.getPoint().getZ() < ymin || pt.getPoint().getZ() > ymax) { } else { arr.add((PointData<V>) node.getData()); } } }, xmin, ymin, xmax, ymax); return arr; } PointQuadTree(float minX, float minZ, float maxX, float maxZ);  PointQuadTree(Vector3 startPoint,Vector3 endPoint); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override void set(Vector3 k, V v); @Override V get(Vector3 k, V defaultValue); @Override Node<V> find(Node<V> node, Vector3 vector3); @Override V remove(Vector3 k); @SuppressWarnings("unchecked") @Override List<PointData<V>> getKeyValues(); @Override List<Vector3> getKeys(); @Override List<V> getValues(); void traverse(Node<V> node, Func<V> func); List<PointData<V>> searchIntersect(final double xmin, final double ymin, final double xmax,
			final double ymax); List<PointData<V>> searchWithin(final float xmin, final float zmin, final float xmax, final float zmax); List<PointData<V>> searchWithin(Vector3 point, float radius); PointQuadTree<V> clone();  }