pub struct Vector<'m> { /* private fields */ }Expand description
A borrowed view of an IfcVector: a direction plus a length.
IFC separates the two because IfcDirection deliberately has no magnitude.
A vector’s Magnitude may legitimately be 0.0 (the schema only requires
>= 0), giving a zero vector with a well-defined orientation – so a zero
magnitude is not an error here, unlike a zero direction.
Implementations§
Source§impl<'m> Vector<'m>
impl<'m> Vector<'m>
Sourcepub fn new(id: EntityId, entity: &'m Entity) -> Self
pub fn new(id: EntityId, entity: &'m Entity) -> Self
Wrap an entity assumed to be an IfcVector.
Sourcepub fn orientation_ref(&self) -> GeometryResult<EntityId>
pub fn orientation_ref(&self) -> GeometryResult<EntityId>
The IfcDirection giving this vector’s orientation.
Sourcepub fn magnitude(&self) -> GeometryResult<f64>
pub fn magnitude(&self) -> GeometryResult<f64>
The vector’s length, in project length units.
Sourcepub fn components(&self, model: &'m Model) -> GeometryResult<[f64; 3]>
pub fn components(&self, model: &'m Model) -> GeometryResult<[f64; 3]>
The vector resolved to components: unit orientation times magnitude.
Trait Implementations§
Auto Trait Implementations§
impl<'m> Freeze for Vector<'m>
impl<'m> RefUnwindSafe for Vector<'m>
impl<'m> Send for Vector<'m>
impl<'m> Sync for Vector<'m>
impl<'m> Unpin for Vector<'m>
impl<'m> UnsafeUnpin for Vector<'m>
impl<'m> UnwindSafe for Vector<'m>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more