Struct castep_model_core::atom::Atom
source · pub struct Atom<T: ModelInfo> { /* private fields */ }Expand description
Struct that defines an atom.
Implementations
sourceimpl<T> Atom<T>where
T: ModelInfo,
impl<T> Atom<T>where
T: ModelInfo,
sourcepub fn new(
element_symbol: String,
element_id: u32,
xyz: Point3<f64>,
atom_id: u32,
model_type: T
) -> Self
pub fn new(
element_symbol: String,
element_id: u32,
xyz: Point3<f64>,
atom_id: u32,
model_type: T
) -> Self
Creates a new Atom.
sourcepub fn element_symbol(&self) -> &str
pub fn element_symbol(&self) -> &str
Returns a reference to the element symbol of this Atom<Format>.
sourcepub fn set_element_symbol(&mut self, element_symbol: String)
pub fn set_element_symbol(&mut self, element_symbol: String)
Sets the element symbol of this Atom<Format>.
sourcepub fn element_id(&self) -> u32
pub fn element_id(&self) -> u32
Returns the element id of this Atom<Format>.
sourcepub fn set_element_id(&mut self, element_id: u32)
pub fn set_element_id(&mut self, element_id: u32)
Sets the element id of this Atom<Format>.
sourcepub fn xyz(&self) -> &Point3<f64>
pub fn xyz(&self) -> &Point3<f64>
Returns a reference to the xyz of this Atom<Format>.
sourcepub fn set_xyz(&mut self, xyz: Point3<f64>)
pub fn set_xyz(&mut self, xyz: Point3<f64>)
Sets the xyz of this Atom<Format>.
sourcepub fn atom_id(&self) -> u32
pub fn atom_id(&self) -> u32
Returns the atom id of this Atom<Format>.
sourcepub fn set_atom_id(&mut self, atom_id: u32)
pub fn set_atom_id(&mut self, atom_id: u32)
Sets the atom id of this Atom<Format>.
sourcepub fn model_type(&self) -> &T
pub fn model_type(&self) -> &T
Returns a reference to the format of this Atom<Format>.
sourcepub fn set_model_type(&mut self, model_type: T)
pub fn set_model_type(&mut self, model_type: T)
Sets the format of this Atom<Format>.
pub fn fractional_xyz(&self) -> Option<&Point3<f64>>
pub fn set_fractional_xyz(&mut self, fractional_xyz: Option<Point3<f64>>)
Trait Implementations
sourceimpl<T> Ord for Atom<T>where
T: ModelInfo,
impl<T> Ord for Atom<T>where
T: ModelInfo,
1.21.0 · sourcefn 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
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T> PartialEq<Atom<T>> for Atom<T>where
T: ModelInfo,
impl<T> PartialEq<Atom<T>> for Atom<T>where
T: ModelInfo,
sourceimpl<T> PartialOrd<Atom<T>> for Atom<T>where
T: ModelInfo,
impl<T> PartialOrd<Atom<T>> for Atom<T>where
T: ModelInfo,
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourcefn 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 moresourceimpl<T> Transformation for Atom<T>where
T: ModelInfo,
impl<T> Transformation for Atom<T>where
T: ModelInfo,
fn rotate(&mut self, rotate_quatd: &UnitQuaternion<f64>)
fn translate(&mut self, translate_matrix: &Translation<f64, 3>)
impl<T> Eq for Atom<T>where
T: ModelInfo,
Auto Trait Implementations
impl<T> RefUnwindSafe for Atom<T>where
T: RefUnwindSafe,
impl<T> Send for Atom<T>where
T: Send,
impl<T> Sync for Atom<T>where
T: Sync,
impl<T> Unpin for Atom<T>where
T: Unpin,
impl<T> UnwindSafe for Atom<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. 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 morefn 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.