[][src]Trait dinotree_alg::HasAabb

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

Trait to signify that this object has an axis aligned bounding box. get() must return a aabb with the same value in it while the element is in the dinotree. This is hard for the user not to do, this the user does not have &mut self, and the aabb is implied to belong to self. But it is still possible through the use of static objects or RefCell/ Mutex, etc. Using this type of methods the user could make different calls to get() return different aabbs. This is unsafe since we allow query algorithms to assume the following: If two object's aabb's don't intersect, then they can be mutated at the same time.

Associated Types

Loading content...

Required methods

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

Loading content...

Implementors

impl<'a, N: NumTrait, T> HasAabb for BBoxMut<'a, N, T>[src]

type Num = N

impl<'a, T: HasAabb> HasAabb for BBoxIndirect<'a, T>[src]

type Num = T::Num

impl<'a, T: HasAabb> HasAabb for ProtectedBBox<'a, T>[src]

type Num = T::Num

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

type Num = N

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

type Num = N

Loading content...