Type Alias splashsurf_lib::topology::Axis
source · pub type Axis = CartesianAxis3d;
Expand description
Abbreviated type alias for cartesian coordinate axes in 3D
Aliased Type§
enum Axis {
X,
Y,
Z,
}
Variants§
Implementations§
source§impl CartesianAxis3d
impl CartesianAxis3d
sourcepub const fn all_possible() -> &'static [Axis; 3]
pub const fn all_possible() -> &'static [Axis; 3]
Returns a reference to an array containing all 3D cartesian axes
use crate::splashsurf_lib::topology::Axis;
assert_eq!(Axis::all_possible()[0], Axis::X);
assert_eq!(Axis::all_possible()[2], Axis::Z);
assert_eq!(Axis::all_possible().len(), 3);
sourcepub const fn dim(self) -> usize
pub const fn dim(self) -> usize
Converts the cartesian axis into the corresponding 3D dimension index (X=0, Y=1, Z=2)
use crate::splashsurf_lib::topology::Axis;
assert_eq!(Axis::X.dim(), 0);
assert_eq!(Axis::Y.dim(), 1);
assert_eq!(Axis::Z.dim(), 2);
sourcepub const fn orthogonal_axes(&self) -> [Self; 2]
pub const fn orthogonal_axes(&self) -> [Self; 2]
Returns the other two axes that are orthogonal to the current axis
use crate::splashsurf_lib::topology::Axis;
assert_eq!(Axis::X.orthogonal_axes(), [Axis::Y, Axis::Z]);
sourcepub const fn with_direction(self, direction: Direction) -> DirectedAxis
pub const fn with_direction(self, direction: Direction) -> DirectedAxis
Combines this coordinate axis with a direction into a DirectedAxis
use crate::splashsurf_lib::topology::{Axis, DirectedAxis, Direction};
assert_eq!(Axis::X.with_direction(Direction::Positive), DirectedAxis::new(Axis::X, Direction::Positive));
Trait Implementations§
source§impl Clone for CartesianAxis3d
impl Clone for CartesianAxis3d
source§fn clone(&self) -> CartesianAxis3d
fn clone(&self) -> CartesianAxis3d
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CartesianAxis3d
impl Debug for CartesianAxis3d
source§impl Hash for CartesianAxis3d
impl Hash for CartesianAxis3d
source§impl Ord for CartesianAxis3d
impl Ord for CartesianAxis3d
source§fn cmp(&self, other: &CartesianAxis3d) -> Ordering
fn cmp(&self, other: &CartesianAxis3d) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<CartesianAxis3d> for CartesianAxis3d
impl PartialEq<CartesianAxis3d> for CartesianAxis3d
source§fn eq(&self, other: &CartesianAxis3d) -> bool
fn eq(&self, other: &CartesianAxis3d) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<CartesianAxis3d> for CartesianAxis3d
impl PartialOrd<CartesianAxis3d> for CartesianAxis3d
source§fn partial_cmp(&self, other: &CartesianAxis3d) -> Option<Ordering>
fn partial_cmp(&self, other: &CartesianAxis3d) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more