Enum splashsurf_lib::topology::CartesianAxis3d
source · pub enum CartesianAxis3d {
X,
Y,
Z,
}
Expand description
The cartesian coordinate axes in 3D
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 moreimpl Copy for CartesianAxis3d
impl Eq for CartesianAxis3d
impl StructuralEq for CartesianAxis3d
impl StructuralPartialEq for CartesianAxis3d
Auto Trait Implementations§
impl RefUnwindSafe for CartesianAxis3d
impl Send for CartesianAxis3d
impl Sync for CartesianAxis3d
impl Unpin for CartesianAxis3d
impl UnwindSafe for CartesianAxis3d
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.