@Test public void testGetElementsContainingArea() { rootQuad.add(box1); Array<CollisionBox> collisionBoxs = rootQuad.getElementsContainingArea(new CollisionBox(2, 2, 10, 10), false); Assert.assertEquals(1, collisionBoxs.size); Assert.assertEquals(true, collisionBoxs.contains(box1, false)); collisionBoxs = rootQuad.getElementsContainingArea(new CollisionBox(2, 2, 10, 10), true); Assert.assertEquals(1, collisionBoxs.size); Assert.assertEquals(true, collisionBoxs.contains(box1, false)); collisionBoxs = rootQuad.getElementsContainingArea(new CollisionBox(40, 40, 10, 10), false); Assert.assertEquals(0, collisionBoxs.size); Assert.assertEquals(false, collisionBoxs.contains(box1, false)); collisionBoxs = rootQuad.getElementsContainingArea(new CollisionBox(40, 40, 10, 10), true); Assert.assertEquals(0, collisionBoxs.size); Assert.assertEquals(false, collisionBoxs.contains(box1, false)); collisionBoxs = rootQuad.getElementsContainingArea(new CollisionBox(25, 25, 10, 10), false); Assert.assertEquals(1, collisionBoxs.size); Assert.assertEquals(true, collisionBoxs.contains(box1, false)); collisionBoxs = rootQuad.getElementsContainingArea(new CollisionBox(25, 25, 10, 10), true); Assert.assertEquals(0, collisionBoxs.size); Assert.assertEquals(false, collisionBoxs.contains(box1, false)); collisionBoxs = rootQuad.getElementsContainingArea(new CollisionBox(0.5f, 0.5f, 64, 64), false); Assert.assertEquals(0, collisionBoxs.size); Assert.assertEquals(false, collisionBoxs.contains(box1, false)); collisionBoxs = rootQuad.getElementsContainingArea(new CollisionBox(0.5f, 0.5f, 64, 64), true); Assert.assertEquals(0, collisionBoxs.size); Assert.assertEquals(false, collisionBoxs.contains(box1, false)); }
@Override public Array<T> getElementsContainingArea(Shape area, boolean entirelyContained) { Array<T> result = new Array<T>(); getElementsContainingArea(result, area, entirelyContained); return result; }
ConcurrentRegionQuadTree extends ConcurrentPointQuadTree<T> { @Override public Array<T> getElementsContainingArea(Shape area, boolean entirelyContained) { Array<T> result = new Array<T>(); getElementsContainingArea(result, area, entirelyContained); return result; } }
ConcurrentRegionQuadTree extends ConcurrentPointQuadTree<T> { @Override public Array<T> getElementsContainingArea(Shape area, boolean entirelyContained) { Array<T> result = new Array<T>(); getElementsContainingArea(result, area, entirelyContained); return result; } ConcurrentRegionQuadTree(int elementLimit, int mergeWatermark, float x, float y, float width, float height);  ConcurrentRegionQuadTree(int elementLimit, float x, float y, float width, float height);  ConcurrentRegionQuadTree(ConcurrentRegionQuadTree<T> parent, float x, float y, float width, float height);  ConcurrentRegionQuadTree(float minimumQuadWidth, float minimumQuadHeight, int elementLimitPerQuad,
			int mergeWatermark, float x, float y, float width, float height); }
ConcurrentRegionQuadTree extends ConcurrentPointQuadTree<T> { @Override public Array<T> getElementsContainingArea(Shape area, boolean entirelyContained) { Array<T> result = new Array<T>(); getElementsContainingArea(result, area, entirelyContained); return result; } ConcurrentRegionQuadTree(int elementLimit, int mergeWatermark, float x, float y, float width, float height);  ConcurrentRegionQuadTree(int elementLimit, float x, float y, float width, float height);  ConcurrentRegionQuadTree(ConcurrentRegionQuadTree<T> parent, float x, float y, float width, float height);  ConcurrentRegionQuadTree(float minimumQuadWidth, float minimumQuadHeight, int elementLimitPerQuad,
			int mergeWatermark, float x, float y, float width, float height); @Override void debugRender(Graphics g); @Override void addAll(Array<T> elements); @Override boolean add(T element); @Override void removeAll(Array<T> elementsToRemove); @Override boolean remove(T element); @Override void getElementsWithinArea(Array<T> result, Shape area); @Override void getElementsWithinArea(Array<T> result, Shape area, QuadTreeSearchDirection searchDirection); @Override Array<T> getElementsContainingArea(Shape area, boolean entirelyContained); @Override Array<T> getElementsContainingArea(Shape area, QuadTreeSearchDirection searchDirection, boolean entirelyContained); @Override void getElementsContainingArea(Array<T> result, Shape area, boolean entirelyContained); @Override void getElementsContainingArea(Array<T> result, Shape area, QuadTreeSearchDirection searchDirection, boolean entirelyContained); @Override void getElementsContainingPoint(Array<T> result, Point point); @Override void getElementsContainingPoint(Array<T> result, Point point, QuadTreeSearchDirection searchDirection); @Override void getElementsIntersectingLineSegment(Array<T> result, LineSegment lineSegment); @Override void getElementsIntersectingLineSegment(Array<T> result, LineSegment lineSegment, QuadTreeSearchDirection searchDirection); @Override Array<T> getElements(); @Override void getElements(Array<T> result); @Override int getTotalElements(); @Override void positionChanged(T moved); }
ConcurrentRegionQuadTree extends ConcurrentPointQuadTree<T> { @Override public Array<T> getElementsContainingArea(Shape area, boolean entirelyContained) { Array<T> result = new Array<T>(); getElementsContainingArea(result, area, entirelyContained); return result; } ConcurrentRegionQuadTree(int elementLimit, int mergeWatermark, float x, float y, float width, float height);  ConcurrentRegionQuadTree(int elementLimit, float x, float y, float width, float height);  ConcurrentRegionQuadTree(ConcurrentRegionQuadTree<T> parent, float x, float y, float width, float height);  ConcurrentRegionQuadTree(float minimumQuadWidth, float minimumQuadHeight, int elementLimitPerQuad,
			int mergeWatermark, float x, float y, float width, float height); @Override void debugRender(Graphics g); @Override void addAll(Array<T> elements); @Override boolean add(T element); @Override void removeAll(Array<T> elementsToRemove); @Override boolean remove(T element); @Override void getElementsWithinArea(Array<T> result, Shape area); @Override void getElementsWithinArea(Array<T> result, Shape area, QuadTreeSearchDirection searchDirection); @Override Array<T> getElementsContainingArea(Shape area, boolean entirelyContained); @Override Array<T> getElementsContainingArea(Shape area, QuadTreeSearchDirection searchDirection, boolean entirelyContained); @Override void getElementsContainingArea(Array<T> result, Shape area, boolean entirelyContained); @Override void getElementsContainingArea(Array<T> result, Shape area, QuadTreeSearchDirection searchDirection, boolean entirelyContained); @Override void getElementsContainingPoint(Array<T> result, Point point); @Override void getElementsContainingPoint(Array<T> result, Point point, QuadTreeSearchDirection searchDirection); @Override void getElementsIntersectingLineSegment(Array<T> result, LineSegment lineSegment); @Override void getElementsIntersectingLineSegment(Array<T> result, LineSegment lineSegment, QuadTreeSearchDirection searchDirection); @Override Array<T> getElements(); @Override void getElements(Array<T> result); @Override int getTotalElements(); @Override void positionChanged(T moved);  }