FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Rect3D

    struct · ferroui-media3d · v0.5.0

    struct Rect3D
    

    An axis-aligned box in 3D space: a location (its corner of least coordinates) and a size, with double-precision values (WPF's System.Windows.Media.Media3D.Rect3D). The bounds of the 3D scene model are boxes.

    Rect3D::EMPTY is the box of nothing: its location is positive infinity and its size is Size3D::EMPTY. It contains nothing, intersects nothing, and is the identity of union. The members that WPF guards with exceptions return a Size3DError.

    View source

    Members

    EMPTY

    const EMPTY: Rect3D
    

    The box of nothing (WPF's Rect3D.Empty).

    Source

    new

    fn new(x: f64, y: f64, z: f64, size_x: f64, size_y: f64, size_z: f64) -> Result<Self, Size3DError>
    

    A box with the given location and size; Size3DError::NegativeDimension when a size is negative.

    Source

    from_location_size

    fn from_location_size(location: Point3D, size: Size3D) -> Self
    

    A box at the location with the size; Rect3D::EMPTY when the size is empty.

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Whether this is Rect3D::EMPTY.

    Source

    x

    fn x(self: &Self) -> f64
    

    The X coordinate of the location.

    Source

    y

    fn y(self: &Self) -> f64
    

    The Y coordinate of the location.

    Source

    z

    fn z(self: &Self) -> f64
    

    The Z coordinate of the location.

    Source

    size_x

    fn size_x(self: &Self) -> f64
    

    The extent along the X axis.

    Source

    size_y

    fn size_y(self: &Self) -> f64
    

    The extent along the Y axis.

    Source

    size_z

    fn size_z(self: &Self) -> f64
    

    The extent along the Z axis.

    Source

    location

    fn location(self: &Self) -> Point3D
    

    The corner of least coordinates.

    Source

    size

    fn size(self: &Self) -> Size3D
    

    The size; Size3D::EMPTY for the empty box.

    Source

    set_x

    fn set_x(self: &mut Self, value: f64) -> Result<(), Size3DError>
    

    Sets the X coordinate of the location; the empty box cannot be moved.

    Source

    set_y

    fn set_y(self: &mut Self, value: f64) -> Result<(), Size3DError>
    

    Sets the Y coordinate of the location; the empty box cannot be moved.

    Source

    set_z

    fn set_z(self: &mut Self, value: f64) -> Result<(), Size3DError>
    

    Sets the Z coordinate of the location; the empty box cannot be moved.

    Source

    set_size_x

    fn set_size_x(self: &mut Self, value: f64) -> Result<(), Size3DError>
    

    Sets the extent along the X axis; the empty box cannot be changed, and a size is not negative.

    Source

    set_size_y

    fn set_size_y(self: &mut Self, value: f64) -> Result<(), Size3DError>
    

    Sets the extent along the Y axis; the empty box cannot be changed, and a size is not negative.

    Source

    set_size_z

    fn set_size_z(self: &mut Self, value: f64) -> Result<(), Size3DError>
    

    Sets the extent along the Z axis; the empty box cannot be changed, and a size is not negative.

    Source

    set_location

    fn set_location(self: &mut Self, location: Point3D) -> Result<(), Size3DError>
    

    Sets the location; the empty box cannot be moved.

    Source

    set_size

    fn set_size(self: &mut Self, size: Size3D) -> Result<(), Size3DError>
    

    Sets the size: the empty size makes this the empty box; another size cannot be given to the empty box.

    Source

    contains

    fn contains(self: &Self, point: Point3D) -> bool
    

    Whether the point is in the box or on its faces; never for the empty box.

    Source

    contains_xyz

    fn contains_xyz(self: &Self, x: f64, y: f64, z: f64) -> bool
    

    Whether the point with the coordinates is in the box or on its faces; never for the empty box.

    Source

    contains_rect

    fn contains_rect(self: &Self, rect: Rect3D) -> bool
    

    Whether the box is inside this one (faces may touch); never when either is empty.

    Source

    intersects_with

    fn intersects_with(self: &Self, rect: Rect3D) -> bool
    

    Whether the boxes share a point (touching faces count); never when either is empty.

    Source

    intersect

    fn intersect(self: &mut Self, rect: Rect3D)
    

    Makes this box the intersection of the two: Rect3D::EMPTY when they do not intersect.

    Source

    intersect_rects

    fn intersect_rects(rect1: Rect3D, rect2: Rect3D) -> Rect3D
    

    The intersection of two boxes (WPF's static Rect3D.Intersect).

    Source

    union

    fn union(self: &mut Self, rect: Rect3D)
    

    Makes this box the smallest box that contains both. The empty box adds nothing.

    Source

    union_point

    fn union_point(self: &mut Self, point: Point3D)
    

    Makes this box the smallest box that contains it and the point.

    Source

    union_rects

    fn union_rects(rect1: Rect3D, rect2: Rect3D) -> Rect3D
    

    The smallest box that contains both boxes (WPF's static Rect3D.Union).

    Source

    union_rect_point

    fn union_rect_point(rect: Rect3D, point: Point3D) -> Rect3D
    

    The smallest box that contains the box and the point (WPF's static Rect3D.Union of a box and a point).

    Source

    offset

    fn offset(self: &mut Self, offset: Vector3D) -> Result<(), Size3DError>
    

    Moves the box by the vector; the empty box cannot be moved.

    Source

    offset_xyz

    fn offset_xyz(self: &mut Self, offset_x: f64, offset_y: f64, offset_z: f64) -> Result<(), Size3DError>
    

    Moves the box by the given amounts; the empty box cannot be moved.

    Source

    offset_rect

    fn offset_rect(rect: Rect3D, offset: Vector3D) -> Result<Rect3D, Size3DError>
    

    The box moved by the vector (WPF's static Rect3D.Offset); the empty box cannot be moved.

    Source

    parse

    fn parse(text: &str) -> Result<Self, FormatError>
    

    Parses the text form: "Empty", or "x,y,z,sizeX,sizeY,sizeZ" (commas, white space or both between the numbers) in the invariant culture, with no negative size.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • MarkupTyped
    • Clone
    • Copy
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Default
    • FromStr
    • Display

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.