Struct pathfinder::Group [−][src]
Holds a set of nodes and applies properties to all child nodes when drawn. The group itself has no displayed output and is not visible.
Fields
settings: Node
nodes: Vec<Node>
Methods
impl Group
[src]
impl Group
pub fn new(name: &str, coordinates: Coordinate) -> Group
[src]
pub fn new(name: &str, coordinates: Coordinate) -> Group
Constructs a new Group
pub fn from_list<'z, 'k>(list: &[(i16, i16)]) -> Vec<Group>
[src]
pub fn from_list<'z, 'k>(list: &[(i16, i16)]) -> Vec<Group>
Converts a list of tuples (x,y) to a Vector of Groups. Names are assigned from "A" and upwards automatically.
use pathfinder::Group; let list = [(0,0), (10, 10), (15, 15)]; let groups = Group::from_list(&list); assert_eq!(groups.len(), 3);
pub fn link(&mut self, other: &Group)
[src]
pub fn link(&mut self, other: &Group)
Links together two groups.
use pathfinder::{Group, Square, Coordinate, Location}; let b: Group = Group::new("B", Coordinate::new(100,100)); let mut a: Group = Group::new("A", Coordinate::new(0,0)); a.link(&b);
impl<'a, 'b> Group
[src]
impl<'a, 'b> Group
pub fn get_nodes(&self) -> &Vec<Node>
[src]
pub fn get_nodes(&self) -> &Vec<Node>
Returns the nodes that exists inside the Group.
pub fn new_node(&mut self, name: &str)
[src]
pub fn new_node(&mut self, name: &str)
Adds a Node dynamically to the Group.
pub fn new_node_min_auto(&mut self, name: &str, min: u32) -> &Node
[src]
pub fn new_node_min_auto(&mut self, name: &str, min: u32) -> &Node
Adds a Node with a static distance from the center of the Group.
pub fn new_node_min_max(&mut self, name: &str, min: u32, max: u32) -> &Node
[src]
pub fn new_node_min_max(&mut self, name: &str, min: u32, max: u32) -> &Node
Adds a Node with a specific minimum and maximum distance from the center of the Group.
pub fn new_node_inner(&mut self, geo: Coordinate, name: &str) -> &Node
[src]
pub fn new_node_inner(&mut self, geo: Coordinate, name: &str) -> &Node
Constructs a new node for the Group and mirrors the properties to it.
pub fn new_simple(x: i16, y: i16) -> Group
[src]
pub fn new_simple(x: i16, y: i16) -> Group
Removes all non-essentials from the standard implementation.
pub fn push(&mut self, node: Node)
[src]
pub fn push(&mut self, node: Node)
Pushes a Node to the Group.
pub fn get_dynamic_radius(&self) -> u32
[src]
pub fn get_dynamic_radius(&self) -> u32
Returns a dynamic radius based on the number of Nodes in the Group.
pub fn gen_color(&self, coordinates: Coordinate) -> Rgba<u8>
[src]
pub fn gen_color(&self, coordinates: Coordinate) -> Rgba<u8>
Generates an image::Rgba based on the color of the Group and the distance from center.
Trait Implementations
impl Clone for Group
[src]
impl Clone for Group
fn clone(&self) -> Group
[src]
fn clone(&self) -> Group
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Group
[src]
impl Debug for Group
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a, 'b> Location for Group
[src]
impl<'a, 'b> Location for Group
fn get_coordinate(&self) -> Coordinate
[src]
fn get_coordinate(&self) -> Coordinate
fn get_parameters(&self) -> (Coordinate, Coordinate)
[src]
fn get_parameters(&self) -> (Coordinate, Coordinate)
fn find(&self, hash: u64) -> Option<Coordinate>
[src]
fn find(&self, hash: u64) -> Option<Coordinate>
impl<'a, 'b> Draw for Group
[src]
impl<'a, 'b> Draw for Group
fn draw<S: Shape>(
&self,
image: ImageBuffer<Rgba<u8>, Vec<u8>>,
x_offset: i16,
y_offset: i16,
size: u32,
shape: &S
) -> ImageBuffer<Rgba<u8>, Vec<u8>>
[src]
fn draw<S: Shape>(
&self,
image: ImageBuffer<Rgba<u8>, Vec<u8>>,
x_offset: i16,
y_offset: i16,
size: u32,
shape: &S
) -> ImageBuffer<Rgba<u8>, Vec<u8>>
Draws the Nodes inside that Group. If none the Group is draw as blank.
fn get_size(&self) -> u32
[src]
fn get_size(&self) -> u32
fn get_links(&self) -> &[HashLink]
[src]
fn get_links(&self) -> &[HashLink]
impl<'a, 'b> Hash for Group
[src]
impl<'a, 'b> Hash for Group