[−][src]Struct plexus::graph::VertexView

pub struct VertexView<M, G> where    M: Reborrow,    M::Target: AsStorage<VertexPayload<G>>,    G: GraphGeometry,  { /* fields omitted */ }

View of a vertex in a graph.

Provides traversals, queries, and mutations related to vertices in a graph. See the module documentation for more information about topological views.

Methods

impl<M, G> VertexView<M, G> where    M: Reborrow,    M::Target: AsStorage<VertexPayload<G>>,    G: GraphGeometry, [src]

pub fn key(&self) -> VertexKey[src]

Gets the key for the vertex.

impl<'a, M, G> VertexView<&'a mut M, G> where    M: 'a + AsStorage<VertexPayload<G>> + AsStorageMut<VertexPayload<G>>,    G: 'a + GraphGeometry, [src]

pub fn into_orphan(self) -> VertexOrphan<'a, G>[src]

Converts a mutable view into an orphan view.

pub fn into_ref(self) -> VertexView<&'a M, G>[src]

Converts a mutable view into an immutable view.

This is useful when mutations are not (or no longer) needed and mutual access is desired.

Examples

use decorum::N64;
use nalgebra::Point3;
use plexus::graph::MeshGraph;
use plexus::prelude::*;
use plexus::primitive::cube::Cube;
use plexus::primitive::generate::Position;

let mut graph = Cube::new()
.polygons::<Position<Point3<N64>>>()
.collect::<MeshGraph<Point3<N64>>>();
let key = graph.arcs().nth(0).unwrap().key();
let vertex = graph.arc_mut(key).unwrap().split_at_midpoint().into_ref();

// This would not be possible without conversion into an immutable view.
let _ = vertex.into_outgoing_arc().into_face().unwrap();
let _ = vertex
.into_outgoing_arc()
.into_opposite_arc()
.into_face()
.unwrap();

impl<M, G> VertexView<M, G> where    M: Reborrow,    M::Target: AsStorage<ArcPayload<G>> + AsStorage<VertexPayload<G>> + Consistent,    G: GraphGeometry, [src]

pub fn into_outgoing_arc(self) -> ArcView<M, G>[src]

Converts the vertex into its leading (outgoing) arc.

pub fn outgoing_arc(&self) -> ArcView<&M::Target, G>[src]

Gets the leading (outgoing) arc of the vertex.

pub fn traverse_by_breadth(    &self) -> impl Clone + Iterator<Item = VertexView<&M::Target, G>>[src]

Gets an iterator that traverses the vertices of the graph in breadth-first order beginning with the vertex on which this function is called.

The traversal moves from the vertex to its neighboring vertices and so on. If there are disjoint subgraphs in the graph, then a traversal will not reach every vertex in the graph.

pub fn traverse_by_depth(    &self) -> impl Clone + Iterator<Item = VertexView<&M::Target, G>>[src]

Gets an iterator that traverses the vertices of the graph in depth-first order beginning with the vertex on which this function is called.

The traversal moves from the vertex to its neighboring vertices and so on. If there are disjoint subgraphs in the graph, then a traversal will not reach every vertex in the graph.

pub fn incoming_arcs(    &self) -> impl Clone + Iterator<Item = ArcView<&M::Target, G>>[src]

Gets an iterator of views over the incoming arcs of the vertex.

The ordering of arcs is deterministic and is based on the leading arc of the vertex.

pub fn outgoing_arcs(    &self) -> impl Clone + Iterator<Item = ArcView<&M::Target, G>>[src]

Gets an iterator of views over the outgoing arcs of the vertex.

The ordering of arcs is deterministic and is based on the leading arc of the vertex.

impl<M, G> VertexView<M, G> where    M: Reborrow + ReborrowMut,    M::Target: AsStorage<ArcPayload<G>> + AsStorageMut<ArcPayload<G>> + AsStorage<VertexPayload<G>> + Consistent,    G: GraphGeometry, [src]

pub fn incoming_arc_orphans(&mut self) -> impl Iterator<Item = ArcOrphan<G>>[src]

Gets an iterator of orphan views over the incoming arcs of the vertex.

The ordering of arcs is deterministic and is based on the leading arc of the vertex.

impl<M, G> VertexView<M, G> where    M: Reborrow,    M::Target: AsStorage<ArcPayload<G>> + AsStorage<FacePayload<G>> + AsStorage<VertexPayload<G>> + Consistent,    G: GraphGeometry, [src]

pub fn neighboring_faces(    &self) -> impl Clone + Iterator<Item = FaceView<&M::Target, G>>[src]

Gets an iterator of views over the neighboring faces of the vertex.

The ordering of faces is deterministic and is based on the leading arc of the vertex.

impl<M, G> VertexView<M, G> where    M: Reborrow + ReborrowMut,    M::Target: AsStorage<ArcPayload<G>> + AsStorage<FacePayload<G>> + AsStorageMut<FacePayload<G>> + AsStorage<VertexPayload<G>> + Consistent,    G: GraphGeometry, [src]

pub fn neighboring_face_orphans(    &mut self) -> impl Iterator<Item = FaceOrphan<G>>[src]

Gets an iterator of orphan views over the neighboring faces of the vertex.

The ordering of faces is deterministic and is based on the leading arc of the vertex.

impl<'a, M, G> VertexView<&'a mut M, G> where    M: AsStorage<ArcPayload<G>> + AsStorage<EdgePayload<G>> + AsStorage<FacePayload<G>> + AsStorage<VertexPayload<G>> + Default + Mutable<G>,    G: 'a + GraphGeometry, [src]

pub fn remove(self)[src]

Removes the vertex.

Any and all dependent topology is also removed, such as arcs and edges connected to the vertex, faces connected to such arcs, vertices with no remaining leading arc, etc.

Vertex removal is the most destructive removal, because vertices are a dependency of all other topological structures.

Examples

Removing a corner from a cube by removing its vertex:

use decorum::N64;
use nalgebra::Point3;
use plexus::graph::MeshGraph;
use plexus::prelude::*;
use plexus::primitive::cube::Cube;
use plexus::primitive::generate::Position;

let mut graph = Cube::new()
.polygons::<Position<Point3<N64>>>()
.collect::<MeshGraph<Point3<f64>>>();
let key = graph.vertices().nth(0).unwrap().key();
graph.vertex_mut(key).unwrap().remove();

Trait Implementations

impl<M, G> Deref for VertexView<M, G> where    M: Reborrow,    M::Target: AsStorage<VertexPayload<G>>,    G: GraphGeometry, [src]

type Target = VertexPayload<G>

The resulting type after dereferencing.

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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> Same<T> for T

type Output = T

Should always be Self