[][src]Trait dinotree::HasAabb

pub unsafe trait HasAabb {
    type Num: NumTrait;
    fn get(&self) -> &Rect<Self::Num>;
}

Marker trait to signify that this object has an axis aligned bounding box. If two HasAabb objects have aabb's that do not intersect, then it must be safe to have a mutable reference to each simultaneously.

The aabb must not change while the object is contained in the tree, even though many query algorithms will give mutable references to the elements in the tree. So multiple calls to get() must return the same bounding box region while the object is in the tree. Not doing so would violate invariants of the tree, and would thus make all the query algorithms performed on the tree would not be correct.

Not only will the algorithms not be correct, but undefined behavior may be introduced. Some algorithms rely on the positions of the bounding boxes to determined if two aabbs can be mutably borrowed at the same time. For example the multirect algorithm makes this assumption.

Associated Types

Loading content...

Required methods

fn get(&self) -> &Rect<Self::Num>

Loading content...

Implementors

impl<N: NumTrait, T> HasAabb for BBox<N, T>
[src]

type Num = N

Loading content...