pub struct PatternManager { /* private fields */ }Expand description
Pattern manager for handling multiple patterns
Implementations§
Source§impl PatternManager
impl PatternManager
Sourcepub fn add_pattern(&mut self, pattern: TilingPattern) -> Result<String>
pub fn add_pattern(&mut self, pattern: TilingPattern) -> Result<String>
Add a pattern and return its name
Sourcepub fn get_pattern(&self, name: &str) -> Option<&TilingPattern>
pub fn get_pattern(&self, name: &str) -> Option<&TilingPattern>
Get a pattern by name
Sourcepub fn patterns(&self) -> &HashMap<String, TilingPattern>
pub fn patterns(&self) -> &HashMap<String, TilingPattern>
Get all patterns
Sourcepub fn remove_pattern(&mut self, name: &str) -> Option<TilingPattern>
pub fn remove_pattern(&mut self, name: &str) -> Option<TilingPattern>
Remove a pattern
Sourcepub fn to_resource_dictionary(&self) -> Result<String>
pub fn to_resource_dictionary(&self) -> Result<String>
Generate pattern resource dictionary
Sourcepub fn create_checkerboard_pattern(
&mut self,
cell_size: f64,
color1: [f64; 3],
color2: [f64; 3],
) -> Result<String>
pub fn create_checkerboard_pattern( &mut self, cell_size: f64, color1: [f64; 3], color2: [f64; 3], ) -> Result<String>
Create a simple checkerboard pattern
Trait Implementations§
Source§impl Clone for PatternManager
impl Clone for PatternManager
Source§fn clone(&self) -> PatternManager
fn clone(&self) -> PatternManager
Returns a duplicate 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 PatternManager
impl Debug for PatternManager
Auto Trait Implementations§
impl Freeze for PatternManager
impl RefUnwindSafe for PatternManager
impl Send for PatternManager
impl Sync for PatternManager
impl Unpin for PatternManager
impl UnwindSafe for PatternManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().