pub struct CartesianPoint<'m> { /* private fields */ }Expand description
A borrowed view of an IfcCartesianPoint.
Implementations§
Source§impl<'m> CartesianPoint<'m>
impl<'m> CartesianPoint<'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 IfcCartesianPoint.
Sourcepub fn coordinates(&self) -> GeometryResult<Vec<f64>>
pub fn coordinates(&self) -> GeometryResult<Vec<f64>>
The raw Coordinates list, exactly as long as the file wrote it.
Sourcepub fn dimension(&self) -> GeometryResult<usize>
pub fn dimension(&self) -> GeometryResult<usize>
How many coordinates the point actually carries: 2 or 3.
A length outside that range is crate::GeometryError::Degenerate: the
schema’s CP2Dor3D rule requires at least 2, and a 1- or 4-element
list has no defined meaning.
Sourcepub fn coordinates_3d(&self) -> GeometryResult<[f64; 3]>
pub fn coordinates_3d(&self) -> GeometryResult<[f64; 3]>
The coordinates promoted to 3D, padding a 2D point with z = 0.
Deliberately a separate call from Self::coordinates: padding is a
decision about the point’s meaning, so the caller makes it. Check
Self::dimension first when the distinction matters.
Trait Implementations§
Source§impl<'m> Clone for CartesianPoint<'m>
impl<'m> Clone for CartesianPoint<'m>
impl<'m> Copy for CartesianPoint<'m>
Auto Trait Implementations§
impl<'m> Freeze for CartesianPoint<'m>
impl<'m> RefUnwindSafe for CartesianPoint<'m>
impl<'m> Send for CartesianPoint<'m>
impl<'m> Sync for CartesianPoint<'m>
impl<'m> Unpin for CartesianPoint<'m>
impl<'m> UnsafeUnpin for CartesianPoint<'m>
impl<'m> UnwindSafe for CartesianPoint<'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