Skip to main content

HasFaces

Trait HasFaces 

Source
pub trait HasFaces<'a>: Sized {
    type Point: IsPoint;
    type Normal: IsUnitVector;
    type Face: IsPolygon<'a, Self::Point, Self::Normal>;
    type FaceTable: IsGeometryTable<Key = FaceId, Item = Self::Face> + ?Sized + 'a;

    // Required methods
    fn face_table(&self) -> &Self::FaceTable;
    fn face_table_mut(&mut self) -> &mut Self::FaceTable;
    fn set_face_table(&mut self, table: &'a mut Self::FaceTable);

    // Provided methods
    fn face_table_size(&self) -> usize { ... }
    fn get_face(&self, id: &FaceId) -> Option<Self::Face> { ... }
    fn contains_face(&self, id: &FaceId) -> bool { ... }
    fn insert_face(
        &mut self,
        id: FaceId,
        value: Self::Face,
    ) -> Result<(), ErrorsJSL> { ... }
    fn remove_face(&mut self, id: &FaceId) -> Option<Self::Face> { ... }
}
Expand description

Provides access to a borrowed polygon-face table.

Required Associated Types§

Source

type Point: IsPoint

Point primitive referenced by the stored faces.

Source

type Normal: IsUnitVector

Unit normal type used by the stored faces.

Source

type Face: IsPolygon<'a, Self::Point, Self::Normal>

Polygon face primitive stored in the face table.

Source

type FaceTable: IsGeometryTable<Key = FaceId, Item = Self::Face> + ?Sized + 'a

Borrowed face-table type.

Required Methods§

Source

fn face_table(&self) -> &Self::FaceTable

Returns an immutable reference to the face table.

Source

fn face_table_mut(&mut self) -> &mut Self::FaceTable

Returns a mutable reference to the face table.

Source

fn set_face_table(&mut self, table: &'a mut Self::FaceTable)

Rebinds the implementor to a different borrowed face table.

Provided Methods§

Source

fn face_table_size(&self) -> usize

Returns the number of entries in the face table.

Source

fn get_face(&self, id: &FaceId) -> Option<Self::Face>

Returns the face stored at id.

Source

fn contains_face(&self, id: &FaceId) -> bool

Returns true if the face table contains id.

Source

fn insert_face( &mut self, id: FaceId, value: Self::Face, ) -> Result<(), ErrorsJSL>

Inserts or replaces the face stored at id.

Source

fn remove_face(&mut self, id: &FaceId) -> Option<Self::Face>

Removes and returns the face 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§