Struct castep_model_core::atom::AtomView
source · pub struct AtomView<'a, T: ModelInfo> { /* private fields */ }Implementations§
source§impl<'a, T: ModelInfo> AtomView<'a, T>
impl<'a, T: ModelInfo> AtomView<'a, T>
sourcepub fn xyz(&self) -> &Point3<f64>
pub fn xyz(&self) -> &Point3<f64>
Examples found in repository?
More examples
src/model_type/msi.rs (line 184)
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
r#" ({item_id} Atom
(A C ACL "{elm_id} {elm}")
(A C Label "{elm}")
(A D XYZ ({x:.12} {y:.12} {z:.12}))
(A I Id {atom_id})
)
"#,
item_id = self.atom_id() + 1,
elm_id = self.atomic_number(),
elm = self.element_symbol(),
x = self.xyz().x,
y = self.xyz().y,
z = self.xyz().z,
atom_id = self.atom_id(),
)
}sourcepub fn element_symbol(&self) -> &str
pub fn element_symbol(&self) -> &str
Examples found in repository?
More examples
src/model_type/msi.rs (line 183)
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
r#" ({item_id} Atom
(A C ACL "{elm_id} {elm}")
(A C Label "{elm}")
(A D XYZ ({x:.12} {y:.12} {z:.12}))
(A I Id {atom_id})
)
"#,
item_id = self.atom_id() + 1,
elm_id = self.atomic_number(),
elm = self.element_symbol(),
x = self.xyz().x,
y = self.xyz().y,
z = self.xyz().z,
atom_id = self.atom_id(),
)
}sourcepub fn atomic_number(&self) -> &u8
pub fn atomic_number(&self) -> &u8
Examples found in repository?
More examples
src/model_type/msi.rs (line 182)
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
r#" ({item_id} Atom
(A C ACL "{elm_id} {elm}")
(A C Label "{elm}")
(A D XYZ ({x:.12} {y:.12} {z:.12}))
(A I Id {atom_id})
)
"#,
item_id = self.atom_id() + 1,
elm_id = self.atomic_number(),
elm = self.element_symbol(),
x = self.xyz().x,
y = self.xyz().y,
z = self.xyz().z,
atom_id = self.atom_id(),
)
}sourcepub fn fractional_xyz(&self) -> Option<&Point3<f64>>
pub fn fractional_xyz(&self) -> Option<&Point3<f64>>
sourcepub fn atom_id(&self) -> &u32
pub fn atom_id(&self) -> &u32
Examples found in repository?
More examples
src/model_type/msi.rs (line 181)
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
r#" ({item_id} Atom
(A C ACL "{elm_id} {elm}")
(A C Label "{elm}")
(A D XYZ ({x:.12} {y:.12} {z:.12}))
(A I Id {atom_id})
)
"#,
item_id = self.atom_id() + 1,
elm_id = self.atomic_number(),
elm = self.element_symbol(),
x = self.xyz().x,
y = self.xyz().y,
z = self.xyz().z,
atom_id = self.atom_id(),
)
}Trait Implementations§
Auto Trait Implementations§
impl<'a, T> RefUnwindSafe for AtomView<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for AtomView<'a, T>where
T: Send,
impl<'a, T> Sync for AtomView<'a, T>where
T: Sync,
impl<'a, T> Unpin for AtomView<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for AtomView<'a, T>where
T: UnwindSafe,
Blanket Implementations§
§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.