T
- object-type stored in structure (the payload).public class BoundingBoxRTree<T> extends RTree<T>
This is similar to IntervalRTree
but uses three-dimensions rather than a single
dimension to index the data.
Constructor and Description |
---|
BoundingBoxRTree()
Creates an empty R-Tree.
|
BoundingBoxRTree(int maxNumberEntries)
Creates an empty R-Tree with a specified number of children.
|
Modifier and Type | Method and Description |
---|---|
void |
add(BoundingBox box,
T payload)
Adds a bounding-box with a corresponding payload.
|
Set<T> |
contains(ReadableTuple3i point)
Which objects contain a particular point?
|
java.util.stream.Stream<T> |
containsStream(ReadableTuple3i point)
Like
contains(org.anchoranalysis.spatial.point.ReadableTuple3i) but returns a Stream instead of a Set . |
Set<T> |
intersectsWith(BoundingBox toIntersectWith)
Which bounding-boxes intersect with another specific bounding box?
|
java.util.stream.Stream<T> |
intersectsWithStream(BoundingBox toIntersectWith)
|
void |
remove(BoundingBox box,
T payload)
Removes a particular item from the r-tree, identified by its bounding-box and payload.
|
add, arbitraryElement, asSet, containsStream, intersectsWithStream, isEmpty, remove, size
public BoundingBoxRTree()
public BoundingBoxRTree(int maxNumberEntries)
maxNumberEntries
- maximum number of entries in the r-treepublic Set<T> contains(ReadableTuple3i point)
point
- the pointpoint
.public java.util.stream.Stream<T> containsStream(ReadableTuple3i point)
contains(org.anchoranalysis.spatial.point.ReadableTuple3i)
but returns a Stream
instead of a Set
.point
- the pointpoint
.public void add(BoundingBox box, T payload)
Note that the payload must not be unique, and multiple identical elements can exist with the same bounding-box and payload.
box
- the box to addpayload
- the payload associated with the bounding-boxpublic Set<T> intersectsWith(BoundingBox toIntersectWith)
toIntersectWith
- the box that must be intersected withtoIntersectWith
.public java.util.stream.Stream<T> intersectsWithStream(BoundingBox toIntersectWith)
toIntersectWith
- the box that must be intersected withtoIntersectWith
.public void remove(BoundingBox box, T payload)
If no entry can be found matching exactly the box
and payload
, no change
happens to the r-tree. No error is reported.
If multiple entries exist that match exactly the box
and payload
, then all
entries are removed.
If box
exists but with a different payload
, behaviour is undefined. Either
box
is removed, or no change occurs.
box
- the bounding-boxpayload
- the payloadCopyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.