Package org.anchoranalysis.spatial.rtree
Class BoundingBoxRTree<T>
Object
org.anchoranalysis.spatial.rtree.RTree<T>
org.anchoranalysis.spatial.rtree.BoundingBoxRTree<T>
- Type Parameters:
T- object-type stored in structure (the payload).
public class BoundingBoxRTree<T> extends RTree<T>
An R-Tree that contains items, each with an associated bounding-box in three dimensions.
This is similar to IntervalRTree but uses three-dimensions rather than a single
dimension to index the data.
- Author:
- Owen Feehan
- See Also:
- R-tree on Wikipedia
-
Constructor Summary
Constructors Constructor Description BoundingBoxRTree()Creates an empty R-Tree.BoundingBoxRTree(int maxNumberEntries)Creates an empty R-Tree with a specified number of children. -
Method Summary
Modifier and Type Method Description voidadd(BoundingBox box, T payload)Adds a bounding-box with a corresponding payload.Set<T>contains(ReadableTuple3i point)Which objects contain a particular point?Stream<T>containsStream(ReadableTuple3i point)Likecontains(org.anchoranalysis.spatial.point.ReadableTuple3i)but returns aStreaminstead of aSet.Set<T>intersectsWith(BoundingBox toIntersectWith)Which bounding-boxes intersect with another specific bounding box?Stream<T>intersectsWithStream(BoundingBox toIntersectWith)voidremove(BoundingBox box, T payload)Removes a particular item from the r-tree, identified by its bounding-box and payload.Methods inherited from class org.anchoranalysis.spatial.rtree.RTree
add, arbitraryElement, asSet, containsStream, intersectsWithStream, isEmpty, remove, size
-
Constructor Details
-
BoundingBoxRTree
public BoundingBoxRTree()Creates an empty R-Tree. -
BoundingBoxRTree
public BoundingBoxRTree(int maxNumberEntries)Creates an empty R-Tree with a specified number of children.- Parameters:
maxNumberEntries- maximum number of entries in the r-tree
-
-
Method Details
-
contains
Which objects contain a particular point?- Parameters:
point- the point- Returns:
- payloads for all objects that contain
point.
-
containsStream
Likecontains(org.anchoranalysis.spatial.point.ReadableTuple3i)but returns aStreaminstead of aSet.- Parameters:
point- the point- Returns:
- payloads for all objects that contain
point.
-
add
Adds a bounding-box with a corresponding payload.Note that the payload must not be unique, and multiple identical elements can exist with the same bounding-box and payload.
- Parameters:
box- the box to addpayload- the payload associated with the bounding-box
-
intersectsWith
Which bounding-boxes intersect with another specific bounding box?- Parameters:
toIntersectWith- the box that must be intersected with- Returns:
- payloads for all bounding-boxes that intersect with
toIntersectWith.
-
intersectsWithStream
- Parameters:
toIntersectWith- the box that must be intersected with- Returns:
- payloads for all bounding-boxes that intersect with
toIntersectWith.
-
remove
Removes a particular item from the r-tree, identified by its bounding-box and payload.If no entry can be found matching exactly the
boxandpayload, no change happens to the r-tree. No error is reported.If multiple entries exist that match exactly the
boxandpayload, then all entries are removed.If
boxexists but with a differentpayload, behaviour is undefined. Eitherboxis removed, or no change occurs.- Parameters:
box- the bounding-boxpayload- the payload
-