Skip to main content

HasVertices

Trait HasVertices 

Source
pub trait HasVertices<'a>: Sized {
    type Vertex: IsPoint;
    type VertexTable: IsGeometryTable<Key = PointId, Item = Self::Vertex> + ?Sized + 'a;

    // Required methods
    fn vertex_table(&self) -> &Self::VertexTable;
    fn vertex_table_mut(&mut self) -> &mut Self::VertexTable;
    fn set_vertex_table(&mut self, table: &'a mut Self::VertexTable);

    // Provided methods
    fn vertex_table_size(&self) -> usize { ... }
    fn get_vertex(&self, id: &PointId) -> Option<Self::Vertex> { ... }
    fn contains_vertex(&self, id: &PointId) -> bool { ... }
    fn insert_vertex(
        &mut self,
        id: PointId,
        value: Self::Vertex,
    ) -> Result<(), ErrorsJSL> { ... }
    fn remove_vertex(&mut self, id: &PointId) -> Option<Self::Vertex> { ... }
}
Expand description

Provides access to a borrowed point table.

Required Associated Types§

Source

type Vertex: IsPoint

Point primitive stored in the vertex table.

Source

type VertexTable: IsGeometryTable<Key = PointId, Item = Self::Vertex> + ?Sized + 'a

Borrowed point-table type.

Required Methods§

Source

fn vertex_table(&self) -> &Self::VertexTable

Returns an immutable reference to the vertex table.

Source

fn vertex_table_mut(&mut self) -> &mut Self::VertexTable

Returns a mutable reference to the vertex table.

Source

fn set_vertex_table(&mut self, table: &'a mut Self::VertexTable)

Rebinds the implementor to a different borrowed vertex table.

Provided Methods§

Source

fn vertex_table_size(&self) -> usize

Returns the number of entries in the vertex table.

Source

fn get_vertex(&self, id: &PointId) -> Option<Self::Vertex>

Returns the vertex stored at id.

Source

fn contains_vertex(&self, id: &PointId) -> bool

Returns true if the vertex table contains id.

Source

fn insert_vertex( &mut self, id: PointId, value: Self::Vertex, ) -> Result<(), ErrorsJSL>

Inserts or replaces the vertex stored at id.

Source

fn remove_vertex(&mut self, id: &PointId) -> Option<Self::Vertex>

Removes and returns the vertex stored at id, if present.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a> HasVertices<'a> for Line1D

Source§

impl<'a> HasVertices<'a> for Line2D

Source§

impl<'a> HasVertices<'a> for Line3D

Source§

impl<'a> HasVertices<'a> for Mesh2D

Source§

impl<'a> HasVertices<'a> for PolygonFace2D

Source§

impl<'a> HasVertices<'a> for PolygonFace3D

Source§

impl<'a> HasVertices<'a> for SurfaceMesh3D

Source§

impl<'a> HasVertices<'a> for Tetrahedron3D

Source§

impl<'a> HasVertices<'a> for Triangle2D

Source§

impl<'a> HasVertices<'a> for Triangle3D

Source§

impl<'a> HasVertices<'a> for VolumeMesh3D