[][src]Struct pathfinder::Map

pub struct Map { /* fields omitted */ }

High abstraction Map which helps position objects.

Methods

impl Map[src]

pub fn new() -> Self[src]

Creates a new map, no min_max are intially required and are generated automatically when calling Map::map.

pub fn save(self, path: &Path) -> Result<(), Error>[src]

Saves the image to disk at the given Path.

Examples

let nodes = Node::from_list(&[(0, 0), (10, 10)]);
Map::new()
.map(&nodes)
.save(Path::new("/tmp/example.png"))?;

pub fn consume(self) -> IW[src]

Consumes the Map and returns the ImageWrapper.

pub fn map<T: Draw + Location + Hash + MinMax>(self, element: &[T]) -> Self[src]

Maps any struct that has implemented Draw, on to an ImageBuffer.

Examples

let nodes: Vec<Node> = Node::from_list(&[(0, 0), (100, 100)]);

// Add content to vectors.

let mut map = Map::new();
map = map.map(&nodes);

pub fn map_filter<T: Draw + Location + Hash + MinMax>(
    self,
    element: &[T],
    filter: &dyn Fn(&T) -> bool
) -> Self
[src]

Maps the elements but with an added filter parameter to exclude elements.

pub fn map_shape<T: Draw + Location + Hash + MinMax>(
    self,
    element: &[T],
    shape: &Shape
) -> Self
[src]

Maps the elements with a specified shape struct.

pub fn map_absolute<T: Draw + Location + Hash + MinMax>(
    self,
    element: &[T]
) -> Self
[src]

Maps the elements without stabalizing the positions on the canvas.

pub fn map_params<T: Draw + Location + Hash + MinMax>(
    self,
    element: &[T],
    filter: &dyn Fn(&T) -> bool,
    shape: &Shape
) -> Self
[src]

Maps the elements but with all added parameters.

Trait Implementations

impl Default for Map[src]

impl Clone for Map[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Map[src]

Auto Trait Implementations

impl Send for Map

impl Unpin for Map

impl Sync for Map

impl UnwindSafe for Map

impl RefUnwindSafe for Map

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T[src]

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 
[src]

Sets value as a parameter of self.