logo
pub struct VertexView<B> where
    B: Reborrow,
    B::Target: AsStorage<Vertex<<B as Parametric>::Data>> + Parametric, 
{ /* private fields */ }
Expand description

View of a vertex entity.

See the graph module documentation for more information about views.

Implementations

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

type E3 = Point3<R64>;

let mut graph: MeshGraph<E3> = Cube::new().polygons::<Position<E3>>().collect();
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();
This impl block contains no items.

Reachable API.

Converts the vertex into its outgoing (leading) arc.

Gets the outgoing (leading) arc of the vertex.

Gets the valence of the vertex.

A vertex’s valence is the number of adjacent vertices to which it is connected by arcs. The valence of a vertex is the same as its degree, which is the number of edges to which the vertex is connected.

This impl block contains no items.

Reachable API.

This impl block contains no items.

Reachable API.

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.

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.

Gets an iterator that traverses adjacent vertices by breadth.

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

Gets an iterator that traverses adjacent vertices by depth.

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

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

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

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.

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

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

Removes the vertex.

Any and all dependent entities are 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 entities.

Examples

Removing a corner from a cube by removing its vertex:

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

type E3 = Point3<R64>;

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

Trait Implementations

Immutably borrows from an owned value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.