Struct libreda_db::prelude::RegularRepetition [−][src]
Describe a equi-spaced n*m two-dimensional repetition as a lattice.
The offsets are computed as (i*a, j*b)
for i
in 0..n
and j
in 0..m
.
a
and b
the distance vectors between two neighbouring points.
Implementations
impl<T> RegularRepetition<T> where
T: CoordinateType,
[src]
T: CoordinateType,
pub fn new(a: Vector<T>, b: Vector<T>, n: u32, m: u32) -> RegularRepetition<T>
[src]
Create a new lattice based repetition.
Parameters
a, b
: Lattice vectors.n, m
: Number of repetitions in directionsa
andb
.
pub fn new_rectilinear(
spacing_x: T,
spacing_y: T,
num_x: u32,
num_y: u32
) -> RegularRepetition<T>
[src]
spacing_x: T,
spacing_y: T,
num_x: u32,
num_y: u32
) -> RegularRepetition<T>
Create a repetition along the x and y axis.
Example
use iron_shapes::prelude::RegularRepetition; let rep = RegularRepetition::new_rectilinear(1, 1, 1, 2); assert_eq!(rep.len(), 2); let offsets: Vec<_> = rep.iter().collect(); assert_eq!(offsets, [(0, 0).into(), (0, 1).into()]);
pub fn iter(self) -> impl Iterator<Item = Vector<T>>
[src]
Iterate over each offsets of this repetition.
pub fn len(&self) -> usize
[src]
Return the number of offsets in this repetition.
Trait Implementations
impl<T> Clone for RegularRepetition<T> where
T: Clone + CoordinateType,
[src]
T: Clone + CoordinateType,
pub fn clone(&self) -> RegularRepetition<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Copy for RegularRepetition<T> where
T: Copy + CoordinateType,
[src]
T: Copy + CoordinateType,
impl<T> Debug for RegularRepetition<T> where
T: Debug + CoordinateType,
[src]
T: Debug + CoordinateType,
impl<T> Eq for RegularRepetition<T> where
T: Eq + CoordinateType,
[src]
T: Eq + CoordinateType,
impl<T> Hash for RegularRepetition<T> where
T: Hash + CoordinateType,
[src]
T: Hash + CoordinateType,
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T> PartialEq<RegularRepetition<T>> for RegularRepetition<T> where
T: PartialEq<T> + CoordinateType,
[src]
T: PartialEq<T> + CoordinateType,
pub fn eq(&self, other: &RegularRepetition<T>) -> bool
[src]
pub fn ne(&self, other: &RegularRepetition<T>) -> bool
[src]
impl<T> StructuralEq for RegularRepetition<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> StructuralPartialEq for RegularRepetition<T> where
T: CoordinateType,
[src]
T: CoordinateType,
Auto Trait Implementations
impl<T> RefUnwindSafe for RegularRepetition<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for RegularRepetition<T> where
T: Send,
T: Send,
impl<T> Sync for RegularRepetition<T> where
T: Sync,
T: Sync,
impl<T> Unpin for RegularRepetition<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for RegularRepetition<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> TextType for T where
T: Clone + Eq + Debug + Hash,
[src]
T: Clone + Eq + Debug + Hash,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,