pub trait VertexPositions {
    type Element;

    // Required methods
    fn vertex_positions(&self) -> &[Self::Element];
    fn vertex_positions_mut(&mut self) -> &mut [Self::Element];

    // Provided methods
    fn vertex_position_iter(&self) -> Iter<'_, Self::Element> { ... }
    fn vertex_position_iter_mut(&mut self) -> IterMut<'_, Self::Element> { ... }
    fn vertex_position<VI>(&self, vidx: VI) -> Self::Element
       where VI: Into<VertexIndex>,
             Self::Element: Clone { ... }
}
Expand description

An “intrinsic” trait for accessing vertex positions on a mesh. This trait can be implemented automatically by deriving the virtual “Intrinsic” trait and taggin the field with the vertex positions field with the #[intrinsic(VertexPositions)] attribute. Make sure that VertexPositions is in scope, or specify the path in the argument to the intrinsic attribute directly.

Required Associated Types§

Required Methods§

source

fn vertex_positions(&self) -> &[Self::Element]

Vertex positions as a slice of triplets.

source

fn vertex_positions_mut(&mut self) -> &mut [Self::Element]

Vertex positions as a mutable slice of triplets.

Provided Methods§

source

fn vertex_position_iter(&self) -> Iter<'_, Self::Element>

Vertex iterator.

source

fn vertex_position_iter_mut(&mut self) -> IterMut<'_, Self::Element>

Mutable vertex iterator.

source

fn vertex_position<VI>(&self, vidx: VI) -> Self::Element
where VI: Into<VertexIndex>, Self::Element: Clone,

Vertex accessor.

Object Safety§

This trait is not object safe.

Implementors§