Trait IsPolygon

Source
pub trait IsPolygon<V> {
    // Required methods
    fn num_segments(&self) -> usize;
    fn segment_vertex_ids(&self, segmentid: SId) -> Result<(VId, VId)>;
    fn segment_vertices(&self, segmentid: SId) -> Result<(V, V)>;
    fn vertex(&self, vertexid: VId) -> Result<V>;

    // Provided method
    fn num_vertices(&self) -> usize { ... }
}
Expand description

IsPolygon is a trait used for closed polygons

Required Methods§

Source

fn num_segments(&self) -> usize

Should return the number of segments within the polygon

Source

fn segment_vertex_ids(&self, segmentid: SId) -> Result<(VId, VId)>

Should return the ids of vertices of the given segment

Source

fn segment_vertices(&self, segmentid: SId) -> Result<(V, V)>

Should return the vertices of the given segment

Source

fn vertex(&self, vertexid: VId) -> Result<V>

Should return the vertex with the given id

Provided Methods§

Source

fn num_vertices(&self) -> usize

Returns the number of vertices within the polygon

Implementors§

Source§

impl<P> IsPolygon<P> for Polygon2D<P>
where P: Is2D + Clone,

Source§

impl<P> IsPolygon<P> for Polygon3D<P>
where P: Is3D + Clone,