Struct castep_model_core::atom::AtomCollection
source · pub struct AtomCollection<T: ModelInfo> { /* private fields */ }Expand description
Struct of Atom as data-driven design.
Implementations§
source§impl<T: ModelInfo> AtomCollection<T>
impl<T: ModelInfo> AtomCollection<T>
sourcepub fn update_symbol_at(
&mut self,
index: usize,
new_symbol: &str
) -> Result<(), InvalidIndex>
pub fn update_symbol_at(
&mut self,
index: usize,
new_symbol: &str
) -> Result<(), InvalidIndex>
Update the element_symbol at the given index.
Errors
This function will return an error if the index is out of bounds.
Examples found in repository?
src/atom/mod.rs (line 144)
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
pub fn update_atom_at(&mut self, index: usize, new_atom: Atom<T>) -> Result<(), InvalidIndex> {
let Atom {
element_symbol,
atomic_number: element_id,
xyz,
fractional_xyz,
atom_id,
format_type: _,
} = new_atom;
self.update_symbol_at(index, &element_symbol)?;
self.update_elm_id_at(index, element_id)?;
self.update_xyz_at(index, xyz)?;
self.update_frac_xyz_at(index, fractional_xyz)?;
self.update_atom_id_at(index, atom_id)?;
Ok(())
}sourcepub fn update_elm_id_at(
&mut self,
index: usize,
new_elm_id: u8
) -> Result<(), InvalidIndex>
pub fn update_elm_id_at(
&mut self,
index: usize,
new_elm_id: u8
) -> Result<(), InvalidIndex>
Update the element_id at the given index.
Errors
This function will return an error if the index is out of bounds.
Examples found in repository?
src/atom/mod.rs (line 145)
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
pub fn update_atom_at(&mut self, index: usize, new_atom: Atom<T>) -> Result<(), InvalidIndex> {
let Atom {
element_symbol,
atomic_number: element_id,
xyz,
fractional_xyz,
atom_id,
format_type: _,
} = new_atom;
self.update_symbol_at(index, &element_symbol)?;
self.update_elm_id_at(index, element_id)?;
self.update_xyz_at(index, xyz)?;
self.update_frac_xyz_at(index, fractional_xyz)?;
self.update_atom_id_at(index, atom_id)?;
Ok(())
}sourcepub fn update_xyz_at(
&mut self,
index: usize,
new_xyz: Point3<f64>
) -> Result<(), InvalidIndex>
pub fn update_xyz_at(
&mut self,
index: usize,
new_xyz: Point3<f64>
) -> Result<(), InvalidIndex>
Update the xyz at the given index.
Errors
This function will return an error if the index is out of bounds.
Examples found in repository?
src/atom/mod.rs (line 146)
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
pub fn update_atom_at(&mut self, index: usize, new_atom: Atom<T>) -> Result<(), InvalidIndex> {
let Atom {
element_symbol,
atomic_number: element_id,
xyz,
fractional_xyz,
atom_id,
format_type: _,
} = new_atom;
self.update_symbol_at(index, &element_symbol)?;
self.update_elm_id_at(index, element_id)?;
self.update_xyz_at(index, xyz)?;
self.update_frac_xyz_at(index, fractional_xyz)?;
self.update_atom_id_at(index, atom_id)?;
Ok(())
}sourcepub fn update_frac_xyz_at(
&mut self,
index: usize,
new_frac: Option<Point3<f64>>
) -> Result<(), InvalidIndex>
pub fn update_frac_xyz_at(
&mut self,
index: usize,
new_frac: Option<Point3<f64>>
) -> Result<(), InvalidIndex>
Update the fractional_xyz at the given index.
Errors
This function will return an error if the index is out of bounds.
Examples found in repository?
src/atom/mod.rs (line 147)
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
pub fn update_atom_at(&mut self, index: usize, new_atom: Atom<T>) -> Result<(), InvalidIndex> {
let Atom {
element_symbol,
atomic_number: element_id,
xyz,
fractional_xyz,
atom_id,
format_type: _,
} = new_atom;
self.update_symbol_at(index, &element_symbol)?;
self.update_elm_id_at(index, element_id)?;
self.update_xyz_at(index, xyz)?;
self.update_frac_xyz_at(index, fractional_xyz)?;
self.update_atom_id_at(index, atom_id)?;
Ok(())
}sourcepub fn update_atom_id_at(
&mut self,
index: usize,
new_atom_id: u32
) -> Result<(), InvalidIndex>
pub fn update_atom_id_at(
&mut self,
index: usize,
new_atom_id: u32
) -> Result<(), InvalidIndex>
Update the atom_id at the given index.
Errors
This function will return an error if the index is out of bounds.
Examples found in repository?
src/atom/mod.rs (line 148)
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
pub fn update_atom_at(&mut self, index: usize, new_atom: Atom<T>) -> Result<(), InvalidIndex> {
let Atom {
element_symbol,
atomic_number: element_id,
xyz,
fractional_xyz,
atom_id,
format_type: _,
} = new_atom;
self.update_symbol_at(index, &element_symbol)?;
self.update_elm_id_at(index, element_id)?;
self.update_xyz_at(index, xyz)?;
self.update_frac_xyz_at(index, fractional_xyz)?;
self.update_atom_id_at(index, atom_id)?;
Ok(())
}sourcepub fn update_atom_at(
&mut self,
index: usize,
new_atom: Atom<T>
) -> Result<(), InvalidIndex>
pub fn update_atom_at(
&mut self,
index: usize,
new_atom: Atom<T>
) -> Result<(), InvalidIndex>
Update the whole atom at the given index.
Errors
This function will return an error if the index is out of bounds.
sourcepub fn view_atom_at(&self, index: usize) -> Result<AtomView<'_, T>, InvalidIndex>
pub fn view_atom_at(&self, index: usize) -> Result<AtomView<'_, T>, InvalidIndex>
Examples found in repository?
More examples
src/atom/mod.rs (line 231)
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
fn from(src: &'a AtomCollection<T>) -> Self {
(0..src.size)
.into_iter()
.map(|i| src.view_atom_at(i).unwrap())
.collect()
}
}
impl<T: ModelInfo> From<AtomCollection<T>> for Vec<Atom<T>> {
fn from(src: AtomCollection<T>) -> Self {
(0..src.size)
.into_iter()
.map(|i| -> Atom<T> {
let view = src.view_atom_at(i).unwrap();
view.into()
})
.collect()
}sourcepub fn element_symbols(&self) -> &[String]
pub fn element_symbols(&self) -> &[String]
Examples found in repository?
src/model_type/cell.rs (line 306)
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
pub fn spin_total(&self) -> u8 {
self.atoms()
.element_symbols()
.iter()
.map(|symbol| -> u8 { ELEMENT_TABLE.get_by_symbol(symbol).unwrap().spin })
.reduce(|total, next| total + next)
.unwrap()
}
/// Build `KptAux` struct
pub fn build_kptaux(&self) -> KptAux {
KptAux::new(
self.settings().kpoints_list().to_vec(),
self.settings().kpoints_grid(),
self.settings().kpoints_mp_spacing(),
self.settings().kpoints_mp_offset(),
)
}
/// Build `TrjAux` struct
pub fn build_trjaux(&self) -> TrjAux {
let atom_ids: Vec<u32> = self.atoms().atom_ids().to_vec();
TrjAux::new(atom_ids)
}
}
impl Display for AtomCollection<CellModel> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let all_positions_str: Vec<String> = self
.element_symbols()
.iter()
.zip(self.fractional_xyz().iter())
.map(|(symbol, frac_xyz)| -> String {
let spin = ELEMENT_TABLE.get_by_symbol(symbol).unwrap().spin();
let spin_str = if spin > 0 {
format!(" SPIN={:14.10}", spin)
} else {
"".into()
};
let frac_xyz = frac_xyz.unwrap();
format!(
"{:>3}{:20.16}{:20.16}{:20.16}{spin_str}",
symbol, frac_xyz.x, frac_xyz.y, frac_xyz.z
)
})
.collect();
let joined_positions_str = all_positions_str.join("\n");
write!(f, "{}", joined_positions_str)
}More examples
src/model_type/msi.rs (line 85)
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
fn from(src: T) -> Self {
let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
builder
.with_element_symbols(src.as_ref().element_symbols())
.unwrap()
.with_atomic_nums(src.as_ref().atomic_nums())
.unwrap()
.with_xyz_coords(src.as_ref().xyz_coords())
.unwrap()
.with_fractional_xyz(src.as_ref().fractional_xyz())
.unwrap()
.with_atom_ids(src.as_ref().atom_ids())
.unwrap()
.finish()
.unwrap()
.build()
}src/lattice/mod.rs (line 67)
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
pub fn list_element(&self) -> Vec<String> {
let mut elm_list: Vec<(String, u8)> = vec![];
elm_list.extend(
self.atoms()
.element_symbols()
.iter()
.zip(self.atoms.atomic_nums().iter())
.map(|(sym, id)| (sym.to_string(), *id))
.collect::<Vec<(String, u8)>>()
.drain(..)
.collect::<HashSet<(String, u8)>>()
.into_iter(),
);
elm_list.sort_unstable_by(|a, b| {
let (_, id_a) = a;
let (_, id_b) = b;
id_a.cmp(id_b)
});
elm_list
.iter()
.map(|(name, _)| name.to_string())
.collect::<Vec<String>>()
}sourcepub fn atomic_nums(&self) -> &[u8] ⓘ
pub fn atomic_nums(&self) -> &[u8] ⓘ
Examples found in repository?
src/model_type/msi.rs (line 87)
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
fn from(src: T) -> Self {
let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
builder
.with_element_symbols(src.as_ref().element_symbols())
.unwrap()
.with_atomic_nums(src.as_ref().atomic_nums())
.unwrap()
.with_xyz_coords(src.as_ref().xyz_coords())
.unwrap()
.with_fractional_xyz(src.as_ref().fractional_xyz())
.unwrap()
.with_atom_ids(src.as_ref().atom_ids())
.unwrap()
.finish()
.unwrap()
.build()
}More examples
src/lattice/mod.rs (line 69)
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
pub fn list_element(&self) -> Vec<String> {
let mut elm_list: Vec<(String, u8)> = vec![];
elm_list.extend(
self.atoms()
.element_symbols()
.iter()
.zip(self.atoms.atomic_nums().iter())
.map(|(sym, id)| (sym.to_string(), *id))
.collect::<Vec<(String, u8)>>()
.drain(..)
.collect::<HashSet<(String, u8)>>()
.into_iter(),
);
elm_list.sort_unstable_by(|a, b| {
let (_, id_a) = a;
let (_, id_b) = b;
id_a.cmp(id_b)
});
elm_list
.iter()
.map(|(name, _)| name.to_string())
.collect::<Vec<String>>()
}sourcepub fn xyz_coords(&self) -> &[Point3<f64>]
pub fn xyz_coords(&self) -> &[Point3<f64>]
Examples found in repository?
src/atom/visitor.rs (line 11)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
pub fn get_xyz_by_id<T: ModelInfo>(
atom_collection: &AtomCollection<T>,
atom_id: u32,
) -> Option<&Point3<f64>> {
atom_collection.xyz_coords().get((atom_id - 1) as usize)
}
pub fn get_multiple_xyz_by_id<'a, 'b, T: ModelInfo>(
atom_collection: &'a AtomCollection<T>,
atom_ids: &'b [u32],
) -> Vec<Option<&'a Point3<f64>>> {
atom_ids
.iter()
.map(|&id| atom_collection.xyz_coords().get((id - 1) as usize))
.collect()
}More examples
src/model_type/msi.rs (line 89)
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
fn from(src: T) -> Self {
let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
builder
.with_element_symbols(src.as_ref().element_symbols())
.unwrap()
.with_atomic_nums(src.as_ref().atomic_nums())
.unwrap()
.with_xyz_coords(src.as_ref().xyz_coords())
.unwrap()
.with_fractional_xyz(src.as_ref().fractional_xyz())
.unwrap()
.with_atom_ids(src.as_ref().atom_ids())
.unwrap()
.finish()
.unwrap()
.build()
}src/model_type/cell.rs (line 71)
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
fn from(mut msi_model: T) -> Self {
let x_axis: Vector3<f64> = Vector::x();
let a_vec = msi_model
.as_ref()
.lattice_vectors()
.unwrap()
.vectors()
.column(0);
let a_to_x_angle = a_vec.angle(&x_axis);
if a_to_x_angle != 0.0 {
let rot_axis = a_vec.cross(&x_axis).normalize();
let rot_quatd: UnitQuaternion<f64> = UnitQuaternion::new(rot_axis * a_to_x_angle);
msi_model.as_mut().rotate(&rot_quatd);
}
let new_lat_vec = LatticeVectors::new(
msi_model
.as_ref()
.lattice_vectors()
.unwrap()
.vectors()
.to_owned(),
);
let fractional_coord_matrix = msi_model
.as_ref()
.lattice_vectors()
.unwrap()
.fractional_coord_matrix();
let mut cell_atoms: AtomCollection<CellModel> = msi_model.as_ref().atoms().clone().into();
let frac_coords: Vec<Point3<f64>> = cell_atoms
.xyz_coords()
.iter()
.map(|xyz| fractional_coord_matrix * xyz)
.collect();
cell_atoms
.fractional_xyz_mut()
.iter_mut()
.enumerate()
.for_each(|(i, f_xyz)| {
*f_xyz = Some(*frac_coords.get(i).unwrap());
});
Self::new(Some(new_lat_vec), cell_atoms, Settings::default())
}pub fn xyz_coords_mut(&mut self) -> &mut [Point3<f64>]
sourcepub fn fractional_xyz(&self) -> &[Option<Point3<f64>>]
pub fn fractional_xyz(&self) -> &[Option<Point3<f64>>]
Examples found in repository?
src/model_type/msi.rs (line 91)
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
fn from(src: T) -> Self {
let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
builder
.with_element_symbols(src.as_ref().element_symbols())
.unwrap()
.with_atomic_nums(src.as_ref().atomic_nums())
.unwrap()
.with_xyz_coords(src.as_ref().xyz_coords())
.unwrap()
.with_fractional_xyz(src.as_ref().fractional_xyz())
.unwrap()
.with_atom_ids(src.as_ref().atom_ids())
.unwrap()
.finish()
.unwrap()
.build()
}More examples
src/model_type/cell.rs (line 333)
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let all_positions_str: Vec<String> = self
.element_symbols()
.iter()
.zip(self.fractional_xyz().iter())
.map(|(symbol, frac_xyz)| -> String {
let spin = ELEMENT_TABLE.get_by_symbol(symbol).unwrap().spin();
let spin_str = if spin > 0 {
format!(" SPIN={:14.10}", spin)
} else {
"".into()
};
let frac_xyz = frac_xyz.unwrap();
format!(
"{:>3}{:20.16}{:20.16}{:20.16}{spin_str}",
symbol, frac_xyz.x, frac_xyz.y, frac_xyz.z
)
})
.collect();
let joined_positions_str = all_positions_str.join("\n");
write!(f, "{}", joined_positions_str)
}sourcepub fn fractional_xyz_mut(&mut self) -> &mut [Option<Point3<f64>>]
pub fn fractional_xyz_mut(&mut self) -> &mut [Option<Point3<f64>>]
Examples found in repository?
src/model_type/cell.rs (line 76)
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
fn from(mut msi_model: T) -> Self {
let x_axis: Vector3<f64> = Vector::x();
let a_vec = msi_model
.as_ref()
.lattice_vectors()
.unwrap()
.vectors()
.column(0);
let a_to_x_angle = a_vec.angle(&x_axis);
if a_to_x_angle != 0.0 {
let rot_axis = a_vec.cross(&x_axis).normalize();
let rot_quatd: UnitQuaternion<f64> = UnitQuaternion::new(rot_axis * a_to_x_angle);
msi_model.as_mut().rotate(&rot_quatd);
}
let new_lat_vec = LatticeVectors::new(
msi_model
.as_ref()
.lattice_vectors()
.unwrap()
.vectors()
.to_owned(),
);
let fractional_coord_matrix = msi_model
.as_ref()
.lattice_vectors()
.unwrap()
.fractional_coord_matrix();
let mut cell_atoms: AtomCollection<CellModel> = msi_model.as_ref().atoms().clone().into();
let frac_coords: Vec<Point3<f64>> = cell_atoms
.xyz_coords()
.iter()
.map(|xyz| fractional_coord_matrix * xyz)
.collect();
cell_atoms
.fractional_xyz_mut()
.iter_mut()
.enumerate()
.for_each(|(i, f_xyz)| {
*f_xyz = Some(*frac_coords.get(i).unwrap());
});
Self::new(Some(new_lat_vec), cell_atoms, Settings::default())
}sourcepub fn atom_ids(&self) -> &[u32]
pub fn atom_ids(&self) -> &[u32]
Examples found in repository?
More examples
src/model_type/msi.rs (line 93)
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
fn from(src: T) -> Self {
let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
builder
.with_element_symbols(src.as_ref().element_symbols())
.unwrap()
.with_atomic_nums(src.as_ref().atomic_nums())
.unwrap()
.with_xyz_coords(src.as_ref().xyz_coords())
.unwrap()
.with_fractional_xyz(src.as_ref().fractional_xyz())
.unwrap()
.with_atom_ids(src.as_ref().atom_ids())
.unwrap()
.finish()
.unwrap()
.build()
}sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Examples found in repository?
src/model_type/msi.rs (line 83)
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
fn from(src: T) -> Self {
let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
builder
.with_element_symbols(src.as_ref().element_symbols())
.unwrap()
.with_atomic_nums(src.as_ref().atomic_nums())
.unwrap()
.with_xyz_coords(src.as_ref().xyz_coords())
.unwrap()
.with_fractional_xyz(src.as_ref().fractional_xyz())
.unwrap()
.with_atom_ids(src.as_ref().atom_ids())
.unwrap()
.finish()
.unwrap()
.build()
}
}
impl<T> From<T> for LatticeModel<MsiModel>
where
T: AsRef<LatticeModel<CellModel>>,
{
fn from(cell_model: T) -> Self {
let new_lat_vec = LatticeVectors::new(
cell_model
.as_ref()
.lattice_vectors()
.unwrap()
.vectors()
.to_owned(),
);
// Convert the SoA to AoS for easier sorting.
let msi_atoms: AtomCollection<MsiModel> = cell_model.as_ref().atoms().into();
let mut msi_atom_array: Vec<Atom<MsiModel>> = msi_atoms.into();
msi_atom_array.sort_by_key(|a| a.atom_id());
// Convert AoS back to SoA.
let msi_atom_collection: AtomCollection<MsiModel> = msi_atom_array.into();
let mut msi_model = Self::new(Some(new_lat_vec), msi_atom_collection, Settings::default());
let y_axis: Vector3<f64> = Vector::y();
let b_vec = cell_model
.as_ref()
.lattice_vectors()
.unwrap()
.vectors()
.column(1);
let b_to_y_angle = b_vec.angle(&y_axis);
if b_to_y_angle != 0.0 {
let rot_axis = b_vec.cross(&y_axis).normalize();
let rot_quatd: UnitQuaternion<f64> = UnitQuaternion::new(rot_axis * b_to_y_angle);
msi_model.rotate(&rot_quatd);
}
msi_model
}
}
impl LatticeModel<MsiModel> {
pub fn msi_export(&self) -> String {
if let Some(lattice_vectors) = self.lattice_vectors() {
let headers_vectors: Vec<String> = vec![
"# MSI CERIUS2 DataModel File Version 4 0\n".to_string(),
"(1 Model\n".to_string(),
" (A I CRY/DISPLAY (192 256))\n".to_string(),
format!(" (A I PeriodicType {})\n", self.settings().periodic_type()),
format!(" (A C SpaceGroup \"{}\")\n", self.settings().space_group()),
format!("{}", lattice_vectors),
format!(
" (A D CRY/TOLERANCE {})\n",
self.settings().cry_tolerance()
),
];
format!("{}{})", headers_vectors.concat(), self.atoms())
} else {
let headers = "# MSI CERIUS2 DataModel File Version 4 0\n(1 Model\n";
format!("{}{})", headers, self.atoms())
}
}
}
impl<'a> Display for AtomView<'a, MsiModel> {
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(),
)
}
}
impl Display for AtomCollection<MsiModel> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let msi_atom_strings: Vec<String> = (0..self.size())
.into_iter()
.map(|i| {
let atom_view = self.view_atom_at(i).unwrap();
format!("{}", atom_view)
})
.collect();
write!(f, "{}", msi_atom_strings.concat())
}Trait Implementations§
source§impl<T: ModelInfo> Add<AtomCollection<T>> for AtomCollection<T>
impl<T: ModelInfo> Add<AtomCollection<T>> for AtomCollection<T>
source§impl<T: ModelInfo> AsRef<AtomCollection<T>> for &AtomCollection<T>
impl<T: ModelInfo> AsRef<AtomCollection<T>> for &AtomCollection<T>
source§fn as_ref(&self) -> &AtomCollection<T>
fn as_ref(&self) -> &AtomCollection<T>
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<T: Clone + ModelInfo> Clone for AtomCollection<T>
impl<T: Clone + ModelInfo> Clone for AtomCollection<T>
source§fn clone(&self) -> AtomCollection<T>
fn clone(&self) -> AtomCollection<T>
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<T: Default + ModelInfo> Default for AtomCollection<T>
impl<T: Default + ModelInfo> Default for AtomCollection<T>
source§fn default() -> AtomCollection<T>
fn default() -> AtomCollection<T>
Returns the “default value” for a type. Read more
source§impl Display for AtomCollection<CellModel>
impl Display for AtomCollection<CellModel>
source§impl Display for AtomCollection<MsiModel>
impl Display for AtomCollection<MsiModel>
source§impl<'a, T: ModelInfo> From<&'a AtomCollection<T>> for Vec<AtomView<'a, T>>
impl<'a, T: ModelInfo> From<&'a AtomCollection<T>> for Vec<AtomView<'a, T>>
source§fn from(src: &'a AtomCollection<T>) -> Self
fn from(src: &'a AtomCollection<T>) -> Self
Converts to this type from the input type.
source§impl From<AtomCollection<MsiModel>> for AtomCollection<CellModel>
impl From<AtomCollection<MsiModel>> for AtomCollection<CellModel>
source§fn from(src: AtomCollection<MsiModel>) -> Self
fn from(src: AtomCollection<MsiModel>) -> Self
Converts to this type from the input type.
source§impl<T: ModelInfo> From<AtomCollection<T>> for Vec<Atom<T>>
impl<T: ModelInfo> From<AtomCollection<T>> for Vec<Atom<T>>
source§fn from(src: AtomCollection<T>) -> Self
fn from(src: AtomCollection<T>) -> Self
Converts to this type from the input type.
source§impl<T> From<T> for AtomCollection<MsiModel>where
T: AsRef<AtomCollection<CellModel>>,
impl<T> From<T> for AtomCollection<MsiModel>where
T: AsRef<AtomCollection<CellModel>>,
source§impl<T> Transformation for AtomCollection<T>where
T: ModelInfo,
impl<T> Transformation for AtomCollection<T>where
T: ModelInfo,
fn rotate(&mut self, rotate_quatd: &UnitQuaternion<f64>)
fn translate(&mut self, translate_matrix: &Translation<f64, 3>)
Auto Trait Implementations§
impl<T> RefUnwindSafe for AtomCollection<T>where
T: RefUnwindSafe,
impl<T> Send for AtomCollection<T>where
T: Send,
impl<T> Sync for AtomCollection<T>where
T: Sync,
impl<T> Unpin for AtomCollection<T>where
T: Unpin,
impl<T> UnwindSafe for AtomCollection<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.